@ckeditor/ckeditor5-real-time-collaboration 44.0.0 → 44.1.0-alpha.1

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 (217) hide show
  1. package/build/real-time-collaboration.js +2 -2
  2. package/dist/augmentation.d.ts +1 -1
  3. package/dist/common-translations.d.ts +1 -1
  4. package/dist/config.d.ts +1 -1
  5. package/dist/index.css +7 -7
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +6 -6
  8. package/dist/presencelist/presencelistui.d.ts +1 -1
  9. package/dist/presencelist/view/presencecounterview.d.ts +1 -1
  10. package/dist/presencelist/view/presencedropdownlistitemview.d.ts +1 -1
  11. package/dist/presencelist/view/presencedropdownlistview.d.ts +1 -1
  12. package/dist/presencelist/view/presenceinlinelistitemview.d.ts +1 -1
  13. package/dist/presencelist/view/presenceinlinelistview.d.ts +1 -1
  14. package/dist/presencelist/view/presencelistview.d.ts +1 -1
  15. package/dist/presencelist.d.ts +1 -1
  16. package/dist/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +1 -1
  17. package/dist/realtimecollaborativecomments.d.ts +1 -1
  18. package/dist/realtimecollaborativeediting/realtimecollaborationclient.d.ts +1 -1
  19. package/dist/realtimecollaborativeediting/sessions.d.ts +1 -1
  20. package/dist/realtimecollaborativeediting/usermarkers.d.ts +1 -1
  21. package/dist/realtimecollaborativeediting/websocketgateway.d.ts +1 -1
  22. package/dist/realtimecollaborativeediting.d.ts +1 -1
  23. package/dist/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +1 -1
  24. package/dist/realtimecollaborativerevisionhistory.d.ts +1 -1
  25. package/dist/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +1 -1
  26. package/dist/realtimecollaborativetrackchanges.d.ts +1 -1
  27. package/dist/translations/af.js +1 -1
  28. package/dist/translations/af.umd.js +1 -1
  29. package/dist/translations/ar.js +1 -1
  30. package/dist/translations/ar.umd.js +1 -1
  31. package/dist/translations/ast.js +1 -1
  32. package/dist/translations/ast.umd.js +1 -1
  33. package/dist/translations/az.js +1 -1
  34. package/dist/translations/az.umd.js +1 -1
  35. package/dist/translations/bg.js +1 -1
  36. package/dist/translations/bg.umd.js +1 -1
  37. package/dist/translations/bn.js +1 -1
  38. package/dist/translations/bn.umd.js +1 -1
  39. package/dist/translations/bs.js +1 -1
  40. package/dist/translations/bs.umd.js +1 -1
  41. package/dist/translations/ca.js +1 -1
  42. package/dist/translations/ca.umd.js +1 -1
  43. package/dist/translations/cs.js +1 -1
  44. package/dist/translations/cs.umd.js +1 -1
  45. package/dist/translations/da.js +1 -1
  46. package/dist/translations/da.umd.js +1 -1
  47. package/dist/translations/de-ch.js +1 -1
  48. package/dist/translations/de-ch.umd.js +1 -1
  49. package/dist/translations/de.js +1 -1
  50. package/dist/translations/de.umd.js +1 -1
  51. package/dist/translations/el.js +1 -1
  52. package/dist/translations/el.umd.js +1 -1
  53. package/dist/translations/en-au.js +1 -1
  54. package/dist/translations/en-au.umd.js +1 -1
  55. package/dist/translations/en-gb.js +1 -1
  56. package/dist/translations/en-gb.umd.js +1 -1
  57. package/dist/translations/en.js +1 -1
  58. package/dist/translations/en.umd.js +1 -1
  59. package/dist/translations/eo.js +1 -1
  60. package/dist/translations/eo.umd.js +1 -1
  61. package/dist/translations/es-co.js +1 -1
  62. package/dist/translations/es-co.umd.js +1 -1
  63. package/dist/translations/es.js +1 -1
  64. package/dist/translations/es.umd.js +1 -1
  65. package/dist/translations/et.js +1 -1
  66. package/dist/translations/et.umd.js +1 -1
  67. package/dist/translations/eu.js +1 -1
  68. package/dist/translations/eu.umd.js +1 -1
  69. package/dist/translations/fa.js +1 -1
  70. package/dist/translations/fa.umd.js +1 -1
  71. package/dist/translations/fi.js +1 -1
  72. package/dist/translations/fi.umd.js +1 -1
  73. package/dist/translations/fr.js +1 -1
  74. package/dist/translations/fr.umd.js +1 -1
  75. package/dist/translations/gl.js +1 -1
  76. package/dist/translations/gl.umd.js +1 -1
  77. package/dist/translations/gu.js +1 -1
  78. package/dist/translations/gu.umd.js +1 -1
  79. package/dist/translations/he.js +1 -1
  80. package/dist/translations/he.umd.js +1 -1
  81. package/dist/translations/hi.js +1 -1
  82. package/dist/translations/hi.umd.js +1 -1
  83. package/dist/translations/hr.js +1 -1
  84. package/dist/translations/hr.umd.js +1 -1
  85. package/dist/translations/hu.js +1 -1
  86. package/dist/translations/hu.umd.js +1 -1
  87. package/dist/translations/hy.js +1 -1
  88. package/dist/translations/hy.umd.js +1 -1
  89. package/dist/translations/id.js +1 -1
  90. package/dist/translations/id.umd.js +1 -1
  91. package/dist/translations/it.js +1 -1
  92. package/dist/translations/it.umd.js +1 -1
  93. package/dist/translations/ja.js +1 -1
  94. package/dist/translations/ja.umd.js +1 -1
  95. package/dist/translations/jv.js +1 -1
  96. package/dist/translations/jv.umd.js +1 -1
  97. package/dist/translations/kk.js +1 -1
  98. package/dist/translations/kk.umd.js +1 -1
  99. package/dist/translations/km.js +1 -1
  100. package/dist/translations/km.umd.js +1 -1
  101. package/dist/translations/kn.js +1 -1
  102. package/dist/translations/kn.umd.js +1 -1
  103. package/dist/translations/ko.js +1 -1
  104. package/dist/translations/ko.umd.js +1 -1
  105. package/dist/translations/ku.js +1 -1
  106. package/dist/translations/ku.umd.js +1 -1
  107. package/dist/translations/lt.js +1 -1
  108. package/dist/translations/lt.umd.js +1 -1
  109. package/dist/translations/lv.js +1 -1
  110. package/dist/translations/lv.umd.js +1 -1
  111. package/dist/translations/ms.js +1 -1
  112. package/dist/translations/ms.umd.js +1 -1
  113. package/dist/translations/nb.js +1 -1
  114. package/dist/translations/nb.umd.js +1 -1
  115. package/dist/translations/ne.js +1 -1
  116. package/dist/translations/ne.umd.js +1 -1
  117. package/dist/translations/nl.js +1 -1
  118. package/dist/translations/nl.umd.js +1 -1
  119. package/dist/translations/no.js +1 -1
  120. package/dist/translations/no.umd.js +1 -1
  121. package/dist/translations/oc.js +1 -1
  122. package/dist/translations/oc.umd.js +1 -1
  123. package/dist/translations/pl.js +1 -1
  124. package/dist/translations/pl.umd.js +1 -1
  125. package/dist/translations/pt-br.js +1 -1
  126. package/dist/translations/pt-br.umd.js +1 -1
  127. package/dist/translations/pt.js +1 -1
  128. package/dist/translations/pt.umd.js +1 -1
  129. package/dist/translations/ro.js +1 -1
  130. package/dist/translations/ro.umd.js +1 -1
  131. package/dist/translations/ru.js +1 -1
  132. package/dist/translations/ru.umd.js +1 -1
  133. package/dist/translations/si.js +1 -1
  134. package/dist/translations/si.umd.js +1 -1
  135. package/dist/translations/sk.js +1 -1
  136. package/dist/translations/sk.umd.js +1 -1
  137. package/dist/translations/sl.js +1 -1
  138. package/dist/translations/sl.umd.js +1 -1
  139. package/dist/translations/sq.js +1 -1
  140. package/dist/translations/sq.umd.js +1 -1
  141. package/dist/translations/sr-latn.js +1 -1
  142. package/dist/translations/sr-latn.umd.js +1 -1
  143. package/dist/translations/sr.js +1 -1
  144. package/dist/translations/sr.umd.js +1 -1
  145. package/dist/translations/sv.js +1 -1
  146. package/dist/translations/sv.umd.js +1 -1
  147. package/dist/translations/th.js +1 -1
  148. package/dist/translations/th.umd.js +1 -1
  149. package/dist/translations/ti.js +1 -1
  150. package/dist/translations/ti.umd.js +1 -1
  151. package/dist/translations/tk.js +1 -1
  152. package/dist/translations/tk.umd.js +1 -1
  153. package/dist/translations/tr.js +1 -1
  154. package/dist/translations/tr.umd.js +1 -1
  155. package/dist/translations/tt.js +1 -1
  156. package/dist/translations/tt.umd.js +1 -1
  157. package/dist/translations/ug.js +1 -1
  158. package/dist/translations/ug.umd.js +1 -1
  159. package/dist/translations/uk.js +1 -1
  160. package/dist/translations/uk.umd.js +1 -1
  161. package/dist/translations/ur.js +1 -1
  162. package/dist/translations/ur.umd.js +1 -1
  163. package/dist/translations/uz.js +1 -1
  164. package/dist/translations/uz.umd.js +1 -1
  165. package/dist/translations/vi.js +1 -1
  166. package/dist/translations/vi.umd.js +1 -1
  167. package/dist/translations/zh-cn.js +1 -1
  168. package/dist/translations/zh-cn.umd.js +1 -1
  169. package/dist/translations/zh.js +1 -1
  170. package/dist/translations/zh.umd.js +1 -1
  171. package/package.json +9 -9
  172. package/src/augmentation.d.ts +1 -1
  173. package/src/common-translations.d.ts +1 -1
  174. package/src/common-translations.js +1 -1
  175. package/src/config.d.ts +1 -1
  176. package/src/index.d.ts +1 -1
  177. package/src/index.js +1 -1
  178. package/src/presencelist/presencelistui.d.ts +1 -1
  179. package/src/presencelist/presencelistui.js +1 -1
  180. package/src/presencelist/view/presencecounterview.d.ts +1 -1
  181. package/src/presencelist/view/presencecounterview.js +1 -1
  182. package/src/presencelist/view/presencedropdownlistitemview.d.ts +1 -1
  183. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  184. package/src/presencelist/view/presencedropdownlistview.d.ts +1 -1
  185. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  186. package/src/presencelist/view/presenceinlinelistitemview.d.ts +1 -1
  187. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  188. package/src/presencelist/view/presenceinlinelistview.d.ts +1 -1
  189. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  190. package/src/presencelist/view/presencelistview.d.ts +1 -1
  191. package/src/presencelist/view/presencelistview.js +1 -1
  192. package/src/presencelist.d.ts +1 -1
  193. package/src/presencelist.js +1 -1
  194. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +1 -1
  195. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
  196. package/src/realtimecollaborativecomments.d.ts +1 -1
  197. package/src/realtimecollaborativecomments.js +1 -1
  198. package/src/realtimecollaborativeediting/realtimecollaborationclient.d.ts +1 -1
  199. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
  200. package/src/realtimecollaborativeediting/sessions.d.ts +1 -1
  201. package/src/realtimecollaborativeediting/sessions.js +1 -1
  202. package/src/realtimecollaborativeediting/usermarkers.d.ts +1 -1
  203. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  204. package/src/realtimecollaborativeediting/websocketgateway.d.ts +1 -1
  205. package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
  206. package/src/realtimecollaborativeediting.d.ts +1 -1
  207. package/src/realtimecollaborativeediting.js +1 -1
  208. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +1 -1
  209. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
  210. package/src/realtimecollaborativerevisionhistory.d.ts +1 -1
  211. package/src/realtimecollaborativerevisionhistory.js +1 -1
  212. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +1 -1
  213. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
  214. package/src/realtimecollaborativetrackchanges.d.ts +1 -1
  215. package/src/realtimecollaborativetrackchanges.js +1 -1
  216. package/theme/presencelist.css +1 -1
  217. package/theme/usermarkers.css +1 -1
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0x177b39,Plugin as _0x43c3db,PendingActions as _0x3d4151,Context as _0x9c56a2}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x12f48c,CKEditorError as _0x5d8b9a,Collection as _0x3ff178,global as _0x504372,version as nt,uid as _0x32829f,KeystrokeHandler as _0x92184c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x4df19c,View as _0x55b472,ListView as _0x579ca9,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x49e7cd,clickOutsideHandler as _0x4e240f,BodyCollection as _0x46ebeb}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x1ee3da,NoOperation as _0x3bf8d7,InsertOperation as _0x5ab76f,MarkerOperation as _0x4c2122,RootAttributeOperation as _0x10a96a,transformSets as _0x12ee36,OperationFactory as _0x33c4af}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x5957c6,CollaborativeEditingService as _0x5b024c,User as dt,CommentsService as _0x2c8285,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x1ab8ea,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0xfccb76}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x1a2d9d}from'lodash-es';class c extends _0x177b39{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x4df19c];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xc2747d){super(_0xc2747d),this['set']('state',_0x5957c6['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x12f48c);}['init'](){const _0x124deb=this['context'],_0x2836a0=_0x124deb['plugins']['get']('CloudServices'),_0x3fdba5=_0x124deb['plugins']['get'](_0x4df19c);if(!_0x2836a0['token'])throw new _0x5d8b9a('websocketgateway-missing-token',this);if(!_0x2836a0['webSocketUrl'])throw new _0x5d8b9a('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'](_0x2836a0['token'],_0x2836a0['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x3b7043=>{if(this['connection']=_0x3b7043,this['bind']('state')['to'](_0x3b7043,'state',this,'_isBrowserOffline',(_0x207418,_0x1ef8f4)=>('connected'!==_0x207418&&(this['_shouldPluginsReconnect']=!0x0),_0x1ef8f4||_0x207418!==_0x5957c6['CONNECTED']?_0x5957c6['DISCONNECTED']:this['state']==_0x5957c6['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x5957c6['CONNECTING']):_0x5957c6['CONNECTED'])),this['connection']['on']('error',(_0x54ffe5,_0x3a4249)=>{if('limitExceeded'!==_0x3a4249['code'])throw console['error'](_0x3a4249),new _0x5d8b9a('cloudservices-init',null,{'originalError':_0x3a4249});_0x3fdba5['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'});}),!_0x3b7043['me'])return new Promise(_0x35c1f1=>_0x3b7043['on']('change:me',_0x35c1f1));})['catch'](_0x3c03cb=>{throw console['error'](_0x3c03cb),new _0x5d8b9a('cloudservices-init',null,{'originalError':_0x3c03cb});});}['addToReconnectionStack'](_0x5d75d3){if('function'!=typeof _0x5d75d3['reconnect'])throw new _0x5d8b9a('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5d75d3))throw new _0x5d8b9a('websocketgateway-plugin-already-registered',this,{'name':_0x5d75d3['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5d75d3);}['removeFromReconnectionStack'](_0x4dbf04){this['_reconnectionStack']['delete'](_0x4dbf04);}['isInReconnectionStack'](_0x2e6a6){return this['_reconnectionStack']['has'](_0x2e6a6);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x5b7c43=>_0x5b7c43['reconnect']())))['then'](()=>this['state']=_0x5957c6['CONNECTED'])['catch'](_0x1c16e6=>{throw console['error'](_0x1c16e6),new _0x5d8b9a('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x5957c6['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x177b39{['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,_0x1ab8ea];}constructor(_0x9ab835){super(_0x9ab835),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x3ff178(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1ab8ea);}['init'](){const _0x31d2e7=this['context']['plugins']['get'](c);this['listenTo'](_0x31d2e7,'change:state',(_0x1f92ff,_0x55d162,_0x20b941)=>{if('connected'!==_0x20b941)this['channelSessions']['forEach'](_0xd36c9b=>_0xd36c9b['clear']()),this['channelConnectedUsers']['forEach'](_0x3a28d8=>_0x3a28d8['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x287ecc,_0x5f1068]of this['_registeredSessions'])for(const _0x52993b of _0x5f1068)this['_handleSessionAdd'](_0x287ecc,_0x52993b);}}),this['_createUser'](_0x31d2e7['connection']['me'],!0x0);}['register'](_0x5eb4a8,_0x5bde78){if(this['_registeredSessions']['has'](_0x5eb4a8))throw new _0x5d8b9a('sessions-register-already-registered',null,{'channelId':_0x5eb4a8});this['_registeredSessions']['set'](_0x5eb4a8,_0x5bde78),this['channelSessions']['set'](_0x5eb4a8,new _0x3ff178()),this['channelConnectedUsers']['set'](_0x5eb4a8,new _0x3ff178()),this['listenTo'](_0x5bde78,'add',(_0x1f489a,_0x47a119)=>this['_handleSessionAdd'](_0x5eb4a8,_0x47a119)),this['listenTo'](_0x5bde78,'remove',(_0x3398ad,_0xd443ce)=>this['_handleSessionRemove'](_0x5eb4a8,_0xd443ce));for(const _0x1ee82f of _0x5bde78)this['_handleSessionAdd'](_0x5eb4a8,_0x1ee82f);}['unregister'](_0x21d353){if(!this['_registeredSessions']['has'](_0x21d353))throw new _0x5d8b9a('sessions-unregister-not-exist',null,{'channelId':_0x21d353});const _0x4f2095=this['_registeredSessions']['get'](_0x21d353);this['stopListening'](_0x4f2095);for(const _0x17fc17 of _0x4f2095)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x21d353,_0x17fc17);this['_registeredSessions']['delete'](_0x21d353),this['channelSessions']['delete'](_0x21d353),this['channelConnectedUsers']['delete'](_0x21d353);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x3bf925){for(const _0x4f7812 of this['channelSessions']['values']())for(const _0x2af19f of _0x4f7812)if(_0x2af19f['id']===_0x3bf925)return _0x2af19f['user'];}['getUserSessions'](_0x25a7a2,_0x197819){const _0x40bb97=_0x197819?[this['channelSessions']['get'](_0x197819)]:this['channelSessions']['values'](),_0x32721d=new Set();for(const _0x5a39b4 of _0x40bb97)for(const _0x5557e9 of _0x5a39b4)_0x5557e9['user']['id']===_0x25a7a2['id']&&_0x32721d['add'](_0x5557e9['id']);return _0x32721d;}['getUserRole'](_0x10d0ef){for(const _0x28c955 of this['channelSessions']['values']())for(const _0x2eae72 of _0x28c955)if(_0x2eae72['user']===_0x10d0ef)return _0x2eae72['role'];}['_handleSessionAdd'](_0x47d65b,_0x48fa49){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x2f1d3c=_0x48fa49['user'],_0x1bf9cb=this['_users']['getUser'](_0x2f1d3c['id'])||this['_createUser'](_0x2f1d3c),_0x1680a0=Object['assign']({},_0x48fa49,{'user':_0x1bf9cb});this['channelSessions']['get'](_0x47d65b)['add'](_0x1680a0);const _0x3e867f=this['channelConnectedUsers']['get'](_0x47d65b);_0x3e867f['has'](_0x1bf9cb['id'])||_0x3e867f['add'](_0x1bf9cb),this['allConnectedUsers']['has'](_0x1bf9cb['id'])||this['allConnectedUsers']['add'](_0x1bf9cb,_0x1bf9cb['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x47d65b,{'channelId':_0x47d65b,'session':_0x1680a0});}['_handleSessionRemove'](_0x8b36b3,_0x13b2a6){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x11ae36=this['channelConnectedUsers']['get'](_0x8b36b3),_0x222b2c=_0x13b2a6['user'];_0x222b2c['id']&&(this['channelSessions']['get'](_0x8b36b3)['remove'](_0x13b2a6['id']),_0x11ae36['has'](_0x222b2c['id'])&&!this['getUserSessions'](_0x222b2c,_0x8b36b3)['size']&&_0x11ae36['remove'](_0x222b2c['id']),this['allConnectedUsers']['get'](_0x222b2c['id'])&&!this['getUserSessions'](_0x222b2c)['size']&&this['allConnectedUsers']['remove'](_0x222b2c['id']));}['_createUser'](_0x3d62d5,_0x3f21c9){const _0xbc16e0=this['_users']['addUser'](_0x3d62d5);return _0x3f21c9&&this['_users']['defineMe'](_0x3d62d5['id']),_0xbc16e0['orderNumber']=this['_uniqueUsersCount']++,_0xbc16e0;}}class H extends _0x43c3db{['_domEmitter']=new(_0x12f48c())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x220c06=this['editor'],_0x345407=_0x220c06['plugins']['get'](i);_0x220c06['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x1b5430,{writer:_0x40ffc1})=>function(_0x1d5e72,_0x2c0b10,_0x3f8af7,_0x203aa3){const _0x375e42=_0x1d5e72['markerName']['split'](':')[0x2],_0x45107b=_0x3f8af7['getUserBySessionId'](_0x375e42);if(!_0x45107b||_0x375e42===_0x3f8af7['mySessionId'])return;if(!_0x203aa3['model']['schema']['checkChild'](_0x1d5e72['markerRange']['start'],'$text'))return;const _0x540f6a={'class':'ck-user__marker\x20'+_0x45107b['color']['getMarkerClass'](),'data-name':_0x45107b['name'],'data-session-id':_0x375e42},_0x24826d=_0x203aa3['model']['markers']['get'](_0x1d5e72['markerName']),_0x1f7e6e=_0x24826d['getStart'](),_0x43e2b3=_0x1f7e6e['nodeAfter'],_0x3c993c=_0x203aa3['model']['schema'];if(_0x43e2b3&&_0x3c993c['isObject'](_0x43e2b3)&&_0x3c993c['isInline'](_0x43e2b3)&&!_0x203aa3['model']['markers']['get']('user:range:'+_0x375e42)['getRange']()['isCollapsed'])return;const _0x2bd6df=_0x1f7e6e['parent'];return _0x203aa3['model']['schema']['isLimit'](_0x2bd6df)&&!_0x203aa3['model']['hasContent'](_0x2bd6df)&&(_0x540f6a['contenteditable']=!0x1),function(_0x33023e,_0x308284,_0x58590b){const _0x2a6fc7=_0x33023e['createUIElement']('span',_0x308284);return _0x33023e['setCustomProperty']('userPositionMarker',!0x0,_0x2a6fc7),_0x2a6fc7['render']=function(_0x4355e0){const _0x43be2c=this['toDomElement'](_0x4355e0);return _0x43be2c['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>'+_0x58590b['name']+'</span>⁠',_0x43be2c['addEventListener']('mouseenter',()=>{_0x43be2c['classList']['add']('ck-user__marker_hovered');}),_0x43be2c['addEventListener']('mouseleave',()=>{_0x43be2c['classList']['remove']('ck-user__marker_hovered');}),_0x43be2c;},_0x2a6fc7['isSimilar']=function(_0x1fc5bd){return!(!this['getCustomProperty']('userPositionMarker')||!_0x1fc5bd['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x1fc5bd['getAttribute']('data-session-id'));},_0x2a6fc7;}(_0x2c0b10,_0x540f6a,_0x45107b);}(_0x1b5430,_0x40ffc1,_0x345407,_0x220c06)}),_0x220c06['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x28a342=>function(_0x42fef0,_0x15e396){const _0x55c078=_0x42fef0['markerName']['split'](':')[0x2];if(_0x55c078===_0x15e396['mySessionId'])return null;const _0x3e5988=_0x15e396['getUserBySessionId'](_0x55c078);if(!_0x3e5988)return{'id':_0x55c078,'classes':[]};return{'id':_0x55c078,'classes':['ck-user__selection',_0x3e5988['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x55c078},'priority':0x7d0+_0x3e5988['orderNumber']};}(_0x28a342,_0x345407)}),function(_0x104b92){const _0x2ca654=_0x104b92['model'],_0x406c83=new Map(),_0x1b3889=_0x104b92['plugins']['get'](i);_0x2ca654['markers']['on']('update:user:range',(_0x4eb096,_0x436447,_0x1bf976,_0x564a13)=>{if(!_0x564a13&&_0x406c83['get'](_0x436447['name']))return _0x406c83['get'](_0x436447['name'])['detach'](),void _0x406c83['delete'](_0x436447['name']);const _0x18dddc=_0x436447['name']['split'](':')[0x2];if(_0x18dddc===_0x1b3889['mySessionId'])return;const _0x5486eb='user:position:'+_0x18dddc;_0x2ca654['markers']['has'](_0x5486eb)&&_0x104b92['editing']['reconvertMarker'](_0x5486eb),_0x436447['on']('change:range',(_0x5e55d3,_0x2a475b,_0x1b8cf7)=>{if('$graveyard'!=_0x2a475b['root']['rootName']&&'$graveyard'==_0x436447['getRange']()['root']['rootName']&&!_0x406c83['has'](_0x436447['name'])){const _0x469739=_0x2ca654['schema']['getNearestSelectionRange'](_0x1b8cf7['deletionPosition']);if(_0x469739){const _0x170aa3=ht['fromRange'](_0x469739);_0x406c83['set'](_0x436447['name'],_0x170aa3),_0x170aa3['on']('change:range',(_0x4ac983,_0x3c8d7c,_0x20c18b)=>{if('$graveyard'==_0x170aa3['root']['rootName']){const _0x156e76=_0x2ca654['schema']['getNearestSelectionRange'](_0x20c18b['deletionPosition']);_0x156e76?(_0x170aa3['start']=_0x156e76['start'],_0x170aa3['end']=_0x156e76['end']):(_0x406c83['delete'](_0x436447['name']),_0x170aa3['detach']());}});}}});}),_0x2ca654['document']['on']('change',()=>{_0x406c83['size']>0x0&&_0x2ca654['enqueueChange']({'isUndoable':!0x1},_0xc342bf=>{for(const [_0x2efb41,_0x1dc1d5]of _0x406c83)'$graveyard'==_0x2ca654['markers']['get'](_0x2efb41)['getRange']()['root']['rootName']&&(re(_0x2efb41['split'](':')[0x2],_0x1dc1d5['toRange'](),_0x2ca654,_0xc342bf),_0x1dc1d5['detach']());_0x406c83['clear']();});});}(_0x220c06),this['_domEmitter']['listenTo'](_0x504372['document'],'keydown',(_0x1ac72c,{key:_0x58af81})=>{'Escape'===_0x58af81&&function(_0xfc8d08){_0xfc8d08['editing']['view']['change'](_0x10addf=>{for(const _0x2d2de0 of _0xfc8d08['model']['markers']){if(!_0x2d2de0['name']['startsWith']('user:position'))continue;const _0x4bff27=_0xfc8d08['editing']['mapper']['markerNameToElements'](_0x2d2de0['name']);if(_0x4bff27){for(const _0x129a2c of _0x4bff27)_0x10addf['removeClass']('ck-user__marker_hovered',_0x129a2c);}}});}(_0x220c06);},{'useCapture':!0x0});}['afterInit'](){const _0x2944d9=this['editor'],_0x6d7460=_0x2944d9['commands']['get']('undo');_0x6d7460&&_0x2944d9['model']['on']('applyOperation',(_0x161f3d,_0x58fa15)=>{const _0x188c0f=_0x58fa15[0x0];if('marker'!=_0x188c0f['type']||!_0x188c0f['name']['startsWith']('user:'))return;const _0x4d9200=_0x188c0f['batch'];_0x6d7460['_createdBatches']['has'](_0x4d9200)&&(_0x188c0f['newRange']=_0x188c0f['oldRange']?_0x2944d9['model']['createRange'](_0x188c0f['oldRange']['start'],_0x188c0f['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x37607c=this['editor'],_0x27339b=_0x37607c['model']['document'],_0x4f577a=_0x37607c['plugins']['get'](i);_0x37607c['model']['enqueueChange']({'isUndoable':!0x1},_0x451b7d=>{const _0x2da580='user:range:'+_0x4f577a['mySessionId'],_0x4e398b='user:position:'+_0x4f577a['mySessionId'],_0x484d78=_0x37607c['model']['markers']['has'](_0x2da580);_0x37607c['editing']['view']['hasDomSelection']?re(_0x4f577a['mySessionId'],_0x27339b['selection']['getFirstRange'](),_0x37607c['model'],_0x451b7d):_0x484d78&&(_0x451b7d['removeMarker'](_0x2da580),_0x451b7d['removeMarker'](_0x4e398b));});}}function re(_0x23d0c4,_0x5e4528,_0x2743d8,_0x148087){const _0x4c3e4d='user:range:'+_0x23d0c4,_0x2bb800='user:position:'+_0x23d0c4,_0x2b0c5a=_0x5e4528['getContainedElement']();let _0x59a4d2=_0x5e4528['start'];_0x2b0c5a&&_0x2b0c5a['is']('element','tableCell')&&(_0x59a4d2=function(_0x5e5eb1,_0x193edb){for(const _0x46d7cb of _0x5e5eb1['getPositions']())if(_0x193edb['schema']['checkChild'](_0x46d7cb,'$text'))return _0x46d7cb;}(_0x5e4528,_0x2743d8),_0x5e4528=_0x148087['createRange'](_0x59a4d2));const _0x9e890b=_0x148087['createRange'](_0x59a4d2);_0x2743d8['markers']['has'](_0x4c3e4d)?(_0x148087['updateMarker'](_0x4c3e4d,{'range':_0x5e4528}),_0x148087['updateMarker'](_0x2bb800,{'range':_0x9e890b})):(_0x148087['addMarker'](_0x4c3e4d,{'range':_0x5e4528,'usingOperation':!0x0}),_0x148087['addMarker'](_0x2bb800,{'range':_0x9e890b,'usingOperation':!0x0}));}function q(_0x337d9c,_0x20fb52,_0xdb3976){const _0x14fdf4=_0x337d9c['t'],t=_0x337d9c['t'];switch(_0x20fb52){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 _0x14fdf4({'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'},_0xdb3976);default:return'';}}let K=0x1;class l extends _0x43c3db{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x5b024c)());['_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,_0x3d4151,_0x1ab8ea,_0x4df19c];}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 _0x57410c=this['serverHistory']['getOperations']();for(let _0x434f13=_0x57410c['length']-0x1;_0x434f13>=0x0;_0x434f13--){const _0x267230=_0x57410c[_0x434f13];if(!this['_disconnectionOperations']['has'](_0x267230))return _0x267230['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x3bc1c3){if(super(_0x3bc1c3),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x1ee3da(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x5d8b9a('collaboration-missing-channelid',this);const _0x13809f=_0x3bc1c3['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x13809f,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0xfccb76(),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 _0x41b9fc=this['editor'],_0x3e6037=_0x41b9fc['plugins']['get'](_0x1ab8ea),_0x4254d0=_0x41b9fc['plugins']['get'](c);this['listenTo'](_0x3e6037,'getOperationAuthor',(_0x10f799,_0x24eb6e)=>{const _0x1e5a88=_0x24eb6e[0x0];_0x1e5a88['_authorId']&&(_0x10f799['return']=_0x3e6037['getUser'](_0x1e5a88['_authorId']),_0x10f799['stop']()),null===_0x1e5a88['_authorId']&&(_0x10f799['return']=null,_0x10f799['stop']());},{'priority':'high'}),this['listenTo'](_0x41b9fc['model']['document']['selection'],'change:range',(_0x32fd50,_0x157562)=>{_0x157562['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x41b9fc['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x41b9fc['model']['on']('applyOperation',(_0x2c90a0,_0x3eb94d)=>{const _0x2072b4=_0x3eb94d[0x0];_0x2072b4['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2072b4),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x4254d0,'state',this,'_hasSynchronizationProblem',(_0x483ff7,_0x193a82)=>'connected'===_0x483ff7&&!_0x193a82),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x41b9fc['disableReadOnlyMode']('rtc-offline'):_0x41b9fc['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x41b9fc['disableReadOnlyMode']('rtc-offline'):_0x41b9fc['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x1b5414=this['editor']['plugins']['get'](i),_0x330f8b=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x1b5414['unregister'](this['_channelId']);const _0x299ab8=await this['_service']['reconnect'](_0x330f8b['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x299ab8)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x1b1c2f=await this['_service']['getConnectedSessions']();_0x1b5414['register'](this['_channelId'],_0x1b1c2f),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x1caeb8){if(function(_0x5eecc5){return'404'===_0x5eecc5['code'];}(_0x1caeb8)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x174227){return'409'===_0x174227['code'];}(_0x1caeb8)){const _0x52b003=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'](_0x52b003);}else{if(!(_0x1caeb8 instanceof J))throw _0x1caeb8;this['_handleReconnectionError']();}}}}['destroy'](){const _0x3c9753=this['editor']['plugins']['get'](c),_0x585075=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x585075['channelSessions']['has'](this['_channelId'])&&_0x585075['unregister'](this['_channelId']),_0x3c9753['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4cbafa){if(this['sessionId']!==_0x4cbafa['sessionId']&&this['_lastSyncedOperationId']!==_0x4cbafa['lastOperationId'])throw new J();return this['sessionId']=_0x4cbafa['sessionId'],this['_handleServerResponse']([],{..._0x4cbafa,'wereChangesApplied':!0x1,'data':_0x4cbafa['data']},'reconnect');}async['_connectService'](_0x2a9395,_0x336380=!0x1){const {connection:_0xa0c8a0}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0xa0c8a0,this['_channelId'])['then'](_0x37b1d9=>this['_initSessionsHandling'](_0x37b1d9))['catch'](_0x33ddaf=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x33ddaf);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x26a608,_0x3333fb)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x3333fb);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x42d500=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2a9395);this['_isPendingUpdate']=!0x0;const _0x26d533=await this['_service']['connect'](_0xa0c8a0,this['_compressOperations'](_0x2a9395),_0x42d500);if(this['sessionId']=_0x26d533['sessionId'],_0x336380){if(!_0x26d533['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x26d533['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x2a9395,_0x26d533,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x26d533,_0x2a9395);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x2b88e0=this['editor']['plugins']['get'](i),_0x529ff1=this['editor']['plugins']['get'](H),_0x5cd532=_0x2b88e0['channelSessions']['get'](this['_channelId']);_0x5cd532&&_0x5cd532['length']>0x1?_0x529ff1['createUserMarkerOperations']():this['listenTo'](_0x2b88e0,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x2b88e0['channelSessions']['get'](this['_channelId'])['length']&&_0x529ff1['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x4f09d4,_0x5044a9,_0x41b517,_0x47476c){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x5044a9){const _0x2d7737=this['_decompressOperations'](_0x41b517,_0x47476c);await this['_fetchMissingUsers'](_0x2d7737),this['_handleExternalOperations'](_0x2d7737,_0x5044a9,_0x41b517['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x2cb2ab}=this['editor'];let _0x32e6c6;try{_0x32e6c6=await this['_service']['getDocumentDetails']();}catch(_0x4aade6){const _0x360a13=q(_0x2cb2ab,'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'](_0x360a13);}const _0x2af652=_0x32e6c6['currentDocumentSession']||_0x32e6c6['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x2af652['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x319a99=q(_0x2cb2ab,'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'](_0x319a99);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x4e494d){const _0x4ea790=this['editor']['plugins']['get'](i);this['listenTo'](_0x4ea790,'sessionAdd:'+this['_channelId'],(_0x335b61,{session:_0x2e52f6})=>{if(_0x2e52f6['id']===_0x4ea790['mySessionId']){_0x335b61['off']();const _0x182dbb=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x47015e=_0x2e52f6['permissions'];_0x182dbb&&_0x182dbb['isEnabled']&&(_0x47015e=_0x47015e['filter'](_0x2bf05a=>'document:write'!==_0x2bf05a)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x47015e,this['_channelId']);}}),_0x4ea790['register'](this['_channelId'],_0x4e494d);}['_initThrowingOnDataSet'](){const _0x2507e4=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x28249a)=>{if(!_0x28249a[_0x28249a['length']-0x1]['suppressErrorInCollaboration'])throw new _0x5d8b9a('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2507e4['apply'](this['editor']['data'],_0x28249a);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x59d96c,[_0x56198e])=>{if(this['_document']['version'])throw new _0x5d8b9a('realtimecollaborationclient-init-document-already-initialized',this);_0x59d96c['stop'](),this['_setPendingAction']();const _0x465e88=this['editor']['config']['get']('rootsAttributes'),_0x103d26=this['_getOperationsFromInitData'](_0x56198e,_0x465e88);0x0==_0x103d26['length']&&_0x103d26['push'](new _0x3bf8d7(0x0)),_0x59d96c['return']=this['_connectService'](_0x103d26)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x5b5b18=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x5b5b18))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x508b15,[_0x417044,_0x1cc7a3])=>{_0x508b15['stop']();const _0x378cbc=this['editor']['model']['document']['getRoot'](_0x417044);if(!this['_knownRootNames']['has'](_0x417044)){const _0x2fc970=_0x1cc7a3&&_0x1cc7a3['data']?_0x1cc7a3['data']:'',_0x4acce9=_0x1cc7a3&&_0x1cc7a3['attributes']?_0x1cc7a3['attributes']:{};await this['_loadRoot'](_0x417044,_0x2fc970,_0x4acce9);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x378cbc['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x378cbc);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x50ea6){const _0x387b14=this['editor']['plugins']['get'](_0x1ab8ea),{connection:_0x1bdabc}=this['editor']['plugins']['get'](c),_0x38d5d3=new Set();for(const _0x55c187 of _0x50ea6){const _0x463a98=_0x55c187['_authorId'];_0x463a98&&!_0x387b14['getUser'](_0x463a98)&&_0x38d5d3['add'](_0x463a98);}if(0x0===_0x38d5d3['size'])return;const _0x4f256a=await dt['getMany'](_0x1bdabc,Array['from'](_0x38d5d3));for(const _0x15d146 of _0x4f256a)_0x387b14['getUser'](_0x15d146['id'])||_0x387b14['addUser'](_0x15d146);}['_getOperationsFromInitData'](_0x23fca1,_0x13c2fa={}){const _0x17daeb=this['editor']['model'],_0x42379e=[];let _0x3f2c0b=0x0;const _0x56648f='string'==typeof _0x23fca1?{'main':_0x23fca1}:_0x23fca1;for(const _0x3f4311 of Object['keys'](_0x56648f)){if(!this['_document']['roots']['has'](_0x3f4311))throw new _0x5d8b9a('realtimecollaborationclient-init-non-existent-root',this);const _0x37e2a7=this['editor']['data']['parse'](_0x56648f[_0x3f4311]),_0x5012d9=this['_document']['getRoot'](_0x3f4311),_0x32f9af=new _0x5ab76f(_0x17daeb['createPositionAt'](_0x5012d9,0x0),_0x37e2a7,_0x3f2c0b++);_0x42379e['push'](_0x32f9af);for(const [_0xe4ca4f,_0x13bc11]of _0x37e2a7['markers']){const _0x1a7ae7=_0x17daeb['createRange'](_0x17daeb['createPositionFromPath'](_0x5012d9,_0x13bc11['start']['path']['slice']()),_0x17daeb['createPositionFromPath'](_0x5012d9,_0x13bc11['end']['path']['slice']())),_0x46de8c=new _0x4c2122(_0xe4ca4f,null,_0x1a7ae7,_0x17daeb['markers'],!0x0,_0x3f2c0b++);_0x42379e['push'](_0x46de8c);}}if(_0x13c2fa)for(const [_0x2ca7b0,_0x25ee9e]of Object['entries'](_0x13c2fa)){const _0x18c9ab=_0x17daeb['document']['getRoot'](_0x2ca7b0);if(!_0x18c9ab)throw new _0x5d8b9a('multi-root-editor-root-attributes-no-root',null);for(const [_0x4e00fa,_0x463ad3]of Object['entries'](_0x25ee9e))if(null!==_0x463ad3){const _0x4ca155=new _0x10a96a(_0x18c9ab,_0x4e00fa,null,_0x463ad3,_0x3f2c0b++);_0x42379e['push'](_0x4ca155);}}return _0x42379e;}async['_loadRoot'](_0x50f4ed,_0x4be402,_0x3ab08d){this['_getOperationsFromInitData']({[_0x50f4ed]:_0x4be402},{[_0x50f4ed]:_0x3ab08d})['forEach']((_0x1a5679,_0x68daa6)=>{_0x1a5679['baseVersion']=this['_document']['version']+_0x68daa6,_0x1a5679['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x1a5679);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5a3f10,_0x1019fe){let _0x2de16b;this['_offset']=_0x5a3f10['offset'];const _0x45d062=_0x5a3f10['wereChangesApplied']&&!_0x5a3f10['initData'],_0x262084=_0x45d062?0x0:_0x5a3f10['data']['baseVersion'];if(_0x1019fe['forEach'](_0x164584=>{_0x164584['_isInit']=!0x0,_0x164584['createdAt']=_0x5a3f10['sessionCreatedAt'],_0x164584['_authorId']=null;}),_0x45d062)_0x2de16b=_0x1019fe,this['_applyOperationsSet'](_0x2de16b,_0x45d062);else{if(_0x5a3f10['initData']){const _0x4835ce=this['_getOperationsFromInitData'](_0x5a3f10['initData']);this['_document']['history']['version']=-_0x4835ce['length'],_0x4835ce['forEach'](_0x40f1cb=>{_0x40f1cb['baseVersion']-=_0x4835ce['length'],_0x40f1cb['createdAt']=_0x5a3f10['sessionCreatedAt'],_0x40f1cb['_isInit']=!0x0,_0x40f1cb['_authorId']=null;}),this['_applyOperationsSet'](_0x4835ce,!0x0),this['serverHistory']['version']=-_0x4835ce['length']+this['_offset'],this['_updateServerHistory'](_0x4835ce);}this['_document']['history']['version']=_0x262084,_0x2de16b=this['_decompressOperations'](_0x5a3f10['data'],_0x5a3f10['metadata']),await this['_fetchMissingUsers'](_0x2de16b),this['_applyOperationsSet'](_0x2de16b,_0x45d062);}_0x5a3f10['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2de16b,_0x5a3f10['lastOperationId']),this['_lastSyncedOperationId']=_0x5a3f10['lastOperationId']),this['serverHistory']['version']=_0x262084+this['_offset'],this['_updateServerHistory'](_0x2de16b),_0x1019fe['filter'](_0x5e0478=>{const _0xd1b23a=this['_getAffectedRoot'](_0x5e0478);return _0xd1b23a&&!this['_knownRootNames']['has'](_0xd1b23a);})['forEach']((_0x50dd45,_0xdb4432)=>{_0x50dd45['baseVersion']=this['_document']['version']+_0xdb4432,this['_saveOperationInBuffer'](_0x50dd45);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x220844,_0x460129,_0x4d55d1){throw this['_isPendingUpdate']=!0x0,_0x460129&&console['error'](_0x460129),_0x4d55d1&&this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x5d8b9a(_0x220844,this['editor']);}['_saveOperationInBuffer'](_0x11e53a){this['_knownOperations']['has'](_0x11e53a)||(this['_knownOperations']['add'](_0x11e53a),this['_bufferedOperations']['push'](_0x11e53a),this['_pendingAction']||'marker'==_0x11e53a['type']&&!_0x11e53a['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x3a5133=!0x1){!_0x3a5133&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x4680f7=>{_0x4680f7&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x149cf3=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x1acf91){return _0x1acf91['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1acf91['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x1acf91['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x149cf3)||this['_crash'](_0x149cf3['message'],_0x149cf3,!0x0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x2c8fa3=>{this['on']('change:_isPendingUpdate',()=>{_0x2c8fa3();});});}async['_sendBufferedOperations'](){const _0x5e8b89=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x5e8b89['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x2004c0=[...this['_bufferedOperations']];for(const _0x385c98 of _0x2004c0)_0x385c98['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x385c98);const _0x320e2f=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2004c0),_0x528388=K++,_0x5a876c=this['_compressOperations'](_0x2004c0),_0xd653b6=await this['_service']['sendOperations'](_0x5a876c,_0x5a876c['baseVersion'],_0x320e2f);try{return await this['_handleServerResponse'](_0x2004c0,_0xd653b6,_0x528388);}catch(_0x367c5a){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x367c5a);}}async['_handleServerResponse'](_0x1f14b6,_0x277796,_0x1a95bb){if('error'in _0x277796)throw _0x277796['error'];let _0x58ef9d=!0x1;if(_0x277796['wereChangesApplied']){_0x277796['lastOperationId']&&(this['_lastSyncedOperationId']=_0x277796['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xfc46c9=>!_0x1f14b6['includes'](_0xfc46c9));for(const _0x46e9e7 of _0x1f14b6)_0x46e9e7['createdAt']='lastOperationAcceptedAt'in _0x277796&&_0x277796['lastOperationAcceptedAt']||void 0x0;Q(_0x1f14b6,_0x277796['version']-_0x1f14b6['length']),this['_updateServerHistory'](_0x1f14b6);const _0x14c4e2=_0x1f14b6['filter'](_0x3b2421=>{if(!_0x3b2421['_isInit'])return!0x1;const _0x4ad3c5=this['_getAffectedRoot'](_0x3b2421);return _0x4ad3c5&&!this['_knownRootNames']['has'](_0x4ad3c5);});Q(_0x14c4e2,this['_document']['version']),this['_applyOperationsSet'](_0x14c4e2),_0x58ef9d=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x91cbcb=this['_decompressOperations'](_0x277796['data'],_0x277796['metadata'])['filter'](_0x57d85f=>_0x57d85f['baseVersion']>=this['_lastServerVersion']);_0x91cbcb['forEach'](_0x3d22b8=>this['_addKnownRoot'](_0x3d22b8)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2512eb=>!_0x2512eb['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x2512eb))),this['_bufferedOperations']['length']&&Q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x91cbcb),_0x58ef9d=this['_handleExternalOperations'](_0x91cbcb,_0x277796['version'],_0x277796['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x58ef9d?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x410ad9,_0x5349c9,_0x588246){try{const _0x364cfb={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x296f6c,operationsB:_0x24d8d7,originalOperations:_0xf4981d}=_0x12ee36(_0x410ad9,this['_bufferedOperations'],_0x364cfb);Q(_0x296f6c,this['_document']['version']),Q(_0x24d8d7,_0x5349c9);for(const _0x3af0c4 of _0x296f6c){const _0x157349=_0xf4981d['get'](_0x3af0c4);_0x3af0c4['_authorId']=_0x157349?_0x157349['_authorId']:null;}_0x588246&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x410ad9,_0x588246),this['_lastSyncedOperationId']=_0x588246),this['_bufferedOperations']=[..._0x24d8d7],this['_applyOperationsSet'](_0x296f6c),this['_updateServerHistory'](_0x410ad9);}catch(_0x22ae56){return console['error'](_0x22ae56),!0x1;}return!0x0;}['_applyOperationsSet'](_0x214681,_0x23a8f5=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x4c9e26=>{for(const _0xb3a221 of _0x214681)this['_knownOperations']['add'](_0xb3a221),this['_addKnownRoot'](_0xb3a221),_0x4c9e26['batch']['addOperation'](_0xb3a221),this['editor']['model']['applyOperation'](_0xb3a221);});}['_addKnownRoot'](_0x2ad508){const _0x588dff=this['_getAffectedRoot'](_0x2ad508);_0x588dff&&this['_knownRootNames']['add'](_0x588dff);}['_getAffectedRoot'](_0x42f27e){let _0x3c869a,_0x217297;switch(_0x42f27e['type']){case'insert':_0x3c869a=_0x42f27e['position']['root'];break;case'marker':if(_0x217297=_0x42f27e['newRange'],!_0x217297)return null;_0x3c869a=_0x217297['root'];break;case'addRootAttribute':_0x3c869a=_0x42f27e['root'];break;case'addRoot':_0x3c869a=_0x42f27e['affectedSelectable'];break;case'move':_0x3c869a=_0x42f27e['targetPosition']['root'];break;default:return null;}return _0x3c869a['rootName'];}['_updateServerHistory'](_0x3363f7){_0x3363f7['forEach'](_0x59b6fb=>{const _0x28aed8=_0x59b6fb['clone']();_0x28aed8['_authorId']=_0x59b6fb['_authorId'],_0x28aed8['_isInit']=!!_0x59b6fb['_isInit'],_0x28aed8['createdAt']=_0x59b6fb['createdAt'],_0x28aed8['baseVersion']+=this['_offset'],_0x59b6fb['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x28aed8),this['serverHistory']['addOperation'](_0x28aed8);});}['_handleReconnectionError'](_0x26229e){const _0x3549f3=this['editor']['plugins']['get']('Notification'),_0x43238e=this['editor']['locale'];_0x26229e||(_0x26229e=q(_0x43238e,'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.')),_0x3549f3['showWarning'](_0x26229e,{'title':q(_0x43238e,'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'](_0x3d4151)['add'](q(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x3d4151)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x3c7c64){const _0x4747fa=_0x3c7c64['map'](_0x4134f5=>_0x4134f5['toJSON']());return this['_compressor']['compress'](_0x4747fa);}['_decompressOperations'](_0x120020,_0x446062){return this['_compressor']['decompress'](_0x120020)['map']((_0x50e66b,_0x6a0698)=>{const _0x5b1ab9='init'==_0x446062[_0x6a0698]['type'];if('InsertOperation'==_0x50e66b['__className']){const _0x2f71ea=_0x50e66b['position']['root'];!this['_document']['getRoot'](_0x2f71ea)&&(this['_document']['createRoot']('$root',_0x2f71ea)['_isAttached']=!0x1);}const _0x22f0b9=_0x33c4af['fromJSON'](_0x50e66b,this['_document']);return _0x22f0b9['wasUndone']=_0x50e66b['wasUndone'],_0x22f0b9['_isInit']=_0x5b1ab9,_0x22f0b9['_authorId']=_0x5b1ab9?null:_0x446062[_0x6a0698]['userId'],_0x22f0b9['_isDisconnection']='cs:removeUser'===_0x446062[_0x6a0698]['type'],_0x22f0b9['createdAt']=_0x446062[_0x6a0698]['createdAt'],_0x22f0b9;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x568b11=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x568b11&&_0x568b11['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class J extends Error{}function Q(_0x1ee079,_0x137c94){for(const _0x4858aa of _0x1ee079)_0x4858aa['baseVersion']=_0x137c94++;}class X{['_ignoredOperations'];['_operationToId'];constructor(_0x33b5ce){this['_ignoredOperations']=_0x33b5ce,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x8ffdeb){let _0x488d28=_0x8ffdeb['length'];for(;_0x488d28--;){const _0x4dc454=_0x8ffdeb[_0x488d28];if(!this['_ignoredOperations']['has'](_0x4dc454)){if(!this['_operationToId']['has'](_0x4dc454)){const _0x343840=_0x32829f()['slice'](0x1,0x12);this['_operationToId']['set'](_0x4dc454,_0x343840);}return this['_operationToId']['get'](_0x4dc454);}}}['setIdForTheLastOperation'](_0x24d77d,_0x18550e){if(!_0x18550e)return;let _0x27bb9c=_0x24d77d['length'];for(;_0x27bb9c--;){const _0x69843c=_0x24d77d[_0x27bb9c];this['_ignoredOperations']['has'](_0x69843c)||this['_operationToId']['set'](_0x69843c,_0x18550e);}}}class n extends _0x43c3db{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x177b39{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x2c8285)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x1ab8ea];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5e73fa){super(_0x5e73fa),this['_services']=new Map();}async['init'](){const _0x513de0=this['context'],_0x4d6030=_0x513de0['plugins']['get']('CommentsRepository');if(_0x513de0['plugins']['get'](c)['addToReconnectionStack'](this),_0x4d6030['adapter']={'addCommentThread':async({channelId:_0x4f8b9b,threadId:_0x1e7f72,comments:_0x3af991,resolvedAt:_0x499fe4,resolvedBy:_0x2f7aad,context:_0x4137d6,attributes:_0x5054a3})=>{const _0x4c0cbb=await this['_getService'](_0x4f8b9b)['addCommentThread']({'commentThreadId':_0x1e7f72,'comments':_0x3af991['map'](_0x1f1b82=>function(_0x1581b9,_0xd7c837,_0x48f144){return{'commentThreadId':_0x48f144,'commentId':_0x1581b9['commentId'],'userId':_0x1581b9['authorId'],'content':_0x1581b9['content'],'documentId':_0xd7c837,'createdAt':_0x1581b9['createdAt'],'attributes':_0x1581b9['attributes']||{}};}(_0x1f1b82,_0x4f8b9b,_0x1e7f72)),'resolvedAt':_0x499fe4,'resolvedBy':_0x2f7aad,'context':_0x4137d6,'attributes':_0x5054a3})['catch'](ut);return{'threadId':_0x4c0cbb['commentThreadId'],'comments':_0x4c0cbb['comments']};},'getCommentThread':async({channelId:_0x162fd7,threadId:_0x3eb324})=>{const _0xcb72d8=await this['_getService'](_0x162fd7)['getCommentThread'](_0x3eb324)['catch'](ut);return _0xcb72d8['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0xcb72d8]),{'threadId':_0xcb72d8['commentThreadId'],'comments':_0xcb72d8['comments']['map'](S),'context':_0xcb72d8['context'],'resolvedAt':_0xcb72d8['resolvedAt'],'resolvedBy':_0xcb72d8['resolvedBy'],'attributes':_0xcb72d8['attributes']||{}});},'updateCommentThread':async({channelId:_0x475a25,threadId:_0x2898a8,context:_0x1c7e32,unlinkedAt:_0x5a55f0,attributes:_0x214132})=>this['_getService'](_0x475a25)['updateCommentThread']({'commentThreadId':_0x2898a8,'context':_0x1c7e32,'attributes':_0x214132,'unlinkedAt':_0x5a55f0})['catch'](B)['catch'](ut),'resolveCommentThread':async({channelId:_0x1203e6,threadId:_0x570ac6})=>{const _0x12d89c=await this['_getService'](_0x1203e6)['resolveCommentThread'](_0x570ac6)['catch'](B)['catch'](ut);return{'threadId':_0x12d89c['commentThreadId'],'resolvedAt':_0x12d89c['resolvedAt'],'resolvedBy':_0x12d89c['resolvedBy']};},'reopenCommentThread':async({channelId:_0x30a662,threadId:_0x4f664e})=>this['_getService'](_0x30a662)['reopenCommentThread'](_0x4f664e)['catch'](B)['catch'](ut),'removeCommentThread':({channelId:_0x1f9aee,threadId:_0x140452})=>this['_getService'](_0x1f9aee)['removeCommentThread'](_0x140452)['catch'](B)['catch'](ut),'addComment':({channelId:_0x1ea914,threadId:_0xca7f95,commentId:_0x39389d,content:_0x5c4817,attributes:_0x3e3d60})=>this['_getService'](_0x1ea914)['addComment'](_0xca7f95,_0x39389d,_0x5c4817,_0x3e3d60)['catch'](ut),'updateComment':({channelId:_0x3699a9,threadId:_0x27daff,commentId:_0x4ceb0c,content:_0x315b95,attributes:_0xc733ec})=>this['_getService'](_0x3699a9)['updateComment'](_0x27daff,_0x4ceb0c,_0x315b95,_0xc733ec)['catch'](B)['catch'](ut),'removeComment':({channelId:_0x38b640,threadId:_0x389086,commentId:_0x7e91e2})=>this['_getService'](_0x38b640)['removeComment'](_0x389086,_0x7e91e2)['catch'](B)['catch'](ut)},_0x513de0 instanceof _0x9c56a2){const _0x17a4a2=_0x513de0['config']['get']('collaboration.channelId'),_0x553ca9=_0x513de0['plugins']['get'](i);await this['_setUpService'](_0x17a4a2);const _0x31ec78=await this['_services']['get'](_0x17a4a2)['getConnectedSessions']();this['listenTo'](_0x553ca9,'sessionAdd:'+_0x17a4a2,(_0x1b7ed3,{session:_0x353ef3})=>{_0x353ef3['id']===_0x553ca9['mySessionId']&&(_0x1b7ed3['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x353ef3['permissions'],_0x17a4a2));}),_0x553ca9['register'](_0x17a4a2,_0x31ec78);}}async['_setUpService'](_0x492fb9){if(this['_services']['has'](_0x492fb9))throw new _0x5d8b9a('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x492fb9});const _0x2fd74f=this['context']['plugins']['get']('CommentsRepository'),_0x327a1e=new a['CommentsService'](_0x492fb9);this['_services']['set'](_0x492fb9,_0x327a1e),this['listenTo'](_0x327a1e,'commentThreadAdded',(_0x8b7264,_0x386777)=>{const {commentThreadId:_0x18165f,documentId:_0x29734f,context:_0x59f185,attributes:_0x17c47a,resolvedAt:_0x1e8b08,resolvedBy:_0x4debc5,comments:_0x2e1f5a}=_0x386777;_0x2fd74f['getCommentThread'](_0x18165f)||_0x2fd74f['addCommentThread']({'threadId':_0x18165f,'channelId':_0x29734f,'comments':_0x2e1f5a?_0x2e1f5a['map'](S):[],'context':_0x59f185,'attributes':_0x17c47a,'resolvedAt':_0x1e8b08,'resolvedBy':_0x4debc5,'isFromAdapter':!0x0});}),this['listenTo'](_0x327a1e,'commentThreadUpdated',(_0x5c3dd0,{commentThreadId:_0x2b5f9d,documentId:_0x2725d1,context:_0x4a8ebe,unlinkedAt:_0x56d252,attributes:_0x2c308a})=>{_0x2fd74f['getCommentThread'](_0x2b5f9d)&&_0x2fd74f['updateCommentThread']({'threadId':_0x2b5f9d,'channelId':_0x2725d1,'context':_0x4a8ebe,'unlinkedAt':_0x56d252,'attributes':_0x2c308a,'isFromAdapter':!0x0});}),this['listenTo'](_0x327a1e,'commentThreadResolved',(_0x2ab54d,{commentThreadId:_0x285a31,resolvedBy:_0x462b18,resolvedAt:_0x1b69f5})=>{const _0x195388=_0x2fd74f['getCommentThread'](_0x285a31);_0x195388&&_0x195388['resolve']({'resolvedBy':_0x462b18,'resolvedAt':_0x1b69f5,'isFromAdapter':!0x0});}),this['listenTo'](_0x327a1e,'commentThreadReopened',(_0x250282,{commentThreadId:_0x3a9a87})=>{const _0x4bce44=_0x2fd74f['getCommentThread'](_0x3a9a87);_0x4bce44&&_0x4bce44['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x327a1e,'commentThreadRemoved',(_0x2e2436,{commentThreadId:_0x4c0551})=>{const _0x59dc16=_0x2fd74f['getCommentThread'](_0x4c0551);_0x59dc16&&_0x59dc16['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x327a1e,'commentAdded',(_0x1fb0e,_0x67c11c)=>{const _0x9733a0=_0x67c11c['commentThreadId'],_0x1d3d46=_0x2fd74f['getCommentThread'](_0x9733a0);_0x1d3d46&&_0x1d3d46['addComment']({...S(_0x67c11c),'isFromAdapter':!0x0});}),this['listenTo'](_0x327a1e,'commentUpdated',(_0x4cb034,{commentThreadId:_0x230ff,commentId:_0x42c329,content:_0x386b6b,attributes:_0x70f918})=>{const _0x3a50fb=_0x2fd74f['getCommentThread'](_0x230ff);if(_0x3a50fb){const _0x34c810=_0x3a50fb['getComment'](_0x42c329);_0x34c810&&_0x34c810['update']({'content':_0x386b6b,'attributes':_0x70f918,'isFromAdapter':!0x0});}}),this['listenTo'](_0x327a1e,'commentRemoved',(_0x14b0eb,{commentThreadId:_0x1b59fb,commentId:_0x7d6209})=>{const _0x42b3ec=_0x2fd74f['getCommentThread'](_0x1b59fb);if(_0x42b3ec){const _0x488c5e=_0x42b3ec['getComment'](_0x7d6209);_0x488c5e&&_0x488c5e['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x492fb9);}['destroy'](){if(this['context']instanceof _0x9c56a2){const _0x57f4e4=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x57f4e4);}}['_terminateService'](_0x5a137b){if(!this['_services']['has'](_0x5a137b))throw new _0x5d8b9a('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x5a137b});this['_getService'](_0x5a137b)['disconnect'](),this['_services']['delete'](_0x5a137b);}async['reconnect'](){for(const _0x2c6da1 of this['_services']['keys']())await this['_connectService'](_0x2c6da1);if(this['context']instanceof _0x9c56a2){const _0x2a80b5=this['context']['config']['get']('collaboration.channelId'),_0x1c5d47=this['context']['plugins']['get'](i);_0x1c5d47['unregister'](_0x2a80b5);const _0x541499=await this['_services']['get'](_0x2a80b5)['getConnectedSessions']();_0x1c5d47['register'](_0x2a80b5,_0x541499);}}async['_connectService'](_0x1e2aa0){const {connection:_0x41e18b}=this['context']['plugins']['get'](c),_0x8dc63=this['context']['plugins']['get']('CommentsRepository'),_0x5b9ed1=this['_services']['get'](_0x1e2aa0),_0x5de4d9=await _0x5b9ed1['connect'](_0x41e18b);await this['_fetchMissingUsersForThreads'](_0x5de4d9);const _0x5176e8=new Set(Array['from'](_0x8dc63['getCommentThreads']({'channelId':_0x1e2aa0}),_0x2794c6=>_0x2794c6['id']));for(const _0x186f0c of _0x5de4d9)_0x186f0c['deletedAt']||_0x5176e8['delete'](_0x186f0c['commentThreadId']);for(const _0x4ff7b0 of _0x5176e8)_0x8dc63['getCommentThread'](_0x4ff7b0)['remove']({'isFromAdapter':!0x0});for(const _0x443605 of _0x5de4d9){let _0x4fcbbc=_0x8dc63['getCommentThread'](_0x443605['commentThreadId']);const {commentThreadId:_0x6fcdc6,context:_0xe50cd1,attributes:_0x28f58e,resolvedBy:_0x21536f,resolvedAt:_0x3054be,unlinkedAt:_0xb0993a,deletedAt:_0xc5fa14}=_0x443605;if(_0xc5fa14)continue;_0x4fcbbc||(_0x4fcbbc=_0x8dc63['addCommentThread']({'channelId':_0x1e2aa0,'threadId':_0x6fcdc6,'context':_0xe50cd1,'attributes':_0x28f58e||{},'resolvedBy':_0x21536f,'resolvedAt':_0x3054be,'unlinkedAt':_0xb0993a,'isFromAdapter':!0x0}));const _0x15ac63=new Set(Array['from'](_0x4fcbbc['comments'],_0x11f068=>_0x11f068['id']));for(const _0x4a1f65 of _0x443605['comments'])_0x15ac63['delete'](_0x4a1f65['commentId']);for(const _0x273519 of _0x15ac63)_0x4fcbbc['getComment'](_0x273519)['remove']({'isFromAdapter':!0x0});for(const _0x2da070 of _0x443605['comments']){const _0x4b3ade=_0x4fcbbc['getComment'](_0x2da070['commentId']);_0x4b3ade?_0x4b3ade['content']!==_0x2da070['content']&&_0x4b3ade['update']({'content':_0x2da070['content'],'isFromAdapter':!0x0}):_0x4fcbbc['addComment'](Object['assign'](S(_0x2da070),{'isFromAdapter':!0x0}));}}}['_getService'](_0x51b2fb){if(!this['_services']['has'](_0x51b2fb))throw new _0x5d8b9a('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x51b2fb});return this['_services']['get'](_0x51b2fb);}async['_fetchMissingUsersForThreads'](_0x39243e){const _0x30068c=this['context']['plugins']['get'](_0x1ab8ea),{connection:_0x3ea921}=this['context']['plugins']['get'](c),_0x45e072=new Set();for(const {resolvedBy:_0x37f5dc,comments:_0x20a102}of _0x39243e){_0x37f5dc&&!_0x30068c['getUser'](_0x37f5dc)&&_0x45e072['add'](_0x37f5dc);for(const {userId:_0xa4d2cc}of _0x20a102)_0x30068c['getUser'](_0xa4d2cc)||_0x45e072['add'](_0xa4d2cc);}if(0x0===_0x45e072['size'])return;const _0xd09dd4=await dt['getMany'](_0x3ea921,Array['from'](_0x45e072));for(const _0x18add1 of _0xd09dd4)_0x30068c['getUser'](_0x18add1['id'])||_0x30068c['addUser'](_0x18add1);}}async function B(_0x145941){if('404'!==_0x145941['code'])throw _0x145941;}function ut(_0x242074){if((_0x59a997=_0x242074)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x59a997['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x59a997['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x59a997;throw _0x242074;}function S(_0x460649){return{'threadId':_0x460649['commentThreadId'],'commentId':_0x460649['commentId'],'content':_0x460649['content'],'createdAt':_0x460649['createdAt'],'authorId':_0x460649['userId'],'attributes':_0x460649['attributes']||{}};}class f extends _0x43c3db{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x250a73){super(_0x250a73);const _0x40c6f1=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x40c6f1);}['init'](){const _0x1d38ae=this['editor']['plugins']['get'](c),_0x42eb55=this['editor']['plugins']['get']('TrackChangesEditing');return _0x42eb55['adapter']={'getSuggestion':async _0x5e70c9=>{await this['_waitForServiceReady']();const _0x13d58a=await this['_trackChangesService']['get'](_0x5e70c9)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x13d58a]),_0x13d58a;},'addSuggestion':async({id:_0x1daa04,type:_0x3f7b50,data:_0x2657a5,originalSuggestionId:_0x438415,attributes:_0x3d4f0d})=>{await this['_waitForServiceReady']();const _0x16750c={'id':_0x1daa04,'type':_0x3f7b50,'data':_0x2657a5,'originalSuggestionId':_0x438415,'attributes':_0x3d4f0d},_0x5c2629=await this['_trackChangesService']['add'](_0x1daa04,_0x3f7b50,_0x2657a5,_0x438415,_0x3d4f0d)['catch'](_0x263f4e=>{if(ft(_0x263f4e))return new Promise(_0x18338a=>{this['_bufferedRequests']['set'](_0x1daa04,{'resolve':_0x18338a,'suggestionData':_0x16750c});});throw _0x263f4e;});return this['_bufferedRequests']['delete'](_0x1daa04),_0x5c2629;},'updateSuggestion':async(_0x173b76,_0x40951b)=>{if(await this['_waitForServiceReady'](),'open'!==_0x40951b['state'])return this['_trackChangesService']['update'](_0x173b76,_0x40951b)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x1014c5,_0x4fa1d9)=>{_0x42eb55['hasSuggestion'](_0x4fa1d9['id'])&&(_0x42eb55['getSuggestion'](_0x4fa1d9['id'])['attributes']=_0x4fa1d9['attributes']);}),this['_trackChangesService']['connect'](_0x1d38ae['connection'])['then'](_0x58aea4=>(_0x1d38ae['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x58aea4)['then'](()=>{for(const _0x41d287 of _0x58aea4){_0x42eb55['addSuggestionData'](_0x41d287)['_saved']=!0x0;}})));}async['reconnect'](){const _0x376868=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x36799b}=this['editor']['plugins']['get'](c),_0x139a7d=await this['_trackChangesService']['connect'](_0x36799b);await this['_fetchMissingUsersForThreads'](_0x139a7d);for(const {suggestionData:_0x5dd4cb,resolve:_0x2997ba}of this['_bufferedRequests']['values']()){let _0x397088=_0x139a7d['find'](_0x4098b0=>_0x4098b0['id']===_0x5dd4cb['id']);_0x397088||(_0x397088=await this['_trackChangesService']['add'](_0x5dd4cb['id'],_0x5dd4cb['type'],_0x5dd4cb['data'],_0x5dd4cb['originalSuggestionId'])),_0x2997ba(_0x397088);}for(const _0x125df0 of _0x139a7d)_0x376868['hasSuggestion'](_0x125df0['id'])||_0x376868['addSuggestionData'](_0x125df0);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x55d905=>{this['listenTo'](this['_trackChangesService'],'connected',_0x12714e=>{_0x12714e['off'](),_0x55d905();});});}async['_fetchMissingUsersForThreads'](_0x532497){const _0x6551f2=this['editor']['plugins']['get'](_0x1ab8ea),{connection:_0x451ad0}=this['editor']['plugins']['get'](c),_0x346849=new Set();for(const {authorId:_0x16f8d5}of _0x532497)_0x6551f2['getUser'](_0x16f8d5)||_0x346849['add'](_0x16f8d5);if(0x0===_0x346849['size'])return;const _0x114430=await dt['getMany'](_0x451ad0,Array['from'](_0x346849));for(const _0x2616d2 of _0x114430)_0x6551f2['getUser'](_0x2616d2['id'])||_0x6551f2['addUser'](_0x2616d2);}}function R(_0x55980f){if(ft(_0x55980f))return new Promise(()=>{});throw _0x55980f;}function ft(_0x4b6bc5){return _0x4b6bc5['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4b6bc5['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x43c3db{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 _0x549c57=this['editor']['plugins']['get'](c),_0x37d81b=this['editor']['plugins']['get']('CommentsEditing'),_0x405021=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x549c57,'change:state',(_0xa27dd7,_0x1fcc02,_0x2ae418)=>{_0x37d81b['isThreadsLoadingPaused']='connected'!==_0x2ae418;});}),this['listenTo'](_0x549c57,'change:state',(_0x2769a8,_0x1a4a35,_0x5008d2)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x5008d2);}),_0x405021['_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 _0x43c3db{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 _0x43c3db{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x1ab8ea];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xac177f){super(_0xac177f);const _0x3e6748=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x3e6748);}async['init'](){const _0x1efeeb=this['editor']['plugins']['get'](l),_0x474c81=_0x1efeeb['serverHistory'],_0x5185ae=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x474c81,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x1efeeb['sessionId']});const _0x3c97eb=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x7ba7e2=await tt['isBundleUploaded'](_0x5185ae['connection'],_0x3c97eb);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x489219})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x489219)),'updateRevisions':async _0x198238=>{await this['_waitForServiceReady']();const _0x3de3ef=this['_revisionTracker']['currentRevision'];if(_0x7ba7e2&&0x1===_0x198238['length']&&_0x198238[0x0]['id']===_0x3de3ef['id'])return _0x198238;for(const _0x3425d4 of _0x198238)_0x3425d4['id']===_0x3de3ef['id']&&(_0x3425d4['isEmptyCurrent']=_0x3425d4['fromVersion']===_0x3425d4['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x198238,this['_lastRequestId'])['then'](_0x142054=>(this['_lastRequestId']=_0x142054,_0x198238))['catch'](_0x4bf5c7=>{if(st(_0x4bf5c7)||'400'===_0x4bf5c7['code']&&void 0x0!==_0x4bf5c7['data']['wrongRequestId']){for(const _0x50d260 of _0x198238){!this['_revisionTracker']['repository']['getRevision'](_0x50d260['id'])||this['_revisionTracker']['_bufferUpdate'](_0x50d260['id'],_0x50d260,!0x1);}if(st(_0x4bf5c7))throw _0x4bf5c7;return _0x198238;}throw _0x4bf5c7;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0xc40968,{revisionsData:_0x39eb86,requestId:_0x219e2f})=>{Math['max'](..._0x39eb86['map'](_0x520110=>_0x520110['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x39eb86,_0x219e2f);}):this['_handleRevisionsUpdate'](_0x39eb86,_0x219e2f);});const {revisions:_0x4dc0d9,requestId:_0x3a740a}=await this['_revisionHistoryService']['connect'](_0x5185ae['connection']);_0x5185ae['addToReconnectionStack'](this),this['_lastRequestId']=_0x3a740a,await this['_fetchMissingUsers'](_0x4dc0d9);for(const _0x58a138 of _0x4dc0d9)this['_revisionTracker']['addRevisionData'](_0x58a138);this['listenTo'](_0x1efeeb,'change:_isConnected',(_0x26140a,_0x234ec0,_0x500a37)=>{_0x500a37&&(this['_oldOffset']=_0x1efeeb['_offset'],_0x26140a['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x5185ae,'state',_0x465ed4=>_0x465ed4===_0x5957c6['CONNECTED']);}async['reconnect'](){const _0xbb42ee=this['editor']['plugins']['get'](c),_0x158685=this['editor']['plugins']['get'](l),_0x4d73ee=async()=>{const _0x3a4c24=this['_revisionTracker']['currentRevision'],_0x3920f1=_0x3a4c24['id'],_0x162e19=_0x3920f1!==_0x158685['sessionId'];if(_0x162e19){const _0x35aa7=_0x158685['_offset']-this['_oldOffset'],_0x1401f5=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x3a4c24['toVersion']+_0x35aa7!==_0x1401f5){const _0x319e07=_0x3a4c24['fromVersion']+_0x35aa7,_0x21face=this['editor']['plugins']['get'](_0x1ab8ea),_0x555e7c=this['_revisionTracker']['buildRevisionData']({'revision':_0x3a4c24,'from':_0x319e07,'to':_0x1401f5});_0x555e7c['id']=_0x3a4c24['id'];const _0x11d660=_0x555e7c['authorsIds']['map'](_0x367815=>_0x21face['getUser'](_0x367815));_0x3a4c24['_update']({..._0x555e7c,'authors':_0x11d660},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x3a4c24['id'],_0x555e7c,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1401f5,(_0x3a4c24['toVersion']===_0x3a4c24['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x3920f1)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x3920f1),this['_revisionTracker']['_createCurrentRevision'](_0x1401f5));}const {revisions:_0x20842a,requestId:_0xced13b}=await this['_revisionHistoryService']['reconnect'](_0xbb42ee['connection'],this['_lastRequestId']);_0x162e19&&_0x20842a['length']>0x0?_0x158685['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x20842a),this['_handleRevisionsUpdate'](_0x20842a,_0xced13b),this['_revisionTracker']['sendBufferedUpdates']());};return _0x158685['_isConnected']?_0x4d73ee():new Promise((_0x56ec0a,_0x328a9e)=>{_0x158685['once']('change:_isConnected',()=>{_0x4d73ee()['then'](_0x56ec0a)['catch'](_0x328a9e);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x50e9e1=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x1bdf83=>{_0x1bdf83['off'](),_0x50e9e1();});});}['_getLatestVersionFromServerOperations'](){const _0x1cbb31=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x3f7fd9 of _0x1cbb31)if('marker'!==_0x3f7fd9['type']||_0x3f7fd9['affectsData'])return _0x3f7fd9['baseVersion']+0x1;}['_getLatestVersion'](){const _0x152828=this['editor']['plugins']['get'](l);return new Promise(_0x13eb6b=>{_0x152828['_isPendingUpdate']?_0x152828['once']('change:_isPendingUpdate',()=>{_0x13eb6b(this['_getLatestVersionFromServerOperations']());}):_0x13eb6b(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x1f111c,_0x1c01ce){const _0xeab0f2=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x1c01ce;for(const _0x382310 of _0x1f111c){const _0x238ad0=_0xeab0f2['getRevision'](_0x382310['id']);if(_0x238ad0){if((_0x382310['fromVersion']||_0x382310['toVersion'])&&(_0x382310['diffData']=null),_0x238ad0===this['_revisionTracker']['currentRevision']){const _0x1d0cf7=Math['max'](_0x238ad0['toVersion'],_0x382310['toVersion']),_0x482e94=Math['max'](_0x238ad0['fromVersion'],_0x382310['fromVersion']);let _0x3aca91;_0x238ad0['toVersion']===_0x382310['toVersion']&&_0x238ad0['fromVersion']===_0x382310['fromVersion']?(_0x3aca91=!0x0,this['_preventResendingRevisionData'](_0x382310)):_0x382310['toVersion']===_0x1d0cf7&&_0x382310['fromVersion']===_0x482e94?_0x3aca91=!0x1:(_0x238ad0['toVersion']===_0x1d0cf7&&_0x238ad0['fromVersion']===_0x482e94||this['_fixRevision']({'revision':_0x238ad0,'from':_0x482e94,'to':_0x1d0cf7}),_0x3aca91=!0x0),_0x3aca91&&(delete _0x382310['fromVersion'],delete _0x382310['toVersion'],delete _0x382310['diffData'],delete _0x382310['createdAt'],delete _0x382310['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x382310),this['_preventResendingRevisionData'](_0x382310);}else this['_revisionTracker']['addRevisionData'](_0x382310);}const _0x19607d=_0xeab0f2['getRevisions']();_0x19607d['reverse']();for(let _0x29121d=0x0;_0x29121d<_0x19607d['length']-0x1;_0x29121d++){const _0x5622de=_0x19607d[_0x29121d],_0x3d83bd=_0x19607d[_0x29121d+0x1];if(_0x5622de['fromVersion']<_0x3d83bd['toVersion']){const _0x41c75d=_0x3d83bd['toVersion'],_0x15223f=Math['max'](_0x41c75d,_0x5622de['toVersion']);this['_fixRevision']({'revision':_0x5622de,'from':_0x41c75d,'to':_0x15223f});}}}['_fixRevision']({revision:_0x2c569d,from:_0x5126c0,to:_0x36ddc6}={}){const _0x4437c0=this['editor']['plugins']['get'](_0x1ab8ea),_0x3f5b85=this['_revisionTracker']['buildRevisionData']({'revision':_0x2c569d,'from':_0x5126c0,'to':_0x36ddc6});_0x3f5b85['authors']=_0x3f5b85['authorsIds']['map'](_0x77285c=>_0x4437c0['getUser'](_0x77285c)),_0x2c569d['_update'](_0x3f5b85);}['_preventResendingRevisionData'](_0x4ba531){const _0x15e610={};_0x15e610['id']=_0x4ba531['id'];for(const _0x1599df of Object['keys'](_0x4ba531))'id'!==_0x1599df&&(_0x15e610[_0x1599df]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x15e610['id'],_0x15e610,!0x0);}async['_fetchMissingUsers'](_0x58dd6b){const _0x17b54d=this['editor']['plugins']['get'](_0x1ab8ea),{connection:_0x3d5139}=this['editor']['plugins']['get'](c),_0x564ff2=new Set();for(const _0x57203c of _0x58dd6b){for(const _0x3ce329 of _0x57203c['authorsIds'])_0x401a3a(_0x3ce329);_0x57203c['creatorId']&&_0x401a3a(_0x57203c['creatorId']);}if(0x0===_0x564ff2['size'])return;const _0x48ae69=await dt['getMany'](_0x3d5139,Array['from'](_0x564ff2));for(const _0x4fffdc of _0x48ae69)_0x17b54d['getUser'](_0x4fffdc['id'])||_0x17b54d['addUser'](_0x4fffdc);function _0x401a3a(_0x24229b){_0x17b54d['getUser'](_0x24229b)||_0x564ff2['add'](_0x24229b);}}}function st(_0x4c61f4){return _0x4c61f4['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x4c61f4['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4c61f4['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x43c3db{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 _0x55b472{constructor(_0xebb5fd){super(_0xebb5fd);const _0x59348c=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x59348c['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x59348c['to']('usersCount',_0x49bee4=>q(_0xebb5fd,'CONNECTED_USERS',_0x49bee4))}]});}}class es extends _0x55b472{['items'];['keystrokes'];constructor(_0x371f02){super(_0x371f02);const _0x606c73=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x92184c(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x606c73['if']('hasPopup'),'aria-expanded':_0x606c73['to']('isExpanded',_0x113e6d=>this['hasPopup']&&String(_0x113e6d)),'aria-label':_0x606c73['to']('hasPopup',_0xf31821=>q(_0x371f02,_0xf31821?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x606c73['to']('hasPopup',_0x7324f2=>!!_0x7324f2&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x606c73['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x3efed2,_0x328231,_0x29cb85)=>{this['element']&&(_0x29cb85?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 _0x55b472{['counterView'];['inlineListView'];constructor(_0x508d95){super(_0x508d95);const _0x42be50=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x508d95),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x2aa13d of this['inlineListView']['items'])_0x2aa13d['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',_0x42be50['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class j extends _0x55b472{['listWrapperView'];constructor(_0x22fcf8,_0x3171ae){super(_0x22fcf8),this['listWrapperView']=new mt(_0x22fcf8,_0x3171ae),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':q(_0x22fcf8,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class mt extends _0x579ca9{constructor(_0x52fbe2,_0x54ce58){super(_0x52fbe2);const _0x1e424d=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x54ce58?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x1e424d['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x1e424d['to']('role'),'aria-label':_0x1e424d['to']('ariaLabel'),'aria-labelledby':_0x1e424d['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x504372['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x397479=this['element'];_0x397479&&(this['_isScrollable']=Math['max'](_0x397479['scrollHeight'],_0x397479['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x11aeaa,_0x163939,_0x2f0684){super(_0x11aeaa);const _0x445186=this['bindTemplate'];this['userView']=new ct(_0x11aeaa,_0x163939);const _0x3a560d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x163939['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x163939['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x163939['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x2f0684&&(_0x3a560d['tag']='button',_0x3a560d['on']={'click':_0x445186['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3a560d);}['focus'](){this['element']['focus']();}}class y extends _0x55b472{['userView'];['markerView'];constructor(_0x2f2d0b,_0x167a52,_0x2df0b3){super(_0x2f2d0b);const _0x907770=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x2f2d0b,_0x167a52),this['markerView']=new at(_0x2f2d0b,_0x167a52);const _0x47b0a0=new ot(_0x2f2d0b);_0x47b0a0['template']['tag']='span',_0x47b0a0['text']=_0x167a52['name'];const _0xda31a2={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x907770['to']('isFocusable',_0x3210b7=>!!_0x3210b7&&0x0),'aria-labelledby':_0x47b0a0['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x907770['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x907770['to']('hasTooltip',_0x388b09=>!_0x388b09),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x47b0a0]};_0x2df0b3&&(_0xda31a2['tag']='button',_0xda31a2['on']={'click':_0x907770['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xda31a2);}}class at extends _0x55b472{constructor(_0x22d24c,_0x657bb1){super(_0x22d24c),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x657bb1['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const A={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x177b39{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x2dee93){super(_0x2dee93),this['context']['config']['define']('presenceList',A);const _0x3ba3c3=_0x2dee93['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x3ba3c3)throw new _0x5d8b9a('presencelist-collapseat-invalid-format',this);if(_0x3ba3c3<0x1)throw new _0x5d8b9a('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x3ff178(),this['balloonPanelView']=new _0x49e7cd(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x3b9cc0 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x3b9cc0);this['listenTo'](this['_allConnectedUsers'],'add',(_0x52d08a,_0x121ccf)=>{this['_handleUserAdd'](_0x121ccf);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x40377f,_0x58532b)=>{this['_handleUserRemove'](_0x58532b);});}['_createView'](){const _0x200d7f=this['context'],_0x2090bb=new L(this['context']['locale']),_0x4e8a06=this['balloonPanelView'];if(!_0x1a2d9d(_0x200d7f['config']['get']('presenceList.container')))throw new _0x5d8b9a('presencelist-missing-container',this);return _0x2090bb['counterView']['bind']('usersCount')['to'](this),_0x2090bb['bind']('isCollapsed')['to'](this,'usersCount',_0x4fef45=>{const {collapseAt:_0x1ca4e3,displayMe:_0x547886}=_0x200d7f['config']['get']('presenceList'),_0x9e96e6=_0x4fef45>=_0x1ca4e3;return _0x2090bb['counterView']['isHidden']=!(0x1==_0x4fef45&&_0x547886||_0x9e96e6),_0x9e96e6||this['hideDropdown'](),_0x9e96e6;}),_0x2090bb['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x46ba1f=>{const _0xbfadc6=_0x200d7f['config']['get']('presenceList'),_0x4023c8=new y(_0x200d7f['locale'],_0x46ba1f,!!_0xbfadc6['onClick']);return _0x4023c8['bind']('hasTooltip')['to'](_0x2090bb,'isCollapsed',_0x49c2dc=>!_0x49c2dc),_0x4023c8['bind']('isFocusable')['to'](_0x2090bb,'isCollapsed',_0xe14ff8=>!_0xe14ff8),_0xbfadc6['onClick']&&this['listenTo'](_0x4023c8,'execute',()=>{this['view']['isCollapsed']||_0xbfadc6['onClick'](_0x46ba1f,_0x4023c8['element']);}),_0x4023c8;}),this['listenTo'](_0x2090bb['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x2090bb['inlineListView']['keystrokes']['set']('Enter',(_0x1897a0,_0x5762f0)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x5762f0());}),_0x2090bb['render'](),_0x4e8a06['render'](),_0x4e240f({'emitter':_0x2090bb,'activator':()=>_0x4e8a06['isVisible'],'contextElements':[_0x4e8a06['element'],_0x2090bb['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x200d7f['config']['get']('presenceList.container')['appendChild'](_0x2090bb['element']),this['_bodyCollection']=new _0x46ebeb(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x2090bb;}['_handleUserAdd'](_0x300c56){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x300c56['isMe'])return;const _0x46c956=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x46c956&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x489211=_0x300c56['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x300c56,_0x489211);}['_handleUserRemove'](_0x524bde){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x524bde['id'])&&(this['currentDisplayedUsers']['remove'](_0x524bde['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x46b9c2 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x46b9c2['id']))return void this['currentDisplayedUsers']['add'](_0x46b9c2,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x18906f=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new j(this['context']['locale'],!!_0x18906f['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x2268f8}=this['presenceDropdownView'];_0x2268f8['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x449dc4=>{if(!_0x18906f['displayMe']&&_0x449dc4['isMe'])return null;const _0x23e435=new k(this['context']['locale'],_0x449dc4,!!_0x18906f['onClick']);return _0x18906f['onClick']&&this['listenTo'](_0x23e435,'execute',()=>{_0x18906f['onClick'](_0x449dc4,_0x23e435['element']);}),_0x23e435;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x2268f8['focus'](),_0x2268f8['checkIfScrollable']();const _0x4588b5=(_0x47aa0f,_0x376eef)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x376eef();};_0x2268f8['keystrokes']['set']('Esc',_0x4588b5),_0x2268f8['keystrokes']['set']('Shift+Tab',_0x4588b5),_0x2268f8['keystrokes']['set']('Tab',(_0x41876c,_0x27fe7f)=>{!function(_0x12a422){const _0x234252=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x306714=>_0x306714+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x32169a=[...document['body']['querySelectorAll'](_0x234252)]['filter'](_0x187009=>_0x187009===document['activeElement']||_0x187009['offsetWidth']+_0x187009['offsetHeight']>0x0)['sort']((_0x15fa2f,_0xad4b4a)=>(_0x15fa2f['tabIndex']||0x0)-(_0xad4b4a['tabIndex']||0x0)),_0x35b883=_0x32169a['indexOf'](_0x12a422),_0x407ef4=_0x32169a[(_0x35b883+0x1)%_0x32169a['length']];_0x407ef4&&_0x407ef4['focus']();}(this['view']['element']),this['hideDropdown'](),_0x27fe7f();}),_0x2268f8['focusTracker']['add'](this['view']['element']),_0x2268f8['focusTracker']['on']('change:isFocused',(_0x5720d2,_0x326302,_0x35502a)=>{_0x35502a||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 _0x177b39{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 _0x2570ba,Plugin as _0x348114,PendingActions as _0x4d25bd,Context as _0xd60d61}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x4c9d2a,CKEditorError as _0x2e3272,Collection as _0x1b4970,global as _0x23615d,version as nt,uid as _0x50f5fd,KeystrokeHandler as _0xd8aef6}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x39ca86,View as _0x3f9851,ListView as _0x3304c8,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x99933,clickOutsideHandler as _0x1b10bb,BodyCollection as _0x4dadbb}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x12abdb,NoOperation as _0x3848dc,InsertOperation as _0x5e3fb9,MarkerOperation as _0x468189,RootAttributeOperation as _0x1fed11,transformSets as _0x2dd9b2,OperationFactory as _0x198c4d}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x1b4187,CollaborativeEditingService as _0x478d92,User as dt,CommentsService as _0xa0ac43,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x1adc04,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x17f265}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x3f492d}from'lodash-es';class c extends _0x2570ba{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x39ca86];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3ca0db){super(_0x3ca0db),this['set']('state',_0x1b4187['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x4c9d2a);}['init'](){const _0x52aa42=this['context'],_0x248ce4=_0x52aa42['plugins']['get']('CloudServices'),_0x398282=_0x52aa42['plugins']['get'](_0x39ca86);if(!_0x248ce4['token'])throw new _0x2e3272('websocketgateway-missing-token',this);if(!_0x248ce4['webSocketUrl'])throw new _0x2e3272('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'](_0x248ce4['token'],_0x248ce4['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x50143e=>{if(this['connection']=_0x50143e,this['bind']('state')['to'](_0x50143e,'state',this,'_isBrowserOffline',(_0x35e524,_0x198855)=>('connected'!==_0x35e524&&(this['_shouldPluginsReconnect']=!0x0),_0x198855||_0x35e524!==_0x1b4187['CONNECTED']?_0x1b4187['DISCONNECTED']:this['state']==_0x1b4187['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x1b4187['CONNECTING']):_0x1b4187['CONNECTED'])),this['connection']['on']('error',(_0xba2678,_0xa24497)=>{if('limitExceeded'!==_0xa24497['code'])throw console['error'](_0xa24497),new _0x2e3272('cloudservices-init',null,{'originalError':_0xa24497});_0x398282['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'});}),!_0x50143e['me'])return new Promise(_0x53b723=>_0x50143e['on']('change:me',_0x53b723));})['catch'](_0x5c8ee4=>{throw console['error'](_0x5c8ee4),new _0x2e3272('cloudservices-init',null,{'originalError':_0x5c8ee4});});}['addToReconnectionStack'](_0x4dca7c){if('function'!=typeof _0x4dca7c['reconnect'])throw new _0x2e3272('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x4dca7c))throw new _0x2e3272('websocketgateway-plugin-already-registered',this,{'name':_0x4dca7c['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x4dca7c);}['removeFromReconnectionStack'](_0x230c14){this['_reconnectionStack']['delete'](_0x230c14);}['isInReconnectionStack'](_0x2816d1){return this['_reconnectionStack']['has'](_0x2816d1);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x2f24de=>_0x2f24de['reconnect']())))['then'](()=>this['state']=_0x1b4187['CONNECTED'])['catch'](_0x3e2481=>{throw console['error'](_0x3e2481),new _0x2e3272('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x1b4187['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x2570ba{['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,_0x1adc04];}constructor(_0x2d1f90){super(_0x2d1f90),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x1b4970(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1adc04);}['init'](){const _0xd98c84=this['context']['plugins']['get'](c);this['listenTo'](_0xd98c84,'change:state',(_0x2152d8,_0x528d2c,_0x22baee)=>{if('connected'!==_0x22baee)this['channelSessions']['forEach'](_0x1d8f4a=>_0x1d8f4a['clear']()),this['channelConnectedUsers']['forEach'](_0x4994fb=>_0x4994fb['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x25318f,_0x38d542]of this['_registeredSessions'])for(const _0x7ac5b7 of _0x38d542)this['_handleSessionAdd'](_0x25318f,_0x7ac5b7);}}),this['_createUser'](_0xd98c84['connection']['me'],!0x0);}['register'](_0x193149,_0x41b3be){if(this['_registeredSessions']['has'](_0x193149))throw new _0x2e3272('sessions-register-already-registered',null,{'channelId':_0x193149});this['_registeredSessions']['set'](_0x193149,_0x41b3be),this['channelSessions']['set'](_0x193149,new _0x1b4970()),this['channelConnectedUsers']['set'](_0x193149,new _0x1b4970()),this['listenTo'](_0x41b3be,'add',(_0x54913b,_0x41f63f)=>this['_handleSessionAdd'](_0x193149,_0x41f63f)),this['listenTo'](_0x41b3be,'remove',(_0x3df78b,_0x1cc673)=>this['_handleSessionRemove'](_0x193149,_0x1cc673));for(const _0x1e324e of _0x41b3be)this['_handleSessionAdd'](_0x193149,_0x1e324e);}['unregister'](_0xb876fd){if(!this['_registeredSessions']['has'](_0xb876fd))throw new _0x2e3272('sessions-unregister-not-exist',null,{'channelId':_0xb876fd});const _0x3c024d=this['_registeredSessions']['get'](_0xb876fd);this['stopListening'](_0x3c024d);for(const _0x51ce93 of _0x3c024d)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0xb876fd,_0x51ce93);this['_registeredSessions']['delete'](_0xb876fd),this['channelSessions']['delete'](_0xb876fd),this['channelConnectedUsers']['delete'](_0xb876fd);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x3e69f2){for(const _0xbab6b1 of this['channelSessions']['values']())for(const _0x38851f of _0xbab6b1)if(_0x38851f['id']===_0x3e69f2)return _0x38851f['user'];}['getUserSessions'](_0x18aa6e,_0x210174){const _0x13ed4c=_0x210174?[this['channelSessions']['get'](_0x210174)]:this['channelSessions']['values'](),_0x44e8f7=new Set();for(const _0xaceb5c of _0x13ed4c)for(const _0x1d6282 of _0xaceb5c)_0x1d6282['user']['id']===_0x18aa6e['id']&&_0x44e8f7['add'](_0x1d6282['id']);return _0x44e8f7;}['getUserRole'](_0x22356e){for(const _0x240eaa of this['channelSessions']['values']())for(const _0x1fb728 of _0x240eaa)if(_0x1fb728['user']===_0x22356e)return _0x1fb728['role'];}['_handleSessionAdd'](_0x2f2aa7,_0x2c586e){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x241cda=_0x2c586e['user'],_0x19a6dc=this['_users']['getUser'](_0x241cda['id'])||this['_createUser'](_0x241cda),_0x55c0a8=Object['assign']({},_0x2c586e,{'user':_0x19a6dc});this['channelSessions']['get'](_0x2f2aa7)['add'](_0x55c0a8);const _0x113cdd=this['channelConnectedUsers']['get'](_0x2f2aa7);_0x113cdd['has'](_0x19a6dc['id'])||_0x113cdd['add'](_0x19a6dc),this['allConnectedUsers']['has'](_0x19a6dc['id'])||this['allConnectedUsers']['add'](_0x19a6dc,_0x19a6dc['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x2f2aa7,{'channelId':_0x2f2aa7,'session':_0x55c0a8});}['_handleSessionRemove'](_0x35411d,_0x4c4188){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x441e57=this['channelConnectedUsers']['get'](_0x35411d),_0x5e5a0c=_0x4c4188['user'];_0x5e5a0c['id']&&(this['channelSessions']['get'](_0x35411d)['remove'](_0x4c4188['id']),_0x441e57['has'](_0x5e5a0c['id'])&&!this['getUserSessions'](_0x5e5a0c,_0x35411d)['size']&&_0x441e57['remove'](_0x5e5a0c['id']),this['allConnectedUsers']['get'](_0x5e5a0c['id'])&&!this['getUserSessions'](_0x5e5a0c)['size']&&this['allConnectedUsers']['remove'](_0x5e5a0c['id']));}['_createUser'](_0x128aa1,_0x185496){const _0x5b82de=this['_users']['addUser'](_0x128aa1);return _0x185496&&this['_users']['defineMe'](_0x128aa1['id']),_0x5b82de['orderNumber']=this['_uniqueUsersCount']++,_0x5b82de;}}class H extends _0x348114{['_domEmitter']=new(_0x4c9d2a())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3992e8=this['editor'],_0x135ebf=_0x3992e8['plugins']['get'](i);_0x3992e8['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x3de16d,{writer:_0x5d7eec})=>function(_0x573370,_0xfc431f,_0x1b378d,_0x2f94a9){const _0x1c6012=_0x573370['markerName']['split'](':')[0x2],_0x52df54=_0x1b378d['getUserBySessionId'](_0x1c6012);if(!_0x52df54||_0x1c6012===_0x1b378d['mySessionId'])return;if(!_0x2f94a9['model']['schema']['checkChild'](_0x573370['markerRange']['start'],'$text'))return;const _0x590d57={'class':'ck-user__marker\x20'+_0x52df54['color']['getMarkerClass'](),'data-name':_0x52df54['name'],'data-session-id':_0x1c6012},_0x580b96=_0x2f94a9['model']['markers']['get'](_0x573370['markerName']),_0x9c78a6=_0x580b96['getStart'](),_0x281d90=_0x9c78a6['nodeAfter'],_0x559ad1=_0x2f94a9['model']['schema'];if(_0x281d90&&_0x559ad1['isObject'](_0x281d90)&&_0x559ad1['isInline'](_0x281d90)&&!_0x2f94a9['model']['markers']['get']('user:range:'+_0x1c6012)['getRange']()['isCollapsed'])return;const _0x34b9d2=_0x9c78a6['parent'];return _0x2f94a9['model']['schema']['isLimit'](_0x34b9d2)&&!_0x2f94a9['model']['hasContent'](_0x34b9d2)&&(_0x590d57['contenteditable']=!0x1),function(_0x15f31a,_0xa89c9c,_0x527cbb){const _0x52b845=_0x15f31a['createUIElement']('span',_0xa89c9c);return _0x15f31a['setCustomProperty']('userPositionMarker',!0x0,_0x52b845),_0x52b845['render']=function(_0xafe3cf){const _0x3c5482=this['toDomElement'](_0xafe3cf);return _0x3c5482['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>'+_0x527cbb['name']+'</span>⁠',_0x3c5482['addEventListener']('mouseenter',()=>{_0x3c5482['classList']['add']('ck-user__marker_hovered');}),_0x3c5482['addEventListener']('mouseleave',()=>{_0x3c5482['classList']['remove']('ck-user__marker_hovered');}),_0x3c5482;},_0x52b845['isSimilar']=function(_0x4372c6){return!(!this['getCustomProperty']('userPositionMarker')||!_0x4372c6['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x4372c6['getAttribute']('data-session-id'));},_0x52b845;}(_0xfc431f,_0x590d57,_0x52df54);}(_0x3de16d,_0x5d7eec,_0x135ebf,_0x3992e8)}),_0x3992e8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x4f05aa=>function(_0x36403f,_0x18f93a){const _0xae48ad=_0x36403f['markerName']['split'](':')[0x2];if(_0xae48ad===_0x18f93a['mySessionId'])return null;const _0x3df567=_0x18f93a['getUserBySessionId'](_0xae48ad);if(!_0x3df567)return{'id':_0xae48ad,'classes':[]};return{'id':_0xae48ad,'classes':['ck-user__selection',_0x3df567['color']['getSelectionClass']()],'attributes':{'data-session-id':_0xae48ad},'priority':0x7d0+_0x3df567['orderNumber']};}(_0x4f05aa,_0x135ebf)}),function(_0x53ad44){const _0x359ba4=_0x53ad44['model'],_0x594e02=new Map(),_0x4ee20b=_0x53ad44['plugins']['get'](i);_0x359ba4['markers']['on']('update:user:range',(_0x3817a9,_0x43068d,_0x54e8c0,_0xf3cc66)=>{if(!_0xf3cc66&&_0x594e02['get'](_0x43068d['name']))return _0x594e02['get'](_0x43068d['name'])['detach'](),void _0x594e02['delete'](_0x43068d['name']);const _0x4c03e4=_0x43068d['name']['split'](':')[0x2];if(_0x4c03e4===_0x4ee20b['mySessionId'])return;const _0x1bb72e='user:position:'+_0x4c03e4;_0x359ba4['markers']['has'](_0x1bb72e)&&_0x53ad44['editing']['reconvertMarker'](_0x1bb72e),_0x43068d['on']('change:range',(_0x5282fc,_0x262784,_0x3c433d)=>{if('$graveyard'!=_0x262784['root']['rootName']&&'$graveyard'==_0x43068d['getRange']()['root']['rootName']&&!_0x594e02['has'](_0x43068d['name'])){const _0x236b83=_0x359ba4['schema']['getNearestSelectionRange'](_0x3c433d['deletionPosition']);if(_0x236b83){const _0x595d01=ht['fromRange'](_0x236b83);_0x594e02['set'](_0x43068d['name'],_0x595d01),_0x595d01['on']('change:range',(_0x51326c,_0x48a0a1,_0x31158a)=>{if('$graveyard'==_0x595d01['root']['rootName']){const _0x43bb0a=_0x359ba4['schema']['getNearestSelectionRange'](_0x31158a['deletionPosition']);_0x43bb0a?(_0x595d01['start']=_0x43bb0a['start'],_0x595d01['end']=_0x43bb0a['end']):(_0x594e02['delete'](_0x43068d['name']),_0x595d01['detach']());}});}}});}),_0x359ba4['document']['on']('change',()=>{_0x594e02['size']>0x0&&_0x359ba4['enqueueChange']({'isUndoable':!0x1},_0x2b17b4=>{for(const [_0x579ac4,_0x46999f]of _0x594e02)'$graveyard'==_0x359ba4['markers']['get'](_0x579ac4)['getRange']()['root']['rootName']&&(re(_0x579ac4['split'](':')[0x2],_0x46999f['toRange'](),_0x359ba4,_0x2b17b4),_0x46999f['detach']());_0x594e02['clear']();});});}(_0x3992e8),this['_domEmitter']['listenTo'](_0x23615d['document'],'keydown',(_0x557bec,{key:_0x98adc7})=>{'Escape'===_0x98adc7&&function(_0x46108a){_0x46108a['editing']['view']['change'](_0x4659f3=>{for(const _0x1c085b of _0x46108a['model']['markers']){if(!_0x1c085b['name']['startsWith']('user:position'))continue;const _0x37f231=_0x46108a['editing']['mapper']['markerNameToElements'](_0x1c085b['name']);if(_0x37f231){for(const _0x18e10f of _0x37f231)_0x4659f3['removeClass']('ck-user__marker_hovered',_0x18e10f);}}});}(_0x3992e8);},{'useCapture':!0x0});}['afterInit'](){const _0x593867=this['editor'],_0x3d4cff=_0x593867['commands']['get']('undo');_0x3d4cff&&_0x593867['model']['on']('applyOperation',(_0x35f639,_0x144741)=>{const _0x31cdf7=_0x144741[0x0];if('marker'!=_0x31cdf7['type']||!_0x31cdf7['name']['startsWith']('user:'))return;const _0x746e=_0x31cdf7['batch'];_0x3d4cff['_createdBatches']['has'](_0x746e)&&(_0x31cdf7['newRange']=_0x31cdf7['oldRange']?_0x593867['model']['createRange'](_0x31cdf7['oldRange']['start'],_0x31cdf7['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x4409c0=this['editor'],_0x49d2a3=_0x4409c0['model']['document'],_0xd1d0e2=_0x4409c0['plugins']['get'](i);_0x4409c0['model']['enqueueChange']({'isUndoable':!0x1},_0x1615f6=>{const _0x3db767='user:range:'+_0xd1d0e2['mySessionId'],_0x4762ae='user:position:'+_0xd1d0e2['mySessionId'],_0x437d89=_0x4409c0['model']['markers']['has'](_0x3db767);_0x4409c0['editing']['view']['hasDomSelection']?re(_0xd1d0e2['mySessionId'],_0x49d2a3['selection']['getFirstRange'](),_0x4409c0['model'],_0x1615f6):_0x437d89&&(_0x1615f6['removeMarker'](_0x3db767),_0x1615f6['removeMarker'](_0x4762ae));});}}function re(_0x2b1549,_0xf20440,_0x214868,_0x21dd28){const _0x2ef6df='user:range:'+_0x2b1549,_0x2dc874='user:position:'+_0x2b1549,_0xdd548f=_0xf20440['getContainedElement']();let _0x2b3ffe=_0xf20440['start'];_0xdd548f&&_0xdd548f['is']('element','tableCell')&&(_0x2b3ffe=function(_0x14a6d9,_0x364180){for(const _0x450668 of _0x14a6d9['getPositions']())if(_0x364180['schema']['checkChild'](_0x450668,'$text'))return _0x450668;}(_0xf20440,_0x214868),_0xf20440=_0x21dd28['createRange'](_0x2b3ffe));const _0x583efc=_0x21dd28['createRange'](_0x2b3ffe);_0x214868['markers']['has'](_0x2ef6df)?(_0x21dd28['updateMarker'](_0x2ef6df,{'range':_0xf20440}),_0x21dd28['updateMarker'](_0x2dc874,{'range':_0x583efc})):(_0x21dd28['addMarker'](_0x2ef6df,{'range':_0xf20440,'usingOperation':!0x0}),_0x21dd28['addMarker'](_0x2dc874,{'range':_0x583efc,'usingOperation':!0x0}));}function q(_0x37c31b,_0x503dec,_0x33f9fc){const _0x555433=_0x37c31b['t'],t=_0x37c31b['t'];switch(_0x503dec){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 _0x555433({'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'},_0x33f9fc);default:return'';}}let K=0x1;class l extends _0x348114{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x478d92)());['_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,_0x4d25bd,_0x1adc04,_0x39ca86];}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 _0x5dc52f=this['serverHistory']['getOperations']();for(let _0x13a924=_0x5dc52f['length']-0x1;_0x13a924>=0x0;_0x13a924--){const _0x51c414=_0x5dc52f[_0x13a924];if(!this['_disconnectionOperations']['has'](_0x51c414))return _0x51c414['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x23af4a){if(super(_0x23af4a),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x12abdb(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x2e3272('collaboration-missing-channelid',this);const _0x12e2c1=_0x23af4a['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x12e2c1,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x17f265(),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 _0x1a777a=this['editor'],_0x287733=_0x1a777a['plugins']['get'](_0x1adc04),_0x2c0485=_0x1a777a['plugins']['get'](c);this['listenTo'](_0x287733,'getOperationAuthor',(_0x1de7e8,_0xa094d3)=>{const _0x558837=_0xa094d3[0x0];_0x558837['_authorId']&&(_0x1de7e8['return']=_0x287733['getUser'](_0x558837['_authorId']),_0x1de7e8['stop']()),null===_0x558837['_authorId']&&(_0x1de7e8['return']=null,_0x1de7e8['stop']());},{'priority':'high'}),this['listenTo'](_0x1a777a['model']['document']['selection'],'change:range',(_0x116f29,_0x780832)=>{_0x780832['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x1a777a['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x1a777a['model']['on']('applyOperation',(_0x1b975c,_0x449ca3)=>{const _0x2156f2=_0x449ca3[0x0];_0x2156f2['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2156f2),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x2c0485,'state',this,'_hasSynchronizationProblem',(_0x360592,_0x4cddd9)=>'connected'===_0x360592&&!_0x4cddd9),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x1a777a['disableReadOnlyMode']('rtc-offline'):_0x1a777a['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x1a777a['disableReadOnlyMode']('rtc-offline'):_0x1a777a['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x40003e=this['editor']['plugins']['get'](i),_0x380cda=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x40003e['unregister'](this['_channelId']);const _0x12456a=await this['_service']['reconnect'](_0x380cda['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x12456a)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x853314=await this['_service']['getConnectedSessions']();_0x40003e['register'](this['_channelId'],_0x853314),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x535765){if(function(_0x597d90){return'404'===_0x597d90['code'];}(_0x535765)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x452761){return'409'===_0x452761['code'];}(_0x535765)){const _0x3c449c=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'](_0x3c449c);}else{if(!(_0x535765 instanceof J))throw _0x535765;this['_handleReconnectionError']();}}}}['destroy'](){const _0x18d280=this['editor']['plugins']['get'](c),_0xd40ace=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0xd40ace['channelSessions']['has'](this['_channelId'])&&_0xd40ace['unregister'](this['_channelId']),_0x18d280['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x11c50c){if(this['sessionId']!==_0x11c50c['sessionId']&&this['_lastSyncedOperationId']!==_0x11c50c['lastOperationId'])throw new J();return this['sessionId']=_0x11c50c['sessionId'],this['_handleServerResponse']([],{..._0x11c50c,'wereChangesApplied':!0x1,'data':_0x11c50c['data']},'reconnect');}async['_connectService'](_0x5a26ff,_0x4586ce=!0x1){const {connection:_0x1f9643}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x1f9643,this['_channelId'])['then'](_0x407831=>this['_initSessionsHandling'](_0x407831))['catch'](_0x56fab2=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x56fab2);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x419bfc,_0x3e2e37)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x3e2e37);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x3b3186=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5a26ff);this['_isPendingUpdate']=!0x0;const _0x49a34c=await this['_service']['connect'](_0x1f9643,this['_compressOperations'](_0x5a26ff),_0x3b3186);if(this['sessionId']=_0x49a34c['sessionId'],_0x4586ce){if(!_0x49a34c['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x49a34c['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x5a26ff,_0x49a34c,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x49a34c,_0x5a26ff);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3da62a=this['editor']['plugins']['get'](i),_0x35abaf=this['editor']['plugins']['get'](H),_0x57c019=_0x3da62a['channelSessions']['get'](this['_channelId']);_0x57c019&&_0x57c019['length']>0x1?_0x35abaf['createUserMarkerOperations']():this['listenTo'](_0x3da62a,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3da62a['channelSessions']['get'](this['_channelId'])['length']&&_0x35abaf['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x4b6256,_0x1cc85f,_0x615ada,_0x19aeaf){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1cc85f){const _0x4eeec8=this['_decompressOperations'](_0x615ada,_0x19aeaf);await this['_fetchMissingUsers'](_0x4eeec8),this['_handleExternalOperations'](_0x4eeec8,_0x1cc85f,_0x615ada['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x2c83fa}=this['editor'];let _0xb5d03b;try{_0xb5d03b=await this['_service']['getDocumentDetails']();}catch(_0x558a3e){const _0x5a622e=q(_0x2c83fa,'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'](_0x5a622e);}const _0x579678=_0xb5d03b['currentDocumentSession']||_0xb5d03b['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x579678['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x415392=q(_0x2c83fa,'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'](_0x415392);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x7bbce5){const _0x12872d=this['editor']['plugins']['get'](i);this['listenTo'](_0x12872d,'sessionAdd:'+this['_channelId'],(_0x4c016f,{session:_0x32f1d7})=>{if(_0x32f1d7['id']===_0x12872d['mySessionId']){_0x4c016f['off']();const _0x2ff757=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x1f0423=_0x32f1d7['permissions'];_0x2ff757&&_0x2ff757['isEnabled']&&(_0x1f0423=_0x1f0423['filter'](_0x3845b3=>'document:write'!==_0x3845b3)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x1f0423,this['_channelId']);}}),_0x12872d['register'](this['_channelId'],_0x7bbce5);}['_initThrowingOnDataSet'](){const _0x478ce1=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2a89d3)=>{if(!_0x2a89d3[_0x2a89d3['length']-0x1]['suppressErrorInCollaboration'])throw new _0x2e3272('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x478ce1['apply'](this['editor']['data'],_0x2a89d3);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x1d9782,[_0x596fc4])=>{if(this['_document']['version'])throw new _0x2e3272('realtimecollaborationclient-init-document-already-initialized',this);_0x1d9782['stop'](),this['_setPendingAction']();const _0x308098=this['editor']['config']['get']('rootsAttributes'),_0x42832e=this['_getOperationsFromInitData'](_0x596fc4,_0x308098);0x0==_0x42832e['length']&&_0x42832e['push'](new _0x3848dc(0x0)),_0x1d9782['return']=this['_connectService'](_0x42832e)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x55ee3c=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x55ee3c))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x2d76aa,[_0x836075,_0x52909b])=>{_0x2d76aa['stop']();const _0x27d7eb=this['editor']['model']['document']['getRoot'](_0x836075);if(!this['_knownRootNames']['has'](_0x836075)){const _0xd074d9=_0x52909b&&_0x52909b['data']?_0x52909b['data']:'',_0x24182c=_0x52909b&&_0x52909b['attributes']?_0x52909b['attributes']:{};await this['_loadRoot'](_0x836075,_0xd074d9,_0x24182c);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x27d7eb['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x27d7eb);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x4b7e40){const _0x1bbcdb=this['editor']['plugins']['get'](_0x1adc04),{connection:_0x5ac9ef}=this['editor']['plugins']['get'](c),_0x5dc107=new Set();for(const _0x5dba26 of _0x4b7e40){const _0x2c9080=_0x5dba26['_authorId'];_0x2c9080&&!_0x1bbcdb['getUser'](_0x2c9080)&&_0x5dc107['add'](_0x2c9080);}if(0x0===_0x5dc107['size'])return;const _0x33e835=await dt['getMany'](_0x5ac9ef,Array['from'](_0x5dc107));for(const _0x564daa of _0x33e835)_0x1bbcdb['getUser'](_0x564daa['id'])||_0x1bbcdb['addUser'](_0x564daa);}['_getOperationsFromInitData'](_0x4c6981,_0x2040f7={}){const _0x184192=this['editor']['model'],_0x7cf1d4=[];let _0x12bca5=0x0;const _0x58cf5='string'==typeof _0x4c6981?{'main':_0x4c6981}:_0x4c6981;for(const _0x9ce8c2 of Object['keys'](_0x58cf5)){if(!this['_document']['roots']['has'](_0x9ce8c2))throw new _0x2e3272('realtimecollaborationclient-init-non-existent-root',this);const _0x42094f=this['editor']['data']['parse'](_0x58cf5[_0x9ce8c2]),_0x29e02b=this['_document']['getRoot'](_0x9ce8c2),_0x4940c2=new _0x5e3fb9(_0x184192['createPositionAt'](_0x29e02b,0x0),_0x42094f,_0x12bca5++);_0x7cf1d4['push'](_0x4940c2);for(const [_0x5c8ecf,_0x268296]of _0x42094f['markers']){const _0x45ff2f=_0x184192['createRange'](_0x184192['createPositionFromPath'](_0x29e02b,_0x268296['start']['path']['slice']()),_0x184192['createPositionFromPath'](_0x29e02b,_0x268296['end']['path']['slice']())),_0x47b7c2=new _0x468189(_0x5c8ecf,null,_0x45ff2f,_0x184192['markers'],!0x0,_0x12bca5++);_0x7cf1d4['push'](_0x47b7c2);}}if(_0x2040f7)for(const [_0x597b66,_0x57aa8f]of Object['entries'](_0x2040f7)){const _0x3efe5f=_0x184192['document']['getRoot'](_0x597b66);if(!_0x3efe5f)throw new _0x2e3272('multi-root-editor-root-attributes-no-root',null);for(const [_0x1c9ce9,_0x154219]of Object['entries'](_0x57aa8f))if(null!==_0x154219){const _0x2a4965=new _0x1fed11(_0x3efe5f,_0x1c9ce9,null,_0x154219,_0x12bca5++);_0x7cf1d4['push'](_0x2a4965);}}return _0x7cf1d4;}async['_loadRoot'](_0x3edb96,_0x4cb640,_0x30d4d7){this['_getOperationsFromInitData']({[_0x3edb96]:_0x4cb640},{[_0x3edb96]:_0x30d4d7})['forEach']((_0xdc1f6a,_0x3b4183)=>{_0xdc1f6a['baseVersion']=this['_document']['version']+_0x3b4183,_0xdc1f6a['_isInit']=!0x0,this['_saveOperationInBuffer'](_0xdc1f6a);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x30f104,_0x594ab6){let _0x27971a;this['_offset']=_0x30f104['offset'];const _0x200d22=_0x30f104['wereChangesApplied']&&!_0x30f104['initData'],_0x48543c=_0x200d22?0x0:_0x30f104['data']['baseVersion'];if(_0x594ab6['forEach'](_0x19d891=>{_0x19d891['_isInit']=!0x0,_0x19d891['createdAt']=_0x30f104['sessionCreatedAt'],_0x19d891['_authorId']=null;}),_0x200d22)_0x27971a=_0x594ab6,this['_applyOperationsSet'](_0x27971a,_0x200d22);else{if(_0x30f104['initData']){const _0x3ef415=this['_getOperationsFromInitData'](_0x30f104['initData']);this['_document']['history']['version']=-_0x3ef415['length'],_0x3ef415['forEach'](_0x3710f9=>{_0x3710f9['baseVersion']-=_0x3ef415['length'],_0x3710f9['createdAt']=_0x30f104['sessionCreatedAt'],_0x3710f9['_isInit']=!0x0,_0x3710f9['_authorId']=null;}),this['_applyOperationsSet'](_0x3ef415,!0x0),this['serverHistory']['version']=-_0x3ef415['length']+this['_offset'],this['_updateServerHistory'](_0x3ef415);}this['_document']['history']['version']=_0x48543c,_0x27971a=this['_decompressOperations'](_0x30f104['data'],_0x30f104['metadata']),await this['_fetchMissingUsers'](_0x27971a),this['_applyOperationsSet'](_0x27971a,_0x200d22);}_0x30f104['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x27971a,_0x30f104['lastOperationId']),this['_lastSyncedOperationId']=_0x30f104['lastOperationId']),this['serverHistory']['version']=_0x48543c+this['_offset'],this['_updateServerHistory'](_0x27971a),_0x594ab6['filter'](_0x5c3064=>{const _0x3b63ae=this['_getAffectedRoot'](_0x5c3064);return _0x3b63ae&&!this['_knownRootNames']['has'](_0x3b63ae);})['forEach']((_0xa40cd0,_0x37d7be)=>{_0xa40cd0['baseVersion']=this['_document']['version']+_0x37d7be,this['_saveOperationInBuffer'](_0xa40cd0);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x325cf8,_0x2151d8,_0x3c0bf6){throw this['_isPendingUpdate']=!0x0,_0x2151d8&&console['error'](_0x2151d8),_0x3c0bf6&&this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x2e3272(_0x325cf8,this['editor']);}['_saveOperationInBuffer'](_0x5a8a83){this['_knownOperations']['has'](_0x5a8a83)||(this['_knownOperations']['add'](_0x5a8a83),this['_bufferedOperations']['push'](_0x5a8a83),this['_pendingAction']||'marker'==_0x5a8a83['type']&&!_0x5a8a83['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x241dff=!0x1){!_0x241dff&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x84bb47=>{_0x84bb47&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x6ee949=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x53fb48){return _0x53fb48['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x53fb48['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x53fb48['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x6ee949)||this['_crash'](_0x6ee949['message'],_0x6ee949,!0x0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x5f1125=>{this['on']('change:_isPendingUpdate',()=>{_0x5f1125();});});}async['_sendBufferedOperations'](){const _0x5f52f2=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x5f52f2['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x17815e=[...this['_bufferedOperations']];for(const _0x1b25a1 of _0x17815e)_0x1b25a1['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x1b25a1);const _0x4fc879=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x17815e),_0x38ec32=K++,_0x11bb73=this['_compressOperations'](_0x17815e),_0x2b1ca5=await this['_service']['sendOperations'](_0x11bb73,_0x11bb73['baseVersion'],_0x4fc879);try{return await this['_handleServerResponse'](_0x17815e,_0x2b1ca5,_0x38ec32);}catch(_0x9756ff){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x9756ff);}}async['_handleServerResponse'](_0x55f852,_0x7c171a,_0x143d06){if('error'in _0x7c171a)throw _0x7c171a['error'];let _0x276a3a=!0x1;if(_0x7c171a['wereChangesApplied']){_0x7c171a['lastOperationId']&&(this['_lastSyncedOperationId']=_0x7c171a['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x294262=>!_0x55f852['includes'](_0x294262));for(const _0x866acb of _0x55f852)_0x866acb['createdAt']='lastOperationAcceptedAt'in _0x7c171a&&_0x7c171a['lastOperationAcceptedAt']||void 0x0;Q(_0x55f852,_0x7c171a['version']-_0x55f852['length']),this['_updateServerHistory'](_0x55f852);const _0x1fbddb=_0x55f852['filter'](_0x434693=>{if(!_0x434693['_isInit'])return!0x1;const _0x261e1e=this['_getAffectedRoot'](_0x434693);return _0x261e1e&&!this['_knownRootNames']['has'](_0x261e1e);});Q(_0x1fbddb,this['_document']['version']),this['_applyOperationsSet'](_0x1fbddb),_0x276a3a=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x2ab3e9=this['_decompressOperations'](_0x7c171a['data'],_0x7c171a['metadata'])['filter'](_0x1a8c77=>_0x1a8c77['baseVersion']>=this['_lastServerVersion']);_0x2ab3e9['forEach'](_0x180b24=>this['_addKnownRoot'](_0x180b24)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1e318e=>!_0x1e318e['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x1e318e))),this['_bufferedOperations']['length']&&Q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x2ab3e9),_0x276a3a=this['_handleExternalOperations'](_0x2ab3e9,_0x7c171a['version'],_0x7c171a['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x276a3a?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x5eb1e1,_0x1f1e46,_0x26e55b){try{const _0x447766={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x17d0f3,operationsB:_0x3b3811,originalOperations:_0x538c71}=_0x2dd9b2(_0x5eb1e1,this['_bufferedOperations'],_0x447766);Q(_0x17d0f3,this['_document']['version']),Q(_0x3b3811,_0x1f1e46);for(const _0x344949 of _0x17d0f3){const _0x1383c2=_0x538c71['get'](_0x344949);_0x344949['_authorId']=_0x1383c2?_0x1383c2['_authorId']:null;}_0x26e55b&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5eb1e1,_0x26e55b),this['_lastSyncedOperationId']=_0x26e55b),this['_bufferedOperations']=[..._0x3b3811],this['_applyOperationsSet'](_0x17d0f3),this['_updateServerHistory'](_0x5eb1e1);}catch(_0x42f656){return console['error'](_0x42f656),!0x1;}return!0x0;}['_applyOperationsSet'](_0x1b5d74,_0x259a6c=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0xa7f78d=>{for(const _0x510531 of _0x1b5d74)this['_knownOperations']['add'](_0x510531),this['_addKnownRoot'](_0x510531),_0xa7f78d['batch']['addOperation'](_0x510531),this['editor']['model']['applyOperation'](_0x510531);});}['_addKnownRoot'](_0x4affea){const _0x2fc6c7=this['_getAffectedRoot'](_0x4affea);_0x2fc6c7&&this['_knownRootNames']['add'](_0x2fc6c7);}['_getAffectedRoot'](_0x661f9b){let _0x56e307,_0x4eeda8;switch(_0x661f9b['type']){case'insert':_0x56e307=_0x661f9b['position']['root'];break;case'marker':if(_0x4eeda8=_0x661f9b['newRange'],!_0x4eeda8)return null;_0x56e307=_0x4eeda8['root'];break;case'addRootAttribute':_0x56e307=_0x661f9b['root'];break;case'addRoot':_0x56e307=_0x661f9b['affectedSelectable'];break;case'move':_0x56e307=_0x661f9b['targetPosition']['root'];break;default:return null;}return _0x56e307['rootName'];}['_updateServerHistory'](_0x53fa0c){_0x53fa0c['forEach'](_0x122a57=>{const _0x25d0d8=_0x122a57['clone']();_0x25d0d8['_authorId']=_0x122a57['_authorId'],_0x25d0d8['_isInit']=!!_0x122a57['_isInit'],_0x25d0d8['createdAt']=_0x122a57['createdAt'],_0x25d0d8['baseVersion']+=this['_offset'],_0x122a57['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x25d0d8),this['serverHistory']['addOperation'](_0x25d0d8);});}['_handleReconnectionError'](_0x465f16){const _0x58740f=this['editor']['plugins']['get']('Notification'),_0x1f6fd9=this['editor']['locale'];_0x465f16||(_0x465f16=q(_0x1f6fd9,'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.')),_0x58740f['showWarning'](_0x465f16,{'title':q(_0x1f6fd9,'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'](_0x4d25bd)['add'](q(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x4d25bd)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0xc1edd){const _0x39492e=_0xc1edd['map'](_0x1f8765=>_0x1f8765['toJSON']());return this['_compressor']['compress'](_0x39492e);}['_decompressOperations'](_0x1db9a8,_0x1bdc8c){return this['_compressor']['decompress'](_0x1db9a8)['map']((_0x1af40b,_0x4c49a9)=>{const _0x420140='init'==_0x1bdc8c[_0x4c49a9]['type'];if('InsertOperation'==_0x1af40b['__className']){const _0x38224d=_0x1af40b['position']['root'];!this['_document']['getRoot'](_0x38224d)&&(this['_document']['createRoot']('$root',_0x38224d)['_isAttached']=!0x1);}const _0x24ceda=_0x198c4d['fromJSON'](_0x1af40b,this['_document']);return _0x24ceda['wasUndone']=_0x1af40b['wasUndone'],_0x24ceda['_isInit']=_0x420140,_0x24ceda['_authorId']=_0x420140?null:_0x1bdc8c[_0x4c49a9]['userId'],_0x24ceda['_isDisconnection']='cs:removeUser'===_0x1bdc8c[_0x4c49a9]['type'],_0x24ceda['createdAt']=_0x1bdc8c[_0x4c49a9]['createdAt'],_0x24ceda;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x34f1ac=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x34f1ac&&_0x34f1ac['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class J extends Error{}function Q(_0x31b24f,_0x4feabc){for(const _0x50aaf5 of _0x31b24f)_0x50aaf5['baseVersion']=_0x4feabc++;}class X{['_ignoredOperations'];['_operationToId'];constructor(_0x38a36b){this['_ignoredOperations']=_0x38a36b,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x1ea6f3){let _0xb40b5f=_0x1ea6f3['length'];for(;_0xb40b5f--;){const _0x1609bf=_0x1ea6f3[_0xb40b5f];if(!this['_ignoredOperations']['has'](_0x1609bf)){if(!this['_operationToId']['has'](_0x1609bf)){const _0x1c52d9=_0x50f5fd()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1609bf,_0x1c52d9);}return this['_operationToId']['get'](_0x1609bf);}}}['setIdForTheLastOperation'](_0x9cbd70,_0x271734){if(!_0x271734)return;let _0x585450=_0x9cbd70['length'];for(;_0x585450--;){const _0x4d8306=_0x9cbd70[_0x585450];this['_ignoredOperations']['has'](_0x4d8306)||this['_operationToId']['set'](_0x4d8306,_0x271734);}}}class n extends _0x348114{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x2570ba{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0xa0ac43)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x1adc04];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x63e1b4){super(_0x63e1b4),this['_services']=new Map();}async['init'](){const _0x220328=this['context'],_0x3e7b20=_0x220328['plugins']['get']('CommentsRepository');if(_0x220328['plugins']['get'](c)['addToReconnectionStack'](this),_0x3e7b20['adapter']={'addCommentThread':async({channelId:_0x4f3b63,threadId:_0x641ef1,comments:_0x425047,resolvedAt:_0x536209,resolvedBy:_0x179c96,context:_0x2e0961,attributes:_0x218dc2})=>{const _0x38b7ef=await this['_getService'](_0x4f3b63)['addCommentThread']({'commentThreadId':_0x641ef1,'comments':_0x425047['map'](_0x1b2411=>function(_0x27283c,_0x38b120,_0x328ddb){return{'commentThreadId':_0x328ddb,'commentId':_0x27283c['commentId'],'userId':_0x27283c['authorId'],'content':_0x27283c['content'],'documentId':_0x38b120,'createdAt':_0x27283c['createdAt'],'attributes':_0x27283c['attributes']||{}};}(_0x1b2411,_0x4f3b63,_0x641ef1)),'resolvedAt':_0x536209,'resolvedBy':_0x179c96,'context':_0x2e0961,'attributes':_0x218dc2})['catch'](ut);return{'threadId':_0x38b7ef['commentThreadId'],'comments':_0x38b7ef['comments']};},'getCommentThread':async({channelId:_0x3fc91e,threadId:_0x5378f2})=>{const _0x5e37ab=await this['_getService'](_0x3fc91e)['getCommentThread'](_0x5378f2)['catch'](ut);return _0x5e37ab['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x5e37ab]),{'threadId':_0x5e37ab['commentThreadId'],'comments':_0x5e37ab['comments']['map'](S),'context':_0x5e37ab['context'],'resolvedAt':_0x5e37ab['resolvedAt'],'resolvedBy':_0x5e37ab['resolvedBy'],'attributes':_0x5e37ab['attributes']||{}});},'updateCommentThread':async({channelId:_0x239f0c,threadId:_0x84f70c,context:_0x36b467,unlinkedAt:_0x426f5e,attributes:_0x193f4b})=>this['_getService'](_0x239f0c)['updateCommentThread']({'commentThreadId':_0x84f70c,'context':_0x36b467,'attributes':_0x193f4b,'unlinkedAt':_0x426f5e})['catch'](B)['catch'](ut),'resolveCommentThread':async({channelId:_0x3ab7da,threadId:_0x8c7163})=>{const _0x19660f=await this['_getService'](_0x3ab7da)['resolveCommentThread'](_0x8c7163)['catch'](B)['catch'](ut);return{'threadId':_0x19660f['commentThreadId'],'resolvedAt':_0x19660f['resolvedAt'],'resolvedBy':_0x19660f['resolvedBy']};},'reopenCommentThread':async({channelId:_0x2c4735,threadId:_0x3222f3})=>this['_getService'](_0x2c4735)['reopenCommentThread'](_0x3222f3)['catch'](B)['catch'](ut),'removeCommentThread':({channelId:_0x5d04c4,threadId:_0x4b30e2})=>this['_getService'](_0x5d04c4)['removeCommentThread'](_0x4b30e2)['catch'](B)['catch'](ut),'addComment':({channelId:_0x3e53c6,threadId:_0x47fa15,commentId:_0x48548d,content:_0x5809f5,attributes:_0x125c69})=>this['_getService'](_0x3e53c6)['addComment'](_0x47fa15,_0x48548d,_0x5809f5,_0x125c69)['catch'](ut),'updateComment':({channelId:_0x32fde3,threadId:_0x5ae98b,commentId:_0x56c0e0,content:_0x295555,attributes:_0x38b595})=>this['_getService'](_0x32fde3)['updateComment'](_0x5ae98b,_0x56c0e0,_0x295555,_0x38b595)['catch'](B)['catch'](ut),'removeComment':({channelId:_0x1fa2df,threadId:_0x5714bc,commentId:_0xc83b7e})=>this['_getService'](_0x1fa2df)['removeComment'](_0x5714bc,_0xc83b7e)['catch'](B)['catch'](ut)},_0x220328 instanceof _0xd60d61){const _0x50ca6a=_0x220328['config']['get']('collaboration.channelId'),_0x3ac1bf=_0x220328['plugins']['get'](i);await this['_setUpService'](_0x50ca6a);const _0x45ac6d=await this['_services']['get'](_0x50ca6a)['getConnectedSessions']();this['listenTo'](_0x3ac1bf,'sessionAdd:'+_0x50ca6a,(_0xf1ae57,{session:_0x3613fb})=>{_0x3613fb['id']===_0x3ac1bf['mySessionId']&&(_0xf1ae57['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x3613fb['permissions'],_0x50ca6a));}),_0x3ac1bf['register'](_0x50ca6a,_0x45ac6d);}}async['_setUpService'](_0x27b8a4){if(this['_services']['has'](_0x27b8a4))throw new _0x2e3272('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x27b8a4});const _0x503482=this['context']['plugins']['get']('CommentsRepository'),_0x5381c2=new a['CommentsService'](_0x27b8a4);this['_services']['set'](_0x27b8a4,_0x5381c2),this['listenTo'](_0x5381c2,'commentThreadAdded',(_0x247c75,_0xf27e6)=>{const {commentThreadId:_0x65ac04,documentId:_0x252551,context:_0x2c6346,attributes:_0x3682b5,resolvedAt:_0x3f1340,resolvedBy:_0x2cf8a1,comments:_0x19a524}=_0xf27e6;_0x503482['getCommentThread'](_0x65ac04)||_0x503482['addCommentThread']({'threadId':_0x65ac04,'channelId':_0x252551,'comments':_0x19a524?_0x19a524['map'](S):[],'context':_0x2c6346,'attributes':_0x3682b5,'resolvedAt':_0x3f1340,'resolvedBy':_0x2cf8a1,'isFromAdapter':!0x0});}),this['listenTo'](_0x5381c2,'commentThreadUpdated',(_0x159738,{commentThreadId:_0x4b1d8d,documentId:_0x7a57af,context:_0x570e21,unlinkedAt:_0x46b2f5,attributes:_0xf78d17})=>{_0x503482['getCommentThread'](_0x4b1d8d)&&_0x503482['updateCommentThread']({'threadId':_0x4b1d8d,'channelId':_0x7a57af,'context':_0x570e21,'unlinkedAt':_0x46b2f5,'attributes':_0xf78d17,'isFromAdapter':!0x0});}),this['listenTo'](_0x5381c2,'commentThreadResolved',(_0x1c97b1,{commentThreadId:_0x5e14ae,resolvedBy:_0x284549,resolvedAt:_0x54e9d0})=>{const _0x13cf76=_0x503482['getCommentThread'](_0x5e14ae);_0x13cf76&&_0x13cf76['resolve']({'resolvedBy':_0x284549,'resolvedAt':_0x54e9d0,'isFromAdapter':!0x0});}),this['listenTo'](_0x5381c2,'commentThreadReopened',(_0x1bccf6,{commentThreadId:_0x250770})=>{const _0x4adecf=_0x503482['getCommentThread'](_0x250770);_0x4adecf&&_0x4adecf['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5381c2,'commentThreadRemoved',(_0xb60215,{commentThreadId:_0x3f6089})=>{const _0x25cad8=_0x503482['getCommentThread'](_0x3f6089);_0x25cad8&&_0x25cad8['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5381c2,'commentAdded',(_0x2e8f7e,_0x517afc)=>{const _0x5a14e1=_0x517afc['commentThreadId'],_0xaf954a=_0x503482['getCommentThread'](_0x5a14e1);_0xaf954a&&_0xaf954a['addComment']({...S(_0x517afc),'isFromAdapter':!0x0});}),this['listenTo'](_0x5381c2,'commentUpdated',(_0x227406,{commentThreadId:_0x595658,commentId:_0x403c7d,content:_0x3ab222,attributes:_0x38ff58})=>{const _0x38b0a9=_0x503482['getCommentThread'](_0x595658);if(_0x38b0a9){const _0x265af8=_0x38b0a9['getComment'](_0x403c7d);_0x265af8&&_0x265af8['update']({'content':_0x3ab222,'attributes':_0x38ff58,'isFromAdapter':!0x0});}}),this['listenTo'](_0x5381c2,'commentRemoved',(_0x5c0952,{commentThreadId:_0x4d56e4,commentId:_0x3e89bd})=>{const _0x3b0395=_0x503482['getCommentThread'](_0x4d56e4);if(_0x3b0395){const _0x5cc2f5=_0x3b0395['getComment'](_0x3e89bd);_0x5cc2f5&&_0x5cc2f5['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x27b8a4);}['destroy'](){if(this['context']instanceof _0xd60d61){const _0x91f386=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x91f386);}}['_terminateService'](_0x370980){if(!this['_services']['has'](_0x370980))throw new _0x2e3272('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x370980});this['_getService'](_0x370980)['disconnect'](),this['_services']['delete'](_0x370980);}async['reconnect'](){for(const _0x2cc08d of this['_services']['keys']())await this['_connectService'](_0x2cc08d);if(this['context']instanceof _0xd60d61){const _0xc0fc48=this['context']['config']['get']('collaboration.channelId'),_0x140e6c=this['context']['plugins']['get'](i);_0x140e6c['unregister'](_0xc0fc48);const _0xf936b6=await this['_services']['get'](_0xc0fc48)['getConnectedSessions']();_0x140e6c['register'](_0xc0fc48,_0xf936b6);}}async['_connectService'](_0x3db70a){const {connection:_0x358509}=this['context']['plugins']['get'](c),_0xc57012=this['context']['plugins']['get']('CommentsRepository'),_0x257a71=this['_services']['get'](_0x3db70a),_0x191890=await _0x257a71['connect'](_0x358509);await this['_fetchMissingUsersForThreads'](_0x191890);const _0x4828e3=new Set(Array['from'](_0xc57012['getCommentThreads']({'channelId':_0x3db70a}),_0x5ca850=>_0x5ca850['id']));for(const _0xf69356 of _0x191890)_0xf69356['deletedAt']||_0x4828e3['delete'](_0xf69356['commentThreadId']);for(const _0x1f91a8 of _0x4828e3)_0xc57012['getCommentThread'](_0x1f91a8)['remove']({'isFromAdapter':!0x0});for(const _0x57dc70 of _0x191890){let _0x3b6938=_0xc57012['getCommentThread'](_0x57dc70['commentThreadId']);const {commentThreadId:_0x4e07ff,context:_0x4b1f8f,attributes:_0x22ec45,resolvedBy:_0x20042e,resolvedAt:_0x2e26b2,unlinkedAt:_0x44ba42,deletedAt:_0x12476e}=_0x57dc70;if(_0x12476e)continue;_0x3b6938||(_0x3b6938=_0xc57012['addCommentThread']({'channelId':_0x3db70a,'threadId':_0x4e07ff,'context':_0x4b1f8f,'attributes':_0x22ec45||{},'resolvedBy':_0x20042e,'resolvedAt':_0x2e26b2,'unlinkedAt':_0x44ba42,'isFromAdapter':!0x0}));const _0x596c53=new Set(Array['from'](_0x3b6938['comments'],_0x1b4d88=>_0x1b4d88['id']));for(const _0x42c888 of _0x57dc70['comments'])_0x596c53['delete'](_0x42c888['commentId']);for(const _0x3331c4 of _0x596c53)_0x3b6938['getComment'](_0x3331c4)['remove']({'isFromAdapter':!0x0});for(const _0x20b4a8 of _0x57dc70['comments']){const _0x5b228e=_0x3b6938['getComment'](_0x20b4a8['commentId']);_0x5b228e?_0x5b228e['content']!==_0x20b4a8['content']&&_0x5b228e['update']({'content':_0x20b4a8['content'],'isFromAdapter':!0x0}):_0x3b6938['addComment'](Object['assign'](S(_0x20b4a8),{'isFromAdapter':!0x0}));}}}['_getService'](_0x4016a6){if(!this['_services']['has'](_0x4016a6))throw new _0x2e3272('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x4016a6});return this['_services']['get'](_0x4016a6);}async['_fetchMissingUsersForThreads'](_0x46decc){const _0x2b0f84=this['context']['plugins']['get'](_0x1adc04),{connection:_0x13a1c6}=this['context']['plugins']['get'](c),_0x5c724d=new Set();for(const {resolvedBy:_0x252252,comments:_0x10fa5d}of _0x46decc){_0x252252&&!_0x2b0f84['getUser'](_0x252252)&&_0x5c724d['add'](_0x252252);for(const {userId:_0x2dc696}of _0x10fa5d)_0x2b0f84['getUser'](_0x2dc696)||_0x5c724d['add'](_0x2dc696);}if(0x0===_0x5c724d['size'])return;const _0x2ca472=await dt['getMany'](_0x13a1c6,Array['from'](_0x5c724d));for(const _0x1d96b7 of _0x2ca472)_0x2b0f84['getUser'](_0x1d96b7['id'])||_0x2b0f84['addUser'](_0x1d96b7);}}async function B(_0x2ce13f){if('404'!==_0x2ce13f['code'])throw _0x2ce13f;}function ut(_0x1e2e45){if((_0x49ad45=_0x1e2e45)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x49ad45['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x49ad45['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x49ad45;throw _0x1e2e45;}function S(_0xbb2d14){return{'threadId':_0xbb2d14['commentThreadId'],'commentId':_0xbb2d14['commentId'],'content':_0xbb2d14['content'],'createdAt':_0xbb2d14['createdAt'],'authorId':_0xbb2d14['userId'],'attributes':_0xbb2d14['attributes']||{}};}class f extends _0x348114{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x57bd21){super(_0x57bd21);const _0x59f37b=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x59f37b);}['init'](){const _0x44b7a6=this['editor']['plugins']['get'](c),_0xc9ff01=this['editor']['plugins']['get']('TrackChangesEditing');return _0xc9ff01['adapter']={'getSuggestion':async _0x23eb6a=>{await this['_waitForServiceReady']();const _0x1e2d0b=await this['_trackChangesService']['get'](_0x23eb6a)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x1e2d0b]),_0x1e2d0b;},'addSuggestion':async({id:_0x417623,type:_0x357b2a,data:_0x33fc4c,originalSuggestionId:_0x35befd,attributes:_0x425a3d})=>{await this['_waitForServiceReady']();const _0x4852d8={'id':_0x417623,'type':_0x357b2a,'data':_0x33fc4c,'originalSuggestionId':_0x35befd,'attributes':_0x425a3d},_0x2c17e5=await this['_trackChangesService']['add'](_0x417623,_0x357b2a,_0x33fc4c,_0x35befd,_0x425a3d)['catch'](_0x5f07ad=>{if(ft(_0x5f07ad))return new Promise(_0x29a6ff=>{this['_bufferedRequests']['set'](_0x417623,{'resolve':_0x29a6ff,'suggestionData':_0x4852d8});});throw _0x5f07ad;});return this['_bufferedRequests']['delete'](_0x417623),_0x2c17e5;},'updateSuggestion':async(_0x214dad,_0x1a8aef)=>{if(await this['_waitForServiceReady'](),'open'!==_0x1a8aef['state'])return this['_trackChangesService']['update'](_0x214dad,_0x1a8aef)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x116b44,_0x5e3803)=>{_0xc9ff01['hasSuggestion'](_0x5e3803['id'])&&(_0xc9ff01['getSuggestion'](_0x5e3803['id'])['attributes']=_0x5e3803['attributes']);}),this['_trackChangesService']['connect'](_0x44b7a6['connection'])['then'](_0x238167=>(_0x44b7a6['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x238167)['then'](()=>{for(const _0x4d3b3f of _0x238167){_0xc9ff01['addSuggestionData'](_0x4d3b3f)['_saved']=!0x0;}})));}async['reconnect'](){const _0x267fab=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x469f8f}=this['editor']['plugins']['get'](c),_0x3b9137=await this['_trackChangesService']['connect'](_0x469f8f);await this['_fetchMissingUsersForThreads'](_0x3b9137);for(const {suggestionData:_0x1b6d2f,resolve:_0x30c4cb}of this['_bufferedRequests']['values']()){let _0x1287af=_0x3b9137['find'](_0x20545e=>_0x20545e['id']===_0x1b6d2f['id']);_0x1287af||(_0x1287af=await this['_trackChangesService']['add'](_0x1b6d2f['id'],_0x1b6d2f['type'],_0x1b6d2f['data'],_0x1b6d2f['originalSuggestionId'])),_0x30c4cb(_0x1287af);}for(const _0x5be7b3 of _0x3b9137)_0x267fab['hasSuggestion'](_0x5be7b3['id'])||_0x267fab['addSuggestionData'](_0x5be7b3);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x58dcf0=>{this['listenTo'](this['_trackChangesService'],'connected',_0x3e4702=>{_0x3e4702['off'](),_0x58dcf0();});});}async['_fetchMissingUsersForThreads'](_0x341f9e){const _0x3a4159=this['editor']['plugins']['get'](_0x1adc04),{connection:_0xb54898}=this['editor']['plugins']['get'](c),_0x13a362=new Set();for(const {authorId:_0x3669bd}of _0x341f9e)_0x3a4159['getUser'](_0x3669bd)||_0x13a362['add'](_0x3669bd);if(0x0===_0x13a362['size'])return;const _0x343ec5=await dt['getMany'](_0xb54898,Array['from'](_0x13a362));for(const _0x5584ce of _0x343ec5)_0x3a4159['getUser'](_0x5584ce['id'])||_0x3a4159['addUser'](_0x5584ce);}}function R(_0x1e8b1e){if(ft(_0x1e8b1e))return new Promise(()=>{});throw _0x1e8b1e;}function ft(_0x319af4){return _0x319af4['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x319af4['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x348114{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 _0xc3ec3c=this['editor']['plugins']['get'](c),_0x2dd53d=this['editor']['plugins']['get']('CommentsEditing'),_0x4a8db8=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0xc3ec3c,'change:state',(_0x2e1f3d,_0x20e563,_0x1066c8)=>{_0x2dd53d['isThreadsLoadingPaused']='connected'!==_0x1066c8;});}),this['listenTo'](_0xc3ec3c,'change:state',(_0xc06432,_0x5dc210,_0x42cc45)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x42cc45);}),_0x4a8db8['_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 _0x348114{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 _0x348114{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x1adc04];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1ac6c9){super(_0x1ac6c9);const _0x1c2d19=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x1c2d19);}async['init'](){const _0x363dbd=this['editor']['plugins']['get'](l),_0x29fa02=_0x363dbd['serverHistory'],_0x367c28=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x29fa02,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x363dbd['sessionId']});const _0x129702=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x23f196=await tt['isBundleUploaded'](_0x367c28['connection'],_0x129702);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x4161bb})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4161bb)),'updateRevisions':async _0x3030da=>{await this['_waitForServiceReady']();const _0x16a590=this['_revisionTracker']['currentRevision'];if(_0x23f196&&0x1===_0x3030da['length']&&_0x3030da[0x0]['id']===_0x16a590['id'])return _0x3030da;for(const _0x4f3d5a of _0x3030da)_0x4f3d5a['id']===_0x16a590['id']&&(_0x4f3d5a['isEmptyCurrent']=_0x4f3d5a['fromVersion']===_0x4f3d5a['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x3030da,this['_lastRequestId'])['then'](_0x2f1dba=>(this['_lastRequestId']=_0x2f1dba,_0x3030da))['catch'](_0x468597=>{if(st(_0x468597)||'400'===_0x468597['code']&&void 0x0!==_0x468597['data']['wrongRequestId']){for(const _0x1e08a0 of _0x3030da){!this['_revisionTracker']['repository']['getRevision'](_0x1e08a0['id'])||this['_revisionTracker']['_bufferUpdate'](_0x1e08a0['id'],_0x1e08a0,!0x1);}if(st(_0x468597))throw _0x468597;return _0x3030da;}throw _0x468597;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x241b3e,{revisionsData:_0x271335,requestId:_0x20fbd4})=>{Math['max'](..._0x271335['map'](_0x293f5f=>_0x293f5f['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x271335,_0x20fbd4);}):this['_handleRevisionsUpdate'](_0x271335,_0x20fbd4);});const {revisions:_0x31284a,requestId:_0x1c318c}=await this['_revisionHistoryService']['connect'](_0x367c28['connection']);_0x367c28['addToReconnectionStack'](this),this['_lastRequestId']=_0x1c318c,await this['_fetchMissingUsers'](_0x31284a);for(const _0x26b177 of _0x31284a)this['_revisionTracker']['addRevisionData'](_0x26b177);this['listenTo'](_0x363dbd,'change:_isConnected',(_0x196e9a,_0x531c3c,_0x1fb31e)=>{_0x1fb31e&&(this['_oldOffset']=_0x363dbd['_offset'],_0x196e9a['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x367c28,'state',_0x3be282=>_0x3be282===_0x1b4187['CONNECTED']);}async['reconnect'](){const _0x1faf8c=this['editor']['plugins']['get'](c),_0x191f08=this['editor']['plugins']['get'](l),_0x798822=async()=>{const _0x48affc=this['_revisionTracker']['currentRevision'],_0x232cbb=_0x48affc['id'],_0x2e9ca5=_0x232cbb!==_0x191f08['sessionId'];if(_0x2e9ca5){const _0x4e8f47=_0x191f08['_offset']-this['_oldOffset'],_0x39657a=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x48affc['toVersion']+_0x4e8f47!==_0x39657a){const _0x56fe4d=_0x48affc['fromVersion']+_0x4e8f47,_0x562e3e=this['editor']['plugins']['get'](_0x1adc04),_0x101193=this['_revisionTracker']['buildRevisionData']({'revision':_0x48affc,'from':_0x56fe4d,'to':_0x39657a});_0x101193['id']=_0x48affc['id'];const _0xce24f8=_0x101193['authorsIds']['map'](_0xb8c058=>_0x562e3e['getUser'](_0xb8c058));_0x48affc['_update']({..._0x101193,'authors':_0xce24f8},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x48affc['id'],_0x101193,!0x0);}this['_revisionTracker']['_startingVersion']=_0x39657a,(_0x48affc['toVersion']===_0x48affc['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x232cbb)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x232cbb),this['_revisionTracker']['_createCurrentRevision'](_0x39657a));}const {revisions:_0x39ad36,requestId:_0x3229dc}=await this['_revisionHistoryService']['reconnect'](_0x1faf8c['connection'],this['_lastRequestId']);_0x2e9ca5&&_0x39ad36['length']>0x0?_0x191f08['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x39ad36),this['_handleRevisionsUpdate'](_0x39ad36,_0x3229dc),this['_revisionTracker']['sendBufferedUpdates']());};return _0x191f08['_isConnected']?_0x798822():new Promise((_0x2f5f35,_0x5e02bb)=>{_0x191f08['once']('change:_isConnected',()=>{_0x798822()['then'](_0x2f5f35)['catch'](_0x5e02bb);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x46de36=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3a345d=>{_0x3a345d['off'](),_0x46de36();});});}['_getLatestVersionFromServerOperations'](){const _0xb27226=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x5a16ce of _0xb27226)if('marker'!==_0x5a16ce['type']||_0x5a16ce['affectsData'])return _0x5a16ce['baseVersion']+0x1;}['_getLatestVersion'](){const _0x1e0cd0=this['editor']['plugins']['get'](l);return new Promise(_0x39818a=>{_0x1e0cd0['_isPendingUpdate']?_0x1e0cd0['once']('change:_isPendingUpdate',()=>{_0x39818a(this['_getLatestVersionFromServerOperations']());}):_0x39818a(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0xe20361,_0x3d74f0){const _0x4fa1a7=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x3d74f0;for(const _0x31cbe8 of _0xe20361){const _0x45a9a9=_0x4fa1a7['getRevision'](_0x31cbe8['id']);if(_0x45a9a9){if((_0x31cbe8['fromVersion']||_0x31cbe8['toVersion'])&&(_0x31cbe8['diffData']=null),_0x45a9a9===this['_revisionTracker']['currentRevision']){const _0x550bfd=Math['max'](_0x45a9a9['toVersion'],_0x31cbe8['toVersion']),_0x2412b5=Math['max'](_0x45a9a9['fromVersion'],_0x31cbe8['fromVersion']);let _0x4b6dd7;_0x45a9a9['toVersion']===_0x31cbe8['toVersion']&&_0x45a9a9['fromVersion']===_0x31cbe8['fromVersion']?(_0x4b6dd7=!0x0,this['_preventResendingRevisionData'](_0x31cbe8)):_0x31cbe8['toVersion']===_0x550bfd&&_0x31cbe8['fromVersion']===_0x2412b5?_0x4b6dd7=!0x1:(_0x45a9a9['toVersion']===_0x550bfd&&_0x45a9a9['fromVersion']===_0x2412b5||this['_fixRevision']({'revision':_0x45a9a9,'from':_0x2412b5,'to':_0x550bfd}),_0x4b6dd7=!0x0),_0x4b6dd7&&(delete _0x31cbe8['fromVersion'],delete _0x31cbe8['toVersion'],delete _0x31cbe8['diffData'],delete _0x31cbe8['createdAt'],delete _0x31cbe8['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x31cbe8),this['_preventResendingRevisionData'](_0x31cbe8);}else this['_revisionTracker']['addRevisionData'](_0x31cbe8);}const _0x4138d9=_0x4fa1a7['getRevisions']();_0x4138d9['reverse']();for(let _0x344b0e=0x0;_0x344b0e<_0x4138d9['length']-0x1;_0x344b0e++){const _0x31db26=_0x4138d9[_0x344b0e],_0x443885=_0x4138d9[_0x344b0e+0x1];if(_0x31db26['fromVersion']<_0x443885['toVersion']){const _0x45ff92=_0x443885['toVersion'],_0x124e74=Math['max'](_0x45ff92,_0x31db26['toVersion']);this['_fixRevision']({'revision':_0x31db26,'from':_0x45ff92,'to':_0x124e74});}}}['_fixRevision']({revision:_0x24204d,from:_0xec6e6a,to:_0x30cbec}={}){const _0x1f3a37=this['editor']['plugins']['get'](_0x1adc04),_0x139ee3=this['_revisionTracker']['buildRevisionData']({'revision':_0x24204d,'from':_0xec6e6a,'to':_0x30cbec});_0x139ee3['authors']=_0x139ee3['authorsIds']['map'](_0x4817e7=>_0x1f3a37['getUser'](_0x4817e7)),_0x24204d['_update'](_0x139ee3);}['_preventResendingRevisionData'](_0x585206){const _0x112b26={};_0x112b26['id']=_0x585206['id'];for(const _0x3cd2da of Object['keys'](_0x585206))'id'!==_0x3cd2da&&(_0x112b26[_0x3cd2da]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x112b26['id'],_0x112b26,!0x0);}async['_fetchMissingUsers'](_0x4fc114){const _0x2102ff=this['editor']['plugins']['get'](_0x1adc04),{connection:_0x7ddb8f}=this['editor']['plugins']['get'](c),_0x5db1fb=new Set();for(const _0x192da1 of _0x4fc114){for(const _0x1570b7 of _0x192da1['authorsIds'])_0x2a79ba(_0x1570b7);_0x192da1['creatorId']&&_0x2a79ba(_0x192da1['creatorId']);}if(0x0===_0x5db1fb['size'])return;const _0x29f2a6=await dt['getMany'](_0x7ddb8f,Array['from'](_0x5db1fb));for(const _0x467536 of _0x29f2a6)_0x2102ff['getUser'](_0x467536['id'])||_0x2102ff['addUser'](_0x467536);function _0x2a79ba(_0x4ce7ef){_0x2102ff['getUser'](_0x4ce7ef)||_0x5db1fb['add'](_0x4ce7ef);}}}function st(_0x38e6b7){return _0x38e6b7['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x38e6b7['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x38e6b7['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x348114{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 _0x3f9851{constructor(_0x76ec97){super(_0x76ec97);const _0x1da8f2=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x1da8f2['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x1da8f2['to']('usersCount',_0x1963d5=>q(_0x76ec97,'CONNECTED_USERS',_0x1963d5))}]});}}class es extends _0x3f9851{['items'];['keystrokes'];constructor(_0x36554e){super(_0x36554e);const _0x393e9d=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0xd8aef6(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x393e9d['if']('hasPopup'),'aria-expanded':_0x393e9d['to']('isExpanded',_0x4d5c3a=>this['hasPopup']&&String(_0x4d5c3a)),'aria-label':_0x393e9d['to']('hasPopup',_0x1a1acd=>q(_0x36554e,_0x1a1acd?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x393e9d['to']('hasPopup',_0x31d8cc=>!!_0x31d8cc&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x393e9d['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x135a06,_0x334ac5,_0x5532b7)=>{this['element']&&(_0x5532b7?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 _0x3f9851{['counterView'];['inlineListView'];constructor(_0x3d2a34){super(_0x3d2a34);const _0x2ef2cf=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x3d2a34),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x10980f of this['inlineListView']['items'])_0x10980f['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',_0x2ef2cf['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class j extends _0x3f9851{['listWrapperView'];constructor(_0x58abc8,_0x1a92cb){super(_0x58abc8),this['listWrapperView']=new mt(_0x58abc8,_0x1a92cb),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':q(_0x58abc8,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class mt extends _0x3304c8{constructor(_0x3814a2,_0x21337c){super(_0x3814a2);const _0x4110de=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x21337c?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x4110de['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x4110de['to']('role'),'aria-label':_0x4110de['to']('ariaLabel'),'aria-labelledby':_0x4110de['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x23615d['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x3c9257=this['element'];_0x3c9257&&(this['_isScrollable']=Math['max'](_0x3c9257['scrollHeight'],_0x3c9257['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x1dc546,_0x41eeb9,_0x5e73dd){super(_0x1dc546);const _0x5d50ef=this['bindTemplate'];this['userView']=new ct(_0x1dc546,_0x41eeb9);const _0xb5fda3={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x41eeb9['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x41eeb9['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x41eeb9['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x5e73dd&&(_0xb5fda3['tag']='button',_0xb5fda3['on']={'click':_0x5d50ef['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xb5fda3);}['focus'](){this['element']['focus']();}}class y extends _0x3f9851{['userView'];['markerView'];constructor(_0x414c0d,_0x118816,_0x9b1c8e){super(_0x414c0d);const _0xf91c04=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x414c0d,_0x118816),this['markerView']=new at(_0x414c0d,_0x118816);const _0x1d6842=new ot(_0x414c0d);_0x1d6842['template']['tag']='span',_0x1d6842['text']=_0x118816['name'];const _0x1dbf2b={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0xf91c04['to']('isFocusable',_0x279d8b=>!!_0x279d8b&&0x0),'aria-labelledby':_0x1d6842['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0xf91c04['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0xf91c04['to']('hasTooltip',_0x408376=>!_0x408376),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x1d6842]};_0x9b1c8e&&(_0x1dbf2b['tag']='button',_0x1dbf2b['on']={'click':_0xf91c04['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x1dbf2b);}}class at extends _0x3f9851{constructor(_0x1c3ce7,_0x2b5bfd){super(_0x1c3ce7),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2b5bfd['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const A={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x2570ba{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x36d129){super(_0x36d129),this['context']['config']['define']('presenceList',A);const _0x1e043d=_0x36d129['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x1e043d)throw new _0x2e3272('presencelist-collapseat-invalid-format',this);if(_0x1e043d<0x1)throw new _0x2e3272('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x1b4970(),this['balloonPanelView']=new _0x99933(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x4af79e of this['_allConnectedUsers'])this['_handleUserAdd'](_0x4af79e);this['listenTo'](this['_allConnectedUsers'],'add',(_0x95032,_0x3fa28e)=>{this['_handleUserAdd'](_0x3fa28e);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x198ab5,_0x25251a)=>{this['_handleUserRemove'](_0x25251a);});}['_createView'](){const _0x4fc22b=this['context'],_0xd53dc7=new L(this['context']['locale']),_0x278f41=this['balloonPanelView'];if(!_0x3f492d(_0x4fc22b['config']['get']('presenceList.container')))throw new _0x2e3272('presencelist-missing-container',this);return _0xd53dc7['counterView']['bind']('usersCount')['to'](this),_0xd53dc7['bind']('isCollapsed')['to'](this,'usersCount',_0x170078=>{const {collapseAt:_0x4cff2c,displayMe:_0x56403e}=_0x4fc22b['config']['get']('presenceList'),_0x1cc609=_0x170078>=_0x4cff2c;return _0xd53dc7['counterView']['isHidden']=!(0x1==_0x170078&&_0x56403e||_0x1cc609),_0x1cc609||this['hideDropdown'](),_0x1cc609;}),_0xd53dc7['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0xd32276=>{const _0x3b05d8=_0x4fc22b['config']['get']('presenceList'),_0x2c5f76=new y(_0x4fc22b['locale'],_0xd32276,!!_0x3b05d8['onClick']);return _0x2c5f76['bind']('hasTooltip')['to'](_0xd53dc7,'isCollapsed',_0x438fd3=>!_0x438fd3),_0x2c5f76['bind']('isFocusable')['to'](_0xd53dc7,'isCollapsed',_0x4d7cf9=>!_0x4d7cf9),_0x3b05d8['onClick']&&this['listenTo'](_0x2c5f76,'execute',()=>{this['view']['isCollapsed']||_0x3b05d8['onClick'](_0xd32276,_0x2c5f76['element']);}),_0x2c5f76;}),this['listenTo'](_0xd53dc7['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0xd53dc7['inlineListView']['keystrokes']['set']('Enter',(_0x52019e,_0x3ca201)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3ca201());}),_0xd53dc7['render'](),_0x278f41['render'](),_0x1b10bb({'emitter':_0xd53dc7,'activator':()=>_0x278f41['isVisible'],'contextElements':[_0x278f41['element'],_0xd53dc7['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4fc22b['config']['get']('presenceList.container')['appendChild'](_0xd53dc7['element']),this['_bodyCollection']=new _0x4dadbb(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0xd53dc7;}['_handleUserAdd'](_0x4f326e){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x4f326e['isMe'])return;const _0xde5b75=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0xde5b75&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x33a9ad=_0x4f326e['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x4f326e,_0x33a9ad);}['_handleUserRemove'](_0xac9954){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0xac9954['id'])&&(this['currentDisplayedUsers']['remove'](_0xac9954['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x298c53 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x298c53['id']))return void this['currentDisplayedUsers']['add'](_0x298c53,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0xfbc7b=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new j(this['context']['locale'],!!_0xfbc7b['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x22d233}=this['presenceDropdownView'];_0x22d233['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x7fc5c3=>{if(!_0xfbc7b['displayMe']&&_0x7fc5c3['isMe'])return null;const _0x4bacbb=new k(this['context']['locale'],_0x7fc5c3,!!_0xfbc7b['onClick']);return _0xfbc7b['onClick']&&this['listenTo'](_0x4bacbb,'execute',()=>{_0xfbc7b['onClick'](_0x7fc5c3,_0x4bacbb['element']);}),_0x4bacbb;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x22d233['focus'](),_0x22d233['checkIfScrollable']();const _0x4d7825=(_0x276917,_0x1365f2)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x1365f2();};_0x22d233['keystrokes']['set']('Esc',_0x4d7825),_0x22d233['keystrokes']['set']('Shift+Tab',_0x4d7825),_0x22d233['keystrokes']['set']('Tab',(_0x1b4249,_0x4d2d96)=>{!function(_0x153102){const _0x25a907=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x4c65eb=>_0x4c65eb+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xe9bb6b=[...document['body']['querySelectorAll'](_0x25a907)]['filter'](_0xf83c76=>_0xf83c76===document['activeElement']||_0xf83c76['offsetWidth']+_0xf83c76['offsetHeight']>0x0)['sort']((_0x8c9e0f,_0x392515)=>(_0x8c9e0f['tabIndex']||0x0)-(_0x392515['tabIndex']||0x0)),_0xa7ee47=_0xe9bb6b['indexOf'](_0x153102),_0x3c5890=_0xe9bb6b[(_0xa7ee47+0x1)%_0xe9bb6b['length']];_0x3c5890&&_0x3c5890['focus']();}(this['view']['element']),this['hideDropdown'](),_0x4d2d96();}),_0x22d233['focusTracker']['add'](this['view']['element']),_0x22d233['focusTracker']['on']('change:isFocused',(_0x50c9d7,_0x94a843,_0x53f5ef)=>{_0x53f5ef||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 _0x2570ba{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};
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /**
6
6
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
8
  */
9
9
  /**
10
10
  * @module real-time-collaboration/presencelist/presencelistui
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /**
6
6
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
8
  */
9
9
  import { View } from 'ckeditor5/src/ui.js';
10
10
  import type { Locale } from 'ckeditor5/src/utils.js';
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /**
6
6
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
8
  */
9
9
  import { ListItemView } from 'ckeditor5/src/ui.js';
10
10
  import type { Locale } from 'ckeditor5/src/utils.js';
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /**
6
6
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
8
  */
9
9
  /**
10
10
  * @module real-time-collaboration/presencelist/view/presencedropdownlistview