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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/build/real-time-collaboration.js +1 -1
  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 _0x28c33e,Plugin as _0x266e72,PendingActions as _0x4e9cba,Context as _0x5c34e8}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x53e42e,CKEditorError as _0x37bed6,Collection as _0x12570d,global as _0x1b9bae,version as nt,uid as _0x5ea109,KeystrokeHandler as _0x12f1de}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x1032c2,View as _0x4d54c6,ListView as _0x25c79c,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x52aab4,clickOutsideHandler as _0x77def9,BodyCollection as _0x2ee6b3}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x393855,NoOperation as _0x3892b7,InsertOperation as _0x17a03e,MarkerOperation as _0x23dfd1,RootAttributeOperation as _0x3a7055,transformSets as _0x11eeae,OperationFactory as _0x4d3b91}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x1cb2dd,CollaborativeEditingService as _0x15a394,User as dt,CommentsService as _0x5c5406,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x4b7120,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x2699d4}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x5c575a}from'lodash-es';class c extends _0x28c33e{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x1032c2];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x297aba){super(_0x297aba),this['set']('state',_0x1cb2dd['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x53e42e);}['init'](){const _0x1ff944=this['context'],_0x273d59=_0x1ff944['plugins']['get']('CloudServices'),_0x1a7df4=_0x1ff944['plugins']['get'](_0x1032c2);if(!_0x273d59['token'])throw new _0x37bed6('websocketgateway-missing-token',this);if(!_0x273d59['webSocketUrl'])throw new _0x37bed6('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'](_0x273d59['token'],_0x273d59['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x1f53b9=>{if(this['connection']=_0x1f53b9,this['bind']('state')['to'](_0x1f53b9,'state',this,'_isBrowserOffline',(_0x28f108,_0x2d23b3)=>('connected'!==_0x28f108&&(this['_shouldPluginsReconnect']=!0x0),_0x2d23b3||_0x28f108!==_0x1cb2dd['CONNECTED']?_0x1cb2dd['DISCONNECTED']:this['state']==_0x1cb2dd['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x1cb2dd['CONNECTING']):_0x1cb2dd['CONNECTED'])),this['connection']['on']('error',(_0x495dfc,_0x58b7d7)=>{if('limitExceeded'!==_0x58b7d7['code'])throw console['error'](_0x58b7d7),new _0x37bed6('cloudservices-init',null,{'originalError':_0x58b7d7});_0x1a7df4['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'});}),!_0x1f53b9['me'])return new Promise(_0x4f8b9f=>_0x1f53b9['on']('change:me',_0x4f8b9f));})['catch'](_0x5a6111=>{throw console['error'](_0x5a6111),new _0x37bed6('cloudservices-init',null,{'originalError':_0x5a6111});});}['addToReconnectionStack'](_0x557a1d){if('function'!=typeof _0x557a1d['reconnect'])throw new _0x37bed6('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x557a1d))throw new _0x37bed6('websocketgateway-plugin-already-registered',this,{'name':_0x557a1d['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x557a1d);}['removeFromReconnectionStack'](_0x58f795){this['_reconnectionStack']['delete'](_0x58f795);}['isInReconnectionStack'](_0x38e147){return this['_reconnectionStack']['has'](_0x38e147);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x22f580=>_0x22f580['reconnect']())))['then'](()=>this['state']=_0x1cb2dd['CONNECTED'])['catch'](_0x23fd2a=>{throw console['error'](_0x23fd2a),new _0x37bed6('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x1cb2dd['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x28c33e{['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,_0x4b7120];}constructor(_0x5a3a29){super(_0x5a3a29),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x12570d(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x4b7120);}['init'](){const _0x5eecdd=this['context']['plugins']['get'](c);this['listenTo'](_0x5eecdd,'change:state',(_0x270067,_0x4abfb8,_0x3dc1ec)=>{if('connected'!==_0x3dc1ec)this['channelSessions']['forEach'](_0x430617=>_0x430617['clear']()),this['channelConnectedUsers']['forEach'](_0x19380f=>_0x19380f['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x39f846,_0x529c06]of this['_registeredSessions'])for(const _0x40c3fb of _0x529c06)this['_handleSessionAdd'](_0x39f846,_0x40c3fb);}}),this['_createUser'](_0x5eecdd['connection']['me'],!0x0);}['register'](_0x367ea8,_0x32adcb){if(this['_registeredSessions']['has'](_0x367ea8))throw new _0x37bed6('sessions-register-already-registered',null,{'channelId':_0x367ea8});this['_registeredSessions']['set'](_0x367ea8,_0x32adcb),this['channelSessions']['set'](_0x367ea8,new _0x12570d()),this['channelConnectedUsers']['set'](_0x367ea8,new _0x12570d()),this['listenTo'](_0x32adcb,'add',(_0x16e90a,_0x40de66)=>this['_handleSessionAdd'](_0x367ea8,_0x40de66)),this['listenTo'](_0x32adcb,'remove',(_0x416eef,_0x568700)=>this['_handleSessionRemove'](_0x367ea8,_0x568700));for(const _0x4fa0da of _0x32adcb)this['_handleSessionAdd'](_0x367ea8,_0x4fa0da);}['unregister'](_0x2c82e7){if(!this['_registeredSessions']['has'](_0x2c82e7))throw new _0x37bed6('sessions-unregister-not-exist',null,{'channelId':_0x2c82e7});const _0x5c4528=this['_registeredSessions']['get'](_0x2c82e7);this['stopListening'](_0x5c4528);for(const _0x69b1dd of _0x5c4528)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x2c82e7,_0x69b1dd);this['_registeredSessions']['delete'](_0x2c82e7),this['channelSessions']['delete'](_0x2c82e7),this['channelConnectedUsers']['delete'](_0x2c82e7);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0xb540a6){for(const _0x3af3f4 of this['channelSessions']['values']())for(const _0x2accde of _0x3af3f4)if(_0x2accde['id']===_0xb540a6)return _0x2accde['user'];}['getUserSessions'](_0x1c5cfa,_0x5abf1f){const _0x554776=_0x5abf1f?[this['channelSessions']['get'](_0x5abf1f)]:this['channelSessions']['values'](),_0x3d0f3f=new Set();for(const _0x1d7429 of _0x554776)for(const _0x11d9f7 of _0x1d7429)_0x11d9f7['user']['id']===_0x1c5cfa['id']&&_0x3d0f3f['add'](_0x11d9f7['id']);return _0x3d0f3f;}['getUserRole'](_0x5d53d0){for(const _0x165223 of this['channelSessions']['values']())for(const _0x48b13e of _0x165223)if(_0x48b13e['user']===_0x5d53d0)return _0x48b13e['role'];}['_handleSessionAdd'](_0x3b8117,_0x22f276){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x1588a7=_0x22f276['user'],_0x43d1d8=this['_users']['getUser'](_0x1588a7['id'])||this['_createUser'](_0x1588a7),_0x4de937=Object['assign']({},_0x22f276,{'user':_0x43d1d8});this['channelSessions']['get'](_0x3b8117)['add'](_0x4de937);const _0x58138f=this['channelConnectedUsers']['get'](_0x3b8117);_0x58138f['has'](_0x43d1d8['id'])||_0x58138f['add'](_0x43d1d8),this['allConnectedUsers']['has'](_0x43d1d8['id'])||this['allConnectedUsers']['add'](_0x43d1d8,_0x43d1d8['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x3b8117,{'channelId':_0x3b8117,'session':_0x4de937});}['_handleSessionRemove'](_0x5763ed,_0xc5173){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x18d19b=this['channelConnectedUsers']['get'](_0x5763ed),_0x17f562=_0xc5173['user'];_0x17f562['id']&&(this['channelSessions']['get'](_0x5763ed)['remove'](_0xc5173['id']),_0x18d19b['has'](_0x17f562['id'])&&!this['getUserSessions'](_0x17f562,_0x5763ed)['size']&&_0x18d19b['remove'](_0x17f562['id']),this['allConnectedUsers']['get'](_0x17f562['id'])&&!this['getUserSessions'](_0x17f562)['size']&&this['allConnectedUsers']['remove'](_0x17f562['id']));}['_createUser'](_0x5bbfce,_0xbead31){const _0x5e57de=this['_users']['addUser'](_0x5bbfce);return _0xbead31&&this['_users']['defineMe'](_0x5bbfce['id']),_0x5e57de['orderNumber']=this['_uniqueUsersCount']++,_0x5e57de;}}class H extends _0x266e72{['_domEmitter']=new(_0x53e42e())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2c7013=this['editor'],_0x2cf2aa=_0x2c7013['plugins']['get'](i);_0x2c7013['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x10dce5,{writer:_0x34ce64})=>function(_0x2c2bc4,_0x462c58,_0x431f58,_0x3dfa1d){const _0xa08f2f=_0x2c2bc4['markerName']['split'](':')[0x2],_0x43f527=_0x431f58['getUserBySessionId'](_0xa08f2f);if(!_0x43f527||_0xa08f2f===_0x431f58['mySessionId'])return;if(!_0x3dfa1d['model']['schema']['checkChild'](_0x2c2bc4['markerRange']['start'],'$text'))return;const _0x530d3a={'class':'ck-user__marker\x20'+_0x43f527['color']['getMarkerClass'](),'data-name':_0x43f527['name'],'data-session-id':_0xa08f2f},_0x173ee0=_0x3dfa1d['model']['markers']['get'](_0x2c2bc4['markerName']),_0x268434=_0x173ee0['getStart'](),_0x5bf25c=_0x268434['nodeAfter'],_0x313a13=_0x3dfa1d['model']['schema'];if(_0x5bf25c&&_0x313a13['isObject'](_0x5bf25c)&&_0x313a13['isInline'](_0x5bf25c)&&!_0x3dfa1d['model']['markers']['get']('user:range:'+_0xa08f2f)['getRange']()['isCollapsed'])return;const _0xd45b84=_0x268434['parent'];return _0x3dfa1d['model']['schema']['isLimit'](_0xd45b84)&&!_0x3dfa1d['model']['hasContent'](_0xd45b84)&&(_0x530d3a['contenteditable']=!0x1),function(_0x2a6203,_0x402be8,_0x2bfea3){const _0x5d4d8f=_0x2a6203['createUIElement']('span',_0x402be8);return _0x2a6203['setCustomProperty']('userPositionMarker',!0x0,_0x5d4d8f),_0x5d4d8f['render']=function(_0x87b3e1){const _0x2a3059=this['toDomElement'](_0x87b3e1);return _0x2a3059['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>'+_0x2bfea3['name']+'</span>⁠',_0x2a3059['addEventListener']('mouseenter',()=>{_0x2a3059['classList']['add']('ck-user__marker_hovered');}),_0x2a3059['addEventListener']('mouseleave',()=>{_0x2a3059['classList']['remove']('ck-user__marker_hovered');}),_0x2a3059;},_0x5d4d8f['isSimilar']=function(_0xfbb685){return!(!this['getCustomProperty']('userPositionMarker')||!_0xfbb685['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0xfbb685['getAttribute']('data-session-id'));},_0x5d4d8f;}(_0x462c58,_0x530d3a,_0x43f527);}(_0x10dce5,_0x34ce64,_0x2cf2aa,_0x2c7013)}),_0x2c7013['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x5e905f=>function(_0x598dee,_0x1898a2){const _0x2eb78e=_0x598dee['markerName']['split'](':')[0x2];if(_0x2eb78e===_0x1898a2['mySessionId'])return null;const _0x3b746e=_0x1898a2['getUserBySessionId'](_0x2eb78e);if(!_0x3b746e)return{'id':_0x2eb78e,'classes':[]};return{'id':_0x2eb78e,'classes':['ck-user__selection',_0x3b746e['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x2eb78e},'priority':0x7d0+_0x3b746e['orderNumber']};}(_0x5e905f,_0x2cf2aa)}),function(_0x5bf08a){const _0x6bee63=_0x5bf08a['model'],_0x1506c9=new Map(),_0x1f5c90=_0x5bf08a['plugins']['get'](i);_0x6bee63['markers']['on']('update:user:range',(_0x2c87c3,_0x2b07ce,_0x4cad69,_0x4a6c72)=>{if(!_0x4a6c72&&_0x1506c9['get'](_0x2b07ce['name']))return _0x1506c9['get'](_0x2b07ce['name'])['detach'](),void _0x1506c9['delete'](_0x2b07ce['name']);const _0x38f922=_0x2b07ce['name']['split'](':')[0x2];if(_0x38f922===_0x1f5c90['mySessionId'])return;const _0x816c39='user:position:'+_0x38f922;_0x6bee63['markers']['has'](_0x816c39)&&_0x5bf08a['editing']['reconvertMarker'](_0x816c39),_0x2b07ce['on']('change:range',(_0x4b1815,_0xc7e59e,_0x451456)=>{if('$graveyard'!=_0xc7e59e['root']['rootName']&&'$graveyard'==_0x2b07ce['getRange']()['root']['rootName']&&!_0x1506c9['has'](_0x2b07ce['name'])){const _0x445769=_0x6bee63['schema']['getNearestSelectionRange'](_0x451456['deletionPosition']);if(_0x445769){const _0x438cca=ht['fromRange'](_0x445769);_0x1506c9['set'](_0x2b07ce['name'],_0x438cca),_0x438cca['on']('change:range',(_0x1e1d24,_0x1ebae6,_0x5ef384)=>{if('$graveyard'==_0x438cca['root']['rootName']){const _0x1b64d9=_0x6bee63['schema']['getNearestSelectionRange'](_0x5ef384['deletionPosition']);_0x1b64d9?(_0x438cca['start']=_0x1b64d9['start'],_0x438cca['end']=_0x1b64d9['end']):(_0x1506c9['delete'](_0x2b07ce['name']),_0x438cca['detach']());}});}}});}),_0x6bee63['document']['on']('change',()=>{_0x1506c9['size']>0x0&&_0x6bee63['enqueueChange']({'isUndoable':!0x1},_0x3bd57d=>{for(const [_0x4c5fb5,_0x52040b]of _0x1506c9)'$graveyard'==_0x6bee63['markers']['get'](_0x4c5fb5)['getRange']()['root']['rootName']&&(re(_0x4c5fb5['split'](':')[0x2],_0x52040b['toRange'](),_0x6bee63,_0x3bd57d),_0x52040b['detach']());_0x1506c9['clear']();});});}(_0x2c7013),this['_domEmitter']['listenTo'](_0x1b9bae['document'],'keydown',(_0x11ce20,{key:_0x25bd1a})=>{'Escape'===_0x25bd1a&&function(_0x3dba1e){_0x3dba1e['editing']['view']['change'](_0x38f114=>{for(const _0x416995 of _0x3dba1e['model']['markers']){if(!_0x416995['name']['startsWith']('user:position'))continue;const _0x42d724=_0x3dba1e['editing']['mapper']['markerNameToElements'](_0x416995['name']);if(_0x42d724){for(const _0x505c08 of _0x42d724)_0x38f114['removeClass']('ck-user__marker_hovered',_0x505c08);}}});}(_0x2c7013);},{'useCapture':!0x0});}['afterInit'](){const _0x50db60=this['editor'],_0x52ecbb=_0x50db60['commands']['get']('undo');_0x52ecbb&&_0x50db60['model']['on']('applyOperation',(_0x3f99b4,_0x1ecde1)=>{const _0xfb81e2=_0x1ecde1[0x0];if('marker'!=_0xfb81e2['type']||!_0xfb81e2['name']['startsWith']('user:'))return;const _0x378d5b=_0xfb81e2['batch'];_0x52ecbb['_createdBatches']['has'](_0x378d5b)&&(_0xfb81e2['newRange']=_0xfb81e2['oldRange']?_0x50db60['model']['createRange'](_0xfb81e2['oldRange']['start'],_0xfb81e2['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x227ca4=this['editor'],_0x47a1eb=_0x227ca4['model']['document'],_0xa6379a=_0x227ca4['plugins']['get'](i);_0x227ca4['model']['enqueueChange']({'isUndoable':!0x1},_0x2585fb=>{const _0x1bc0f9='user:range:'+_0xa6379a['mySessionId'],_0x49dd5d='user:position:'+_0xa6379a['mySessionId'],_0x21c24b=_0x227ca4['model']['markers']['has'](_0x1bc0f9);_0x227ca4['editing']['view']['hasDomSelection']?re(_0xa6379a['mySessionId'],_0x47a1eb['selection']['getFirstRange'](),_0x227ca4['model'],_0x2585fb):_0x21c24b&&(_0x2585fb['removeMarker'](_0x1bc0f9),_0x2585fb['removeMarker'](_0x49dd5d));});}}function re(_0xc93b1,_0x1eb891,_0x49b1b3,_0x5c1876){const _0x4c8f33='user:range:'+_0xc93b1,_0x3e354c='user:position:'+_0xc93b1,_0x13ad87=_0x1eb891['getContainedElement']();let _0x296847=_0x1eb891['start'];_0x13ad87&&_0x13ad87['is']('element','tableCell')&&(_0x296847=function(_0x45f827,_0xca40e8){for(const _0xd89f34 of _0x45f827['getPositions']())if(_0xca40e8['schema']['checkChild'](_0xd89f34,'$text'))return _0xd89f34;}(_0x1eb891,_0x49b1b3),_0x1eb891=_0x5c1876['createRange'](_0x296847));const _0x208b4f=_0x5c1876['createRange'](_0x296847);_0x49b1b3['markers']['has'](_0x4c8f33)?(_0x5c1876['updateMarker'](_0x4c8f33,{'range':_0x1eb891}),_0x5c1876['updateMarker'](_0x3e354c,{'range':_0x208b4f})):(_0x5c1876['addMarker'](_0x4c8f33,{'range':_0x1eb891,'usingOperation':!0x0}),_0x5c1876['addMarker'](_0x3e354c,{'range':_0x208b4f,'usingOperation':!0x0}));}function q(_0x48748c,_0x3fe676,_0x431876){const _0x18c3ee=_0x48748c['t'],t=_0x48748c['t'];switch(_0x3fe676){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 _0x18c3ee({'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'},_0x431876);default:return'';}}let K=0x1;class l extends _0x266e72{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x15a394)());['_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,_0x4e9cba,_0x4b7120,_0x1032c2];}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 _0x1444ef=this['serverHistory']['getOperations']();for(let _0x306e2b=_0x1444ef['length']-0x1;_0x306e2b>=0x0;_0x306e2b--){const _0x25d3dc=_0x1444ef[_0x306e2b];if(!this['_disconnectionOperations']['has'](_0x25d3dc))return _0x25d3dc['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2a7414){if(super(_0x2a7414),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x393855(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x37bed6('collaboration-missing-channelid',this);const _0xcc9ea8=_0x2a7414['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0xcc9ea8,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x2699d4(),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 _0x3857f8=this['editor'],_0x2188b5=_0x3857f8['plugins']['get'](_0x4b7120),_0x45e236=_0x3857f8['plugins']['get'](c);this['listenTo'](_0x2188b5,'getOperationAuthor',(_0x710acc,_0x596687)=>{const _0x213a13=_0x596687[0x0];_0x213a13['_authorId']&&(_0x710acc['return']=_0x2188b5['getUser'](_0x213a13['_authorId']),_0x710acc['stop']()),null===_0x213a13['_authorId']&&(_0x710acc['return']=null,_0x710acc['stop']());},{'priority':'high'}),this['listenTo'](_0x3857f8['model']['document']['selection'],'change:range',(_0x4f415f,_0x14a073)=>{_0x14a073['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x3857f8['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x3857f8['model']['on']('applyOperation',(_0x37a622,_0x4d9c15)=>{const _0xa73d29=_0x4d9c15[0x0];_0xa73d29['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0xa73d29),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x45e236,'state',this,'_hasSynchronizationProblem',(_0x573552,_0x4f5032)=>'connected'===_0x573552&&!_0x4f5032),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x3857f8['disableReadOnlyMode']('rtc-offline'):_0x3857f8['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x3857f8['disableReadOnlyMode']('rtc-offline'):_0x3857f8['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x109cb3=this['editor']['plugins']['get'](i),_0x192baf=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x109cb3['unregister'](this['_channelId']);const _0x69a9ac=await this['_service']['reconnect'](_0x192baf['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x69a9ac)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x5b631b=await this['_service']['getConnectedSessions']();_0x109cb3['register'](this['_channelId'],_0x5b631b),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0xd6b46e){if(function(_0x59ee60){return'404'===_0x59ee60['code'];}(_0xd6b46e)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x195dcf){return'409'===_0x195dcf['code'];}(_0xd6b46e)){const _0x2a9a76=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'](_0x2a9a76);}else{if(!(_0xd6b46e instanceof J))throw _0xd6b46e;this['_handleReconnectionError']();}}}}['destroy'](){const _0x2f866b=this['editor']['plugins']['get'](c),_0x29379d=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x29379d['channelSessions']['has'](this['_channelId'])&&_0x29379d['unregister'](this['_channelId']),_0x2f866b['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x10c172){if(this['sessionId']!==_0x10c172['sessionId']&&this['_lastSyncedOperationId']!==_0x10c172['lastOperationId'])throw new J();return this['sessionId']=_0x10c172['sessionId'],this['_handleServerResponse']([],{..._0x10c172,'wereChangesApplied':!0x1,'data':_0x10c172['data']},'reconnect');}async['_connectService'](_0x2eb9eb,_0x1aa5b9=!0x1){const {connection:_0x3cd206}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x3cd206,this['_channelId'])['then'](_0x3234dc=>this['_initSessionsHandling'](_0x3234dc))['catch'](_0x4f930e=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4f930e);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x1256c4,_0x5e7b76)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x5e7b76);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x52c298=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2eb9eb);this['_isPendingUpdate']=!0x0;const _0x543170=await this['_service']['connect'](_0x3cd206,this['_compressOperations'](_0x2eb9eb),_0x52c298);if(this['sessionId']=_0x543170['sessionId'],_0x1aa5b9){if(!_0x543170['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x543170['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x2eb9eb,_0x543170,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x543170,_0x2eb9eb);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x1889b4=this['editor']['plugins']['get'](i),_0x51dbd4=this['editor']['plugins']['get'](H),_0x5e81e0=_0x1889b4['channelSessions']['get'](this['_channelId']);_0x5e81e0&&_0x5e81e0['length']>0x1?_0x51dbd4['createUserMarkerOperations']():this['listenTo'](_0x1889b4,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x1889b4['channelSessions']['get'](this['_channelId'])['length']&&_0x51dbd4['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x342ff7,_0x105e95,_0x113109,_0x52da5b){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x105e95){const _0x4ce755=this['_decompressOperations'](_0x113109,_0x52da5b);await this['_fetchMissingUsers'](_0x4ce755),this['_handleExternalOperations'](_0x4ce755,_0x105e95,_0x113109['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x504472}=this['editor'];let _0x30c3eb;try{_0x30c3eb=await this['_service']['getDocumentDetails']();}catch(_0x77090e){const _0x317dfd=q(_0x504472,'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'](_0x317dfd);}const _0x4e9333=_0x30c3eb['currentDocumentSession']||_0x30c3eb['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x4e9333['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x46053d=q(_0x504472,'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'](_0x46053d);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0xe24146){const _0x2c25e1=this['editor']['plugins']['get'](i);this['listenTo'](_0x2c25e1,'sessionAdd:'+this['_channelId'],(_0x683113,{session:_0x59b858})=>{if(_0x59b858['id']===_0x2c25e1['mySessionId']){_0x683113['off']();const _0x102f84=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x4fc742=_0x59b858['permissions'];_0x102f84&&_0x102f84['isEnabled']&&(_0x4fc742=_0x4fc742['filter'](_0x48995a=>'document:write'!==_0x48995a)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x4fc742,this['_channelId']);}}),_0x2c25e1['register'](this['_channelId'],_0xe24146);}['_initThrowingOnDataSet'](){const _0x2a5a1c=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x596ef8)=>{if(!_0x596ef8[_0x596ef8['length']-0x1]['suppressErrorInCollaboration'])throw new _0x37bed6('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2a5a1c['apply'](this['editor']['data'],_0x596ef8);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x224f25,[_0xd05500])=>{if(this['_document']['version'])throw new _0x37bed6('realtimecollaborationclient-init-document-already-initialized',this);_0x224f25['stop'](),this['_setPendingAction']();const _0x38e349=this['editor']['config']['get']('rootsAttributes'),_0x402108=this['_getOperationsFromInitData'](_0xd05500,_0x38e349);0x0==_0x402108['length']&&_0x402108['push'](new _0x3892b7(0x0)),_0x224f25['return']=this['_connectService'](_0x402108)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0xd4288c=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0xd4288c))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3bbcd8,[_0x5f1445,_0x1d8ff5])=>{_0x3bbcd8['stop']();const _0xc09717=this['editor']['model']['document']['getRoot'](_0x5f1445);if(!this['_knownRootNames']['has'](_0x5f1445)){const _0x35e7ae=_0x1d8ff5&&_0x1d8ff5['data']?_0x1d8ff5['data']:'',_0x31c53e=_0x1d8ff5&&_0x1d8ff5['attributes']?_0x1d8ff5['attributes']:{};await this['_loadRoot'](_0x5f1445,_0x35e7ae,_0x31c53e);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0xc09717['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0xc09717);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x320c7a){const _0x13b6d5=this['editor']['plugins']['get'](_0x4b7120),{connection:_0x1cd8ad}=this['editor']['plugins']['get'](c),_0x39ffb6=new Set();for(const _0x232d5a of _0x320c7a){const _0x562a63=_0x232d5a['_authorId'];_0x562a63&&!_0x13b6d5['getUser'](_0x562a63)&&_0x39ffb6['add'](_0x562a63);}if(0x0===_0x39ffb6['size'])return;const _0x5d4fcb=await dt['getMany'](_0x1cd8ad,Array['from'](_0x39ffb6));for(const _0x32a3db of _0x5d4fcb)_0x13b6d5['getUser'](_0x32a3db['id'])||_0x13b6d5['addUser'](_0x32a3db);}['_getOperationsFromInitData'](_0x55ba3,_0x2c9063={}){const _0x52f669=this['editor']['model'],_0x563549=[];let _0x4604eb=0x0;const _0x5b0125='string'==typeof _0x55ba3?{'main':_0x55ba3}:_0x55ba3;for(const _0x22fb15 of Object['keys'](_0x5b0125)){if(!this['_document']['roots']['has'](_0x22fb15))throw new _0x37bed6('realtimecollaborationclient-init-non-existent-root',this);const _0x571088=this['editor']['data']['parse'](_0x5b0125[_0x22fb15]),_0x52b57f=this['_document']['getRoot'](_0x22fb15),_0x3342b8=new _0x17a03e(_0x52f669['createPositionAt'](_0x52b57f,0x0),_0x571088,_0x4604eb++);_0x563549['push'](_0x3342b8);for(const [_0x12646d,_0x568249]of _0x571088['markers']){const _0x3106df=_0x52f669['createRange'](_0x52f669['createPositionFromPath'](_0x52b57f,_0x568249['start']['path']['slice']()),_0x52f669['createPositionFromPath'](_0x52b57f,_0x568249['end']['path']['slice']())),_0xb6c83e=new _0x23dfd1(_0x12646d,null,_0x3106df,_0x52f669['markers'],!0x0,_0x4604eb++);_0x563549['push'](_0xb6c83e);}}if(_0x2c9063)for(const [_0x47de1e,_0x48adca]of Object['entries'](_0x2c9063)){const _0x2742bb=_0x52f669['document']['getRoot'](_0x47de1e);if(!_0x2742bb)throw new _0x37bed6('multi-root-editor-root-attributes-no-root',null);for(const [_0x1de691,_0xa96bd3]of Object['entries'](_0x48adca))if(null!==_0xa96bd3){const _0x46d422=new _0x3a7055(_0x2742bb,_0x1de691,null,_0xa96bd3,_0x4604eb++);_0x563549['push'](_0x46d422);}}return _0x563549;}async['_loadRoot'](_0x29b2cf,_0x5cd44f,_0x67f12f){this['_getOperationsFromInitData']({[_0x29b2cf]:_0x5cd44f},{[_0x29b2cf]:_0x67f12f})['forEach']((_0xf37d1d,_0x9a5891)=>{_0xf37d1d['baseVersion']=this['_document']['version']+_0x9a5891,_0xf37d1d['_isInit']=!0x0,this['_saveOperationInBuffer'](_0xf37d1d);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0xe7d19e,_0x5d379c){let _0x594d3f;this['_offset']=_0xe7d19e['offset'];const _0x44f24a=_0xe7d19e['wereChangesApplied']&&!_0xe7d19e['initData'],_0x11fd0f=_0x44f24a?0x0:_0xe7d19e['data']['baseVersion'];if(_0x5d379c['forEach'](_0x215746=>{_0x215746['_isInit']=!0x0,_0x215746['createdAt']=_0xe7d19e['sessionCreatedAt'],_0x215746['_authorId']=null;}),_0x44f24a)_0x594d3f=_0x5d379c,this['_applyOperationsSet'](_0x594d3f,_0x44f24a);else{if(_0xe7d19e['initData']){const _0x42b515=this['_getOperationsFromInitData'](_0xe7d19e['initData']);this['_document']['history']['version']=-_0x42b515['length'],_0x42b515['forEach'](_0x5c9fbd=>{_0x5c9fbd['baseVersion']-=_0x42b515['length'],_0x5c9fbd['createdAt']=_0xe7d19e['sessionCreatedAt'],_0x5c9fbd['_isInit']=!0x0,_0x5c9fbd['_authorId']=null;}),this['_applyOperationsSet'](_0x42b515,!0x0),this['serverHistory']['version']=-_0x42b515['length']+this['_offset'],this['_updateServerHistory'](_0x42b515);}this['_document']['history']['version']=_0x11fd0f,_0x594d3f=this['_decompressOperations'](_0xe7d19e['data'],_0xe7d19e['metadata']),await this['_fetchMissingUsers'](_0x594d3f),this['_applyOperationsSet'](_0x594d3f,_0x44f24a);}_0xe7d19e['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x594d3f,_0xe7d19e['lastOperationId']),this['_lastSyncedOperationId']=_0xe7d19e['lastOperationId']),this['serverHistory']['version']=_0x11fd0f+this['_offset'],this['_updateServerHistory'](_0x594d3f),_0x5d379c['filter'](_0x2fc930=>{const _0x44e0f2=this['_getAffectedRoot'](_0x2fc930);return _0x44e0f2&&!this['_knownRootNames']['has'](_0x44e0f2);})['forEach']((_0x27aa61,_0x2d0444)=>{_0x27aa61['baseVersion']=this['_document']['version']+_0x2d0444,this['_saveOperationInBuffer'](_0x27aa61);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x212d20,_0x6720a5,_0x22b859){throw this['_isPendingUpdate']=!0x0,_0x6720a5&&console['error'](_0x6720a5),_0x22b859&&this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x37bed6(_0x212d20,this['editor']);}['_saveOperationInBuffer'](_0x2e8d87){this['_knownOperations']['has'](_0x2e8d87)||(this['_knownOperations']['add'](_0x2e8d87),this['_bufferedOperations']['push'](_0x2e8d87),this['_pendingAction']||'marker'==_0x2e8d87['type']&&!_0x2e8d87['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x15d940=!0x1){!_0x15d940&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x3c2d57=>{_0x3c2d57&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x2ea1ff=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x11bd57){return _0x11bd57['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x11bd57['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x11bd57['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x2ea1ff)||this['_crash'](_0x2ea1ff['message'],_0x2ea1ff,!0x0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x170fed=>{this['on']('change:_isPendingUpdate',()=>{_0x170fed();});});}async['_sendBufferedOperations'](){const _0x1503b0=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x1503b0['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x33440f=[...this['_bufferedOperations']];for(const _0x174077 of _0x33440f)_0x174077['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x174077);const _0x325671=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x33440f),_0x1f8a63=K++,_0xc0a83d=this['_compressOperations'](_0x33440f),_0x5720c0=await this['_service']['sendOperations'](_0xc0a83d,_0xc0a83d['baseVersion'],_0x325671);try{return await this['_handleServerResponse'](_0x33440f,_0x5720c0,_0x1f8a63);}catch(_0x113c5a){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x113c5a);}}async['_handleServerResponse'](_0x5cadc2,_0x2110ab,_0x5cb233){if('error'in _0x2110ab)throw _0x2110ab['error'];let _0xbc4aee=!0x1;if(_0x2110ab['wereChangesApplied']){_0x2110ab['lastOperationId']&&(this['_lastSyncedOperationId']=_0x2110ab['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2ba82e=>!_0x5cadc2['includes'](_0x2ba82e));for(const _0x131c9c of _0x5cadc2)_0x131c9c['createdAt']='lastOperationAcceptedAt'in _0x2110ab&&_0x2110ab['lastOperationAcceptedAt']||void 0x0;Q(_0x5cadc2,_0x2110ab['version']-_0x5cadc2['length']),this['_updateServerHistory'](_0x5cadc2);const _0x476952=_0x5cadc2['filter'](_0x3e9ac4=>{if(!_0x3e9ac4['_isInit'])return!0x1;const _0x1a7b41=this['_getAffectedRoot'](_0x3e9ac4);return _0x1a7b41&&!this['_knownRootNames']['has'](_0x1a7b41);});Q(_0x476952,this['_document']['version']),this['_applyOperationsSet'](_0x476952),_0xbc4aee=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x131cf9=this['_decompressOperations'](_0x2110ab['data'],_0x2110ab['metadata'])['filter'](_0x50f49e=>_0x50f49e['baseVersion']>=this['_lastServerVersion']);_0x131cf9['forEach'](_0x4446bb=>this['_addKnownRoot'](_0x4446bb)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3595c2=>!_0x3595c2['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x3595c2))),this['_bufferedOperations']['length']&&Q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x131cf9),_0xbc4aee=this['_handleExternalOperations'](_0x131cf9,_0x2110ab['version'],_0x2110ab['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0xbc4aee?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x1d7482,_0x6403aa,_0x3769a5){try{const _0x1104f0={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x45ee60,operationsB:_0x2b4ac6,originalOperations:_0x3e58c1}=_0x11eeae(_0x1d7482,this['_bufferedOperations'],_0x1104f0);Q(_0x45ee60,this['_document']['version']),Q(_0x2b4ac6,_0x6403aa);for(const _0x1a57e5 of _0x45ee60){const _0x1e8fa8=_0x3e58c1['get'](_0x1a57e5);_0x1a57e5['_authorId']=_0x1e8fa8?_0x1e8fa8['_authorId']:null;}_0x3769a5&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1d7482,_0x3769a5),this['_lastSyncedOperationId']=_0x3769a5),this['_bufferedOperations']=[..._0x2b4ac6],this['_applyOperationsSet'](_0x45ee60),this['_updateServerHistory'](_0x1d7482);}catch(_0x4d4f67){return console['error'](_0x4d4f67),!0x1;}return!0x0;}['_applyOperationsSet'](_0x3dad1f,_0xacc0b8=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x39ff61=>{for(const _0x2ad4d3 of _0x3dad1f)this['_knownOperations']['add'](_0x2ad4d3),this['_addKnownRoot'](_0x2ad4d3),_0x39ff61['batch']['addOperation'](_0x2ad4d3),this['editor']['model']['applyOperation'](_0x2ad4d3);});}['_addKnownRoot'](_0x20034d){const _0xa31834=this['_getAffectedRoot'](_0x20034d);_0xa31834&&this['_knownRootNames']['add'](_0xa31834);}['_getAffectedRoot'](_0x10a9fe){let _0x3d0e0a,_0x42d0a6;switch(_0x10a9fe['type']){case'insert':_0x3d0e0a=_0x10a9fe['position']['root'];break;case'marker':if(_0x42d0a6=_0x10a9fe['newRange'],!_0x42d0a6)return null;_0x3d0e0a=_0x42d0a6['root'];break;case'addRootAttribute':_0x3d0e0a=_0x10a9fe['root'];break;case'addRoot':_0x3d0e0a=_0x10a9fe['affectedSelectable'];break;case'move':_0x3d0e0a=_0x10a9fe['targetPosition']['root'];break;default:return null;}return _0x3d0e0a['rootName'];}['_updateServerHistory'](_0x5d1dba){_0x5d1dba['forEach'](_0x5e3aca=>{const _0x3a7766=_0x5e3aca['clone']();_0x3a7766['_authorId']=_0x5e3aca['_authorId'],_0x3a7766['_isInit']=!!_0x5e3aca['_isInit'],_0x3a7766['createdAt']=_0x5e3aca['createdAt'],_0x3a7766['baseVersion']+=this['_offset'],_0x5e3aca['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x3a7766),this['serverHistory']['addOperation'](_0x3a7766);});}['_handleReconnectionError'](_0x4428bf){const _0xa4b865=this['editor']['plugins']['get']('Notification'),_0x8bd54=this['editor']['locale'];_0x4428bf||(_0x4428bf=q(_0x8bd54,'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.')),_0xa4b865['showWarning'](_0x4428bf,{'title':q(_0x8bd54,'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'](_0x4e9cba)['add'](q(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x4e9cba)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x22cc30){const _0x3e37bf=_0x22cc30['map'](_0x496725=>_0x496725['toJSON']());return this['_compressor']['compress'](_0x3e37bf);}['_decompressOperations'](_0x4b7cff,_0xf6b206){return this['_compressor']['decompress'](_0x4b7cff)['map']((_0x132b3e,_0x1a6747)=>{const _0x22ea2b='init'==_0xf6b206[_0x1a6747]['type'];if('InsertOperation'==_0x132b3e['__className']){const _0x5904f6=_0x132b3e['position']['root'];!this['_document']['getRoot'](_0x5904f6)&&(this['_document']['createRoot']('$root',_0x5904f6)['_isAttached']=!0x1);}const _0x4ea541=_0x4d3b91['fromJSON'](_0x132b3e,this['_document']);return _0x4ea541['wasUndone']=_0x132b3e['wasUndone'],_0x4ea541['_isInit']=_0x22ea2b,_0x4ea541['_authorId']=_0x22ea2b?null:_0xf6b206[_0x1a6747]['userId'],_0x4ea541['_isDisconnection']='cs:removeUser'===_0xf6b206[_0x1a6747]['type'],_0x4ea541['createdAt']=_0xf6b206[_0x1a6747]['createdAt'],_0x4ea541;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x178be8=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x178be8&&_0x178be8['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class J extends Error{}function Q(_0x101e4e,_0x349d9b){for(const _0x35a153 of _0x101e4e)_0x35a153['baseVersion']=_0x349d9b++;}class X{['_ignoredOperations'];['_operationToId'];constructor(_0x1624c4){this['_ignoredOperations']=_0x1624c4,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x5ef0c7){let _0x413368=_0x5ef0c7['length'];for(;_0x413368--;){const _0x28e9b2=_0x5ef0c7[_0x413368];if(!this['_ignoredOperations']['has'](_0x28e9b2)){if(!this['_operationToId']['has'](_0x28e9b2)){const _0x4e8144=_0x5ea109()['slice'](0x1,0x12);this['_operationToId']['set'](_0x28e9b2,_0x4e8144);}return this['_operationToId']['get'](_0x28e9b2);}}}['setIdForTheLastOperation'](_0x5dce6d,_0x46feea){if(!_0x46feea)return;let _0x5d71f2=_0x5dce6d['length'];for(;_0x5d71f2--;){const _0x4c14d6=_0x5dce6d[_0x5d71f2];this['_ignoredOperations']['has'](_0x4c14d6)||this['_operationToId']['set'](_0x4c14d6,_0x46feea);}}}class n extends _0x266e72{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x28c33e{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x5c5406)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x4b7120];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5a023a){super(_0x5a023a),this['_services']=new Map();}async['init'](){const _0x2644c2=this['context'],_0x25d3ee=_0x2644c2['plugins']['get']('CommentsRepository');if(_0x2644c2['plugins']['get'](c)['addToReconnectionStack'](this),_0x25d3ee['adapter']={'addCommentThread':async({channelId:_0x14c7f4,threadId:_0x4cc220,comments:_0x1b1747,resolvedAt:_0x3294b7,resolvedBy:_0x378165,context:_0x5d569b,attributes:_0x2b6271})=>{const _0x5e5394=await this['_getService'](_0x14c7f4)['addCommentThread']({'commentThreadId':_0x4cc220,'comments':_0x1b1747['map'](_0x314f9e=>function(_0x3926e7,_0x37474d,_0x1fccd5){return{'commentThreadId':_0x1fccd5,'commentId':_0x3926e7['commentId'],'userId':_0x3926e7['authorId'],'content':_0x3926e7['content'],'documentId':_0x37474d,'createdAt':_0x3926e7['createdAt'],'attributes':_0x3926e7['attributes']||{}};}(_0x314f9e,_0x14c7f4,_0x4cc220)),'resolvedAt':_0x3294b7,'resolvedBy':_0x378165,'context':_0x5d569b,'attributes':_0x2b6271})['catch'](ut);return{'threadId':_0x5e5394['commentThreadId'],'comments':_0x5e5394['comments']};},'getCommentThread':async({channelId:_0x52661e,threadId:_0x46a7c9})=>{const _0x37267e=await this['_getService'](_0x52661e)['getCommentThread'](_0x46a7c9)['catch'](ut);return _0x37267e['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x37267e]),{'threadId':_0x37267e['commentThreadId'],'comments':_0x37267e['comments']['map'](S),'context':_0x37267e['context'],'resolvedAt':_0x37267e['resolvedAt'],'resolvedBy':_0x37267e['resolvedBy'],'attributes':_0x37267e['attributes']||{}});},'updateCommentThread':async({channelId:_0x44e029,threadId:_0x4309d2,context:_0x3abe49,unlinkedAt:_0x1185de,attributes:_0x4d001a})=>this['_getService'](_0x44e029)['updateCommentThread']({'commentThreadId':_0x4309d2,'context':_0x3abe49,'attributes':_0x4d001a,'unlinkedAt':_0x1185de})['catch'](B)['catch'](ut),'resolveCommentThread':async({channelId:_0x3d2d4b,threadId:_0x2111ac})=>{const _0x815cfb=await this['_getService'](_0x3d2d4b)['resolveCommentThread'](_0x2111ac)['catch'](B)['catch'](ut);return{'threadId':_0x815cfb['commentThreadId'],'resolvedAt':_0x815cfb['resolvedAt'],'resolvedBy':_0x815cfb['resolvedBy']};},'reopenCommentThread':async({channelId:_0x19f44c,threadId:_0x54de01})=>this['_getService'](_0x19f44c)['reopenCommentThread'](_0x54de01)['catch'](B)['catch'](ut),'removeCommentThread':({channelId:_0x47e0a1,threadId:_0x20418d})=>this['_getService'](_0x47e0a1)['removeCommentThread'](_0x20418d)['catch'](B)['catch'](ut),'addComment':({channelId:_0x3cabfc,threadId:_0xb5950c,commentId:_0x40d2f1,content:_0x2eb523,attributes:_0x55550a})=>this['_getService'](_0x3cabfc)['addComment'](_0xb5950c,_0x40d2f1,_0x2eb523,_0x55550a)['catch'](ut),'updateComment':({channelId:_0x5782dc,threadId:_0xf1c7dc,commentId:_0x61091,content:_0x3c1706,attributes:_0x344d9d})=>this['_getService'](_0x5782dc)['updateComment'](_0xf1c7dc,_0x61091,_0x3c1706,_0x344d9d)['catch'](B)['catch'](ut),'removeComment':({channelId:_0x5c9360,threadId:_0x156b47,commentId:_0x221400})=>this['_getService'](_0x5c9360)['removeComment'](_0x156b47,_0x221400)['catch'](B)['catch'](ut)},_0x2644c2 instanceof _0x5c34e8){const _0x2d65b1=_0x2644c2['config']['get']('collaboration.channelId'),_0x290a5d=_0x2644c2['plugins']['get'](i);await this['_setUpService'](_0x2d65b1);const _0x3b5fa6=await this['_services']['get'](_0x2d65b1)['getConnectedSessions']();this['listenTo'](_0x290a5d,'sessionAdd:'+_0x2d65b1,(_0x40a132,{session:_0x5af38e})=>{_0x5af38e['id']===_0x290a5d['mySessionId']&&(_0x40a132['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x5af38e['permissions'],_0x2d65b1));}),_0x290a5d['register'](_0x2d65b1,_0x3b5fa6);}}async['_setUpService'](_0x5775e3){if(this['_services']['has'](_0x5775e3))throw new _0x37bed6('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x5775e3});const _0x2d7b1f=this['context']['plugins']['get']('CommentsRepository'),_0x386b5a=new a['CommentsService'](_0x5775e3);this['_services']['set'](_0x5775e3,_0x386b5a),this['listenTo'](_0x386b5a,'commentThreadAdded',(_0x5a6e12,_0x2fffbf)=>{const {commentThreadId:_0x4b83f0,documentId:_0x4fc91f,context:_0x2a5812,attributes:_0x412ed3,resolvedAt:_0x26db41,resolvedBy:_0x15e116,comments:_0x5b6c7c}=_0x2fffbf;_0x2d7b1f['getCommentThread'](_0x4b83f0)||_0x2d7b1f['addCommentThread']({'threadId':_0x4b83f0,'channelId':_0x4fc91f,'comments':_0x5b6c7c?_0x5b6c7c['map'](S):[],'context':_0x2a5812,'attributes':_0x412ed3,'resolvedAt':_0x26db41,'resolvedBy':_0x15e116,'isFromAdapter':!0x0});}),this['listenTo'](_0x386b5a,'commentThreadUpdated',(_0x2e487f,{commentThreadId:_0x3a99fb,documentId:_0x944c2f,context:_0x22e03b,unlinkedAt:_0x2b5064,attributes:_0x1efead})=>{_0x2d7b1f['getCommentThread'](_0x3a99fb)&&_0x2d7b1f['updateCommentThread']({'threadId':_0x3a99fb,'channelId':_0x944c2f,'context':_0x22e03b,'unlinkedAt':_0x2b5064,'attributes':_0x1efead,'isFromAdapter':!0x0});}),this['listenTo'](_0x386b5a,'commentThreadResolved',(_0x177af0,{commentThreadId:_0x5c2758,resolvedBy:_0x2b47ec,resolvedAt:_0x4a4757})=>{const _0x201192=_0x2d7b1f['getCommentThread'](_0x5c2758);_0x201192&&_0x201192['resolve']({'resolvedBy':_0x2b47ec,'resolvedAt':_0x4a4757,'isFromAdapter':!0x0});}),this['listenTo'](_0x386b5a,'commentThreadReopened',(_0x41b103,{commentThreadId:_0xccd637})=>{const _0x531535=_0x2d7b1f['getCommentThread'](_0xccd637);_0x531535&&_0x531535['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x386b5a,'commentThreadRemoved',(_0x1254df,{commentThreadId:_0x3277cf})=>{const _0x2167a7=_0x2d7b1f['getCommentThread'](_0x3277cf);_0x2167a7&&_0x2167a7['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x386b5a,'commentAdded',(_0x4923c0,_0x95a7c0)=>{const _0x311a2b=_0x95a7c0['commentThreadId'],_0x3795da=_0x2d7b1f['getCommentThread'](_0x311a2b);_0x3795da&&_0x3795da['addComment']({...S(_0x95a7c0),'isFromAdapter':!0x0});}),this['listenTo'](_0x386b5a,'commentUpdated',(_0x36c730,{commentThreadId:_0x42cafe,commentId:_0x2f456f,content:_0x265db5,attributes:_0x3907ae})=>{const _0xbbdf4e=_0x2d7b1f['getCommentThread'](_0x42cafe);if(_0xbbdf4e){const _0x318f81=_0xbbdf4e['getComment'](_0x2f456f);_0x318f81&&_0x318f81['update']({'content':_0x265db5,'attributes':_0x3907ae,'isFromAdapter':!0x0});}}),this['listenTo'](_0x386b5a,'commentRemoved',(_0x48dfec,{commentThreadId:_0x28ffd7,commentId:_0x18397f})=>{const _0xfb54bc=_0x2d7b1f['getCommentThread'](_0x28ffd7);if(_0xfb54bc){const _0xbda1e6=_0xfb54bc['getComment'](_0x18397f);_0xbda1e6&&_0xbda1e6['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x5775e3);}['destroy'](){if(this['context']instanceof _0x5c34e8){const _0x52141b=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x52141b);}}['_terminateService'](_0xea722a){if(!this['_services']['has'](_0xea722a))throw new _0x37bed6('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0xea722a});this['_getService'](_0xea722a)['disconnect'](),this['_services']['delete'](_0xea722a);}async['reconnect'](){for(const _0x278660 of this['_services']['keys']())await this['_connectService'](_0x278660);if(this['context']instanceof _0x5c34e8){const _0x5deb66=this['context']['config']['get']('collaboration.channelId'),_0x4d7c11=this['context']['plugins']['get'](i);_0x4d7c11['unregister'](_0x5deb66);const _0x30ec74=await this['_services']['get'](_0x5deb66)['getConnectedSessions']();_0x4d7c11['register'](_0x5deb66,_0x30ec74);}}async['_connectService'](_0x13c6dc){const {connection:_0x4bc3d2}=this['context']['plugins']['get'](c),_0x5ca1aa=this['context']['plugins']['get']('CommentsRepository'),_0x38a1ea=this['_services']['get'](_0x13c6dc),_0x3a2635=await _0x38a1ea['connect'](_0x4bc3d2);await this['_fetchMissingUsersForThreads'](_0x3a2635);const _0x388b20=new Set(Array['from'](_0x5ca1aa['getCommentThreads']({'channelId':_0x13c6dc}),_0xcf24b1=>_0xcf24b1['id']));for(const _0x18ab49 of _0x3a2635)_0x18ab49['deletedAt']||_0x388b20['delete'](_0x18ab49['commentThreadId']);for(const _0x230fc0 of _0x388b20)_0x5ca1aa['getCommentThread'](_0x230fc0)['remove']({'isFromAdapter':!0x0});for(const _0x232757 of _0x3a2635){let _0x547409=_0x5ca1aa['getCommentThread'](_0x232757['commentThreadId']);const {commentThreadId:_0x2c2363,context:_0x594eb1,attributes:_0x10adf0,resolvedBy:_0xc56772,resolvedAt:_0x435dfb,unlinkedAt:_0x4cf4d4,deletedAt:_0x220a43}=_0x232757;if(_0x220a43)continue;_0x547409||(_0x547409=_0x5ca1aa['addCommentThread']({'channelId':_0x13c6dc,'threadId':_0x2c2363,'context':_0x594eb1,'attributes':_0x10adf0||{},'resolvedBy':_0xc56772,'resolvedAt':_0x435dfb,'unlinkedAt':_0x4cf4d4,'isFromAdapter':!0x0}));const _0x128fc7=new Set(Array['from'](_0x547409['comments'],_0x22de6e=>_0x22de6e['id']));for(const _0x5f5940 of _0x232757['comments'])_0x128fc7['delete'](_0x5f5940['commentId']);for(const _0x191896 of _0x128fc7)_0x547409['getComment'](_0x191896)['remove']({'isFromAdapter':!0x0});for(const _0x5179a6 of _0x232757['comments']){const _0x4f048e=_0x547409['getComment'](_0x5179a6['commentId']);_0x4f048e?_0x4f048e['content']!==_0x5179a6['content']&&_0x4f048e['update']({'content':_0x5179a6['content'],'isFromAdapter':!0x0}):_0x547409['addComment'](Object['assign'](S(_0x5179a6),{'isFromAdapter':!0x0}));}}}['_getService'](_0x328b16){if(!this['_services']['has'](_0x328b16))throw new _0x37bed6('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x328b16});return this['_services']['get'](_0x328b16);}async['_fetchMissingUsersForThreads'](_0x53e244){const _0x257059=this['context']['plugins']['get'](_0x4b7120),{connection:_0x2f91ce}=this['context']['plugins']['get'](c),_0x23f2a6=new Set();for(const {resolvedBy:_0x293228,comments:_0x2ae0dc}of _0x53e244){_0x293228&&!_0x257059['getUser'](_0x293228)&&_0x23f2a6['add'](_0x293228);for(const {userId:_0x5169d4}of _0x2ae0dc)_0x257059['getUser'](_0x5169d4)||_0x23f2a6['add'](_0x5169d4);}if(0x0===_0x23f2a6['size'])return;const _0x5ca0f5=await dt['getMany'](_0x2f91ce,Array['from'](_0x23f2a6));for(const _0x54a138 of _0x5ca0f5)_0x257059['getUser'](_0x54a138['id'])||_0x257059['addUser'](_0x54a138);}}async function B(_0x5bc103){if('404'!==_0x5bc103['code'])throw _0x5bc103;}function ut(_0x53440d){if((_0x1cec38=_0x53440d)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1cec38['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1cec38['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1cec38;throw _0x53440d;}function S(_0x152b5b){return{'threadId':_0x152b5b['commentThreadId'],'commentId':_0x152b5b['commentId'],'content':_0x152b5b['content'],'createdAt':_0x152b5b['createdAt'],'authorId':_0x152b5b['userId'],'attributes':_0x152b5b['attributes']||{}};}class f extends _0x266e72{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(_0x2ec6a2){super(_0x2ec6a2);const _0x96a24c=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x96a24c);}['init'](){const _0x875e11=this['editor']['plugins']['get'](c),_0x5c49a3=this['editor']['plugins']['get']('TrackChangesEditing');return _0x5c49a3['adapter']={'getSuggestion':async _0x2da8f3=>{await this['_waitForServiceReady']();const _0x5abcf1=await this['_trackChangesService']['get'](_0x2da8f3)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x5abcf1]),_0x5abcf1;},'addSuggestion':async({id:_0x37ef70,type:_0x3c1ccb,data:_0x24c000,originalSuggestionId:_0x3a7990,attributes:_0x19f6fd})=>{await this['_waitForServiceReady']();const _0x372118={'id':_0x37ef70,'type':_0x3c1ccb,'data':_0x24c000,'originalSuggestionId':_0x3a7990,'attributes':_0x19f6fd},_0x566306=await this['_trackChangesService']['add'](_0x37ef70,_0x3c1ccb,_0x24c000,_0x3a7990,_0x19f6fd)['catch'](_0x518a01=>{if(ft(_0x518a01))return new Promise(_0x92fb34=>{this['_bufferedRequests']['set'](_0x37ef70,{'resolve':_0x92fb34,'suggestionData':_0x372118});});throw _0x518a01;});return this['_bufferedRequests']['delete'](_0x37ef70),_0x566306;},'updateSuggestion':async(_0x13c883,_0x6742d8)=>{if(await this['_waitForServiceReady'](),'open'!==_0x6742d8['state'])return this['_trackChangesService']['update'](_0x13c883,_0x6742d8)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0xa649ac,_0x1e22bf)=>{_0x5c49a3['hasSuggestion'](_0x1e22bf['id'])&&(_0x5c49a3['getSuggestion'](_0x1e22bf['id'])['attributes']=_0x1e22bf['attributes']);}),this['_trackChangesService']['connect'](_0x875e11['connection'])['then'](_0x2fd973=>(_0x875e11['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x2fd973)['then'](()=>{for(const _0x33c5e8 of _0x2fd973){_0x5c49a3['addSuggestionData'](_0x33c5e8)['_saved']=!0x0;}})));}async['reconnect'](){const _0x136a59=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x573a9a}=this['editor']['plugins']['get'](c),_0xca6e79=await this['_trackChangesService']['connect'](_0x573a9a);await this['_fetchMissingUsersForThreads'](_0xca6e79);for(const {suggestionData:_0x458240,resolve:_0x117b00}of this['_bufferedRequests']['values']()){let _0x3f30a9=_0xca6e79['find'](_0x2dc1f8=>_0x2dc1f8['id']===_0x458240['id']);_0x3f30a9||(_0x3f30a9=await this['_trackChangesService']['add'](_0x458240['id'],_0x458240['type'],_0x458240['data'],_0x458240['originalSuggestionId'])),_0x117b00(_0x3f30a9);}for(const _0x4abf94 of _0xca6e79)_0x136a59['hasSuggestion'](_0x4abf94['id'])||_0x136a59['addSuggestionData'](_0x4abf94);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x17a35b=>{this['listenTo'](this['_trackChangesService'],'connected',_0xc55b62=>{_0xc55b62['off'](),_0x17a35b();});});}async['_fetchMissingUsersForThreads'](_0x2c5576){const _0x4106af=this['editor']['plugins']['get'](_0x4b7120),{connection:_0xa40c71}=this['editor']['plugins']['get'](c),_0x517c33=new Set();for(const {authorId:_0x471f16}of _0x2c5576)_0x4106af['getUser'](_0x471f16)||_0x517c33['add'](_0x471f16);if(0x0===_0x517c33['size'])return;const _0xd24eb4=await dt['getMany'](_0xa40c71,Array['from'](_0x517c33));for(const _0x2a8d6a of _0xd24eb4)_0x4106af['getUser'](_0x2a8d6a['id'])||_0x4106af['addUser'](_0x2a8d6a);}}function R(_0x2f700c){if(ft(_0x2f700c))return new Promise(()=>{});throw _0x2f700c;}function ft(_0x2e4ef9){return _0x2e4ef9['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2e4ef9['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x266e72{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 _0xa27bd3=this['editor']['plugins']['get'](c),_0x432292=this['editor']['plugins']['get']('CommentsEditing'),_0x42719f=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0xa27bd3,'change:state',(_0x1a2ebd,_0x297056,_0x1fee89)=>{_0x432292['isThreadsLoadingPaused']='connected'!==_0x1fee89;});}),this['listenTo'](_0xa27bd3,'change:state',(_0x46557b,_0x4506b5,_0x23a588)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x23a588);}),_0x42719f['_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 _0x266e72{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 _0x266e72{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x4b7120];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x9e8594){super(_0x9e8594);const _0x43bc8e=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x43bc8e);}async['init'](){const _0x38a53c=this['editor']['plugins']['get'](l),_0x222449=_0x38a53c['serverHistory'],_0x6ea0b2=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x222449,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x38a53c['sessionId']});const _0x9c9ba4=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x3fd93c=await tt['isBundleUploaded'](_0x6ea0b2['connection'],_0x9c9ba4);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x5b28ed})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x5b28ed)),'updateRevisions':async _0x1946dc=>{await this['_waitForServiceReady']();const _0x3eb514=this['_revisionTracker']['currentRevision'];if(_0x3fd93c&&0x1===_0x1946dc['length']&&_0x1946dc[0x0]['id']===_0x3eb514['id'])return _0x1946dc;for(const _0x3f63ca of _0x1946dc)_0x3f63ca['id']===_0x3eb514['id']&&(_0x3f63ca['isEmptyCurrent']=_0x3f63ca['fromVersion']===_0x3f63ca['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x1946dc,this['_lastRequestId'])['then'](_0x20d8a7=>(this['_lastRequestId']=_0x20d8a7,_0x1946dc))['catch'](_0x18d6e6=>{if(st(_0x18d6e6)||'400'===_0x18d6e6['code']&&void 0x0!==_0x18d6e6['data']['wrongRequestId']){for(const _0x17a761 of _0x1946dc){!this['_revisionTracker']['repository']['getRevision'](_0x17a761['id'])||this['_revisionTracker']['_bufferUpdate'](_0x17a761['id'],_0x17a761,!0x1);}if(st(_0x18d6e6))throw _0x18d6e6;return _0x1946dc;}throw _0x18d6e6;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x9bf179,{revisionsData:_0x502c1b,requestId:_0x2687d0})=>{Math['max'](..._0x502c1b['map'](_0x1306d2=>_0x1306d2['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x502c1b,_0x2687d0);}):this['_handleRevisionsUpdate'](_0x502c1b,_0x2687d0);});const {revisions:_0x36464f,requestId:_0x1c38e7}=await this['_revisionHistoryService']['connect'](_0x6ea0b2['connection']);_0x6ea0b2['addToReconnectionStack'](this),this['_lastRequestId']=_0x1c38e7,await this['_fetchMissingUsers'](_0x36464f);for(const _0x852aa2 of _0x36464f)this['_revisionTracker']['addRevisionData'](_0x852aa2);this['listenTo'](_0x38a53c,'change:_isConnected',(_0x4629e4,_0x3acebb,_0x1fb6d8)=>{_0x1fb6d8&&(this['_oldOffset']=_0x38a53c['_offset'],_0x4629e4['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x6ea0b2,'state',_0x4e953f=>_0x4e953f===_0x1cb2dd['CONNECTED']);}async['reconnect'](){const _0x383c2c=this['editor']['plugins']['get'](c),_0x3b003f=this['editor']['plugins']['get'](l),_0x542b66=async()=>{const _0x5109ca=this['_revisionTracker']['currentRevision'],_0x534d26=_0x5109ca['id'],_0x56ae02=_0x534d26!==_0x3b003f['sessionId'];if(_0x56ae02){const _0x453061=_0x3b003f['_offset']-this['_oldOffset'],_0x9900de=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x5109ca['toVersion']+_0x453061!==_0x9900de){const _0x210dd3=_0x5109ca['fromVersion']+_0x453061,_0x4bf328=this['editor']['plugins']['get'](_0x4b7120),_0x16de79=this['_revisionTracker']['buildRevisionData']({'revision':_0x5109ca,'from':_0x210dd3,'to':_0x9900de});_0x16de79['id']=_0x5109ca['id'];const _0x2bd82c=_0x16de79['authorsIds']['map'](_0x16e7c2=>_0x4bf328['getUser'](_0x16e7c2));_0x5109ca['_update']({..._0x16de79,'authors':_0x2bd82c},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x5109ca['id'],_0x16de79,!0x0);}this['_revisionTracker']['_startingVersion']=_0x9900de,(_0x5109ca['toVersion']===_0x5109ca['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x534d26)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x534d26),this['_revisionTracker']['_createCurrentRevision'](_0x9900de));}const {revisions:_0x18c373,requestId:_0x1f97fd}=await this['_revisionHistoryService']['reconnect'](_0x383c2c['connection'],this['_lastRequestId']);_0x56ae02&&_0x18c373['length']>0x0?_0x3b003f['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x18c373),this['_handleRevisionsUpdate'](_0x18c373,_0x1f97fd),this['_revisionTracker']['sendBufferedUpdates']());};return _0x3b003f['_isConnected']?_0x542b66():new Promise((_0x22b62e,_0x128139)=>{_0x3b003f['once']('change:_isConnected',()=>{_0x542b66()['then'](_0x22b62e)['catch'](_0x128139);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x52c322=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x53e598=>{_0x53e598['off'](),_0x52c322();});});}['_getLatestVersionFromServerOperations'](){const _0x1ed8d3=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x30f8b8 of _0x1ed8d3)if('marker'!==_0x30f8b8['type']||_0x30f8b8['affectsData'])return _0x30f8b8['baseVersion']+0x1;}['_getLatestVersion'](){const _0x221f21=this['editor']['plugins']['get'](l);return new Promise(_0x3326ab=>{_0x221f21['_isPendingUpdate']?_0x221f21['once']('change:_isPendingUpdate',()=>{_0x3326ab(this['_getLatestVersionFromServerOperations']());}):_0x3326ab(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x50d8da,_0x435e0a){const _0x481dce=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x435e0a;for(const _0x48daa8 of _0x50d8da){const _0x672c27=_0x481dce['getRevision'](_0x48daa8['id']);if(_0x672c27){if((_0x48daa8['fromVersion']||_0x48daa8['toVersion'])&&(_0x48daa8['diffData']=null),_0x672c27===this['_revisionTracker']['currentRevision']){const _0xa1cee0=Math['max'](_0x672c27['toVersion'],_0x48daa8['toVersion']),_0xed695e=Math['max'](_0x672c27['fromVersion'],_0x48daa8['fromVersion']);let _0x306172;_0x672c27['toVersion']===_0x48daa8['toVersion']&&_0x672c27['fromVersion']===_0x48daa8['fromVersion']?(_0x306172=!0x0,this['_preventResendingRevisionData'](_0x48daa8)):_0x48daa8['toVersion']===_0xa1cee0&&_0x48daa8['fromVersion']===_0xed695e?_0x306172=!0x1:(_0x672c27['toVersion']===_0xa1cee0&&_0x672c27['fromVersion']===_0xed695e||this['_fixRevision']({'revision':_0x672c27,'from':_0xed695e,'to':_0xa1cee0}),_0x306172=!0x0),_0x306172&&(delete _0x48daa8['fromVersion'],delete _0x48daa8['toVersion'],delete _0x48daa8['diffData'],delete _0x48daa8['createdAt'],delete _0x48daa8['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x48daa8),this['_preventResendingRevisionData'](_0x48daa8);}else this['_revisionTracker']['addRevisionData'](_0x48daa8);}const _0x5a8e60=_0x481dce['getRevisions']();_0x5a8e60['reverse']();for(let _0x14cc0f=0x0;_0x14cc0f<_0x5a8e60['length']-0x1;_0x14cc0f++){const _0x5d8ace=_0x5a8e60[_0x14cc0f],_0x11dd55=_0x5a8e60[_0x14cc0f+0x1];if(_0x5d8ace['fromVersion']<_0x11dd55['toVersion']){const _0x47aba5=_0x11dd55['toVersion'],_0x9f32a8=Math['max'](_0x47aba5,_0x5d8ace['toVersion']);this['_fixRevision']({'revision':_0x5d8ace,'from':_0x47aba5,'to':_0x9f32a8});}}}['_fixRevision']({revision:_0x4fab2f,from:_0xb21346,to:_0x57ee3b}={}){const _0xe7f1cb=this['editor']['plugins']['get'](_0x4b7120),_0x5da3fc=this['_revisionTracker']['buildRevisionData']({'revision':_0x4fab2f,'from':_0xb21346,'to':_0x57ee3b});_0x5da3fc['authors']=_0x5da3fc['authorsIds']['map'](_0x3d8296=>_0xe7f1cb['getUser'](_0x3d8296)),_0x4fab2f['_update'](_0x5da3fc);}['_preventResendingRevisionData'](_0x21b728){const _0xba194b={};_0xba194b['id']=_0x21b728['id'];for(const _0xc52ee of Object['keys'](_0x21b728))'id'!==_0xc52ee&&(_0xba194b[_0xc52ee]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0xba194b['id'],_0xba194b,!0x0);}async['_fetchMissingUsers'](_0x5983e4){const _0x23df4b=this['editor']['plugins']['get'](_0x4b7120),{connection:_0x491ea4}=this['editor']['plugins']['get'](c),_0x4e5edf=new Set();for(const _0x311fa8 of _0x5983e4){for(const _0x4f3a96 of _0x311fa8['authorsIds'])_0x4fa8dc(_0x4f3a96);_0x311fa8['creatorId']&&_0x4fa8dc(_0x311fa8['creatorId']);}if(0x0===_0x4e5edf['size'])return;const _0x578f9b=await dt['getMany'](_0x491ea4,Array['from'](_0x4e5edf));for(const _0x5aaf67 of _0x578f9b)_0x23df4b['getUser'](_0x5aaf67['id'])||_0x23df4b['addUser'](_0x5aaf67);function _0x4fa8dc(_0x3fcbdb){_0x23df4b['getUser'](_0x3fcbdb)||_0x4e5edf['add'](_0x3fcbdb);}}}function st(_0x739d15){return _0x739d15['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x739d15['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x739d15['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x266e72{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 _0x4d54c6{constructor(_0x1ce6c2){super(_0x1ce6c2);const _0x508469=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x508469['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x508469['to']('usersCount',_0x535cc6=>q(_0x1ce6c2,'CONNECTED_USERS',_0x535cc6))}]});}}class es extends _0x4d54c6{['items'];['keystrokes'];constructor(_0x2cbc89){super(_0x2cbc89);const _0x3f7120=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x12f1de(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x3f7120['if']('hasPopup'),'aria-expanded':_0x3f7120['to']('isExpanded',_0x411a5b=>this['hasPopup']&&String(_0x411a5b)),'aria-label':_0x3f7120['to']('hasPopup',_0xcf1315=>q(_0x2cbc89,_0xcf1315?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x3f7120['to']('hasPopup',_0x62ca07=>!!_0x62ca07&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x3f7120['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x2bcc86,_0x35b698,_0x47253d)=>{this['element']&&(_0x47253d?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 _0x4d54c6{['counterView'];['inlineListView'];constructor(_0x82ce99){super(_0x82ce99);const _0x433800=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x82ce99),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x45cac4 of this['inlineListView']['items'])_0x45cac4['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',_0x433800['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class j extends _0x4d54c6{['listWrapperView'];constructor(_0x33f4f9,_0x11511a){super(_0x33f4f9),this['listWrapperView']=new mt(_0x33f4f9,_0x11511a),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':q(_0x33f4f9,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class mt extends _0x25c79c{constructor(_0x5f23e3,_0x33f90b){super(_0x5f23e3);const _0x1ee76b=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x33f90b?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x1ee76b['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x1ee76b['to']('role'),'aria-label':_0x1ee76b['to']('ariaLabel'),'aria-labelledby':_0x1ee76b['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x1b9bae['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x5f3bca=this['element'];_0x5f3bca&&(this['_isScrollable']=Math['max'](_0x5f3bca['scrollHeight'],_0x5f3bca['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x18469b,_0xdaef2,_0x3e7dba){super(_0x18469b);const _0x3ffff0=this['bindTemplate'];this['userView']=new ct(_0x18469b,_0xdaef2);const _0x2d5f87={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0xdaef2['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0xdaef2['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0xdaef2['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x3e7dba&&(_0x2d5f87['tag']='button',_0x2d5f87['on']={'click':_0x3ffff0['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2d5f87);}['focus'](){this['element']['focus']();}}class y extends _0x4d54c6{['userView'];['markerView'];constructor(_0x305c33,_0x26324f,_0x2d1318){super(_0x305c33);const _0x54aa24=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x305c33,_0x26324f),this['markerView']=new at(_0x305c33,_0x26324f);const _0x57e581=new ot(_0x305c33);_0x57e581['template']['tag']='span',_0x57e581['text']=_0x26324f['name'];const _0x469c81={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x54aa24['to']('isFocusable',_0x27357d=>!!_0x27357d&&0x0),'aria-labelledby':_0x57e581['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x54aa24['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x54aa24['to']('hasTooltip',_0x279d88=>!_0x279d88),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x57e581]};_0x2d1318&&(_0x469c81['tag']='button',_0x469c81['on']={'click':_0x54aa24['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x469c81);}}class at extends _0x4d54c6{constructor(_0x49847a,_0x6e214d){super(_0x49847a),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x6e214d['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const A={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x28c33e{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x3edffb){super(_0x3edffb),this['context']['config']['define']('presenceList',A);const _0x222b8a=_0x3edffb['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x222b8a)throw new _0x37bed6('presencelist-collapseat-invalid-format',this);if(_0x222b8a<0x1)throw new _0x37bed6('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x12570d(),this['balloonPanelView']=new _0x52aab4(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x509178 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x509178);this['listenTo'](this['_allConnectedUsers'],'add',(_0xdcbcb,_0x44a4b8)=>{this['_handleUserAdd'](_0x44a4b8);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x30ad22,_0x565965)=>{this['_handleUserRemove'](_0x565965);});}['_createView'](){const _0x4d4f66=this['context'],_0x451dd0=new L(this['context']['locale']),_0x12e4f0=this['balloonPanelView'];if(!_0x5c575a(_0x4d4f66['config']['get']('presenceList.container')))throw new _0x37bed6('presencelist-missing-container',this);return _0x451dd0['counterView']['bind']('usersCount')['to'](this),_0x451dd0['bind']('isCollapsed')['to'](this,'usersCount',_0x15274e=>{const {collapseAt:_0x46450e,displayMe:_0x279796}=_0x4d4f66['config']['get']('presenceList'),_0x1ddd73=_0x15274e>=_0x46450e;return _0x451dd0['counterView']['isHidden']=!(0x1==_0x15274e&&_0x279796||_0x1ddd73),_0x1ddd73||this['hideDropdown'](),_0x1ddd73;}),_0x451dd0['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1c1ca8=>{const _0x48a9e7=_0x4d4f66['config']['get']('presenceList'),_0x3bb49a=new y(_0x4d4f66['locale'],_0x1c1ca8,!!_0x48a9e7['onClick']);return _0x3bb49a['bind']('hasTooltip')['to'](_0x451dd0,'isCollapsed',_0x3deb76=>!_0x3deb76),_0x3bb49a['bind']('isFocusable')['to'](_0x451dd0,'isCollapsed',_0x262a5f=>!_0x262a5f),_0x48a9e7['onClick']&&this['listenTo'](_0x3bb49a,'execute',()=>{this['view']['isCollapsed']||_0x48a9e7['onClick'](_0x1c1ca8,_0x3bb49a['element']);}),_0x3bb49a;}),this['listenTo'](_0x451dd0['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x451dd0['inlineListView']['keystrokes']['set']('Enter',(_0x366670,_0x110aa1)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x110aa1());}),_0x451dd0['render'](),_0x12e4f0['render'](),_0x77def9({'emitter':_0x451dd0,'activator':()=>_0x12e4f0['isVisible'],'contextElements':[_0x12e4f0['element'],_0x451dd0['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4d4f66['config']['get']('presenceList.container')['appendChild'](_0x451dd0['element']),this['_bodyCollection']=new _0x2ee6b3(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x451dd0;}['_handleUserAdd'](_0x1d2fee){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x1d2fee['isMe'])return;const _0xc5892=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0xc5892&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x7ea05e=_0x1d2fee['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x1d2fee,_0x7ea05e);}['_handleUserRemove'](_0x18b60d){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x18b60d['id'])&&(this['currentDisplayedUsers']['remove'](_0x18b60d['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x1a61dc of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x1a61dc['id']))return void this['currentDisplayedUsers']['add'](_0x1a61dc,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4507c1=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new j(this['context']['locale'],!!_0x4507c1['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x169745}=this['presenceDropdownView'];_0x169745['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x5ba426=>{if(!_0x4507c1['displayMe']&&_0x5ba426['isMe'])return null;const _0x2c3bb0=new k(this['context']['locale'],_0x5ba426,!!_0x4507c1['onClick']);return _0x4507c1['onClick']&&this['listenTo'](_0x2c3bb0,'execute',()=>{_0x4507c1['onClick'](_0x5ba426,_0x2c3bb0['element']);}),_0x2c3bb0;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x169745['focus'](),_0x169745['checkIfScrollable']();const _0x48463d=(_0x550b57,_0x486d4c)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x486d4c();};_0x169745['keystrokes']['set']('Esc',_0x48463d),_0x169745['keystrokes']['set']('Shift+Tab',_0x48463d),_0x169745['keystrokes']['set']('Tab',(_0x3db6fa,_0x554a53)=>{!function(_0x5c8e01){const _0x431345=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x22e870=>_0x22e870+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x22ccc6=[...document['body']['querySelectorAll'](_0x431345)]['filter'](_0x110aa2=>_0x110aa2===document['activeElement']||_0x110aa2['offsetWidth']+_0x110aa2['offsetHeight']>0x0)['sort']((_0x40a02d,_0x5a1ef5)=>(_0x40a02d['tabIndex']||0x0)-(_0x5a1ef5['tabIndex']||0x0)),_0x3edee9=_0x22ccc6['indexOf'](_0x5c8e01),_0x39c4f2=_0x22ccc6[(_0x3edee9+0x1)%_0x22ccc6['length']];_0x39c4f2&&_0x39c4f2['focus']();}(this['view']['element']),this['hideDropdown'](),_0x554a53();}),_0x169745['focusTracker']['add'](this['view']['element']),_0x169745['focusTracker']['on']('change:isFocused',(_0x4b7659,_0x25591f,_0x56fb1d)=>{_0x56fb1d||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 _0x28c33e{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 _0x37a9d3,Plugin as _0x50372a,PendingActions as _0x368f32,Context as _0x112e10}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x4c6426,CKEditorError as _0x408616,Collection as _0x5da562,global as _0x38475b,version as nt,uid as _0x301035,KeystrokeHandler as _0x60e8df}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x1d35e3,View as _0x32c1aa,ListView as _0x5e215a,ListItemView as et,LabelView as ot,BalloonPanelView as _0x4bb92d,clickOutsideHandler as _0x452c2f,BodyCollection as _0x400f02}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as at,History as _0x2d8e8d,NoOperation as _0x54ca34,InsertOperation as _0x4e5089,MarkerOperation as _0x184ddc,RootAttributeOperation as _0x3baf28,transformSets as _0x453bb3,OperationFactory as _0x1e5de9}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ht,WEB_SOCKET_GATEWAY_STATES as _0x39f1be,CollaborativeEditingService as _0x35ce65,User as lt,CommentsService as _0x2fcac4,TrackChangesService as _0x3715b6,RevisionHistoryService as _0x20d94b,EditorService as _0x2f88e7}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x4c3346,UserView as rt}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x439fc2}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x1667f2}from'lodash-es';class c extends _0x37a9d3{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x1d35e3];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x19c74c){super(_0x19c74c),this['set']('state',_0x39f1be['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x4c6426);}['init'](){const _0x2340db=this['context'],_0x2358d2=_0x2340db['plugins']['get']('CloudServices'),_0x204d81=_0x2340db['plugins']['get'](_0x1d35e3);if(!_0x2358d2['token'])throw new _0x408616('websocketgateway-missing-token',this);if(!_0x2358d2['webSocketUrl'])throw new _0x408616('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'](_0x2358d2['token'],_0x2358d2['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2b8af7=>{if(this['connection']=_0x2b8af7,this['bind']('state')['to'](_0x2b8af7,'state',this,'_isBrowserOffline',(_0x57a9c6,_0x3088cc)=>('connected'!==_0x57a9c6&&(this['_shouldPluginsReconnect']=!0x0),_0x3088cc||_0x57a9c6!==_0x39f1be['CONNECTED']?_0x39f1be['DISCONNECTED']:this['state']==_0x39f1be['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x39f1be['CONNECTING']):_0x39f1be['CONNECTED'])),this['connection']['on']('error',(_0x45feea,_0x29ac25)=>{if('limitExceeded'!==_0x29ac25['code'])throw console['error'](_0x29ac25),new _0x408616('cloudservices-init',null,{'originalError':_0x29ac25});_0x204d81['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'});}),!_0x2b8af7['me'])return new Promise(_0xd8e606=>_0x2b8af7['on']('change:me',_0xd8e606));})['catch'](_0x1a4be3=>{throw console['error'](_0x1a4be3),new _0x408616('cloudservices-init',null,{'originalError':_0x1a4be3});});}['addToReconnectionStack'](_0x19f3f4){if('function'!=typeof _0x19f3f4['reconnect'])throw new _0x408616('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x19f3f4))throw new _0x408616('websocketgateway-plugin-already-registered',this,{'name':_0x19f3f4['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x19f3f4);}['removeFromReconnectionStack'](_0x4bce05){this['_reconnectionStack']['delete'](_0x4bce05);}['isInReconnectionStack'](_0x7fd775){return this['_reconnectionStack']['has'](_0x7fd775);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x4864d0=>_0x4864d0['reconnect']())))['then'](()=>this['state']=_0x39f1be['CONNECTED'])['catch'](_0x3fdb4d=>{throw console['error'](_0x3fdb4d),new _0x408616('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x39f1be['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x37a9d3{['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,_0x4c3346];}constructor(_0x26a76d){super(_0x26a76d),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x5da562(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x4c3346);}['init'](){const _0x30a0fa=this['context']['plugins']['get'](c);this['listenTo'](_0x30a0fa,'change:state',(_0x5171da,_0x19b10a,_0x117b54)=>{if('connected'!==_0x117b54)this['channelSessions']['forEach'](_0x433229=>_0x433229['clear']()),this['channelConnectedUsers']['forEach'](_0x1b8c59=>_0x1b8c59['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x1b1c0e,_0x102eca]of this['_registeredSessions'])for(const _0x5b9dbd of _0x102eca)this['_handleSessionAdd'](_0x1b1c0e,_0x5b9dbd);}}),this['_createUser'](_0x30a0fa['connection']['me'],!0x0);}['register'](_0xaa7016,_0x556212){if(this['_registeredSessions']['has'](_0xaa7016))throw new _0x408616('sessions-register-already-registered',null,{'channelId':_0xaa7016});this['_registeredSessions']['set'](_0xaa7016,_0x556212),this['channelSessions']['set'](_0xaa7016,new _0x5da562()),this['channelConnectedUsers']['set'](_0xaa7016,new _0x5da562()),this['listenTo'](_0x556212,'add',(_0x409ab3,_0x1c4542)=>this['_handleSessionAdd'](_0xaa7016,_0x1c4542)),this['listenTo'](_0x556212,'remove',(_0x3d42bc,_0x45f841)=>this['_handleSessionRemove'](_0xaa7016,_0x45f841));for(const _0x1d12d4 of _0x556212)this['_handleSessionAdd'](_0xaa7016,_0x1d12d4);}['unregister'](_0x2e3809){if(!this['_registeredSessions']['has'](_0x2e3809))throw new _0x408616('sessions-unregister-not-exist',null,{'channelId':_0x2e3809});const _0x162ccb=this['_registeredSessions']['get'](_0x2e3809);this['stopListening'](_0x162ccb);for(const _0x502de8 of _0x162ccb)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x2e3809,_0x502de8);this['_registeredSessions']['delete'](_0x2e3809),this['channelSessions']['delete'](_0x2e3809),this['channelConnectedUsers']['delete'](_0x2e3809);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x14f0de){for(const _0x357871 of this['channelSessions']['values']())for(const _0x58349a of _0x357871)if(_0x58349a['id']===_0x14f0de)return _0x58349a['user'];}['getUserSessions'](_0x385825,_0x9c6073){const _0x430299=_0x9c6073?[this['channelSessions']['get'](_0x9c6073)]:this['channelSessions']['values'](),_0x296469=new Set();for(const _0x391ba9 of _0x430299)for(const _0x206f37 of _0x391ba9)_0x206f37['user']['id']===_0x385825['id']&&_0x296469['add'](_0x206f37['id']);return _0x296469;}['getUserRole'](_0x4f83d5){for(const _0x406933 of this['channelSessions']['values']())for(const _0x252324 of _0x406933)if(_0x252324['user']===_0x4f83d5)return _0x252324['role'];}['_handleSessionAdd'](_0x571b78,_0x31874a){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x25f633=_0x31874a['user'],_0x1bc4f2=this['_users']['getUser'](_0x25f633['id'])||this['_createUser'](_0x25f633),_0x4eba01=Object['assign']({},_0x31874a,{'user':_0x1bc4f2});this['channelSessions']['get'](_0x571b78)['add'](_0x4eba01);const _0x350488=this['channelConnectedUsers']['get'](_0x571b78);_0x350488['has'](_0x1bc4f2['id'])||_0x350488['add'](_0x1bc4f2),this['allConnectedUsers']['has'](_0x1bc4f2['id'])||this['allConnectedUsers']['add'](_0x1bc4f2,_0x1bc4f2['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x571b78,{'channelId':_0x571b78,'session':_0x4eba01});}['_handleSessionRemove'](_0x1aadfe,_0x46d888){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0xdedd13=this['channelConnectedUsers']['get'](_0x1aadfe),_0x16107c=_0x46d888['user'];_0x16107c['id']&&(this['channelSessions']['get'](_0x1aadfe)['remove'](_0x46d888['id']),_0xdedd13['has'](_0x16107c['id'])&&!this['getUserSessions'](_0x16107c,_0x1aadfe)['size']&&_0xdedd13['remove'](_0x16107c['id']),this['allConnectedUsers']['get'](_0x16107c['id'])&&!this['getUserSessions'](_0x16107c)['size']&&this['allConnectedUsers']['remove'](_0x16107c['id']));}['_createUser'](_0x4f6c61,_0x11cd30){const _0x35e889=this['_users']['addUser'](_0x4f6c61);return _0x11cd30&&this['_users']['defineMe'](_0x4f6c61['id']),_0x35e889['orderNumber']=this['_uniqueUsersCount']++,_0x35e889;}}class J extends _0x50372a{['_domEmitter']=new(_0x4c6426())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4f2322=this['editor'],_0x286365=_0x4f2322['plugins']['get'](i);_0x4f2322['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x3bb0e0,{writer:_0x5e55d2})=>function(_0xbbf936,_0x8c4244,_0x2bcfb9,_0x2e2625){const _0x121ed8=_0xbbf936['markerName']['split'](':')[0x2],_0xf207f4=_0x2bcfb9['getUserBySessionId'](_0x121ed8);if(!_0xf207f4||_0x121ed8===_0x2bcfb9['mySessionId'])return;if(!_0x2e2625['model']['schema']['checkChild'](_0xbbf936['markerRange']['start'],'$text'))return;const _0x3c7846={'class':'ck-user__marker\x20'+_0xf207f4['color']['getMarkerClass'](),'data-name':_0xf207f4['name'],'data-session-id':_0x121ed8},_0x51574d=_0x2e2625['model']['markers']['get'](_0xbbf936['markerName']),_0x15c528=_0x51574d['getStart'](),_0x2ee8bf=_0x15c528['nodeAfter'],_0x1b5b45=_0x2e2625['model']['schema'];if(_0x2ee8bf&&_0x1b5b45['isObject'](_0x2ee8bf)&&_0x1b5b45['isInline'](_0x2ee8bf)&&!_0x2e2625['model']['markers']['get']('user:range:'+_0x121ed8)['getRange']()['isCollapsed'])return;const _0x38a309=_0x15c528['parent'];return _0x2e2625['model']['schema']['isLimit'](_0x38a309)&&!_0x2e2625['model']['hasContent'](_0x38a309)&&(_0x3c7846['contenteditable']=!0x1),function(_0x45b51c,_0x3251b4,_0x5368ff){const _0x389d2c=_0x45b51c['createUIElement']('span',_0x3251b4);return _0x45b51c['setCustomProperty']('userPositionMarker',!0x0,_0x389d2c),_0x389d2c['render']=function(_0x53bac7){const _0x45c86b=this['toDomElement'](_0x53bac7);return _0x45c86b['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>'+_0x5368ff['name']+'</span>⁠',_0x45c86b['addEventListener']('mouseenter',()=>{_0x45c86b['classList']['add']('ck-user__marker_hovered');}),_0x45c86b['addEventListener']('mouseleave',()=>{_0x45c86b['classList']['remove']('ck-user__marker_hovered');}),_0x45c86b;},_0x389d2c['isSimilar']=function(_0xbbc359){return!(!this['getCustomProperty']('userPositionMarker')||!_0xbbc359['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0xbbc359['getAttribute']('data-session-id'));},_0x389d2c;}(_0x8c4244,_0x3c7846,_0xf207f4);}(_0x3bb0e0,_0x5e55d2,_0x286365,_0x4f2322)}),_0x4f2322['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x4c9c60=>function(_0x1ebf50,_0x5b0d91){const _0x50e9e7=_0x1ebf50['markerName']['split'](':')[0x2];if(_0x50e9e7===_0x5b0d91['mySessionId'])return null;const _0x1d1614=_0x5b0d91['getUserBySessionId'](_0x50e9e7);if(!_0x1d1614)return{'id':_0x50e9e7,'classes':[]};return{'id':_0x50e9e7,'classes':['ck-user__selection',_0x1d1614['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x50e9e7},'priority':0x7d0+_0x1d1614['orderNumber']};}(_0x4c9c60,_0x286365)}),function(_0x125fbb){const _0x3ec903=_0x125fbb['model'],_0x146284=new Map(),_0x3c5005=_0x125fbb['plugins']['get'](i);_0x3ec903['markers']['on']('update:user:range',(_0xe64318,_0x14e49c,_0x5233fb,_0x8b33db)=>{if(!_0x8b33db&&_0x146284['get'](_0x14e49c['name']))return _0x146284['get'](_0x14e49c['name'])['detach'](),void _0x146284['delete'](_0x14e49c['name']);const _0x11db1f=_0x14e49c['name']['split'](':')[0x2];if(_0x11db1f===_0x3c5005['mySessionId'])return;const _0x580649='user:position:'+_0x11db1f;_0x3ec903['markers']['has'](_0x580649)&&_0x125fbb['editing']['reconvertMarker'](_0x580649),_0x14e49c['on']('change:range',(_0x32c1ad,_0x2c6ef1,_0x4cb00c)=>{if('$graveyard'!=_0x2c6ef1['root']['rootName']&&'$graveyard'==_0x14e49c['getRange']()['root']['rootName']&&!_0x146284['has'](_0x14e49c['name'])){const _0x43e2c9=_0x3ec903['schema']['getNearestSelectionRange'](_0x4cb00c['deletionPosition']);if(_0x43e2c9){const _0x591a1c=at['fromRange'](_0x43e2c9);_0x146284['set'](_0x14e49c['name'],_0x591a1c),_0x591a1c['on']('change:range',(_0x5a404a,_0x467bff,_0x5c2121)=>{if('$graveyard'==_0x591a1c['root']['rootName']){const _0x3aad36=_0x3ec903['schema']['getNearestSelectionRange'](_0x5c2121['deletionPosition']);_0x3aad36?(_0x591a1c['start']=_0x3aad36['start'],_0x591a1c['end']=_0x3aad36['end']):(_0x146284['delete'](_0x14e49c['name']),_0x591a1c['detach']());}});}}});}),_0x3ec903['document']['on']('change',()=>{_0x146284['size']>0x0&&_0x3ec903['enqueueChange']({'isUndoable':!0x1},_0x45187f=>{for(const [_0x5c2daf,_0x23d428]of _0x146284)'$graveyard'==_0x3ec903['markers']['get'](_0x5c2daf)['getRange']()['root']['rootName']&&(te(_0x5c2daf['split'](':')[0x2],_0x23d428['toRange'](),_0x3ec903,_0x45187f),_0x23d428['detach']());_0x146284['clear']();});});}(_0x4f2322),this['_domEmitter']['listenTo'](_0x38475b['document'],'keydown',(_0x480ae3,{key:_0x4da8cf})=>{'Escape'===_0x4da8cf&&function(_0x428dce){_0x428dce['editing']['view']['change'](_0x5ca89b=>{for(const _0x3c3f7f of _0x428dce['model']['markers']){if(!_0x3c3f7f['name']['startsWith']('user:position'))continue;const _0x279173=_0x428dce['editing']['mapper']['markerNameToElements'](_0x3c3f7f['name']);if(_0x279173){for(const _0x2dc69a of _0x279173)_0x5ca89b['removeClass']('ck-user__marker_hovered',_0x2dc69a);}}});}(_0x4f2322);},{'useCapture':!0x0});}['afterInit'](){const _0x574118=this['editor'],_0x24cf2a=_0x574118['commands']['get']('undo');_0x24cf2a&&_0x574118['model']['on']('applyOperation',(_0x283b83,_0x4b8769)=>{const _0x4a4a44=_0x4b8769[0x0];if('marker'!=_0x4a4a44['type']||!_0x4a4a44['name']['startsWith']('user:'))return;const _0x51a2b9=_0x4a4a44['batch'];_0x24cf2a['_createdBatches']['has'](_0x51a2b9)&&(_0x4a4a44['newRange']=_0x4a4a44['oldRange']?_0x574118['model']['createRange'](_0x4a4a44['oldRange']['start'],_0x4a4a44['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x2798fe=this['editor'],_0x376591=_0x2798fe['model']['document'],_0x2f8e81=_0x2798fe['plugins']['get'](i);_0x2798fe['model']['enqueueChange']({'isUndoable':!0x1},_0x1450e4=>{const _0x5c2550='user:range:'+_0x2f8e81['mySessionId'],_0xfd3398='user:position:'+_0x2f8e81['mySessionId'],_0x3f1292=_0x2798fe['model']['markers']['has'](_0x5c2550);_0x2798fe['editing']['view']['hasDomSelection']?te(_0x2f8e81['mySessionId'],_0x376591['selection']['getFirstRange'](),_0x2798fe['model'],_0x1450e4):_0x3f1292&&(_0x1450e4['removeMarker'](_0x5c2550),_0x1450e4['removeMarker'](_0xfd3398));});}}function te(_0x4a6f09,_0x23628c,_0x2f0698,_0x2cb0a3){const _0xcd8c68='user:range:'+_0x4a6f09,_0x41d0a9='user:position:'+_0x4a6f09,_0xc252b1=_0x23628c['getContainedElement']();let _0x56adf9=_0x23628c['start'];_0xc252b1&&_0xc252b1['is']('element','tableCell')&&(_0x56adf9=function(_0x23967d,_0x1575b9){for(const _0x51d807 of _0x23967d['getPositions']())if(_0x1575b9['schema']['checkChild'](_0x51d807,'$text'))return _0x51d807;}(_0x23628c,_0x2f0698),_0x23628c=_0x2cb0a3['createRange'](_0x56adf9));const _0x568d31=_0x2cb0a3['createRange'](_0x56adf9);_0x2f0698['markers']['has'](_0xcd8c68)?(_0x2cb0a3['updateMarker'](_0xcd8c68,{'range':_0x23628c}),_0x2cb0a3['updateMarker'](_0x41d0a9,{'range':_0x568d31})):(_0x2cb0a3['addMarker'](_0xcd8c68,{'range':_0x23628c,'usingOperation':!0x0}),_0x2cb0a3['addMarker'](_0x41d0a9,{'range':_0x568d31,'usingOperation':!0x0}));}function Q(_0x32da98,_0x1340f4,_0x3ade47){const _0x4adff1=_0x32da98['t'],t=_0x32da98['t'];switch(_0x1340f4){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 _0x4adff1({'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'},_0x3ade47);default:return'';}}let Z=0x1;class l extends _0x50372a{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x35ce65)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,J,_0x368f32,_0x4c3346,_0x1d35e3];}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 _0x475d26=this['serverHistory']['getOperations']();for(let _0x271ff8=_0x475d26['length']-0x1;_0x271ff8>=0x0;_0x271ff8--){const _0x40956f=_0x475d26[_0x271ff8];if(!this['_disconnectionOperations']['has'](_0x40956f))return _0x40956f['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x31378f){if(super(_0x31378f),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x2d8e8d(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x408616('collaboration-missing-channelid',this);const _0x5236a6=_0x31378f['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x5236a6,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x439fc2(),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 st(this['_disconnectionOperations']);}['init'](){const _0x840f44=this['editor'],_0x42bad7=_0x840f44['plugins']['get'](_0x4c3346),_0x36795f=_0x840f44['plugins']['get'](c);this['listenTo'](_0x42bad7,'getOperationAuthor',(_0x547f57,_0x2b760c)=>{const _0x340d1a=_0x2b760c[0x0];_0x340d1a['_authorId']&&(_0x547f57['return']=_0x42bad7['getUser'](_0x340d1a['_authorId']),_0x547f57['stop']()),null===_0x340d1a['_authorId']&&(_0x547f57['return']=null,_0x547f57['stop']());},{'priority':'high'}),this['listenTo'](_0x840f44['model']['document']['selection'],'change:range',(_0x48e793,_0x51833e)=>{_0x51833e['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x840f44['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x840f44['model']['on']('applyOperation',(_0x51cbab,_0x51a853)=>{const _0x543c66=_0x51a853[0x0];_0x543c66['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x543c66),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x36795f,'state',this,'_hasSynchronizationProblem',(_0x2f2285,_0x1dec65)=>'connected'===_0x2f2285&&!_0x1dec65),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x840f44['disableReadOnlyMode']('rtc-offline'):_0x840f44['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x840f44['disableReadOnlyMode']('rtc-offline'):_0x840f44['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x223d0c=this['editor']['plugins']['get'](i),_0x24455e=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x223d0c['unregister'](this['_channelId']);const _0x579c27=await this['_service']['reconnect'](_0x24455e['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x579c27)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x25f60b=await this['_service']['getConnectedSessions']();_0x223d0c['register'](this['_channelId'],_0x25f60b),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x3b16cf){if(function(_0x3106cb){return'404'===_0x3106cb['code'];}(_0x3b16cf)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x2c39be){return'409'===_0x2c39be['code'];}(_0x3b16cf)){const _0x2845e7=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'](_0x2845e7);}else{if(!(_0x3b16cf instanceof tt))throw _0x3b16cf;this['_handleReconnectionError']();}}}}['destroy'](){const _0x35cd10=this['editor']['plugins']['get'](c),_0x176b83=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x176b83['channelSessions']['has'](this['_channelId'])&&_0x176b83['unregister'](this['_channelId']),_0x35cd10['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4c1dd0){if(this['sessionId']!==_0x4c1dd0['sessionId']&&this['_lastSyncedOperationId']!==_0x4c1dd0['lastOperationId'])throw new tt();return this['sessionId']=_0x4c1dd0['sessionId'],this['_handleServerResponse']([],{..._0x4c1dd0,'wereChangesApplied':!0x1,'data':_0x4c1dd0['data']},'reconnect');}async['_connectService'](_0x3a92f9,_0x3cc43d=!0x1){const {connection:_0x2f0c00}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x2f0c00,this['_channelId'])['then'](_0x2665e0=>this['_initSessionsHandling'](_0x2665e0))['catch'](_0x325a0e=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x325a0e);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x548d90,_0x3e0b8a)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x3e0b8a);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0xb4c97d=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3a92f9);this['_isPendingUpdate']=!0x0;const _0x4681c3=await this['_service']['connect'](_0x2f0c00,this['_compressOperations'](_0x3a92f9),_0xb4c97d);if(this['sessionId']=_0x4681c3['sessionId'],_0x3cc43d){if(!_0x4681c3['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x4681c3['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x3a92f9,_0x4681c3,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x4681c3,_0x3a92f9);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x2c85d6=this['editor']['plugins']['get'](i),_0x76f47d=this['editor']['plugins']['get'](J),_0x1aae00=_0x2c85d6['channelSessions']['get'](this['_channelId']);_0x1aae00&&_0x1aae00['length']>0x1?_0x76f47d['createUserMarkerOperations']():this['listenTo'](_0x2c85d6,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x2c85d6['channelSessions']['get'](this['_channelId'])['length']&&_0x76f47d['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x3d30e0,_0x152453,_0x53e5d5,_0x9da1fa){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x152453){const _0x2ae469=this['_decompressOperations'](_0x53e5d5,_0x9da1fa);await this['_fetchMissingUsers'](_0x2ae469),this['_handleExternalOperations'](_0x2ae469,_0x152453,_0x53e5d5['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x23a2f1}=this['editor'];let _0x3de310;try{_0x3de310=await this['_service']['getDocumentDetails']();}catch(_0x4863e7){const _0x254151=Q(_0x23a2f1,'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'](_0x254151);}const _0x41cd13=_0x3de310['currentDocumentSession']||_0x3de310['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x41cd13['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x4b1751=Q(_0x23a2f1,'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'](_0x4b1751);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x218460){const _0x3f5628=this['editor']['plugins']['get'](i);this['listenTo'](_0x3f5628,'sessionAdd:'+this['_channelId'],(_0x136297,{session:_0x3a0a02})=>{if(_0x3a0a02['id']===_0x3f5628['mySessionId']){_0x136297['off']();const _0xc1f66c=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x4f3416=_0x3a0a02['permissions'];_0xc1f66c&&_0xc1f66c['isEnabled']&&(_0x4f3416=_0x4f3416['filter'](_0x21a30d=>'document:write'!==_0x21a30d)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x4f3416,this['_channelId']);}}),_0x3f5628['register'](this['_channelId'],_0x218460);}['_initThrowingOnDataSet'](){const _0x5261ad=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x31b1e1)=>{if(!_0x31b1e1[_0x31b1e1['length']-0x1]['suppressErrorInCollaboration'])throw new _0x408616('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5261ad['apply'](this['editor']['data'],_0x31b1e1);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x1dac26,[_0x1bfd6c])=>{if(this['_document']['version'])throw new _0x408616('realtimecollaborationclient-init-document-already-initialized',this);_0x1dac26['stop'](),this['_setPendingAction']();const _0x2fbbc8=this['editor']['config']['get']('rootsAttributes'),_0x5bfa8a=this['_getOperationsFromInitData'](_0x1bfd6c,_0x2fbbc8);0x0==_0x5bfa8a['length']&&_0x5bfa8a['push'](new _0x54ca34(0x0)),_0x1dac26['return']=this['_connectService'](_0x5bfa8a)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x1f1033=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x1f1033))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x2df160,[_0x44dd76,_0x4057b1])=>{_0x2df160['stop']();const _0x5de0ec=this['editor']['model']['document']['getRoot'](_0x44dd76);if(!this['_knownRootNames']['has'](_0x44dd76)){const _0x2a72dc=_0x4057b1&&_0x4057b1['data']?_0x4057b1['data']:'',_0x37556e=_0x4057b1&&_0x4057b1['attributes']?_0x4057b1['attributes']:{};await this['_loadRoot'](_0x44dd76,_0x2a72dc,_0x37556e);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x5de0ec['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x5de0ec);});},{'priority':'high'});}async['_fetchMissingUsers'](_0xe9fdbd){const _0x234686=this['editor']['plugins']['get'](_0x4c3346),{connection:_0x4762e7}=this['editor']['plugins']['get'](c),_0x4a030a=new Set();for(const _0x6c73f6 of _0xe9fdbd){const _0x509edd=_0x6c73f6['_authorId'];_0x509edd&&!_0x234686['getUser'](_0x509edd)&&_0x4a030a['add'](_0x509edd);}if(0x0===_0x4a030a['size'])return;const _0x5c09fc=await lt['getMany'](_0x4762e7,Array['from'](_0x4a030a));for(const _0x3af950 of _0x5c09fc)_0x234686['getUser'](_0x3af950['id'])||_0x234686['addUser'](_0x3af950);}['_getOperationsFromInitData'](_0x3e767f,_0x2586c4={}){const _0x527e68=this['editor']['model'],_0x5b7a6a=[];let _0x1e1251=0x0;const _0x4ecd9c='string'==typeof _0x3e767f?{'main':_0x3e767f}:_0x3e767f;for(const _0x458968 of Object['keys'](_0x4ecd9c)){if(!this['_document']['roots']['has'](_0x458968))throw new _0x408616('realtimecollaborationclient-init-non-existent-root',this);const _0x43f878=this['editor']['data']['parse'](_0x4ecd9c[_0x458968]),_0x4acb00=this['_document']['getRoot'](_0x458968),_0xb7edb1=new _0x4e5089(_0x527e68['createPositionAt'](_0x4acb00,0x0),_0x43f878,_0x1e1251++);_0x5b7a6a['push'](_0xb7edb1);for(const [_0x2fa92,_0x2faaaf]of _0x43f878['markers']){const _0x2a4b2f=_0x527e68['createRange'](_0x527e68['createPositionFromPath'](_0x4acb00,_0x2faaaf['start']['path']['slice']()),_0x527e68['createPositionFromPath'](_0x4acb00,_0x2faaaf['end']['path']['slice']())),_0x503faa=new _0x184ddc(_0x2fa92,null,_0x2a4b2f,_0x527e68['markers'],!0x0,_0x1e1251++);_0x5b7a6a['push'](_0x503faa);}}if(_0x2586c4)for(const [_0x128b7f,_0x3a1688]of Object['entries'](_0x2586c4)){const _0x5c34aa=_0x527e68['document']['getRoot'](_0x128b7f);if(!_0x5c34aa)throw new _0x408616('multi-root-editor-root-attributes-no-root',null);for(const [_0x270014,_0x35601d]of Object['entries'](_0x3a1688))if(null!==_0x35601d){const _0x5733f9=new _0x3baf28(_0x5c34aa,_0x270014,null,_0x35601d,_0x1e1251++);_0x5b7a6a['push'](_0x5733f9);}}return _0x5b7a6a;}async['_loadRoot'](_0x106715,_0x39839a,_0x4ca3d1){this['_getOperationsFromInitData']({[_0x106715]:_0x39839a},{[_0x106715]:_0x4ca3d1})['forEach']((_0x2d9bcc,_0x4c387c)=>{_0x2d9bcc['baseVersion']=this['_document']['version']+_0x4c387c,_0x2d9bcc['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2d9bcc);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x363cf7,_0x767697){let _0x15d3dd;this['_offset']=_0x363cf7['offset'];const _0x4917e5=_0x363cf7['wereChangesApplied']&&!_0x363cf7['initData'],_0x40ca2d=_0x4917e5?0x0:_0x363cf7['data']['baseVersion'];if(_0x767697['forEach'](_0x3f1592=>{_0x3f1592['_isInit']=!0x0,_0x3f1592['createdAt']=_0x363cf7['sessionCreatedAt'],_0x3f1592['_authorId']=null;}),_0x4917e5)_0x15d3dd=_0x767697,this['_applyOperationsSet'](_0x15d3dd,_0x4917e5);else{if(_0x363cf7['initData']){const _0x2ce947=this['_getOperationsFromInitData'](_0x363cf7['initData']);this['_document']['history']['version']=-_0x2ce947['length'],_0x2ce947['forEach'](_0x3f420e=>{_0x3f420e['baseVersion']-=_0x2ce947['length'],_0x3f420e['createdAt']=_0x363cf7['sessionCreatedAt'],_0x3f420e['_isInit']=!0x0,_0x3f420e['_authorId']=null;}),this['_applyOperationsSet'](_0x2ce947,!0x0),this['serverHistory']['version']=-_0x2ce947['length']+this['_offset'],this['_updateServerHistory'](_0x2ce947);}this['_document']['history']['version']=_0x40ca2d,_0x15d3dd=this['_decompressOperations'](_0x363cf7['data'],_0x363cf7['metadata']),await this['_fetchMissingUsers'](_0x15d3dd),this['_applyOperationsSet'](_0x15d3dd,_0x4917e5);}_0x363cf7['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x15d3dd,_0x363cf7['lastOperationId']),this['_lastSyncedOperationId']=_0x363cf7['lastOperationId']),this['serverHistory']['version']=_0x40ca2d+this['_offset'],this['_updateServerHistory'](_0x15d3dd),_0x767697['filter'](_0x23321e=>{const _0x57f483=this['_getAffectedRoot'](_0x23321e);return _0x57f483&&!this['_knownRootNames']['has'](_0x57f483);})['forEach']((_0x3240fc,_0x5397c8)=>{_0x3240fc['baseVersion']=this['_document']['version']+_0x5397c8,this['_saveOperationInBuffer'](_0x3240fc);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x171afb,_0x350373,_0x19a521){throw this['_isPendingUpdate']=!0x0,_0x350373&&console['error'](_0x350373),_0x19a521&&this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x408616(_0x171afb,this['editor']);}['_saveOperationInBuffer'](_0x1fc260){this['_knownOperations']['has'](_0x1fc260)||(this['_knownOperations']['add'](_0x1fc260),this['_bufferedOperations']['push'](_0x1fc260),this['_pendingAction']||'marker'==_0x1fc260['type']&&!_0x1fc260['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x467c70=!0x1){!_0x467c70&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x2042b6=>{_0x2042b6&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x476d46=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x36aa87){return _0x36aa87['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x36aa87['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x36aa87['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x476d46)||this['_crash'](_0x476d46['message'],_0x476d46,!0x0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x21df35=>{this['on']('change:_isPendingUpdate',()=>{_0x21df35();});});}async['_sendBufferedOperations'](){const _0x270e9a=this['editor']['plugins']['get'](J);if(this['_shouldSendSelectionUpdate']()&&(_0x270e9a['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x2603e2=[...this['_bufferedOperations']];for(const _0x443e61 of _0x2603e2)_0x443e61['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x443e61);const _0x185669=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2603e2),_0x14bb03=Z++,_0x27eca6=this['_compressOperations'](_0x2603e2),_0x5a40fd=await this['_service']['sendOperations'](_0x27eca6,_0x27eca6['baseVersion'],_0x185669);try{return await this['_handleServerResponse'](_0x2603e2,_0x5a40fd,_0x14bb03);}catch(_0x2ff1e3){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x2ff1e3);}}async['_handleServerResponse'](_0x1286ba,_0x479a8b,_0x5503cb){if('error'in _0x479a8b)throw _0x479a8b['error'];let _0x5df959=!0x1;if(_0x479a8b['wereChangesApplied']){_0x479a8b['lastOperationId']&&(this['_lastSyncedOperationId']=_0x479a8b['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x44b596=>!_0x1286ba['includes'](_0x44b596));for(const _0xa80072 of _0x1286ba)_0xa80072['createdAt']='lastOperationAcceptedAt'in _0x479a8b&&_0x479a8b['lastOperationAcceptedAt']||void 0x0;it(_0x1286ba,_0x479a8b['version']-_0x1286ba['length']),this['_updateServerHistory'](_0x1286ba);const _0x2ac032=_0x1286ba['filter'](_0x2d981a=>{if(!_0x2d981a['_isInit'])return!0x1;const _0x55b651=this['_getAffectedRoot'](_0x2d981a);return _0x55b651&&!this['_knownRootNames']['has'](_0x55b651);});it(_0x2ac032,this['_document']['version']),this['_applyOperationsSet'](_0x2ac032),_0x5df959=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x45bd1b=this['_decompressOperations'](_0x479a8b['data'],_0x479a8b['metadata'])['filter'](_0x4357b6=>_0x4357b6['baseVersion']>=this['_lastServerVersion']);_0x45bd1b['forEach'](_0x13c73b=>this['_addKnownRoot'](_0x13c73b)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x47be01=>!_0x47be01['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x47be01))),this['_bufferedOperations']['length']&&it(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x45bd1b),_0x5df959=this['_handleExternalOperations'](_0x45bd1b,_0x479a8b['version'],_0x479a8b['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x5df959?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x494e61,_0x2538dc,_0x2bf8c7){try{const _0x38a26c={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x57d387,operationsB:_0x12b01d,originalOperations:_0x13de61}=_0x453bb3(_0x494e61,this['_bufferedOperations'],_0x38a26c);it(_0x57d387,this['_document']['version']),it(_0x12b01d,_0x2538dc);for(const _0x16cc18 of _0x57d387){const _0xe63d2a=_0x13de61['get'](_0x16cc18);_0x16cc18['_authorId']=_0xe63d2a?_0xe63d2a['_authorId']:null;}_0x2bf8c7&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x494e61,_0x2bf8c7),this['_lastSyncedOperationId']=_0x2bf8c7),this['_bufferedOperations']=[..._0x12b01d],this['_applyOperationsSet'](_0x57d387),this['_updateServerHistory'](_0x494e61);}catch(_0x58bc4c){return console['error'](_0x58bc4c),!0x1;}return!0x0;}['_applyOperationsSet'](_0x5d14e2,_0x31871e=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3a193f=>{for(const _0x410c0c of _0x5d14e2)this['_knownOperations']['add'](_0x410c0c),this['_addKnownRoot'](_0x410c0c),_0x3a193f['batch']['addOperation'](_0x410c0c),this['editor']['model']['applyOperation'](_0x410c0c);});}['_addKnownRoot'](_0x973b8c){const _0x18de1a=this['_getAffectedRoot'](_0x973b8c);_0x18de1a&&this['_knownRootNames']['add'](_0x18de1a);}['_getAffectedRoot'](_0x49a7c6){let _0x281594,_0x52da4c;switch(_0x49a7c6['type']){case'insert':_0x281594=_0x49a7c6['position']['root'];break;case'marker':if(_0x52da4c=_0x49a7c6['newRange'],!_0x52da4c)return null;_0x281594=_0x52da4c['root'];break;case'addRootAttribute':_0x281594=_0x49a7c6['root'];break;case'addRoot':_0x281594=_0x49a7c6['affectedSelectable'];break;case'move':_0x281594=_0x49a7c6['targetPosition']['root'];break;default:return null;}return _0x281594['rootName'];}['_updateServerHistory'](_0x317e53){_0x317e53['forEach'](_0x244aba=>{const _0x105f1c=_0x244aba['clone']();_0x105f1c['_authorId']=_0x244aba['_authorId'],_0x105f1c['_isInit']=!!_0x244aba['_isInit'],_0x105f1c['createdAt']=_0x244aba['createdAt'],_0x105f1c['baseVersion']+=this['_offset'],_0x244aba['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x105f1c),this['serverHistory']['addOperation'](_0x105f1c);});}['_handleReconnectionError'](_0x3d69fc){const _0x1e1f3f=this['editor']['plugins']['get']('Notification'),_0xf2aac=this['editor']['locale'];_0x3d69fc||(_0x3d69fc=Q(_0xf2aac,'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.')),_0x1e1f3f['showWarning'](_0x3d69fc,{'title':Q(_0xf2aac,'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'](_0x368f32)['add'](Q(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x368f32)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x4cb562){const _0x76cb36=_0x4cb562['map'](_0x370842=>_0x370842['toJSON']());return this['_compressor']['compress'](_0x76cb36);}['_decompressOperations'](_0x5c3db2,_0x2c4d5f){return this['_compressor']['decompress'](_0x5c3db2)['map']((_0x2779c5,_0x4ff71a)=>{const _0x26cbf8='init'==_0x2c4d5f[_0x4ff71a]['type'];if('InsertOperation'==_0x2779c5['__className']){const _0x490b7d=_0x2779c5['position']['root'];!this['_document']['getRoot'](_0x490b7d)&&(this['_document']['createRoot']('$root',_0x490b7d)['_isAttached']=!0x1);}const _0x39670a=_0x1e5de9['fromJSON'](_0x2779c5,this['_document']);return _0x39670a['wasUndone']=_0x2779c5['wasUndone'],_0x39670a['_isInit']=_0x26cbf8,_0x39670a['_authorId']=_0x26cbf8?null:_0x2c4d5f[_0x4ff71a]['userId'],_0x39670a['_isDisconnection']='cs:removeUser'===_0x2c4d5f[_0x4ff71a]['type'],_0x39670a['createdAt']=_0x2c4d5f[_0x4ff71a]['createdAt'],_0x39670a;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x3e26ac=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x3e26ac&&_0x3e26ac['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class tt extends Error{}function it(_0x42937e,_0x241cbd){for(const _0x4c1c0b of _0x42937e)_0x4c1c0b['baseVersion']=_0x241cbd++;}class st{['_ignoredOperations'];['_operationToId'];constructor(_0x58a2b0){this['_ignoredOperations']=_0x58a2b0,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xc78e90){let _0x55a0a7=_0xc78e90['length'];for(;_0x55a0a7--;){const _0x3ce8f6=_0xc78e90[_0x55a0a7];if(!this['_ignoredOperations']['has'](_0x3ce8f6)){if(!this['_operationToId']['has'](_0x3ce8f6)){const _0x42a061=_0x301035()['slice'](0x1,0x12);this['_operationToId']['set'](_0x3ce8f6,_0x42a061);}return this['_operationToId']['get'](_0x3ce8f6);}}}['setIdForTheLastOperation'](_0x4f4f96,_0x2b93bd){if(!_0x2b93bd)return;let _0x45f7ba=_0x4f4f96['length'];for(;_0x45f7ba--;){const _0x9ae605=_0x4f4f96[_0x45f7ba];this['_ignoredOperations']['has'](_0x9ae605)||this['_operationToId']['set'](_0x9ae605,_0x2b93bd);}}}class n extends _0x50372a{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x37a9d3{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x2fcac4)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x4c3346];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x203d3f){super(_0x203d3f),this['_services']=new Map();}async['init'](){const _0x4fb797=this['context'],_0xe59c4e=_0x4fb797['plugins']['get']('CommentsRepository');if(_0x4fb797['plugins']['get'](c)['addToReconnectionStack'](this),_0xe59c4e['adapter']={'addCommentThread':async({channelId:_0x4cd9a1,threadId:_0x3420bf,comments:_0x18d822,resolvedAt:_0x30d2d6,resolvedBy:_0x4a8414,context:_0x2d6c94,attributes:_0x3d1620})=>{const _0x4b1608=await this['_getService'](_0x4cd9a1)['addCommentThread']({'commentThreadId':_0x3420bf,'comments':_0x18d822['map'](_0x2d70df=>function(_0x249ff1,_0x2982c2,_0x20dafa){return{'commentThreadId':_0x20dafa,'commentId':_0x249ff1['commentId'],'userId':_0x249ff1['authorId'],'content':_0x249ff1['content'],'documentId':_0x2982c2,'createdAt':_0x249ff1['createdAt'],'attributes':_0x249ff1['attributes']||{}};}(_0x2d70df,_0x4cd9a1,_0x3420bf)),'resolvedAt':_0x30d2d6,'resolvedBy':_0x4a8414,'context':_0x2d6c94,'attributes':_0x3d1620})['catch'](dt);return{'threadId':_0x4b1608['commentThreadId'],'comments':_0x4b1608['comments']};},'getCommentThread':async({channelId:_0x20fc95,threadId:_0x5be569})=>{const _0x28bbb7=await this['_getService'](_0x20fc95)['getCommentThread'](_0x5be569)['catch'](dt);return _0x28bbb7['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x28bbb7]),{'threadId':_0x28bbb7['commentThreadId'],'comments':_0x28bbb7['comments']['map'](S),'context':_0x28bbb7['context'],'resolvedAt':_0x28bbb7['resolvedAt'],'resolvedBy':_0x28bbb7['resolvedBy'],'attributes':_0x28bbb7['attributes']||{}});},'updateCommentThread':async({channelId:_0x581bdb,threadId:_0x1edd08,context:_0x47c239,unlinkedAt:_0x276e82,attributes:_0x282691})=>this['_getService'](_0x581bdb)['updateCommentThread']({'commentThreadId':_0x1edd08,'context':_0x47c239,'attributes':_0x282691,'unlinkedAt':_0x276e82})['catch'](B)['catch'](dt),'resolveCommentThread':async({channelId:_0x32055b,threadId:_0x3c8224})=>{const _0x514117=await this['_getService'](_0x32055b)['resolveCommentThread'](_0x3c8224)['catch'](B)['catch'](dt);return{'threadId':_0x514117['commentThreadId'],'resolvedAt':_0x514117['resolvedAt'],'resolvedBy':_0x514117['resolvedBy']};},'reopenCommentThread':async({channelId:_0x49a056,threadId:_0x398f17})=>this['_getService'](_0x49a056)['reopenCommentThread'](_0x398f17)['catch'](B)['catch'](dt),'removeCommentThread':({channelId:_0x22a6fe,threadId:_0x441628})=>this['_getService'](_0x22a6fe)['removeCommentThread'](_0x441628)['catch'](B)['catch'](dt),'addComment':({channelId:_0x48bef4,threadId:_0x5da0a0,commentId:_0x485c5c,content:_0x5de220,attributes:_0x55129a})=>this['_getService'](_0x48bef4)['addComment'](_0x5da0a0,_0x485c5c,_0x5de220,_0x55129a)['catch'](dt),'updateComment':({channelId:_0x19031b,threadId:_0x3ed5e7,commentId:_0x2a3ad5,content:_0x3eef45,attributes:_0x121149})=>this['_getService'](_0x19031b)['updateComment'](_0x3ed5e7,_0x2a3ad5,_0x3eef45,_0x121149)['catch'](B)['catch'](dt),'removeComment':({channelId:_0x35b92d,threadId:_0x225d0d,commentId:_0x14092e})=>this['_getService'](_0x35b92d)['removeComment'](_0x225d0d,_0x14092e)['catch'](B)['catch'](dt)},_0x4fb797 instanceof _0x112e10){const _0x4d38ea=_0x4fb797['config']['get']('collaboration.channelId'),_0x13ce2d=_0x4fb797['plugins']['get'](i);await this['_setUpService'](_0x4d38ea);const _0xcc3ebd=await this['_services']['get'](_0x4d38ea)['getConnectedSessions']();this['listenTo'](_0x13ce2d,'sessionAdd:'+_0x4d38ea,(_0x529fcc,{session:_0x2d8c8b})=>{_0x2d8c8b['id']===_0x13ce2d['mySessionId']&&(_0x529fcc['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2d8c8b['permissions'],_0x4d38ea));}),_0x13ce2d['register'](_0x4d38ea,_0xcc3ebd);}}async['_setUpService'](_0x2859d0){if(this['_services']['has'](_0x2859d0))throw new _0x408616('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x2859d0});const _0x81796e=this['context']['plugins']['get']('CommentsRepository'),_0x51fa2d=new a['CommentsService'](_0x2859d0);this['_services']['set'](_0x2859d0,_0x51fa2d),this['listenTo'](_0x51fa2d,'commentThreadAdded',(_0x261e84,_0x2d4f8e)=>{const {commentThreadId:_0x54602b,documentId:_0x4e0db4,context:_0x461943,attributes:_0x142026,resolvedAt:_0x45caa6,resolvedBy:_0x2e3ea2,comments:_0x2d5949}=_0x2d4f8e;_0x81796e['getCommentThread'](_0x54602b)||_0x81796e['addCommentThread']({'threadId':_0x54602b,'channelId':_0x4e0db4,'comments':_0x2d5949?_0x2d5949['map'](S):[],'context':_0x461943,'attributes':_0x142026,'resolvedAt':_0x45caa6,'resolvedBy':_0x2e3ea2,'isFromAdapter':!0x0});}),this['listenTo'](_0x51fa2d,'commentThreadUpdated',(_0x19c496,{commentThreadId:_0x3a28ae,documentId:_0x2920b8,context:_0x2d73ea,unlinkedAt:_0xe84df,attributes:_0x5bfc73})=>{_0x81796e['getCommentThread'](_0x3a28ae)&&_0x81796e['updateCommentThread']({'threadId':_0x3a28ae,'channelId':_0x2920b8,'context':_0x2d73ea,'unlinkedAt':_0xe84df,'attributes':_0x5bfc73,'isFromAdapter':!0x0});}),this['listenTo'](_0x51fa2d,'commentThreadResolved',(_0x59fa5b,{commentThreadId:_0x5ed39e,resolvedBy:_0x4c50f6,resolvedAt:_0xf74b91})=>{const _0x158d73=_0x81796e['getCommentThread'](_0x5ed39e);_0x158d73&&_0x158d73['resolve']({'resolvedBy':_0x4c50f6,'resolvedAt':_0xf74b91,'isFromAdapter':!0x0});}),this['listenTo'](_0x51fa2d,'commentThreadReopened',(_0x1fc94b,{commentThreadId:_0x59a2cc})=>{const _0x29cca7=_0x81796e['getCommentThread'](_0x59a2cc);_0x29cca7&&_0x29cca7['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x51fa2d,'commentThreadRemoved',(_0x58f5a4,{commentThreadId:_0x55ce8d})=>{const _0x265fe0=_0x81796e['getCommentThread'](_0x55ce8d);_0x265fe0&&_0x265fe0['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x51fa2d,'commentAdded',(_0x2f32bc,_0x1c1ea8)=>{const _0x2a9bd4=_0x1c1ea8['commentThreadId'],_0x4bb639=_0x81796e['getCommentThread'](_0x2a9bd4);_0x4bb639&&_0x4bb639['addComment']({...S(_0x1c1ea8),'isFromAdapter':!0x0});}),this['listenTo'](_0x51fa2d,'commentUpdated',(_0x126684,{commentThreadId:_0x598c3d,commentId:_0x33c08f,content:_0x3ade66,attributes:_0x4ca2f5})=>{const _0x28aa11=_0x81796e['getCommentThread'](_0x598c3d);if(_0x28aa11){const _0x29688e=_0x28aa11['getComment'](_0x33c08f);_0x29688e&&_0x29688e['update']({'content':_0x3ade66,'attributes':_0x4ca2f5,'isFromAdapter':!0x0});}}),this['listenTo'](_0x51fa2d,'commentRemoved',(_0x3d71a6,{commentThreadId:_0x2aeec5,commentId:_0x218c11})=>{const _0x2bf15d=_0x81796e['getCommentThread'](_0x2aeec5);if(_0x2bf15d){const _0xeb125e=_0x2bf15d['getComment'](_0x218c11);_0xeb125e&&_0xeb125e['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x2859d0);}['destroy'](){if(this['context']instanceof _0x112e10){const _0x563767=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x563767);}}['_terminateService'](_0x57cb46){if(!this['_services']['has'](_0x57cb46))throw new _0x408616('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x57cb46});this['_getService'](_0x57cb46)['disconnect'](),this['_services']['delete'](_0x57cb46);}async['reconnect'](){for(const _0x88d658 of this['_services']['keys']())await this['_connectService'](_0x88d658);if(this['context']instanceof _0x112e10){const _0x12d8b4=this['context']['config']['get']('collaboration.channelId'),_0x287e1a=this['context']['plugins']['get'](i);_0x287e1a['unregister'](_0x12d8b4);const _0x331684=await this['_services']['get'](_0x12d8b4)['getConnectedSessions']();_0x287e1a['register'](_0x12d8b4,_0x331684);}}async['_connectService'](_0x4ad732){const {connection:_0x2508a6}=this['context']['plugins']['get'](c),_0x3347c2=this['context']['plugins']['get']('CommentsRepository'),_0x4fc6e0=this['_services']['get'](_0x4ad732),_0x2139e0=await _0x4fc6e0['connect'](_0x2508a6);await this['_fetchMissingUsersForThreads'](_0x2139e0);const _0x162206=new Set(Array['from'](_0x3347c2['getCommentThreads']({'channelId':_0x4ad732}),_0x21960e=>_0x21960e['id']));for(const _0x96374b of _0x2139e0)_0x96374b['deletedAt']||_0x162206['delete'](_0x96374b['commentThreadId']);for(const _0x1fe4f4 of _0x162206)_0x3347c2['getCommentThread'](_0x1fe4f4)['remove']({'isFromAdapter':!0x0});for(const _0x5cfb57 of _0x2139e0){let _0x1fa430=_0x3347c2['getCommentThread'](_0x5cfb57['commentThreadId']);const {commentThreadId:_0x1de89f,context:_0x132a21,attributes:_0x199415,resolvedBy:_0xd8f423,resolvedAt:_0x11b49f,unlinkedAt:_0x83d5d2,deletedAt:_0x58eb9c}=_0x5cfb57;if(_0x58eb9c)continue;_0x1fa430||(_0x1fa430=_0x3347c2['addCommentThread']({'channelId':_0x4ad732,'threadId':_0x1de89f,'context':_0x132a21,'attributes':_0x199415||{},'resolvedBy':_0xd8f423,'resolvedAt':_0x11b49f,'unlinkedAt':_0x83d5d2,'isFromAdapter':!0x0}));const _0x1b84a2=new Set(Array['from'](_0x1fa430['comments'],_0xfdf117=>_0xfdf117['id']));for(const _0x4ca0af of _0x5cfb57['comments'])_0x1b84a2['delete'](_0x4ca0af['commentId']);for(const _0x310fae of _0x1b84a2)_0x1fa430['getComment'](_0x310fae)['remove']({'isFromAdapter':!0x0});for(const _0x34f5f3 of _0x5cfb57['comments']){const _0x1d3256=_0x1fa430['getComment'](_0x34f5f3['commentId']);_0x1d3256?_0x1d3256['content']!==_0x34f5f3['content']&&_0x1d3256['update']({'content':_0x34f5f3['content'],'isFromAdapter':!0x0}):_0x1fa430['addComment'](Object['assign'](S(_0x34f5f3),{'isFromAdapter':!0x0}));}}}['_getService'](_0x2e61a4){if(!this['_services']['has'](_0x2e61a4))throw new _0x408616('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x2e61a4});return this['_services']['get'](_0x2e61a4);}async['_fetchMissingUsersForThreads'](_0x1fd44a){const _0x5e0b3e=this['context']['plugins']['get'](_0x4c3346),{connection:_0x1ebf38}=this['context']['plugins']['get'](c),_0x185cc1=new Set();for(const {resolvedBy:_0x4589a1,comments:_0x23f30d}of _0x1fd44a){_0x4589a1&&!_0x5e0b3e['getUser'](_0x4589a1)&&_0x185cc1['add'](_0x4589a1);for(const {userId:_0x35156b}of _0x23f30d)_0x5e0b3e['getUser'](_0x35156b)||_0x185cc1['add'](_0x35156b);}if(0x0===_0x185cc1['size'])return;const _0x5d1a00=await lt['getMany'](_0x1ebf38,Array['from'](_0x185cc1));for(const _0x4cf02d of _0x5d1a00)_0x5e0b3e['getUser'](_0x4cf02d['id'])||_0x5e0b3e['addUser'](_0x4cf02d);}}async function B(_0x3286db){if('404'!==_0x3286db['code'])throw _0x3286db;}function dt(_0x184926){if((_0x5b9c4b=_0x184926)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x5b9c4b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5b9c4b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x5b9c4b;throw _0x184926;}function S(_0x277c97){return{'threadId':_0x277c97['commentThreadId'],'commentId':_0x277c97['commentId'],'content':_0x277c97['content'],'createdAt':_0x277c97['createdAt'],'authorId':_0x277c97['userId'],'attributes':_0x277c97['attributes']||{}};}class f extends _0x50372a{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>_0x3715b6)());['_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(_0x3cb4ca){super(_0x3cb4ca);const _0x2b33ec=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x2b33ec);}['init'](){const _0x57ead0=this['editor']['plugins']['get'](c),_0x4196c3=this['editor']['plugins']['get']('TrackChangesEditing');return _0x4196c3['adapter']={'getSuggestion':async _0x1a684f=>{await this['_waitForServiceReady']();const _0x43a307=await this['_trackChangesService']['get'](_0x1a684f)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x43a307]),_0x43a307;},'addSuggestion':async({id:_0x58c437,type:_0x4f5819,data:_0x54ca2a,originalSuggestionId:_0xc494f0,attributes:_0x8ee014})=>{await this['_waitForServiceReady']();const _0x47af8b={'id':_0x58c437,'type':_0x4f5819,'data':_0x54ca2a,'originalSuggestionId':_0xc494f0,'attributes':_0x8ee014},_0x4c4db2=await this['_trackChangesService']['add'](_0x58c437,_0x4f5819,_0x54ca2a,_0xc494f0,_0x8ee014)['catch'](_0x1839f5=>{if(ut(_0x1839f5))return new Promise(_0x56f2b7=>{this['_bufferedRequests']['set'](_0x58c437,{'resolve':_0x56f2b7,'suggestionData':_0x47af8b});});throw _0x1839f5;});return this['_bufferedRequests']['delete'](_0x58c437),_0x4c4db2;},'updateSuggestion':async(_0x144b0f,_0x1576a6)=>{if(await this['_waitForServiceReady'](),'open'!==_0x1576a6['state'])return this['_trackChangesService']['update'](_0x144b0f,_0x1576a6)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x28feed,_0x227ee3)=>{_0x4196c3['hasSuggestion'](_0x227ee3['id'])&&(_0x4196c3['getSuggestion'](_0x227ee3['id'])['attributes']=_0x227ee3['attributes']);}),this['_trackChangesService']['connect'](_0x57ead0['connection'])['then'](_0x12b2d9=>(_0x57ead0['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x12b2d9)['then'](()=>{for(const _0x257c05 of _0x12b2d9){_0x4196c3['addSuggestionData'](_0x257c05)['_saved']=!0x0;}})));}async['reconnect'](){const _0x5c5dc6=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x5b5713}=this['editor']['plugins']['get'](c),_0x40f528=await this['_trackChangesService']['connect'](_0x5b5713);await this['_fetchMissingUsersForThreads'](_0x40f528);for(const {suggestionData:_0x378b65,resolve:_0x1e70cf}of this['_bufferedRequests']['values']()){let _0x2e17d0=_0x40f528['find'](_0x304bb4=>_0x304bb4['id']===_0x378b65['id']);_0x2e17d0||(_0x2e17d0=await this['_trackChangesService']['add'](_0x378b65['id'],_0x378b65['type'],_0x378b65['data'],_0x378b65['originalSuggestionId'])),_0x1e70cf(_0x2e17d0);}for(const _0x324c91 of _0x40f528)_0x5c5dc6['hasSuggestion'](_0x324c91['id'])||_0x5c5dc6['addSuggestionData'](_0x324c91);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x2d028d=>{this['listenTo'](this['_trackChangesService'],'connected',_0x204485=>{_0x204485['off'](),_0x2d028d();});});}async['_fetchMissingUsersForThreads'](_0x5b188e){const _0x2674f1=this['editor']['plugins']['get'](_0x4c3346),{connection:_0x61cae6}=this['editor']['plugins']['get'](c),_0x2b272d=new Set();for(const {authorId:_0x48da32}of _0x5b188e)_0x2674f1['getUser'](_0x48da32)||_0x2b272d['add'](_0x48da32);if(0x0===_0x2b272d['size'])return;const _0x4a246b=await lt['getMany'](_0x61cae6,Array['from'](_0x2b272d));for(const _0x4f7c56 of _0x4a246b)_0x2674f1['getUser'](_0x4f7c56['id'])||_0x2674f1['addUser'](_0x4f7c56);}}function R(_0x4f5f03){if(ut(_0x4f5f03))return new Promise(()=>{});throw _0x4f5f03;}function ut(_0x58c6f3){return _0x58c6f3['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x58c6f3['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x50372a{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 _0x20557a=this['editor']['plugins']['get'](c),_0x2e9ba1=this['editor']['plugins']['get']('CommentsEditing'),_0x77c8b2=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x20557a,'change:state',(_0x1619fd,_0x32e1c4,_0x494523)=>{_0x2e9ba1['isThreadsLoadingPaused']='connected'!==_0x494523;});}),this['listenTo'](_0x20557a,'change:state',(_0x2ce699,_0x4e938d,_0x1409c4)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x1409c4);}),_0x77c8b2['_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 _0x50372a{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 _0x50372a{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x20d94b)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x4c3346];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3335c3){super(_0x3335c3);const _0x17d594=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x17d594);}async['init'](){const _0x43e13b=this['editor']['plugins']['get'](l),_0x5945e0=_0x43e13b['serverHistory'],_0x265929=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x5945e0,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x43e13b['sessionId']});const _0x3f9524=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x362857=await _0x2f88e7['isBundleUploaded'](_0x265929['connection'],_0x3f9524);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x5681e9})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x5681e9)),'updateRevisions':async _0x5d4c73=>{await this['_waitForServiceReady']();const _0x1dd2b0=this['_revisionTracker']['currentRevision'];if(_0x362857&&0x1===_0x5d4c73['length']&&_0x5d4c73[0x0]['id']===_0x1dd2b0['id'])return _0x5d4c73;for(const _0x232fc6 of _0x5d4c73)_0x232fc6['id']===_0x1dd2b0['id']&&(_0x232fc6['isEmptyCurrent']=_0x232fc6['fromVersion']===_0x232fc6['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x5d4c73,this['_lastRequestId'])['then'](_0x2912b4=>(this['_lastRequestId']=_0x2912b4,_0x5d4c73))['catch'](_0xe13d99=>{if(U(_0xe13d99)||'400'===_0xe13d99['code']&&void 0x0!==_0xe13d99['data']['wrongRequestId']){for(const _0x52c7cc of _0x5d4c73){!this['_revisionTracker']['repository']['getRevision'](_0x52c7cc['id'])||this['_revisionTracker']['_bufferUpdate'](_0x52c7cc['id'],_0x52c7cc,!0x1);}if(U(_0xe13d99))throw _0xe13d99;return _0x5d4c73;}throw _0xe13d99;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x2c345a,{revisionsData:_0x2d8dca,requestId:_0x517b4f})=>{Math['max'](..._0x2d8dca['map'](_0x56cff7=>_0x56cff7['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x2d8dca,_0x517b4f);}):this['_handleRevisionsUpdate'](_0x2d8dca,_0x517b4f);});const {revisions:_0x4223b6,requestId:_0x3468ef}=await this['_revisionHistoryService']['connect'](_0x265929['connection']);_0x265929['addToReconnectionStack'](this),this['_lastRequestId']=_0x3468ef,await this['_fetchMissingUsers'](_0x4223b6);for(const _0x298f37 of _0x4223b6)this['_revisionTracker']['addRevisionData'](_0x298f37);this['listenTo'](_0x43e13b,'change:_isConnected',(_0x269e9b,_0x4297b7,_0x4fe7a2)=>{_0x4fe7a2&&(this['_oldOffset']=_0x43e13b['_offset'],_0x269e9b['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x265929,'state',_0x21d9c9=>_0x21d9c9===_0x39f1be['CONNECTED']);}async['reconnect'](){const _0x5d9f18=this['editor']['plugins']['get'](c),_0x58d57d=this['editor']['plugins']['get'](l),_0x18ef1a=async()=>{const _0x43ebe9=this['_revisionTracker']['currentRevision'],_0x1db6b1=_0x43ebe9['id'],_0x1090ec=_0x1db6b1!==_0x58d57d['sessionId'];if(_0x1090ec){const _0x4e5f4c=_0x58d57d['_offset']-this['_oldOffset'],_0x9c289f=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x43ebe9['toVersion']+_0x4e5f4c!==_0x9c289f){const _0x1039df=_0x43ebe9['fromVersion']+_0x4e5f4c,_0x25fc3d=this['editor']['plugins']['get'](_0x4c3346),_0x4fdab9=this['_revisionTracker']['buildRevisionData']({'revision':_0x43ebe9,'from':_0x1039df,'to':_0x9c289f});_0x4fdab9['id']=_0x43ebe9['id'];const _0x74d991=_0x4fdab9['authorsIds']['map'](_0x43f931=>_0x25fc3d['getUser'](_0x43f931));_0x43ebe9['_update']({..._0x4fdab9,'authors':_0x74d991},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x43ebe9['id'],_0x4fdab9,!0x0);}this['_revisionTracker']['_startingVersion']=_0x9c289f,(_0x43ebe9['toVersion']===_0x43ebe9['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x1db6b1)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x1db6b1),this['_revisionTracker']['_createCurrentRevision'](_0x9c289f));}const {revisions:_0x3ad5e8,requestId:_0xa9019d}=await this['_revisionHistoryService']['reconnect'](_0x5d9f18['connection'],this['_lastRequestId']);_0x1090ec&&_0x3ad5e8['length']>0x0?_0x58d57d['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3ad5e8),this['_handleRevisionsUpdate'](_0x3ad5e8,_0xa9019d),this['_revisionTracker']['sendBufferedUpdates']());};return _0x58d57d['_isConnected']?_0x18ef1a():new Promise((_0x3f164b,_0x1cb8e6)=>{_0x58d57d['once']('change:_isConnected',()=>{_0x18ef1a()['then'](_0x3f164b)['catch'](_0x1cb8e6);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x25b7d7=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x589228=>{_0x589228['off'](),_0x25b7d7();});});}['_getLatestVersionFromServerOperations'](){const _0x346069=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x3d4f5d of _0x346069)if('marker'!==_0x3d4f5d['type']||_0x3d4f5d['affectsData'])return _0x3d4f5d['baseVersion']+0x1;}['_getLatestVersion'](){const _0x61d21a=this['editor']['plugins']['get'](l);return new Promise(_0x1a2d16=>{_0x61d21a['_isPendingUpdate']?_0x61d21a['once']('change:_isPendingUpdate',()=>{_0x1a2d16(this['_getLatestVersionFromServerOperations']());}):_0x1a2d16(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0xd9feed,_0x5b0bea){const _0x2ad339=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x5b0bea;for(const _0x1b89d5 of _0xd9feed){const _0x1bc378=_0x2ad339['getRevision'](_0x1b89d5['id']);if(_0x1bc378){if((_0x1b89d5['fromVersion']||_0x1b89d5['toVersion'])&&(_0x1b89d5['diffData']=null),_0x1bc378===this['_revisionTracker']['currentRevision']){const _0x2701f2=Math['max'](_0x1bc378['toVersion'],_0x1b89d5['toVersion']),_0x2f2c1b=Math['max'](_0x1bc378['fromVersion'],_0x1b89d5['fromVersion']);let _0xe21026;_0x1bc378['toVersion']===_0x1b89d5['toVersion']&&_0x1bc378['fromVersion']===_0x1b89d5['fromVersion']?(_0xe21026=!0x0,this['_preventResendingRevisionData'](_0x1b89d5)):_0x1b89d5['toVersion']===_0x2701f2&&_0x1b89d5['fromVersion']===_0x2f2c1b?_0xe21026=!0x1:(_0x1bc378['toVersion']===_0x2701f2&&_0x1bc378['fromVersion']===_0x2f2c1b||this['_fixRevision']({'revision':_0x1bc378,'from':_0x2f2c1b,'to':_0x2701f2}),_0xe21026=!0x0),_0xe21026&&(delete _0x1b89d5['fromVersion'],delete _0x1b89d5['toVersion'],delete _0x1b89d5['diffData'],delete _0x1b89d5['createdAt'],delete _0x1b89d5['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x1b89d5),this['_preventResendingRevisionData'](_0x1b89d5);}else this['_revisionTracker']['addRevisionData'](_0x1b89d5);}const _0x50ba41=_0x2ad339['getRevisions']();_0x50ba41['reverse']();for(let _0xa0c3ea=0x0;_0xa0c3ea<_0x50ba41['length']-0x1;_0xa0c3ea++){const _0x25a682=_0x50ba41[_0xa0c3ea],_0x53cd71=_0x50ba41[_0xa0c3ea+0x1];if(_0x25a682['fromVersion']<_0x53cd71['toVersion']){const _0x4c7f16=_0x53cd71['toVersion'],_0x2c4f94=Math['max'](_0x4c7f16,_0x25a682['toVersion']);this['_fixRevision']({'revision':_0x25a682,'from':_0x4c7f16,'to':_0x2c4f94});}}}['_fixRevision']({revision:_0x32e5d4,from:_0x45527e,to:_0x139e71}={}){const _0x4a7de3=this['editor']['plugins']['get'](_0x4c3346),_0x13b666=this['_revisionTracker']['buildRevisionData']({'revision':_0x32e5d4,'from':_0x45527e,'to':_0x139e71});_0x13b666['authors']=_0x13b666['authorsIds']['map'](_0xc619b4=>_0x4a7de3['getUser'](_0xc619b4)),_0x32e5d4['_update'](_0x13b666);}['_preventResendingRevisionData'](_0x5c159b){const _0x563f45={};_0x563f45['id']=_0x5c159b['id'];for(const _0x295536 of Object['keys'](_0x5c159b))'id'!==_0x295536&&(_0x563f45[_0x295536]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x563f45['id'],_0x563f45,!0x0);}async['_fetchMissingUsers'](_0x59feaf){const _0x19839e=this['editor']['plugins']['get'](_0x4c3346),{connection:_0x58bb33}=this['editor']['plugins']['get'](c),_0xabc583=new Set();for(const _0x24c934 of _0x59feaf){for(const _0x24e53d of _0x24c934['authorsIds'])_0x2733ce(_0x24e53d);_0x24c934['creatorId']&&_0x2733ce(_0x24c934['creatorId']);}if(0x0===_0xabc583['size'])return;const _0x812fff=await lt['getMany'](_0x58bb33,Array['from'](_0xabc583));for(const _0xa279e of _0x812fff)_0x19839e['getUser'](_0xa279e['id'])||_0x19839e['addUser'](_0xa279e);function _0x2733ce(_0x9d6c8){_0x19839e['getUser'](_0x9d6c8)||_0xabc583['add'](_0x9d6c8);}}}function U(_0x2f01d3){return _0x2f01d3['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x2f01d3['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2f01d3['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x50372a{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 _0x32c1aa{constructor(_0x99282d){super(_0x99282d);const _0x2fe8f0=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x2fe8f0['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x2fe8f0['to']('usersCount',_0x4a947f=>Q(_0x99282d,'CONNECTED_USERS',_0x4a947f))}]});}}class es extends _0x32c1aa{['items'];['keystrokes'];constructor(_0x1c64a1){super(_0x1c64a1);const _0x5d62ec=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x60e8df(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x5d62ec['if']('hasPopup'),'aria-expanded':_0x5d62ec['to']('isExpanded',_0x1052d2=>this['hasPopup']&&String(_0x1052d2)),'aria-label':_0x5d62ec['to']('hasPopup',_0x41c488=>Q(_0x1c64a1,_0x41c488?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x5d62ec['to']('hasPopup',_0x1c1000=>!!_0x1c1000&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x5d62ec['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x1b6c96,_0x41ee2a,_0x43d221)=>{this['element']&&(_0x43d221?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 _0x32c1aa{['counterView'];['inlineListView'];constructor(_0xbb82cc){super(_0xbb82cc);const _0x4d6c23=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0xbb82cc),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x5abe92 of this['inlineListView']['items'])_0x5abe92['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',_0x4d6c23['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class j extends _0x32c1aa{['listWrapperView'];constructor(_0x14c926,_0x3dbaeb){super(_0x14c926),this['listWrapperView']=new ft(_0x14c926,_0x3dbaeb),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':Q(_0x14c926,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class ft extends _0x5e215a{constructor(_0x53fe56,_0xeb3e12){super(_0x53fe56);const _0x523b94=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0xeb3e12?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x523b94['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x523b94['to']('role'),'aria-label':_0x523b94['to']('ariaLabel'),'aria-labelledby':_0x523b94['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x38475b['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x4d3c33=this['element'];_0x4d3c33&&(this['_isScrollable']=Math['max'](_0x4d3c33['scrollHeight'],_0x4d3c33['clientHeight'])>0.8*window['innerHeight']);}}class k extends et{['userView'];constructor(_0x45bab6,_0x46441e,_0x18ca97){super(_0x45bab6);const _0x2295c5=this['bindTemplate'];this['userView']=new rt(_0x45bab6,_0x46441e);const _0xda6f3b={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x46441e['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x46441e['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x46441e['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x18ca97&&(_0xda6f3b['tag']='button',_0xda6f3b['on']={'click':_0x2295c5['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xda6f3b);}['focus'](){this['element']['focus']();}}class y extends _0x32c1aa{['userView'];['markerView'];constructor(_0x155632,_0x11163b,_0x168381){super(_0x155632);const _0x22b73f=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new rt(_0x155632,_0x11163b),this['markerView']=new ct(_0x155632,_0x11163b);const _0x3ad4bb=new ot(_0x155632);_0x3ad4bb['template']['tag']='span',_0x3ad4bb['text']=_0x11163b['name'];const _0x18c731={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x22b73f['to']('isFocusable',_0x595e2d=>!!_0x595e2d&&0x0),'aria-labelledby':_0x3ad4bb['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x22b73f['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x22b73f['to']('hasTooltip',_0x1625a1=>!_0x1625a1),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x3ad4bb]};_0x168381&&(_0x18c731['tag']='button',_0x18c731['on']={'click':_0x22b73f['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x18c731);}}class ct extends _0x32c1aa{constructor(_0x2acadf,_0x24c0fa){super(_0x2acadf),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x24c0fa['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const A={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x37a9d3{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x4cadb1){super(_0x4cadb1),this['context']['config']['define']('presenceList',A);const _0x31d572=_0x4cadb1['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x31d572)throw new _0x408616('presencelist-collapseat-invalid-format',this);if(_0x31d572<0x1)throw new _0x408616('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x5da562(),this['balloonPanelView']=new _0x4bb92d(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x448557 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x448557);this['listenTo'](this['_allConnectedUsers'],'add',(_0x2ae293,_0x1e748f)=>{this['_handleUserAdd'](_0x1e748f);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x277e3d,_0x77f534)=>{this['_handleUserRemove'](_0x77f534);});}['_createView'](){const _0x371173=this['context'],_0x2cc2c8=new L(this['context']['locale']),_0x48a799=this['balloonPanelView'];if(!_0x1667f2(_0x371173['config']['get']('presenceList.container')))throw new _0x408616('presencelist-missing-container',this);return _0x2cc2c8['counterView']['bind']('usersCount')['to'](this),_0x2cc2c8['bind']('isCollapsed')['to'](this,'usersCount',_0x405e63=>{const {collapseAt:_0x5e9170,displayMe:_0x262b17}=_0x371173['config']['get']('presenceList'),_0x49224c=_0x405e63>=_0x5e9170;return _0x2cc2c8['counterView']['isHidden']=!(0x1==_0x405e63&&_0x262b17||_0x49224c),_0x49224c||this['hideDropdown'](),_0x49224c;}),_0x2cc2c8['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x15db90=>{const _0x406c99=_0x371173['config']['get']('presenceList'),_0xbb6ed5=new y(_0x371173['locale'],_0x15db90,!!_0x406c99['onClick']);return _0xbb6ed5['bind']('hasTooltip')['to'](_0x2cc2c8,'isCollapsed',_0x175d65=>!_0x175d65),_0xbb6ed5['bind']('isFocusable')['to'](_0x2cc2c8,'isCollapsed',_0x5cd35f=>!_0x5cd35f),_0x406c99['onClick']&&this['listenTo'](_0xbb6ed5,'execute',()=>{this['view']['isCollapsed']||_0x406c99['onClick'](_0x15db90,_0xbb6ed5['element']);}),_0xbb6ed5;}),this['listenTo'](_0x2cc2c8['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x2cc2c8['inlineListView']['keystrokes']['set']('Enter',(_0x24c4ab,_0x68243a)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x68243a());}),_0x2cc2c8['render'](),_0x48a799['render'](),_0x452c2f({'emitter':_0x2cc2c8,'activator':()=>_0x48a799['isVisible'],'contextElements':[_0x48a799['element'],_0x2cc2c8['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x371173['config']['get']('presenceList.container')['appendChild'](_0x2cc2c8['element']),this['_bodyCollection']=new _0x400f02(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x2cc2c8;}['_handleUserAdd'](_0x5923f6){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x5923f6['isMe'])return;const _0x234ce4=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x234ce4&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x353801=_0x5923f6['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x5923f6,_0x353801);}['_handleUserRemove'](_0x468634){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x468634['id'])&&(this['currentDisplayedUsers']['remove'](_0x468634['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x8b8a0c of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x8b8a0c['id']))return void this['currentDisplayedUsers']['add'](_0x8b8a0c,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4ef9bb=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new j(this['context']['locale'],!!_0x4ef9bb['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x177eba}=this['presenceDropdownView'];_0x177eba['items']['bindTo'](this['_allConnectedUsers'])['using'](_0xcae3b8=>{if(!_0x4ef9bb['displayMe']&&_0xcae3b8['isMe'])return null;const _0x55639f=new k(this['context']['locale'],_0xcae3b8,!!_0x4ef9bb['onClick']);return _0x4ef9bb['onClick']&&this['listenTo'](_0x55639f,'execute',()=>{_0x4ef9bb['onClick'](_0xcae3b8,_0x55639f['element']);}),_0x55639f;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x177eba['focus'](),_0x177eba['checkIfScrollable']();const _0x559eae=(_0x4ecf5c,_0x1330db)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x1330db();};_0x177eba['keystrokes']['set']('Esc',_0x559eae),_0x177eba['keystrokes']['set']('Shift+Tab',_0x559eae),_0x177eba['keystrokes']['set']('Tab',(_0x23ba25,_0x41491c)=>{!function(_0x551708){const _0x29e028=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x5378fd=>_0x5378fd+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x39489a=[...document['body']['querySelectorAll'](_0x29e028)]['filter'](_0x2a626c=>_0x2a626c===document['activeElement']||_0x2a626c['offsetWidth']+_0x2a626c['offsetHeight']>0x0)['sort']((_0x32d156,_0x3f229b)=>(_0x32d156['tabIndex']||0x0)-(_0x3f229b['tabIndex']||0x0)),_0x10d74b=_0x39489a['indexOf'](_0x551708),_0xe0dc73=_0x39489a[(_0x10d74b+0x1)%_0x39489a['length']];_0xe0dc73&&_0xe0dc73['focus']();}(this['view']['element']),this['hideDropdown'](),_0x41491c();}),_0x177eba['focusTracker']['add'](this['view']['element']),_0x177eba['focusTracker']['on']('change:isFocused',(_0x1f614c,_0x5252ba,_0x16f62f)=>{_0x16f62f||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 _0x37a9d3{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