@ckeditor/ckeditor5-real-time-collaboration 45.2.1-alpha.9 → 45.2.2

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 _0x3f68a4,Plugin as _0xdcbc50,PendingActions as _0x352a17,Context as _0x51b985}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x58e02a,CKEditorError as _0x19d29c,Collection as _0x52ca00,global as _0x4366f0,version as nt,uid as _0x53029c,KeystrokeHandler as _0x404036}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0xc034f2,View as _0x2e989d,ListView as _0x54e28b,ListItemView as rt,LabelView as ot,BalloonPanelView as _0xcc0d89,clickOutsideHandler as _0x57da6e,BodyCollection as _0x202965}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x241be6,NoOperation as _0x27ade8,InsertOperation as _0x4955f3,MarkerOperation as _0x455320,RootAttributeOperation as _0x15eb0d,transformSets as _0x401905,OperationFactory as _0xdb4121}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x312285,CollaborativeEditingService as _0x4f847e,User as dt,CommentsService as _0x360da2,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x2aaab9,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x2e6a41}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x2a9041}from'es-toolkit/compat';class c extends _0x3f68a4{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0xc034f2];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1aea76){super(_0x1aea76),this['set']('state',_0x312285['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x58e02a);}['init'](){const _0x13110f=this['context'],_0xaa1bcc=_0x13110f['plugins']['get']('CloudServices'),_0x55ae5b=_0x13110f['plugins']['get'](_0xc034f2);if(!_0xaa1bcc['token'])throw new _0x19d29c('websocketgateway-missing-token',this);if(!_0xaa1bcc['webSocketUrl'])throw new _0x19d29c('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'](_0xaa1bcc['token'],_0xaa1bcc['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x271802=>{if(this['connection']=_0x271802,this['bind']('state')['to'](_0x271802,'state',this,'_isBrowserOffline',(_0x3a8f85,_0x585d0a)=>('connected'!==_0x3a8f85&&(this['_shouldPluginsReconnect']=!0x0),_0x585d0a||_0x3a8f85!==_0x312285['CONNECTED']?_0x312285['DISCONNECTED']:this['state']==_0x312285['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x312285['CONNECTING']):_0x312285['CONNECTED'])),this['connection']['on']('error',(_0x27420b,_0x31038b)=>{if('limitExceeded'!==_0x31038b['code'])throw console['error'](_0x31038b),new _0x19d29c('cloudservices-init',null,{'originalError':_0x31038b});_0x55ae5b['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'});}),!_0x271802['me'])return new Promise(_0x31328b=>_0x271802['on']('change:me',_0x31328b));})['catch'](_0x4524e7=>{throw console['error'](_0x4524e7),new _0x19d29c('cloudservices-init',null,{'originalError':_0x4524e7});});}['addToReconnectionStack'](_0x517438){if('function'!=typeof _0x517438['reconnect'])throw new _0x19d29c('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x517438))throw new _0x19d29c('websocketgateway-plugin-already-registered',this,{'name':_0x517438['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x517438);}['removeFromReconnectionStack'](_0x78d6f7){this['_reconnectionStack']['delete'](_0x78d6f7);}['isInReconnectionStack'](_0x38338d){return this['_reconnectionStack']['has'](_0x38338d);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x5a66cb=>_0x5a66cb['reconnect']())))['then'](()=>this['state']=_0x312285['CONNECTED'])['catch'](_0x4292d0=>{throw console['error'](_0x4292d0),new _0x19d29c('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x312285['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x3f68a4{['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,_0x2aaab9];}constructor(_0x4961d5){super(_0x4961d5),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x52ca00(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x2aaab9);}['init'](){const _0x3f6174=this['context']['plugins']['get'](c);this['listenTo'](_0x3f6174,'change:state',(_0x3354fa,_0x708e0b,_0x49ad29)=>{if('connected'!==_0x49ad29)this['channelSessions']['forEach'](_0x518567=>_0x518567['clear']()),this['channelConnectedUsers']['forEach'](_0x5d92f4=>_0x5d92f4['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x49db1e,_0x123188]of this['_registeredSessions'])for(const _0x1f6224 of _0x123188)this['_handleSessionAdd'](_0x49db1e,_0x1f6224);}}),this['_createUser'](_0x3f6174['connection']['me'],!0x0);}['register'](_0x35da19,_0x20fae4){if(this['_registeredSessions']['has'](_0x35da19))throw new _0x19d29c('sessions-register-already-registered',null,{'channelId':_0x35da19});this['_registeredSessions']['set'](_0x35da19,_0x20fae4),this['channelSessions']['set'](_0x35da19,new _0x52ca00()),this['channelConnectedUsers']['set'](_0x35da19,new _0x52ca00()),this['listenTo'](_0x20fae4,'add',(_0x21c582,_0x501b46)=>this['_handleSessionAdd'](_0x35da19,_0x501b46)),this['listenTo'](_0x20fae4,'remove',(_0x9e9307,_0x1b13b9)=>this['_handleSessionRemove'](_0x35da19,_0x1b13b9));for(const _0x9f73f2 of _0x20fae4)this['_handleSessionAdd'](_0x35da19,_0x9f73f2);}['unregister'](_0x532bd1){if(!this['_registeredSessions']['has'](_0x532bd1))throw new _0x19d29c('sessions-unregister-not-exist',null,{'channelId':_0x532bd1});const _0x44b55c=this['_registeredSessions']['get'](_0x532bd1);this['stopListening'](_0x44b55c);for(const _0xf2a99 of _0x44b55c)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x532bd1,_0xf2a99);this['_registeredSessions']['delete'](_0x532bd1),this['channelSessions']['delete'](_0x532bd1),this['channelConnectedUsers']['delete'](_0x532bd1);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x25d736){for(const _0x9440a6 of this['channelSessions']['values']())for(const _0x14bc25 of _0x9440a6)if(_0x14bc25['id']===_0x25d736)return _0x14bc25['user'];}['getUserSessions'](_0x4c281a,_0x129e6a){const _0xeb0fd9=_0x129e6a?[this['channelSessions']['get'](_0x129e6a)]:this['channelSessions']['values'](),_0x25b90e=new Set();for(const _0x4da448 of _0xeb0fd9)for(const _0x289f41 of _0x4da448)_0x289f41['user']['id']===_0x4c281a['id']&&_0x25b90e['add'](_0x289f41['id']);return _0x25b90e;}['getUserRole'](_0x54ccd6){for(const _0x110f4d of this['channelSessions']['values']())for(const _0x535500 of _0x110f4d)if(_0x535500['user']===_0x54ccd6)return _0x535500['role'];}['_handleSessionAdd'](_0x27f8b6,_0x1fb42c){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x2367c5=_0x1fb42c['user'],_0x4e538f=this['_users']['getUser'](_0x2367c5['id'])||this['_createUser'](_0x2367c5),_0x10648c=Object['assign']({},_0x1fb42c,{'user':_0x4e538f});this['channelSessions']['get'](_0x27f8b6)['add'](_0x10648c);const _0x58f766=this['channelConnectedUsers']['get'](_0x27f8b6);_0x58f766['has'](_0x4e538f['id'])||_0x58f766['add'](_0x4e538f),this['allConnectedUsers']['has'](_0x4e538f['id'])||this['allConnectedUsers']['add'](_0x4e538f,_0x4e538f['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x27f8b6,{'channelId':_0x27f8b6,'session':_0x10648c});}['_handleSessionRemove'](_0x4d1fbc,_0x4b3038){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x445242=this['channelConnectedUsers']['get'](_0x4d1fbc),_0x5ca821=_0x4b3038['user'];_0x5ca821['id']&&(this['channelSessions']['get'](_0x4d1fbc)['remove'](_0x4b3038['id']),_0x445242['has'](_0x5ca821['id'])&&!this['getUserSessions'](_0x5ca821,_0x4d1fbc)['size']&&_0x445242['remove'](_0x5ca821['id']),this['allConnectedUsers']['get'](_0x5ca821['id'])&&!this['getUserSessions'](_0x5ca821)['size']&&this['allConnectedUsers']['remove'](_0x5ca821['id']));}['_createUser'](_0x1d93e2,_0x2ed4f8){const _0xea685=this['_users']['addUser'](_0x1d93e2);return _0x2ed4f8&&this['_users']['defineMe'](_0x1d93e2['id']),_0xea685['orderNumber']=this['_uniqueUsersCount']++,_0xea685;}}class q extends _0xdcbc50{['_domEmitter']=new(_0x58e02a())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4d0d7e=this['editor'],_0xff3e91=_0x4d0d7e['plugins']['get'](i);_0x4d0d7e['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x38ccc2,{writer:_0x1af9ea})=>function(_0x51edb6,_0x3b7869,_0x52193b,_0x4a5507){const _0x33ce22=_0x51edb6['markerName']['split'](':')[0x2],_0xd3c0f9=_0x52193b['getUserBySessionId'](_0x33ce22);if(!_0xd3c0f9||_0x33ce22===_0x52193b['mySessionId'])return;if(!_0x4a5507['model']['schema']['checkChild'](_0x51edb6['markerRange']['start'],'$text'))return;const _0xc38011={'class':'ck-user__marker\x20'+_0xd3c0f9['color']['getMarkerClass'](),'data-name':_0xd3c0f9['name'],'data-session-id':_0x33ce22},_0x59c2d6=_0x4a5507['model']['markers']['get'](_0x51edb6['markerName']),_0x59a72d=_0x59c2d6['getStart'](),_0x576ae8=_0x59a72d['nodeAfter'],_0x38c123=_0x4a5507['model']['schema'];if(_0x576ae8&&_0x38c123['isObject'](_0x576ae8)&&_0x38c123['isInline'](_0x576ae8)&&!_0x4a5507['model']['markers']['get']('user:range:'+_0x33ce22)['getRange']()['isCollapsed'])return;const _0x5efff8=_0x59a72d['parent'];return _0x4a5507['model']['schema']['isLimit'](_0x5efff8)&&!_0x4a5507['model']['hasContent'](_0x5efff8)&&(_0xc38011['contenteditable']=!0x1),function(_0x150bf9,_0x4396d7,_0x63fe4e){const _0x1cd20e=_0x150bf9['createUIElement']('span',_0x4396d7);return _0x150bf9['setCustomProperty']('userPositionMarker',!0x0,_0x1cd20e),_0x1cd20e['render']=function(_0x4f25a8){const _0x18e49c=this['toDomElement'](_0x4f25a8),_0x3d3303=document['createElement']('span');return _0x3d3303['classList']['add']('ck-user__marker-tooltip'),_0x3d3303['setAttribute']('contenteditable','false'),_0x3d3303['setAttribute']('spellcheck','false'),_0x3d3303['textContent']=_0x63fe4e['name'],_0x18e49c['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x3d3303['outerHTML']+'⁠',_0x18e49c['addEventListener']('mouseenter',()=>{_0x18e49c['classList']['add']('ck-user__marker_hovered');}),_0x18e49c['addEventListener']('mouseleave',()=>{_0x18e49c['classList']['remove']('ck-user__marker_hovered');}),_0x18e49c;},_0x1cd20e['isSimilar']=function(_0x18d014){return!(!this['getCustomProperty']('userPositionMarker')||!_0x18d014['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x18d014['getAttribute']('data-session-id'));},_0x1cd20e;}(_0x3b7869,_0xc38011,_0xd3c0f9);}(_0x38ccc2,_0x1af9ea,_0xff3e91,_0x4d0d7e)}),_0x4d0d7e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x5f5b1b=>function(_0x56c5e0,_0x177fef){const _0x2859fe=_0x56c5e0['markerName']['split'](':')[0x2];if(_0x2859fe===_0x177fef['mySessionId'])return null;const _0x33c0f1=_0x177fef['getUserBySessionId'](_0x2859fe);if(!_0x33c0f1)return{'id':_0x2859fe,'classes':[]};return{'id':_0x2859fe,'classes':['ck-user__selection',_0x33c0f1['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x2859fe},'priority':0x7d0+_0x33c0f1['orderNumber']};}(_0x5f5b1b,_0xff3e91)}),function(_0x1c5e43){const _0x582f7c=_0x1c5e43['model'],_0x5a5388=new Map(),_0x307b98=_0x1c5e43['plugins']['get'](i);_0x582f7c['markers']['on']('update:user:range',(_0x382aca,_0x156b12,_0x3767db,_0x36be2f)=>{if(!_0x36be2f&&_0x5a5388['get'](_0x156b12['name']))return _0x5a5388['get'](_0x156b12['name'])['detach'](),void _0x5a5388['delete'](_0x156b12['name']);const _0x18afe7=_0x156b12['name']['split'](':')[0x2];if(_0x18afe7===_0x307b98['mySessionId'])return;const _0x2ff4d9='user:position:'+_0x18afe7;_0x582f7c['markers']['has'](_0x2ff4d9)&&_0x1c5e43['editing']['reconvertMarker'](_0x2ff4d9),_0x156b12['on']('change:range',(_0x20e157,_0x223cca,_0x15ae12)=>{if('$graveyard'!=_0x223cca['root']['rootName']&&'$graveyard'==_0x156b12['getRange']()['root']['rootName']&&!_0x5a5388['has'](_0x156b12['name'])){const _0x14bd92=_0x582f7c['schema']['getNearestSelectionRange'](_0x15ae12['deletionPosition']);if(_0x14bd92){const _0x1a501f=ht['fromRange'](_0x14bd92);_0x5a5388['set'](_0x156b12['name'],_0x1a501f),_0x1a501f['on']('change:range',(_0x28acd6,_0x5a7209,_0x3ef412)=>{if('$graveyard'==_0x1a501f['root']['rootName']){const _0x183233=_0x582f7c['schema']['getNearestSelectionRange'](_0x3ef412['deletionPosition']);_0x183233?(_0x1a501f['start']=_0x183233['start'],_0x1a501f['end']=_0x183233['end']):(_0x5a5388['delete'](_0x156b12['name']),_0x1a501f['detach']());}});}}});}),_0x582f7c['document']['on']('change',()=>{_0x5a5388['size']>0x0&&_0x582f7c['enqueueChange']({'isUndoable':!0x1},_0x37e516=>{for(const [_0x19d3b8,_0x42678c]of _0x5a5388)'$graveyard'==_0x582f7c['markers']['get'](_0x19d3b8)['getRange']()['root']['rootName']&&(te(_0x19d3b8['split'](':')[0x2],_0x42678c['toRange'](),_0x582f7c,_0x37e516),_0x42678c['detach']());_0x5a5388['clear']();});});}(_0x4d0d7e),this['_domEmitter']['listenTo'](_0x4366f0['document'],'keydown',(_0x58484d,{key:_0x5e116c})=>{'Escape'===_0x5e116c&&function(_0x3db62a){_0x3db62a['editing']['view']['change'](_0x161cb6=>{for(const _0x5c3b1f of _0x3db62a['model']['markers']){if(!_0x5c3b1f['name']['startsWith']('user:position'))continue;const _0xaedbbf=_0x3db62a['editing']['mapper']['markerNameToElements'](_0x5c3b1f['name']);if(_0xaedbbf){for(const _0x43dda8 of _0xaedbbf)_0x161cb6['removeClass']('ck-user__marker_hovered',_0x43dda8);}}});}(_0x4d0d7e);},{'useCapture':!0x0});}['afterInit'](){const _0x36e65f=this['editor'],_0x365bd8=_0x36e65f['commands']['get']('undo');_0x365bd8&&_0x36e65f['model']['on']('applyOperation',(_0x258eaa,_0x4b8315)=>{const _0x5114dd=_0x4b8315[0x0];if(!_0x5114dd['isDocumentOperation'])return;if('marker'!=_0x5114dd['type']||!_0x5114dd['name']['startsWith']('user:'))return;const _0x430401=_0x5114dd['batch'];_0x365bd8['_createdBatches']['has'](_0x430401)&&(_0x5114dd['newRange']=_0x5114dd['oldRange']?_0x36e65f['model']['createRange'](_0x5114dd['oldRange']['start'],_0x5114dd['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x8e831c=this['editor'],_0x4107d7=_0x8e831c['model']['document'],_0x115e6e=_0x8e831c['plugins']['get'](i);_0x8e831c['model']['enqueueChange']({'isUndoable':!0x1},_0x2505b2=>{const _0x4a00e9='user:range:'+_0x115e6e['mySessionId'],_0xebf53c='user:position:'+_0x115e6e['mySessionId'],_0x506f94=_0x8e831c['model']['markers']['has'](_0x4a00e9);_0x8e831c['editing']['view']['hasDomSelection']?te(_0x115e6e['mySessionId'],_0x4107d7['selection']['getFirstRange'](),_0x8e831c['model'],_0x2505b2):_0x506f94&&(_0x2505b2['removeMarker'](_0x4a00e9),_0x2505b2['removeMarker'](_0xebf53c));});}}function te(_0x4f15c6,_0x50fbe9,_0x211c28,_0x11f045){const _0x5edd7e='user:range:'+_0x4f15c6,_0x5aed46='user:position:'+_0x4f15c6,_0x536d45=_0x50fbe9['getContainedElement']();let _0xd0b1d=_0x50fbe9['start'];if(_0x536d45&&_0x536d45['is']('element','tableCell')){const _0x13d82b=function(_0x5bcebf,_0x4bc03f){for(const _0x937850 of _0x5bcebf['getPositions']())if(_0x4bc03f['schema']['checkChild'](_0x937850,'$text'))return _0x937850;}(_0x50fbe9,_0x211c28);_0x13d82b&&(_0xd0b1d=_0x13d82b,_0x50fbe9=_0x11f045['createRange'](_0xd0b1d));}const _0x16cffd=_0x11f045['createRange'](_0xd0b1d);_0x211c28['markers']['has'](_0x5edd7e)?(_0x11f045['updateMarker'](_0x5edd7e,{'range':_0x50fbe9}),_0x11f045['updateMarker'](_0x5aed46,{'range':_0x16cffd})):(_0x11f045['addMarker'](_0x5edd7e,{'range':_0x50fbe9,'usingOperation':!0x0}),_0x11f045['addMarker'](_0x5aed46,{'range':_0x16cffd,'usingOperation':!0x0}));}function G(_0x8411e5,_0x282679,_0xf183f3){const _0x4b8929=_0x8411e5['t'],t=_0x8411e5['t'];switch(_0x282679){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 _0x4b8929({'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'},_0xf183f3);default:return'';}}let J=0x1;class l extends _0xdcbc50{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x4f847e)());['_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,_0x352a17,_0x2aaab9,_0xc034f2];}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 _0x315b37=this['serverHistory']['getOperations']();for(let _0xba6ebe=_0x315b37['length']-0x1;_0xba6ebe>=0x0;_0xba6ebe--){const _0x4bb05b=_0x315b37[_0xba6ebe];if(!this['_disconnectionOperations']['has'](_0x4bb05b))return _0x4bb05b['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x5c7834){if(super(_0x5c7834),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x241be6(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x19d29c('collaboration-missing-channelid',this);const _0x54e674=_0x5c7834['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x54e674,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x2e6a41(),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 _0x4d3f45=this['editor'],_0x4194b1=_0x4d3f45['plugins']['get'](_0x2aaab9),_0x4b0779=_0x4d3f45['plugins']['get'](c);this['listenTo'](_0x4194b1,'getOperationAuthor',(_0x3f2a60,_0x5e3ab2)=>{const _0x5ee973=_0x5e3ab2[0x0];_0x5ee973['_authorId']&&(_0x3f2a60['return']=_0x4194b1['getUser'](_0x5ee973['_authorId']),_0x3f2a60['stop']()),null===_0x5ee973['_authorId']&&(_0x3f2a60['return']=null,_0x3f2a60['stop']());},{'priority':'high'}),this['listenTo'](_0x4d3f45['model']['document']['selection'],'change:range',(_0x2beb2f,_0x3417d0)=>{_0x3417d0['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x4d3f45['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x4d3f45['model']['on']('applyOperation',(_0x3347e4,_0x2989fb)=>{const _0x12b350=_0x2989fb[0x0];_0x12b350['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x12b350),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x4b0779,'state',this,'_hasSynchronizationProblem',(_0x21747d,_0x1f21f3)=>'connected'===_0x21747d&&!_0x1f21f3),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x4d3f45['disableReadOnlyMode']('rtc-offline'):_0x4d3f45['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x4d3f45['disableReadOnlyMode']('rtc-offline'):_0x4d3f45['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x3f243e=this['editor']['plugins']['get'](i),_0x528cb4=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x3f243e['unregister'](this['_channelId']);const _0x4704ad=await this['_service']['reconnect'](_0x528cb4['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x4704ad)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x554546=await this['_service']['getConnectedSessions']();_0x3f243e['register'](this['_channelId'],_0x554546),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x5b8d22){if(function(_0x18618b){return'404'===_0x18618b['code'];}(_0x5b8d22)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x34d2fa){return'409'===_0x34d2fa['code'];}(_0x5b8d22)){const _0x39a5fd=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'](_0x39a5fd);}else{if(!(_0x5b8d22 instanceof Q))throw _0x5b8d22;this['_handleReconnectionError']();}}}}['destroy'](){const _0x33eb60=this['editor']['plugins']['get'](c),_0x387f81=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x387f81['channelSessions']['has'](this['_channelId'])&&_0x387f81['unregister'](this['_channelId']),_0x33eb60['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x5df39e){if(this['sessionId']!==_0x5df39e['sessionId']&&this['_lastSyncedOperationId']!==_0x5df39e['lastOperationId'])throw new Q();return this['sessionId']=_0x5df39e['sessionId'],this['_handleServerResponse']([],{..._0x5df39e,'wereChangesApplied':!0x1,'data':_0x5df39e['data']},'reconnect');}async['_connectService'](_0x30feaa,_0x4dea60=!0x1){const {connection:_0x275bb8}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x275bb8,this['_channelId'])['then'](_0x16b045=>this['_initSessionsHandling'](_0x16b045))['catch'](_0x5aee6c=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x5aee6c);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x572b90,_0x408165)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x408165);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x2e9dbb=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x30feaa);this['_isPendingUpdate']=!0x0;const _0x31d791=await this['_service']['connect'](_0x275bb8,this['_compressOperations'](_0x30feaa),_0x2e9dbb);if(this['sessionId']=_0x31d791['sessionId'],_0x4dea60){if(!_0x31d791['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x31d791['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x30feaa,_0x31d791,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x31d791,_0x30feaa);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x177a19=this['editor']['plugins']['get'](i),_0x3fee87=this['editor']['plugins']['get'](q),_0x19ad16=_0x177a19['channelSessions']['get'](this['_channelId']);_0x19ad16&&_0x19ad16['length']>0x1?_0x3fee87['createUserMarkerOperations']():this['listenTo'](_0x177a19,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x177a19['channelSessions']['get'](this['_channelId'])['length']&&_0x3fee87['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x242fb6,_0x37e39b,_0x2be766,_0x4c397b){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x37e39b){const _0x3ecd26=this['_decompressOperations'](_0x2be766,_0x4c397b);await this['_fetchMissingUsers'](_0x3ecd26),this['_handleExternalOperations'](_0x3ecd26,_0x37e39b,_0x2be766['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x97eb67}=this['editor'];let _0x1e0a1d;try{_0x1e0a1d=await this['_service']['getDocumentDetails']();}catch{const _0xb18869=G(_0x97eb67,'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'](_0xb18869);}const _0x502736=_0x1e0a1d['currentDocumentSession']||_0x1e0a1d['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x502736['lastOperationId']){const _0x2f6287=G(_0x97eb67,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x2f6287);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x452e66){const _0x432a64=this['editor']['plugins']['get'](i);this['listenTo'](_0x432a64,'sessionAdd:'+this['_channelId'],(_0x39d590,{session:_0x15db25})=>{if(_0x15db25['id']===_0x432a64['mySessionId']){_0x39d590['off']();const _0x41a0bf=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x33f39e=_0x15db25['permissions'];_0x41a0bf&&_0x41a0bf['isEnabled']&&(_0x33f39e=_0x33f39e['filter'](_0x4fef0c=>'document:write'!==_0x4fef0c)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x33f39e,this['_channelId']);}}),_0x432a64['register'](this['_channelId'],_0x452e66);}['_initThrowingOnDataSet'](){const _0x16c9dc=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x3242a4)=>{if(!_0x3242a4[_0x3242a4['length']-0x1]['suppressErrorInCollaboration'])throw new _0x19d29c('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x16c9dc['apply'](this['editor']['data'],_0x3242a4);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4382d2,[_0x5b2113])=>{if(this['_document']['version'])throw new _0x19d29c('realtimecollaborationclient-init-document-already-initialized',this);_0x4382d2['stop'](),this['_setPendingAction']();const _0x17ac41=this['editor']['config']['get']('rootsAttributes'),_0x318746=this['_getOperationsFromInitData'](_0x5b2113,_0x17ac41);0x0==_0x318746['length']&&_0x318746['push'](new _0x27ade8(0x0)),_0x4382d2['return']=this['_connectService'](_0x318746)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x23fcff=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x23fcff))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x40cf36,[_0x2bbeec,_0x278870])=>{_0x40cf36['stop']();const _0x220e08=this['editor']['model']['document']['getRoot'](_0x2bbeec);if(!this['_knownRootNames']['has'](_0x2bbeec)){const _0x5457df=_0x278870&&_0x278870['data']?_0x278870['data']:'',_0x55fad4=_0x278870&&_0x278870['attributes']?_0x278870['attributes']:{};await this['_loadRoot'](_0x2bbeec,_0x5457df,_0x55fad4);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x220e08['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x220e08);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x440f0d){const _0x19fb08=this['editor']['plugins']['get'](_0x2aaab9),{connection:_0x3022f1}=this['editor']['plugins']['get'](c),_0x2c4fcd=new Set();for(const _0x16648c of _0x440f0d){const _0x13daf1=_0x16648c['_authorId'];_0x13daf1&&!_0x19fb08['getUser'](_0x13daf1)&&_0x2c4fcd['add'](_0x13daf1);}if(0x0===_0x2c4fcd['size'])return;const _0x4d56fb=await dt['getMany'](_0x3022f1,Array['from'](_0x2c4fcd));for(const _0x4933d4 of _0x4d56fb)_0x19fb08['getUser'](_0x4933d4['id'])||_0x19fb08['addUser'](_0x4933d4);}['_getOperationsFromInitData'](_0xfeefc2,_0x34450a={}){const _0x4b0352=this['editor']['model'],_0x5cf809=[];let _0x37680e=0x0;const _0x25cc6c='string'==typeof _0xfeefc2?{'main':_0xfeefc2}:_0xfeefc2;for(const _0x47cc1d of Object['keys'](_0x25cc6c)){if(!this['_document']['roots']['has'](_0x47cc1d))throw new _0x19d29c('realtimecollaborationclient-init-non-existent-root',this);const _0x17ee4d=this['editor']['data']['parse'](_0x25cc6c[_0x47cc1d]),_0x51e8cd=this['_document']['getRoot'](_0x47cc1d),_0x399a38=new _0x4955f3(_0x4b0352['createPositionAt'](_0x51e8cd,0x0),_0x17ee4d,_0x37680e++);_0x5cf809['push'](_0x399a38);for(const [_0x33d163,_0x699fd6]of _0x17ee4d['markers']){const _0x5802b0=_0x4b0352['createRange'](_0x4b0352['createPositionFromPath'](_0x51e8cd,_0x699fd6['start']['path']['slice']()),_0x4b0352['createPositionFromPath'](_0x51e8cd,_0x699fd6['end']['path']['slice']())),_0x2e5728=new _0x455320(_0x33d163,null,_0x5802b0,_0x4b0352['markers'],!0x0,_0x37680e++);_0x5cf809['push'](_0x2e5728);}}if(_0x34450a)for(const [_0xe16a9f,_0x26e589]of Object['entries'](_0x34450a)){const _0x347668=_0x4b0352['document']['getRoot'](_0xe16a9f);if(!_0x347668)throw new _0x19d29c('multi-root-editor-root-attributes-no-root',null);for(const [_0x4379df,_0x35a01f]of Object['entries'](_0x26e589))if(null!==_0x35a01f){const _0x448df7=new _0x15eb0d(_0x347668,_0x4379df,null,_0x35a01f,_0x37680e++);_0x5cf809['push'](_0x448df7);}}return _0x5cf809;}async['_loadRoot'](_0x181ef8,_0x6d4080,_0x2dab9a){this['_getOperationsFromInitData']({[_0x181ef8]:_0x6d4080},{[_0x181ef8]:_0x2dab9a})['forEach']((_0x2839d5,_0x3b7991)=>{_0x2839d5['baseVersion']=this['_document']['version']+_0x3b7991,_0x2839d5['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2839d5);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x2515cf,_0x39ea31){let _0x1f7eff;this['_offset']=_0x2515cf['offset'];const _0x514774=_0x2515cf['wereChangesApplied']&&!_0x2515cf['initData'],_0x20028b=_0x514774?0x0:_0x2515cf['data']['baseVersion'];if(_0x39ea31['forEach'](_0x37bac7=>{_0x37bac7['_isInit']=!0x0,_0x37bac7['createdAt']=_0x2515cf['sessionCreatedAt'],_0x37bac7['_authorId']=null;}),_0x514774)_0x1f7eff=_0x39ea31,this['_applyOperationsSet'](_0x1f7eff,_0x514774);else{if(_0x2515cf['initData']){const _0x4cceb4=this['_getOperationsFromInitData'](_0x2515cf['initData']);this['_document']['history']['version']=-_0x4cceb4['length'],_0x4cceb4['forEach'](_0x2661ad=>{_0x2661ad['baseVersion']-=_0x4cceb4['length'],_0x2661ad['createdAt']=_0x2515cf['sessionCreatedAt'],_0x2661ad['_isInit']=!0x0,_0x2661ad['_authorId']=null;}),this['_applyOperationsSet'](_0x4cceb4,!0x0),this['serverHistory']['version']=-_0x4cceb4['length']+this['_offset'],this['_updateServerHistory'](_0x4cceb4);}this['_document']['history']['version']=_0x20028b,_0x1f7eff=this['_decompressOperations'](_0x2515cf['data'],_0x2515cf['metadata']),await this['_fetchMissingUsers'](_0x1f7eff),this['_applyOperationsSet'](_0x1f7eff,_0x514774);}_0x2515cf['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1f7eff,_0x2515cf['lastOperationId']),this['_lastSyncedOperationId']=_0x2515cf['lastOperationId']),this['serverHistory']['version']=_0x20028b+this['_offset'],this['_updateServerHistory'](_0x1f7eff),_0x39ea31['filter'](_0x476f82=>{const _0x78ca8=this['_getAffectedRoot'](_0x476f82);return _0x78ca8&&!this['_knownRootNames']['has'](_0x78ca8);})['forEach']((_0x16ed26,_0x20df46)=>{_0x16ed26['baseVersion']=this['_document']['version']+_0x20df46,this['_saveOperationInBuffer'](_0x16ed26);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x9c60be,_0x1419b4){const _0x156715=_0x1419b4&&_0x1419b4['message'];if(_0x156715&&_0x156715['startsWith']('realtimecollaborationclient'))throw _0x1419b4;const _0x59b8fe=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x59b8fe['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x19d29c(_0x9c60be,this['editor'],_0x156715?{'originalError':_0x156715}:void 0x0);}['_saveOperationInBuffer'](_0x4e01aa){this['_knownOperations']['has'](_0x4e01aa)||(this['_knownOperations']['add'](_0x4e01aa),this['_bufferedOperations']['push'](_0x4e01aa),this['_pendingAction']||'marker'==_0x4e01aa['type']&&!_0x4e01aa['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x21e289=!0x1){!_0x21e289&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x5d707d=>{_0x5d707d&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x519b19=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x53bc72){return _0x53bc72['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x53bc72['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x53bc72['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x519b19)||this['_crash'](_0x519b19['message'],_0x519b19);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x872ae2=>{this['on']('change:_isPendingUpdate',()=>{_0x872ae2();});});}async['_sendBufferedOperations'](){const _0x1d153f=this['editor']['plugins']['get'](q);if(this['_shouldSendSelectionUpdate']()&&(_0x1d153f['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x346530=[...this['_bufferedOperations']];for(const _0x55ea5b of _0x346530)_0x55ea5b['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x55ea5b);const _0x4ace40=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x346530),_0x52572a=J++,_0x369125=this['_compressOperations'](_0x346530),_0x3beaf2=await this['_service']['sendOperations'](_0x369125,_0x369125['baseVersion'],_0x4ace40);try{return await this['_handleServerResponse'](_0x346530,_0x3beaf2,_0x52572a);}catch(_0x5c06e0){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x5c06e0);}}async['_handleServerResponse'](_0x1fcb44,_0x559830,_0xb52e61){if('error'in _0x559830)throw _0x559830['error'];let _0x4a0e37=!0x1;if(_0x559830['wereChangesApplied']){_0x559830['lastOperationId']&&(this['_lastSyncedOperationId']=_0x559830['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x48b97e=>!_0x1fcb44['includes'](_0x48b97e));for(const _0x1dbf02 of _0x1fcb44)_0x1dbf02['createdAt']='lastOperationAcceptedAt'in _0x559830&&_0x559830['lastOperationAcceptedAt']||void 0x0;X(_0x1fcb44,_0x559830['version']-_0x1fcb44['length']),this['_updateServerHistory'](_0x1fcb44);const _0x104b50=_0x1fcb44['filter'](_0x5a364c=>{if(!_0x5a364c['_isInit'])return!0x1;const _0x2ddd23=this['_getAffectedRoot'](_0x5a364c);return _0x2ddd23&&!this['_knownRootNames']['has'](_0x2ddd23);});X(_0x104b50,this['_document']['version']),this['_applyOperationsSet'](_0x104b50),_0x4a0e37=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x468c25=this['_decompressOperations'](_0x559830['data'],_0x559830['metadata'])['filter'](_0x260054=>_0x260054['baseVersion']>=this['_lastServerVersion']);_0x468c25['forEach'](_0x38932e=>this['_addKnownRoot'](_0x38932e)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x35f5f6=>!_0x35f5f6['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x35f5f6))),this['_bufferedOperations']['length']&&X(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x468c25),_0x4a0e37=this['_handleExternalOperations'](_0x468c25,_0x559830['version'],_0x559830['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x4a0e37?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x132e86,_0x2e3514,_0x412ca2){try{const _0x235c7f={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4dec66,operationsB:_0x49a823,originalOperations:_0x49a85}=_0x401905(_0x132e86,this['_bufferedOperations'],_0x235c7f);X(_0x4dec66,this['_document']['version']),X(_0x49a823,_0x2e3514);for(const _0x271fed of _0x4dec66){const _0x3e8b50=_0x49a85['get'](_0x271fed);_0x271fed['_authorId']=_0x3e8b50?_0x3e8b50['_authorId']:null;}_0x412ca2&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x132e86,_0x412ca2),this['_lastSyncedOperationId']=_0x412ca2),this['_bufferedOperations']=[..._0x49a823],this['_applyOperationsSet'](_0x4dec66),this['_updateServerHistory'](_0x132e86);}catch(_0x57d8c2){return console['error'](_0x57d8c2),!0x1;}return!0x0;}['_applyOperationsSet'](_0x5c7d8c,_0x4f365a=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x134212=>{for(const _0x5565ae of _0x5c7d8c)this['_knownOperations']['add'](_0x5565ae),this['_addKnownRoot'](_0x5565ae),_0x134212['batch']['addOperation'](_0x5565ae),this['editor']['model']['applyOperation'](_0x5565ae);});}['_addKnownRoot'](_0x4a7ede){const _0xd5bead=this['_getAffectedRoot'](_0x4a7ede);_0xd5bead&&this['_knownRootNames']['add'](_0xd5bead);}['_getAffectedRoot'](_0x196360){let _0x1b6f52,_0x3c8f9c;switch(_0x196360['type']){case'insert':_0x1b6f52=_0x196360['position']['root'];break;case'marker':if(_0x3c8f9c=_0x196360['newRange'],!_0x3c8f9c)return null;_0x1b6f52=_0x3c8f9c['root'];break;case'addRootAttribute':_0x1b6f52=_0x196360['root'];break;case'addRoot':_0x1b6f52=_0x196360['affectedSelectable'];break;case'move':_0x1b6f52=_0x196360['targetPosition']['root'];break;default:return null;}return _0x1b6f52['rootName'];}['_updateServerHistory'](_0x5da47c){_0x5da47c['forEach'](_0xe943b1=>{const _0x13a25a=_0xe943b1['clone']();_0x13a25a['_authorId']=_0xe943b1['_authorId'],_0x13a25a['_isInit']=!!_0xe943b1['_isInit'],_0x13a25a['createdAt']=_0xe943b1['createdAt'],_0x13a25a['baseVersion']+=this['_offset'],_0xe943b1['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x13a25a),this['serverHistory']['addOperation'](_0x13a25a);});}['_handleReconnectionError'](_0x53978d){const _0x5982c8=this['editor']['plugins']['get']('Notification'),_0x13d08d=this['editor']['locale'];_0x53978d||(_0x53978d=G(_0x13d08d,'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.')),_0x5982c8['showWarning'](_0x53978d,{'title':G(_0x13d08d,'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'](_0x352a17)['add'](G(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x352a17)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x435096){const _0x11f008=_0x435096['map'](_0x4cb939=>_0x4cb939['toJSON']());return this['_compressor']['compress'](_0x11f008);}['_decompressOperations'](_0x43a4e6,_0xad23d8){return this['_compressor']['decompress'](_0x43a4e6)['map']((_0x4c8c15,_0x1f4947)=>{const _0x47035e='init'==_0xad23d8[_0x1f4947]['type'];if('InsertOperation'==_0x4c8c15['__className']){const _0x510439=_0x4c8c15['position']['root'];!this['_document']['getRoot'](_0x510439)&&(this['_document']['createRoot']('$root',_0x510439)['_isAttached']=!0x1);}const _0x4ed1ba=_0xdb4121['fromJSON'](_0x4c8c15,this['_document']);return _0x4ed1ba['wasUndone']=_0x4c8c15['wasUndone'],_0x4ed1ba['_isInit']=_0x47035e,_0x4ed1ba['_authorId']=_0x47035e?null:_0xad23d8[_0x1f4947]['userId'],_0x4ed1ba['_isDisconnection']='cs:removeUser'===_0xad23d8[_0x1f4947]['type'],_0x4ed1ba['createdAt']=_0xad23d8[_0x1f4947]['createdAt'],_0x4ed1ba;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x3f25fb=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x3f25fb&&_0x3f25fb['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Q extends Error{}function X(_0x13819a,_0x294514){for(const _0x4bbda1 of _0x13819a)_0x4bbda1['baseVersion']=_0x294514++;}class Y{['_ignoredOperations'];['_operationToId'];constructor(_0x5dab86){this['_ignoredOperations']=_0x5dab86,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x1ce2e2){let _0x391c84=_0x1ce2e2['length'];for(;_0x391c84--;){const _0x473997=_0x1ce2e2[_0x391c84];if(!this['_ignoredOperations']['has'](_0x473997)){if(!this['_operationToId']['has'](_0x473997)){const _0x14ce74=_0x53029c()['slice'](0x1,0x12);this['_operationToId']['set'](_0x473997,_0x14ce74);}return this['_operationToId']['get'](_0x473997);}}}['setIdForTheLastOperation'](_0x32e42d,_0x31a0d6){if(!_0x31a0d6)return;let _0x4334cf=_0x32e42d['length'];for(;_0x4334cf--;){const _0x2e93a0=_0x32e42d[_0x4334cf];this['_ignoredOperations']['has'](_0x2e93a0)||this['_operationToId']['set'](_0x2e93a0,_0x31a0d6);}}}class n extends _0xdcbc50{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x3f68a4{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x360da2)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x2aaab9];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x360e72){super(_0x360e72),this['_services']=new Map();}async['init'](){const _0x39b43b=this['context'],_0x1f0951=_0x39b43b['plugins']['get']('CommentsRepository');if(_0x39b43b['plugins']['get'](c)['addToReconnectionStack'](this),_0x1f0951['adapter']={'addCommentThread':async({channelId:_0x18d894,threadId:_0x5b8e26,comments:_0x33b269,resolvedAt:_0x1c86db,resolvedBy:_0x4d0c1c,context:_0x487c48,attributes:_0x2bc87e})=>{const _0x2b265f=await this['_getService'](_0x18d894)['addCommentThread']({'commentThreadId':_0x5b8e26,'comments':_0x33b269['map'](_0x5449d3=>function(_0x299906,_0x13634b,_0x29abe9){return{'commentThreadId':_0x29abe9,'commentId':_0x299906['commentId'],'userId':_0x299906['authorId'],'content':_0x299906['content'],'documentId':_0x13634b,'createdAt':_0x299906['createdAt'],'attributes':_0x299906['attributes']||{}};}(_0x5449d3,_0x18d894,_0x5b8e26)),'resolvedAt':_0x1c86db,'resolvedBy':_0x4d0c1c,'context':_0x487c48,'attributes':_0x2bc87e})['catch'](ut);return{'threadId':_0x2b265f['commentThreadId'],'comments':_0x2b265f['comments']};},'getCommentThread':async({channelId:_0x28e0a2,threadId:_0x13504e})=>{const _0x1a89ad=await this['_getService'](_0x28e0a2)['getCommentThread'](_0x13504e)['catch'](ut);return _0x1a89ad['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x1a89ad]),{'threadId':_0x1a89ad['commentThreadId'],'comments':_0x1a89ad['comments']['map'](_),'context':_0x1a89ad['context'],'resolvedAt':_0x1a89ad['resolvedAt'],'resolvedBy':_0x1a89ad['resolvedBy'],'attributes':_0x1a89ad['attributes']||{}});},'updateCommentThread':async({channelId:_0x2475f1,threadId:_0x36f33d,context:_0x329896,unlinkedAt:_0x4d7c0e,attributes:_0x11b163})=>this['_getService'](_0x2475f1)['updateCommentThread']({'commentThreadId':_0x36f33d,'context':_0x329896,'attributes':_0x11b163,'unlinkedAt':_0x4d7c0e})['catch'](S)['catch'](ut),'resolveCommentThread':async({channelId:_0x322aaf,threadId:_0x135409})=>{const _0x1babf0=await this['_getService'](_0x322aaf)['resolveCommentThread'](_0x135409)['catch'](S)['catch'](ut);return{'threadId':_0x1babf0['commentThreadId'],'resolvedAt':_0x1babf0['resolvedAt'],'resolvedBy':_0x1babf0['resolvedBy']};},'reopenCommentThread':async({channelId:_0x18ac7b,threadId:_0x2725a0})=>this['_getService'](_0x18ac7b)['reopenCommentThread'](_0x2725a0)['catch'](S)['catch'](ut),'removeCommentThread':({channelId:_0x5a39f0,threadId:_0x21001a})=>this['_getService'](_0x5a39f0)['removeCommentThread'](_0x21001a)['catch'](S)['catch'](ut),'addComment':({channelId:_0x5d2aea,threadId:_0x138469,commentId:_0x548241,content:_0x2dcab0,attributes:_0x52a635})=>this['_getService'](_0x5d2aea)['addComment'](_0x138469,_0x548241,_0x2dcab0,_0x52a635)['catch'](ut),'updateComment':({channelId:_0x463bb2,threadId:_0x55ba91,commentId:_0x26a2a8,content:_0x3609d6,attributes:_0xa0351d})=>this['_getService'](_0x463bb2)['updateComment'](_0x55ba91,_0x26a2a8,_0x3609d6,_0xa0351d)['catch'](S)['catch'](ut),'removeComment':({channelId:_0xf881e1,threadId:_0x15f936,commentId:_0x380439})=>this['_getService'](_0xf881e1)['removeComment'](_0x15f936,_0x380439)['catch'](S)['catch'](ut)},_0x39b43b instanceof _0x51b985){const _0xd8b47c=_0x39b43b['config']['get']('collaboration.channelId'),_0x23f506=_0x39b43b['plugins']['get'](i);await this['_setUpService'](_0xd8b47c);const _0x963752=await this['_services']['get'](_0xd8b47c)['getConnectedSessions']();this['listenTo'](_0x23f506,'sessionAdd:'+_0xd8b47c,(_0xab493d,{session:_0x2347f0})=>{_0x2347f0['id']===_0x23f506['mySessionId']&&(_0xab493d['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2347f0['permissions'],_0xd8b47c));}),_0x23f506['register'](_0xd8b47c,_0x963752);}}async['_setUpService'](_0x28c2c5){if(this['_services']['has'](_0x28c2c5))throw new _0x19d29c('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x28c2c5});const _0x464d9e=this['context']['plugins']['get']('CommentsRepository'),_0x32490d=new a['CommentsService'](_0x28c2c5);this['_services']['set'](_0x28c2c5,_0x32490d),this['listenTo'](_0x32490d,'commentThreadAdded',(_0x1d7274,_0x5a0e76)=>{const {commentThreadId:_0x114208,documentId:_0x437ec5,context:_0x17617b,attributes:_0x2b331c,resolvedAt:_0x15fb94,resolvedBy:_0x4f67c9,comments:_0x1fd78f}=_0x5a0e76;_0x464d9e['getCommentThread'](_0x114208)||_0x464d9e['addCommentThread']({'threadId':_0x114208,'channelId':_0x437ec5,'comments':_0x1fd78f?_0x1fd78f['map'](_):[],'context':_0x17617b,'attributes':_0x2b331c,'resolvedAt':_0x15fb94,'resolvedBy':_0x4f67c9,'isFromAdapter':!0x0});}),this['listenTo'](_0x32490d,'commentThreadUpdated',(_0x3060b8,{commentThreadId:_0x488a61,documentId:_0x33d771,context:_0x62b15,unlinkedAt:_0xdc1f74,attributes:_0x216f3e})=>{_0x464d9e['getCommentThread'](_0x488a61)&&_0x464d9e['updateCommentThread']({'threadId':_0x488a61,'channelId':_0x33d771,'context':_0x62b15,'unlinkedAt':_0xdc1f74,'attributes':_0x216f3e,'isFromAdapter':!0x0});}),this['listenTo'](_0x32490d,'commentThreadResolved',(_0xcf65a9,{commentThreadId:_0x125ca9,resolvedBy:_0x54c59e,resolvedAt:_0x235edf})=>{const _0x11b240=_0x464d9e['getCommentThread'](_0x125ca9);_0x11b240&&_0x11b240['resolve']({'resolvedBy':_0x54c59e,'resolvedAt':_0x235edf,'isFromAdapter':!0x0});}),this['listenTo'](_0x32490d,'commentThreadReopened',(_0x227cb0,{commentThreadId:_0x426e6f})=>{const _0x409980=_0x464d9e['getCommentThread'](_0x426e6f);_0x409980&&_0x409980['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x32490d,'commentThreadRemoved',(_0x4a0f79,{commentThreadId:_0x2d3b44})=>{const _0x4c49fd=_0x464d9e['getCommentThread'](_0x2d3b44);_0x4c49fd&&_0x4c49fd['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x32490d,'commentAdded',(_0x53c03b,_0xbbb89f)=>{const _0x30a984=_0xbbb89f['commentThreadId'],_0x21c5a8=_0x464d9e['getCommentThread'](_0x30a984);_0x21c5a8&&_0x21c5a8['addComment']({..._(_0xbbb89f),'isFromAdapter':!0x0});}),this['listenTo'](_0x32490d,'commentUpdated',(_0x4dfc8a,{commentThreadId:_0x5714e1,commentId:_0x3a6bb3,content:_0x3d3e80,attributes:_0x2d4c08})=>{const _0x453630=_0x464d9e['getCommentThread'](_0x5714e1);if(_0x453630){const _0x42e5f6=_0x453630['getComment'](_0x3a6bb3);_0x42e5f6&&_0x42e5f6['update']({'content':_0x3d3e80,'attributes':_0x2d4c08,'isFromAdapter':!0x0});}}),this['listenTo'](_0x32490d,'commentRemoved',(_0x369884,{commentThreadId:_0x4f27f3,commentId:_0x26b442})=>{const _0x25ff28=_0x464d9e['getCommentThread'](_0x4f27f3);if(_0x25ff28){const _0x81a53e=_0x25ff28['getComment'](_0x26b442);_0x81a53e&&_0x81a53e['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x28c2c5);}['destroy'](){if(this['context']instanceof _0x51b985){const _0x108050=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x108050);}}['_terminateService'](_0x5b614b){if(!this['_services']['has'](_0x5b614b))throw new _0x19d29c('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x5b614b});this['_getService'](_0x5b614b)['disconnect'](),this['_services']['delete'](_0x5b614b);}async['reconnect'](){for(const _0x3cb99c of this['_services']['keys']())await this['_connectService'](_0x3cb99c);if(this['context']instanceof _0x51b985){const _0x5dcd31=this['context']['config']['get']('collaboration.channelId'),_0x17de4f=this['context']['plugins']['get'](i);_0x17de4f['unregister'](_0x5dcd31);const _0x11d9d4=await this['_services']['get'](_0x5dcd31)['getConnectedSessions']();_0x17de4f['register'](_0x5dcd31,_0x11d9d4);}}async['_connectService'](_0x1ff709){const {connection:_0x763018}=this['context']['plugins']['get'](c),_0x641f5c=this['context']['plugins']['get']('CommentsRepository'),_0x29a3a7=this['_services']['get'](_0x1ff709),_0x54cbed=await _0x29a3a7['connect'](_0x763018);await this['_fetchMissingUsersForThreads'](_0x54cbed);const _0x4ebbf4=new Set(Array['from'](_0x641f5c['getCommentThreads']({'channelId':_0x1ff709}),_0x3845d8=>_0x3845d8['id']));for(const _0x3523e2 of _0x54cbed)_0x3523e2['deletedAt']||_0x4ebbf4['delete'](_0x3523e2['commentThreadId']);for(const _0x21624b of _0x4ebbf4)_0x641f5c['getCommentThread'](_0x21624b)['remove']({'isFromAdapter':!0x0});for(const _0x2dba35 of _0x54cbed){let _0x4267e3=_0x641f5c['getCommentThread'](_0x2dba35['commentThreadId']);const {commentThreadId:_0xe8eb61,context:_0x2b779a,attributes:_0x125e17,resolvedBy:_0x3ae955,resolvedAt:_0x4d52c7,unlinkedAt:_0x5fe59b,deletedAt:_0x104af3}=_0x2dba35;if(_0x104af3)continue;_0x4267e3||(_0x4267e3=_0x641f5c['addCommentThread']({'channelId':_0x1ff709,'threadId':_0xe8eb61,'context':_0x2b779a,'attributes':_0x125e17||{},'resolvedBy':_0x3ae955,'resolvedAt':_0x4d52c7,'unlinkedAt':_0x5fe59b,'isFromAdapter':!0x0}));const _0x263570=new Set(Array['from'](_0x4267e3['comments'],_0x41cba0=>_0x41cba0['id']));for(const _0x4196f1 of _0x2dba35['comments'])_0x263570['delete'](_0x4196f1['commentId']);for(const _0x5da7e1 of _0x263570)_0x4267e3['getComment'](_0x5da7e1)['remove']({'isFromAdapter':!0x0});for(const _0x28b245 of _0x2dba35['comments']){const _0x1d690d=_0x4267e3['getComment'](_0x28b245['commentId']);_0x1d690d?_0x1d690d['content']!==_0x28b245['content']&&_0x1d690d['update']({'content':_0x28b245['content'],'isFromAdapter':!0x0}):_0x4267e3['addComment'](Object['assign'](_(_0x28b245),{'isFromAdapter':!0x0}));}}}['_getService'](_0x9f7bd0){if(!this['_services']['has'](_0x9f7bd0))throw new _0x19d29c('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x9f7bd0});return this['_services']['get'](_0x9f7bd0);}async['_fetchMissingUsersForThreads'](_0x5d45a3){const _0x135367=this['context']['plugins']['get'](_0x2aaab9),{connection:_0xa89817}=this['context']['plugins']['get'](c),_0x18dd78=new Set();for(const {resolvedBy:_0x172d45,comments:_0x49abcf}of _0x5d45a3){_0x172d45&&!_0x135367['getUser'](_0x172d45)&&_0x18dd78['add'](_0x172d45);for(const {userId:_0x3b95b5}of _0x49abcf)_0x135367['getUser'](_0x3b95b5)||_0x18dd78['add'](_0x3b95b5);}if(0x0===_0x18dd78['size'])return;const _0x6cb33=await dt['getMany'](_0xa89817,Array['from'](_0x18dd78));for(const _0x109f9c of _0x6cb33)_0x135367['getUser'](_0x109f9c['id'])||_0x135367['addUser'](_0x109f9c);}}async function S(_0x2513ba){if('404'!==_0x2513ba['code'])throw _0x2513ba;}function ut(_0x5183d4){if((_0x2c1b85=_0x5183d4)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2c1b85['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2c1b85['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2c1b85;throw _0x5183d4;}function _(_0x4a7900){return{'threadId':_0x4a7900['commentThreadId'],'commentId':_0x4a7900['commentId'],'content':_0x4a7900['content'],'createdAt':_0x4a7900['createdAt'],'authorId':_0x4a7900['userId'],'attributes':_0x4a7900['attributes']||{}};}class f extends _0xdcbc50{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(_0x39e4ec){super(_0x39e4ec);const _0x11cd5b=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x11cd5b);}['init'](){const _0x462989=this['editor']['plugins']['get'](c),_0x2ca589=this['editor']['plugins']['get']('TrackChangesEditing');return _0x2ca589['adapter']={'getSuggestion':async _0x31f5db=>{await this['_waitForServiceReady']();const _0x305056=await this['_trackChangesService']['get'](_0x31f5db)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x305056]),_0x305056;},'addSuggestion':async({id:_0x519acd,type:_0x1204e3,data:_0xb907b1,originalSuggestionId:_0x517721,attributes:_0x456165})=>{await this['_waitForServiceReady']();const _0xf2a66b={'id':_0x519acd,'type':_0x1204e3,'data':_0xb907b1,'originalSuggestionId':_0x517721,'attributes':_0x456165},_0x4fc642=await this['_trackChangesService']['add'](_0x519acd,_0x1204e3,_0xb907b1,_0x517721,_0x456165)['catch'](_0x2f41cf=>{if(ft(_0x2f41cf))return new Promise(_0x4287e3=>{this['_bufferedRequests']['set'](_0x519acd,{'resolve':_0x4287e3,'suggestionData':_0xf2a66b});});throw _0x2f41cf;});return this['_bufferedRequests']['delete'](_0x519acd),_0x4fc642;},'updateSuggestion':async(_0x59bb8d,_0x58fd22)=>{if(await this['_waitForServiceReady'](),'open'!==_0x58fd22['state'])return this['_trackChangesService']['update'](_0x59bb8d,_0x58fd22)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0xf81890,_0x4c7aaf)=>{_0x2ca589['hasSuggestion'](_0x4c7aaf['id'])&&(_0x2ca589['getSuggestion'](_0x4c7aaf['id'])['attributes']=_0x4c7aaf['attributes']);}),this['_trackChangesService']['connect'](_0x462989['connection'])['then'](_0x5f1976=>(_0x462989['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x5f1976)['then'](()=>{for(const _0x156d4b of _0x5f1976){_0x2ca589['addSuggestionData'](_0x156d4b)['_saved']=!0x0;}})));}async['reconnect'](){const _0x319808=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x34017f}=this['editor']['plugins']['get'](c),_0x2c2c25=await this['_trackChangesService']['connect'](_0x34017f);await this['_fetchMissingUsersForThreads'](_0x2c2c25);for(const {suggestionData:_0x1e9275,resolve:_0x4e1c2c}of this['_bufferedRequests']['values']()){let _0x3d61aa=_0x2c2c25['find'](_0x36d468=>_0x36d468['id']===_0x1e9275['id']);_0x3d61aa||(_0x3d61aa=await this['_trackChangesService']['add'](_0x1e9275['id'],_0x1e9275['type'],_0x1e9275['data'],_0x1e9275['originalSuggestionId'])),_0x4e1c2c(_0x3d61aa);}for(const _0x6a0f88 of _0x2c2c25)_0x319808['hasSuggestion'](_0x6a0f88['id'])||_0x319808['addSuggestionData'](_0x6a0f88);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x4807aa=>{this['listenTo'](this['_trackChangesService'],'connected',_0x74bf41=>{_0x74bf41['off'](),_0x4807aa();});});}async['_fetchMissingUsersForThreads'](_0x45eb53){const _0x208b40=this['editor']['plugins']['get'](_0x2aaab9),{connection:_0x5d8b7b}=this['editor']['plugins']['get'](c),_0x2c2a3c=new Set();for(const {authorId:_0x11486d}of _0x45eb53)_0x208b40['getUser'](_0x11486d)||_0x2c2a3c['add'](_0x11486d);if(0x0===_0x2c2a3c['size'])return;const _0x44d95d=await dt['getMany'](_0x5d8b7b,Array['from'](_0x2c2a3c));for(const _0x482b14 of _0x44d95d)_0x208b40['getUser'](_0x482b14['id'])||_0x208b40['addUser'](_0x482b14);}}function R(_0x416e78){if(ft(_0x416e78))return new Promise(()=>{});throw _0x416e78;}function ft(_0x5d1ee6){return _0x5d1ee6['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5d1ee6['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0xdcbc50{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 _0x3b1d36=this['editor']['plugins']['get'](c),_0x2bc9ca=this['editor']['plugins']['get']('CommentsEditing'),_0x3858dd=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3b1d36,'change:state',(_0x47d1b8,_0xc6511b,_0x49c132)=>{_0x2bc9ca['isThreadsLoadingPaused']='connected'!==_0x49c132;});}),this['listenTo'](_0x3b1d36,'change:state',(_0x19b98e,_0x3147cf,_0x73fbd2)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x73fbd2);}),_0x3858dd['_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 _0xdcbc50{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 _0xdcbc50{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x2aaab9];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x64232e){super(_0x64232e);const _0x2629db=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x2629db);}async['init'](){const _0xc85d8d=this['editor']['plugins']['get'](l),_0x563ce0=_0xc85d8d['serverHistory'],_0x4d0b21=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x563ce0,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0xc85d8d['sessionId']});const _0x45e40c=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x181637=await tt['isBundleUploaded'](_0x4d0b21['connection'],_0x45e40c);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x1204ed})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x1204ed)),'updateRevisions':async _0x5734ed=>{await this['_waitForServiceReady']();const _0x3c136b=this['_revisionTracker']['currentRevision'];if(_0x181637&&0x1===_0x5734ed['length']&&_0x5734ed[0x0]['id']===_0x3c136b['id'])return _0x5734ed;for(const _0xf58391 of _0x5734ed)_0xf58391['id']===_0x3c136b['id']&&(_0xf58391['isEmptyCurrent']=_0xf58391['fromVersion']===_0xf58391['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x5734ed,this['_lastRequestId'])['then'](_0x733141=>(this['_lastRequestId']=_0x733141,_0x5734ed))['catch'](_0x4bc883=>{if(st(_0x4bc883)||'400'===_0x4bc883['code']&&void 0x0!==_0x4bc883['data']['wrongRequestId']){for(const _0x5ca906 of _0x5734ed){!this['_revisionTracker']['repository']['getRevision'](_0x5ca906['id'])||this['_revisionTracker']['_bufferUpdate'](_0x5ca906['id'],_0x5ca906,!0x1);}if(st(_0x4bc883))throw _0x4bc883;return _0x5734ed;}throw _0x4bc883;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x4b75c4,{revisionsData:_0x2dc1c4,requestId:_0x561b7d})=>{Math['max'](..._0x2dc1c4['map'](_0x4de17f=>_0x4de17f['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x2dc1c4,_0x561b7d);}):this['_handleRevisionsUpdate'](_0x2dc1c4,_0x561b7d);});const {revisions:_0x294a42,requestId:_0x5e7c39}=await this['_revisionHistoryService']['connect'](_0x4d0b21['connection']);_0x4d0b21['addToReconnectionStack'](this),this['_lastRequestId']=_0x5e7c39,await this['_fetchMissingUsers'](_0x294a42);for(const _0x2751b0 of _0x294a42)this['_revisionTracker']['addRevisionData'](_0x2751b0);this['listenTo'](_0xc85d8d,'change:_isConnected',(_0x4c99a7,_0x39622f,_0x4160d5)=>{_0x4160d5&&(this['_oldOffset']=_0xc85d8d['_offset'],_0x4c99a7['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4d0b21,'state',_0x45b2d4=>_0x45b2d4===_0x312285['CONNECTED']);}async['reconnect'](){const _0x55cc5d=this['editor']['plugins']['get'](c),_0x3b775a=this['editor']['plugins']['get'](l),_0x5541ec=async()=>{const _0xa91d08=this['_revisionTracker']['currentRevision'],_0x5b6b65=_0xa91d08['id'],_0x2a76cc=_0x5b6b65!==_0x3b775a['sessionId'];if(_0x2a76cc){const _0x1855de=_0x3b775a['_offset']-this['_oldOffset'],_0x25d2b3=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0xa91d08['toVersion']+_0x1855de!==_0x25d2b3){const _0x113017=_0xa91d08['fromVersion']+_0x1855de,_0x5e1a06=this['editor']['plugins']['get'](_0x2aaab9),_0x47a63d=this['_revisionTracker']['buildRevisionData']({'revision':_0xa91d08,'from':_0x113017,'to':_0x25d2b3});_0x47a63d['id']=_0xa91d08['id'];const _0xa26992=_0x47a63d['authorsIds']['map'](_0x36ce40=>_0x5e1a06['getUser'](_0x36ce40));_0xa91d08['_update']({..._0x47a63d,'authors':_0xa26992},!0x0),this['_revisionTracker']['_bufferUpdate'](_0xa91d08['id'],_0x47a63d,!0x0);}this['_revisionTracker']['_startingVersion']=_0x25d2b3,(_0xa91d08['toVersion']===_0xa91d08['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x5b6b65)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x5b6b65),this['_revisionTracker']['_createCurrentRevision'](_0x25d2b3));}const {revisions:_0x4c1421,requestId:_0x3d2573}=await this['_revisionHistoryService']['reconnect'](_0x55cc5d['connection'],this['_lastRequestId']);_0x2a76cc&&_0x4c1421['length']>0x0?_0x3b775a['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x4c1421),this['_handleRevisionsUpdate'](_0x4c1421,_0x3d2573),this['_revisionTracker']['sendBufferedUpdates']());};return _0x3b775a['_isConnected']?_0x5541ec():new Promise((_0xfecb1,_0x252a5b)=>{_0x3b775a['once']('change:_isConnected',()=>{_0x5541ec()['then'](_0xfecb1)['catch'](_0x252a5b);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4fc11a=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x53fdfc=>{_0x53fdfc['off'](),_0x4fc11a();});});}['_getLatestVersionFromServerOperations'](){const _0x482b7f=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x50a3c1 of _0x482b7f)if('marker'!==_0x50a3c1['type']||_0x50a3c1['affectsData'])return _0x50a3c1['baseVersion']+0x1;}['_getLatestVersion'](){const _0x5312b2=this['editor']['plugins']['get'](l);return new Promise(_0x49934a=>{_0x5312b2['_isPendingUpdate']?_0x5312b2['once']('change:_isPendingUpdate',()=>{_0x49934a(this['_getLatestVersionFromServerOperations']());}):_0x49934a(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x264b73,_0x361629){const _0x2198e4=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x361629;for(const _0x4a3f04 of _0x264b73){const _0x1d113b=_0x2198e4['getRevision'](_0x4a3f04['id']);if(_0x1d113b){if((_0x4a3f04['fromVersion']||_0x4a3f04['toVersion'])&&(_0x4a3f04['diffData']=null),_0x1d113b===this['_revisionTracker']['currentRevision']){const _0x58a3cf=Math['max'](_0x1d113b['toVersion'],_0x4a3f04['toVersion']),_0xd7e03e=Math['max'](_0x1d113b['fromVersion'],_0x4a3f04['fromVersion']);let _0x16a0e6;_0x1d113b['toVersion']===_0x4a3f04['toVersion']&&_0x1d113b['fromVersion']===_0x4a3f04['fromVersion']?(_0x16a0e6=!0x0,this['_preventResendingRevisionData'](_0x4a3f04)):_0x4a3f04['toVersion']===_0x58a3cf&&_0x4a3f04['fromVersion']===_0xd7e03e?_0x16a0e6=!0x1:(_0x1d113b['toVersion']===_0x58a3cf&&_0x1d113b['fromVersion']===_0xd7e03e||this['_fixRevision']({'revision':_0x1d113b,'from':_0xd7e03e,'to':_0x58a3cf}),_0x16a0e6=!0x0),_0x16a0e6&&(delete _0x4a3f04['fromVersion'],delete _0x4a3f04['toVersion'],delete _0x4a3f04['diffData'],delete _0x4a3f04['createdAt'],delete _0x4a3f04['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x4a3f04),this['_preventResendingRevisionData'](_0x4a3f04);}else this['_revisionTracker']['addRevisionData'](_0x4a3f04);}const _0x1ce79f=_0x2198e4['getRevisions']();_0x1ce79f['reverse']();for(let _0xdf97ad=0x0;_0xdf97ad<_0x1ce79f['length']-0x1;_0xdf97ad++){const _0x4a669b=_0x1ce79f[_0xdf97ad],_0x217ae9=_0x1ce79f[_0xdf97ad+0x1];if(_0x4a669b['fromVersion']<_0x217ae9['toVersion']){const _0x36e7f3=_0x217ae9['toVersion'],_0x40fe12=Math['max'](_0x36e7f3,_0x4a669b['toVersion']);this['_fixRevision']({'revision':_0x4a669b,'from':_0x36e7f3,'to':_0x40fe12});}}}['_fixRevision']({revision:_0x5db21d,from:_0x1d3f27,to:_0xf0b379}={}){const _0x19eab9=this['editor']['plugins']['get'](_0x2aaab9),_0x152c55=this['_revisionTracker']['buildRevisionData']({'revision':_0x5db21d,'from':_0x1d3f27,'to':_0xf0b379});_0x152c55['authors']=_0x152c55['authorsIds']['map'](_0x23da0b=>_0x19eab9['getUser'](_0x23da0b)),_0x5db21d['_update'](_0x152c55);}['_preventResendingRevisionData'](_0x66d570){const _0x5498fe={};_0x5498fe['id']=_0x66d570['id'];for(const _0x154b37 of Object['keys'](_0x66d570))'id'!==_0x154b37&&(_0x5498fe[_0x154b37]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x5498fe['id'],_0x5498fe,!0x0);}async['_fetchMissingUsers'](_0x2387e2){const _0x5c4807=this['editor']['plugins']['get'](_0x2aaab9),{connection:_0x3ef64d}=this['editor']['plugins']['get'](c),_0x42b1df=new Set();for(const _0x49f416 of _0x2387e2){for(const _0x465f44 of _0x49f416['authorsIds'])_0x5b4edd(_0x465f44);_0x49f416['creatorId']&&_0x5b4edd(_0x49f416['creatorId']);}if(0x0===_0x42b1df['size'])return;const _0x5b44e8=await dt['getMany'](_0x3ef64d,Array['from'](_0x42b1df));for(const _0x3a63ad of _0x5b44e8)_0x5c4807['getUser'](_0x3a63ad['id'])||_0x5c4807['addUser'](_0x3a63ad);function _0x5b4edd(_0x88e32f){_0x5c4807['getUser'](_0x88e32f)||_0x42b1df['add'](_0x88e32f);}}}function st(_0x4aa927){return _0x4aa927['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x4aa927['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4aa927['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0xdcbc50{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 _0x2e989d{['_collapseAt'];constructor(_0x365a26,_0x3525c1=0x6){super(_0x365a26);const _0x536e5c=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x3525c1,this['bind']('isHidden')['to'](this,'usersCount',_0x35297e=>_0x35297e<_0x3525c1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x536e5c['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':_0x536e5c['to']('usersCount',_0x4bcfed=>'+'+(_0x4bcfed-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x2e989d{['items'];['keystrokes'];constructor(_0x35ab4d){super(_0x35ab4d);const _0x76cf8b=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x404036(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x76cf8b['if']('hasPopup'),'aria-expanded':_0x76cf8b['to']('isExpanded',_0x3ba6ce=>this['hasPopup']&&String(_0x3ba6ce)),'aria-label':_0x76cf8b['to']('hasPopup',_0x749496=>G(_0x35ab4d,_0x749496?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x76cf8b['to']('hasPopup',_0x32d8f7=>!!_0x32d8f7&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x76cf8b['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x76cf8b['to'](_0x59bc99=>{const _0x1ef8c9=_0x59bc99,_0x887bdf=document['querySelector']('.ck-presence-list__dropdown-list'),_0x895301=document['querySelector']('.ck-balloon-panel_with-arrow');_0x887bdf?.['contains'](_0x1ef8c9['relatedTarget'])||_0x895301?.['contains'](_0x1ef8c9['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x10e1b5,_0x552375,_0x48517d)=>{this['element']&&(_0x48517d?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 _0x2e989d{['counterView'];['inlineListView'];constructor(_0x1b8ac1,_0x3e0517=0x6){super(_0x1b8ac1);const _0x3610f2=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x3e0517),this['inlineListView']=new ts(_0x1b8ac1),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x57a820 of this['inlineListView']['items'])_0x57a820['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',_0x3610f2['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x2e989d{['listWrapperView'];constructor(_0x1241ef,_0x338d81){super(_0x1241ef);const _0x11b294=this['bindTemplate'];this['listWrapperView']=new mt(_0x1241ef,_0x338d81),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':G(_0x1241ef,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x11b294['to'](_0xaee2e8=>{const _0x2d966f=_0xaee2e8,_0x4f165f=document['querySelector']('.ck-presence-list__list'),_0x2c1565=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4f165f?.['contains'](_0x2d966f['relatedTarget'])||_0x2c1565?.['contains'](_0x2d966f['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class mt extends _0x54e28b{constructor(_0x55d925,_0x34c8cf){super(_0x55d925);const _0x20d615=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x34c8cf?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x20d615['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x20d615['to']('role'),'aria-label':_0x20d615['to']('ariaLabel'),'aria-labelledby':_0x20d615['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x4366f0['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x115303=this['element'];_0x115303&&(this['_isScrollable']=Math['max'](_0x115303['scrollHeight'],_0x115303['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x2e0100,_0x120255,_0x2a855b){super(_0x2e0100);const _0x49023e=this['bindTemplate'];this['userView']=new ct(_0x2e0100,_0x120255);const _0x46308e={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x120255['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x120255['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x120255['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x2a855b&&(_0x46308e['tag']='button',_0x46308e['on']={'click':_0x49023e['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x46308e);}['focus'](){this['element']['focus']();}}class y extends _0x2e989d{['userView'];['markerView'];constructor(_0x3109a3,_0x20b7d8,_0x6ae8be){super(_0x3109a3);const _0x38ebf4=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x3109a3,_0x20b7d8),this['markerView']=new at(_0x3109a3,_0x20b7d8);const _0x3ead27=new ot(_0x3109a3);_0x3ead27['template']['tag']='span',_0x3ead27['text']=_0x20b7d8['name'];const _0x1e80e1={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x38ebf4['to']('isFocusable',_0x2a4671=>!!_0x2a4671&&0x0),'aria-labelledby':_0x3ead27['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x38ebf4['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x38ebf4['to']('hasTooltip',_0x28082f=>!_0x28082f),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x3ead27]};_0x6ae8be&&(_0x1e80e1['tag']='button',_0x1e80e1['on']={'click':_0x38ebf4['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x1e80e1);}}class at extends _0x2e989d{constructor(_0x3dcda4,_0x9fcaec){super(_0x3dcda4),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x9fcaec['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x3f68a4{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x19a29d){super(_0x19a29d),this['context']['config']['define']('presenceList',C);const _0x12df01=_0x19a29d['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x12df01)throw new _0x19d29c('presencelist-collapseat-invalid-format',this);if(_0x12df01<0x1)throw new _0x19d29c('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x52ca00(),this['balloonPanelView']=new _0xcc0d89(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x5cfed2 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x5cfed2);this['listenTo'](this['_allConnectedUsers'],'add',(_0x56d3a6,_0x47dfe1)=>{this['_handleUserAdd'](_0x47dfe1);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x59dbd4,_0x23f143)=>{this['_handleUserRemove'](_0x23f143);});}['_createView'](){const _0x16261d=this['context'],_0x4202fa=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x14d7bd=this['balloonPanelView'];if(!_0x2a9041(_0x16261d['config']['get']('presenceList.container')))throw new _0x19d29c('presencelist-missing-container',this);return _0x4202fa['counterView']['bind']('usersCount')['to'](this),_0x4202fa['bind']('isCollapsed')['to'](this,'usersCount',_0x5d8510=>{const {collapseAt:_0x305099}=_0x16261d['config']['get']('presenceList'),_0xef56f1=_0x5d8510>=_0x305099;if(_0xef56f1&&!_0x4202fa['inlineListView']['items']['find'](_0x4d44ec=>_0x4d44ec instanceof A)){const _0x42c424=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x42c424&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x4202fa['inlineListView']['items']['add'](_0x4202fa['counterView']);}return _0xef56f1||this['hideDropdown'](),_0xef56f1;}),_0x4202fa['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x2104d9=>{const _0x4d316b=_0x16261d['config']['get']('presenceList'),_0x4b451b=new y(_0x16261d['locale'],_0x2104d9,!!_0x4d316b['onClick']);return _0x4b451b['bind']('hasTooltip')['to'](_0x4202fa,'isCollapsed',_0x32167f=>!_0x32167f),_0x4b451b['bind']('isFocusable')['to'](_0x4202fa,'isCollapsed',_0x446efb=>!_0x446efb),_0x4d316b['onClick']&&this['listenTo'](_0x4b451b,'execute',()=>{this['view']['isCollapsed']||_0x4d316b['onClick'](_0x2104d9,_0x4b451b['element']);}),_0x4b451b;}),this['listenTo'](_0x4202fa['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x4202fa['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x4202fa['inlineListView']['keystrokes']['set']('Enter',(_0x9b662d,_0xf0edfb)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0xf0edfb());}),_0x4202fa['render'](),_0x14d7bd['render'](),_0x57da6e({'emitter':_0x4202fa,'activator':()=>_0x14d7bd['isVisible'],'contextElements':[_0x14d7bd['element'],_0x4202fa['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x16261d['config']['get']('presenceList.container')['appendChild'](_0x4202fa['element']),this['_bodyCollection']=new _0x202965(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x4202fa;}['_handleUserAdd'](_0x10911b){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x10911b['isMe'])return;const _0x3ccace=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x3ccace-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x2e3c91=_0x10911b['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x10911b,_0x2e3c91);}['_handleUserRemove'](_0xfe4e63){this['usersCount']--;const {collapseAt:_0x353d15}=this['context']['config']['get']('presenceList'),_0x64d6e0=this['usersCount']>=_0x353d15;if(this['currentDisplayedUsers']['get'](_0xfe4e63['id']))this['currentDisplayedUsers']['remove'](_0xfe4e63['id']);else{if(_0x64d6e0&&this['currentDisplayedUsers']['length']+0x1===_0x353d15-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x64d6e0?0x1:0x0)<this['usersCount']){for(const _0x43b9de of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x43b9de['id'])&&(this['currentDisplayedUsers']['add'](_0x43b9de,Math['min'](this['currentDisplayedUsers']['length']-(_0x64d6e0?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x64d6e0?0x1:0x0)===_0x353d15-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0xa19e41=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0xa19e41['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x4c650e}=this['presenceDropdownView'];_0x4c650e['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x50fe43=>{if(!_0xa19e41['displayMe']&&_0x50fe43['isMe'])return null;const _0x5dfe54=new k(this['context']['locale'],_0x50fe43,!!_0xa19e41['onClick']);return _0xa19e41['onClick']&&this['listenTo'](_0x5dfe54,'execute',()=>{_0xa19e41['onClick'](_0x50fe43,_0x5dfe54['element']);}),_0x5dfe54;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x4c650e['focus'](),_0x4c650e['checkIfScrollable']();const _0xed00dc=(_0x3c3727,_0x1e0c37)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x1e0c37();};_0x4c650e['keystrokes']['set']('Esc',_0xed00dc),_0x4c650e['keystrokes']['set']('Shift+Tab',_0xed00dc),_0x4c650e['keystrokes']['set']('Tab',(_0x11a183,_0xca72a2)=>{!function(_0x33ba48){const _0x578417=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x5206b3=>_0x5206b3+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x42433a=[...document['body']['querySelectorAll'](_0x578417)]['filter'](_0x3142ab=>_0x3142ab===document['activeElement']||_0x3142ab['offsetWidth']+_0x3142ab['offsetHeight']>0x0)['sort']((_0x473760,_0x4379bf)=>(_0x473760['tabIndex']||0x0)-(_0x4379bf['tabIndex']||0x0)),_0x393891=_0x42433a['indexOf'](_0x33ba48),_0x3471ed=_0x42433a[(_0x393891+0x1)%_0x42433a['length']];_0x3471ed&&_0x3471ed['focus']();}(this['view']['element']),this['hideDropdown'](),_0xca72a2();}),_0x4c650e['focusTracker']['add'](this['view']['element']),_0x4c650e['focusTracker']['on']('change:isFocused',(_0x3758f1,_0x55cce6,_0x3cbf80)=>{_0x3cbf80||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 _0x3f68a4{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 _0x45e4d4,Plugin as _0x4792c5,PendingActions as _0x111923,Context as _0x550b52}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x4157d3,CKEditorError as _0x2cb10f,Collection as _0x44a5db,global as _0x19cda2,version as nt,uid as _0x85443b,KeystrokeHandler as _0x4044d4}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x20d895,View as _0x295a75,ListView as _0x372256,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x15cb5a,clickOutsideHandler as _0x4f52d2,BodyCollection as _0x24a730}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x1cb197,NoOperation as _0x2c8b74,InsertOperation as _0x57a621,MarkerOperation as _0x58628a,RootAttributeOperation as _0x59f94d,transformSets as _0x43550b,OperationFactory as _0x4a5eb5}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x5ba7c6,CollaborativeEditingService as _0x360098,User as dt,CommentsService as _0x5e36cb,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x153683,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x818af3}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x227d9d}from'es-toolkit/compat';class c extends _0x45e4d4{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x20d895];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49d4c5){super(_0x49d4c5),this['set']('state',_0x5ba7c6['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x4157d3);}['init'](){const _0x343f5d=this['context'],_0x1ad7cc=_0x343f5d['plugins']['get']('CloudServices'),_0x1fc758=_0x343f5d['plugins']['get'](_0x20d895);if(!_0x1ad7cc['token'])throw new _0x2cb10f('websocketgateway-missing-token',this);if(!_0x1ad7cc['webSocketUrl'])throw new _0x2cb10f('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'](_0x1ad7cc['token'],_0x1ad7cc['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x56f5e5=>{if(this['connection']=_0x56f5e5,this['bind']('state')['to'](_0x56f5e5,'state',this,'_isBrowserOffline',(_0x5b3726,_0x1b6bf6)=>('connected'!==_0x5b3726&&(this['_shouldPluginsReconnect']=!0x0),_0x1b6bf6||_0x5b3726!==_0x5ba7c6['CONNECTED']?_0x5ba7c6['DISCONNECTED']:this['state']==_0x5ba7c6['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x5ba7c6['CONNECTING']):_0x5ba7c6['CONNECTED'])),this['connection']['on']('error',(_0x488ca3,_0x2b26e3)=>{if('limitExceeded'!==_0x2b26e3['code'])throw console['error'](_0x2b26e3),new _0x2cb10f('cloudservices-init',null,{'originalError':_0x2b26e3});_0x1fc758['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'});}),!_0x56f5e5['me'])return new Promise(_0x5aee2e=>_0x56f5e5['on']('change:me',_0x5aee2e));})['catch'](_0x415f01=>{throw console['error'](_0x415f01),new _0x2cb10f('cloudservices-init',null,{'originalError':_0x415f01});});}['addToReconnectionStack'](_0x567713){if('function'!=typeof _0x567713['reconnect'])throw new _0x2cb10f('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x567713))throw new _0x2cb10f('websocketgateway-plugin-already-registered',this,{'name':_0x567713['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x567713);}['removeFromReconnectionStack'](_0x1b07df){this['_reconnectionStack']['delete'](_0x1b07df);}['isInReconnectionStack'](_0x493e03){return this['_reconnectionStack']['has'](_0x493e03);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x31b1b1=>_0x31b1b1['reconnect']())))['then'](()=>this['state']=_0x5ba7c6['CONNECTED'])['catch'](_0xadb75b=>{throw console['error'](_0xadb75b),new _0x2cb10f('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x5ba7c6['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x45e4d4{['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,_0x153683];}constructor(_0x3ef155){super(_0x3ef155),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x44a5db(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x153683);}['init'](){const _0x2bc16e=this['context']['plugins']['get'](c);this['listenTo'](_0x2bc16e,'change:state',(_0x12403b,_0x126c90,_0x54b079)=>{if('connected'!==_0x54b079)this['channelSessions']['forEach'](_0x2010c8=>_0x2010c8['clear']()),this['channelConnectedUsers']['forEach'](_0xfa0677=>_0xfa0677['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x154ced,_0x2e6d33]of this['_registeredSessions'])for(const _0x57b53e of _0x2e6d33)this['_handleSessionAdd'](_0x154ced,_0x57b53e);}}),this['_createUser'](_0x2bc16e['connection']['me'],!0x0);}['register'](_0x319bf8,_0x2417e1){if(this['_registeredSessions']['has'](_0x319bf8))throw new _0x2cb10f('sessions-register-already-registered',null,{'channelId':_0x319bf8});this['_registeredSessions']['set'](_0x319bf8,_0x2417e1),this['channelSessions']['set'](_0x319bf8,new _0x44a5db()),this['channelConnectedUsers']['set'](_0x319bf8,new _0x44a5db()),this['listenTo'](_0x2417e1,'add',(_0x149501,_0x58f640)=>this['_handleSessionAdd'](_0x319bf8,_0x58f640)),this['listenTo'](_0x2417e1,'remove',(_0x1b7b27,_0x163f35)=>this['_handleSessionRemove'](_0x319bf8,_0x163f35));for(const _0x121a29 of _0x2417e1)this['_handleSessionAdd'](_0x319bf8,_0x121a29);}['unregister'](_0x5603dd){if(!this['_registeredSessions']['has'](_0x5603dd))throw new _0x2cb10f('sessions-unregister-not-exist',null,{'channelId':_0x5603dd});const _0x1d8341=this['_registeredSessions']['get'](_0x5603dd);this['stopListening'](_0x1d8341);for(const _0x28a5d3 of _0x1d8341)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x5603dd,_0x28a5d3);this['_registeredSessions']['delete'](_0x5603dd),this['channelSessions']['delete'](_0x5603dd),this['channelConnectedUsers']['delete'](_0x5603dd);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x486568){for(const _0x1242c4 of this['channelSessions']['values']())for(const _0x5ef118 of _0x1242c4)if(_0x5ef118['id']===_0x486568)return _0x5ef118['user'];}['getUserSessions'](_0x4e714d,_0x3f39e0){const _0x60fc46=_0x3f39e0?[this['channelSessions']['get'](_0x3f39e0)]:this['channelSessions']['values'](),_0x17cc36=new Set();for(const _0x3ac224 of _0x60fc46)for(const _0x3035a4 of _0x3ac224)_0x3035a4['user']['id']===_0x4e714d['id']&&_0x17cc36['add'](_0x3035a4['id']);return _0x17cc36;}['getUserRole'](_0x2f6d8f){for(const _0x1b615e of this['channelSessions']['values']())for(const _0x4e0acc of _0x1b615e)if(_0x4e0acc['user']===_0x2f6d8f)return _0x4e0acc['role'];}['_handleSessionAdd'](_0xc4ae15,_0x4d9dc5){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0xe82e74=_0x4d9dc5['user'],_0x5ef74a=this['_users']['getUser'](_0xe82e74['id'])||this['_createUser'](_0xe82e74),_0x3260d4=Object['assign']({},_0x4d9dc5,{'user':_0x5ef74a});this['channelSessions']['get'](_0xc4ae15)['add'](_0x3260d4);const _0x34aa49=this['channelConnectedUsers']['get'](_0xc4ae15);_0x34aa49['has'](_0x5ef74a['id'])||_0x34aa49['add'](_0x5ef74a),this['allConnectedUsers']['has'](_0x5ef74a['id'])||this['allConnectedUsers']['add'](_0x5ef74a,_0x5ef74a['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0xc4ae15,{'channelId':_0xc4ae15,'session':_0x3260d4});}['_handleSessionRemove'](_0x35c556,_0xbd641a){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x20716c=this['channelConnectedUsers']['get'](_0x35c556),_0x387ddc=_0xbd641a['user'];_0x387ddc['id']&&(this['channelSessions']['get'](_0x35c556)['remove'](_0xbd641a['id']),_0x20716c['has'](_0x387ddc['id'])&&!this['getUserSessions'](_0x387ddc,_0x35c556)['size']&&_0x20716c['remove'](_0x387ddc['id']),this['allConnectedUsers']['get'](_0x387ddc['id'])&&!this['getUserSessions'](_0x387ddc)['size']&&this['allConnectedUsers']['remove'](_0x387ddc['id']));}['_createUser'](_0x2ce366,_0x395e57){const _0x27f08a=this['_users']['addUser'](_0x2ce366);return _0x395e57&&this['_users']['defineMe'](_0x2ce366['id']),_0x27f08a['orderNumber']=this['_uniqueUsersCount']++,_0x27f08a;}}class q extends _0x4792c5{['_domEmitter']=new(_0x4157d3())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x63cec7=this['editor'],_0x5a1cc3=_0x63cec7['plugins']['get'](i);_0x63cec7['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x55b697,{writer:_0x4ba000})=>function(_0x4e1ed9,_0x4221c7,_0x2e9b57,_0x3b8c05){const _0x3327d9=_0x4e1ed9['markerName']['split'](':')[0x2],_0x5d0633=_0x2e9b57['getUserBySessionId'](_0x3327d9);if(!_0x5d0633||_0x3327d9===_0x2e9b57['mySessionId'])return;if(!_0x3b8c05['model']['schema']['checkChild'](_0x4e1ed9['markerRange']['start'],'$text'))return;const _0x16cf6f={'class':'ck-user__marker\x20'+_0x5d0633['color']['getMarkerClass'](),'data-name':_0x5d0633['name'],'data-session-id':_0x3327d9},_0x5d1729=_0x3b8c05['model']['markers']['get'](_0x4e1ed9['markerName']),_0x27229f=_0x5d1729['getStart'](),_0x1bd9b4=_0x27229f['nodeAfter'],_0x33c266=_0x3b8c05['model']['schema'];if(_0x1bd9b4&&_0x33c266['isObject'](_0x1bd9b4)&&_0x33c266['isInline'](_0x1bd9b4)&&!_0x3b8c05['model']['markers']['get']('user:range:'+_0x3327d9)['getRange']()['isCollapsed'])return;const _0x2dfdff=_0x27229f['parent'];return _0x3b8c05['model']['schema']['isLimit'](_0x2dfdff)&&!_0x3b8c05['model']['hasContent'](_0x2dfdff)&&(_0x16cf6f['contenteditable']=!0x1),function(_0x357a31,_0x1bb19b,_0x305487){const _0x50a536=_0x357a31['createUIElement']('span',_0x1bb19b);return _0x357a31['setCustomProperty']('userPositionMarker',!0x0,_0x50a536),_0x50a536['render']=function(_0x2ddef4){const _0x12bfeb=this['toDomElement'](_0x2ddef4),_0x4b601c=document['createElement']('span');return _0x4b601c['classList']['add']('ck-user__marker-tooltip'),_0x4b601c['setAttribute']('contenteditable','false'),_0x4b601c['setAttribute']('spellcheck','false'),_0x4b601c['textContent']=_0x305487['name'],_0x12bfeb['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x4b601c['outerHTML']+'⁠',_0x12bfeb['addEventListener']('mouseenter',()=>{_0x12bfeb['classList']['add']('ck-user__marker_hovered');}),_0x12bfeb['addEventListener']('mouseleave',()=>{_0x12bfeb['classList']['remove']('ck-user__marker_hovered');}),_0x12bfeb;},_0x50a536['isSimilar']=function(_0x176e89){return!(!this['getCustomProperty']('userPositionMarker')||!_0x176e89['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x176e89['getAttribute']('data-session-id'));},_0x50a536;}(_0x4221c7,_0x16cf6f,_0x5d0633);}(_0x55b697,_0x4ba000,_0x5a1cc3,_0x63cec7)}),_0x63cec7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0xb59dcb=>function(_0x64bf1,_0x8ccfb0){const _0x588b4e=_0x64bf1['markerName']['split'](':')[0x2];if(_0x588b4e===_0x8ccfb0['mySessionId'])return null;const _0x4fec54=_0x8ccfb0['getUserBySessionId'](_0x588b4e);if(!_0x4fec54)return{'id':_0x588b4e,'classes':[]};return{'id':_0x588b4e,'classes':['ck-user__selection',_0x4fec54['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x588b4e},'priority':0x7d0+_0x4fec54['orderNumber']};}(_0xb59dcb,_0x5a1cc3)}),function(_0x275ce9){const _0x216b3c=_0x275ce9['model'],_0x40270c=new Map(),_0x131bc2=_0x275ce9['plugins']['get'](i);_0x216b3c['markers']['on']('update:user:range',(_0x5b5e4e,_0x27931a,_0x291883,_0x31cd8a)=>{if(!_0x31cd8a&&_0x40270c['get'](_0x27931a['name']))return _0x40270c['get'](_0x27931a['name'])['detach'](),void _0x40270c['delete'](_0x27931a['name']);const _0x541f87=_0x27931a['name']['split'](':')[0x2];if(_0x541f87===_0x131bc2['mySessionId'])return;const _0x42a062='user:position:'+_0x541f87;_0x216b3c['markers']['has'](_0x42a062)&&_0x275ce9['editing']['reconvertMarker'](_0x42a062),_0x27931a['on']('change:range',(_0x28bf04,_0x5b8976,_0x1dbde1)=>{if('$graveyard'!=_0x5b8976['root']['rootName']&&'$graveyard'==_0x27931a['getRange']()['root']['rootName']&&!_0x40270c['has'](_0x27931a['name'])){const _0x5c8d49=_0x216b3c['schema']['getNearestSelectionRange'](_0x1dbde1['deletionPosition']);if(_0x5c8d49){const _0x325ee3=ht['fromRange'](_0x5c8d49);_0x40270c['set'](_0x27931a['name'],_0x325ee3),_0x325ee3['on']('change:range',(_0x219998,_0x4eb6f6,_0x363a2b)=>{if('$graveyard'==_0x325ee3['root']['rootName']){const _0x551865=_0x216b3c['schema']['getNearestSelectionRange'](_0x363a2b['deletionPosition']);_0x551865?(_0x325ee3['start']=_0x551865['start'],_0x325ee3['end']=_0x551865['end']):(_0x40270c['delete'](_0x27931a['name']),_0x325ee3['detach']());}});}}});}),_0x216b3c['document']['on']('change',()=>{_0x40270c['size']>0x0&&_0x216b3c['enqueueChange']({'isUndoable':!0x1},_0x62b4db=>{for(const [_0x3eee55,_0xc1bd86]of _0x40270c)'$graveyard'==_0x216b3c['markers']['get'](_0x3eee55)['getRange']()['root']['rootName']&&(te(_0x3eee55['split'](':')[0x2],_0xc1bd86['toRange'](),_0x216b3c,_0x62b4db),_0xc1bd86['detach']());_0x40270c['clear']();});});}(_0x63cec7),this['_domEmitter']['listenTo'](_0x19cda2['document'],'keydown',(_0x3c3d9b,{key:_0xf912b4})=>{'Escape'===_0xf912b4&&function(_0x50f3aa){_0x50f3aa['editing']['view']['change'](_0x11cd8e=>{for(const _0x332aa5 of _0x50f3aa['model']['markers']){if(!_0x332aa5['name']['startsWith']('user:position'))continue;const _0x55d080=_0x50f3aa['editing']['mapper']['markerNameToElements'](_0x332aa5['name']);if(_0x55d080){for(const _0xdc4be2 of _0x55d080)_0x11cd8e['removeClass']('ck-user__marker_hovered',_0xdc4be2);}}});}(_0x63cec7);},{'useCapture':!0x0});}['afterInit'](){const _0x58c7d2=this['editor'],_0x4aa0bf=_0x58c7d2['commands']['get']('undo');_0x4aa0bf&&_0x58c7d2['model']['on']('applyOperation',(_0x1616b5,_0x480573)=>{const _0x2725d0=_0x480573[0x0];if(!_0x2725d0['isDocumentOperation'])return;if('marker'!=_0x2725d0['type']||!_0x2725d0['name']['startsWith']('user:'))return;const _0x1a4c1a=_0x2725d0['batch'];_0x4aa0bf['_createdBatches']['has'](_0x1a4c1a)&&(_0x2725d0['newRange']=_0x2725d0['oldRange']?_0x58c7d2['model']['createRange'](_0x2725d0['oldRange']['start'],_0x2725d0['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x413c80=this['editor'],_0x369617=_0x413c80['model']['document'],_0x4934ff=_0x413c80['plugins']['get'](i);_0x413c80['model']['enqueueChange']({'isUndoable':!0x1},_0x3a5d47=>{const _0xecdebb='user:range:'+_0x4934ff['mySessionId'],_0x588d3f='user:position:'+_0x4934ff['mySessionId'],_0x19a02a=_0x413c80['model']['markers']['has'](_0xecdebb);_0x413c80['editing']['view']['hasDomSelection']?te(_0x4934ff['mySessionId'],_0x369617['selection']['getFirstRange'](),_0x413c80['model'],_0x3a5d47):_0x19a02a&&(_0x3a5d47['removeMarker'](_0xecdebb),_0x3a5d47['removeMarker'](_0x588d3f));});}}function te(_0x4000a5,_0x138fae,_0x4de627,_0x1c9b9d){const _0x2d602a='user:range:'+_0x4000a5,_0x4d1987='user:position:'+_0x4000a5,_0x59aa82=_0x138fae['getContainedElement']();let _0x4810ef=_0x138fae['start'];if(_0x59aa82&&_0x59aa82['is']('element','tableCell')){const _0x5c86aa=function(_0x1b78b1,_0x5b5e1e){for(const _0x1e68c2 of _0x1b78b1['getPositions']())if(_0x5b5e1e['schema']['checkChild'](_0x1e68c2,'$text'))return _0x1e68c2;}(_0x138fae,_0x4de627);_0x5c86aa&&(_0x4810ef=_0x5c86aa,_0x138fae=_0x1c9b9d['createRange'](_0x4810ef));}const _0x32f30c=_0x1c9b9d['createRange'](_0x4810ef);_0x4de627['markers']['has'](_0x2d602a)?(_0x1c9b9d['updateMarker'](_0x2d602a,{'range':_0x138fae}),_0x1c9b9d['updateMarker'](_0x4d1987,{'range':_0x32f30c})):(_0x1c9b9d['addMarker'](_0x2d602a,{'range':_0x138fae,'usingOperation':!0x0}),_0x1c9b9d['addMarker'](_0x4d1987,{'range':_0x32f30c,'usingOperation':!0x0}));}function G(_0x39fde3,_0x7f9d78,_0x304f48){const _0x31ff5a=_0x39fde3['t'],t=_0x39fde3['t'];switch(_0x7f9d78){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 _0x31ff5a({'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'},_0x304f48);default:return'';}}let J=0x1;class l extends _0x4792c5{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x360098)());['_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,_0x111923,_0x153683,_0x20d895];}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 _0x5640ff=this['serverHistory']['getOperations']();for(let _0x5eb64f=_0x5640ff['length']-0x1;_0x5eb64f>=0x0;_0x5eb64f--){const _0x4bd2d8=_0x5640ff[_0x5eb64f];if(!this['_disconnectionOperations']['has'](_0x4bd2d8))return _0x4bd2d8['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x35f356){if(super(_0x35f356),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x1cb197(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x2cb10f('collaboration-missing-channelid',this);const _0xb73fe5=_0x35f356['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0xb73fe5,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x818af3(),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 _0xfd2da6=this['editor'],_0x12110e=_0xfd2da6['plugins']['get'](_0x153683),_0x53791f=_0xfd2da6['plugins']['get'](c);this['listenTo'](_0x12110e,'getOperationAuthor',(_0x4db83f,_0x47a74b)=>{const _0xbdc539=_0x47a74b[0x0];_0xbdc539['_authorId']&&(_0x4db83f['return']=_0x12110e['getUser'](_0xbdc539['_authorId']),_0x4db83f['stop']()),null===_0xbdc539['_authorId']&&(_0x4db83f['return']=null,_0x4db83f['stop']());},{'priority':'high'}),this['listenTo'](_0xfd2da6['model']['document']['selection'],'change:range',(_0x15fa6a,_0x369673)=>{_0x369673['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0xfd2da6['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0xfd2da6['model']['on']('applyOperation',(_0x4ef221,_0x4fb288)=>{const _0x5a7d46=_0x4fb288[0x0];_0x5a7d46['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x5a7d46),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x53791f,'state',this,'_hasSynchronizationProblem',(_0x1ead13,_0x49960c)=>'connected'===_0x1ead13&&!_0x49960c),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0xfd2da6['disableReadOnlyMode']('rtc-offline'):_0xfd2da6['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0xfd2da6['disableReadOnlyMode']('rtc-offline'):_0xfd2da6['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x5afe94=this['editor']['plugins']['get'](i),_0x1696ec=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x5afe94['unregister'](this['_channelId']);const _0x4bb3ab=await this['_service']['reconnect'](_0x1696ec['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x4bb3ab)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x6b27e8=await this['_service']['getConnectedSessions']();_0x5afe94['register'](this['_channelId'],_0x6b27e8),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2663e6){if(function(_0x39ef33){return'404'===_0x39ef33['code'];}(_0x2663e6)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x2a176b){return'409'===_0x2a176b['code'];}(_0x2663e6)){const _0x3a191b=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'](_0x3a191b);}else{if(!(_0x2663e6 instanceof Q))throw _0x2663e6;this['_handleReconnectionError']();}}}}['destroy'](){const _0x268e76=this['editor']['plugins']['get'](c),_0x105bdb=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x105bdb['channelSessions']['has'](this['_channelId'])&&_0x105bdb['unregister'](this['_channelId']),_0x268e76['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x2b3e7c){if(this['sessionId']!==_0x2b3e7c['sessionId']&&this['_lastSyncedOperationId']!==_0x2b3e7c['lastOperationId'])throw new Q();return this['sessionId']=_0x2b3e7c['sessionId'],this['_handleServerResponse']([],{..._0x2b3e7c,'wereChangesApplied':!0x1,'data':_0x2b3e7c['data']},'reconnect');}async['_connectService'](_0x7c9fd9,_0x400318=!0x1){const {connection:_0x327a6a}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x327a6a,this['_channelId'])['then'](_0x193d40=>this['_initSessionsHandling'](_0x193d40))['catch'](_0x33628d=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x33628d);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x4b058c,_0x51c86f)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x51c86f);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x5563d5=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x7c9fd9);this['_isPendingUpdate']=!0x0;const _0x221deb=await this['_service']['connect'](_0x327a6a,this['_compressOperations'](_0x7c9fd9),_0x5563d5);if(this['sessionId']=_0x221deb['sessionId'],_0x400318){if(!_0x221deb['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x221deb['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x7c9fd9,_0x221deb,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x221deb,_0x7c9fd9);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x1b498d=this['editor']['plugins']['get'](i),_0x4645b7=this['editor']['plugins']['get'](q),_0x206467=_0x1b498d['channelSessions']['get'](this['_channelId']);_0x206467&&_0x206467['length']>0x1?_0x4645b7['createUserMarkerOperations']():this['listenTo'](_0x1b498d,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x1b498d['channelSessions']['get'](this['_channelId'])['length']&&_0x4645b7['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x3c7136,_0x4ca5b6,_0x55e469,_0x27b450){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x4ca5b6){const _0x3cb5ae=this['_decompressOperations'](_0x55e469,_0x27b450);await this['_fetchMissingUsers'](_0x3cb5ae),this['_handleExternalOperations'](_0x3cb5ae,_0x4ca5b6,_0x55e469['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x28c2f3}=this['editor'];let _0x2758e9;try{_0x2758e9=await this['_service']['getDocumentDetails']();}catch{const _0x30d030=G(_0x28c2f3,'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'](_0x30d030);}const _0x3ae5c9=_0x2758e9['currentDocumentSession']||_0x2758e9['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x3ae5c9['lastOperationId']){const _0x514a24=G(_0x28c2f3,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x514a24);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x3cda08){const _0x29f202=this['editor']['plugins']['get'](i);this['listenTo'](_0x29f202,'sessionAdd:'+this['_channelId'],(_0x53bfdd,{session:_0x558668})=>{if(_0x558668['id']===_0x29f202['mySessionId']){_0x53bfdd['off']();const _0x1ba97c=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0xc72dbf=_0x558668['permissions'];_0x1ba97c&&_0x1ba97c['isEnabled']&&(_0xc72dbf=_0xc72dbf['filter'](_0x4632b0=>'document:write'!==_0x4632b0)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0xc72dbf,this['_channelId']);}}),_0x29f202['register'](this['_channelId'],_0x3cda08);}['_initThrowingOnDataSet'](){const _0x58a1cd=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x31e3c0)=>{if(!_0x31e3c0[_0x31e3c0['length']-0x1]['suppressErrorInCollaboration'])throw new _0x2cb10f('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x58a1cd['apply'](this['editor']['data'],_0x31e3c0);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x49bd3b,[_0x565c52])=>{if(this['_document']['version'])throw new _0x2cb10f('realtimecollaborationclient-init-document-already-initialized',this);_0x49bd3b['stop'](),this['_setPendingAction']();const _0x48ad11=this['editor']['config']['get']('rootsAttributes'),_0x21a8d6=this['_getOperationsFromInitData'](_0x565c52,_0x48ad11);0x0==_0x21a8d6['length']&&_0x21a8d6['push'](new _0x2c8b74(0x0)),_0x49bd3b['return']=this['_connectService'](_0x21a8d6)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x12b625=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x12b625))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3b4e97,[_0x286b3e,_0x3d7137])=>{_0x3b4e97['stop']();const _0x3a219f=this['editor']['model']['document']['getRoot'](_0x286b3e);if(!this['_knownRootNames']['has'](_0x286b3e)){const _0x273157=_0x3d7137&&_0x3d7137['data']?_0x3d7137['data']:'',_0x548cf7=_0x3d7137&&_0x3d7137['attributes']?_0x3d7137['attributes']:{};await this['_loadRoot'](_0x286b3e,_0x273157,_0x548cf7);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x3a219f['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x3a219f);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x47f759){const _0xda6798=this['editor']['plugins']['get'](_0x153683),{connection:_0x266218}=this['editor']['plugins']['get'](c),_0x527aa6=new Set();for(const _0x17453 of _0x47f759){const _0x419b52=_0x17453['_authorId'];_0x419b52&&!_0xda6798['getUser'](_0x419b52)&&_0x527aa6['add'](_0x419b52);}if(0x0===_0x527aa6['size'])return;const _0x346687=await dt['getMany'](_0x266218,Array['from'](_0x527aa6));for(const _0x9b61f6 of _0x346687)_0xda6798['getUser'](_0x9b61f6['id'])||_0xda6798['addUser'](_0x9b61f6);}['_getOperationsFromInitData'](_0x39c8ac,_0x1cd4ce={}){const _0x18f8d4=this['editor']['model'],_0x2e7fd5=[];let _0x584733=0x0;const _0x8e8fc0='string'==typeof _0x39c8ac?{'main':_0x39c8ac}:_0x39c8ac;for(const _0x1be583 of Object['keys'](_0x8e8fc0)){if(!this['_document']['roots']['has'](_0x1be583))throw new _0x2cb10f('realtimecollaborationclient-init-non-existent-root',this);const _0x3945c0=this['editor']['data']['parse'](_0x8e8fc0[_0x1be583]),_0x351ac1=this['_document']['getRoot'](_0x1be583),_0x5e19f5=new _0x57a621(_0x18f8d4['createPositionAt'](_0x351ac1,0x0),_0x3945c0,_0x584733++);_0x2e7fd5['push'](_0x5e19f5);for(const [_0x2b24e9,_0x45266e]of _0x3945c0['markers']){const _0x273279=_0x18f8d4['createRange'](_0x18f8d4['createPositionFromPath'](_0x351ac1,_0x45266e['start']['path']['slice']()),_0x18f8d4['createPositionFromPath'](_0x351ac1,_0x45266e['end']['path']['slice']())),_0x53e61a=new _0x58628a(_0x2b24e9,null,_0x273279,_0x18f8d4['markers'],!0x0,_0x584733++);_0x2e7fd5['push'](_0x53e61a);}}if(_0x1cd4ce)for(const [_0x496734,_0x63fbc2]of Object['entries'](_0x1cd4ce)){const _0x34880e=_0x18f8d4['document']['getRoot'](_0x496734);if(!_0x34880e)throw new _0x2cb10f('multi-root-editor-root-attributes-no-root',null);for(const [_0x182a3c,_0x3812da]of Object['entries'](_0x63fbc2))if(null!==_0x3812da){const _0x1deb6d=new _0x59f94d(_0x34880e,_0x182a3c,null,_0x3812da,_0x584733++);_0x2e7fd5['push'](_0x1deb6d);}}return _0x2e7fd5;}async['_loadRoot'](_0x49c795,_0x3c2845,_0x4ec03c){this['_getOperationsFromInitData']({[_0x49c795]:_0x3c2845},{[_0x49c795]:_0x4ec03c})['forEach']((_0x151218,_0x3452c1)=>{_0x151218['baseVersion']=this['_document']['version']+_0x3452c1,_0x151218['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x151218);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0xcf1863,_0x27771a){let _0x1e3a56;this['_offset']=_0xcf1863['offset'];const _0x41bf1e=_0xcf1863['wereChangesApplied']&&!_0xcf1863['initData'],_0x257953=_0x41bf1e?0x0:_0xcf1863['data']['baseVersion'];if(_0x27771a['forEach'](_0x25230d=>{_0x25230d['_isInit']=!0x0,_0x25230d['createdAt']=_0xcf1863['sessionCreatedAt'],_0x25230d['_authorId']=null;}),_0x41bf1e)_0x1e3a56=_0x27771a,this['_applyOperationsSet'](_0x1e3a56,_0x41bf1e);else{if(_0xcf1863['initData']){const _0x90ba05=this['_getOperationsFromInitData'](_0xcf1863['initData']);this['_document']['history']['version']=-_0x90ba05['length'],_0x90ba05['forEach'](_0x2f35b1=>{_0x2f35b1['baseVersion']-=_0x90ba05['length'],_0x2f35b1['createdAt']=_0xcf1863['sessionCreatedAt'],_0x2f35b1['_isInit']=!0x0,_0x2f35b1['_authorId']=null;}),this['_applyOperationsSet'](_0x90ba05,!0x0),this['serverHistory']['version']=-_0x90ba05['length']+this['_offset'],this['_updateServerHistory'](_0x90ba05);}this['_document']['history']['version']=_0x257953,_0x1e3a56=this['_decompressOperations'](_0xcf1863['data'],_0xcf1863['metadata']),await this['_fetchMissingUsers'](_0x1e3a56),this['_applyOperationsSet'](_0x1e3a56,_0x41bf1e);}_0xcf1863['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1e3a56,_0xcf1863['lastOperationId']),this['_lastSyncedOperationId']=_0xcf1863['lastOperationId']),this['serverHistory']['version']=_0x257953+this['_offset'],this['_updateServerHistory'](_0x1e3a56),_0x27771a['filter'](_0x34c963=>{const _0x10ec23=this['_getAffectedRoot'](_0x34c963);return _0x10ec23&&!this['_knownRootNames']['has'](_0x10ec23);})['forEach']((_0x484b47,_0xfe6278)=>{_0x484b47['baseVersion']=this['_document']['version']+_0xfe6278,this['_saveOperationInBuffer'](_0x484b47);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0xdfea70,_0x6a2119){const _0x4af823=_0x6a2119&&_0x6a2119['message'];if(_0x4af823&&_0x4af823['startsWith']('realtimecollaborationclient'))throw _0x6a2119;const _0x2a890c=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x2a890c['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x2cb10f(_0xdfea70,this['editor'],_0x4af823?{'originalError':_0x4af823}:void 0x0);}['_saveOperationInBuffer'](_0x240833){this['_knownOperations']['has'](_0x240833)||(this['_knownOperations']['add'](_0x240833),this['_bufferedOperations']['push'](_0x240833),this['_pendingAction']||'marker'==_0x240833['type']&&!_0x240833['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x32789b=!0x1){!_0x32789b&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x5e06b=>{_0x5e06b&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x28902f=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0xc67636){return _0xc67636['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xc67636['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0xc67636['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x28902f)||this['_crash'](_0x28902f['message'],_0x28902f);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x529967=>{this['on']('change:_isPendingUpdate',()=>{_0x529967();});});}async['_sendBufferedOperations'](){const _0x277afa=this['editor']['plugins']['get'](q);if(this['_shouldSendSelectionUpdate']()&&(_0x277afa['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x2b4fa2=[...this['_bufferedOperations']];for(const _0x1a3363 of _0x2b4fa2)_0x1a3363['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x1a3363);const _0x1fb371=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2b4fa2),_0x2d2471=J++,_0x3d8dae=this['_compressOperations'](_0x2b4fa2),_0x377b0b=await this['_service']['sendOperations'](_0x3d8dae,_0x3d8dae['baseVersion'],_0x1fb371);try{return await this['_handleServerResponse'](_0x2b4fa2,_0x377b0b,_0x2d2471);}catch(_0x2bfcf6){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x2bfcf6);}}async['_handleServerResponse'](_0x289b26,_0x33baff,_0x12e710){if('error'in _0x33baff)throw _0x33baff['error'];let _0x58c158=!0x1;if(_0x33baff['wereChangesApplied']){_0x33baff['lastOperationId']&&(this['_lastSyncedOperationId']=_0x33baff['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3c03af=>!_0x289b26['includes'](_0x3c03af));for(const _0x278b59 of _0x289b26)_0x278b59['createdAt']='lastOperationAcceptedAt'in _0x33baff&&_0x33baff['lastOperationAcceptedAt']||void 0x0;X(_0x289b26,_0x33baff['version']-_0x289b26['length']),this['_updateServerHistory'](_0x289b26);const _0x43ea5d=_0x289b26['filter'](_0x1affa5=>{if(!_0x1affa5['_isInit'])return!0x1;const _0x32e8b4=this['_getAffectedRoot'](_0x1affa5);return _0x32e8b4&&!this['_knownRootNames']['has'](_0x32e8b4);});X(_0x43ea5d,this['_document']['version']),this['_applyOperationsSet'](_0x43ea5d),_0x58c158=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x5442ef=this['_decompressOperations'](_0x33baff['data'],_0x33baff['metadata'])['filter'](_0x43b437=>_0x43b437['baseVersion']>=this['_lastServerVersion']);_0x5442ef['forEach'](_0x174f5f=>this['_addKnownRoot'](_0x174f5f)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x27baf4=>!_0x27baf4['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x27baf4))),this['_bufferedOperations']['length']&&X(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x5442ef),_0x58c158=this['_handleExternalOperations'](_0x5442ef,_0x33baff['version'],_0x33baff['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x58c158?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x12dabe,_0x560f56,_0x5053ca){try{const _0x29c36e={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2e8183,operationsB:_0xa312f0,originalOperations:_0xc6b931}=_0x43550b(_0x12dabe,this['_bufferedOperations'],_0x29c36e);X(_0x2e8183,this['_document']['version']),X(_0xa312f0,_0x560f56);for(const _0x4b4ecb of _0x2e8183){const _0x29d7c2=_0xc6b931['get'](_0x4b4ecb);_0x4b4ecb['_authorId']=_0x29d7c2?_0x29d7c2['_authorId']:null;}_0x5053ca&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x12dabe,_0x5053ca),this['_lastSyncedOperationId']=_0x5053ca),this['_bufferedOperations']=[..._0xa312f0],this['_applyOperationsSet'](_0x2e8183),this['_updateServerHistory'](_0x12dabe);}catch(_0x1097ff){return console['error'](_0x1097ff),!0x1;}return!0x0;}['_applyOperationsSet'](_0x4b6117,_0x5d3af9=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x2e95bc=>{for(const _0x5ac52e of _0x4b6117)this['_knownOperations']['add'](_0x5ac52e),this['_addKnownRoot'](_0x5ac52e),_0x2e95bc['batch']['addOperation'](_0x5ac52e),this['editor']['model']['applyOperation'](_0x5ac52e);});}['_addKnownRoot'](_0x4f6563){const _0x27899e=this['_getAffectedRoot'](_0x4f6563);_0x27899e&&this['_knownRootNames']['add'](_0x27899e);}['_getAffectedRoot'](_0x44ee07){let _0x107b33,_0x4a5875;switch(_0x44ee07['type']){case'insert':_0x107b33=_0x44ee07['position']['root'];break;case'marker':if(_0x4a5875=_0x44ee07['newRange'],!_0x4a5875)return null;_0x107b33=_0x4a5875['root'];break;case'addRootAttribute':_0x107b33=_0x44ee07['root'];break;case'addRoot':_0x107b33=_0x44ee07['affectedSelectable'];break;case'move':_0x107b33=_0x44ee07['targetPosition']['root'];break;default:return null;}return _0x107b33['rootName'];}['_updateServerHistory'](_0x5c3690){_0x5c3690['forEach'](_0x22df58=>{const _0x498c9a=_0x22df58['clone']();_0x498c9a['_authorId']=_0x22df58['_authorId'],_0x498c9a['_isInit']=!!_0x22df58['_isInit'],_0x498c9a['createdAt']=_0x22df58['createdAt'],_0x498c9a['baseVersion']+=this['_offset'],_0x22df58['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x498c9a),this['serverHistory']['addOperation'](_0x498c9a);});}['_handleReconnectionError'](_0x5a3604){const _0x33a870=this['editor']['plugins']['get']('Notification'),_0x446bb9=this['editor']['locale'];_0x5a3604||(_0x5a3604=G(_0x446bb9,'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.')),_0x33a870['showWarning'](_0x5a3604,{'title':G(_0x446bb9,'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'](_0x111923)['add'](G(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x111923)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x5a63fc){const _0x5d7eb2=_0x5a63fc['map'](_0x400ce9=>_0x400ce9['toJSON']());return this['_compressor']['compress'](_0x5d7eb2);}['_decompressOperations'](_0x389a14,_0x29439e){return this['_compressor']['decompress'](_0x389a14)['map']((_0x410614,_0xc68c54)=>{const _0xdea7a3='init'==_0x29439e[_0xc68c54]['type'];if('InsertOperation'==_0x410614['__className']){const _0x4dd641=_0x410614['position']['root'];!this['_document']['getRoot'](_0x4dd641)&&(this['_document']['createRoot']('$root',_0x4dd641)['_isAttached']=!0x1);}const _0x5a31d2=_0x4a5eb5['fromJSON'](_0x410614,this['_document']);return _0x5a31d2['wasUndone']=_0x410614['wasUndone'],_0x5a31d2['_isInit']=_0xdea7a3,_0x5a31d2['_authorId']=_0xdea7a3?null:_0x29439e[_0xc68c54]['userId'],_0x5a31d2['_isDisconnection']='cs:removeUser'===_0x29439e[_0xc68c54]['type'],_0x5a31d2['createdAt']=_0x29439e[_0xc68c54]['createdAt'],_0x5a31d2;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2682ed=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2682ed&&_0x2682ed['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Q extends Error{}function X(_0xa9791d,_0x4cff8f){for(const _0x22879b of _0xa9791d)_0x22879b['baseVersion']=_0x4cff8f++;}class Y{['_ignoredOperations'];['_operationToId'];constructor(_0x1e2cd4){this['_ignoredOperations']=_0x1e2cd4,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x157a41){let _0x4250b5=_0x157a41['length'];for(;_0x4250b5--;){const _0x1c2d91=_0x157a41[_0x4250b5];if(!this['_ignoredOperations']['has'](_0x1c2d91)){if(!this['_operationToId']['has'](_0x1c2d91)){const _0x4b36c5=_0x85443b()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1c2d91,_0x4b36c5);}return this['_operationToId']['get'](_0x1c2d91);}}}['setIdForTheLastOperation'](_0x4f11ac,_0x767b55){if(!_0x767b55)return;let _0x3f7b97=_0x4f11ac['length'];for(;_0x3f7b97--;){const _0x264355=_0x4f11ac[_0x3f7b97];this['_ignoredOperations']['has'](_0x264355)||this['_operationToId']['set'](_0x264355,_0x767b55);}}}class n extends _0x4792c5{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x45e4d4{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x5e36cb)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x153683];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4906ef){super(_0x4906ef),this['_services']=new Map();}async['init'](){const _0x1eae14=this['context'],_0x21624b=_0x1eae14['plugins']['get']('CommentsRepository');if(_0x1eae14['plugins']['get'](c)['addToReconnectionStack'](this),_0x21624b['adapter']={'addCommentThread':async({channelId:_0x34ff33,threadId:_0x2f9596,comments:_0x29932c,resolvedAt:_0x3a0009,resolvedBy:_0x3a75f6,context:_0xd075fd,attributes:_0x5eaa22})=>{const _0x837eb6=await this['_getService'](_0x34ff33)['addCommentThread']({'commentThreadId':_0x2f9596,'comments':_0x29932c['map'](_0x360ae5=>function(_0x27c5a0,_0x520f83,_0x35b1db){return{'commentThreadId':_0x35b1db,'commentId':_0x27c5a0['commentId'],'userId':_0x27c5a0['authorId'],'content':_0x27c5a0['content'],'documentId':_0x520f83,'createdAt':_0x27c5a0['createdAt'],'attributes':_0x27c5a0['attributes']||{}};}(_0x360ae5,_0x34ff33,_0x2f9596)),'resolvedAt':_0x3a0009,'resolvedBy':_0x3a75f6,'context':_0xd075fd,'attributes':_0x5eaa22})['catch'](ut);return{'threadId':_0x837eb6['commentThreadId'],'comments':_0x837eb6['comments']};},'getCommentThread':async({channelId:_0x2f5340,threadId:_0xa6d13b})=>{const _0x42c358=await this['_getService'](_0x2f5340)['getCommentThread'](_0xa6d13b)['catch'](ut);return _0x42c358['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x42c358]),{'threadId':_0x42c358['commentThreadId'],'comments':_0x42c358['comments']['map'](_),'context':_0x42c358['context'],'resolvedAt':_0x42c358['resolvedAt'],'resolvedBy':_0x42c358['resolvedBy'],'attributes':_0x42c358['attributes']||{}});},'updateCommentThread':async({channelId:_0x2b2957,threadId:_0x1c4947,context:_0x3fbb5f,unlinkedAt:_0x5a0b62,attributes:_0x5de605})=>this['_getService'](_0x2b2957)['updateCommentThread']({'commentThreadId':_0x1c4947,'context':_0x3fbb5f,'attributes':_0x5de605,'unlinkedAt':_0x5a0b62})['catch'](S)['catch'](ut),'resolveCommentThread':async({channelId:_0x5cd832,threadId:_0x24a460})=>{const _0x1caefd=await this['_getService'](_0x5cd832)['resolveCommentThread'](_0x24a460)['catch'](S)['catch'](ut);return{'threadId':_0x1caefd['commentThreadId'],'resolvedAt':_0x1caefd['resolvedAt'],'resolvedBy':_0x1caefd['resolvedBy']};},'reopenCommentThread':async({channelId:_0x61181b,threadId:_0x4472e9})=>this['_getService'](_0x61181b)['reopenCommentThread'](_0x4472e9)['catch'](S)['catch'](ut),'removeCommentThread':({channelId:_0x2a12b8,threadId:_0x341347})=>this['_getService'](_0x2a12b8)['removeCommentThread'](_0x341347)['catch'](S)['catch'](ut),'addComment':({channelId:_0x36a3d0,threadId:_0x409cd5,commentId:_0x530c9a,content:_0x572dbc,attributes:_0x3dd5b3})=>this['_getService'](_0x36a3d0)['addComment'](_0x409cd5,_0x530c9a,_0x572dbc,_0x3dd5b3)['catch'](ut),'updateComment':({channelId:_0x110fd6,threadId:_0x5e3397,commentId:_0x515b01,content:_0x21cb9c,attributes:_0x24e7c4})=>this['_getService'](_0x110fd6)['updateComment'](_0x5e3397,_0x515b01,_0x21cb9c,_0x24e7c4)['catch'](S)['catch'](ut),'removeComment':({channelId:_0x1c822a,threadId:_0x2acc6c,commentId:_0x522ba1})=>this['_getService'](_0x1c822a)['removeComment'](_0x2acc6c,_0x522ba1)['catch'](S)['catch'](ut)},_0x1eae14 instanceof _0x550b52){const _0x4d81e9=_0x1eae14['config']['get']('collaboration.channelId'),_0x4bc0d7=_0x1eae14['plugins']['get'](i);await this['_setUpService'](_0x4d81e9);const _0x1443eb=await this['_services']['get'](_0x4d81e9)['getConnectedSessions']();this['listenTo'](_0x4bc0d7,'sessionAdd:'+_0x4d81e9,(_0x128b64,{session:_0x344c30})=>{_0x344c30['id']===_0x4bc0d7['mySessionId']&&(_0x128b64['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x344c30['permissions'],_0x4d81e9));}),_0x4bc0d7['register'](_0x4d81e9,_0x1443eb);}}async['_setUpService'](_0x339cb2){if(this['_services']['has'](_0x339cb2))throw new _0x2cb10f('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x339cb2});const _0x17b8b7=this['context']['plugins']['get']('CommentsRepository'),_0x4dc98d=new a['CommentsService'](_0x339cb2);this['_services']['set'](_0x339cb2,_0x4dc98d),this['listenTo'](_0x4dc98d,'commentThreadAdded',(_0x53680f,_0x22e539)=>{const {commentThreadId:_0x2f592f,documentId:_0x1f91f3,context:_0x11a599,attributes:_0x34d5a4,resolvedAt:_0x4d4b08,resolvedBy:_0x1098cf,comments:_0x432ec4}=_0x22e539;_0x17b8b7['getCommentThread'](_0x2f592f)||_0x17b8b7['addCommentThread']({'threadId':_0x2f592f,'channelId':_0x1f91f3,'comments':_0x432ec4?_0x432ec4['map'](_):[],'context':_0x11a599,'attributes':_0x34d5a4,'resolvedAt':_0x4d4b08,'resolvedBy':_0x1098cf,'isFromAdapter':!0x0});}),this['listenTo'](_0x4dc98d,'commentThreadUpdated',(_0x44c98f,{commentThreadId:_0x4c0443,documentId:_0x18b181,context:_0x3d8539,unlinkedAt:_0x23818f,attributes:_0x5231a3})=>{_0x17b8b7['getCommentThread'](_0x4c0443)&&_0x17b8b7['updateCommentThread']({'threadId':_0x4c0443,'channelId':_0x18b181,'context':_0x3d8539,'unlinkedAt':_0x23818f,'attributes':_0x5231a3,'isFromAdapter':!0x0});}),this['listenTo'](_0x4dc98d,'commentThreadResolved',(_0x4f3cd3,{commentThreadId:_0x1130dc,resolvedBy:_0x183718,resolvedAt:_0x33b52a})=>{const _0x1d7a3d=_0x17b8b7['getCommentThread'](_0x1130dc);_0x1d7a3d&&_0x1d7a3d['resolve']({'resolvedBy':_0x183718,'resolvedAt':_0x33b52a,'isFromAdapter':!0x0});}),this['listenTo'](_0x4dc98d,'commentThreadReopened',(_0x231773,{commentThreadId:_0x9536f9})=>{const _0x48c462=_0x17b8b7['getCommentThread'](_0x9536f9);_0x48c462&&_0x48c462['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x4dc98d,'commentThreadRemoved',(_0x12be0a,{commentThreadId:_0xb7e7ff})=>{const _0x1365bd=_0x17b8b7['getCommentThread'](_0xb7e7ff);_0x1365bd&&_0x1365bd['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x4dc98d,'commentAdded',(_0x321374,_0x12b80f)=>{const _0x5a507d=_0x12b80f['commentThreadId'],_0x35fee6=_0x17b8b7['getCommentThread'](_0x5a507d);_0x35fee6&&_0x35fee6['addComment']({..._(_0x12b80f),'isFromAdapter':!0x0});}),this['listenTo'](_0x4dc98d,'commentUpdated',(_0x2abec5,{commentThreadId:_0x59163a,commentId:_0x32c3bf,content:_0x2e2de3,attributes:_0x4ebffc})=>{const _0x38648e=_0x17b8b7['getCommentThread'](_0x59163a);if(_0x38648e){const _0x5834e8=_0x38648e['getComment'](_0x32c3bf);_0x5834e8&&_0x5834e8['update']({'content':_0x2e2de3,'attributes':_0x4ebffc,'isFromAdapter':!0x0});}}),this['listenTo'](_0x4dc98d,'commentRemoved',(_0x18d5e4,{commentThreadId:_0x20181a,commentId:_0x1b821f})=>{const _0x5e7455=_0x17b8b7['getCommentThread'](_0x20181a);if(_0x5e7455){const _0x4ebc7a=_0x5e7455['getComment'](_0x1b821f);_0x4ebc7a&&_0x4ebc7a['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x339cb2);}['destroy'](){if(this['context']instanceof _0x550b52){const _0x443c94=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x443c94);}}['_terminateService'](_0x513b3e){if(!this['_services']['has'](_0x513b3e))throw new _0x2cb10f('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x513b3e});this['_getService'](_0x513b3e)['disconnect'](),this['_services']['delete'](_0x513b3e);}async['reconnect'](){for(const _0x358292 of this['_services']['keys']())await this['_connectService'](_0x358292);if(this['context']instanceof _0x550b52){const _0x30f8d4=this['context']['config']['get']('collaboration.channelId'),_0x4c6449=this['context']['plugins']['get'](i);_0x4c6449['unregister'](_0x30f8d4);const _0x1bd68e=await this['_services']['get'](_0x30f8d4)['getConnectedSessions']();_0x4c6449['register'](_0x30f8d4,_0x1bd68e);}}async['_connectService'](_0x499033){const {connection:_0x5b5341}=this['context']['plugins']['get'](c),_0x1e6f4a=this['context']['plugins']['get']('CommentsRepository'),_0x2e1474=this['_services']['get'](_0x499033),_0x7a8a60=await _0x2e1474['connect'](_0x5b5341);await this['_fetchMissingUsersForThreads'](_0x7a8a60);const _0x17407f=new Set(Array['from'](_0x1e6f4a['getCommentThreads']({'channelId':_0x499033}),_0x590b75=>_0x590b75['id']));for(const _0x147c24 of _0x7a8a60)_0x147c24['deletedAt']||_0x17407f['delete'](_0x147c24['commentThreadId']);for(const _0x144e42 of _0x17407f)_0x1e6f4a['getCommentThread'](_0x144e42)['remove']({'isFromAdapter':!0x0});for(const _0xe057b3 of _0x7a8a60){let _0x105620=_0x1e6f4a['getCommentThread'](_0xe057b3['commentThreadId']);const {commentThreadId:_0x2b3098,context:_0x2a89a8,attributes:_0x47591f,resolvedBy:_0x577a35,resolvedAt:_0x336d9c,unlinkedAt:_0x5bba1b,deletedAt:_0x304955}=_0xe057b3;if(_0x304955)continue;_0x105620||(_0x105620=_0x1e6f4a['addCommentThread']({'channelId':_0x499033,'threadId':_0x2b3098,'context':_0x2a89a8,'attributes':_0x47591f||{},'resolvedBy':_0x577a35,'resolvedAt':_0x336d9c,'unlinkedAt':_0x5bba1b,'isFromAdapter':!0x0}));const _0x230d50=new Set(Array['from'](_0x105620['comments'],_0x447ee5=>_0x447ee5['id']));for(const _0x5060ef of _0xe057b3['comments'])_0x230d50['delete'](_0x5060ef['commentId']);for(const _0xb21305 of _0x230d50)_0x105620['getComment'](_0xb21305)['remove']({'isFromAdapter':!0x0});for(const _0x3ad14b of _0xe057b3['comments']){const _0x4a1143=_0x105620['getComment'](_0x3ad14b['commentId']);_0x4a1143?_0x4a1143['content']!==_0x3ad14b['content']&&_0x4a1143['update']({'content':_0x3ad14b['content'],'isFromAdapter':!0x0}):_0x105620['addComment'](Object['assign'](_(_0x3ad14b),{'isFromAdapter':!0x0}));}}}['_getService'](_0x17d0b3){if(!this['_services']['has'](_0x17d0b3))throw new _0x2cb10f('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x17d0b3});return this['_services']['get'](_0x17d0b3);}async['_fetchMissingUsersForThreads'](_0x418de3){const _0x2c43c2=this['context']['plugins']['get'](_0x153683),{connection:_0x37b497}=this['context']['plugins']['get'](c),_0x156bb1=new Set();for(const {resolvedBy:_0x36a098,comments:_0x43cafa}of _0x418de3){_0x36a098&&!_0x2c43c2['getUser'](_0x36a098)&&_0x156bb1['add'](_0x36a098);for(const {userId:_0x2a2c4b}of _0x43cafa)_0x2c43c2['getUser'](_0x2a2c4b)||_0x156bb1['add'](_0x2a2c4b);}if(0x0===_0x156bb1['size'])return;const _0x4bd4f7=await dt['getMany'](_0x37b497,Array['from'](_0x156bb1));for(const _0x2d582d of _0x4bd4f7)_0x2c43c2['getUser'](_0x2d582d['id'])||_0x2c43c2['addUser'](_0x2d582d);}}async function S(_0x59d6c4){if('404'!==_0x59d6c4['code'])throw _0x59d6c4;}function ut(_0x1a7fab){if((_0x43efd7=_0x1a7fab)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x43efd7['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x43efd7['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x43efd7;throw _0x1a7fab;}function _(_0x40d1b2){return{'threadId':_0x40d1b2['commentThreadId'],'commentId':_0x40d1b2['commentId'],'content':_0x40d1b2['content'],'createdAt':_0x40d1b2['createdAt'],'authorId':_0x40d1b2['userId'],'attributes':_0x40d1b2['attributes']||{}};}class f extends _0x4792c5{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(_0x4fb60e){super(_0x4fb60e);const _0x5dafb3=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x5dafb3);}['init'](){const _0x43e5e6=this['editor']['plugins']['get'](c),_0x57c7ec=this['editor']['plugins']['get']('TrackChangesEditing');return _0x57c7ec['adapter']={'getSuggestion':async _0x35b9af=>{await this['_waitForServiceReady']();const _0x444583=await this['_trackChangesService']['get'](_0x35b9af)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x444583]),_0x444583;},'addSuggestion':async({id:_0x147db8,type:_0x5d1ba1,data:_0x8b2e60,originalSuggestionId:_0x3eb2c2,attributes:_0x3bd3fb})=>{await this['_waitForServiceReady']();const _0x181e47={'id':_0x147db8,'type':_0x5d1ba1,'data':_0x8b2e60,'originalSuggestionId':_0x3eb2c2,'attributes':_0x3bd3fb},_0x35ca1d=await this['_trackChangesService']['add'](_0x147db8,_0x5d1ba1,_0x8b2e60,_0x3eb2c2,_0x3bd3fb)['catch'](_0xfa6664=>{if(ft(_0xfa6664))return new Promise(_0x197ac0=>{this['_bufferedRequests']['set'](_0x147db8,{'resolve':_0x197ac0,'suggestionData':_0x181e47});});throw _0xfa6664;});return this['_bufferedRequests']['delete'](_0x147db8),_0x35ca1d;},'updateSuggestion':async(_0x287348,_0x2076b9)=>{if(await this['_waitForServiceReady'](),'open'!==_0x2076b9['state'])return this['_trackChangesService']['update'](_0x287348,_0x2076b9)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x510c18,_0x454521)=>{_0x57c7ec['hasSuggestion'](_0x454521['id'])&&(_0x57c7ec['getSuggestion'](_0x454521['id'])['attributes']=_0x454521['attributes']);}),this['_trackChangesService']['connect'](_0x43e5e6['connection'])['then'](_0x1e27d9=>(_0x43e5e6['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x1e27d9)['then'](()=>{for(const _0x23b665 of _0x1e27d9){_0x57c7ec['addSuggestionData'](_0x23b665)['_saved']=!0x0;}})));}async['reconnect'](){const _0x4a3a99=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x278d7c}=this['editor']['plugins']['get'](c),_0x25cdbc=await this['_trackChangesService']['connect'](_0x278d7c);await this['_fetchMissingUsersForThreads'](_0x25cdbc);for(const {suggestionData:_0x29c0ac,resolve:_0x56ab78}of this['_bufferedRequests']['values']()){let _0x579d6f=_0x25cdbc['find'](_0x429149=>_0x429149['id']===_0x29c0ac['id']);_0x579d6f||(_0x579d6f=await this['_trackChangesService']['add'](_0x29c0ac['id'],_0x29c0ac['type'],_0x29c0ac['data'],_0x29c0ac['originalSuggestionId'])),_0x56ab78(_0x579d6f);}for(const _0x5a0a78 of _0x25cdbc)_0x4a3a99['hasSuggestion'](_0x5a0a78['id'])||_0x4a3a99['addSuggestionData'](_0x5a0a78);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x1e7d18=>{this['listenTo'](this['_trackChangesService'],'connected',_0x448c68=>{_0x448c68['off'](),_0x1e7d18();});});}async['_fetchMissingUsersForThreads'](_0x2a0d3b){const _0x21e0ec=this['editor']['plugins']['get'](_0x153683),{connection:_0xbd0da0}=this['editor']['plugins']['get'](c),_0x3e07e2=new Set();for(const {authorId:_0x1ef11a}of _0x2a0d3b)_0x21e0ec['getUser'](_0x1ef11a)||_0x3e07e2['add'](_0x1ef11a);if(0x0===_0x3e07e2['size'])return;const _0x31cce9=await dt['getMany'](_0xbd0da0,Array['from'](_0x3e07e2));for(const _0x2ff2b3 of _0x31cce9)_0x21e0ec['getUser'](_0x2ff2b3['id'])||_0x21e0ec['addUser'](_0x2ff2b3);}}function R(_0x1c5c7e){if(ft(_0x1c5c7e))return new Promise(()=>{});throw _0x1c5c7e;}function ft(_0x5c1e9c){return _0x5c1e9c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5c1e9c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x4792c5{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 _0x52ac20=this['editor']['plugins']['get'](c),_0x5c80a2=this['editor']['plugins']['get']('CommentsEditing'),_0x32125f=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x52ac20,'change:state',(_0x29a51c,_0x21d2b5,_0x2599b4)=>{_0x5c80a2['isThreadsLoadingPaused']='connected'!==_0x2599b4;});}),this['listenTo'](_0x52ac20,'change:state',(_0x9f5be7,_0x316567,_0x489a93)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x489a93);}),_0x32125f['_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 _0x4792c5{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 _0x4792c5{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x153683];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x572090){super(_0x572090);const _0x41b138=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x41b138);}async['init'](){const _0x38b532=this['editor']['plugins']['get'](l),_0x51efeb=_0x38b532['serverHistory'],_0x513995=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x51efeb,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x38b532['sessionId']});const _0x239381=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x454861=await tt['isBundleUploaded'](_0x513995['connection'],_0x239381);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x1324d3})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x1324d3)),'updateRevisions':async _0x455397=>{await this['_waitForServiceReady']();const _0x120999=this['_revisionTracker']['currentRevision'];if(_0x454861&&0x1===_0x455397['length']&&_0x455397[0x0]['id']===_0x120999['id'])return _0x455397;for(const _0x181495 of _0x455397)_0x181495['id']===_0x120999['id']&&(_0x181495['isEmptyCurrent']=_0x181495['fromVersion']===_0x181495['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x455397,this['_lastRequestId'])['then'](_0x582bd6=>(this['_lastRequestId']=_0x582bd6,_0x455397))['catch'](_0x4b4745=>{if(st(_0x4b4745)||'400'===_0x4b4745['code']&&void 0x0!==_0x4b4745['data']['wrongRequestId']){for(const _0x220fbc of _0x455397){!this['_revisionTracker']['repository']['getRevision'](_0x220fbc['id'])||this['_revisionTracker']['_bufferUpdate'](_0x220fbc['id'],_0x220fbc,!0x1);}if(st(_0x4b4745))throw _0x4b4745;return _0x455397;}throw _0x4b4745;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0xacdb8c,{revisionsData:_0x411165,requestId:_0x3aac6f})=>{Math['max'](..._0x411165['map'](_0x1b6640=>_0x1b6640['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x411165,_0x3aac6f);}):this['_handleRevisionsUpdate'](_0x411165,_0x3aac6f);});const {revisions:_0x4758a0,requestId:_0x23b57e}=await this['_revisionHistoryService']['connect'](_0x513995['connection']);_0x513995['addToReconnectionStack'](this),this['_lastRequestId']=_0x23b57e,await this['_fetchMissingUsers'](_0x4758a0);for(const _0x3ab796 of _0x4758a0)this['_revisionTracker']['addRevisionData'](_0x3ab796);this['listenTo'](_0x38b532,'change:_isConnected',(_0x42c8fc,_0xd5c76,_0x2119ec)=>{_0x2119ec&&(this['_oldOffset']=_0x38b532['_offset'],_0x42c8fc['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x513995,'state',_0x42cb80=>_0x42cb80===_0x5ba7c6['CONNECTED']);}async['reconnect'](){const _0xed4a3=this['editor']['plugins']['get'](c),_0x32f3fa=this['editor']['plugins']['get'](l),_0xd56e36=async()=>{const _0x2af023=this['_revisionTracker']['currentRevision'],_0x1ffa22=_0x2af023['id'],_0x40d4e4=_0x1ffa22!==_0x32f3fa['sessionId'];if(_0x40d4e4){const _0x3d9724=_0x32f3fa['_offset']-this['_oldOffset'],_0x182ce5=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x2af023['toVersion']+_0x3d9724!==_0x182ce5){const _0x413e85=_0x2af023['fromVersion']+_0x3d9724,_0x355714=this['editor']['plugins']['get'](_0x153683),_0x18de86=this['_revisionTracker']['buildRevisionData']({'revision':_0x2af023,'from':_0x413e85,'to':_0x182ce5});_0x18de86['id']=_0x2af023['id'];const _0x3d97fe=_0x18de86['authorsIds']['map'](_0x478683=>_0x355714['getUser'](_0x478683));_0x2af023['_update']({..._0x18de86,'authors':_0x3d97fe},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2af023['id'],_0x18de86,!0x0);}this['_revisionTracker']['_startingVersion']=_0x182ce5,(_0x2af023['toVersion']===_0x2af023['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x1ffa22)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x1ffa22),this['_revisionTracker']['_createCurrentRevision'](_0x182ce5));}const {revisions:_0x3518f9,requestId:_0x61fe8f}=await this['_revisionHistoryService']['reconnect'](_0xed4a3['connection'],this['_lastRequestId']);_0x40d4e4&&_0x3518f9['length']>0x0?_0x32f3fa['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3518f9),this['_handleRevisionsUpdate'](_0x3518f9,_0x61fe8f),this['_revisionTracker']['sendBufferedUpdates']());};return _0x32f3fa['_isConnected']?_0xd56e36():new Promise((_0x38533e,_0x2811b3)=>{_0x32f3fa['once']('change:_isConnected',()=>{_0xd56e36()['then'](_0x38533e)['catch'](_0x2811b3);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4e83c1=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x5987b6=>{_0x5987b6['off'](),_0x4e83c1();});});}['_getLatestVersionFromServerOperations'](){const _0x237186=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1936da of _0x237186)if('marker'!==_0x1936da['type']||_0x1936da['affectsData'])return _0x1936da['baseVersion']+0x1;}['_getLatestVersion'](){const _0x5e424f=this['editor']['plugins']['get'](l);return new Promise(_0x507255=>{_0x5e424f['_isPendingUpdate']?_0x5e424f['once']('change:_isPendingUpdate',()=>{_0x507255(this['_getLatestVersionFromServerOperations']());}):_0x507255(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x26647f,_0x4b03de){const _0x20c38d=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x4b03de;for(const _0x109dca of _0x26647f){const _0x44252d=_0x20c38d['getRevision'](_0x109dca['id']);if(_0x44252d){if((_0x109dca['fromVersion']||_0x109dca['toVersion'])&&(_0x109dca['diffData']=null),_0x44252d===this['_revisionTracker']['currentRevision']){const _0x37fa79=Math['max'](_0x44252d['toVersion'],_0x109dca['toVersion']),_0x4f819f=Math['max'](_0x44252d['fromVersion'],_0x109dca['fromVersion']);let _0x1e06ae;_0x44252d['toVersion']===_0x109dca['toVersion']&&_0x44252d['fromVersion']===_0x109dca['fromVersion']?(_0x1e06ae=!0x0,this['_preventResendingRevisionData'](_0x109dca)):_0x109dca['toVersion']===_0x37fa79&&_0x109dca['fromVersion']===_0x4f819f?_0x1e06ae=!0x1:(_0x44252d['toVersion']===_0x37fa79&&_0x44252d['fromVersion']===_0x4f819f||this['_fixRevision']({'revision':_0x44252d,'from':_0x4f819f,'to':_0x37fa79}),_0x1e06ae=!0x0),_0x1e06ae&&(delete _0x109dca['fromVersion'],delete _0x109dca['toVersion'],delete _0x109dca['diffData'],delete _0x109dca['createdAt'],delete _0x109dca['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x109dca),this['_preventResendingRevisionData'](_0x109dca);}else this['_revisionTracker']['addRevisionData'](_0x109dca);}const _0x2b51ce=_0x20c38d['getRevisions']();_0x2b51ce['reverse']();for(let _0x126356=0x0;_0x126356<_0x2b51ce['length']-0x1;_0x126356++){const _0x1c5780=_0x2b51ce[_0x126356],_0xaf00b9=_0x2b51ce[_0x126356+0x1];if(_0x1c5780['fromVersion']<_0xaf00b9['toVersion']){const _0x526e96=_0xaf00b9['toVersion'],_0x32b0ea=Math['max'](_0x526e96,_0x1c5780['toVersion']);this['_fixRevision']({'revision':_0x1c5780,'from':_0x526e96,'to':_0x32b0ea});}}}['_fixRevision']({revision:_0x115b6a,from:_0x1c629f,to:_0x2ccaea}={}){const _0x2b558e=this['editor']['plugins']['get'](_0x153683),_0x16d428=this['_revisionTracker']['buildRevisionData']({'revision':_0x115b6a,'from':_0x1c629f,'to':_0x2ccaea});_0x16d428['authors']=_0x16d428['authorsIds']['map'](_0x596626=>_0x2b558e['getUser'](_0x596626)),_0x115b6a['_update'](_0x16d428);}['_preventResendingRevisionData'](_0x5c723d){const _0x41b5c2={};_0x41b5c2['id']=_0x5c723d['id'];for(const _0x2b3b1b of Object['keys'](_0x5c723d))'id'!==_0x2b3b1b&&(_0x41b5c2[_0x2b3b1b]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x41b5c2['id'],_0x41b5c2,!0x0);}async['_fetchMissingUsers'](_0x310675){const _0xe4fefc=this['editor']['plugins']['get'](_0x153683),{connection:_0x18ad2e}=this['editor']['plugins']['get'](c),_0x2d38a3=new Set();for(const _0x3e35b0 of _0x310675){for(const _0xcfc0dd of _0x3e35b0['authorsIds'])_0x237b51(_0xcfc0dd);_0x3e35b0['creatorId']&&_0x237b51(_0x3e35b0['creatorId']);}if(0x0===_0x2d38a3['size'])return;const _0x2be753=await dt['getMany'](_0x18ad2e,Array['from'](_0x2d38a3));for(const _0x36721b of _0x2be753)_0xe4fefc['getUser'](_0x36721b['id'])||_0xe4fefc['addUser'](_0x36721b);function _0x237b51(_0x599ab3){_0xe4fefc['getUser'](_0x599ab3)||_0x2d38a3['add'](_0x599ab3);}}}function st(_0x18af2d){return _0x18af2d['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x18af2d['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x18af2d['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x4792c5{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 _0x295a75{['_collapseAt'];constructor(_0x346a70,_0x4619f8=0x6){super(_0x346a70);const _0x161619=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x4619f8,this['bind']('isHidden')['to'](this,'usersCount',_0x1b5217=>_0x1b5217<_0x4619f8),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x161619['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':_0x161619['to']('usersCount',_0x46af76=>'+'+(_0x46af76-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x295a75{['items'];['keystrokes'];constructor(_0x44259b){super(_0x44259b);const _0x3a2c47=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x4044d4(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x3a2c47['if']('hasPopup'),'aria-expanded':_0x3a2c47['to']('isExpanded',_0x4c3df1=>this['hasPopup']&&String(_0x4c3df1)),'aria-label':_0x3a2c47['to']('hasPopup',_0x235ce4=>G(_0x44259b,_0x235ce4?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x3a2c47['to']('hasPopup',_0x272daa=>!!_0x272daa&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x3a2c47['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x3a2c47['to'](_0x578503=>{const _0x5202e0=_0x578503,_0x3fbfc3=document['querySelector']('.ck-presence-list__dropdown-list'),_0x626766=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3fbfc3?.['contains'](_0x5202e0['relatedTarget'])||_0x626766?.['contains'](_0x5202e0['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x3918c8,_0x33ebff,_0xa85ab5)=>{this['element']&&(_0xa85ab5?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 _0x295a75{['counterView'];['inlineListView'];constructor(_0x41740d,_0x3ce211=0x6){super(_0x41740d);const _0x16273a=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x3ce211),this['inlineListView']=new ts(_0x41740d),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0xd569d6 of this['inlineListView']['items'])_0xd569d6['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',_0x16273a['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x295a75{['listWrapperView'];constructor(_0x198415,_0x24786e){super(_0x198415);const _0x1e916f=this['bindTemplate'];this['listWrapperView']=new mt(_0x198415,_0x24786e),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':G(_0x198415,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x1e916f['to'](_0x1f781f=>{const _0xf3d485=_0x1f781f,_0x4dc42f=document['querySelector']('.ck-presence-list__list'),_0x54c860=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4dc42f?.['contains'](_0xf3d485['relatedTarget'])||_0x54c860?.['contains'](_0xf3d485['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class mt extends _0x372256{constructor(_0x400369,_0x4d2633){super(_0x400369);const _0x471b02=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x4d2633?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x471b02['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x471b02['to']('role'),'aria-label':_0x471b02['to']('ariaLabel'),'aria-labelledby':_0x471b02['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x19cda2['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x52e820=this['element'];_0x52e820&&(this['_isScrollable']=Math['max'](_0x52e820['scrollHeight'],_0x52e820['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x1deed1,_0x2aad23,_0xb52c08){super(_0x1deed1);const _0x18490a=this['bindTemplate'];this['userView']=new ct(_0x1deed1,_0x2aad23);const _0x56645d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x2aad23['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x2aad23['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2aad23['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0xb52c08&&(_0x56645d['tag']='button',_0x56645d['on']={'click':_0x18490a['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x56645d);}['focus'](){this['element']['focus']();}}class y extends _0x295a75{['userView'];['markerView'];constructor(_0x13ba34,_0x3a9583,_0x3a1cc3){super(_0x13ba34);const _0x5b0302=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x13ba34,_0x3a9583),this['markerView']=new at(_0x13ba34,_0x3a9583);const _0x1a6b08=new ot(_0x13ba34);_0x1a6b08['template']['tag']='span',_0x1a6b08['text']=_0x3a9583['name'];const _0x515766={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x5b0302['to']('isFocusable',_0x4533b2=>!!_0x4533b2&&0x0),'aria-labelledby':_0x1a6b08['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x5b0302['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x5b0302['to']('hasTooltip',_0x42fe0a=>!_0x42fe0a),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x1a6b08]};_0x3a1cc3&&(_0x515766['tag']='button',_0x515766['on']={'click':_0x5b0302['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x515766);}}class at extends _0x295a75{constructor(_0x2185df,_0x2becf7){super(_0x2185df),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2becf7['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x45e4d4{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x57d51d){super(_0x57d51d),this['context']['config']['define']('presenceList',C);const _0x51f12b=_0x57d51d['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x51f12b)throw new _0x2cb10f('presencelist-collapseat-invalid-format',this);if(_0x51f12b<0x1)throw new _0x2cb10f('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x44a5db(),this['balloonPanelView']=new _0x15cb5a(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x574436 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x574436);this['listenTo'](this['_allConnectedUsers'],'add',(_0x3399ce,_0x2972e2)=>{this['_handleUserAdd'](_0x2972e2);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x5c3314,_0x30ec7f)=>{this['_handleUserRemove'](_0x30ec7f);});}['_createView'](){const _0x15eb25=this['context'],_0x3c0ad6=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x2041df=this['balloonPanelView'];if(!_0x227d9d(_0x15eb25['config']['get']('presenceList.container')))throw new _0x2cb10f('presencelist-missing-container',this);return _0x3c0ad6['counterView']['bind']('usersCount')['to'](this),_0x3c0ad6['bind']('isCollapsed')['to'](this,'usersCount',_0x142c96=>{const {collapseAt:_0x118f27}=_0x15eb25['config']['get']('presenceList'),_0x2bc9e3=_0x142c96>=_0x118f27;if(_0x2bc9e3&&!_0x3c0ad6['inlineListView']['items']['find'](_0x1ad1b9=>_0x1ad1b9 instanceof A)){const _0x5e672b=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x5e672b&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x3c0ad6['inlineListView']['items']['add'](_0x3c0ad6['counterView']);}return _0x2bc9e3||this['hideDropdown'](),_0x2bc9e3;}),_0x3c0ad6['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x18023e=>{const _0x2ecca7=_0x15eb25['config']['get']('presenceList'),_0xde9fcc=new y(_0x15eb25['locale'],_0x18023e,!!_0x2ecca7['onClick']);return _0xde9fcc['bind']('hasTooltip')['to'](_0x3c0ad6,'isCollapsed',_0x2684fa=>!_0x2684fa),_0xde9fcc['bind']('isFocusable')['to'](_0x3c0ad6,'isCollapsed',_0x156920=>!_0x156920),_0x2ecca7['onClick']&&this['listenTo'](_0xde9fcc,'execute',()=>{this['view']['isCollapsed']||_0x2ecca7['onClick'](_0x18023e,_0xde9fcc['element']);}),_0xde9fcc;}),this['listenTo'](_0x3c0ad6['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x3c0ad6['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x3c0ad6['inlineListView']['keystrokes']['set']('Enter',(_0x2198c6,_0xb6e668)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0xb6e668());}),_0x3c0ad6['render'](),_0x2041df['render'](),_0x4f52d2({'emitter':_0x3c0ad6,'activator':()=>_0x2041df['isVisible'],'contextElements':[_0x2041df['element'],_0x3c0ad6['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x15eb25['config']['get']('presenceList.container')['appendChild'](_0x3c0ad6['element']),this['_bodyCollection']=new _0x24a730(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x3c0ad6;}['_handleUserAdd'](_0x38cbf7){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x38cbf7['isMe'])return;const _0x20da04=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x20da04-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x1a8f36=_0x38cbf7['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x38cbf7,_0x1a8f36);}['_handleUserRemove'](_0x1448fd){this['usersCount']--;const {collapseAt:_0x6aed91}=this['context']['config']['get']('presenceList'),_0x450b99=this['usersCount']>=_0x6aed91;if(this['currentDisplayedUsers']['get'](_0x1448fd['id']))this['currentDisplayedUsers']['remove'](_0x1448fd['id']);else{if(_0x450b99&&this['currentDisplayedUsers']['length']+0x1===_0x6aed91-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x450b99?0x1:0x0)<this['usersCount']){for(const _0x35011e of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x35011e['id'])&&(this['currentDisplayedUsers']['add'](_0x35011e,Math['min'](this['currentDisplayedUsers']['length']-(_0x450b99?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x450b99?0x1:0x0)===_0x6aed91-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x5e81bc=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x5e81bc['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x1b2a78}=this['presenceDropdownView'];_0x1b2a78['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4bf15f=>{if(!_0x5e81bc['displayMe']&&_0x4bf15f['isMe'])return null;const _0x46bf78=new k(this['context']['locale'],_0x4bf15f,!!_0x5e81bc['onClick']);return _0x5e81bc['onClick']&&this['listenTo'](_0x46bf78,'execute',()=>{_0x5e81bc['onClick'](_0x4bf15f,_0x46bf78['element']);}),_0x46bf78;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x1b2a78['focus'](),_0x1b2a78['checkIfScrollable']();const _0x4b06fe=(_0x2dfd0e,_0x5bcda2)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x5bcda2();};_0x1b2a78['keystrokes']['set']('Esc',_0x4b06fe),_0x1b2a78['keystrokes']['set']('Shift+Tab',_0x4b06fe),_0x1b2a78['keystrokes']['set']('Tab',(_0x48ed77,_0x35a9b8)=>{!function(_0x158402){const _0x3cba1a=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x224ca0=>_0x224ca0+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xb09665=[...document['body']['querySelectorAll'](_0x3cba1a)]['filter'](_0x5b6868=>_0x5b6868===document['activeElement']||_0x5b6868['offsetWidth']+_0x5b6868['offsetHeight']>0x0)['sort']((_0xa7c112,_0x2c191c)=>(_0xa7c112['tabIndex']||0x0)-(_0x2c191c['tabIndex']||0x0)),_0x126f01=_0xb09665['indexOf'](_0x158402),_0x316266=_0xb09665[(_0x126f01+0x1)%_0xb09665['length']];_0x316266&&_0x316266['focus']();}(this['view']['element']),this['hideDropdown'](),_0x35a9b8();}),_0x1b2a78['focusTracker']['add'](this['view']['element']),_0x1b2a78['focusTracker']['on']('change:isFocused',(_0x351cff,_0x56ef95,_0xa91616)=>{_0xa91616||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 _0x45e4d4{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':_0x2b5951=>0x1!=_0x2b5951}};
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':_0x38d0da=>0x1!=_0x38d0da}};