@ckeditor/ckeditor5-real-time-collaboration 45.1.0-alpha.1 → 45.1.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +14 -14
  150. package/src/common-translations.js +1 -1
  151. package/src/index.js +1 -1
  152. package/src/presencelist/presencelistui.js +1 -1
  153. package/src/presencelist/view/presencecounterview.js +1 -1
  154. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  155. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  156. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  157. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  158. package/src/presencelist/view/presencelistview.js +1 -1
  159. package/src/presencelist.js +1 -1
  160. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
  161. package/src/realtimecollaborativecomments.js +1 -1
  162. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
  163. package/src/realtimecollaborativeediting/sessions.js +1 -1
  164. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  165. package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
  166. package/src/realtimecollaborativeediting.js +1 -1
  167. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
  168. package/src/realtimecollaborativerevisionhistory.js +1 -1
  169. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
  170. package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0x1e9e2c,Plugin as _0x20916b,PendingActions as _0x214519,Context as _0x477adb}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x3a5f17,CKEditorError as _0x33aefe,Collection as _0x45ec41,global as _0x9f47bb,version as nt,uid as _0x54b238,KeystrokeHandler as _0x31ddfb}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x5c3da0,View as _0x5f4aca,ListView as _0x48119e,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x181e94,clickOutsideHandler as _0x322879,BodyCollection as _0x188f88}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x266e39,NoOperation as _0x171dfb,InsertOperation as _0x4a7479,MarkerOperation as _0x51983f,RootAttributeOperation as _0x20e10e,transformSets as _0x39c88a,OperationFactory as _0x3ac639}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x14ebd0,CollaborativeEditingService as _0x3f3ce7,User as dt,CommentsService as _0x397a38,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x4b25d7,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x5874be}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0xf9bf6f}from'es-toolkit/compat';class c extends _0x1e9e2c{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x5c3da0];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x26395d){super(_0x26395d),this['set']('state',_0x14ebd0['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x3a5f17);}['init'](){const _0x39f4f0=this['context'],_0x25f2ec=_0x39f4f0['plugins']['get']('CloudServices'),_0x4dff67=_0x39f4f0['plugins']['get'](_0x5c3da0);if(!_0x25f2ec['token'])throw new _0x33aefe('websocketgateway-missing-token',this);if(!_0x25f2ec['webSocketUrl'])throw new _0x33aefe('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'](_0x25f2ec['token'],_0x25f2ec['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x5c10e4=>{if(this['connection']=_0x5c10e4,this['bind']('state')['to'](_0x5c10e4,'state',this,'_isBrowserOffline',(_0x2a0f12,_0x479404)=>('connected'!==_0x2a0f12&&(this['_shouldPluginsReconnect']=!0x0),_0x479404||_0x2a0f12!==_0x14ebd0['CONNECTED']?_0x14ebd0['DISCONNECTED']:this['state']==_0x14ebd0['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x14ebd0['CONNECTING']):_0x14ebd0['CONNECTED'])),this['connection']['on']('error',(_0x47b674,_0x43b576)=>{if('limitExceeded'!==_0x43b576['code'])throw console['error'](_0x43b576),new _0x33aefe('cloudservices-init',null,{'originalError':_0x43b576});_0x4dff67['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'});}),!_0x5c10e4['me'])return new Promise(_0x5c25a9=>_0x5c10e4['on']('change:me',_0x5c25a9));})['catch'](_0x2fa8fc=>{throw console['error'](_0x2fa8fc),new _0x33aefe('cloudservices-init',null,{'originalError':_0x2fa8fc});});}['addToReconnectionStack'](_0xabb0b8){if('function'!=typeof _0xabb0b8['reconnect'])throw new _0x33aefe('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0xabb0b8))throw new _0x33aefe('websocketgateway-plugin-already-registered',this,{'name':_0xabb0b8['constructor']['pluginName']});this['_reconnectionStack']['add'](_0xabb0b8);}['removeFromReconnectionStack'](_0x8d1ea1){this['_reconnectionStack']['delete'](_0x8d1ea1);}['isInReconnectionStack'](_0x17a5e5){return this['_reconnectionStack']['has'](_0x17a5e5);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x421e94=>_0x421e94['reconnect']())))['then'](()=>this['state']=_0x14ebd0['CONNECTED'])['catch'](_0xf0861b=>{throw console['error'](_0xf0861b),new _0x33aefe('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x14ebd0['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x1e9e2c{['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,_0x4b25d7];}constructor(_0x3494d4){super(_0x3494d4),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x45ec41(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x4b25d7);}['init'](){const _0x222db9=this['context']['plugins']['get'](c);this['listenTo'](_0x222db9,'change:state',(_0x1929ce,_0x431c5e,_0x577705)=>{if('connected'!==_0x577705)this['channelSessions']['forEach'](_0xf07ac2=>_0xf07ac2['clear']()),this['channelConnectedUsers']['forEach'](_0x58d1d0=>_0x58d1d0['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x1f332c,_0x1ba335]of this['_registeredSessions'])for(const _0x3fd4ad of _0x1ba335)this['_handleSessionAdd'](_0x1f332c,_0x3fd4ad);}}),this['_createUser'](_0x222db9['connection']['me'],!0x0);}['register'](_0x36ad12,_0x254371){if(this['_registeredSessions']['has'](_0x36ad12))throw new _0x33aefe('sessions-register-already-registered',null,{'channelId':_0x36ad12});this['_registeredSessions']['set'](_0x36ad12,_0x254371),this['channelSessions']['set'](_0x36ad12,new _0x45ec41()),this['channelConnectedUsers']['set'](_0x36ad12,new _0x45ec41()),this['listenTo'](_0x254371,'add',(_0x1b6563,_0x8a8470)=>this['_handleSessionAdd'](_0x36ad12,_0x8a8470)),this['listenTo'](_0x254371,'remove',(_0x1f3405,_0x133e76)=>this['_handleSessionRemove'](_0x36ad12,_0x133e76));for(const _0x32f061 of _0x254371)this['_handleSessionAdd'](_0x36ad12,_0x32f061);}['unregister'](_0x16673b){if(!this['_registeredSessions']['has'](_0x16673b))throw new _0x33aefe('sessions-unregister-not-exist',null,{'channelId':_0x16673b});const _0x3e5b11=this['_registeredSessions']['get'](_0x16673b);this['stopListening'](_0x3e5b11);for(const _0x25ef92 of _0x3e5b11)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x16673b,_0x25ef92);this['_registeredSessions']['delete'](_0x16673b),this['channelSessions']['delete'](_0x16673b),this['channelConnectedUsers']['delete'](_0x16673b);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x11ba69){for(const _0x55813f of this['channelSessions']['values']())for(const _0x5608a1 of _0x55813f)if(_0x5608a1['id']===_0x11ba69)return _0x5608a1['user'];}['getUserSessions'](_0x835f67,_0x2ce133){const _0x5a69f7=_0x2ce133?[this['channelSessions']['get'](_0x2ce133)]:this['channelSessions']['values'](),_0x5b89a6=new Set();for(const _0x2eb693 of _0x5a69f7)for(const _0xce8c49 of _0x2eb693)_0xce8c49['user']['id']===_0x835f67['id']&&_0x5b89a6['add'](_0xce8c49['id']);return _0x5b89a6;}['getUserRole'](_0x39558b){for(const _0x12377a of this['channelSessions']['values']())for(const _0x56c2ef of _0x12377a)if(_0x56c2ef['user']===_0x39558b)return _0x56c2ef['role'];}['_handleSessionAdd'](_0x14ab28,_0x37397b){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x26521f=_0x37397b['user'],_0x44481c=this['_users']['getUser'](_0x26521f['id'])||this['_createUser'](_0x26521f),_0x3fcf7a=Object['assign']({},_0x37397b,{'user':_0x44481c});this['channelSessions']['get'](_0x14ab28)['add'](_0x3fcf7a);const _0x572b09=this['channelConnectedUsers']['get'](_0x14ab28);_0x572b09['has'](_0x44481c['id'])||_0x572b09['add'](_0x44481c),this['allConnectedUsers']['has'](_0x44481c['id'])||this['allConnectedUsers']['add'](_0x44481c,_0x44481c['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x14ab28,{'channelId':_0x14ab28,'session':_0x3fcf7a});}['_handleSessionRemove'](_0x40d861,_0x1d304d){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x2178ff=this['channelConnectedUsers']['get'](_0x40d861),_0x5b9421=_0x1d304d['user'];_0x5b9421['id']&&(this['channelSessions']['get'](_0x40d861)['remove'](_0x1d304d['id']),_0x2178ff['has'](_0x5b9421['id'])&&!this['getUserSessions'](_0x5b9421,_0x40d861)['size']&&_0x2178ff['remove'](_0x5b9421['id']),this['allConnectedUsers']['get'](_0x5b9421['id'])&&!this['getUserSessions'](_0x5b9421)['size']&&this['allConnectedUsers']['remove'](_0x5b9421['id']));}['_createUser'](_0x349092,_0x77ba5c){const _0x53e76b=this['_users']['addUser'](_0x349092);return _0x77ba5c&&this['_users']['defineMe'](_0x349092['id']),_0x53e76b['orderNumber']=this['_uniqueUsersCount']++,_0x53e76b;}}class q extends _0x20916b{['_domEmitter']=new(_0x3a5f17())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5615ee=this['editor'],_0x3efbd6=_0x5615ee['plugins']['get'](i);_0x5615ee['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x39c310,{writer:_0x338634})=>function(_0x459458,_0xeeafcc,_0x53c297,_0x416129){const _0x16b5a0=_0x459458['markerName']['split'](':')[0x2],_0x4c6aaf=_0x53c297['getUserBySessionId'](_0x16b5a0);if(!_0x4c6aaf||_0x16b5a0===_0x53c297['mySessionId'])return;if(!_0x416129['model']['schema']['checkChild'](_0x459458['markerRange']['start'],'$text'))return;const _0x901d0d={'class':'ck-user__marker\x20'+_0x4c6aaf['color']['getMarkerClass'](),'data-name':_0x4c6aaf['name'],'data-session-id':_0x16b5a0},_0x1f0a04=_0x416129['model']['markers']['get'](_0x459458['markerName']),_0x520384=_0x1f0a04['getStart'](),_0x492018=_0x520384['nodeAfter'],_0x495e4f=_0x416129['model']['schema'];if(_0x492018&&_0x495e4f['isObject'](_0x492018)&&_0x495e4f['isInline'](_0x492018)&&!_0x416129['model']['markers']['get']('user:range:'+_0x16b5a0)['getRange']()['isCollapsed'])return;const _0x4c9a7f=_0x520384['parent'];return _0x416129['model']['schema']['isLimit'](_0x4c9a7f)&&!_0x416129['model']['hasContent'](_0x4c9a7f)&&(_0x901d0d['contenteditable']=!0x1),function(_0x14626f,_0x1f531d,_0x441306){const _0x1c2e13=_0x14626f['createUIElement']('span',_0x1f531d);return _0x14626f['setCustomProperty']('userPositionMarker',!0x0,_0x1c2e13),_0x1c2e13['render']=function(_0xe2a58c){const _0xd7fa31=this['toDomElement'](_0xe2a58c),_0x18fada=document['createElement']('span');return _0x18fada['classList']['add']('ck-user__marker-tooltip'),_0x18fada['setAttribute']('contenteditable','false'),_0x18fada['setAttribute']('spellcheck','false'),_0x18fada['textContent']=_0x441306['name'],_0xd7fa31['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x18fada['outerHTML']+'⁠',_0xd7fa31['addEventListener']('mouseenter',()=>{_0xd7fa31['classList']['add']('ck-user__marker_hovered');}),_0xd7fa31['addEventListener']('mouseleave',()=>{_0xd7fa31['classList']['remove']('ck-user__marker_hovered');}),_0xd7fa31;},_0x1c2e13['isSimilar']=function(_0x288f9c){return!(!this['getCustomProperty']('userPositionMarker')||!_0x288f9c['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x288f9c['getAttribute']('data-session-id'));},_0x1c2e13;}(_0xeeafcc,_0x901d0d,_0x4c6aaf);}(_0x39c310,_0x338634,_0x3efbd6,_0x5615ee)}),_0x5615ee['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x310039=>function(_0x4391eb,_0x5cc009){const _0x3c7544=_0x4391eb['markerName']['split'](':')[0x2];if(_0x3c7544===_0x5cc009['mySessionId'])return null;const _0x241aa4=_0x5cc009['getUserBySessionId'](_0x3c7544);if(!_0x241aa4)return{'id':_0x3c7544,'classes':[]};return{'id':_0x3c7544,'classes':['ck-user__selection',_0x241aa4['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x3c7544},'priority':0x7d0+_0x241aa4['orderNumber']};}(_0x310039,_0x3efbd6)}),function(_0x494654){const _0x5b71d7=_0x494654['model'],_0x54577e=new Map(),_0x5d4b4a=_0x494654['plugins']['get'](i);_0x5b71d7['markers']['on']('update:user:range',(_0x17749c,_0x2670cd,_0x22b9d3,_0x418e65)=>{if(!_0x418e65&&_0x54577e['get'](_0x2670cd['name']))return _0x54577e['get'](_0x2670cd['name'])['detach'](),void _0x54577e['delete'](_0x2670cd['name']);const _0x5d7ca9=_0x2670cd['name']['split'](':')[0x2];if(_0x5d7ca9===_0x5d4b4a['mySessionId'])return;const _0x4ad6a5='user:position:'+_0x5d7ca9;_0x5b71d7['markers']['has'](_0x4ad6a5)&&_0x494654['editing']['reconvertMarker'](_0x4ad6a5),_0x2670cd['on']('change:range',(_0x401318,_0x31cd8a,_0x2dea8a)=>{if('$graveyard'!=_0x31cd8a['root']['rootName']&&'$graveyard'==_0x2670cd['getRange']()['root']['rootName']&&!_0x54577e['has'](_0x2670cd['name'])){const _0x3c879e=_0x5b71d7['schema']['getNearestSelectionRange'](_0x2dea8a['deletionPosition']);if(_0x3c879e){const _0x25adc5=ht['fromRange'](_0x3c879e);_0x54577e['set'](_0x2670cd['name'],_0x25adc5),_0x25adc5['on']('change:range',(_0x58b814,_0x31babc,_0xabfd1)=>{if('$graveyard'==_0x25adc5['root']['rootName']){const _0x2139c1=_0x5b71d7['schema']['getNearestSelectionRange'](_0xabfd1['deletionPosition']);_0x2139c1?(_0x25adc5['start']=_0x2139c1['start'],_0x25adc5['end']=_0x2139c1['end']):(_0x54577e['delete'](_0x2670cd['name']),_0x25adc5['detach']());}});}}});}),_0x5b71d7['document']['on']('change',()=>{_0x54577e['size']>0x0&&_0x5b71d7['enqueueChange']({'isUndoable':!0x1},_0x2e760d=>{for(const [_0xa31b4,_0x418b54]of _0x54577e)'$graveyard'==_0x5b71d7['markers']['get'](_0xa31b4)['getRange']()['root']['rootName']&&(te(_0xa31b4['split'](':')[0x2],_0x418b54['toRange'](),_0x5b71d7,_0x2e760d),_0x418b54['detach']());_0x54577e['clear']();});});}(_0x5615ee),this['_domEmitter']['listenTo'](_0x9f47bb['document'],'keydown',(_0x4279fe,{key:_0x59c620})=>{'Escape'===_0x59c620&&function(_0x96f3d4){_0x96f3d4['editing']['view']['change'](_0x1631f9=>{for(const _0x593c0b of _0x96f3d4['model']['markers']){if(!_0x593c0b['name']['startsWith']('user:position'))continue;const _0xf7a909=_0x96f3d4['editing']['mapper']['markerNameToElements'](_0x593c0b['name']);if(_0xf7a909){for(const _0x8994cc of _0xf7a909)_0x1631f9['removeClass']('ck-user__marker_hovered',_0x8994cc);}}});}(_0x5615ee);},{'useCapture':!0x0});}['afterInit'](){const _0x30e78e=this['editor'],_0x50f707=_0x30e78e['commands']['get']('undo');_0x50f707&&_0x30e78e['model']['on']('applyOperation',(_0x4c0491,_0x479940)=>{const _0x46a93c=_0x479940[0x0];if(!_0x46a93c['isDocumentOperation'])return;if('marker'!=_0x46a93c['type']||!_0x46a93c['name']['startsWith']('user:'))return;const _0x25d2bf=_0x46a93c['batch'];_0x50f707['_createdBatches']['has'](_0x25d2bf)&&(_0x46a93c['newRange']=_0x46a93c['oldRange']?_0x30e78e['model']['createRange'](_0x46a93c['oldRange']['start'],_0x46a93c['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x446db7=this['editor'],_0x5c7f9f=_0x446db7['model']['document'],_0xea1db9=_0x446db7['plugins']['get'](i);_0x446db7['model']['enqueueChange']({'isUndoable':!0x1},_0x11f7d7=>{const _0x4cc701='user:range:'+_0xea1db9['mySessionId'],_0x4d65be='user:position:'+_0xea1db9['mySessionId'],_0x2d1db9=_0x446db7['model']['markers']['has'](_0x4cc701);_0x446db7['editing']['view']['hasDomSelection']?te(_0xea1db9['mySessionId'],_0x5c7f9f['selection']['getFirstRange'](),_0x446db7['model'],_0x11f7d7):_0x2d1db9&&(_0x11f7d7['removeMarker'](_0x4cc701),_0x11f7d7['removeMarker'](_0x4d65be));});}}function te(_0x12f1f7,_0x134d24,_0x5526ba,_0x4d44aa){const _0x1224cc='user:range:'+_0x12f1f7,_0x29f53e='user:position:'+_0x12f1f7,_0x45c2da=_0x134d24['getContainedElement']();let _0x5e2d7e=_0x134d24['start'];_0x45c2da&&_0x45c2da['is']('element','tableCell')&&(_0x5e2d7e=function(_0x1634d1,_0x48f87a){for(const _0xcd80f9 of _0x1634d1['getPositions']())if(_0x48f87a['schema']['checkChild'](_0xcd80f9,'$text'))return _0xcd80f9;}(_0x134d24,_0x5526ba),_0x134d24=_0x4d44aa['createRange'](_0x5e2d7e));const _0x1bdfd6=_0x4d44aa['createRange'](_0x5e2d7e);_0x5526ba['markers']['has'](_0x1224cc)?(_0x4d44aa['updateMarker'](_0x1224cc,{'range':_0x134d24}),_0x4d44aa['updateMarker'](_0x29f53e,{'range':_0x1bdfd6})):(_0x4d44aa['addMarker'](_0x1224cc,{'range':_0x134d24,'usingOperation':!0x0}),_0x4d44aa['addMarker'](_0x29f53e,{'range':_0x1bdfd6,'usingOperation':!0x0}));}function G(_0x508767,_0x3b2f53,_0x562d87){const _0x255f46=_0x508767['t'],t=_0x508767['t'];switch(_0x3b2f53){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 _0x255f46({'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'},_0x562d87);default:return'';}}let J=0x1;class l extends _0x20916b{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x3f3ce7)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,q,_0x214519,_0x4b25d7,_0x5c3da0];}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 _0x5cb369=this['serverHistory']['getOperations']();for(let _0x3e8d19=_0x5cb369['length']-0x1;_0x3e8d19>=0x0;_0x3e8d19--){const _0x5a834f=_0x5cb369[_0x3e8d19];if(!this['_disconnectionOperations']['has'](_0x5a834f))return _0x5a834f['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0xce836){if(super(_0xce836),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x266e39(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x33aefe('collaboration-missing-channelid',this);const _0x264846=_0xce836['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x264846,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x5874be(),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 Y(this['_disconnectionOperations']);}['init'](){const _0x3f9e98=this['editor'],_0x4250bb=_0x3f9e98['plugins']['get'](_0x4b25d7),_0x499169=_0x3f9e98['plugins']['get'](c);this['listenTo'](_0x4250bb,'getOperationAuthor',(_0x109ee3,_0x48aaa7)=>{const _0x1a7411=_0x48aaa7[0x0];_0x1a7411['_authorId']&&(_0x109ee3['return']=_0x4250bb['getUser'](_0x1a7411['_authorId']),_0x109ee3['stop']()),null===_0x1a7411['_authorId']&&(_0x109ee3['return']=null,_0x109ee3['stop']());},{'priority':'high'}),this['listenTo'](_0x3f9e98['model']['document']['selection'],'change:range',(_0x613593,_0x498d11)=>{_0x498d11['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x3f9e98['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x3f9e98['model']['on']('applyOperation',(_0x2233cd,_0x4047d)=>{const _0x1738d7=_0x4047d[0x0];_0x1738d7['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x1738d7),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x499169,'state',this,'_hasSynchronizationProblem',(_0x31b9d4,_0x45b787)=>'connected'===_0x31b9d4&&!_0x45b787),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x3f9e98['disableReadOnlyMode']('rtc-offline'):_0x3f9e98['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x3f9e98['disableReadOnlyMode']('rtc-offline'):_0x3f9e98['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0xa4f4f9=this['editor']['plugins']['get'](i),_0x37f422=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0xa4f4f9['unregister'](this['_channelId']);const _0x1ea2de=await this['_service']['reconnect'](_0x37f422['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1ea2de)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4062e6=await this['_service']['getConnectedSessions']();_0xa4f4f9['register'](this['_channelId'],_0x4062e6),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x429429){if(function(_0x339314){return'404'===_0x339314['code'];}(_0x429429)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x3345f0){return'409'===_0x3345f0['code'];}(_0x429429)){const _0x36651b=G(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'](_0x36651b);}else{if(!(_0x429429 instanceof Q))throw _0x429429;this['_handleReconnectionError']();}}}}['destroy'](){const _0x2664a7=this['editor']['plugins']['get'](c),_0x431c1c=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x431c1c['channelSessions']['has'](this['_channelId'])&&_0x431c1c['unregister'](this['_channelId']),_0x2664a7['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x34694f){if(this['sessionId']!==_0x34694f['sessionId']&&this['_lastSyncedOperationId']!==_0x34694f['lastOperationId'])throw new Q();return this['sessionId']=_0x34694f['sessionId'],this['_handleServerResponse']([],{..._0x34694f,'wereChangesApplied':!0x1,'data':_0x34694f['data']},'reconnect');}async['_connectService'](_0x1ad6cc,_0x578aed=!0x1){const {connection:_0x2dde66}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x2dde66,this['_channelId'])['then'](_0x21c963=>this['_initSessionsHandling'](_0x21c963))['catch'](_0x1c041a=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x1c041a);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xecad3,_0xf432d)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0xf432d);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x471d87=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1ad6cc);this['_isPendingUpdate']=!0x0;const _0x13da57=await this['_service']['connect'](_0x2dde66,this['_compressOperations'](_0x1ad6cc),_0x471d87);if(this['sessionId']=_0x13da57['sessionId'],_0x578aed){if(!_0x13da57['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x13da57['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x1ad6cc,_0x13da57,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x13da57,_0x1ad6cc);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x33e4dc=this['editor']['plugins']['get'](i),_0x1c8ffa=this['editor']['plugins']['get'](q),_0x189901=_0x33e4dc['channelSessions']['get'](this['_channelId']);_0x189901&&_0x189901['length']>0x1?_0x1c8ffa['createUserMarkerOperations']():this['listenTo'](_0x33e4dc,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x33e4dc['channelSessions']['get'](this['_channelId'])['length']&&_0x1c8ffa['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x2464eb,_0x20373c,_0x4485fb,_0xa27b03){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x20373c){const _0x3769c0=this['_decompressOperations'](_0x4485fb,_0xa27b03);await this['_fetchMissingUsers'](_0x3769c0),this['_handleExternalOperations'](_0x3769c0,_0x20373c,_0x4485fb['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x26b791}=this['editor'];let _0x2a8d27;try{_0x2a8d27=await this['_service']['getDocumentDetails']();}catch(_0x3a35f7){const _0x3fbed7=G(_0x26b791,'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'](_0x3fbed7);}const _0x4fde9e=_0x2a8d27['currentDocumentSession']||_0x2a8d27['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x4fde9e['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x46dbac=G(_0x26b791,'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'](_0x46dbac);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x29e812){const _0x1722f1=this['editor']['plugins']['get'](i);this['listenTo'](_0x1722f1,'sessionAdd:'+this['_channelId'],(_0x454ba6,{session:_0x3dd404})=>{if(_0x3dd404['id']===_0x1722f1['mySessionId']){_0x454ba6['off']();const _0x5f04cf=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0xaf8ea8=_0x3dd404['permissions'];_0x5f04cf&&_0x5f04cf['isEnabled']&&(_0xaf8ea8=_0xaf8ea8['filter'](_0x410df7=>'document:write'!==_0x410df7)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0xaf8ea8,this['_channelId']);}}),_0x1722f1['register'](this['_channelId'],_0x29e812);}['_initThrowingOnDataSet'](){const _0x51f57a=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x3037a8)=>{if(!_0x3037a8[_0x3037a8['length']-0x1]['suppressErrorInCollaboration'])throw new _0x33aefe('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x51f57a['apply'](this['editor']['data'],_0x3037a8);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x18d81f,[_0x2c2bd6])=>{if(this['_document']['version'])throw new _0x33aefe('realtimecollaborationclient-init-document-already-initialized',this);_0x18d81f['stop'](),this['_setPendingAction']();const _0x589989=this['editor']['config']['get']('rootsAttributes'),_0x281586=this['_getOperationsFromInitData'](_0x2c2bd6,_0x589989);0x0==_0x281586['length']&&_0x281586['push'](new _0x171dfb(0x0)),_0x18d81f['return']=this['_connectService'](_0x281586)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0xdf8c9c=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0xdf8c9c))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3c44c1,[_0x278c6d,_0x4ba368])=>{_0x3c44c1['stop']();const _0x4b11c6=this['editor']['model']['document']['getRoot'](_0x278c6d);if(!this['_knownRootNames']['has'](_0x278c6d)){const _0x312c1e=_0x4ba368&&_0x4ba368['data']?_0x4ba368['data']:'',_0x35381f=_0x4ba368&&_0x4ba368['attributes']?_0x4ba368['attributes']:{};await this['_loadRoot'](_0x278c6d,_0x312c1e,_0x35381f);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x4b11c6['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x4b11c6);});},{'priority':'high'});}async['_fetchMissingUsers'](_0xb3a6bb){const _0x69e5f1=this['editor']['plugins']['get'](_0x4b25d7),{connection:_0x2b4f1c}=this['editor']['plugins']['get'](c),_0x313309=new Set();for(const _0x4cf7cc of _0xb3a6bb){const _0x307d8f=_0x4cf7cc['_authorId'];_0x307d8f&&!_0x69e5f1['getUser'](_0x307d8f)&&_0x313309['add'](_0x307d8f);}if(0x0===_0x313309['size'])return;const _0x11587e=await dt['getMany'](_0x2b4f1c,Array['from'](_0x313309));for(const _0x4011e0 of _0x11587e)_0x69e5f1['getUser'](_0x4011e0['id'])||_0x69e5f1['addUser'](_0x4011e0);}['_getOperationsFromInitData'](_0x5ad6e0,_0x1ad591={}){const _0x1a12c1=this['editor']['model'],_0xf6ff6f=[];let _0xd66811=0x0;const _0x2ddef4='string'==typeof _0x5ad6e0?{'main':_0x5ad6e0}:_0x5ad6e0;for(const _0x26f1de of Object['keys'](_0x2ddef4)){if(!this['_document']['roots']['has'](_0x26f1de))throw new _0x33aefe('realtimecollaborationclient-init-non-existent-root',this);const _0x502e41=this['editor']['data']['parse'](_0x2ddef4[_0x26f1de]),_0x5cbc93=this['_document']['getRoot'](_0x26f1de),_0x81811c=new _0x4a7479(_0x1a12c1['createPositionAt'](_0x5cbc93,0x0),_0x502e41,_0xd66811++);_0xf6ff6f['push'](_0x81811c);for(const [_0x58d279,_0x52d88c]of _0x502e41['markers']){const _0x203635=_0x1a12c1['createRange'](_0x1a12c1['createPositionFromPath'](_0x5cbc93,_0x52d88c['start']['path']['slice']()),_0x1a12c1['createPositionFromPath'](_0x5cbc93,_0x52d88c['end']['path']['slice']())),_0x161279=new _0x51983f(_0x58d279,null,_0x203635,_0x1a12c1['markers'],!0x0,_0xd66811++);_0xf6ff6f['push'](_0x161279);}}if(_0x1ad591)for(const [_0x376512,_0x454b60]of Object['entries'](_0x1ad591)){const _0x1da146=_0x1a12c1['document']['getRoot'](_0x376512);if(!_0x1da146)throw new _0x33aefe('multi-root-editor-root-attributes-no-root',null);for(const [_0x4846e0,_0x5b488f]of Object['entries'](_0x454b60))if(null!==_0x5b488f){const _0x1ba884=new _0x20e10e(_0x1da146,_0x4846e0,null,_0x5b488f,_0xd66811++);_0xf6ff6f['push'](_0x1ba884);}}return _0xf6ff6f;}async['_loadRoot'](_0x11a5db,_0x971923,_0x34f82a){this['_getOperationsFromInitData']({[_0x11a5db]:_0x971923},{[_0x11a5db]:_0x34f82a})['forEach']((_0x1f9ccf,_0x196c55)=>{_0x1f9ccf['baseVersion']=this['_document']['version']+_0x196c55,_0x1f9ccf['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x1f9ccf);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x266f90,_0x9ceece){let _0x2a6aab;this['_offset']=_0x266f90['offset'];const _0x52e8e6=_0x266f90['wereChangesApplied']&&!_0x266f90['initData'],_0x8266ba=_0x52e8e6?0x0:_0x266f90['data']['baseVersion'];if(_0x9ceece['forEach'](_0x565240=>{_0x565240['_isInit']=!0x0,_0x565240['createdAt']=_0x266f90['sessionCreatedAt'],_0x565240['_authorId']=null;}),_0x52e8e6)_0x2a6aab=_0x9ceece,this['_applyOperationsSet'](_0x2a6aab,_0x52e8e6);else{if(_0x266f90['initData']){const _0xc4d8df=this['_getOperationsFromInitData'](_0x266f90['initData']);this['_document']['history']['version']=-_0xc4d8df['length'],_0xc4d8df['forEach'](_0x596a9a=>{_0x596a9a['baseVersion']-=_0xc4d8df['length'],_0x596a9a['createdAt']=_0x266f90['sessionCreatedAt'],_0x596a9a['_isInit']=!0x0,_0x596a9a['_authorId']=null;}),this['_applyOperationsSet'](_0xc4d8df,!0x0),this['serverHistory']['version']=-_0xc4d8df['length']+this['_offset'],this['_updateServerHistory'](_0xc4d8df);}this['_document']['history']['version']=_0x8266ba,_0x2a6aab=this['_decompressOperations'](_0x266f90['data'],_0x266f90['metadata']),await this['_fetchMissingUsers'](_0x2a6aab),this['_applyOperationsSet'](_0x2a6aab,_0x52e8e6);}_0x266f90['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2a6aab,_0x266f90['lastOperationId']),this['_lastSyncedOperationId']=_0x266f90['lastOperationId']),this['serverHistory']['version']=_0x8266ba+this['_offset'],this['_updateServerHistory'](_0x2a6aab),_0x9ceece['filter'](_0xa96740=>{const _0x42511e=this['_getAffectedRoot'](_0xa96740);return _0x42511e&&!this['_knownRootNames']['has'](_0x42511e);})['forEach']((_0x299636,_0xc0e245)=>{_0x299636['baseVersion']=this['_document']['version']+_0xc0e245,this['_saveOperationInBuffer'](_0x299636);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x44c3b5,_0x44eacb){const _0x3e267d=_0x44eacb&&_0x44eacb['message'];if(_0x3e267d&&_0x3e267d['startsWith']('realtimecollaborationclient'))throw _0x44eacb;const _0xa7937a=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0xa7937a['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x33aefe(_0x44c3b5,this['editor'],_0x3e267d?{'originalError':_0x3e267d}:void 0x0);}['_saveOperationInBuffer'](_0x36006b){this['_knownOperations']['has'](_0x36006b)||(this['_knownOperations']['add'](_0x36006b),this['_bufferedOperations']['push'](_0x36006b),this['_pendingAction']||'marker'==_0x36006b['type']&&!_0x36006b['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x25bead=!0x1){!_0x25bead&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x20968a=>{_0x20968a&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x105351=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x3a7229){return _0x3a7229['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3a7229['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x3a7229['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x105351)||this['_crash'](_0x105351['message'],_0x105351);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x28eae0=>{this['on']('change:_isPendingUpdate',()=>{_0x28eae0();});});}async['_sendBufferedOperations'](){const _0x3ec1a0=this['editor']['plugins']['get'](q);if(this['_shouldSendSelectionUpdate']()&&(_0x3ec1a0['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x21f833=[...this['_bufferedOperations']];for(const _0x2126b6 of _0x21f833)_0x2126b6['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x2126b6);const _0x26f060=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x21f833),_0x2d4a39=J++,_0x3f49c7=this['_compressOperations'](_0x21f833),_0x358d7d=await this['_service']['sendOperations'](_0x3f49c7,_0x3f49c7['baseVersion'],_0x26f060);try{return await this['_handleServerResponse'](_0x21f833,_0x358d7d,_0x2d4a39);}catch(_0x321a02){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x321a02);}}async['_handleServerResponse'](_0x5e80ee,_0x414227,_0x2982b2){if('error'in _0x414227)throw _0x414227['error'];let _0x261218=!0x1;if(_0x414227['wereChangesApplied']){_0x414227['lastOperationId']&&(this['_lastSyncedOperationId']=_0x414227['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x458571=>!_0x5e80ee['includes'](_0x458571));for(const _0xa987c3 of _0x5e80ee)_0xa987c3['createdAt']='lastOperationAcceptedAt'in _0x414227&&_0x414227['lastOperationAcceptedAt']||void 0x0;X(_0x5e80ee,_0x414227['version']-_0x5e80ee['length']),this['_updateServerHistory'](_0x5e80ee);const _0x303e59=_0x5e80ee['filter'](_0x5d1b99=>{if(!_0x5d1b99['_isInit'])return!0x1;const _0x289f5a=this['_getAffectedRoot'](_0x5d1b99);return _0x289f5a&&!this['_knownRootNames']['has'](_0x289f5a);});X(_0x303e59,this['_document']['version']),this['_applyOperationsSet'](_0x303e59),_0x261218=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x51aa29=this['_decompressOperations'](_0x414227['data'],_0x414227['metadata'])['filter'](_0x18c87a=>_0x18c87a['baseVersion']>=this['_lastServerVersion']);_0x51aa29['forEach'](_0x516ba8=>this['_addKnownRoot'](_0x516ba8)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x362af3=>!_0x362af3['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x362af3))),this['_bufferedOperations']['length']&&X(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x51aa29),_0x261218=this['_handleExternalOperations'](_0x51aa29,_0x414227['version'],_0x414227['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x261218?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x205040,_0x4e0eb4,_0x7ad584){try{const _0xa4f498={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x1e75a0,operationsB:_0x532814,originalOperations:_0x334818}=_0x39c88a(_0x205040,this['_bufferedOperations'],_0xa4f498);X(_0x1e75a0,this['_document']['version']),X(_0x532814,_0x4e0eb4);for(const _0x1ae4b5 of _0x1e75a0){const _0x5a6fdf=_0x334818['get'](_0x1ae4b5);_0x1ae4b5['_authorId']=_0x5a6fdf?_0x5a6fdf['_authorId']:null;}_0x7ad584&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x205040,_0x7ad584),this['_lastSyncedOperationId']=_0x7ad584),this['_bufferedOperations']=[..._0x532814],this['_applyOperationsSet'](_0x1e75a0),this['_updateServerHistory'](_0x205040);}catch(_0x208f7a){return console['error'](_0x208f7a),!0x1;}return!0x0;}['_applyOperationsSet'](_0x17c7a8,_0x52c695=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x235b58=>{for(const _0x522909 of _0x17c7a8)this['_knownOperations']['add'](_0x522909),this['_addKnownRoot'](_0x522909),_0x235b58['batch']['addOperation'](_0x522909),this['editor']['model']['applyOperation'](_0x522909);});}['_addKnownRoot'](_0x162903){const _0x397c4e=this['_getAffectedRoot'](_0x162903);_0x397c4e&&this['_knownRootNames']['add'](_0x397c4e);}['_getAffectedRoot'](_0x270773){let _0x190b19,_0x238692;switch(_0x270773['type']){case'insert':_0x190b19=_0x270773['position']['root'];break;case'marker':if(_0x238692=_0x270773['newRange'],!_0x238692)return null;_0x190b19=_0x238692['root'];break;case'addRootAttribute':_0x190b19=_0x270773['root'];break;case'addRoot':_0x190b19=_0x270773['affectedSelectable'];break;case'move':_0x190b19=_0x270773['targetPosition']['root'];break;default:return null;}return _0x190b19['rootName'];}['_updateServerHistory'](_0xd9c309){_0xd9c309['forEach'](_0x48de21=>{const _0x477930=_0x48de21['clone']();_0x477930['_authorId']=_0x48de21['_authorId'],_0x477930['_isInit']=!!_0x48de21['_isInit'],_0x477930['createdAt']=_0x48de21['createdAt'],_0x477930['baseVersion']+=this['_offset'],_0x48de21['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x477930),this['serverHistory']['addOperation'](_0x477930);});}['_handleReconnectionError'](_0x17785a){const _0x1a6755=this['editor']['plugins']['get']('Notification'),_0x2bdf4f=this['editor']['locale'];_0x17785a||(_0x17785a=G(_0x2bdf4f,'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.')),_0x1a6755['showWarning'](_0x17785a,{'title':G(_0x2bdf4f,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x214519)['add'](G(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x214519)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x41f9b0){const _0x3571ca=_0x41f9b0['map'](_0x5a1f64=>_0x5a1f64['toJSON']());return this['_compressor']['compress'](_0x3571ca);}['_decompressOperations'](_0x265a7a,_0x12fe68){return this['_compressor']['decompress'](_0x265a7a)['map']((_0x57e12e,_0x4b1c0e)=>{const _0x21de53='init'==_0x12fe68[_0x4b1c0e]['type'];if('InsertOperation'==_0x57e12e['__className']){const _0x5e3c93=_0x57e12e['position']['root'];!this['_document']['getRoot'](_0x5e3c93)&&(this['_document']['createRoot']('$root',_0x5e3c93)['_isAttached']=!0x1);}const _0x30e90a=_0x3ac639['fromJSON'](_0x57e12e,this['_document']);return _0x30e90a['wasUndone']=_0x57e12e['wasUndone'],_0x30e90a['_isInit']=_0x21de53,_0x30e90a['_authorId']=_0x21de53?null:_0x12fe68[_0x4b1c0e]['userId'],_0x30e90a['_isDisconnection']='cs:removeUser'===_0x12fe68[_0x4b1c0e]['type'],_0x30e90a['createdAt']=_0x12fe68[_0x4b1c0e]['createdAt'],_0x30e90a;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x3699be=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x3699be&&_0x3699be['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Q extends Error{}function X(_0x3ffa91,_0x5ba1d1){for(const _0x4aca63 of _0x3ffa91)_0x4aca63['baseVersion']=_0x5ba1d1++;}class Y{['_ignoredOperations'];['_operationToId'];constructor(_0x482c41){this['_ignoredOperations']=_0x482c41,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x2c91e8){let _0x15d77c=_0x2c91e8['length'];for(;_0x15d77c--;){const _0x45b0ba=_0x2c91e8[_0x15d77c];if(!this['_ignoredOperations']['has'](_0x45b0ba)){if(!this['_operationToId']['has'](_0x45b0ba)){const _0x42d773=_0x54b238()['slice'](0x1,0x12);this['_operationToId']['set'](_0x45b0ba,_0x42d773);}return this['_operationToId']['get'](_0x45b0ba);}}}['setIdForTheLastOperation'](_0xe2c01b,_0x32528e){if(!_0x32528e)return;let _0x1c4c4b=_0xe2c01b['length'];for(;_0x1c4c4b--;){const _0x4664bb=_0xe2c01b[_0x1c4c4b];this['_ignoredOperations']['has'](_0x4664bb)||this['_operationToId']['set'](_0x4664bb,_0x32528e);}}}class n extends _0x20916b{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x1e9e2c{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x397a38)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x4b25d7];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1201f9){super(_0x1201f9),this['_services']=new Map();}async['init'](){const _0x4f9952=this['context'],_0x8e988e=_0x4f9952['plugins']['get']('CommentsRepository');if(_0x4f9952['plugins']['get'](c)['addToReconnectionStack'](this),_0x8e988e['adapter']={'addCommentThread':async({channelId:_0x5039bb,threadId:_0x420a31,comments:_0x2f09b6,resolvedAt:_0x58b1b0,resolvedBy:_0x172981,context:_0x49626c,attributes:_0x3eb94f})=>{const _0x48b141=await this['_getService'](_0x5039bb)['addCommentThread']({'commentThreadId':_0x420a31,'comments':_0x2f09b6['map'](_0x19ad92=>function(_0x6d6bb3,_0x15e5d8,_0x50ea4d){return{'commentThreadId':_0x50ea4d,'commentId':_0x6d6bb3['commentId'],'userId':_0x6d6bb3['authorId'],'content':_0x6d6bb3['content'],'documentId':_0x15e5d8,'createdAt':_0x6d6bb3['createdAt'],'attributes':_0x6d6bb3['attributes']||{}};}(_0x19ad92,_0x5039bb,_0x420a31)),'resolvedAt':_0x58b1b0,'resolvedBy':_0x172981,'context':_0x49626c,'attributes':_0x3eb94f})['catch'](ut);return{'threadId':_0x48b141['commentThreadId'],'comments':_0x48b141['comments']};},'getCommentThread':async({channelId:_0x3c2938,threadId:_0x297321})=>{const _0x19c7f2=await this['_getService'](_0x3c2938)['getCommentThread'](_0x297321)['catch'](ut);return _0x19c7f2['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x19c7f2]),{'threadId':_0x19c7f2['commentThreadId'],'comments':_0x19c7f2['comments']['map'](_),'context':_0x19c7f2['context'],'resolvedAt':_0x19c7f2['resolvedAt'],'resolvedBy':_0x19c7f2['resolvedBy'],'attributes':_0x19c7f2['attributes']||{}});},'updateCommentThread':async({channelId:_0x90f6b7,threadId:_0x2a0186,context:_0x52334a,unlinkedAt:_0x564ba6,attributes:_0x62e2d6})=>this['_getService'](_0x90f6b7)['updateCommentThread']({'commentThreadId':_0x2a0186,'context':_0x52334a,'attributes':_0x62e2d6,'unlinkedAt':_0x564ba6})['catch'](S)['catch'](ut),'resolveCommentThread':async({channelId:_0x5249ff,threadId:_0x5f4fd2})=>{const _0x313efb=await this['_getService'](_0x5249ff)['resolveCommentThread'](_0x5f4fd2)['catch'](S)['catch'](ut);return{'threadId':_0x313efb['commentThreadId'],'resolvedAt':_0x313efb['resolvedAt'],'resolvedBy':_0x313efb['resolvedBy']};},'reopenCommentThread':async({channelId:_0x264b79,threadId:_0x28299c})=>this['_getService'](_0x264b79)['reopenCommentThread'](_0x28299c)['catch'](S)['catch'](ut),'removeCommentThread':({channelId:_0x26c0b5,threadId:_0x5eea5e})=>this['_getService'](_0x26c0b5)['removeCommentThread'](_0x5eea5e)['catch'](S)['catch'](ut),'addComment':({channelId:_0x1a7943,threadId:_0x1cfcd6,commentId:_0x31217c,content:_0x3583f4,attributes:_0x655e57})=>this['_getService'](_0x1a7943)['addComment'](_0x1cfcd6,_0x31217c,_0x3583f4,_0x655e57)['catch'](ut),'updateComment':({channelId:_0x9e7911,threadId:_0x1fbf7e,commentId:_0x46b899,content:_0x44db21,attributes:_0x278bf4})=>this['_getService'](_0x9e7911)['updateComment'](_0x1fbf7e,_0x46b899,_0x44db21,_0x278bf4)['catch'](S)['catch'](ut),'removeComment':({channelId:_0x27fa52,threadId:_0x235bfa,commentId:_0x3b2b46})=>this['_getService'](_0x27fa52)['removeComment'](_0x235bfa,_0x3b2b46)['catch'](S)['catch'](ut)},_0x4f9952 instanceof _0x477adb){const _0x3ae219=_0x4f9952['config']['get']('collaboration.channelId'),_0x870ebc=_0x4f9952['plugins']['get'](i);await this['_setUpService'](_0x3ae219);const _0x29dec3=await this['_services']['get'](_0x3ae219)['getConnectedSessions']();this['listenTo'](_0x870ebc,'sessionAdd:'+_0x3ae219,(_0x1fcda4,{session:_0x242940})=>{_0x242940['id']===_0x870ebc['mySessionId']&&(_0x1fcda4['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x242940['permissions'],_0x3ae219));}),_0x870ebc['register'](_0x3ae219,_0x29dec3);}}async['_setUpService'](_0x13fb49){if(this['_services']['has'](_0x13fb49))throw new _0x33aefe('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x13fb49});const _0x4de6a0=this['context']['plugins']['get']('CommentsRepository'),_0x3db26d=new a['CommentsService'](_0x13fb49);this['_services']['set'](_0x13fb49,_0x3db26d),this['listenTo'](_0x3db26d,'commentThreadAdded',(_0x72ebe3,_0x28d9c5)=>{const {commentThreadId:_0x3fe169,documentId:_0x23fd4f,context:_0x4c92d1,attributes:_0x172ba1,resolvedAt:_0x3708f9,resolvedBy:_0x1fec12,comments:_0x21986c}=_0x28d9c5;_0x4de6a0['getCommentThread'](_0x3fe169)||_0x4de6a0['addCommentThread']({'threadId':_0x3fe169,'channelId':_0x23fd4f,'comments':_0x21986c?_0x21986c['map'](_):[],'context':_0x4c92d1,'attributes':_0x172ba1,'resolvedAt':_0x3708f9,'resolvedBy':_0x1fec12,'isFromAdapter':!0x0});}),this['listenTo'](_0x3db26d,'commentThreadUpdated',(_0x3e7265,{commentThreadId:_0x147e31,documentId:_0x3abccc,context:_0x381a2f,unlinkedAt:_0x2d1da8,attributes:_0x2c5779})=>{_0x4de6a0['getCommentThread'](_0x147e31)&&_0x4de6a0['updateCommentThread']({'threadId':_0x147e31,'channelId':_0x3abccc,'context':_0x381a2f,'unlinkedAt':_0x2d1da8,'attributes':_0x2c5779,'isFromAdapter':!0x0});}),this['listenTo'](_0x3db26d,'commentThreadResolved',(_0x439b0e,{commentThreadId:_0x4a6490,resolvedBy:_0x57aec4,resolvedAt:_0x1da3d9})=>{const _0x41194e=_0x4de6a0['getCommentThread'](_0x4a6490);_0x41194e&&_0x41194e['resolve']({'resolvedBy':_0x57aec4,'resolvedAt':_0x1da3d9,'isFromAdapter':!0x0});}),this['listenTo'](_0x3db26d,'commentThreadReopened',(_0x34f239,{commentThreadId:_0x54cd41})=>{const _0xf7dad2=_0x4de6a0['getCommentThread'](_0x54cd41);_0xf7dad2&&_0xf7dad2['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3db26d,'commentThreadRemoved',(_0x53dc0f,{commentThreadId:_0x2d6507})=>{const _0xa860ba=_0x4de6a0['getCommentThread'](_0x2d6507);_0xa860ba&&_0xa860ba['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3db26d,'commentAdded',(_0x24892b,_0x24a0b7)=>{const _0x224b9a=_0x24a0b7['commentThreadId'],_0x53eb15=_0x4de6a0['getCommentThread'](_0x224b9a);_0x53eb15&&_0x53eb15['addComment']({..._(_0x24a0b7),'isFromAdapter':!0x0});}),this['listenTo'](_0x3db26d,'commentUpdated',(_0x22c5e6,{commentThreadId:_0x33e5ae,commentId:_0x5a3c4d,content:_0x560019,attributes:_0x58860f})=>{const _0x3200d6=_0x4de6a0['getCommentThread'](_0x33e5ae);if(_0x3200d6){const _0x51e778=_0x3200d6['getComment'](_0x5a3c4d);_0x51e778&&_0x51e778['update']({'content':_0x560019,'attributes':_0x58860f,'isFromAdapter':!0x0});}}),this['listenTo'](_0x3db26d,'commentRemoved',(_0x909a51,{commentThreadId:_0x671ef2,commentId:_0x47fb7f})=>{const _0x158812=_0x4de6a0['getCommentThread'](_0x671ef2);if(_0x158812){const _0x1da6d7=_0x158812['getComment'](_0x47fb7f);_0x1da6d7&&_0x1da6d7['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x13fb49);}['destroy'](){if(this['context']instanceof _0x477adb){const _0x341cec=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x341cec);}}['_terminateService'](_0x5748f9){if(!this['_services']['has'](_0x5748f9))throw new _0x33aefe('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x5748f9});this['_getService'](_0x5748f9)['disconnect'](),this['_services']['delete'](_0x5748f9);}async['reconnect'](){for(const _0x2968bd of this['_services']['keys']())await this['_connectService'](_0x2968bd);if(this['context']instanceof _0x477adb){const _0xe3344c=this['context']['config']['get']('collaboration.channelId'),_0x31671b=this['context']['plugins']['get'](i);_0x31671b['unregister'](_0xe3344c);const _0x496d38=await this['_services']['get'](_0xe3344c)['getConnectedSessions']();_0x31671b['register'](_0xe3344c,_0x496d38);}}async['_connectService'](_0x4815ed){const {connection:_0x376892}=this['context']['plugins']['get'](c),_0x50cd1f=this['context']['plugins']['get']('CommentsRepository'),_0x2124b9=this['_services']['get'](_0x4815ed),_0x280a81=await _0x2124b9['connect'](_0x376892);await this['_fetchMissingUsersForThreads'](_0x280a81);const _0x2680c7=new Set(Array['from'](_0x50cd1f['getCommentThreads']({'channelId':_0x4815ed}),_0x10d8c1=>_0x10d8c1['id']));for(const _0x33c581 of _0x280a81)_0x33c581['deletedAt']||_0x2680c7['delete'](_0x33c581['commentThreadId']);for(const _0x1f05ed of _0x2680c7)_0x50cd1f['getCommentThread'](_0x1f05ed)['remove']({'isFromAdapter':!0x0});for(const _0x48fd07 of _0x280a81){let _0x5342f3=_0x50cd1f['getCommentThread'](_0x48fd07['commentThreadId']);const {commentThreadId:_0x37449d,context:_0x1cfc76,attributes:_0x4c4d45,resolvedBy:_0x2bcd04,resolvedAt:_0x5701bd,unlinkedAt:_0x2df50e,deletedAt:_0x2fbf84}=_0x48fd07;if(_0x2fbf84)continue;_0x5342f3||(_0x5342f3=_0x50cd1f['addCommentThread']({'channelId':_0x4815ed,'threadId':_0x37449d,'context':_0x1cfc76,'attributes':_0x4c4d45||{},'resolvedBy':_0x2bcd04,'resolvedAt':_0x5701bd,'unlinkedAt':_0x2df50e,'isFromAdapter':!0x0}));const _0x2b3d70=new Set(Array['from'](_0x5342f3['comments'],_0x300ce4=>_0x300ce4['id']));for(const _0x5bd3c9 of _0x48fd07['comments'])_0x2b3d70['delete'](_0x5bd3c9['commentId']);for(const _0x1ca154 of _0x2b3d70)_0x5342f3['getComment'](_0x1ca154)['remove']({'isFromAdapter':!0x0});for(const _0x17e041 of _0x48fd07['comments']){const _0x2e02ba=_0x5342f3['getComment'](_0x17e041['commentId']);_0x2e02ba?_0x2e02ba['content']!==_0x17e041['content']&&_0x2e02ba['update']({'content':_0x17e041['content'],'isFromAdapter':!0x0}):_0x5342f3['addComment'](Object['assign'](_(_0x17e041),{'isFromAdapter':!0x0}));}}}['_getService'](_0x4eab2f){if(!this['_services']['has'](_0x4eab2f))throw new _0x33aefe('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x4eab2f});return this['_services']['get'](_0x4eab2f);}async['_fetchMissingUsersForThreads'](_0x44fae9){const _0x3f5e34=this['context']['plugins']['get'](_0x4b25d7),{connection:_0x583641}=this['context']['plugins']['get'](c),_0x372030=new Set();for(const {resolvedBy:_0x2a0313,comments:_0x477c36}of _0x44fae9){_0x2a0313&&!_0x3f5e34['getUser'](_0x2a0313)&&_0x372030['add'](_0x2a0313);for(const {userId:_0x22ddd5}of _0x477c36)_0x3f5e34['getUser'](_0x22ddd5)||_0x372030['add'](_0x22ddd5);}if(0x0===_0x372030['size'])return;const _0x525628=await dt['getMany'](_0x583641,Array['from'](_0x372030));for(const _0x3f0498 of _0x525628)_0x3f5e34['getUser'](_0x3f0498['id'])||_0x3f5e34['addUser'](_0x3f0498);}}async function S(_0x3ad7cf){if('404'!==_0x3ad7cf['code'])throw _0x3ad7cf;}function ut(_0x356c0f){if((_0x1b7b62=_0x356c0f)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1b7b62['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1b7b62['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1b7b62;throw _0x356c0f;}function _(_0x3db2e3){return{'threadId':_0x3db2e3['commentThreadId'],'commentId':_0x3db2e3['commentId'],'content':_0x3db2e3['content'],'createdAt':_0x3db2e3['createdAt'],'authorId':_0x3db2e3['userId'],'attributes':_0x3db2e3['attributes']||{}};}class f extends _0x20916b{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(_0x49ed2f){super(_0x49ed2f);const _0x48087c=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x48087c);}['init'](){const _0x30328b=this['editor']['plugins']['get'](c),_0x58752c=this['editor']['plugins']['get']('TrackChangesEditing');return _0x58752c['adapter']={'getSuggestion':async _0x28df5a=>{await this['_waitForServiceReady']();const _0x2f4205=await this['_trackChangesService']['get'](_0x28df5a)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x2f4205]),_0x2f4205;},'addSuggestion':async({id:_0x365e0b,type:_0x543bdb,data:_0x5025d5,originalSuggestionId:_0x1858cd,attributes:_0x545443})=>{await this['_waitForServiceReady']();const _0x451232={'id':_0x365e0b,'type':_0x543bdb,'data':_0x5025d5,'originalSuggestionId':_0x1858cd,'attributes':_0x545443},_0x2f2ab3=await this['_trackChangesService']['add'](_0x365e0b,_0x543bdb,_0x5025d5,_0x1858cd,_0x545443)['catch'](_0x35ecf2=>{if(ft(_0x35ecf2))return new Promise(_0x3a857a=>{this['_bufferedRequests']['set'](_0x365e0b,{'resolve':_0x3a857a,'suggestionData':_0x451232});});throw _0x35ecf2;});return this['_bufferedRequests']['delete'](_0x365e0b),_0x2f2ab3;},'updateSuggestion':async(_0x4931d5,_0x342778)=>{if(await this['_waitForServiceReady'](),'open'!==_0x342778['state'])return this['_trackChangesService']['update'](_0x4931d5,_0x342778)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x1bac4c,_0x253ee2)=>{_0x58752c['hasSuggestion'](_0x253ee2['id'])&&(_0x58752c['getSuggestion'](_0x253ee2['id'])['attributes']=_0x253ee2['attributes']);}),this['_trackChangesService']['connect'](_0x30328b['connection'])['then'](_0x1d4647=>(_0x30328b['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x1d4647)['then'](()=>{for(const _0x4e6ea6 of _0x1d4647){_0x58752c['addSuggestionData'](_0x4e6ea6)['_saved']=!0x0;}})));}async['reconnect'](){const _0x282109=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x157851}=this['editor']['plugins']['get'](c),_0x2ab271=await this['_trackChangesService']['connect'](_0x157851);await this['_fetchMissingUsersForThreads'](_0x2ab271);for(const {suggestionData:_0x1d599d,resolve:_0x2fe761}of this['_bufferedRequests']['values']()){let _0xbc3d7c=_0x2ab271['find'](_0x28c150=>_0x28c150['id']===_0x1d599d['id']);_0xbc3d7c||(_0xbc3d7c=await this['_trackChangesService']['add'](_0x1d599d['id'],_0x1d599d['type'],_0x1d599d['data'],_0x1d599d['originalSuggestionId'])),_0x2fe761(_0xbc3d7c);}for(const _0x1ebac8 of _0x2ab271)_0x282109['hasSuggestion'](_0x1ebac8['id'])||_0x282109['addSuggestionData'](_0x1ebac8);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x2f3d26=>{this['listenTo'](this['_trackChangesService'],'connected',_0x54e617=>{_0x54e617['off'](),_0x2f3d26();});});}async['_fetchMissingUsersForThreads'](_0x271067){const _0x5b9ee9=this['editor']['plugins']['get'](_0x4b25d7),{connection:_0x91828e}=this['editor']['plugins']['get'](c),_0xef6834=new Set();for(const {authorId:_0x4679af}of _0x271067)_0x5b9ee9['getUser'](_0x4679af)||_0xef6834['add'](_0x4679af);if(0x0===_0xef6834['size'])return;const _0x2db269=await dt['getMany'](_0x91828e,Array['from'](_0xef6834));for(const _0x58b192 of _0x2db269)_0x5b9ee9['getUser'](_0x58b192['id'])||_0x5b9ee9['addUser'](_0x58b192);}}function R(_0x50618b){if(ft(_0x50618b))return new Promise(()=>{});throw _0x50618b;}function ft(_0x1e2d42){return _0x1e2d42['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1e2d42['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x20916b{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 _0x18bdb8=this['editor']['plugins']['get'](c),_0x30658c=this['editor']['plugins']['get']('CommentsEditing'),_0x5e2db1=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x18bdb8,'change:state',(_0x1ba7a4,_0x124510,_0x219c23)=>{_0x30658c['isThreadsLoadingPaused']='connected'!==_0x219c23;});}),this['listenTo'](_0x18bdb8,'change:state',(_0x40b12a,_0x68b17d,_0x226fe9)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x226fe9);}),_0x5e2db1['_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 _0x20916b{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 _0x20916b{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x4b25d7];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x321ba9){super(_0x321ba9);const _0x4a6660=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x4a6660);}async['init'](){const _0x2d51a9=this['editor']['plugins']['get'](l),_0x36b6b5=_0x2d51a9['serverHistory'],_0xd73f4e=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x36b6b5,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x2d51a9['sessionId']});const _0x3143ae=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x34885b=await tt['isBundleUploaded'](_0xd73f4e['connection'],_0x3143ae);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x128215})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x128215)),'updateRevisions':async _0x4d6342=>{await this['_waitForServiceReady']();const _0x3fcfc6=this['_revisionTracker']['currentRevision'];if(_0x34885b&&0x1===_0x4d6342['length']&&_0x4d6342[0x0]['id']===_0x3fcfc6['id'])return _0x4d6342;for(const _0xedb828 of _0x4d6342)_0xedb828['id']===_0x3fcfc6['id']&&(_0xedb828['isEmptyCurrent']=_0xedb828['fromVersion']===_0xedb828['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x4d6342,this['_lastRequestId'])['then'](_0xab5ee9=>(this['_lastRequestId']=_0xab5ee9,_0x4d6342))['catch'](_0x253b7e=>{if(st(_0x253b7e)||'400'===_0x253b7e['code']&&void 0x0!==_0x253b7e['data']['wrongRequestId']){for(const _0x3a1639 of _0x4d6342){!this['_revisionTracker']['repository']['getRevision'](_0x3a1639['id'])||this['_revisionTracker']['_bufferUpdate'](_0x3a1639['id'],_0x3a1639,!0x1);}if(st(_0x253b7e))throw _0x253b7e;return _0x4d6342;}throw _0x253b7e;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x16225d,{revisionsData:_0x2253f2,requestId:_0x3ad627})=>{Math['max'](..._0x2253f2['map'](_0x2920fd=>_0x2920fd['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x2253f2,_0x3ad627);}):this['_handleRevisionsUpdate'](_0x2253f2,_0x3ad627);});const {revisions:_0x1c95d1,requestId:_0x4d01c1}=await this['_revisionHistoryService']['connect'](_0xd73f4e['connection']);_0xd73f4e['addToReconnectionStack'](this),this['_lastRequestId']=_0x4d01c1,await this['_fetchMissingUsers'](_0x1c95d1);for(const _0x157410 of _0x1c95d1)this['_revisionTracker']['addRevisionData'](_0x157410);this['listenTo'](_0x2d51a9,'change:_isConnected',(_0x4c3cb8,_0x2eadbd,_0x191612)=>{_0x191612&&(this['_oldOffset']=_0x2d51a9['_offset'],_0x4c3cb8['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0xd73f4e,'state',_0x13b4bc=>_0x13b4bc===_0x14ebd0['CONNECTED']);}async['reconnect'](){const _0x30f828=this['editor']['plugins']['get'](c),_0x319fb4=this['editor']['plugins']['get'](l),_0x5d783f=async()=>{const _0x1385c5=this['_revisionTracker']['currentRevision'],_0x34d23e=_0x1385c5['id'],_0x5223b7=_0x34d23e!==_0x319fb4['sessionId'];if(_0x5223b7){const _0x18d129=_0x319fb4['_offset']-this['_oldOffset'],_0xa2566=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x1385c5['toVersion']+_0x18d129!==_0xa2566){const _0x229341=_0x1385c5['fromVersion']+_0x18d129,_0xbf9e1f=this['editor']['plugins']['get'](_0x4b25d7),_0x31466d=this['_revisionTracker']['buildRevisionData']({'revision':_0x1385c5,'from':_0x229341,'to':_0xa2566});_0x31466d['id']=_0x1385c5['id'];const _0x3dc57b=_0x31466d['authorsIds']['map'](_0x29a5f4=>_0xbf9e1f['getUser'](_0x29a5f4));_0x1385c5['_update']({..._0x31466d,'authors':_0x3dc57b},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x1385c5['id'],_0x31466d,!0x0);}this['_revisionTracker']['_startingVersion']=_0xa2566,(_0x1385c5['toVersion']===_0x1385c5['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x34d23e)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x34d23e),this['_revisionTracker']['_createCurrentRevision'](_0xa2566));}const {revisions:_0x179da1,requestId:_0x40d1b0}=await this['_revisionHistoryService']['reconnect'](_0x30f828['connection'],this['_lastRequestId']);_0x5223b7&&_0x179da1['length']>0x0?_0x319fb4['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x179da1),this['_handleRevisionsUpdate'](_0x179da1,_0x40d1b0),this['_revisionTracker']['sendBufferedUpdates']());};return _0x319fb4['_isConnected']?_0x5d783f():new Promise((_0x149778,_0x5c4a90)=>{_0x319fb4['once']('change:_isConnected',()=>{_0x5d783f()['then'](_0x149778)['catch'](_0x5c4a90);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x388e51=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x5dba49=>{_0x5dba49['off'](),_0x388e51();});});}['_getLatestVersionFromServerOperations'](){const _0x25c745=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x3d6ba4 of _0x25c745)if('marker'!==_0x3d6ba4['type']||_0x3d6ba4['affectsData'])return _0x3d6ba4['baseVersion']+0x1;}['_getLatestVersion'](){const _0x472868=this['editor']['plugins']['get'](l);return new Promise(_0x3b272b=>{_0x472868['_isPendingUpdate']?_0x472868['once']('change:_isPendingUpdate',()=>{_0x3b272b(this['_getLatestVersionFromServerOperations']());}):_0x3b272b(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x505ed4,_0x405cb5){const _0x2747c3=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x405cb5;for(const _0x5b2f39 of _0x505ed4){const _0xc4913e=_0x2747c3['getRevision'](_0x5b2f39['id']);if(_0xc4913e){if((_0x5b2f39['fromVersion']||_0x5b2f39['toVersion'])&&(_0x5b2f39['diffData']=null),_0xc4913e===this['_revisionTracker']['currentRevision']){const _0x18881f=Math['max'](_0xc4913e['toVersion'],_0x5b2f39['toVersion']),_0x33a22c=Math['max'](_0xc4913e['fromVersion'],_0x5b2f39['fromVersion']);let _0x54c684;_0xc4913e['toVersion']===_0x5b2f39['toVersion']&&_0xc4913e['fromVersion']===_0x5b2f39['fromVersion']?(_0x54c684=!0x0,this['_preventResendingRevisionData'](_0x5b2f39)):_0x5b2f39['toVersion']===_0x18881f&&_0x5b2f39['fromVersion']===_0x33a22c?_0x54c684=!0x1:(_0xc4913e['toVersion']===_0x18881f&&_0xc4913e['fromVersion']===_0x33a22c||this['_fixRevision']({'revision':_0xc4913e,'from':_0x33a22c,'to':_0x18881f}),_0x54c684=!0x0),_0x54c684&&(delete _0x5b2f39['fromVersion'],delete _0x5b2f39['toVersion'],delete _0x5b2f39['diffData'],delete _0x5b2f39['createdAt'],delete _0x5b2f39['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x5b2f39),this['_preventResendingRevisionData'](_0x5b2f39);}else this['_revisionTracker']['addRevisionData'](_0x5b2f39);}const _0x47f4f2=_0x2747c3['getRevisions']();_0x47f4f2['reverse']();for(let _0x4de859=0x0;_0x4de859<_0x47f4f2['length']-0x1;_0x4de859++){const _0x453b7e=_0x47f4f2[_0x4de859],_0x555b4c=_0x47f4f2[_0x4de859+0x1];if(_0x453b7e['fromVersion']<_0x555b4c['toVersion']){const _0x5ec466=_0x555b4c['toVersion'],_0x447a8b=Math['max'](_0x5ec466,_0x453b7e['toVersion']);this['_fixRevision']({'revision':_0x453b7e,'from':_0x5ec466,'to':_0x447a8b});}}}['_fixRevision']({revision:_0x5e35d6,from:_0x465bc6,to:_0x447e6c}={}){const _0x5b7894=this['editor']['plugins']['get'](_0x4b25d7),_0x48af08=this['_revisionTracker']['buildRevisionData']({'revision':_0x5e35d6,'from':_0x465bc6,'to':_0x447e6c});_0x48af08['authors']=_0x48af08['authorsIds']['map'](_0x2c28af=>_0x5b7894['getUser'](_0x2c28af)),_0x5e35d6['_update'](_0x48af08);}['_preventResendingRevisionData'](_0x526b2c){const _0x23228a={};_0x23228a['id']=_0x526b2c['id'];for(const _0x210469 of Object['keys'](_0x526b2c))'id'!==_0x210469&&(_0x23228a[_0x210469]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x23228a['id'],_0x23228a,!0x0);}async['_fetchMissingUsers'](_0x3e1f67){const _0x55d176=this['editor']['plugins']['get'](_0x4b25d7),{connection:_0x1600ff}=this['editor']['plugins']['get'](c),_0x3c93ca=new Set();for(const _0x37b5ad of _0x3e1f67){for(const _0x2616b0 of _0x37b5ad['authorsIds'])_0xd3f9d9(_0x2616b0);_0x37b5ad['creatorId']&&_0xd3f9d9(_0x37b5ad['creatorId']);}if(0x0===_0x3c93ca['size'])return;const _0x5d4ede=await dt['getMany'](_0x1600ff,Array['from'](_0x3c93ca));for(const _0x5177df of _0x5d4ede)_0x55d176['getUser'](_0x5177df['id'])||_0x55d176['addUser'](_0x5177df);function _0xd3f9d9(_0x336257){_0x55d176['getUser'](_0x336257)||_0x3c93ca['add'](_0x336257);}}}function st(_0x14873b){return _0x14873b['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x14873b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x14873b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x20916b{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class A extends _0x5f4aca{['_collapseAt'];constructor(_0x5b1f3d,_0x2cfa09=0x6){super(_0x5b1f3d);const _0x199b39=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x2cfa09,this['bind']('isHidden')['to'](this,'usersCount',_0x34c9da=>_0x34c9da<_0x2cfa09),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x199b39['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x199b39['to']('usersCount',_0x544b19=>'+'+(_0x544b19-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x5f4aca{['items'];['keystrokes'];constructor(_0x15e45d){super(_0x15e45d);const _0x1d9181=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x31ddfb(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x1d9181['if']('hasPopup'),'aria-expanded':_0x1d9181['to']('isExpanded',_0x4fc9a1=>this['hasPopup']&&String(_0x4fc9a1)),'aria-label':_0x1d9181['to']('hasPopup',_0x4fbceb=>G(_0x15e45d,_0x4fbceb?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x1d9181['to']('hasPopup',_0x29b8f4=>!!_0x29b8f4&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x1d9181['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x1d9181['to'](_0x5c807f=>{const _0x27c87e=_0x5c807f,_0x1dc61d=document['querySelector']('.ck-presence-list__dropdown-list'),_0x296d89=document['querySelector']('.ck-balloon-panel_with-arrow');_0x1dc61d?.['contains'](_0x27c87e['relatedTarget'])||_0x296d89?.['contains'](_0x27c87e['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x252039,_0x470f93,_0x36baa1)=>{this['element']&&(_0x36baa1?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class j extends _0x5f4aca{['counterView'];['inlineListView'];constructor(_0x2e8f0c,_0x2bb256=0x6){super(_0x2e8f0c);const _0x48d618=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x2bb256),this['inlineListView']=new ts(_0x2e8f0c),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x4d17ef of this['inlineListView']['items'])_0x4d17ef['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',_0x48d618['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x5f4aca{['listWrapperView'];constructor(_0x38b53d,_0x53d945){super(_0x38b53d);const _0x41d7c3=this['bindTemplate'];this['listWrapperView']=new mt(_0x38b53d,_0x53d945),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':G(_0x38b53d,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x41d7c3['to'](_0x220b53=>{const _0x4254a3=_0x220b53,_0x26cc76=document['querySelector']('.ck-presence-list__list'),_0xa1577d=document['querySelector']('.ck-balloon-panel_with-arrow');_0x26cc76?.['contains'](_0x4254a3['relatedTarget'])||_0xa1577d?.['contains'](_0x4254a3['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class mt extends _0x48119e{constructor(_0x2fd969,_0x18bdee){super(_0x2fd969);const _0x33cc5a=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x18bdee?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x33cc5a['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x33cc5a['to']('role'),'aria-label':_0x33cc5a['to']('ariaLabel'),'aria-labelledby':_0x33cc5a['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x9f47bb['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x1ba90c=this['element'];_0x1ba90c&&(this['_isScrollable']=Math['max'](_0x1ba90c['scrollHeight'],_0x1ba90c['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x3fc4e9,_0xf9cef8,_0xf60f33){super(_0x3fc4e9);const _0x2cdd74=this['bindTemplate'];this['userView']=new ct(_0x3fc4e9,_0xf9cef8);const _0x53983d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0xf9cef8['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0xf9cef8['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0xf9cef8['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0xf60f33&&(_0x53983d['tag']='button',_0x53983d['on']={'click':_0x2cdd74['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x53983d);}['focus'](){this['element']['focus']();}}class y extends _0x5f4aca{['userView'];['markerView'];constructor(_0x55a217,_0x1c493f,_0xe3e4a2){super(_0x55a217);const _0x3b2cee=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x55a217,_0x1c493f),this['markerView']=new at(_0x55a217,_0x1c493f);const _0x2284ad=new ot(_0x55a217);_0x2284ad['template']['tag']='span',_0x2284ad['text']=_0x1c493f['name'];const _0x2c9c22={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x3b2cee['to']('isFocusable',_0x4025f2=>!!_0x4025f2&&0x0),'aria-labelledby':_0x2284ad['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x3b2cee['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x3b2cee['to']('hasTooltip',_0x3e34a7=>!_0x3e34a7),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2284ad]};_0xe3e4a2&&(_0x2c9c22['tag']='button',_0x2c9c22['on']={'click':_0x3b2cee['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2c9c22);}}class at extends _0x5f4aca{constructor(_0x36aa7a,_0x21f203){super(_0x36aa7a),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x21f203['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x1e9e2c{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1987fb){super(_0x1987fb),this['context']['config']['define']('presenceList',C);const _0x333372=_0x1987fb['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x333372)throw new _0x33aefe('presencelist-collapseat-invalid-format',this);if(_0x333372<0x1)throw new _0x33aefe('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x45ec41(),this['balloonPanelView']=new _0x181e94(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x5ae2ec of this['_allConnectedUsers'])this['_handleUserAdd'](_0x5ae2ec);this['listenTo'](this['_allConnectedUsers'],'add',(_0x296be4,_0xda2d3d)=>{this['_handleUserAdd'](_0xda2d3d);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x331aa7,_0x478275)=>{this['_handleUserRemove'](_0x478275);});}['_createView'](){const _0x2eca6c=this['context'],_0x35f843=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x237433=this['balloonPanelView'];if(!_0xf9bf6f(_0x2eca6c['config']['get']('presenceList.container')))throw new _0x33aefe('presencelist-missing-container',this);return _0x35f843['counterView']['bind']('usersCount')['to'](this),_0x35f843['bind']('isCollapsed')['to'](this,'usersCount',_0x1b86ed=>{const {collapseAt:_0xc7b035}=_0x2eca6c['config']['get']('presenceList'),_0x2fafbc=_0x1b86ed>=_0xc7b035;if(_0x2fafbc&&!_0x35f843['inlineListView']['items']['find'](_0x1c78fd=>_0x1c78fd instanceof A)){const _0x1f5ef3=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x1f5ef3&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x35f843['inlineListView']['items']['add'](_0x35f843['counterView']);}return _0x2fafbc||this['hideDropdown'](),_0x2fafbc;}),_0x35f843['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x14fa08=>{const _0x2ca02d=_0x2eca6c['config']['get']('presenceList'),_0x5580d6=new y(_0x2eca6c['locale'],_0x14fa08,!!_0x2ca02d['onClick']);return _0x5580d6['bind']('hasTooltip')['to'](_0x35f843,'isCollapsed',_0x41d90f=>!_0x41d90f),_0x5580d6['bind']('isFocusable')['to'](_0x35f843,'isCollapsed',_0x419319=>!_0x419319),_0x2ca02d['onClick']&&this['listenTo'](_0x5580d6,'execute',()=>{this['view']['isCollapsed']||_0x2ca02d['onClick'](_0x14fa08,_0x5580d6['element']);}),_0x5580d6;}),this['listenTo'](_0x35f843['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x35f843['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x35f843['inlineListView']['keystrokes']['set']('Enter',(_0x53fe09,_0x4aeb9c)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x4aeb9c());}),_0x35f843['render'](),_0x237433['render'](),_0x322879({'emitter':_0x35f843,'activator':()=>_0x237433['isVisible'],'contextElements':[_0x237433['element'],_0x35f843['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x2eca6c['config']['get']('presenceList.container')['appendChild'](_0x35f843['element']),this['_bodyCollection']=new _0x188f88(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x35f843;}['_handleUserAdd'](_0x60575c){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x60575c['isMe'])return;const _0x2b7cda=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2b7cda-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0xffc457=_0x60575c['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x60575c,_0xffc457);}['_handleUserRemove'](_0x422528){this['usersCount']--;const {collapseAt:_0x375e21}=this['context']['config']['get']('presenceList'),_0x442be5=this['usersCount']>=_0x375e21;if(this['currentDisplayedUsers']['get'](_0x422528['id']))this['currentDisplayedUsers']['remove'](_0x422528['id']);else{if(_0x442be5&&this['currentDisplayedUsers']['length']+0x1===_0x375e21-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x442be5?0x1:0x0)<this['usersCount']){for(const _0x30ef12 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x30ef12['id'])&&(this['currentDisplayedUsers']['add'](_0x30ef12,Math['min'](this['currentDisplayedUsers']['length']-(_0x442be5?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x442be5?0x1:0x0)===_0x375e21-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x5b71cc=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x5b71cc['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x3a150f}=this['presenceDropdownView'];_0x3a150f['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x56bba4=>{if(!_0x5b71cc['displayMe']&&_0x56bba4['isMe'])return null;const _0x2310d8=new k(this['context']['locale'],_0x56bba4,!!_0x5b71cc['onClick']);return _0x5b71cc['onClick']&&this['listenTo'](_0x2310d8,'execute',()=>{_0x5b71cc['onClick'](_0x56bba4,_0x2310d8['element']);}),_0x2310d8;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x3a150f['focus'](),_0x3a150f['checkIfScrollable']();const _0x454801=(_0x49447f,_0x3491ee)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3491ee();};_0x3a150f['keystrokes']['set']('Esc',_0x454801),_0x3a150f['keystrokes']['set']('Shift+Tab',_0x454801),_0x3a150f['keystrokes']['set']('Tab',(_0x3df900,_0x3f375b)=>{!function(_0xf16bde){const _0x1d9f60=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x48a602=>_0x48a602+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x54d52e=[...document['body']['querySelectorAll'](_0x1d9f60)]['filter'](_0x43d437=>_0x43d437===document['activeElement']||_0x43d437['offsetWidth']+_0x43d437['offsetHeight']>0x0)['sort']((_0x205bdc,_0x381584)=>(_0x205bdc['tabIndex']||0x0)-(_0x381584['tabIndex']||0x0)),_0x34c409=_0x54d52e['indexOf'](_0xf16bde),_0x2ca6dd=_0x54d52e[(_0x34c409+0x1)%_0x54d52e['length']];_0x2ca6dd&&_0x2ca6dd['focus']();}(this['view']['element']),this['hideDropdown'](),_0x3f375b();}),_0x3a150f['focusTracker']['add'](this['view']['element']),_0x3a150f['focusTracker']['on']('change:isFocused',(_0x5721aa,_0x226918,_0x49db35)=>{_0x49db35||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 _0x1e9e2c{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,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
23
+ import{ContextPlugin as _0x51d4ec,Plugin as _0x58ccc3,PendingActions as _0x507fb3,Context as _0x5ee6a1}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x5d5780,CKEditorError as _0x71c4af,Collection as _0x447489,global as _0xeaa953,version as nt,uid as _0x5048e5,KeystrokeHandler as _0x30a9a4}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x445d56,View as _0x471b2e,ListView as _0x4e71d5,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x460bdf,clickOutsideHandler as _0x4bb096,BodyCollection as _0x5df3c7}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x7e212a,NoOperation as _0x29c09c,InsertOperation as _0xd86e04,MarkerOperation as _0x42fab9,RootAttributeOperation as _0x22d82a,transformSets as _0x181f13,OperationFactory as _0x498110}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x22666b,CollaborativeEditingService as _0x239c9f,User as dt,CommentsService as _0x1c305a,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x398766,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x4dd3cc}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x4f25f1}from'es-toolkit/compat';class c extends _0x51d4ec{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x445d56];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xb54a5a){super(_0xb54a5a),this['set']('state',_0x22666b['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x5d5780);}['init'](){const _0x16053f=this['context'],_0xfbe31e=_0x16053f['plugins']['get']('CloudServices'),_0x1e37c1=_0x16053f['plugins']['get'](_0x445d56);if(!_0xfbe31e['token'])throw new _0x71c4af('websocketgateway-missing-token',this);if(!_0xfbe31e['webSocketUrl'])throw new _0x71c4af('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'](_0xfbe31e['token'],_0xfbe31e['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x4dc1f2=>{if(this['connection']=_0x4dc1f2,this['bind']('state')['to'](_0x4dc1f2,'state',this,'_isBrowserOffline',(_0x197254,_0x5b09bc)=>('connected'!==_0x197254&&(this['_shouldPluginsReconnect']=!0x0),_0x5b09bc||_0x197254!==_0x22666b['CONNECTED']?_0x22666b['DISCONNECTED']:this['state']==_0x22666b['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x22666b['CONNECTING']):_0x22666b['CONNECTED'])),this['connection']['on']('error',(_0x43be55,_0x1169c1)=>{if('limitExceeded'!==_0x1169c1['code'])throw console['error'](_0x1169c1),new _0x71c4af('cloudservices-init',null,{'originalError':_0x1169c1});_0x1e37c1['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'});}),!_0x4dc1f2['me'])return new Promise(_0x4dd840=>_0x4dc1f2['on']('change:me',_0x4dd840));})['catch'](_0x353477=>{throw console['error'](_0x353477),new _0x71c4af('cloudservices-init',null,{'originalError':_0x353477});});}['addToReconnectionStack'](_0x51933e){if('function'!=typeof _0x51933e['reconnect'])throw new _0x71c4af('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x51933e))throw new _0x71c4af('websocketgateway-plugin-already-registered',this,{'name':_0x51933e['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x51933e);}['removeFromReconnectionStack'](_0x1cc599){this['_reconnectionStack']['delete'](_0x1cc599);}['isInReconnectionStack'](_0x3690b4){return this['_reconnectionStack']['has'](_0x3690b4);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x192c68=>_0x192c68['reconnect']())))['then'](()=>this['state']=_0x22666b['CONNECTED'])['catch'](_0xa718c5=>{throw console['error'](_0xa718c5),new _0x71c4af('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x22666b['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x51d4ec{['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,_0x398766];}constructor(_0x451076){super(_0x451076),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x447489(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x398766);}['init'](){const _0x306b97=this['context']['plugins']['get'](c);this['listenTo'](_0x306b97,'change:state',(_0x375d20,_0x38c219,_0x462a9a)=>{if('connected'!==_0x462a9a)this['channelSessions']['forEach'](_0xb42cac=>_0xb42cac['clear']()),this['channelConnectedUsers']['forEach'](_0x5353f1=>_0x5353f1['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x5cbeec,_0x12bd8d]of this['_registeredSessions'])for(const _0x2612ab of _0x12bd8d)this['_handleSessionAdd'](_0x5cbeec,_0x2612ab);}}),this['_createUser'](_0x306b97['connection']['me'],!0x0);}['register'](_0x5617d5,_0x18ac51){if(this['_registeredSessions']['has'](_0x5617d5))throw new _0x71c4af('sessions-register-already-registered',null,{'channelId':_0x5617d5});this['_registeredSessions']['set'](_0x5617d5,_0x18ac51),this['channelSessions']['set'](_0x5617d5,new _0x447489()),this['channelConnectedUsers']['set'](_0x5617d5,new _0x447489()),this['listenTo'](_0x18ac51,'add',(_0x56d604,_0x11291d)=>this['_handleSessionAdd'](_0x5617d5,_0x11291d)),this['listenTo'](_0x18ac51,'remove',(_0x1c65fb,_0x9ed9d0)=>this['_handleSessionRemove'](_0x5617d5,_0x9ed9d0));for(const _0x512b2b of _0x18ac51)this['_handleSessionAdd'](_0x5617d5,_0x512b2b);}['unregister'](_0x13330f){if(!this['_registeredSessions']['has'](_0x13330f))throw new _0x71c4af('sessions-unregister-not-exist',null,{'channelId':_0x13330f});const _0xcdf9a2=this['_registeredSessions']['get'](_0x13330f);this['stopListening'](_0xcdf9a2);for(const _0x5e55dc of _0xcdf9a2)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x13330f,_0x5e55dc);this['_registeredSessions']['delete'](_0x13330f),this['channelSessions']['delete'](_0x13330f),this['channelConnectedUsers']['delete'](_0x13330f);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x4cd441){for(const _0x582515 of this['channelSessions']['values']())for(const _0x5710e4 of _0x582515)if(_0x5710e4['id']===_0x4cd441)return _0x5710e4['user'];}['getUserSessions'](_0x13c054,_0x27dfbe){const _0x1cc70d=_0x27dfbe?[this['channelSessions']['get'](_0x27dfbe)]:this['channelSessions']['values'](),_0x188de0=new Set();for(const _0x1984dd of _0x1cc70d)for(const _0x272fff of _0x1984dd)_0x272fff['user']['id']===_0x13c054['id']&&_0x188de0['add'](_0x272fff['id']);return _0x188de0;}['getUserRole'](_0x16b2d2){for(const _0x2b2af4 of this['channelSessions']['values']())for(const _0x2534dc of _0x2b2af4)if(_0x2534dc['user']===_0x16b2d2)return _0x2534dc['role'];}['_handleSessionAdd'](_0x260dea,_0x2d15af){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0xaf0957=_0x2d15af['user'],_0x1101ca=this['_users']['getUser'](_0xaf0957['id'])||this['_createUser'](_0xaf0957),_0x400daf=Object['assign']({},_0x2d15af,{'user':_0x1101ca});this['channelSessions']['get'](_0x260dea)['add'](_0x400daf);const _0x36d143=this['channelConnectedUsers']['get'](_0x260dea);_0x36d143['has'](_0x1101ca['id'])||_0x36d143['add'](_0x1101ca),this['allConnectedUsers']['has'](_0x1101ca['id'])||this['allConnectedUsers']['add'](_0x1101ca,_0x1101ca['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x260dea,{'channelId':_0x260dea,'session':_0x400daf});}['_handleSessionRemove'](_0xaa169e,_0xed341){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x12da46=this['channelConnectedUsers']['get'](_0xaa169e),_0x37c5cc=_0xed341['user'];_0x37c5cc['id']&&(this['channelSessions']['get'](_0xaa169e)['remove'](_0xed341['id']),_0x12da46['has'](_0x37c5cc['id'])&&!this['getUserSessions'](_0x37c5cc,_0xaa169e)['size']&&_0x12da46['remove'](_0x37c5cc['id']),this['allConnectedUsers']['get'](_0x37c5cc['id'])&&!this['getUserSessions'](_0x37c5cc)['size']&&this['allConnectedUsers']['remove'](_0x37c5cc['id']));}['_createUser'](_0x48cec6,_0x1a10ce){const _0x119663=this['_users']['addUser'](_0x48cec6);return _0x1a10ce&&this['_users']['defineMe'](_0x48cec6['id']),_0x119663['orderNumber']=this['_uniqueUsersCount']++,_0x119663;}}class q extends _0x58ccc3{['_domEmitter']=new(_0x5d5780())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xba1f96=this['editor'],_0x39ea3f=_0xba1f96['plugins']['get'](i);_0xba1f96['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x4faac8,{writer:_0x4b67bf})=>function(_0x517f3a,_0x14b644,_0x57b0e1,_0x5f3a49){const _0x432bd5=_0x517f3a['markerName']['split'](':')[0x2],_0x19d843=_0x57b0e1['getUserBySessionId'](_0x432bd5);if(!_0x19d843||_0x432bd5===_0x57b0e1['mySessionId'])return;if(!_0x5f3a49['model']['schema']['checkChild'](_0x517f3a['markerRange']['start'],'$text'))return;const _0x1786ad={'class':'ck-user__marker\x20'+_0x19d843['color']['getMarkerClass'](),'data-name':_0x19d843['name'],'data-session-id':_0x432bd5},_0x4b7e21=_0x5f3a49['model']['markers']['get'](_0x517f3a['markerName']),_0x1bf43c=_0x4b7e21['getStart'](),_0x335b0e=_0x1bf43c['nodeAfter'],_0x523700=_0x5f3a49['model']['schema'];if(_0x335b0e&&_0x523700['isObject'](_0x335b0e)&&_0x523700['isInline'](_0x335b0e)&&!_0x5f3a49['model']['markers']['get']('user:range:'+_0x432bd5)['getRange']()['isCollapsed'])return;const _0x54ec89=_0x1bf43c['parent'];return _0x5f3a49['model']['schema']['isLimit'](_0x54ec89)&&!_0x5f3a49['model']['hasContent'](_0x54ec89)&&(_0x1786ad['contenteditable']=!0x1),function(_0x15859e,_0x3c6d29,_0x1689a0){const _0x3bc2c7=_0x15859e['createUIElement']('span',_0x3c6d29);return _0x15859e['setCustomProperty']('userPositionMarker',!0x0,_0x3bc2c7),_0x3bc2c7['render']=function(_0x23a1d9){const _0x267318=this['toDomElement'](_0x23a1d9),_0x5dc2ec=document['createElement']('span');return _0x5dc2ec['classList']['add']('ck-user__marker-tooltip'),_0x5dc2ec['setAttribute']('contenteditable','false'),_0x5dc2ec['setAttribute']('spellcheck','false'),_0x5dc2ec['textContent']=_0x1689a0['name'],_0x267318['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x5dc2ec['outerHTML']+'⁠',_0x267318['addEventListener']('mouseenter',()=>{_0x267318['classList']['add']('ck-user__marker_hovered');}),_0x267318['addEventListener']('mouseleave',()=>{_0x267318['classList']['remove']('ck-user__marker_hovered');}),_0x267318;},_0x3bc2c7['isSimilar']=function(_0x12c209){return!(!this['getCustomProperty']('userPositionMarker')||!_0x12c209['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x12c209['getAttribute']('data-session-id'));},_0x3bc2c7;}(_0x14b644,_0x1786ad,_0x19d843);}(_0x4faac8,_0x4b67bf,_0x39ea3f,_0xba1f96)}),_0xba1f96['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x448d36=>function(_0x43051e,_0x179718){const _0x58cb91=_0x43051e['markerName']['split'](':')[0x2];if(_0x58cb91===_0x179718['mySessionId'])return null;const _0x56898e=_0x179718['getUserBySessionId'](_0x58cb91);if(!_0x56898e)return{'id':_0x58cb91,'classes':[]};return{'id':_0x58cb91,'classes':['ck-user__selection',_0x56898e['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x58cb91},'priority':0x7d0+_0x56898e['orderNumber']};}(_0x448d36,_0x39ea3f)}),function(_0x4616d1){const _0x60b144=_0x4616d1['model'],_0x4f951a=new Map(),_0x19ccfd=_0x4616d1['plugins']['get'](i);_0x60b144['markers']['on']('update:user:range',(_0x59d7da,_0x55783d,_0x15b5a7,_0x2a71d5)=>{if(!_0x2a71d5&&_0x4f951a['get'](_0x55783d['name']))return _0x4f951a['get'](_0x55783d['name'])['detach'](),void _0x4f951a['delete'](_0x55783d['name']);const _0x25b8eb=_0x55783d['name']['split'](':')[0x2];if(_0x25b8eb===_0x19ccfd['mySessionId'])return;const _0x20e2da='user:position:'+_0x25b8eb;_0x60b144['markers']['has'](_0x20e2da)&&_0x4616d1['editing']['reconvertMarker'](_0x20e2da),_0x55783d['on']('change:range',(_0x2f2e3f,_0xf345fd,_0x2115c9)=>{if('$graveyard'!=_0xf345fd['root']['rootName']&&'$graveyard'==_0x55783d['getRange']()['root']['rootName']&&!_0x4f951a['has'](_0x55783d['name'])){const _0x327a98=_0x60b144['schema']['getNearestSelectionRange'](_0x2115c9['deletionPosition']);if(_0x327a98){const _0x3b6f99=ht['fromRange'](_0x327a98);_0x4f951a['set'](_0x55783d['name'],_0x3b6f99),_0x3b6f99['on']('change:range',(_0x474ced,_0x54fdb4,_0x129ba2)=>{if('$graveyard'==_0x3b6f99['root']['rootName']){const _0x285c40=_0x60b144['schema']['getNearestSelectionRange'](_0x129ba2['deletionPosition']);_0x285c40?(_0x3b6f99['start']=_0x285c40['start'],_0x3b6f99['end']=_0x285c40['end']):(_0x4f951a['delete'](_0x55783d['name']),_0x3b6f99['detach']());}});}}});}),_0x60b144['document']['on']('change',()=>{_0x4f951a['size']>0x0&&_0x60b144['enqueueChange']({'isUndoable':!0x1},_0x35347c=>{for(const [_0x231203,_0x58ca12]of _0x4f951a)'$graveyard'==_0x60b144['markers']['get'](_0x231203)['getRange']()['root']['rootName']&&(te(_0x231203['split'](':')[0x2],_0x58ca12['toRange'](),_0x60b144,_0x35347c),_0x58ca12['detach']());_0x4f951a['clear']();});});}(_0xba1f96),this['_domEmitter']['listenTo'](_0xeaa953['document'],'keydown',(_0x2008b8,{key:_0x272cda})=>{'Escape'===_0x272cda&&function(_0x113532){_0x113532['editing']['view']['change'](_0x39fee4=>{for(const _0x5163ee of _0x113532['model']['markers']){if(!_0x5163ee['name']['startsWith']('user:position'))continue;const _0x172148=_0x113532['editing']['mapper']['markerNameToElements'](_0x5163ee['name']);if(_0x172148){for(const _0x5ed200 of _0x172148)_0x39fee4['removeClass']('ck-user__marker_hovered',_0x5ed200);}}});}(_0xba1f96);},{'useCapture':!0x0});}['afterInit'](){const _0x5e97c7=this['editor'],_0x5b5a5d=_0x5e97c7['commands']['get']('undo');_0x5b5a5d&&_0x5e97c7['model']['on']('applyOperation',(_0x33c862,_0x1d1212)=>{const _0x2ffd54=_0x1d1212[0x0];if(!_0x2ffd54['isDocumentOperation'])return;if('marker'!=_0x2ffd54['type']||!_0x2ffd54['name']['startsWith']('user:'))return;const _0x1a513b=_0x2ffd54['batch'];_0x5b5a5d['_createdBatches']['has'](_0x1a513b)&&(_0x2ffd54['newRange']=_0x2ffd54['oldRange']?_0x5e97c7['model']['createRange'](_0x2ffd54['oldRange']['start'],_0x2ffd54['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x3019ee=this['editor'],_0x491390=_0x3019ee['model']['document'],_0x83808b=_0x3019ee['plugins']['get'](i);_0x3019ee['model']['enqueueChange']({'isUndoable':!0x1},_0x203c71=>{const _0xc0760='user:range:'+_0x83808b['mySessionId'],_0x539f0a='user:position:'+_0x83808b['mySessionId'],_0x1512f1=_0x3019ee['model']['markers']['has'](_0xc0760);_0x3019ee['editing']['view']['hasDomSelection']?te(_0x83808b['mySessionId'],_0x491390['selection']['getFirstRange'](),_0x3019ee['model'],_0x203c71):_0x1512f1&&(_0x203c71['removeMarker'](_0xc0760),_0x203c71['removeMarker'](_0x539f0a));});}}function te(_0x12b5c1,_0x7c1765,_0x1ea0ed,_0x47787c){const _0x36df13='user:range:'+_0x12b5c1,_0xeeb566='user:position:'+_0x12b5c1,_0x3df595=_0x7c1765['getContainedElement']();let _0x5182ee=_0x7c1765['start'];_0x3df595&&_0x3df595['is']('element','tableCell')&&(_0x5182ee=function(_0x1f925c,_0x27608d){for(const _0xd5a17c of _0x1f925c['getPositions']())if(_0x27608d['schema']['checkChild'](_0xd5a17c,'$text'))return _0xd5a17c;}(_0x7c1765,_0x1ea0ed),_0x7c1765=_0x47787c['createRange'](_0x5182ee));const _0x1b21b7=_0x47787c['createRange'](_0x5182ee);_0x1ea0ed['markers']['has'](_0x36df13)?(_0x47787c['updateMarker'](_0x36df13,{'range':_0x7c1765}),_0x47787c['updateMarker'](_0xeeb566,{'range':_0x1b21b7})):(_0x47787c['addMarker'](_0x36df13,{'range':_0x7c1765,'usingOperation':!0x0}),_0x47787c['addMarker'](_0xeeb566,{'range':_0x1b21b7,'usingOperation':!0x0}));}function G(_0x248604,_0x428b52,_0x4e2d5d){const _0x1d0d93=_0x248604['t'],t=_0x248604['t'];switch(_0x428b52){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 _0x1d0d93({'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'},_0x4e2d5d);default:return'';}}let J=0x1;class l extends _0x58ccc3{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x239c9f)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,q,_0x507fb3,_0x398766,_0x445d56];}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 _0x5e25ab=this['serverHistory']['getOperations']();for(let _0x1ec99a=_0x5e25ab['length']-0x1;_0x1ec99a>=0x0;_0x1ec99a--){const _0x5b96d4=_0x5e25ab[_0x1ec99a];if(!this['_disconnectionOperations']['has'](_0x5b96d4))return _0x5b96d4['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2663b6){if(super(_0x2663b6),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x7e212a(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x71c4af('collaboration-missing-channelid',this);const _0x282703=_0x2663b6['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x282703,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x4dd3cc(),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 Y(this['_disconnectionOperations']);}['init'](){const _0x357408=this['editor'],_0x2fb0eb=_0x357408['plugins']['get'](_0x398766),_0x200691=_0x357408['plugins']['get'](c);this['listenTo'](_0x2fb0eb,'getOperationAuthor',(_0x3a95b1,_0x3a18f9)=>{const _0x46659a=_0x3a18f9[0x0];_0x46659a['_authorId']&&(_0x3a95b1['return']=_0x2fb0eb['getUser'](_0x46659a['_authorId']),_0x3a95b1['stop']()),null===_0x46659a['_authorId']&&(_0x3a95b1['return']=null,_0x3a95b1['stop']());},{'priority':'high'}),this['listenTo'](_0x357408['model']['document']['selection'],'change:range',(_0x5e0175,_0x1eb7f5)=>{_0x1eb7f5['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x357408['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x357408['model']['on']('applyOperation',(_0xdec675,_0x21f989)=>{const _0x16809a=_0x21f989[0x0];_0x16809a['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x16809a),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x200691,'state',this,'_hasSynchronizationProblem',(_0x53eddb,_0x12450c)=>'connected'===_0x53eddb&&!_0x12450c),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x357408['disableReadOnlyMode']('rtc-offline'):_0x357408['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x357408['disableReadOnlyMode']('rtc-offline'):_0x357408['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x444cfb=this['editor']['plugins']['get'](i),_0x1f2010=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x444cfb['unregister'](this['_channelId']);const _0x75a1b1=await this['_service']['reconnect'](_0x1f2010['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x75a1b1)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x309724=await this['_service']['getConnectedSessions']();_0x444cfb['register'](this['_channelId'],_0x309724),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x197b09){if(function(_0x43eb1a){return'404'===_0x43eb1a['code'];}(_0x197b09)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x699029){return'409'===_0x699029['code'];}(_0x197b09)){const _0x53512c=G(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'](_0x53512c);}else{if(!(_0x197b09 instanceof Q))throw _0x197b09;this['_handleReconnectionError']();}}}}['destroy'](){const _0x3c5ddd=this['editor']['plugins']['get'](c),_0x1c669e=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x1c669e['channelSessions']['has'](this['_channelId'])&&_0x1c669e['unregister'](this['_channelId']),_0x3c5ddd['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x13b2c3){if(this['sessionId']!==_0x13b2c3['sessionId']&&this['_lastSyncedOperationId']!==_0x13b2c3['lastOperationId'])throw new Q();return this['sessionId']=_0x13b2c3['sessionId'],this['_handleServerResponse']([],{..._0x13b2c3,'wereChangesApplied':!0x1,'data':_0x13b2c3['data']},'reconnect');}async['_connectService'](_0x27350b,_0x5a811c=!0x1){const {connection:_0x15c085}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x15c085,this['_channelId'])['then'](_0x26c8f6=>this['_initSessionsHandling'](_0x26c8f6))['catch'](_0x1e2ab9=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x1e2ab9);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x3ba7b9,_0x1e8d2a)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x1e8d2a);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x52ae15=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x27350b);this['_isPendingUpdate']=!0x0;const _0x21c969=await this['_service']['connect'](_0x15c085,this['_compressOperations'](_0x27350b),_0x52ae15);if(this['sessionId']=_0x21c969['sessionId'],_0x5a811c){if(!_0x21c969['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x21c969['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x27350b,_0x21c969,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x21c969,_0x27350b);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x4f5637=this['editor']['plugins']['get'](i),_0x588919=this['editor']['plugins']['get'](q),_0x57bec1=_0x4f5637['channelSessions']['get'](this['_channelId']);_0x57bec1&&_0x57bec1['length']>0x1?_0x588919['createUserMarkerOperations']():this['listenTo'](_0x4f5637,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x4f5637['channelSessions']['get'](this['_channelId'])['length']&&_0x588919['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x221be0,_0x1e732c,_0x3301ab,_0xc7ce27){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1e732c){const _0x27453a=this['_decompressOperations'](_0x3301ab,_0xc7ce27);await this['_fetchMissingUsers'](_0x27453a),this['_handleExternalOperations'](_0x27453a,_0x1e732c,_0x3301ab['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0xb75d6}=this['editor'];let _0x9f8c85;try{_0x9f8c85=await this['_service']['getDocumentDetails']();}catch(_0x50cfd3){const _0x5991c9=G(_0xb75d6,'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'](_0x5991c9);}const _0x14c043=_0x9f8c85['currentDocumentSession']||_0x9f8c85['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x14c043['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x543ada=G(_0xb75d6,'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'](_0x543ada);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x3622d9){const _0x2b5286=this['editor']['plugins']['get'](i);this['listenTo'](_0x2b5286,'sessionAdd:'+this['_channelId'],(_0x5127d1,{session:_0x412aba})=>{if(_0x412aba['id']===_0x2b5286['mySessionId']){_0x5127d1['off']();const _0x5a6a95=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x18c0c2=_0x412aba['permissions'];_0x5a6a95&&_0x5a6a95['isEnabled']&&(_0x18c0c2=_0x18c0c2['filter'](_0x194373=>'document:write'!==_0x194373)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x18c0c2,this['_channelId']);}}),_0x2b5286['register'](this['_channelId'],_0x3622d9);}['_initThrowingOnDataSet'](){const _0x3f244a=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x3c3fb5)=>{if(!_0x3c3fb5[_0x3c3fb5['length']-0x1]['suppressErrorInCollaboration'])throw new _0x71c4af('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x3f244a['apply'](this['editor']['data'],_0x3c3fb5);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x46b628,[_0x479182])=>{if(this['_document']['version'])throw new _0x71c4af('realtimecollaborationclient-init-document-already-initialized',this);_0x46b628['stop'](),this['_setPendingAction']();const _0x462528=this['editor']['config']['get']('rootsAttributes'),_0x505bcf=this['_getOperationsFromInitData'](_0x479182,_0x462528);0x0==_0x505bcf['length']&&_0x505bcf['push'](new _0x29c09c(0x0)),_0x46b628['return']=this['_connectService'](_0x505bcf)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x4cd715=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x4cd715))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x36f350,[_0x57fa7e,_0x587618])=>{_0x36f350['stop']();const _0x45c8fa=this['editor']['model']['document']['getRoot'](_0x57fa7e);if(!this['_knownRootNames']['has'](_0x57fa7e)){const _0x198f6e=_0x587618&&_0x587618['data']?_0x587618['data']:'',_0x242517=_0x587618&&_0x587618['attributes']?_0x587618['attributes']:{};await this['_loadRoot'](_0x57fa7e,_0x198f6e,_0x242517);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x45c8fa['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x45c8fa);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x123cf1){const _0x3c3276=this['editor']['plugins']['get'](_0x398766),{connection:_0x594ebd}=this['editor']['plugins']['get'](c),_0x3971c7=new Set();for(const _0x7284a3 of _0x123cf1){const _0x1c5a29=_0x7284a3['_authorId'];_0x1c5a29&&!_0x3c3276['getUser'](_0x1c5a29)&&_0x3971c7['add'](_0x1c5a29);}if(0x0===_0x3971c7['size'])return;const _0x1f3944=await dt['getMany'](_0x594ebd,Array['from'](_0x3971c7));for(const _0x39d9f6 of _0x1f3944)_0x3c3276['getUser'](_0x39d9f6['id'])||_0x3c3276['addUser'](_0x39d9f6);}['_getOperationsFromInitData'](_0x4a4519,_0x17c6ac={}){const _0xbf3fce=this['editor']['model'],_0x4c7ea0=[];let _0x2c8ef8=0x0;const _0x529d57='string'==typeof _0x4a4519?{'main':_0x4a4519}:_0x4a4519;for(const _0x4d9201 of Object['keys'](_0x529d57)){if(!this['_document']['roots']['has'](_0x4d9201))throw new _0x71c4af('realtimecollaborationclient-init-non-existent-root',this);const _0x200160=this['editor']['data']['parse'](_0x529d57[_0x4d9201]),_0x1d19b5=this['_document']['getRoot'](_0x4d9201),_0x12ce6c=new _0xd86e04(_0xbf3fce['createPositionAt'](_0x1d19b5,0x0),_0x200160,_0x2c8ef8++);_0x4c7ea0['push'](_0x12ce6c);for(const [_0x3b27b5,_0x339b65]of _0x200160['markers']){const _0x40ac03=_0xbf3fce['createRange'](_0xbf3fce['createPositionFromPath'](_0x1d19b5,_0x339b65['start']['path']['slice']()),_0xbf3fce['createPositionFromPath'](_0x1d19b5,_0x339b65['end']['path']['slice']())),_0x537289=new _0x42fab9(_0x3b27b5,null,_0x40ac03,_0xbf3fce['markers'],!0x0,_0x2c8ef8++);_0x4c7ea0['push'](_0x537289);}}if(_0x17c6ac)for(const [_0x38328b,_0x130e1c]of Object['entries'](_0x17c6ac)){const _0x2efe5f=_0xbf3fce['document']['getRoot'](_0x38328b);if(!_0x2efe5f)throw new _0x71c4af('multi-root-editor-root-attributes-no-root',null);for(const [_0x2fee53,_0x71a354]of Object['entries'](_0x130e1c))if(null!==_0x71a354){const _0x3fed00=new _0x22d82a(_0x2efe5f,_0x2fee53,null,_0x71a354,_0x2c8ef8++);_0x4c7ea0['push'](_0x3fed00);}}return _0x4c7ea0;}async['_loadRoot'](_0x457e89,_0xfbf1aa,_0x2ec836){this['_getOperationsFromInitData']({[_0x457e89]:_0xfbf1aa},{[_0x457e89]:_0x2ec836})['forEach']((_0x52fa29,_0x5b8e82)=>{_0x52fa29['baseVersion']=this['_document']['version']+_0x5b8e82,_0x52fa29['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x52fa29);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5d0e71,_0x4a924c){let _0x5956d4;this['_offset']=_0x5d0e71['offset'];const _0x36dc85=_0x5d0e71['wereChangesApplied']&&!_0x5d0e71['initData'],_0x55adef=_0x36dc85?0x0:_0x5d0e71['data']['baseVersion'];if(_0x4a924c['forEach'](_0x38a739=>{_0x38a739['_isInit']=!0x0,_0x38a739['createdAt']=_0x5d0e71['sessionCreatedAt'],_0x38a739['_authorId']=null;}),_0x36dc85)_0x5956d4=_0x4a924c,this['_applyOperationsSet'](_0x5956d4,_0x36dc85);else{if(_0x5d0e71['initData']){const _0x2a6442=this['_getOperationsFromInitData'](_0x5d0e71['initData']);this['_document']['history']['version']=-_0x2a6442['length'],_0x2a6442['forEach'](_0x109ad4=>{_0x109ad4['baseVersion']-=_0x2a6442['length'],_0x109ad4['createdAt']=_0x5d0e71['sessionCreatedAt'],_0x109ad4['_isInit']=!0x0,_0x109ad4['_authorId']=null;}),this['_applyOperationsSet'](_0x2a6442,!0x0),this['serverHistory']['version']=-_0x2a6442['length']+this['_offset'],this['_updateServerHistory'](_0x2a6442);}this['_document']['history']['version']=_0x55adef,_0x5956d4=this['_decompressOperations'](_0x5d0e71['data'],_0x5d0e71['metadata']),await this['_fetchMissingUsers'](_0x5956d4),this['_applyOperationsSet'](_0x5956d4,_0x36dc85);}_0x5d0e71['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5956d4,_0x5d0e71['lastOperationId']),this['_lastSyncedOperationId']=_0x5d0e71['lastOperationId']),this['serverHistory']['version']=_0x55adef+this['_offset'],this['_updateServerHistory'](_0x5956d4),_0x4a924c['filter'](_0x2e23f8=>{const _0x494afc=this['_getAffectedRoot'](_0x2e23f8);return _0x494afc&&!this['_knownRootNames']['has'](_0x494afc);})['forEach']((_0x5a07dd,_0x1e108d)=>{_0x5a07dd['baseVersion']=this['_document']['version']+_0x1e108d,this['_saveOperationInBuffer'](_0x5a07dd);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x1ebfac,_0x48217a){const _0xc1b065=_0x48217a&&_0x48217a['message'];if(_0xc1b065&&_0xc1b065['startsWith']('realtimecollaborationclient'))throw _0x48217a;const _0x2f1495=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x2f1495['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x71c4af(_0x1ebfac,this['editor'],_0xc1b065?{'originalError':_0xc1b065}:void 0x0);}['_saveOperationInBuffer'](_0x93e899){this['_knownOperations']['has'](_0x93e899)||(this['_knownOperations']['add'](_0x93e899),this['_bufferedOperations']['push'](_0x93e899),this['_pendingAction']||'marker'==_0x93e899['type']&&!_0x93e899['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x251144=!0x1){!_0x251144&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x39506e=>{_0x39506e&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x68956c=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x3c9295){return _0x3c9295['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3c9295['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x3c9295['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x68956c)||this['_crash'](_0x68956c['message'],_0x68956c);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x33f634=>{this['on']('change:_isPendingUpdate',()=>{_0x33f634();});});}async['_sendBufferedOperations'](){const _0xce202d=this['editor']['plugins']['get'](q);if(this['_shouldSendSelectionUpdate']()&&(_0xce202d['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x1064fb=[...this['_bufferedOperations']];for(const _0x325480 of _0x1064fb)_0x325480['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x325480);const _0x45a61a=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1064fb),_0x4112a6=J++,_0x4abe46=this['_compressOperations'](_0x1064fb),_0xa76f4f=await this['_service']['sendOperations'](_0x4abe46,_0x4abe46['baseVersion'],_0x45a61a);try{return await this['_handleServerResponse'](_0x1064fb,_0xa76f4f,_0x4112a6);}catch(_0x4e7a25){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x4e7a25);}}async['_handleServerResponse'](_0x2dc75c,_0xd58c4d,_0x425342){if('error'in _0xd58c4d)throw _0xd58c4d['error'];let _0x4e4490=!0x1;if(_0xd58c4d['wereChangesApplied']){_0xd58c4d['lastOperationId']&&(this['_lastSyncedOperationId']=_0xd58c4d['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x58c0bb=>!_0x2dc75c['includes'](_0x58c0bb));for(const _0x23bb2f of _0x2dc75c)_0x23bb2f['createdAt']='lastOperationAcceptedAt'in _0xd58c4d&&_0xd58c4d['lastOperationAcceptedAt']||void 0x0;X(_0x2dc75c,_0xd58c4d['version']-_0x2dc75c['length']),this['_updateServerHistory'](_0x2dc75c);const _0x42425c=_0x2dc75c['filter'](_0x2ae147=>{if(!_0x2ae147['_isInit'])return!0x1;const _0x5aedbe=this['_getAffectedRoot'](_0x2ae147);return _0x5aedbe&&!this['_knownRootNames']['has'](_0x5aedbe);});X(_0x42425c,this['_document']['version']),this['_applyOperationsSet'](_0x42425c),_0x4e4490=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x39404d=this['_decompressOperations'](_0xd58c4d['data'],_0xd58c4d['metadata'])['filter'](_0x1c8254=>_0x1c8254['baseVersion']>=this['_lastServerVersion']);_0x39404d['forEach'](_0xc3f8d3=>this['_addKnownRoot'](_0xc3f8d3)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2a3999=>!_0x2a3999['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x2a3999))),this['_bufferedOperations']['length']&&X(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x39404d),_0x4e4490=this['_handleExternalOperations'](_0x39404d,_0xd58c4d['version'],_0xd58c4d['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x4e4490?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x1f4d9d,_0x477e17,_0x1bad6f){try{const _0x200633={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x5e5984,operationsB:_0x173cbe,originalOperations:_0x557cbc}=_0x181f13(_0x1f4d9d,this['_bufferedOperations'],_0x200633);X(_0x5e5984,this['_document']['version']),X(_0x173cbe,_0x477e17);for(const _0x5aeeef of _0x5e5984){const _0x360f19=_0x557cbc['get'](_0x5aeeef);_0x5aeeef['_authorId']=_0x360f19?_0x360f19['_authorId']:null;}_0x1bad6f&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1f4d9d,_0x1bad6f),this['_lastSyncedOperationId']=_0x1bad6f),this['_bufferedOperations']=[..._0x173cbe],this['_applyOperationsSet'](_0x5e5984),this['_updateServerHistory'](_0x1f4d9d);}catch(_0x4f7b43){return console['error'](_0x4f7b43),!0x1;}return!0x0;}['_applyOperationsSet'](_0x707acd,_0x1b6b65=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x164213=>{for(const _0x3bd82a of _0x707acd)this['_knownOperations']['add'](_0x3bd82a),this['_addKnownRoot'](_0x3bd82a),_0x164213['batch']['addOperation'](_0x3bd82a),this['editor']['model']['applyOperation'](_0x3bd82a);});}['_addKnownRoot'](_0x3d8390){const _0x27feb7=this['_getAffectedRoot'](_0x3d8390);_0x27feb7&&this['_knownRootNames']['add'](_0x27feb7);}['_getAffectedRoot'](_0x447694){let _0x18c464,_0x225c31;switch(_0x447694['type']){case'insert':_0x18c464=_0x447694['position']['root'];break;case'marker':if(_0x225c31=_0x447694['newRange'],!_0x225c31)return null;_0x18c464=_0x225c31['root'];break;case'addRootAttribute':_0x18c464=_0x447694['root'];break;case'addRoot':_0x18c464=_0x447694['affectedSelectable'];break;case'move':_0x18c464=_0x447694['targetPosition']['root'];break;default:return null;}return _0x18c464['rootName'];}['_updateServerHistory'](_0x52c653){_0x52c653['forEach'](_0xdbefcf=>{const _0x3eab36=_0xdbefcf['clone']();_0x3eab36['_authorId']=_0xdbefcf['_authorId'],_0x3eab36['_isInit']=!!_0xdbefcf['_isInit'],_0x3eab36['createdAt']=_0xdbefcf['createdAt'],_0x3eab36['baseVersion']+=this['_offset'],_0xdbefcf['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x3eab36),this['serverHistory']['addOperation'](_0x3eab36);});}['_handleReconnectionError'](_0x5109ad){const _0x34be39=this['editor']['plugins']['get']('Notification'),_0x3cb9fe=this['editor']['locale'];_0x5109ad||(_0x5109ad=G(_0x3cb9fe,'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.')),_0x34be39['showWarning'](_0x5109ad,{'title':G(_0x3cb9fe,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x507fb3)['add'](G(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x507fb3)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x3d7710){const _0x554f0e=_0x3d7710['map'](_0x66ca56=>_0x66ca56['toJSON']());return this['_compressor']['compress'](_0x554f0e);}['_decompressOperations'](_0x482301,_0x4fd359){return this['_compressor']['decompress'](_0x482301)['map']((_0x116827,_0x191575)=>{const _0x548c7c='init'==_0x4fd359[_0x191575]['type'];if('InsertOperation'==_0x116827['__className']){const _0x4c4af6=_0x116827['position']['root'];!this['_document']['getRoot'](_0x4c4af6)&&(this['_document']['createRoot']('$root',_0x4c4af6)['_isAttached']=!0x1);}const _0x59892c=_0x498110['fromJSON'](_0x116827,this['_document']);return _0x59892c['wasUndone']=_0x116827['wasUndone'],_0x59892c['_isInit']=_0x548c7c,_0x59892c['_authorId']=_0x548c7c?null:_0x4fd359[_0x191575]['userId'],_0x59892c['_isDisconnection']='cs:removeUser'===_0x4fd359[_0x191575]['type'],_0x59892c['createdAt']=_0x4fd359[_0x191575]['createdAt'],_0x59892c;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x5e7047=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x5e7047&&_0x5e7047['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Q extends Error{}function X(_0x323346,_0xf1caa9){for(const _0x55148e of _0x323346)_0x55148e['baseVersion']=_0xf1caa9++;}class Y{['_ignoredOperations'];['_operationToId'];constructor(_0x44467d){this['_ignoredOperations']=_0x44467d,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x1feab6){let _0x552a43=_0x1feab6['length'];for(;_0x552a43--;){const _0xae01cb=_0x1feab6[_0x552a43];if(!this['_ignoredOperations']['has'](_0xae01cb)){if(!this['_operationToId']['has'](_0xae01cb)){const _0x517313=_0x5048e5()['slice'](0x1,0x12);this['_operationToId']['set'](_0xae01cb,_0x517313);}return this['_operationToId']['get'](_0xae01cb);}}}['setIdForTheLastOperation'](_0x330762,_0x30c732){if(!_0x30c732)return;let _0x418814=_0x330762['length'];for(;_0x418814--;){const _0x5158e8=_0x330762[_0x418814];this['_ignoredOperations']['has'](_0x5158e8)||this['_operationToId']['set'](_0x5158e8,_0x30c732);}}}class n extends _0x58ccc3{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x51d4ec{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x1c305a)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x398766];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xc67fe7){super(_0xc67fe7),this['_services']=new Map();}async['init'](){const _0x4cacc1=this['context'],_0x5209d5=_0x4cacc1['plugins']['get']('CommentsRepository');if(_0x4cacc1['plugins']['get'](c)['addToReconnectionStack'](this),_0x5209d5['adapter']={'addCommentThread':async({channelId:_0x114951,threadId:_0x1142aa,comments:_0x53f790,resolvedAt:_0x1dcc71,resolvedBy:_0x25c0b7,context:_0x4dd5b9,attributes:_0x5bd2be})=>{const _0x4c0d73=await this['_getService'](_0x114951)['addCommentThread']({'commentThreadId':_0x1142aa,'comments':_0x53f790['map'](_0x1ffa1b=>function(_0x2acd81,_0x10af58,_0x3167d8){return{'commentThreadId':_0x3167d8,'commentId':_0x2acd81['commentId'],'userId':_0x2acd81['authorId'],'content':_0x2acd81['content'],'documentId':_0x10af58,'createdAt':_0x2acd81['createdAt'],'attributes':_0x2acd81['attributes']||{}};}(_0x1ffa1b,_0x114951,_0x1142aa)),'resolvedAt':_0x1dcc71,'resolvedBy':_0x25c0b7,'context':_0x4dd5b9,'attributes':_0x5bd2be})['catch'](ut);return{'threadId':_0x4c0d73['commentThreadId'],'comments':_0x4c0d73['comments']};},'getCommentThread':async({channelId:_0x3a0e4d,threadId:_0x59da27})=>{const _0x2d5d6f=await this['_getService'](_0x3a0e4d)['getCommentThread'](_0x59da27)['catch'](ut);return _0x2d5d6f['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x2d5d6f]),{'threadId':_0x2d5d6f['commentThreadId'],'comments':_0x2d5d6f['comments']['map'](_),'context':_0x2d5d6f['context'],'resolvedAt':_0x2d5d6f['resolvedAt'],'resolvedBy':_0x2d5d6f['resolvedBy'],'attributes':_0x2d5d6f['attributes']||{}});},'updateCommentThread':async({channelId:_0x5129b6,threadId:_0x3566aa,context:_0x10727f,unlinkedAt:_0x1b7161,attributes:_0x266195})=>this['_getService'](_0x5129b6)['updateCommentThread']({'commentThreadId':_0x3566aa,'context':_0x10727f,'attributes':_0x266195,'unlinkedAt':_0x1b7161})['catch'](S)['catch'](ut),'resolveCommentThread':async({channelId:_0x1cfad4,threadId:_0x51b2af})=>{const _0x4ba0ab=await this['_getService'](_0x1cfad4)['resolveCommentThread'](_0x51b2af)['catch'](S)['catch'](ut);return{'threadId':_0x4ba0ab['commentThreadId'],'resolvedAt':_0x4ba0ab['resolvedAt'],'resolvedBy':_0x4ba0ab['resolvedBy']};},'reopenCommentThread':async({channelId:_0x32bf9b,threadId:_0x5115e2})=>this['_getService'](_0x32bf9b)['reopenCommentThread'](_0x5115e2)['catch'](S)['catch'](ut),'removeCommentThread':({channelId:_0x42e5ca,threadId:_0x4db8d3})=>this['_getService'](_0x42e5ca)['removeCommentThread'](_0x4db8d3)['catch'](S)['catch'](ut),'addComment':({channelId:_0x5971ad,threadId:_0x10edb4,commentId:_0x5af7e5,content:_0x42b49b,attributes:_0x58ea69})=>this['_getService'](_0x5971ad)['addComment'](_0x10edb4,_0x5af7e5,_0x42b49b,_0x58ea69)['catch'](ut),'updateComment':({channelId:_0x555831,threadId:_0x41233c,commentId:_0x16fa10,content:_0x53d075,attributes:_0x343def})=>this['_getService'](_0x555831)['updateComment'](_0x41233c,_0x16fa10,_0x53d075,_0x343def)['catch'](S)['catch'](ut),'removeComment':({channelId:_0x4c011c,threadId:_0x52d2bb,commentId:_0xb33741})=>this['_getService'](_0x4c011c)['removeComment'](_0x52d2bb,_0xb33741)['catch'](S)['catch'](ut)},_0x4cacc1 instanceof _0x5ee6a1){const _0x1e35b9=_0x4cacc1['config']['get']('collaboration.channelId'),_0xda3b37=_0x4cacc1['plugins']['get'](i);await this['_setUpService'](_0x1e35b9);const _0x4b6466=await this['_services']['get'](_0x1e35b9)['getConnectedSessions']();this['listenTo'](_0xda3b37,'sessionAdd:'+_0x1e35b9,(_0x1ecd93,{session:_0x5702b9})=>{_0x5702b9['id']===_0xda3b37['mySessionId']&&(_0x1ecd93['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x5702b9['permissions'],_0x1e35b9));}),_0xda3b37['register'](_0x1e35b9,_0x4b6466);}}async['_setUpService'](_0x40de82){if(this['_services']['has'](_0x40de82))throw new _0x71c4af('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x40de82});const _0x2b815c=this['context']['plugins']['get']('CommentsRepository'),_0x3767df=new a['CommentsService'](_0x40de82);this['_services']['set'](_0x40de82,_0x3767df),this['listenTo'](_0x3767df,'commentThreadAdded',(_0x149466,_0x6897ac)=>{const {commentThreadId:_0x4ad6bd,documentId:_0x18aad8,context:_0x454deb,attributes:_0x448fb5,resolvedAt:_0x346bd9,resolvedBy:_0x38412b,comments:_0x1123e1}=_0x6897ac;_0x2b815c['getCommentThread'](_0x4ad6bd)||_0x2b815c['addCommentThread']({'threadId':_0x4ad6bd,'channelId':_0x18aad8,'comments':_0x1123e1?_0x1123e1['map'](_):[],'context':_0x454deb,'attributes':_0x448fb5,'resolvedAt':_0x346bd9,'resolvedBy':_0x38412b,'isFromAdapter':!0x0});}),this['listenTo'](_0x3767df,'commentThreadUpdated',(_0x2a9b82,{commentThreadId:_0x49fd99,documentId:_0x489223,context:_0x1b7fa9,unlinkedAt:_0x2c8e55,attributes:_0x466761})=>{_0x2b815c['getCommentThread'](_0x49fd99)&&_0x2b815c['updateCommentThread']({'threadId':_0x49fd99,'channelId':_0x489223,'context':_0x1b7fa9,'unlinkedAt':_0x2c8e55,'attributes':_0x466761,'isFromAdapter':!0x0});}),this['listenTo'](_0x3767df,'commentThreadResolved',(_0x583b6d,{commentThreadId:_0x5ad1a5,resolvedBy:_0x31221b,resolvedAt:_0x385dd4})=>{const _0x4e799a=_0x2b815c['getCommentThread'](_0x5ad1a5);_0x4e799a&&_0x4e799a['resolve']({'resolvedBy':_0x31221b,'resolvedAt':_0x385dd4,'isFromAdapter':!0x0});}),this['listenTo'](_0x3767df,'commentThreadReopened',(_0x3b931d,{commentThreadId:_0x28bb70})=>{const _0x6d6a60=_0x2b815c['getCommentThread'](_0x28bb70);_0x6d6a60&&_0x6d6a60['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3767df,'commentThreadRemoved',(_0x1c2322,{commentThreadId:_0x1a50f9})=>{const _0x18b4c7=_0x2b815c['getCommentThread'](_0x1a50f9);_0x18b4c7&&_0x18b4c7['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x3767df,'commentAdded',(_0x3f5a9a,_0x3abaeb)=>{const _0x409604=_0x3abaeb['commentThreadId'],_0x1b4a3b=_0x2b815c['getCommentThread'](_0x409604);_0x1b4a3b&&_0x1b4a3b['addComment']({..._(_0x3abaeb),'isFromAdapter':!0x0});}),this['listenTo'](_0x3767df,'commentUpdated',(_0x93718d,{commentThreadId:_0x2e99f4,commentId:_0x398e16,content:_0x22e2a9,attributes:_0x42e688})=>{const _0x2cd90a=_0x2b815c['getCommentThread'](_0x2e99f4);if(_0x2cd90a){const _0x1a55b8=_0x2cd90a['getComment'](_0x398e16);_0x1a55b8&&_0x1a55b8['update']({'content':_0x22e2a9,'attributes':_0x42e688,'isFromAdapter':!0x0});}}),this['listenTo'](_0x3767df,'commentRemoved',(_0x3fe88f,{commentThreadId:_0x109000,commentId:_0x91627f})=>{const _0x5c50fb=_0x2b815c['getCommentThread'](_0x109000);if(_0x5c50fb){const _0x19bdf9=_0x5c50fb['getComment'](_0x91627f);_0x19bdf9&&_0x19bdf9['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x40de82);}['destroy'](){if(this['context']instanceof _0x5ee6a1){const _0x2bc3d7=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x2bc3d7);}}['_terminateService'](_0x209bc2){if(!this['_services']['has'](_0x209bc2))throw new _0x71c4af('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x209bc2});this['_getService'](_0x209bc2)['disconnect'](),this['_services']['delete'](_0x209bc2);}async['reconnect'](){for(const _0x473dc1 of this['_services']['keys']())await this['_connectService'](_0x473dc1);if(this['context']instanceof _0x5ee6a1){const _0x1c3988=this['context']['config']['get']('collaboration.channelId'),_0x15bd52=this['context']['plugins']['get'](i);_0x15bd52['unregister'](_0x1c3988);const _0x3214ed=await this['_services']['get'](_0x1c3988)['getConnectedSessions']();_0x15bd52['register'](_0x1c3988,_0x3214ed);}}async['_connectService'](_0x389b5d){const {connection:_0x3ed790}=this['context']['plugins']['get'](c),_0x21fbe3=this['context']['plugins']['get']('CommentsRepository'),_0x1b3459=this['_services']['get'](_0x389b5d),_0x456bf9=await _0x1b3459['connect'](_0x3ed790);await this['_fetchMissingUsersForThreads'](_0x456bf9);const _0x27f1f4=new Set(Array['from'](_0x21fbe3['getCommentThreads']({'channelId':_0x389b5d}),_0x30ed10=>_0x30ed10['id']));for(const _0x16a4e5 of _0x456bf9)_0x16a4e5['deletedAt']||_0x27f1f4['delete'](_0x16a4e5['commentThreadId']);for(const _0x2c0d6c of _0x27f1f4)_0x21fbe3['getCommentThread'](_0x2c0d6c)['remove']({'isFromAdapter':!0x0});for(const _0x14189d of _0x456bf9){let _0x1c1ed8=_0x21fbe3['getCommentThread'](_0x14189d['commentThreadId']);const {commentThreadId:_0x4fe005,context:_0x593340,attributes:_0x492df1,resolvedBy:_0xfdc9f8,resolvedAt:_0x1dfe71,unlinkedAt:_0x3a13ec,deletedAt:_0x469b86}=_0x14189d;if(_0x469b86)continue;_0x1c1ed8||(_0x1c1ed8=_0x21fbe3['addCommentThread']({'channelId':_0x389b5d,'threadId':_0x4fe005,'context':_0x593340,'attributes':_0x492df1||{},'resolvedBy':_0xfdc9f8,'resolvedAt':_0x1dfe71,'unlinkedAt':_0x3a13ec,'isFromAdapter':!0x0}));const _0x5589d7=new Set(Array['from'](_0x1c1ed8['comments'],_0xe85599=>_0xe85599['id']));for(const _0x5b256d of _0x14189d['comments'])_0x5589d7['delete'](_0x5b256d['commentId']);for(const _0x31d686 of _0x5589d7)_0x1c1ed8['getComment'](_0x31d686)['remove']({'isFromAdapter':!0x0});for(const _0x1e9a93 of _0x14189d['comments']){const _0x66fde4=_0x1c1ed8['getComment'](_0x1e9a93['commentId']);_0x66fde4?_0x66fde4['content']!==_0x1e9a93['content']&&_0x66fde4['update']({'content':_0x1e9a93['content'],'isFromAdapter':!0x0}):_0x1c1ed8['addComment'](Object['assign'](_(_0x1e9a93),{'isFromAdapter':!0x0}));}}}['_getService'](_0x58eadf){if(!this['_services']['has'](_0x58eadf))throw new _0x71c4af('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x58eadf});return this['_services']['get'](_0x58eadf);}async['_fetchMissingUsersForThreads'](_0xdd016f){const _0x5ec297=this['context']['plugins']['get'](_0x398766),{connection:_0x25412d}=this['context']['plugins']['get'](c),_0x17c4ca=new Set();for(const {resolvedBy:_0x10575d,comments:_0x311122}of _0xdd016f){_0x10575d&&!_0x5ec297['getUser'](_0x10575d)&&_0x17c4ca['add'](_0x10575d);for(const {userId:_0x278bef}of _0x311122)_0x5ec297['getUser'](_0x278bef)||_0x17c4ca['add'](_0x278bef);}if(0x0===_0x17c4ca['size'])return;const _0x329fa6=await dt['getMany'](_0x25412d,Array['from'](_0x17c4ca));for(const _0x1a11a8 of _0x329fa6)_0x5ec297['getUser'](_0x1a11a8['id'])||_0x5ec297['addUser'](_0x1a11a8);}}async function S(_0x4d9d63){if('404'!==_0x4d9d63['code'])throw _0x4d9d63;}function ut(_0x1fe025){if((_0x22d9af=_0x1fe025)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x22d9af['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x22d9af['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x22d9af;throw _0x1fe025;}function _(_0x3e11db){return{'threadId':_0x3e11db['commentThreadId'],'commentId':_0x3e11db['commentId'],'content':_0x3e11db['content'],'createdAt':_0x3e11db['createdAt'],'authorId':_0x3e11db['userId'],'attributes':_0x3e11db['attributes']||{}};}class f extends _0x58ccc3{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(_0x52d3f0){super(_0x52d3f0);const _0x2a1495=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x2a1495);}['init'](){const _0x3ade12=this['editor']['plugins']['get'](c),_0xf9030a=this['editor']['plugins']['get']('TrackChangesEditing');return _0xf9030a['adapter']={'getSuggestion':async _0x5a2690=>{await this['_waitForServiceReady']();const _0x208b1b=await this['_trackChangesService']['get'](_0x5a2690)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x208b1b]),_0x208b1b;},'addSuggestion':async({id:_0x121d63,type:_0x13aa02,data:_0x519349,originalSuggestionId:_0x3c122c,attributes:_0x4d7523})=>{await this['_waitForServiceReady']();const _0x54eb60={'id':_0x121d63,'type':_0x13aa02,'data':_0x519349,'originalSuggestionId':_0x3c122c,'attributes':_0x4d7523},_0x392fad=await this['_trackChangesService']['add'](_0x121d63,_0x13aa02,_0x519349,_0x3c122c,_0x4d7523)['catch'](_0x38adaa=>{if(ft(_0x38adaa))return new Promise(_0x52a65a=>{this['_bufferedRequests']['set'](_0x121d63,{'resolve':_0x52a65a,'suggestionData':_0x54eb60});});throw _0x38adaa;});return this['_bufferedRequests']['delete'](_0x121d63),_0x392fad;},'updateSuggestion':async(_0x1fda8b,_0x310896)=>{if(await this['_waitForServiceReady'](),'open'!==_0x310896['state'])return this['_trackChangesService']['update'](_0x1fda8b,_0x310896)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x203948,_0x495762)=>{_0xf9030a['hasSuggestion'](_0x495762['id'])&&(_0xf9030a['getSuggestion'](_0x495762['id'])['attributes']=_0x495762['attributes']);}),this['_trackChangesService']['connect'](_0x3ade12['connection'])['then'](_0x5eb490=>(_0x3ade12['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x5eb490)['then'](()=>{for(const _0x5a5004 of _0x5eb490){_0xf9030a['addSuggestionData'](_0x5a5004)['_saved']=!0x0;}})));}async['reconnect'](){const _0x1a06b1=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x6b211e}=this['editor']['plugins']['get'](c),_0x3b3121=await this['_trackChangesService']['connect'](_0x6b211e);await this['_fetchMissingUsersForThreads'](_0x3b3121);for(const {suggestionData:_0x44748b,resolve:_0x4e9257}of this['_bufferedRequests']['values']()){let _0x1bc22c=_0x3b3121['find'](_0x3844c3=>_0x3844c3['id']===_0x44748b['id']);_0x1bc22c||(_0x1bc22c=await this['_trackChangesService']['add'](_0x44748b['id'],_0x44748b['type'],_0x44748b['data'],_0x44748b['originalSuggestionId'])),_0x4e9257(_0x1bc22c);}for(const _0x2e14d0 of _0x3b3121)_0x1a06b1['hasSuggestion'](_0x2e14d0['id'])||_0x1a06b1['addSuggestionData'](_0x2e14d0);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x20a5f8=>{this['listenTo'](this['_trackChangesService'],'connected',_0x11c7ce=>{_0x11c7ce['off'](),_0x20a5f8();});});}async['_fetchMissingUsersForThreads'](_0x3cf7aa){const _0x1133c4=this['editor']['plugins']['get'](_0x398766),{connection:_0xd7e09e}=this['editor']['plugins']['get'](c),_0x1039af=new Set();for(const {authorId:_0x4f1813}of _0x3cf7aa)_0x1133c4['getUser'](_0x4f1813)||_0x1039af['add'](_0x4f1813);if(0x0===_0x1039af['size'])return;const _0x33cb70=await dt['getMany'](_0xd7e09e,Array['from'](_0x1039af));for(const _0x535331 of _0x33cb70)_0x1133c4['getUser'](_0x535331['id'])||_0x1133c4['addUser'](_0x535331);}}function R(_0x168f6e){if(ft(_0x168f6e))return new Promise(()=>{});throw _0x168f6e;}function ft(_0x121a6e){return _0x121a6e['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x121a6e['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x58ccc3{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 _0xfb0259=this['editor']['plugins']['get'](c),_0x2df461=this['editor']['plugins']['get']('CommentsEditing'),_0x3ce464=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0xfb0259,'change:state',(_0x43dcf9,_0x2cb8b6,_0x3791a7)=>{_0x2df461['isThreadsLoadingPaused']='connected'!==_0x3791a7;});}),this['listenTo'](_0xfb0259,'change:state',(_0x36630f,_0x4cc0bf,_0x5c49ef)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x5c49ef);}),_0x3ce464['_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 _0x58ccc3{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 _0x58ccc3{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x398766];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5078f2){super(_0x5078f2);const _0x4ea9df=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x4ea9df);}async['init'](){const _0xc3d258=this['editor']['plugins']['get'](l),_0x1eae25=_0xc3d258['serverHistory'],_0x479b8a=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x1eae25,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0xc3d258['sessionId']});const _0x5e6842=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x69f7d4=await tt['isBundleUploaded'](_0x479b8a['connection'],_0x5e6842);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0xc03778})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0xc03778)),'updateRevisions':async _0x54de47=>{await this['_waitForServiceReady']();const _0x317292=this['_revisionTracker']['currentRevision'];if(_0x69f7d4&&0x1===_0x54de47['length']&&_0x54de47[0x0]['id']===_0x317292['id'])return _0x54de47;for(const _0x503a42 of _0x54de47)_0x503a42['id']===_0x317292['id']&&(_0x503a42['isEmptyCurrent']=_0x503a42['fromVersion']===_0x503a42['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x54de47,this['_lastRequestId'])['then'](_0x3d6e65=>(this['_lastRequestId']=_0x3d6e65,_0x54de47))['catch'](_0x14624f=>{if(st(_0x14624f)||'400'===_0x14624f['code']&&void 0x0!==_0x14624f['data']['wrongRequestId']){for(const _0x5bccde of _0x54de47){!this['_revisionTracker']['repository']['getRevision'](_0x5bccde['id'])||this['_revisionTracker']['_bufferUpdate'](_0x5bccde['id'],_0x5bccde,!0x1);}if(st(_0x14624f))throw _0x14624f;return _0x54de47;}throw _0x14624f;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x101fd2,{revisionsData:_0x599fa8,requestId:_0xad1ec3})=>{Math['max'](..._0x599fa8['map'](_0x241d05=>_0x241d05['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x599fa8,_0xad1ec3);}):this['_handleRevisionsUpdate'](_0x599fa8,_0xad1ec3);});const {revisions:_0x3aface,requestId:_0x1c6588}=await this['_revisionHistoryService']['connect'](_0x479b8a['connection']);_0x479b8a['addToReconnectionStack'](this),this['_lastRequestId']=_0x1c6588,await this['_fetchMissingUsers'](_0x3aface);for(const _0x302bb3 of _0x3aface)this['_revisionTracker']['addRevisionData'](_0x302bb3);this['listenTo'](_0xc3d258,'change:_isConnected',(_0x593e5e,_0x5daa09,_0x5c9d81)=>{_0x5c9d81&&(this['_oldOffset']=_0xc3d258['_offset'],_0x593e5e['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x479b8a,'state',_0x153fac=>_0x153fac===_0x22666b['CONNECTED']);}async['reconnect'](){const _0x348f31=this['editor']['plugins']['get'](c),_0x461c54=this['editor']['plugins']['get'](l),_0x1cd336=async()=>{const _0x2d1bcf=this['_revisionTracker']['currentRevision'],_0x52382e=_0x2d1bcf['id'],_0x57dcdf=_0x52382e!==_0x461c54['sessionId'];if(_0x57dcdf){const _0x52ddc7=_0x461c54['_offset']-this['_oldOffset'],_0x5e54a1=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x2d1bcf['toVersion']+_0x52ddc7!==_0x5e54a1){const _0x34eaa4=_0x2d1bcf['fromVersion']+_0x52ddc7,_0x58d134=this['editor']['plugins']['get'](_0x398766),_0x440ae8=this['_revisionTracker']['buildRevisionData']({'revision':_0x2d1bcf,'from':_0x34eaa4,'to':_0x5e54a1});_0x440ae8['id']=_0x2d1bcf['id'];const _0x26a48d=_0x440ae8['authorsIds']['map'](_0x216ec4=>_0x58d134['getUser'](_0x216ec4));_0x2d1bcf['_update']({..._0x440ae8,'authors':_0x26a48d},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2d1bcf['id'],_0x440ae8,!0x0);}this['_revisionTracker']['_startingVersion']=_0x5e54a1,(_0x2d1bcf['toVersion']===_0x2d1bcf['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x52382e)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x52382e),this['_revisionTracker']['_createCurrentRevision'](_0x5e54a1));}const {revisions:_0x57bb3b,requestId:_0xfc1c16}=await this['_revisionHistoryService']['reconnect'](_0x348f31['connection'],this['_lastRequestId']);_0x57dcdf&&_0x57bb3b['length']>0x0?_0x461c54['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x57bb3b),this['_handleRevisionsUpdate'](_0x57bb3b,_0xfc1c16),this['_revisionTracker']['sendBufferedUpdates']());};return _0x461c54['_isConnected']?_0x1cd336():new Promise((_0x1d7844,_0x2c1b14)=>{_0x461c54['once']('change:_isConnected',()=>{_0x1cd336()['then'](_0x1d7844)['catch'](_0x2c1b14);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x24f391=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x588cf7=>{_0x588cf7['off'](),_0x24f391();});});}['_getLatestVersionFromServerOperations'](){const _0x229e58=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x553ead of _0x229e58)if('marker'!==_0x553ead['type']||_0x553ead['affectsData'])return _0x553ead['baseVersion']+0x1;}['_getLatestVersion'](){const _0x523850=this['editor']['plugins']['get'](l);return new Promise(_0x1a06c9=>{_0x523850['_isPendingUpdate']?_0x523850['once']('change:_isPendingUpdate',()=>{_0x1a06c9(this['_getLatestVersionFromServerOperations']());}):_0x1a06c9(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x38bcfc,_0x120575){const _0x22c371=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x120575;for(const _0x462f96 of _0x38bcfc){const _0x57c20b=_0x22c371['getRevision'](_0x462f96['id']);if(_0x57c20b){if((_0x462f96['fromVersion']||_0x462f96['toVersion'])&&(_0x462f96['diffData']=null),_0x57c20b===this['_revisionTracker']['currentRevision']){const _0x4cd205=Math['max'](_0x57c20b['toVersion'],_0x462f96['toVersion']),_0x1fe35a=Math['max'](_0x57c20b['fromVersion'],_0x462f96['fromVersion']);let _0x49db2f;_0x57c20b['toVersion']===_0x462f96['toVersion']&&_0x57c20b['fromVersion']===_0x462f96['fromVersion']?(_0x49db2f=!0x0,this['_preventResendingRevisionData'](_0x462f96)):_0x462f96['toVersion']===_0x4cd205&&_0x462f96['fromVersion']===_0x1fe35a?_0x49db2f=!0x1:(_0x57c20b['toVersion']===_0x4cd205&&_0x57c20b['fromVersion']===_0x1fe35a||this['_fixRevision']({'revision':_0x57c20b,'from':_0x1fe35a,'to':_0x4cd205}),_0x49db2f=!0x0),_0x49db2f&&(delete _0x462f96['fromVersion'],delete _0x462f96['toVersion'],delete _0x462f96['diffData'],delete _0x462f96['createdAt'],delete _0x462f96['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x462f96),this['_preventResendingRevisionData'](_0x462f96);}else this['_revisionTracker']['addRevisionData'](_0x462f96);}const _0x36ce15=_0x22c371['getRevisions']();_0x36ce15['reverse']();for(let _0x318393=0x0;_0x318393<_0x36ce15['length']-0x1;_0x318393++){const _0x42611c=_0x36ce15[_0x318393],_0x147e3e=_0x36ce15[_0x318393+0x1];if(_0x42611c['fromVersion']<_0x147e3e['toVersion']){const _0x4aa512=_0x147e3e['toVersion'],_0xc6ffa9=Math['max'](_0x4aa512,_0x42611c['toVersion']);this['_fixRevision']({'revision':_0x42611c,'from':_0x4aa512,'to':_0xc6ffa9});}}}['_fixRevision']({revision:_0xfeb6fe,from:_0x1388bb,to:_0x134404}={}){const _0x4f6748=this['editor']['plugins']['get'](_0x398766),_0x356a7d=this['_revisionTracker']['buildRevisionData']({'revision':_0xfeb6fe,'from':_0x1388bb,'to':_0x134404});_0x356a7d['authors']=_0x356a7d['authorsIds']['map'](_0x534c38=>_0x4f6748['getUser'](_0x534c38)),_0xfeb6fe['_update'](_0x356a7d);}['_preventResendingRevisionData'](_0x892738){const _0x29c91c={};_0x29c91c['id']=_0x892738['id'];for(const _0x3e709f of Object['keys'](_0x892738))'id'!==_0x3e709f&&(_0x29c91c[_0x3e709f]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x29c91c['id'],_0x29c91c,!0x0);}async['_fetchMissingUsers'](_0x5a6ceb){const _0xe474b9=this['editor']['plugins']['get'](_0x398766),{connection:_0x23484a}=this['editor']['plugins']['get'](c),_0x3c81d2=new Set();for(const _0x2642d1 of _0x5a6ceb){for(const _0x1a6186 of _0x2642d1['authorsIds'])_0xceb3b(_0x1a6186);_0x2642d1['creatorId']&&_0xceb3b(_0x2642d1['creatorId']);}if(0x0===_0x3c81d2['size'])return;const _0x503e46=await dt['getMany'](_0x23484a,Array['from'](_0x3c81d2));for(const _0x151f89 of _0x503e46)_0xe474b9['getUser'](_0x151f89['id'])||_0xe474b9['addUser'](_0x151f89);function _0xceb3b(_0x5091ca){_0xe474b9['getUser'](_0x5091ca)||_0x3c81d2['add'](_0x5091ca);}}}function st(_0x4c7774){return _0x4c7774['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x4c7774['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4c7774['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x58ccc3{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class A extends _0x471b2e{['_collapseAt'];constructor(_0x35d6fa,_0x4310e3=0x6){super(_0x35d6fa);const _0x20826c=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x4310e3,this['bind']('isHidden')['to'](this,'usersCount',_0x5626f1=>_0x5626f1<_0x4310e3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x20826c['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x20826c['to']('usersCount',_0x29e82d=>'+'+(_0x29e82d-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x471b2e{['items'];['keystrokes'];constructor(_0x3afe18){super(_0x3afe18);const _0x57d02e=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x30a9a4(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x57d02e['if']('hasPopup'),'aria-expanded':_0x57d02e['to']('isExpanded',_0x409bd3=>this['hasPopup']&&String(_0x409bd3)),'aria-label':_0x57d02e['to']('hasPopup',_0x251997=>G(_0x3afe18,_0x251997?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x57d02e['to']('hasPopup',_0x569295=>!!_0x569295&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x57d02e['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x57d02e['to'](_0x12920b=>{const _0x3ca370=_0x12920b,_0x2781c8=document['querySelector']('.ck-presence-list__dropdown-list'),_0x2dad2b=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2781c8?.['contains'](_0x3ca370['relatedTarget'])||_0x2dad2b?.['contains'](_0x3ca370['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0xa9ba65,_0x1012b1,_0xfa823b)=>{this['element']&&(_0xfa823b?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class j extends _0x471b2e{['counterView'];['inlineListView'];constructor(_0x3554f6,_0x20715c=0x6){super(_0x3554f6);const _0x3526c3=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x20715c),this['inlineListView']=new ts(_0x3554f6),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x5abcb6 of this['inlineListView']['items'])_0x5abcb6['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',_0x3526c3['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x471b2e{['listWrapperView'];constructor(_0x360afd,_0x583734){super(_0x360afd);const _0x131b26=this['bindTemplate'];this['listWrapperView']=new mt(_0x360afd,_0x583734),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':G(_0x360afd,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x131b26['to'](_0x34aa37=>{const _0x5078ba=_0x34aa37,_0x5d6086=document['querySelector']('.ck-presence-list__list'),_0x264e75=document['querySelector']('.ck-balloon-panel_with-arrow');_0x5d6086?.['contains'](_0x5078ba['relatedTarget'])||_0x264e75?.['contains'](_0x5078ba['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class mt extends _0x4e71d5{constructor(_0x4514ea,_0x2a4779){super(_0x4514ea);const _0x595025=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x2a4779?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x595025['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x595025['to']('role'),'aria-label':_0x595025['to']('ariaLabel'),'aria-labelledby':_0x595025['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0xeaa953['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x451c44=this['element'];_0x451c44&&(this['_isScrollable']=Math['max'](_0x451c44['scrollHeight'],_0x451c44['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0xadf7a3,_0x244955,_0x11ea26){super(_0xadf7a3);const _0x1fa6d7=this['bindTemplate'];this['userView']=new ct(_0xadf7a3,_0x244955);const _0x4b29e6={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x244955['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x244955['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x244955['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x11ea26&&(_0x4b29e6['tag']='button',_0x4b29e6['on']={'click':_0x1fa6d7['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4b29e6);}['focus'](){this['element']['focus']();}}class y extends _0x471b2e{['userView'];['markerView'];constructor(_0x43f700,_0x278513,_0x50a02d){super(_0x43f700);const _0x3cb000=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x43f700,_0x278513),this['markerView']=new at(_0x43f700,_0x278513);const _0x5b3fe4=new ot(_0x43f700);_0x5b3fe4['template']['tag']='span',_0x5b3fe4['text']=_0x278513['name'];const _0x1b03c1={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x3cb000['to']('isFocusable',_0x3eba61=>!!_0x3eba61&&0x0),'aria-labelledby':_0x5b3fe4['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x3cb000['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x3cb000['to']('hasTooltip',_0x3fc615=>!_0x3fc615),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x5b3fe4]};_0x50a02d&&(_0x1b03c1['tag']='button',_0x1b03c1['on']={'click':_0x3cb000['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x1b03c1);}}class at extends _0x471b2e{constructor(_0x30d483,_0x2c6236){super(_0x30d483),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2c6236['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x51d4ec{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x282f05){super(_0x282f05),this['context']['config']['define']('presenceList',C);const _0x33be9a=_0x282f05['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x33be9a)throw new _0x71c4af('presencelist-collapseat-invalid-format',this);if(_0x33be9a<0x1)throw new _0x71c4af('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x447489(),this['balloonPanelView']=new _0x460bdf(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x3a3e6a of this['_allConnectedUsers'])this['_handleUserAdd'](_0x3a3e6a);this['listenTo'](this['_allConnectedUsers'],'add',(_0x5f5014,_0x247530)=>{this['_handleUserAdd'](_0x247530);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x56869c,_0x2ee243)=>{this['_handleUserRemove'](_0x2ee243);});}['_createView'](){const _0x3a2b29=this['context'],_0x597419=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x222dd5=this['balloonPanelView'];if(!_0x4f25f1(_0x3a2b29['config']['get']('presenceList.container')))throw new _0x71c4af('presencelist-missing-container',this);return _0x597419['counterView']['bind']('usersCount')['to'](this),_0x597419['bind']('isCollapsed')['to'](this,'usersCount',_0x4dd22f=>{const {collapseAt:_0x37fc40}=_0x3a2b29['config']['get']('presenceList'),_0x36fdfd=_0x4dd22f>=_0x37fc40;if(_0x36fdfd&&!_0x597419['inlineListView']['items']['find'](_0x14a885=>_0x14a885 instanceof A)){const _0x2a138a=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x2a138a&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x597419['inlineListView']['items']['add'](_0x597419['counterView']);}return _0x36fdfd||this['hideDropdown'](),_0x36fdfd;}),_0x597419['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0xfe547=>{const _0x290219=_0x3a2b29['config']['get']('presenceList'),_0xff4ddf=new y(_0x3a2b29['locale'],_0xfe547,!!_0x290219['onClick']);return _0xff4ddf['bind']('hasTooltip')['to'](_0x597419,'isCollapsed',_0x2ec75f=>!_0x2ec75f),_0xff4ddf['bind']('isFocusable')['to'](_0x597419,'isCollapsed',_0x35e335=>!_0x35e335),_0x290219['onClick']&&this['listenTo'](_0xff4ddf,'execute',()=>{this['view']['isCollapsed']||_0x290219['onClick'](_0xfe547,_0xff4ddf['element']);}),_0xff4ddf;}),this['listenTo'](_0x597419['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x597419['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x597419['inlineListView']['keystrokes']['set']('Enter',(_0x337b37,_0x462ccd)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x462ccd());}),_0x597419['render'](),_0x222dd5['render'](),_0x4bb096({'emitter':_0x597419,'activator':()=>_0x222dd5['isVisible'],'contextElements':[_0x222dd5['element'],_0x597419['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x3a2b29['config']['get']('presenceList.container')['appendChild'](_0x597419['element']),this['_bodyCollection']=new _0x5df3c7(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x597419;}['_handleUserAdd'](_0x294a63){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x294a63['isMe'])return;const _0x25e329=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x25e329-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x14323c=_0x294a63['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x294a63,_0x14323c);}['_handleUserRemove'](_0x5c13ba){this['usersCount']--;const {collapseAt:_0x30c5c7}=this['context']['config']['get']('presenceList'),_0x8997cf=this['usersCount']>=_0x30c5c7;if(this['currentDisplayedUsers']['get'](_0x5c13ba['id']))this['currentDisplayedUsers']['remove'](_0x5c13ba['id']);else{if(_0x8997cf&&this['currentDisplayedUsers']['length']+0x1===_0x30c5c7-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x8997cf?0x1:0x0)<this['usersCount']){for(const _0xf18676 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0xf18676['id'])&&(this['currentDisplayedUsers']['add'](_0xf18676,Math['min'](this['currentDisplayedUsers']['length']-(_0x8997cf?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x8997cf?0x1:0x0)===_0x30c5c7-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x3a82fb=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x3a82fb['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x4fcd3f}=this['presenceDropdownView'];_0x4fcd3f['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x1caa4b=>{if(!_0x3a82fb['displayMe']&&_0x1caa4b['isMe'])return null;const _0x577bb4=new k(this['context']['locale'],_0x1caa4b,!!_0x3a82fb['onClick']);return _0x3a82fb['onClick']&&this['listenTo'](_0x577bb4,'execute',()=>{_0x3a82fb['onClick'](_0x1caa4b,_0x577bb4['element']);}),_0x577bb4;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x4fcd3f['focus'](),_0x4fcd3f['checkIfScrollable']();const _0x24f381=(_0x58e71d,_0x3a390d)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3a390d();};_0x4fcd3f['keystrokes']['set']('Esc',_0x24f381),_0x4fcd3f['keystrokes']['set']('Shift+Tab',_0x24f381),_0x4fcd3f['keystrokes']['set']('Tab',(_0x1f5da3,_0x584a94)=>{!function(_0x2500b8){const _0x2cafb9=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x4451a6=>_0x4451a6+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x2ecaed=[...document['body']['querySelectorAll'](_0x2cafb9)]['filter'](_0x67874e=>_0x67874e===document['activeElement']||_0x67874e['offsetWidth']+_0x67874e['offsetHeight']>0x0)['sort']((_0x3ce505,_0xd8e4fd)=>(_0x3ce505['tabIndex']||0x0)-(_0xd8e4fd['tabIndex']||0x0)),_0x3cdcec=_0x2ecaed['indexOf'](_0x2500b8),_0xe5e097=_0x2ecaed[(_0x3cdcec+0x1)%_0x2ecaed['length']];_0xe5e097&&_0xe5e097['focus']();}(this['view']['element']),this['hideDropdown'](),_0x584a94();}),_0x4fcd3f['focusTracker']['add'](this['view']['element']),_0x4fcd3f['focusTracker']['on']('change:isFocused',(_0x1fc14d,_0x1e57b6,_0x18f1e4)=>{_0x18f1e4||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 _0x51d4ec{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,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x1a4799=>0x1!=_0x1a4799}};
23
+ export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x3e01fb=>0x1!=_0x3e01fb}};