@ckeditor/ckeditor5-real-time-collaboration 36.0.1 → 37.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/package.json +22 -5
  3. package/src/augmentation.d.ts +57 -0
  4. package/src/augmentation.js +23 -0
  5. package/src/common-translations.d.ts +5 -0
  6. package/src/common-translations.js +1 -1
  7. package/src/config.d.ts +33 -0
  8. package/src/config.js +23 -0
  9. package/src/index.d.ts +9 -0
  10. package/src/index.js +1 -1
  11. package/src/presencelist/presencelistui.d.ts +38 -0
  12. package/src/presencelist/presencelistui.js +1 -1
  13. package/src/presencelist/view/presencecounterview.d.ts +7 -0
  14. package/src/presencelist/view/presencecounterview.js +1 -1
  15. package/src/presencelist/view/presencedropdownlistitemview.d.ts +7 -0
  16. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  17. package/src/presencelist/view/presencedropdownlistview.d.ts +6 -0
  18. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  19. package/src/presencelist/view/presenceinlinelistitemview.d.ts +14 -0
  20. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  21. package/src/presencelist/view/presenceinlinelistview.d.ts +7 -0
  22. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  23. package/src/presencelist/view/presencelistview.d.ts +11 -0
  24. package/src/presencelist/view/presencelistview.js +1 -1
  25. package/src/presencelist.d.ts +22 -0
  26. package/src/presencelist.js +1 -1
  27. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +42 -0
  28. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
  29. package/src/realtimecollaborativecomments.d.ts +29 -0
  30. package/src/realtimecollaborativecomments.js +1 -1
  31. package/src/realtimecollaborativeediting/realtimecollaborationclient.d.ts +119 -0
  32. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
  33. package/src/realtimecollaborativeediting/sessions.d.ts +114 -0
  34. package/src/realtimecollaborativeediting/sessions.js +1 -1
  35. package/src/realtimecollaborativeediting/usermarkers.d.ts +31 -0
  36. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  37. package/src/realtimecollaborativeediting/websocketgateway.d.ts +51 -0
  38. package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
  39. package/src/realtimecollaborativeediting.d.ts +21 -0
  40. package/src/realtimecollaborativeediting.js +1 -1
  41. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +38 -0
  42. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
  43. package/src/realtimecollaborativerevisionhistory.d.ts +23 -0
  44. package/src/realtimecollaborativerevisionhistory.js +1 -1
  45. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +34 -0
  46. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
  47. package/src/realtimecollaborativetrackchanges.d.ts +21 -0
  48. package/src/realtimecollaborativetrackchanges.js +1 -1
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x28a5=['hasCommentThread','add','startsWith','listenTo','connect','reconnect','collaboration.channelId','removeComment','getConnectedSessions','has','size','plugins','remove','keys','updateComment','map','register','_terminateService','unregister','_connectService','cloudservicescommentsadapter-connect-already-connected','getCommentThreads','requires','content','CommentsRepository','getUser','permissions','commentAdded','cloudservicescommentsadapter-disconnect-not-exist','off','sessionAdd:','update','message','_services','removeCommentThread','destroy','CommentsService','code','cloud-services-internal-error:\x20Not\x20connected.','_setUpService','_getService','commentId','addComment','disconnect','delete','cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.','attributes','createdAt','catch','getMany','Permissions','_fetchMissingUsersForThreads','getComment','cloud-services-internal-error:\x20Request\x20timeout.','addCommentThread','404','from','commentUpdated','context','assign','cloudservicescommentsadapter-service-not-exist','get','adapter','commentRemoved','getCommentThread','mySessionId','config','userId','comments','commentThreadId'];(function(_0x2e0fe6,_0x28a50f){const _0x37c799=function(_0x5bba4c){while(--_0x5bba4c){_0x2e0fe6['push'](_0x2e0fe6['shift']());}};_0x37c799(++_0x28a50f);}(_0x28a5,0x125));const _0x37c7=function(_0x2e0fe6,_0x28a50f){_0x2e0fe6=_0x2e0fe6-0x0;let _0x37c799=_0x28a5[_0x2e0fe6];return _0x37c799;};import{Context as _0x2b6e99,ContextPlugin as _0x472cfa}from'ckeditor5/src/core';import{CKEditorError as _0x3c4994}from'ckeditor5/src/utils';import{Users as _0x54a4a6}from'ckeditor5-collaboration/src/collaboration-core';import _0x15ceb6 from'@ckeditor/ckeditor-cloud-services-collaboration/src/users/user';import _0x5a7e52 from'@ckeditor/ckeditor-cloud-services-collaboration/src/comments-v2/commentsservice';import _0x2bb57f from'../realtimecollaborativeediting/websocketgateway';import _0x1f5d40 from'../realtimecollaborativeediting/sessions';export default class a extends _0x472cfa{static get[_0x37c7('0x9')](){return[_0x2bb57f,'CommentsRepository',_0x1f5d40,_0x54a4a6];}constructor(_0x472d77){super(_0x472d77),this[_0x37c7('0x14')]=new Map();}async['init'](){const _0x9b2ecc=this[_0x37c7('0x2d')],_0x266de5=_0x9b2ecc[_0x37c7('0x44')][_0x37c7('0x30')]('CommentsRepository');if(_0x9b2ecc['plugins'][_0x37c7('0x30')](_0x2bb57f)['addToReconnectionStack'](this),_0x266de5[_0x37c7('0x31')]={'getCommentThread':async({channelId:_0x2c3b79,threadId:_0x5204c3})=>{const _0x162e6c=await this[_0x37c7('0x1b')](_0x2c3b79)[_0x37c7('0x33')](_0x5204c3)['catch'](tt);return await this['_fetchMissingUsersForThreads']([_0x162e6c]),{'threadId':_0x162e6c[_0x37c7('0x38')],'comments':_0x162e6c[_0x37c7('0x37')][_0x37c7('0x2')](et)};},'removeCommentThread':({channelId:_0x1db40d,threadId:_0x5778d5})=>this[_0x37c7('0x1b')](_0x1db40d)[_0x37c7('0x15')](_0x5778d5)[_0x37c7('0x23')](Z)['catch'](tt),'addComment':({channelId:_0x14ec89,threadId:_0x3be0ed,commentId:_0x3c3ba9,content:_0x5c27fa,attributes:_0x237506})=>this[_0x37c7('0x1b')](_0x14ec89)[_0x37c7('0x1d')](_0x3be0ed,_0x3c3ba9,_0x5c27fa,_0x237506)[_0x37c7('0x23')](tt),'updateComment':({channelId:_0x45599f,threadId:_0x4a3b53,commentId:_0x4cc4d0,content:_0x1cec29,attributes:_0x3aae43})=>this[_0x37c7('0x1b')](_0x45599f)[_0x37c7('0x1')](_0x4a3b53,_0x4cc4d0,_0x1cec29,_0x3aae43)[_0x37c7('0x23')](Z)[_0x37c7('0x23')](tt),'removeComment':({channelId:_0x4a263b,threadId:_0xf11498,commentId:_0x2a9fc6})=>this[_0x37c7('0x1b')](_0x4a263b)[_0x37c7('0x40')](_0xf11498,_0x2a9fc6)[_0x37c7('0x23')](Z)['catch'](tt)},_0x9b2ecc instanceof _0x2b6e99){const _0x44c3a6=_0x9b2ecc[_0x37c7('0x35')][_0x37c7('0x30')]('collaboration.channelId'),_0x17c067=_0x9b2ecc[_0x37c7('0x44')][_0x37c7('0x30')](_0x1f5d40);await this[_0x37c7('0x1a')](_0x44c3a6);const _0x2af5d7=await this[_0x37c7('0x14')][_0x37c7('0x30')](_0x44c3a6)['getConnectedSessions']();this['listenTo'](_0x17c067,_0x37c7('0x11')+_0x44c3a6,(_0x276c98,{session:_0x2b4d2e})=>{_0x2b4d2e['id']===_0x17c067[_0x37c7('0x34')]&&(_0x276c98[_0x37c7('0x10')](),this['context'][_0x37c7('0x44')][_0x37c7('0x30')](_0x37c7('0x25'))['setPermissions'](_0x2b4d2e[_0x37c7('0xd')],_0x44c3a6));}),_0x17c067['register'](_0x44c3a6,_0x2af5d7);}}async[_0x37c7('0x1a')](_0x57c67b){if(this[_0x37c7('0x14')][_0x37c7('0x42')](_0x57c67b))throw new _0x3c4994(_0x37c7('0x7'),null,{'channelId':_0x57c67b});const _0x19b8be=this[_0x37c7('0x2d')][_0x37c7('0x44')][_0x37c7('0x30')](_0x37c7('0xb')),_0x27e504=new a[(_0x37c7('0x17'))](_0x57c67b);this[_0x37c7('0x14')]['set'](_0x57c67b,_0x27e504),this[_0x37c7('0x3c')](_0x27e504,'commentThreadRemoved',(_0x4eea27,{commentThreadId:_0x35d27d})=>{const _0x29025e=_0x19b8be['getCommentThread'](_0x35d27d);_0x29025e&&_0x29025e[_0x37c7('0x45')]({'isFromAdapter':!0x0});}),this[_0x37c7('0x3c')](_0x27e504,_0x37c7('0xe'),(_0x3db38d,_0x3be3d1)=>{const _0x4012b9=_0x3be3d1[_0x37c7('0x38')];_0x19b8be[_0x37c7('0x39')](_0x4012b9)||_0x19b8be[_0x37c7('0x29')]({'channelId':_0x57c67b,'threadId':_0x4012b9,'isFromAdapter':!0x0});const _0x6c80f9=_0x19b8be[_0x37c7('0x33')](_0x4012b9);_0x6c80f9&&_0x6c80f9[_0x37c7('0x1d')](Object['assign'](et(_0x3be3d1),{'isFromAdapter':!0x0}));}),this[_0x37c7('0x3c')](_0x27e504,_0x37c7('0x2c'),(_0x3a1ac5,{commentThreadId:_0xce58d0,commentId:_0x4b779f,content:_0xc884df,attributes:_0x2d857e})=>{const _0x43d547=_0x19b8be[_0x37c7('0x33')](_0xce58d0);if(_0x43d547){const _0x568aa5=_0x43d547['getComment'](_0x4b779f);_0x568aa5&&_0x568aa5[_0x37c7('0x12')]({'content':_0xc884df,'attributes':_0x2d857e,'isFromAdapter':!0x0});}}),this[_0x37c7('0x3c')](_0x27e504,_0x37c7('0x32'),(_0x585a9a,{commentThreadId:_0x546a12,commentId:_0x6f8f34})=>{const _0x221a72=_0x19b8be['getCommentThread'](_0x546a12);if(_0x221a72){const _0x12ca3b=_0x221a72['getComment'](_0x6f8f34);_0x12ca3b&&_0x12ca3b['remove']({'isFromAdapter':!0x0});}}),await this[_0x37c7('0x6')](_0x57c67b);}[_0x37c7('0x16')](){if(this[_0x37c7('0x2d')]instanceof _0x2b6e99){const _0x3e4b3f=this[_0x37c7('0x2d')][_0x37c7('0x35')][_0x37c7('0x30')](_0x37c7('0x3f'));this[_0x37c7('0x4')](_0x3e4b3f);}}[_0x37c7('0x4')](_0x46c07b){if(!this[_0x37c7('0x14')][_0x37c7('0x42')](_0x46c07b))throw new _0x3c4994(_0x37c7('0xf'),null,{'channelId':_0x46c07b});this[_0x37c7('0x1b')](_0x46c07b)[_0x37c7('0x1e')](),this[_0x37c7('0x14')][_0x37c7('0x1f')](_0x46c07b);}async[_0x37c7('0x3e')](){for(const _0x334ee0 of this[_0x37c7('0x14')][_0x37c7('0x0')]())await this['_connectService'](_0x334ee0);if(this['context']instanceof _0x2b6e99){const _0x25af3f=this['context'][_0x37c7('0x35')]['get'](_0x37c7('0x3f')),_0x230e7f=this['context']['plugins'][_0x37c7('0x30')](_0x1f5d40);_0x230e7f[_0x37c7('0x5')](_0x25af3f);const _0x7518b7=await this[_0x37c7('0x14')][_0x37c7('0x30')](_0x25af3f)[_0x37c7('0x41')]();_0x230e7f[_0x37c7('0x3')](_0x25af3f,_0x7518b7);}}async[_0x37c7('0x6')](_0x44ae46){const {connection:_0x2e413e}=this[_0x37c7('0x2d')][_0x37c7('0x44')][_0x37c7('0x30')](_0x2bb57f),_0x1a55a6=this[_0x37c7('0x2d')][_0x37c7('0x44')][_0x37c7('0x30')](_0x37c7('0xb')),_0x4f07f0=this[_0x37c7('0x14')][_0x37c7('0x30')](_0x44ae46),_0x4f3a61=await _0x4f07f0[_0x37c7('0x3d')](_0x2e413e);await this[_0x37c7('0x26')](_0x4f3a61);const _0xe0186d=new Set(Array[_0x37c7('0x2b')](_0x1a55a6[_0x37c7('0x8')]({'channelId':_0x44ae46}),_0x302998=>_0x302998['id']));for(const _0x508c55 of _0x4f3a61)_0xe0186d[_0x37c7('0x1f')](_0x508c55[_0x37c7('0x38')]);for(const _0x36ae17 of _0xe0186d)_0x1a55a6['getCommentThread'](_0x36ae17)[_0x37c7('0x45')]({'isFromAdapter':!0x0});for(const _0x5a372f of _0x4f3a61){let _0x45e6ad=_0x1a55a6[_0x37c7('0x33')](_0x5a372f[_0x37c7('0x38')]);_0x45e6ad||(_0x45e6ad=_0x1a55a6['addCommentThread']({'channelId':_0x44ae46,'threadId':_0x5a372f[_0x37c7('0x38')],'isFromAdapter':!0x0}));const _0x39cd3c=new Set(Array[_0x37c7('0x2b')](_0x45e6ad['comments'],_0x2a76c7=>_0x2a76c7['id']));for(const _0x45c65c of _0x5a372f[_0x37c7('0x37')])_0x39cd3c[_0x37c7('0x1f')](_0x45c65c[_0x37c7('0x1c')]);for(const _0x31babd of _0x39cd3c)_0x45e6ad[_0x37c7('0x27')](_0x31babd)[_0x37c7('0x45')]({'isFromAdapter':!0x0});for(const _0x57b478 of _0x5a372f[_0x37c7('0x37')]){const _0x30e279=_0x45e6ad[_0x37c7('0x27')](_0x57b478[_0x37c7('0x1c')]);_0x30e279?_0x30e279[_0x37c7('0xa')]!==_0x57b478[_0x37c7('0xa')]&&_0x30e279[_0x37c7('0x12')]({'content':_0x57b478[_0x37c7('0xa')],'isFromAdapter':!0x0}):_0x45e6ad[_0x37c7('0x1d')](Object[_0x37c7('0x2e')](et(_0x57b478),{'isFromAdapter':!0x0}));}}}['_getService'](_0x14c0e6){if(!this[_0x37c7('0x14')][_0x37c7('0x42')](_0x14c0e6))throw new _0x3c4994(_0x37c7('0x2f'),null,{'channelId':_0x14c0e6});return this[_0x37c7('0x14')][_0x37c7('0x30')](_0x14c0e6);}async[_0x37c7('0x26')](_0x24f988){const _0x3e439f=this['context']['plugins'][_0x37c7('0x30')](_0x54a4a6),{connection:_0x44313e}=this[_0x37c7('0x2d')][_0x37c7('0x44')]['get'](_0x2bb57f),_0x408680=new Set();for(const {comments:_0x244667}of _0x24f988)for(const {userId:_0x4b01da}of _0x244667)_0x3e439f[_0x37c7('0xc')](_0x4b01da)||_0x408680[_0x37c7('0x3a')](_0x4b01da);if(0x0===_0x408680[_0x37c7('0x43')])return;const _0x3beb2a=await _0x15ceb6[_0x37c7('0x24')](_0x44313e,Array['from'](_0x408680));for(const _0x73957c of _0x3beb2a)_0x3e439f['getUser'](_0x73957c['id'])||_0x3e439f['addUser'](_0x73957c);}}async function Z(_0xd84e1e){if(_0x37c7('0x2a')!==_0xd84e1e[_0x37c7('0x18')])throw _0xd84e1e;}function tt(_0x406261){if((_0x2d6f98=_0x406261)[_0x37c7('0x13')][_0x37c7('0x3b')](_0x37c7('0x20'))||_0x2d6f98[_0x37c7('0x13')]['startsWith'](_0x37c7('0x19'))||_0x2d6f98['message'][_0x37c7('0x3b')](_0x37c7('0x28')))return new Promise(()=>{});var _0x2d6f98;throw _0x406261;}function et(_0x1141aa){return{'threadId':_0x1141aa['commentThreadId'],'commentId':_0x1141aa[_0x37c7('0x1c')],'content':_0x1141aa[_0x37c7('0xa')],'createdAt':_0x1141aa[_0x37c7('0x22')],'authorId':_0x1141aa[_0x37c7('0x36')],'attributes':_0x1141aa[_0x37c7('0x21')]};}a['CommentsService']=_0x5a7e52;
23
+ const _0x37b4=['disconnect','remove','destroy','404','_connectService','addCommentThread','attributes','getCommentThread','cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.','from','requires','resolvedBy','updateCommentThread','userId','CommentsRepository','add','commentUpdated','setPermissions','updateComment','context','_terminateService','removeCommentThread','createdAt','reconnect','_getService','unregister','off','cloud-services-internal-error:\x20Not\x20connected.','reopenCommentThread','commentId','getUser','config','_fetchMissingUsersForThreads','code','catch','getComment','addToReconnectionStack','getConnectedSessions','collaboration.channelId','commentRemoved','commentThreadRemoved','commentThreadId','size','init','resolve','has','update','keys','_setUpService','get','resolvedAt','addUser','listenTo','_services','cloud-services-internal-error:\x20Request\x20timeout.','addComment','Permissions','adapter','set','getMany','content','removeComment','commentThreadAdded','commentThreadResolved','startsWith','connect','CommentsService','comments','delete','map','sessionAdd:','message','reopen','authorId','assign','cloudservicescommentsadapter-disconnect-not-exist','plugins','register'];(function(_0x540b28,_0x37b4a8){const _0x4e843b=function(_0x3679b0){while(--_0x3679b0){_0x540b28['push'](_0x540b28['shift']());}};_0x4e843b(++_0x37b4a8);}(_0x37b4,0x1c5));const _0x4e84=function(_0x540b28,_0x37b4a8){_0x540b28=_0x540b28-0x0;let _0x4e843b=_0x37b4[_0x540b28];return _0x4e843b;};import{Context as _0x2932d3,ContextPlugin as _0x5bf0d9}from'ckeditor5/src/core';import{CKEditorError as _0x2256d6}from'ckeditor5/src/utils';import{Users as _0x530880}from'ckeditor5-collaboration/src/collaboration-core';import _0x5103fc from'@ckeditor/ckeditor-cloud-services-collaboration/src/users/user';import _0x3777a0 from'@ckeditor/ckeditor-cloud-services-collaboration/src/comments-v2/commentsservice';import _0x20a5f0 from'../realtimecollaborativeediting/websocketgateway';import _0x36ffa0 from'../realtimecollaborativeediting/sessions';export default class a extends _0x5bf0d9{static get[_0x4e84('0x19')](){return[_0x20a5f0,'CommentsRepository',_0x36ffa0,_0x530880];}constructor(_0xa0d8c2){super(_0xa0d8c2),this[_0x4e84('0x44')]=new Map();}async[_0x4e84('0x3a')](){const _0x42f7e8=this['context'],_0x961640=_0x42f7e8['plugins'][_0x4e84('0x40')](_0x4e84('0x1d'));if(_0x42f7e8['plugins'][_0x4e84('0x40')](_0x20a5f0)[_0x4e84('0x33')](this),_0x961640[_0x4e84('0x48')]={'addCommentThread':async({channelId:_0x19c694,threadId:_0xb62d99,comments:_0x20e107,resolvedAt:_0x5cf404,resolvedBy:_0x5c4e07,context:_0x1563db,attributes:_0x1b2604})=>{const _0x23616e=await this[_0x4e84('0x27')](_0x19c694)[_0x4e84('0x14')]({'commentThreadId':_0xb62d99,'comments':_0x20e107[_0x4e84('0x6')](_0xd1e044=>function(_0x18fd1a,_0x399bf0,_0x1559b8){return{'commentThreadId':_0x1559b8,'commentId':_0x18fd1a[_0x4e84('0x2c')],'userId':_0x18fd1a[_0x4e84('0xa')],'content':_0x18fd1a['content'],'documentId':_0x399bf0,'createdAt':_0x18fd1a[_0x4e84('0x25')],'attributes':_0x18fd1a[_0x4e84('0x15')]||{}};}(_0xd1e044,_0x19c694,_0xb62d99)),'resolvedAt':_0x5cf404,'resolvedBy':_0x5c4e07,'context':_0x1563db,'attributes':_0x1b2604})[_0x4e84('0x31')](tt);return{'threadId':_0x23616e[_0x4e84('0x38')],'comments':_0x23616e[_0x4e84('0x4')]};},'getCommentThread':async({channelId:_0x11f26d,threadId:_0x1a02eb})=>{const _0x1f21a3=await this[_0x4e84('0x27')](_0x11f26d)['getCommentThread'](_0x1a02eb)['catch'](tt);return await this['_fetchMissingUsersForThreads']([_0x1f21a3]),{'threadId':_0x1f21a3[_0x4e84('0x38')],'comments':_0x1f21a3['comments'][_0x4e84('0x6')](et),'context':_0x1f21a3[_0x4e84('0x22')],'resolvedAt':_0x1f21a3[_0x4e84('0x41')],'resolvedBy':_0x1f21a3[_0x4e84('0x1a')],'attributes':_0x1f21a3[_0x4e84('0x15')]||{}};},'updateCommentThread':async({channelId:_0x2d3559,threadId:_0x2a6d3d,context:_0x567607,attributes:_0x5d0dcf})=>this[_0x4e84('0x27')](_0x2d3559)[_0x4e84('0x1b')]({'commentThreadId':_0x2a6d3d,'context':_0x567607,'attributes':_0x5d0dcf})['catch'](Z)[_0x4e84('0x31')](tt),'resolveCommentThread':async({channelId:_0x2767f3,threadId:_0x39c7b2})=>{const _0x2fc04a=await this[_0x4e84('0x27')](_0x2767f3)['resolveCommentThread'](_0x39c7b2)[_0x4e84('0x31')](Z)['catch'](tt);return{'threadId':_0x2fc04a[_0x4e84('0x38')],'resolvedAt':_0x2fc04a[_0x4e84('0x41')],'resolvedBy':_0x2fc04a[_0x4e84('0x1a')]};},'reopenCommentThread':async({channelId:_0x19ac71,threadId:_0x5ed243})=>this[_0x4e84('0x27')](_0x19ac71)[_0x4e84('0x2b')](_0x5ed243)[_0x4e84('0x31')](Z)[_0x4e84('0x31')](tt),'removeCommentThread':({channelId:_0x216f4c,threadId:_0xfbf5ca})=>this[_0x4e84('0x27')](_0x216f4c)[_0x4e84('0x24')](_0xfbf5ca)['catch'](Z)[_0x4e84('0x31')](tt),'addComment':({channelId:_0x447a86,threadId:_0x293d48,commentId:_0x1ac1cb,content:_0x679645,attributes:_0x4e724f})=>this[_0x4e84('0x27')](_0x447a86)[_0x4e84('0x46')](_0x293d48,_0x1ac1cb,_0x679645,_0x4e724f)[_0x4e84('0x31')](tt),'updateComment':({channelId:_0x14e966,threadId:_0xeea27e,commentId:_0x3368a6,content:_0x4976e8,attributes:_0x50daf0})=>this[_0x4e84('0x27')](_0x14e966)[_0x4e84('0x21')](_0xeea27e,_0x3368a6,_0x4976e8,_0x50daf0)[_0x4e84('0x31')](Z)[_0x4e84('0x31')](tt),'removeComment':({channelId:_0x3e63e8,threadId:_0x127bab,commentId:_0x33ca7a})=>this[_0x4e84('0x27')](_0x3e63e8)[_0x4e84('0x4c')](_0x127bab,_0x33ca7a)[_0x4e84('0x31')](Z)[_0x4e84('0x31')](tt)},_0x42f7e8 instanceof _0x2932d3){const _0x365871=_0x42f7e8[_0x4e84('0x2e')]['get'](_0x4e84('0x35')),_0x593695=_0x42f7e8[_0x4e84('0xd')][_0x4e84('0x40')](_0x36ffa0);await this[_0x4e84('0x3f')](_0x365871);const _0xe43dd0=await this['_services'][_0x4e84('0x40')](_0x365871)[_0x4e84('0x34')]();this[_0x4e84('0x43')](_0x593695,_0x4e84('0x7')+_0x365871,(_0x41c89e,{session:_0x990385})=>{_0x990385['id']===_0x593695['mySessionId']&&(_0x41c89e[_0x4e84('0x29')](),this['context'][_0x4e84('0xd')][_0x4e84('0x40')](_0x4e84('0x47'))[_0x4e84('0x20')](_0x990385['permissions'],_0x365871));}),_0x593695['register'](_0x365871,_0xe43dd0);}}async[_0x4e84('0x3f')](_0x2ccec2){if(this[_0x4e84('0x44')][_0x4e84('0x3c')](_0x2ccec2))throw new _0x2256d6('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x2ccec2});const _0x4f5f41=this[_0x4e84('0x22')][_0x4e84('0xd')]['get'](_0x4e84('0x1d')),_0x497009=new a[(_0x4e84('0x3'))](_0x2ccec2);this[_0x4e84('0x44')][_0x4e84('0x49')](_0x2ccec2,_0x497009),this[_0x4e84('0x43')](_0x497009,_0x4e84('0x4d'),(_0x34d345,_0x309561)=>{const {commentThreadId:_0x105607,documentId:_0x3c967e,context:_0x5a0f9b,attributes:_0x9875e,resolvedAt:_0x3cc5cb,resolvedBy:_0x1d1e0a,comments:_0x5951ed}=_0x309561;_0x4f5f41[_0x4e84('0x16')](_0x105607)||_0x4f5f41['addCommentThread']({'threadId':_0x105607,'channelId':_0x3c967e,'comments':_0x5951ed?_0x5951ed[_0x4e84('0x6')](et):[],'context':_0x5a0f9b,'attributes':_0x9875e,'resolvedAt':_0x3cc5cb,'resolvedBy':_0x1d1e0a,'isFromAdapter':!0x0});}),this[_0x4e84('0x43')](_0x497009,'commentThreadUpdated',(_0x2fe9d0,{commentThreadId:_0x2a379e,documentId:_0x511d09,context:_0x286c72,attributes:_0x4955ce})=>{_0x4f5f41[_0x4e84('0x16')](_0x2a379e)&&_0x4f5f41[_0x4e84('0x1b')]({'threadId':_0x2a379e,'channelId':_0x511d09,'context':_0x286c72,'attributes':_0x4955ce,'isFromAdapter':!0x0});}),this['listenTo'](_0x497009,_0x4e84('0x0'),(_0x14c40c,{commentThreadId:_0x176a39,resolvedBy:_0x3f24b2,resolvedAt:_0x163441})=>{const _0x154145=_0x4f5f41[_0x4e84('0x16')](_0x176a39);_0x154145&&_0x154145[_0x4e84('0x3b')]({'resolvedBy':_0x3f24b2,'resolvedAt':_0x163441,'isFromAdapter':!0x0});}),this[_0x4e84('0x43')](_0x497009,'commentThreadReopened',(_0x4e37d8,{commentThreadId:_0x303afb})=>{const _0x304846=_0x4f5f41[_0x4e84('0x16')](_0x303afb);_0x304846&&_0x304846[_0x4e84('0x9')]({'isFromAdapter':!0x0});}),this[_0x4e84('0x43')](_0x497009,_0x4e84('0x37'),(_0x505048,{commentThreadId:_0x41b7c3})=>{const _0x260c7a=_0x4f5f41[_0x4e84('0x16')](_0x41b7c3);_0x260c7a&&_0x260c7a[_0x4e84('0x10')]({'isFromAdapter':!0x0});}),this[_0x4e84('0x43')](_0x497009,'commentAdded',(_0x4952f0,_0x10b109)=>{const _0x400bab=_0x10b109[_0x4e84('0x38')],_0x53a138=_0x4f5f41[_0x4e84('0x16')](_0x400bab);_0x53a138&&_0x53a138[_0x4e84('0x46')]({...et(_0x10b109),'isFromAdapter':!0x0});}),this[_0x4e84('0x43')](_0x497009,_0x4e84('0x1f'),(_0x311313,{commentThreadId:_0xdbe754,commentId:_0x382aba,content:_0x2f8986,attributes:_0x4ae509})=>{const _0x5881a0=_0x4f5f41[_0x4e84('0x16')](_0xdbe754);if(_0x5881a0){const _0x25d7bd=_0x5881a0[_0x4e84('0x32')](_0x382aba);_0x25d7bd&&_0x25d7bd[_0x4e84('0x3d')]({'content':_0x2f8986,'attributes':_0x4ae509,'isFromAdapter':!0x0});}}),this[_0x4e84('0x43')](_0x497009,_0x4e84('0x36'),(_0x219d71,{commentThreadId:_0x2fce92,commentId:_0x533f4e})=>{const _0x12e7b5=_0x4f5f41[_0x4e84('0x16')](_0x2fce92);if(_0x12e7b5){const _0x462891=_0x12e7b5[_0x4e84('0x32')](_0x533f4e);_0x462891&&_0x462891['remove']({'isFromAdapter':!0x0});}}),await this[_0x4e84('0x13')](_0x2ccec2);}[_0x4e84('0x11')](){if(this['context']instanceof _0x2932d3){const _0x585d12=this['context'][_0x4e84('0x2e')][_0x4e84('0x40')]('collaboration.channelId');this[_0x4e84('0x23')](_0x585d12);}}[_0x4e84('0x23')](_0x843c3b){if(!this[_0x4e84('0x44')][_0x4e84('0x3c')](_0x843c3b))throw new _0x2256d6(_0x4e84('0xc'),null,{'channelId':_0x843c3b});this['_getService'](_0x843c3b)[_0x4e84('0xf')](),this[_0x4e84('0x44')][_0x4e84('0x5')](_0x843c3b);}async[_0x4e84('0x26')](){for(const _0x5ee656 of this[_0x4e84('0x44')][_0x4e84('0x3e')]())await this[_0x4e84('0x13')](_0x5ee656);if(this['context']instanceof _0x2932d3){const _0x277fb6=this['context'][_0x4e84('0x2e')][_0x4e84('0x40')](_0x4e84('0x35')),_0xb391f4=this['context'][_0x4e84('0xd')]['get'](_0x36ffa0);_0xb391f4[_0x4e84('0x28')](_0x277fb6);const _0x3e53f6=await this[_0x4e84('0x44')][_0x4e84('0x40')](_0x277fb6)[_0x4e84('0x34')]();_0xb391f4[_0x4e84('0xe')](_0x277fb6,_0x3e53f6);}}async['_connectService'](_0x2f74b4){const {connection:_0x412fa6}=this[_0x4e84('0x22')][_0x4e84('0xd')][_0x4e84('0x40')](_0x20a5f0),_0x333b10=this['context']['plugins'][_0x4e84('0x40')](_0x4e84('0x1d')),_0x168d70=this[_0x4e84('0x44')][_0x4e84('0x40')](_0x2f74b4),_0x38bb1b=await _0x168d70[_0x4e84('0x2')](_0x412fa6);await this[_0x4e84('0x2f')](_0x38bb1b);const _0x52862d=new Set(Array[_0x4e84('0x18')](_0x333b10['getCommentThreads']({'channelId':_0x2f74b4}),_0x4bfc9e=>_0x4bfc9e['id']));for(const _0x56f7ea of _0x38bb1b)_0x52862d[_0x4e84('0x5')](_0x56f7ea[_0x4e84('0x38')]);for(const _0x4197e0 of _0x52862d)_0x333b10[_0x4e84('0x16')](_0x4197e0)[_0x4e84('0x10')]({'isFromAdapter':!0x0});for(const _0x2f6b8e of _0x38bb1b){let _0x55e949=_0x333b10[_0x4e84('0x16')](_0x2f6b8e[_0x4e84('0x38')]);const {commentThreadId:_0x5b8fc5,context:_0x56256a,attributes:_0x53bcea,resolvedBy:_0x50fa7f,resolvedAt:_0x50f9ab}=_0x2f6b8e;_0x55e949||(_0x55e949=_0x333b10[_0x4e84('0x14')]({'channelId':_0x2f74b4,'threadId':_0x5b8fc5,'context':_0x56256a,'attributes':_0x53bcea,'resolvedBy':_0x50fa7f,'resolvedAt':_0x50f9ab,'isFromAdapter':!0x0}));const _0x1d9385=new Set(Array[_0x4e84('0x18')](_0x55e949[_0x4e84('0x4')],_0x56a098=>_0x56a098['id']));for(const _0x9dd599 of _0x2f6b8e[_0x4e84('0x4')])_0x1d9385[_0x4e84('0x5')](_0x9dd599[_0x4e84('0x2c')]);for(const _0x54bd25 of _0x1d9385)_0x55e949['getComment'](_0x54bd25)[_0x4e84('0x10')]({'isFromAdapter':!0x0});for(const _0x27130b of _0x2f6b8e[_0x4e84('0x4')]){const _0x236817=_0x55e949[_0x4e84('0x32')](_0x27130b['commentId']);_0x236817?_0x236817['content']!==_0x27130b[_0x4e84('0x4b')]&&_0x236817[_0x4e84('0x3d')]({'content':_0x27130b[_0x4e84('0x4b')],'isFromAdapter':!0x0}):_0x55e949['addComment'](Object[_0x4e84('0xb')](et(_0x27130b),{'isFromAdapter':!0x0}));}}}[_0x4e84('0x27')](_0x5aa841){if(!this[_0x4e84('0x44')]['has'](_0x5aa841))throw new _0x2256d6('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x5aa841});return this[_0x4e84('0x44')]['get'](_0x5aa841);}async[_0x4e84('0x2f')](_0x367f09){const _0x12479a=this['context'][_0x4e84('0xd')][_0x4e84('0x40')](_0x530880),{connection:_0x35ba89}=this[_0x4e84('0x22')]['plugins'][_0x4e84('0x40')](_0x20a5f0),_0x171690=new Set();for(const {resolvedBy:_0x6b679d,comments:_0x18978d}of _0x367f09){_0x6b679d&&!_0x12479a[_0x4e84('0x2d')](_0x6b679d)&&_0x171690[_0x4e84('0x1e')](_0x6b679d);for(const {userId:_0x2cceb9}of _0x18978d)_0x12479a[_0x4e84('0x2d')](_0x2cceb9)||_0x171690[_0x4e84('0x1e')](_0x2cceb9);}if(0x0===_0x171690[_0x4e84('0x39')])return;const _0x5203dd=await _0x5103fc[_0x4e84('0x4a')](_0x35ba89,Array[_0x4e84('0x18')](_0x171690));for(const _0x1c24e1 of _0x5203dd)_0x12479a[_0x4e84('0x2d')](_0x1c24e1['id'])||_0x12479a[_0x4e84('0x42')](_0x1c24e1);}}async function Z(_0x55fe61){if(_0x4e84('0x12')!==_0x55fe61[_0x4e84('0x30')])throw _0x55fe61;}function tt(_0x1a0b65){if((_0x1a9e7e=_0x1a0b65)[_0x4e84('0x8')][_0x4e84('0x1')](_0x4e84('0x17'))||_0x1a9e7e[_0x4e84('0x8')][_0x4e84('0x1')](_0x4e84('0x2a'))||_0x1a9e7e['message']['startsWith'](_0x4e84('0x45')))return new Promise(()=>{});var _0x1a9e7e;throw _0x1a0b65;}function et(_0x38e3f2){return{'threadId':_0x38e3f2[_0x4e84('0x38')],'commentId':_0x38e3f2[_0x4e84('0x2c')],'content':_0x38e3f2['content'],'createdAt':_0x38e3f2[_0x4e84('0x25')],'authorId':_0x38e3f2[_0x4e84('0x1c')],'attributes':_0x38e3f2[_0x4e84('0x15')]||{}};}a[_0x4e84('0x3')]=_0x3777a0;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @module real-time-collaboration/realtimecollaborativecomments
3
+ * @publicApi
4
+ */
5
+ import { Plugin, type PluginDependencies } from 'ckeditor5/src/core';
6
+ /**
7
+ * Enables the real-time collaborative comments feature.
8
+ *
9
+ * Check the {@glink features/collaboration/real-time-collaboration/real-time-collaboration-integration Real-time collaboration guide}
10
+ * to see how to launch the editor in the real-time collaboration mode.
11
+ */
12
+ export default class RealTimeCollaborativeComments extends Plugin {
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ static get requires(): PluginDependencies;
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static get pluginName(): 'RealTimeCollaborativeComments';
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ init(): Promise<void>;
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ destroy(): void;
29
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x894e=['ready','switchReadOnly','init','config','_setUpService','_terminateService','connected','CommentsEditing','CommentsRepository','change:state','collaboration.channelId','get','Comments','once','RealTimeCollaborativeComments','data','requires','isThreadsLoadingPaused','plugins','pluginName','editor'];(function(_0x1a68be,_0x894e7a){const _0x50cfe9=function(_0x34a1c9){while(--_0x34a1c9){_0x1a68be['push'](_0x1a68be['shift']());}};_0x50cfe9(++_0x894e7a);}(_0x894e,0xd3));const _0x50cf=function(_0x1a68be,_0x894e7a){_0x1a68be=_0x1a68be-0x0;let _0x50cfe9=_0x894e[_0x1a68be];return _0x50cfe9;};import{Plugin as _0x20cd02}from'ckeditor5/src/core';import _0x5306e5 from'./realtimecollaborativecomments/cloudservicescommentsadapter';import _0x1a9066 from'./realtimecollaborativeediting';import _0x2b935b from'./realtimecollaborativeediting/websocketgateway';export default class m extends _0x20cd02{static get[_0x50cf('0xf')](){return[_0x50cf('0xb'),_0x5306e5,_0x1a9066,_0x2b935b];}static get[_0x50cf('0x12')](){return _0x50cf('0xd');}[_0x50cf('0x1')](){const _0x516c84=this[_0x50cf('0x13')][_0x50cf('0x11')][_0x50cf('0xa')](_0x2b935b),_0x356552=this[_0x50cf('0x13')]['plugins']['get'](_0x50cf('0x6')),_0x10d4b4=this[_0x50cf('0x13')][_0x50cf('0x11')][_0x50cf('0xa')](_0x5306e5);return this['editor'][_0x50cf('0xe')][_0x50cf('0xc')](_0x50cf('0x14'),()=>{this['listenTo'](_0x516c84,_0x50cf('0x8'),(_0x4e8f2f,_0x184cf5,_0x206bad)=>{_0x356552[_0x50cf('0x10')]=_0x50cf('0x5')!==_0x206bad;});}),this['listenTo'](_0x516c84,'change:state',(_0x2eeac9,_0x47188f,_0x1f33b8)=>{this[_0x50cf('0x13')][_0x50cf('0x11')][_0x50cf('0xa')](_0x50cf('0x7'))[_0x50cf('0x0')](_0x50cf('0x5')!==_0x1f33b8);}),_0x10d4b4[_0x50cf('0x3')](this['editor'][_0x50cf('0x2')][_0x50cf('0xa')](_0x50cf('0x9')));}['destroy'](){this[_0x50cf('0x13')][_0x50cf('0x11')][_0x50cf('0xa')](_0x5306e5)[_0x50cf('0x4')](this[_0x50cf('0x13')][_0x50cf('0x2')][_0x50cf('0xa')](_0x50cf('0x9'))),super['destroy']();}}
23
+ const _0x3ffb=['editor','init','pluginName','connected','requires','get','destroy','_setUpService','switchReadOnly','CommentsRepository','isThreadsLoadingPaused','_terminateService','data','listenTo','collaboration.channelId','CommentsEditing','change:state','plugins','config','Comments'];(function(_0x7a5353,_0x3ffb71){const _0xd7a4cf=function(_0x3e5d68){while(--_0x3e5d68){_0x7a5353['push'](_0x7a5353['shift']());}};_0xd7a4cf(++_0x3ffb71);}(_0x3ffb,0x84));const _0xd7a4=function(_0x7a5353,_0x3ffb71){_0x7a5353=_0x7a5353-0x0;let _0xd7a4cf=_0x3ffb[_0x7a5353];return _0xd7a4cf;};import{Plugin as _0x37297c}from'ckeditor5/src/core';import _0x34a4a0 from'./realtimecollaborativecomments/cloudservicescommentsadapter';import _0xc3b7c1 from'./realtimecollaborativeediting';import _0x4a7845 from'./realtimecollaborativeediting/websocketgateway';export default class m extends _0x37297c{static get[_0xd7a4('0xc')](){return[_0xd7a4('0x7'),_0x34a4a0,_0xc3b7c1,_0x4a7845];}static get[_0xd7a4('0xa')](){return'RealTimeCollaborativeComments';}[_0xd7a4('0x9')](){const _0x3b8414=this[_0xd7a4('0x8')][_0xd7a4('0x5')][_0xd7a4('0xd')](_0x4a7845),_0x50c77f=this[_0xd7a4('0x8')]['plugins'][_0xd7a4('0xd')](_0xd7a4('0x3')),_0x3fd8fe=this['editor'][_0xd7a4('0x5')][_0xd7a4('0xd')](_0x34a4a0);return this['editor'][_0xd7a4('0x0')]['once']('ready',()=>{this[_0xd7a4('0x1')](_0x3b8414,'change:state',(_0xdd25e5,_0x35c284,_0x32f5c4)=>{_0x50c77f[_0xd7a4('0x12')]=_0xd7a4('0xb')!==_0x32f5c4;});}),this['listenTo'](_0x3b8414,_0xd7a4('0x4'),(_0x189f3c,_0x2262a1,_0x4aa950)=>{this[_0xd7a4('0x8')][_0xd7a4('0x5')][_0xd7a4('0xd')](_0xd7a4('0x11'))[_0xd7a4('0x10')](_0xd7a4('0xb')!==_0x4aa950);}),_0x3fd8fe[_0xd7a4('0xf')](this['editor'][_0xd7a4('0x6')]['get'](_0xd7a4('0x2')));}['destroy'](){this[_0xd7a4('0x8')]['plugins'][_0xd7a4('0xd')](_0x34a4a0)[_0xd7a4('0x13')](this[_0xd7a4('0x8')][_0xd7a4('0x6')][_0xd7a4('0xd')](_0xd7a4('0x2'))),super[_0xd7a4('0xe')]();}}
@@ -0,0 +1,119 @@
1
+ /**
2
+ * @module real-time-collaboration/realtimecollaborativeediting/realtimecollaborationclient
3
+ * @publicApi
4
+ */
5
+ import { Plugin, type PluginDependencies, type Editor } from 'ckeditor5/src/core';
6
+ import { type CollaborationHistory } from 'ckeditor5-collaboration/src/collaboration-core';
7
+ import CollaborativeEditingService from '@ckeditor/ckeditor-cloud-services-collaboration/src/collaborativeeditingservice/collaborativeeditingservice';
8
+ /**
9
+ * Handles the real-time collaborative editing.
10
+ */
11
+ export default class RealTimeCollaborationClient extends Plugin {
12
+ static CollaborativeEditingService: typeof CollaborativeEditingService;
13
+ /**
14
+ * The ID of the current editing session to which the client is connected (or was connected before losing the connection).
15
+ */
16
+ sessionId: string | null;
17
+ /**
18
+ * Holds the history of operations that have been applied on the collaboration server.
19
+ *
20
+ * Contains only these operations, that have been already synchronized. It is exactly the same for all clients
21
+ * connected to the same editing session.
22
+ *
23
+ * All original operations are cloned.
24
+ */
25
+ serverHistory: CollaborationHistory;
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static get requires(): PluginDependencies;
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ static get pluginName(): 'RealTimeCollaborationClient';
34
+ /**
35
+ * Incremented every time the document is synchronized with Cloud Services server. It can be treated as the server's current document
36
+ * version. This number is stored between editing sessions, so even when all clients disconnect, the editing session is closed, the
37
+ * next time the document is initialized, the version number will stay the same and will continue to be incremented with
38
+ * subsequent document changes.
39
+ *
40
+ * Use this version to compare which client has a newer version of the document. It is recommended to save it together with the
41
+ * document content in the database. Comparing `cloudDocumentVersion` can be used to prevent overwriting a newer content with
42
+ * an older one from another client.
43
+ */
44
+ get cloudDocumentVersion(): number;
45
+ /**
46
+ * The last document version synchronized with the server during current real-time collaboration session.
47
+ *
48
+ * Equals to `0` when the client is not connected to the server yet.
49
+ *
50
+ * This includes only operations created by this or other clients. Notably, user selection markers operations created by
51
+ * the server are excluded.
52
+ */
53
+ get lastSyncVersion(): number;
54
+ constructor(editor: Editor);
55
+ /**
56
+ * @inheritDoc
57
+ */
58
+ init(): void;
59
+ /**
60
+ * Reconnects the client to the document.
61
+ *
62
+ * If the document has been flushed (editing session for that document was closed) in the meantime, the editing session is recreated
63
+ * using the local operations history.
64
+ *
65
+ * There are several scenarios where the reconnection can fail because it is impossible to synchronize local document state with the
66
+ * server editing session or with the document state saved in the database. In those situations, the editor switches to read-only
67
+ * mode and a {@link module:ui/notification/notification~Notification `Notification`} is created.
68
+ */
69
+ reconnect(): Promise<void>;
70
+ /**
71
+ * @inheritDoc
72
+ */
73
+ destroy(): void;
74
+ /**
75
+ * Handles the server response after the reconnection.
76
+ */
77
+ private _handleReconnectionResponse;
78
+ /**
79
+ * Connects the client to the editing session.
80
+ *
81
+ * If this client is the first one that tries connecting to the session, the session will be created based on its
82
+ * local operations. Otherwise, the server will respond with server operations that are already stored on the server for the
83
+ * existing session and those operations will replace this client's editor content.
84
+ *
85
+ * @param isReconnectionProcess Set to `true` when reconnecting to the document after the document has been flushed.
86
+ */
87
+ private _connectService;
88
+ /**
89
+ * Handles operations received from the server. Callback for the `CollaborativeEditingService#event:operationsReceived`.
90
+ */
91
+ private _handleReceivedOperations;
92
+ /**
93
+ * Connects the client to the editing session after it has been flushed. The client will use the local operations history to re-create
94
+ * the editing session on the server.
95
+ */
96
+ private _connectAfterSessionHasBeenFlushed;
97
+ /**
98
+ * Fetches missing users based on author IDs of the given operations.
99
+ */
100
+ private _fetchMissingUsers;
101
+ /**
102
+ * Handles the initial connection.
103
+ */
104
+ private _handleInitialConnectionData;
105
+ private _sendBufferedOperations;
106
+ /**
107
+ * Handles a response from the server for the following actions:
108
+ * - connection
109
+ * - reconnection
110
+ * - sending buffered operations.
111
+ *
112
+ * @param sentOperations Operations sent to the server.
113
+ * @param response The server's response.
114
+ * @param requestId
115
+ * @returns Resolves to `true` if the updates process has finished,
116
+ * resolves to `false` if next batch of updates was sent to the server.
117
+ */
118
+ private _handleServerResponse;
119
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x40f4=['addUser','setPermissions','getRoot','start','applyOperation','type','CollaborativeEditingService','404','_pendingAction','code','permissions','add','high','_isPendingUpdate','cloud-services-internal-error:\x20Not\x20connected.','fire','lastDocumentSession','_operationToId','addToReconnectionStack','metadata','operationsReceived','Notification','sendOperations','stop','isEnabled','has','slice','return','getDocumentDetails','_lastSyncedOperationId','getIdOfTheLastOperation','markers','compress','toJSON','_assignOperationsMetaData','error','map','_currentBufferDelay','_offset','reconnection:\x20flushed\x20session','round','_document','lastOperationAcceptedAt','baseVersion','_isDisconnection','includes','disconnect','CommentsOnly','getOperations','_setUpDataInit','_lastServerVersion','_baseBufferDelay','realtimecollaborationclient-init-document-already-initialized','remove','createUserMarkerOperations','RealTimeCollaborationClient','cloudDocumentVersion','requires','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','_sendBufferedOperations','string','cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.','filter','connect','affectsData','_initSessionsHandling','document','change:hasDomSelection','decompress','_initThrowingOnDataSet','sessionAdd:','enableReadOnlyMode','_handleReconnectionResponse','locale','_refreshUserSelectionMarkers','lastOperationId','reset','_handleInitialConnectionData','model','sessionCreatedAt','then','_decompressOperations','initData','realtimecollaborationclient-init-non-existent-root','wasUndone','_saveOperationInBuffer','from','batch','destroy','_sendBufferedOperationsDelayed','setIdForTheLastOperation','_shouldSendSelectionUpdate','createdAt','set','_operationIdentifier','createRange','wereChangesApplied','_isConnected','unregister','forEach','realtimecollaborationclient-initservice-internal-error','catch','apply','_bufferedOperations','_clearPendingAction','selection','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.','message','listenTo','marker','reconnect','_handleExternalOperations','collaboration-missing-channelid','editor','disableReadOnlyMode','409','_handleSendingSelectionMarkers','suppressErrorInCollaboration','_setPendingAction','_shouldSendUpdate','_disconnectionOperations','connected','sessionId','plugins','view','realtimecollaborationclient-handleserverresponse','_sendBufferedOperationsDelayId','realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration','getUser','_handleReconnectionError','_channelId','isDocumentOperation','rtc-destroyed','_isEditingAllowed','length','version','addOperation','showWarning','roots','_compressOperations','config','Permissions','init','userId','real-time-collaboration','register','_handleReceivedOperations','_service','_isInit','cloudServices.bundleVersion','_hasSynchronizationProblem','editing','removeFromReconnectionStack','mySessionId','get','startsWith','cs:removeUser','_connectAfterSessionHasBeenFlushed','finally','getConnectedSessions','bind','data','channelSessions','offset','isReadOnly','connection','_applyOperationsSet','_disconnectService','collaboration.channelId','rtc-offline','end','_fetchMissingUsers','_crash','_handleServerResponse','_hasSelectionChanged','Synchronization\x20issue','document:write','serverHistory','_ignoredOperations','push','_sendBufferedOperationsDelay','history','realtimecollaborationclient-sendbufferedoperations','change:range','keys','_knownOperations','path','_compressor','getMany','size','disconnected','_connectService','_authorId','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.','enqueueChange','isUndoneOperation','_getOperationsFromInitData','collaboration','_updateServerHistory'];(function(_0x20344a,_0x40f49c){const _0x45d79c=function(_0x733357){while(--_0x733357){_0x20344a['push'](_0x20344a['shift']());}};_0x45d79c(++_0x40f49c);}(_0x40f4,0xeb));const _0x45d7=function(_0x20344a,_0x40f49c){_0x20344a=_0x20344a-0x0;let _0x45d79c=_0x40f4[_0x20344a];return _0x45d79c;};import{Plugin as _0x1b05f6,PendingActions as _0x260e85}from'ckeditor5/src/core';import{CKEditorError as _0xeddf3e,version as _0x40d6a9,uid as _0x1a5607}from'ckeditor5/src/utils';import{transformSets as _0x1082d5,InsertOperation as _0x57ee07,MarkerOperation as _0x50e75d,OperationFactory as _0x18a8cf,History as _0x11cb62}from'ckeditor5/src/engine';import{Notification as _0x40b74a}from'ckeditor5/src/ui';import{Users as _0x38e5dc}from'ckeditor5-collaboration/src/collaboration-core';import _0x250c7b from'./websocketgateway';import _0xec0562 from'./sessions';import _0x53e3d7 from'./usermarkers';import{getTranslation as _0x4c21b1}from'../common-translations';import _0x5d5561 from'@ckeditor/ckeditor5-operations-compressor/src/compressor';import _0x366772 from'@ckeditor/ckeditor-cloud-services-collaboration/src/collaborativeeditingservice/collaborativeeditingservice';import _0x34b11f from'@ckeditor/ckeditor-cloud-services-collaboration/src/users/user';let V=0x1;export default class l extends _0x1b05f6{static get[_0x45d7('0x15')](){return[_0x250c7b,_0xec0562,_0x53e3d7,_0x260e85,_0x38e5dc,_0x40b74a];}static get['pluginName'](){return _0x45d7('0x13');}get[_0x45d7('0x14')](){return this[_0x45d7('0xe')]+this[_0x45d7('0x2')];}get['_lastServerVersion'](){return this[_0x45d7('0x8d')]['version']-this[_0x45d7('0x2')];}get['lastSyncVersion'](){const _0xf12709=this[_0x45d7('0x8d')][_0x45d7('0xc')]();for(let _0x26603d=_0xf12709[_0x45d7('0x62')]-0x1;_0x26603d>=0x0;_0x26603d--){const _0x37ea03=_0xf12709[_0x26603d];if(!this[_0x45d7('0x54')][_0x45d7('0xbc')](_0x37ea03))return _0x37ea03['baseVersion']+0x1-this['_offset'];}return 0x0;}[_0x45d7('0x6a')](){const _0x1538c2=this[_0x45d7('0x4d')],_0x5becfa=_0x1538c2[_0x45d7('0x57')][_0x45d7('0x76')](_0x38e5dc),_0x440a46=_0x1538c2[_0x45d7('0x57')][_0x45d7('0x76')](_0x250c7b);if(this[_0x45d7('0x2')]=0x0,this['sessionId']=null,this[_0x45d7('0x8d')]=new _0x11cb62(),this[_0x45d7('0x4d')][_0x45d7('0x68')]['define'](_0x45d7('0xa1'),{}),this[_0x45d7('0x5e')]=_0x1538c2[_0x45d7('0x68')][_0x45d7('0x76')](_0x45d7('0x84')),!this[_0x45d7('0x5e')])throw new _0xeddf3e(_0x45d7('0x4c'),this);this['listenTo'](_0x5becfa,'getOperationAuthor',(_0xaa245,_0x4d32c1)=>{const _0x106646=_0x4d32c1[0x0];_0x106646[_0x45d7('0x9c')]&&(_0xaa245[_0x45d7('0xbe')]=_0x5becfa[_0x45d7('0x5c')](_0x106646[_0x45d7('0x9c')]),_0xaa245['stop']()),null===_0x106646[_0x45d7('0x9c')]&&(_0xaa245[_0x45d7('0xbe')]=null,_0xaa245[_0x45d7('0xba')]());},{'priority':_0x45d7('0xaf')});const _0x15a51c=_0x1538c2[_0x45d7('0x68')]['get'](_0x45d7('0x71'))||_0x40d6a9;this[_0x45d7('0x6f')]=new l[(_0x45d7('0xa9'))](_0x15a51c,this[_0x45d7('0x5e')]),this[_0x45d7('0x5')]=this['editor']['model'][_0x45d7('0x1e')],this['_compressor']=new _0x5d5561(),this['_bufferedOperations']=[],this[_0x45d7('0x95')]=new WeakSet(),this[_0x45d7('0x39')](_0x45d7('0xb0'),!0x1),this[_0x45d7('0x39')](_0x45d7('0x72'),!0x1),this[_0x45d7('0xab')]=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this[_0x45d7('0xf')]=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this[_0x45d7('0xc0')]=null,this[_0x45d7('0x54')]=new WeakSet(),this[_0x45d7('0x3a')]=new H(this['_disconnectionOperations']),this[_0x45d7('0x48')](_0x1538c2[_0x45d7('0x2a')][_0x45d7('0x1e')][_0x45d7('0x45')],_0x45d7('0x93'),(_0x4c3724,_0x42a538)=>{_0x42a538['directChange']&&this[_0x45d7('0x26')]();}),this['listenTo'](_0x1538c2[_0x45d7('0x73')][_0x45d7('0x58')],_0x45d7('0x1f'),()=>{this[_0x45d7('0x26')]();}),this[_0x45d7('0x21')](),_0x1538c2['model']['on']('applyOperation',(_0x4675dc,_0x4e9a04)=>{const _0x36cbae=_0x4e9a04[0x0];_0x36cbae[_0x45d7('0x5f')]&&(this[_0x45d7('0x31')](_0x36cbae),this[_0x45d7('0x53')]()&&this[_0x45d7('0x35')]());}),this[_0x45d7('0xd')](),this[_0x45d7('0x7c')](_0x45d7('0x61'))['to'](_0x440a46,'state',this,_0x45d7('0x72'),(_0x1727cd,_0x3a3582)=>_0x45d7('0x55')===_0x1727cd&&!_0x3a3582),this['on']('change:_isEditingAllowed',()=>{this[_0x45d7('0x61')]?_0x1538c2[_0x45d7('0x4e')]('rtc-offline'):_0x1538c2[_0x45d7('0x23')]('rtc-offline');}),this['_isEditingAllowed']?_0x1538c2[_0x45d7('0x4e')]('rtc-offline'):_0x1538c2['enableReadOnlyMode'](_0x45d7('0x85')),this[_0x45d7('0x39')](_0x45d7('0x3d'),!0x1);}async[_0x45d7('0x4a')](){const _0x39b25e=this[_0x45d7('0x4d')]['plugins'][_0x45d7('0x76')](_0xec0562),_0xea3de3=this[_0x45d7('0x4d')][_0x45d7('0x57')]['get'](_0x250c7b);try{this['_isPendingUpdate']=!0x0,_0x39b25e[_0x45d7('0x3e')](this[_0x45d7('0x5e')]);const _0x3f40f6=await this['_service']['reconnect'](_0xea3de3[_0x45d7('0x81')],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x3f40f6)&&(this[_0x45d7('0xb0')]=!0x1,this[_0x45d7('0x44')]());const _0x169748=await this[_0x45d7('0x6f')][_0x45d7('0x7b')]();_0x39b25e['register'](this[_0x45d7('0x5e')],_0x169748),this[_0x45d7('0x50')](),this[_0x45d7('0x3d')]=!0x0;}catch(_0x17aa98){if(function(_0x2f8dbe){return _0x45d7('0xaa')===_0x2f8dbe[_0x45d7('0xac')];}(_0x17aa98)&&this[_0x45d7('0x56')])await this[_0x45d7('0x79')]();else{if(function(_0x387e1d){return _0x45d7('0x4f')===_0x387e1d[_0x45d7('0xac')];}(_0x17aa98)){const _0x2ae42a=_0x4c21b1(this['editor'][_0x45d7('0x25')],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this[_0x45d7('0x5d')](_0x2ae42a);}else{if(!(_0x17aa98 instanceof W))throw _0x17aa98;this[_0x45d7('0x5d')]();}}}}[_0x45d7('0x34')](){const _0x7b920a=this['editor'][_0x45d7('0x57')]['get'](_0x250c7b),_0x548bf5=this[_0x45d7('0x4d')][_0x45d7('0x57')][_0x45d7('0x76')](_0xec0562);this['editor'][_0x45d7('0x23')](_0x45d7('0x60')),_0x548bf5[_0x45d7('0x7e')]['has'](this[_0x45d7('0x5e')])&&_0x548bf5['unregister'](this[_0x45d7('0x5e')]),_0x7b920a[_0x45d7('0x74')](this),this[_0x45d7('0x83')](),super['destroy']();}async[_0x45d7('0x24')](_0x507785){if(this[_0x45d7('0x56')]!==_0x507785[_0x45d7('0x56')]&&this[_0x45d7('0xc0')]!==_0x507785[_0x45d7('0x27')])throw new W();return this[_0x45d7('0x56')]=_0x507785[_0x45d7('0x56')],this['_handleServerResponse']([],{..._0x507785,'wereChangesApplied':!0x1,'data':_0x507785[_0x45d7('0x7d')]},'reconnect');}async[_0x45d7('0x9b')](_0x4bded0,_0x3dce83=!0x1){const {connection:_0xf85c3}=this['editor'][_0x45d7('0x57')][_0x45d7('0x76')](_0x250c7b);l[_0x45d7('0xa9')][_0x45d7('0x7b')](_0xf85c3,this[_0x45d7('0x5e')])[_0x45d7('0x2c')](_0x40f918=>this[_0x45d7('0x1d')](_0x40f918))['catch'](_0x119bd3=>{this[_0x45d7('0x88')]('realtimecollaborationclient-init-session-connection-error',_0x119bd3);}),this[_0x45d7('0x48')](this[_0x45d7('0x6f')],_0x45d7('0xb7'),this[_0x45d7('0x6e')][_0x45d7('0x7c')](this)),this[_0x45d7('0x48')](this[_0x45d7('0x6f')],_0x45d7('0xc6'),(_0x2ebcbf,_0x1d7d06)=>{this[_0x45d7('0x88')](_0x45d7('0x40'),_0x1d7d06);}),this['listenTo'](this[_0x45d7('0x6f')],_0x45d7('0x9a'),()=>{this[_0x45d7('0x3d')]=!0x1;});const _0x4725b0=this[_0x45d7('0x3a')][_0x45d7('0xc1')](_0x4bded0),_0x10b7a3=await this[_0x45d7('0x6f')][_0x45d7('0x1b')](_0xf85c3,this['_compressOperations'](_0x4bded0),_0x4725b0);if(this[_0x45d7('0x56')]=_0x10b7a3[_0x45d7('0x56')],_0x10b7a3[_0x45d7('0x3c')]&&(this[_0x45d7('0xb0')]=!0x1,this[_0x45d7('0x44')]()),_0x3dce83){if(!_0x10b7a3[_0x45d7('0x3c')])return void this[_0x45d7('0x5d')]();this[_0x45d7('0x8d')][_0x45d7('0x28')](),this['_offset']=_0x10b7a3[_0x45d7('0x7f')],this[_0x45d7('0x8d')][_0x45d7('0x63')]=this[_0x45d7('0x2')],await this['_handleServerResponse'](_0x4bded0,_0x10b7a3,_0x45d7('0x3'));}else await this[_0x45d7('0x29')](_0x10b7a3,_0x4bded0);this[_0x45d7('0x50')](),this['_isConnected']=!0x0;}[_0x45d7('0x50')](){const _0x54cfb2=this[_0x45d7('0x4d')]['plugins'][_0x45d7('0x76')](_0xec0562),_0x2f2c1e=this[_0x45d7('0x4d')][_0x45d7('0x57')][_0x45d7('0x76')](_0x53e3d7),_0x50581d=_0x54cfb2[_0x45d7('0x7e')][_0x45d7('0x76')](this[_0x45d7('0x5e')]);_0x50581d&&_0x50581d[_0x45d7('0x62')]>0x1?_0x2f2c1e[_0x45d7('0x12')]():this[_0x45d7('0x48')](_0x54cfb2,'sessionAdd:'+this[_0x45d7('0x5e')],()=>{0x2===_0x54cfb2[_0x45d7('0x7e')][_0x45d7('0x76')](this[_0x45d7('0x5e')])[_0x45d7('0x62')]&&_0x2f2c1e['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x2d84cc,_0xe274af,_0x429ca6,_0x15e71d){if(!this['_isPendingUpdate']&&this[_0x45d7('0x5')][_0x45d7('0x63')]==_0xe274af){const _0xed2051=this[_0x45d7('0x2d')](_0x429ca6,_0x15e71d);await this['_fetchMissingUsers'](_0xed2051),this['_handleExternalOperations'](_0xed2051,_0xe274af,_0x429ca6[_0x45d7('0x27')])||this[_0x45d7('0x88')]('realtimecollaborationclient-initservice-incorrect-server-operation');}}async[_0x45d7('0x79')](){this[_0x45d7('0x83')]();const {locale:_0x3c27dd}=this[_0x45d7('0x4d')];let _0x1bdc15;try{_0x1bdc15=await this[_0x45d7('0x6f')][_0x45d7('0xbf')]();}catch(_0x24803f){const _0x3cbfa7=_0x4c21b1(_0x3c27dd,_0x45d7('0x16'));return void this['_handleReconnectionError'](_0x3cbfa7);}const _0x2514a1=_0x1bdc15['currentDocumentSession']||_0x1bdc15[_0x45d7('0xb3')];if(this['_lastSyncedOperationId']===_0x2514a1[_0x45d7('0x27')])await this['_connectService'](this[_0x45d7('0x4d')][_0x45d7('0x2a')][_0x45d7('0x1e')][_0x45d7('0x91')][_0x45d7('0xc')](),!0x0);else{const _0x49c278=_0x4c21b1(_0x3c27dd,_0x45d7('0x46'));this[_0x45d7('0x5d')](_0x49c278);}}[_0x45d7('0x83')](){this['_service'][_0x45d7('0xa')](),this[_0x45d7('0x43')]=[],clearTimeout(this[_0x45d7('0x90')]),this['stopListening'](this[_0x45d7('0x6f')]);}[_0x45d7('0x1d')](_0x2fe848){const _0x465900=this[_0x45d7('0x4d')][_0x45d7('0x57')][_0x45d7('0x76')](_0xec0562);this['listenTo'](_0x465900,_0x45d7('0x22')+this['_channelId'],(_0x150255,{session:_0x10fb72})=>{if(_0x10fb72['id']===_0x465900[_0x45d7('0x75')]){_0x150255['off']();const _0x21c54c=this[_0x45d7('0x4d')][_0x45d7('0x57')]['has'](_0x45d7('0xb'))&&this[_0x45d7('0x4d')][_0x45d7('0x57')][_0x45d7('0x76')](_0x45d7('0xb'));let _0x2ad824=_0x10fb72[_0x45d7('0xad')];_0x21c54c&&_0x21c54c[_0x45d7('0xbb')]&&(_0x2ad824=_0x2ad824['filter'](_0x510e61=>_0x45d7('0x8c')!==_0x510e61)),this[_0x45d7('0x4d')][_0x45d7('0x57')][_0x45d7('0x76')](_0x45d7('0x69'))[_0x45d7('0xa4')](_0x2ad824,this[_0x45d7('0x5e')]);}}),_0x465900[_0x45d7('0x6d')](this[_0x45d7('0x5e')],_0x2fe848);}[_0x45d7('0x21')](){const _0x141454=this[_0x45d7('0x4d')]['data'][_0x45d7('0x39')];this[_0x45d7('0x4d')][_0x45d7('0x7d')][_0x45d7('0x39')]=(..._0x57a76d)=>{if(!_0x57a76d[_0x57a76d[_0x45d7('0x62')]-0x1][_0x45d7('0x51')])throw new _0xeddf3e(_0x45d7('0x5b'),this);_0x141454[_0x45d7('0x42')](this[_0x45d7('0x4d')][_0x45d7('0x7d')],_0x57a76d);};}[_0x45d7('0xd')](){this[_0x45d7('0x4d')][_0x45d7('0x7d')]['on'](_0x45d7('0x6a'),(_0x2ce9a9,[_0x53eb4c])=>{if(this[_0x45d7('0x5')][_0x45d7('0x63')])throw new _0xeddf3e(_0x45d7('0x10'),this);_0x2ce9a9['stop'](),this[_0x45d7('0x52')]();const _0x597751=this['_getOperationsFromInitData'](_0x53eb4c);_0x2ce9a9[_0x45d7('0xbe')]=this[_0x45d7('0x9b')](_0x597751)[_0x45d7('0x2c')](()=>{this[_0x45d7('0x4d')]['plugins']['get'](_0x250c7b)[_0x45d7('0xb5')](this),this['editor']['data'][_0x45d7('0xb2')]('ready');})['catch'](_0x21c71a=>this[_0x45d7('0x88')]('realtimecollaborationclient-init-connection-failed',_0x21c71a))[_0x45d7('0x7a')](()=>this[_0x45d7('0x44')]());},{'priority':_0x45d7('0xaf')});}async['_fetchMissingUsers'](_0x43304c){const _0x45fa89=this[_0x45d7('0x4d')][_0x45d7('0x57')][_0x45d7('0x76')](_0x38e5dc),{connection:_0x52b2e1}=this[_0x45d7('0x4d')][_0x45d7('0x57')][_0x45d7('0x76')](_0x250c7b),_0x467b61=new Set();for(const _0x2b9acf of _0x43304c){const _0x4f9287=_0x2b9acf[_0x45d7('0x9c')];_0x4f9287&&!_0x45fa89['getUser'](_0x4f9287)&&_0x467b61[_0x45d7('0xae')](_0x4f9287);}if(0x0===_0x467b61[_0x45d7('0x99')])return;const _0x4b7ce6=await _0x34b11f[_0x45d7('0x98')](_0x52b2e1,Array[_0x45d7('0x32')](_0x467b61));for(const _0x49a03e of _0x4b7ce6)_0x45fa89[_0x45d7('0x5c')](_0x49a03e['id'])||_0x45fa89[_0x45d7('0xa3')](_0x49a03e);}[_0x45d7('0xa0')](_0x43fbc7){const _0x38e920=this[_0x45d7('0x4d')][_0x45d7('0x2a')],_0x2e18da=[];let _0x59c91c=0x0;const _0x25d26e=_0x45d7('0x18')==typeof _0x43fbc7?{'main':_0x43fbc7}:_0x43fbc7;for(const _0x5c5649 of Object[_0x45d7('0x94')](_0x25d26e)){if(!this['_document'][_0x45d7('0x66')][_0x45d7('0xbc')](_0x5c5649))throw new _0xeddf3e(_0x45d7('0x2f'),this);const _0x460b62=this[_0x45d7('0x4d')][_0x45d7('0x7d')]['parse'](_0x25d26e[_0x5c5649]),_0x95cd7c=this[_0x45d7('0x5')][_0x45d7('0xa5')](_0x5c5649),_0x43aad5=new _0x57ee07(_0x38e920['createPositionAt'](_0x95cd7c,0x0),_0x460b62,_0x59c91c++);_0x2e18da[_0x45d7('0x8f')](_0x43aad5);for(const [_0x447a8d,_0x112f31]of _0x460b62[_0x45d7('0xc2')]){const _0x4b3071=_0x38e920[_0x45d7('0x3b')](_0x38e920['createPositionFromPath'](_0x95cd7c,_0x112f31[_0x45d7('0xa6')]['path'][_0x45d7('0xbd')]()),_0x38e920['createPositionFromPath'](_0x95cd7c,_0x112f31[_0x45d7('0x86')][_0x45d7('0x96')][_0x45d7('0xbd')]())),_0x58e013=new _0x50e75d(_0x447a8d,null,_0x4b3071,_0x38e920[_0x45d7('0xc2')],!0x0,_0x59c91c++);_0x2e18da['push'](_0x58e013);}}return _0x2e18da;}async[_0x45d7('0x29')](_0x707117,_0xf230b2){let _0x5a2b98;this[_0x45d7('0x2')]=_0x707117[_0x45d7('0x7f')];const _0x2c9e9e=_0x707117[_0x45d7('0x3c')]&&!_0x707117['initData'],_0x53ba3f=_0x2c9e9e?0x0:_0x707117[_0x45d7('0x7d')][_0x45d7('0x7')];if(_0x2c9e9e)_0x5a2b98=_0xf230b2,_0x5a2b98[_0x45d7('0x3f')](_0x20df27=>{_0x20df27['createdAt']=_0x707117[_0x45d7('0x2b')],_0x20df27[_0x45d7('0x70')]=!0x0,_0x20df27[_0x45d7('0x9c')]=null;}),this[_0x45d7('0x82')](_0x5a2b98,_0x2c9e9e);else{if(_0x707117[_0x45d7('0x2e')]){const _0x1f47d6=this[_0x45d7('0xa0')](_0x707117[_0x45d7('0x2e')]);this['_document'][_0x45d7('0x91')][_0x45d7('0x63')]=-_0x1f47d6[_0x45d7('0x62')],_0x1f47d6['forEach'](_0x15bb4=>{_0x15bb4[_0x45d7('0x7')]-=_0x1f47d6[_0x45d7('0x62')],_0x15bb4[_0x45d7('0x38')]=_0x707117[_0x45d7('0x2b')],_0x15bb4[_0x45d7('0x70')]=!0x0,_0x15bb4[_0x45d7('0x9c')]=null;}),this[_0x45d7('0x82')](_0x1f47d6,!0x0),this['serverHistory'][_0x45d7('0x63')]=-_0x1f47d6[_0x45d7('0x62')]+this[_0x45d7('0x2')],this[_0x45d7('0xa2')](_0x1f47d6);}this[_0x45d7('0x5')][_0x45d7('0x91')]['version']=_0x53ba3f,_0x5a2b98=this[_0x45d7('0x2d')](_0x707117[_0x45d7('0x7d')],_0x707117[_0x45d7('0xb6')]),await this[_0x45d7('0x87')](_0x5a2b98),this[_0x45d7('0x82')](_0x5a2b98,_0x2c9e9e);}_0x707117[_0x45d7('0x27')]&&(this[_0x45d7('0x3a')][_0x45d7('0x36')](_0x5a2b98,_0x707117['lastOperationId']),this[_0x45d7('0xc0')]=_0x707117[_0x45d7('0x27')]),this['serverHistory'][_0x45d7('0x63')]=_0x53ba3f+this['_offset'],this['_updateServerHistory'](_0x5a2b98);}[_0x45d7('0x88')](_0x13264f,_0x4212c2){throw this[_0x45d7('0xb0')]=!0x0,_0x4212c2&&console[_0x45d7('0xc6')](_0x4212c2),new _0xeddf3e(_0x13264f,this['editor']);}[_0x45d7('0x31')](_0x3dd355){this[_0x45d7('0x95')][_0x45d7('0xbc')](_0x3dd355)||(this['_knownOperations']['add'](_0x3dd355),this[_0x45d7('0x43')]['push'](_0x3dd355),this[_0x45d7('0xab')]||_0x45d7('0x49')==_0x3dd355[_0x45d7('0xa8')]&&!_0x3dd355[_0x45d7('0x1c')]||this[_0x45d7('0x52')]());}['_sendBufferedOperationsDelayed'](_0x5399b4=!0x1){!_0x5399b4&&this['_isPendingUpdate']||(this[_0x45d7('0xb0')]=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this[_0x45d7('0x17')]()[_0x45d7('0x2c')](_0x2e994f=>{_0x2e994f&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})[_0x45d7('0x41')](_0x334c6c=>{if(this['_clearPendingAction'](),this[_0x45d7('0xb0')]=!0x1,!function(_0x1bdfe1){return _0x1bdfe1[_0x45d7('0x47')]['startsWith'](_0x45d7('0xb1'))||_0x1bdfe1['message'][_0x45d7('0x77')](_0x45d7('0x19'))||_0x1bdfe1['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x334c6c))throw _0x334c6c;});},this[_0x45d7('0x1')]));}async[_0x45d7('0x17')](){const _0x1c1162=this[_0x45d7('0x4d')][_0x45d7('0x57')][_0x45d7('0x76')](_0x53e3d7);if(this['_shouldSendSelectionUpdate']()&&(_0x1c1162['createUserMarkerOperations'](),this[_0x45d7('0x8a')]=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x1e8c9f=[...this[_0x45d7('0x43')]];for(const _0x26c8c0 of _0x1e8c9f)_0x26c8c0['wasUndone']=this['_document'][_0x45d7('0x91')][_0x45d7('0x9f')](_0x26c8c0);const _0x2d1a21=this[_0x45d7('0x3a')][_0x45d7('0xc1')](_0x1e8c9f),_0x1fa5a7=V++,_0x4d2543=this[_0x45d7('0x67')](_0x1e8c9f),_0x13a154=await this[_0x45d7('0x6f')][_0x45d7('0xb9')](_0x4d2543,_0x4d2543['baseVersion'],_0x2d1a21);try{return await this[_0x45d7('0x89')](_0x1e8c9f,_0x13a154,_0x1fa5a7);}catch(_0x4faaa9){return this['_crash'](_0x45d7('0x92'),_0x4faaa9);}}async['_handleServerResponse'](_0x204bc1,_0x4d2ddc,_0x45181d){if(_0x4d2ddc[_0x45d7('0xc6')])throw _0x4d2ddc[_0x45d7('0xc6')];let _0x4e8aa7=!0x1;if(_0x4d2ddc['wereChangesApplied']){_0x4d2ddc['lastOperationId']&&(this[_0x45d7('0xc0')]=_0x4d2ddc['lastOperationId']),this[_0x45d7('0x43')]=this['_bufferedOperations'][_0x45d7('0x1a')](_0x1fd33d=>!_0x204bc1[_0x45d7('0x9')](_0x1fd33d));for(const _0xa03d54 of _0x204bc1)_0xa03d54[_0x45d7('0x38')]=_0x4d2ddc[_0x45d7('0x6')];this['_updateServerHistory'](_0x204bc1),_0x4e8aa7=!0x0,this['_currentBufferDelay']=this[_0x45d7('0xf')];}else{const _0x159002=this[_0x45d7('0x2d')](_0x4d2ddc[_0x45d7('0x7d')],_0x4d2ddc['metadata'])[_0x45d7('0x1a')](_0x284000=>_0x284000[_0x45d7('0x7')]>=this[_0x45d7('0xe')]);await this[_0x45d7('0x87')](_0x159002),_0x4e8aa7=this[_0x45d7('0x4b')](_0x159002,_0x4d2ddc[_0x45d7('0x63')],_0x4d2ddc['lastOperationId']),this[_0x45d7('0x1')]=Math[_0x45d7('0x4')](this['_currentBufferDelay']/0x2);}return _0x4e8aa7?!this[_0x45d7('0x53')]()||(this[_0x45d7('0x35')](!0x0),!0x1):this[_0x45d7('0x88')](_0x45d7('0x59'));}[_0x45d7('0x4b')](_0x555c2d,_0x3542cd,_0x45018b){try{const _0x4ce163={'document':this[_0x45d7('0x5')],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x3d01e2,operationsB:_0x498d01,originalOperations:_0x12cef9}=_0x1082d5(_0x555c2d,this[_0x45d7('0x43')],_0x4ce163);F(_0x3d01e2,this[_0x45d7('0x5')][_0x45d7('0x63')]),F(_0x498d01,_0x3542cd);for(const _0x392adb of _0x3d01e2){const _0x600e30=_0x12cef9[_0x45d7('0x76')](_0x392adb);_0x392adb[_0x45d7('0x9c')]=_0x600e30?_0x600e30[_0x45d7('0x9c')]:null;}_0x45018b&&(this[_0x45d7('0x3a')][_0x45d7('0x36')](_0x555c2d,_0x45018b),this[_0x45d7('0xc0')]=_0x45018b),this['_bufferedOperations']=[..._0x498d01],this[_0x45d7('0x82')](_0x3d01e2),this[_0x45d7('0xa2')](_0x555c2d);}catch(_0x2f6939){return console[_0x45d7('0xc6')](_0x2f6939),!0x1;}return!0x0;}['_applyOperationsSet'](_0x2b117f,_0x45d0bb=!0x1){this[_0x45d7('0x4d')][_0x45d7('0x2a')][_0x45d7('0x9e')]({'isUndoable':!0x1,'isLocal':!0x1},_0xcdd9e4=>{for(const _0xf9a455 of _0x2b117f)this['_knownOperations'][_0x45d7('0xae')](_0xf9a455),_0xcdd9e4[_0x45d7('0x33')][_0x45d7('0x64')](_0xf9a455),this[_0x45d7('0x4d')]['model'][_0x45d7('0xa7')](_0xf9a455);});}['_updateServerHistory'](_0x569e0d){_0x569e0d[_0x45d7('0x3f')](_0x2bdd80=>{const _0x237e87=_0x2bdd80['clone']();_0x237e87['_authorId']=_0x2bdd80[_0x45d7('0x9c')],_0x237e87[_0x45d7('0x70')]=!!_0x2bdd80[_0x45d7('0x70')],_0x237e87[_0x45d7('0x38')]=_0x2bdd80[_0x45d7('0x38')],_0x237e87[_0x45d7('0x7')]+=this['_offset'],_0x2bdd80[_0x45d7('0x8')]&&this[_0x45d7('0x54')][_0x45d7('0xae')](_0x237e87),this[_0x45d7('0x8d')]['addOperation'](_0x237e87);});}[_0x45d7('0x5d')](_0x254dc1){const _0x257b7e=this['editor']['plugins'][_0x45d7('0x76')](_0x45d7('0xb8')),_0x4204f3=this['editor'][_0x45d7('0x25')];_0x254dc1||(_0x254dc1=_0x4c21b1(_0x4204f3,_0x45d7('0x9d'))),_0x257b7e[_0x45d7('0x65')](_0x254dc1,{'title':_0x4c21b1(_0x4204f3,_0x45d7('0x8b')),'namespace':_0x45d7('0x6c')}),this[_0x45d7('0x72')]=!0x0,clearTimeout(this[_0x45d7('0x5a')]),this[_0x45d7('0x43')]=[],this[_0x45d7('0x4d')][_0x45d7('0x57')][_0x45d7('0x76')](_0x250c7b)[_0x45d7('0x34')]();}['_setPendingAction'](){this['_pendingAction']||(this[_0x45d7('0xab')]=this[_0x45d7('0x4d')][_0x45d7('0x57')][_0x45d7('0x76')](_0x260e85)[_0x45d7('0xae')](_0x4c21b1(this[_0x45d7('0x4d')][_0x45d7('0x25')],'PENDING_ACTION_SENDING_DATA')));}[_0x45d7('0x44')](){this['_pendingAction']&&(this[_0x45d7('0x4d')][_0x45d7('0x57')][_0x45d7('0x76')](_0x260e85)[_0x45d7('0x11')](this['_pendingAction']),this[_0x45d7('0xab')]=null);}['_compressOperations'](_0x191d0f){const _0x17ad4b=_0x191d0f[_0x45d7('0x0')](_0x44efb0=>_0x44efb0[_0x45d7('0xc4')]());return this[_0x45d7('0x97')][_0x45d7('0xc3')](_0x17ad4b);}[_0x45d7('0x2d')](_0x4b8eb9,_0x251ffb){const _0x4e8ce1=this[_0x45d7('0x97')][_0x45d7('0x20')](_0x4b8eb9)['map']((_0x24cb61,_0x250a6e)=>{const _0x36c174=_0x18a8cf['fromJSON'](_0x24cb61,this[_0x45d7('0x5')]);return _0x36c174[_0x45d7('0x30')]=_0x24cb61[_0x45d7('0x30')],_0x45d7('0x78')===_0x251ffb[_0x250a6e][_0x45d7('0xa8')]&&(_0x36c174[_0x45d7('0x8')]=!0x0),_0x36c174;});return this[_0x45d7('0xc5')](_0x4e8ce1,_0x251ffb),_0x4e8ce1;}[_0x45d7('0xc5')](_0x2057ef,_0x327b9a){for(let _0x8ee7a4=0x0;_0x8ee7a4<_0x2057ef[_0x45d7('0x62')];_0x8ee7a4++)_0x45d7('0x6a')==_0x327b9a[_0x8ee7a4][_0x45d7('0xa8')]?(_0x2057ef[_0x8ee7a4][_0x45d7('0x70')]=!0x0,_0x2057ef[_0x8ee7a4][_0x45d7('0x9c')]=null):(_0x2057ef[_0x8ee7a4][_0x45d7('0x70')]=!0x1,_0x2057ef[_0x8ee7a4][_0x45d7('0x9c')]=_0x327b9a[_0x8ee7a4][_0x45d7('0x6b')]),_0x2057ef[_0x8ee7a4][_0x45d7('0x38')]=_0x327b9a[_0x8ee7a4][_0x45d7('0x38')];}[_0x45d7('0x26')](){this[_0x45d7('0x8a')]=!0x0,this[_0x45d7('0x37')]()?this[_0x45d7('0x35')]():this[_0x45d7('0x8a')]=!0x1;}[_0x45d7('0x37')](){const _0x3fb43b=this[_0x45d7('0x4d')][_0x45d7('0x57')]['get'](_0xec0562)[_0x45d7('0x7e')][_0x45d7('0x76')](this[_0x45d7('0x5e')]);return!this[_0x45d7('0x4d')][_0x45d7('0x80')]&&_0x3fb43b&&_0x3fb43b[_0x45d7('0x62')]>0x1&&this[_0x45d7('0x8a')];}[_0x45d7('0x53')](){return this[_0x45d7('0x43')][_0x45d7('0x62')]>0x0||this[_0x45d7('0x37')]();}}class W extends Error{}function F(_0x5698bb,_0x5b67e0){for(const _0x3ce406 of _0x5698bb)_0x3ce406[_0x45d7('0x7')]=_0x5b67e0++;}l[_0x45d7('0xa9')]=_0x366772;class H{constructor(_0x4af66f){this['_ignoredOperations']=_0x4af66f,this[_0x45d7('0xb4')]=new WeakMap();}['getIdOfTheLastOperation'](_0x5ead50){let _0x55cc44=_0x5ead50[_0x45d7('0x62')];for(;_0x55cc44--;){const _0x49ac73=_0x5ead50[_0x55cc44];if(!this['_ignoredOperations'][_0x45d7('0xbc')](_0x49ac73)){if(!this[_0x45d7('0xb4')][_0x45d7('0xbc')](_0x49ac73)){const _0x19de1f=_0x1a5607()[_0x45d7('0xbd')](0x1,0x12);this['_operationToId'][_0x45d7('0x39')](_0x49ac73,_0x19de1f);}return this[_0x45d7('0xb4')][_0x45d7('0x76')](_0x49ac73);}}}[_0x45d7('0x36')](_0x3de76b,_0x3504e1){if(!_0x3504e1)return;let _0x5d9b7b=_0x3de76b['length'];for(;_0x5d9b7b--;){const _0x125d88=_0x3de76b[_0x5d9b7b];this[_0x45d7('0x8e')][_0x45d7('0xbc')](_0x125d88)||this['_operationToId'][_0x45d7('0x39')](_0x125d88,_0x3504e1);}}}
23
+ const _0x5269=['_sendBufferedOperationsDelayId','data','bufferOperation','realtimecollaborationclient-sendbufferedoperations','_isPendingUpdate','addOperation','Synchronization\x20issue','collaboration','set','_pendingAction','listenTo','document','clone','editor','config','realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration','_isAttached','_offset','length','rootsAttributes','register','collaboration-missing-channelid','_isConnected','_knownOperations','setIdForTheLastOperation','_ignoredOperations','operationsReceived','_isDisconnection','type','size','_initSessionsHandling','sessionAdd:','sendOperations','message','_connectAfterSessionHasBeenFlushed','lastDocumentSession','metadata','position','PENDING_ACTION_SENDING_DATA','_hasSelectionChanged','lastOperationAcceptedAt','baseVersion','catch','_clearPendingAction','_isInit','unregister','plugins','model','wereChangesApplied','serverHistory','getIdOfTheLastOperation','createRange','createPositionFromPath','_channelId','code','_handleReconnectionError','getConnectedSessions','cloud-services-internal-error:\x20Request\x20timeout.','destroy','_disconnectService','_lastServerVersion','permissions','then','_authorId','_sendBufferedOperationsDelayed','_operationToId','marker','_handleInitialConnectionData','__className','_saveOperationInBuffer','requires','getRoot','lastSyncVersion','disableReadOnlyMode','RealTimeCollaborationClient','string','rootName','bind','_connectService','change:hasDomSelection','_baseBufferDelay','rtc-destroyed','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.','_compressOperations','includes','connected','_setPendingAction','disconnect','define','rtc-offline','_sendBufferedOperations','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.','roots','connect','removeFromReconnectionStack','_currentBufferDelay','reconnection:\x20flushed\x20session','isAdd','decompress','initData','return','Notification','_operationIdentifier','real-time-collaboration','isEnabled','_applyOperationsSet','push','high','CollaborativeEditingService','init','realtimecollaborationclient-handleserverresponse','locale','_shouldSendSelectionUpdate','404','createUserMarkerOperations','getMany','getUser','createdAt','_compressor','collaboration.channelId','directChange','_handleExternalOperations','_shouldSendUpdate','toJSON','get','filter','has','sessionId','isReadOnly','ready','reconnect','enqueueChange','_refreshUserSelectionMarkers','_document','_bufferedOperations','end','realtimecollaborationclient-init-connection-failed','error','forEach','round','enableReadOnlyMode','lastOperationId','editing','map','_disconnectionOperations','addUser','currentDocumentSession','entries','getDocumentDetails','slice','fire','differ','_handleSendingSelectionMarkers','realtimecollaborationclient-init-session-connection-error','state','start','disconnected','_handleReconnectionResponse','getOperationAuthor','_fetchMissingUsers','mySessionId','history','_crash','userId','from','_handleServerResponse','wasUndone','sessionCreatedAt','cloudServices.bundleVersion','realtimecollaborationclient-init-non-existent-root','connection','fromJSON','realtimecollaborationclient-init-document-already-initialized','$root','_decompressOperations','parse','applyOperation','offset','finally','stop','markers','add','cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.','_handleReceivedOperations','startsWith','version','channelSessions','realtimecollaborationclient-initservice-incorrect-server-operation','_getOperationsFromInitData','_service','view','pluginName','_hasSynchronizationProblem','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','off','_isEditingAllowed','CommentsOnly','apply','_lastSyncedOperationId','cs:removeUser','_updateServerHistory','suppressErrorInCollaboration','multi-root-editor-root-attributes-no-root','addToReconnectionStack','batch'];(function(_0x4236fe,_0x526998){const _0x26ae61=function(_0x56b520){while(--_0x56b520){_0x4236fe['push'](_0x4236fe['shift']());}};_0x26ae61(++_0x526998);}(_0x5269,0x17a));const _0x26ae=function(_0x4236fe,_0x526998){_0x4236fe=_0x4236fe-0x0;let _0x26ae61=_0x5269[_0x4236fe];return _0x26ae61;};import{Plugin as _0x439ed6,PendingActions as _0x3e37cc}from'ckeditor5/src/core';import{CKEditorError as _0x4d77ef,version as _0x491a80,uid as _0x1fbea5}from'ckeditor5/src/utils';import{Notification as _0x14f6d4}from'ckeditor5/src/ui';import{transformSets as _0x4d4c02,InsertOperation as _0x2560e6,MarkerOperation as _0x30850e,RootAttributeOperation as _0x301496,RootOperation as _0x4dfaf5,OperationFactory as _0x42b1b0,History as _0x3bcfd4}from'ckeditor5/src/engine';import _0x12b3fb from'./websocketgateway';import _0x466843 from'./sessions';import _0x10b6c8 from'./usermarkers';import{getTranslation as _0x2c78c5}from'../common-translations';import _0x48346f from'@ckeditor/ckeditor5-operations-compressor/src/compressor';import{Users as _0x21abf3}from'ckeditor5-collaboration/src/collaboration-core';import _0x4ac2c5 from'@ckeditor/ckeditor-cloud-services-collaboration/src/collaborativeeditingservice/collaborativeeditingservice';import _0x2484c6 from'@ckeditor/ckeditor-cloud-services-collaboration/src/users/user';let j=0x1;export default class l extends _0x439ed6{static get[_0x26ae('0x66')](){return[_0x12b3fb,_0x466843,_0x10b6c8,_0x3e37cc,_0x21abf3,_0x14f6d4];}static get[_0x26ae('0x12')](){return _0x26ae('0x6a');}get['cloudDocumentVersion'](){return this[_0x26ae('0x5c')]+this['_offset'];}get[_0x26ae('0x5c')](){return this[_0x26ae('0x51')]['version']-this[_0x26ae('0x31')];}get[_0x26ae('0x68')](){const _0x5e5fdc=this[_0x26ae('0x51')]['getOperations']();for(let _0x3e7406=_0x5e5fdc[_0x26ae('0x32')]-0x1;_0x3e7406>=0x0;_0x3e7406--){const _0xa1fbf4=_0x5e5fdc[_0x3e7406];if(!this[_0x26ae('0xb0')]['has'](_0xa1fbf4))return _0xa1fbf4[_0x26ae('0x49')]+0x1-this[_0x26ae('0x31')];}return 0x0;}constructor(_0x41c72c){if(super(_0x41c72c),this[_0x26ae('0x31')]=0x0,this[_0x26ae('0x9f')]=null,this[_0x26ae('0x51')]=new _0x3bcfd4(),this[_0x26ae('0x2d')][_0x26ae('0x2e')][_0x26ae('0x78')](_0x26ae('0x27'),{}),this[_0x26ae('0x55')]=this[_0x26ae('0x2d')][_0x26ae('0x2e')][_0x26ae('0x9c')](_0x26ae('0x97')),!this['_channelId'])throw new _0x4d77ef(_0x26ae('0x35'),this);const _0x77245e=_0x41c72c[_0x26ae('0x2e')][_0x26ae('0x9c')](_0x26ae('0xc8'))||_0x491a80;this['_service']=new l[(_0x26ae('0x8c'))](_0x77245e,this['_channelId']),this[_0x26ae('0xa5')]=this[_0x26ae('0x2d')][_0x26ae('0x4f')][_0x26ae('0x2b')],this[_0x26ae('0x96')]=new _0x48346f(),this[_0x26ae('0xa6')]=[],this[_0x26ae('0x37')]=new WeakSet(),this[_0x26ae('0x28')](_0x26ae('0x24'),!0x1),this[_0x26ae('0x28')](_0x26ae('0x13'),!0x1),this[_0x26ae('0x29')]=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this[_0x26ae('0x70')]=0x12c,this[_0x26ae('0x7f')]=this['_baseBufferDelay'],this[_0x26ae('0x19')]=null,this[_0x26ae('0xb0')]=new WeakSet(),this[_0x26ae('0x86')]=new q(this[_0x26ae('0xb0')]);}[_0x26ae('0x8d')](){const _0x207247=this[_0x26ae('0x2d')],_0x3066a2=_0x207247[_0x26ae('0x4e')]['get'](_0x21abf3),_0x320829=_0x207247[_0x26ae('0x4e')][_0x26ae('0x9c')](_0x12b3fb);this['listenTo'](_0x3066a2,_0x26ae('0xbe'),(_0x2aa77e,_0xe42f60)=>{const _0x14f3b2=_0xe42f60[0x0];_0x14f3b2['_authorId']&&(_0x2aa77e[_0x26ae('0x84')]=_0x3066a2[_0x26ae('0x94')](_0x14f3b2[_0x26ae('0x5f')]),_0x2aa77e[_0x26ae('0x6')]()),null===_0x14f3b2['_authorId']&&(_0x2aa77e['return']=null,_0x2aa77e[_0x26ae('0x6')]());},{'priority':_0x26ae('0x8b')}),this[_0x26ae('0x2a')](_0x207247[_0x26ae('0x4f')][_0x26ae('0x2b')]['selection'],'change:range',(_0x8973ae,_0x516211)=>{_0x516211[_0x26ae('0x98')]&&this['_refreshUserSelectionMarkers']();}),this[_0x26ae('0x2a')](_0x207247[_0x26ae('0xae')][_0x26ae('0x11')],_0x26ae('0x6f'),()=>{this[_0x26ae('0xa4')]();}),this['_initThrowingOnDataSet'](),_0x207247['model']['on'](_0x26ae('0x3'),(_0xd88081,_0x18e175)=>{const _0x731a69=_0x18e175[0x0];_0x731a69['isDocumentOperation']&&(this[_0x26ae('0x65')](_0x731a69),this['_shouldSendUpdate']()&&this[_0x26ae('0x60')]());}),this['_setUpDataInit'](),this[_0x26ae('0x6d')](_0x26ae('0x16'))['to'](_0x320829,_0x26ae('0xba'),this,'_hasSynchronizationProblem',(_0x102faa,_0x49b65)=>_0x26ae('0x75')===_0x102faa&&!_0x49b65),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x207247[_0x26ae('0x69')]('rtc-offline'):_0x207247[_0x26ae('0xac')](_0x26ae('0x79'));}),this[_0x26ae('0x16')]?_0x207247[_0x26ae('0x69')]('rtc-offline'):_0x207247[_0x26ae('0xac')](_0x26ae('0x79')),this[_0x26ae('0x28')](_0x26ae('0x36'),!0x1);}async[_0x26ae('0xa2')](){const _0x264e69=this[_0x26ae('0x2d')][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x466843),_0x478b4c=this[_0x26ae('0x2d')][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x12b3fb);try{this[_0x26ae('0x24')]=!0x0,_0x264e69['unregister'](this['_channelId']);const _0x456238=await this[_0x26ae('0x10')][_0x26ae('0xa2')](_0x478b4c[_0x26ae('0xca')],this[_0x26ae('0x68')]);await this['_handleReconnectionResponse'](_0x456238)&&(this[_0x26ae('0x24')]=!0x1,this['_clearPendingAction']());const _0x3e9dac=await this[_0x26ae('0x10')][_0x26ae('0x58')]();_0x264e69[_0x26ae('0x34')](this[_0x26ae('0x55')],_0x3e9dac),this['_handleSendingSelectionMarkers'](),this[_0x26ae('0x36')]=!0x0;}catch(_0xb140fa){if(function(_0x38e7f5){return _0x26ae('0x91')===_0x38e7f5[_0x26ae('0x56')];}(_0xb140fa)&&this['sessionId'])await this[_0x26ae('0x42')]();else{if(function(_0x12eb10){return'409'===_0x12eb10[_0x26ae('0x56')];}(_0xb140fa)){const _0x4be642=_0x2c78c5(this[_0x26ae('0x2d')]['locale'],_0x26ae('0x14'));this[_0x26ae('0x57')](_0x4be642);}else{if(!(_0xb140fa instanceof F))throw _0xb140fa;this[_0x26ae('0x57')]();}}}}[_0x26ae('0x5a')](){const _0x4c944a=this[_0x26ae('0x2d')][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x12b3fb),_0x5cf1f5=this['editor'][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x466843);this[_0x26ae('0x2d')][_0x26ae('0xac')](_0x26ae('0x71')),_0x5cf1f5['channelSessions'][_0x26ae('0x9e')](this[_0x26ae('0x55')])&&_0x5cf1f5[_0x26ae('0x4d')](this[_0x26ae('0x55')]),_0x4c944a[_0x26ae('0x7e')](this),this[_0x26ae('0x5b')](),super[_0x26ae('0x5a')]();}async[_0x26ae('0xbd')](_0x394cfc){if(this['sessionId']!==_0x394cfc[_0x26ae('0x9f')]&&this['_lastSyncedOperationId']!==_0x394cfc[_0x26ae('0xad')])throw new F();return this[_0x26ae('0x9f')]=_0x394cfc[_0x26ae('0x9f')],this[_0x26ae('0xc5')]([],{..._0x394cfc,'wereChangesApplied':!0x1,'data':_0x394cfc[_0x26ae('0x21')]},_0x26ae('0xa2'));}async[_0x26ae('0x6e')](_0x36a533,_0x58baf2=!0x1){const {connection:_0x2180ea}=this[_0x26ae('0x2d')][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x12b3fb);l[_0x26ae('0x8c')][_0x26ae('0x58')](_0x2180ea,this[_0x26ae('0x55')])[_0x26ae('0x5e')](_0x506776=>this[_0x26ae('0x3e')](_0x506776))['catch'](_0x4ee6f1=>{this[_0x26ae('0xc2')](_0x26ae('0xb9'),_0x4ee6f1);}),this[_0x26ae('0x2a')](this[_0x26ae('0x10')],_0x26ae('0x3a'),this[_0x26ae('0xa')][_0x26ae('0x6d')](this)),this[_0x26ae('0x2a')](this['_service'],'error',(_0x209367,_0x2eda7b)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x2eda7b);}),this[_0x26ae('0x2a')](this['_service'],_0x26ae('0xbc'),()=>{this[_0x26ae('0x36')]=!0x1;});const _0x2de92c=this[_0x26ae('0x86')][_0x26ae('0x52')](_0x36a533),_0xf852e7=await this[_0x26ae('0x10')][_0x26ae('0x7d')](_0x2180ea,this[_0x26ae('0x73')](_0x36a533),_0x2de92c);if(this[_0x26ae('0x9f')]=_0xf852e7[_0x26ae('0x9f')],_0xf852e7[_0x26ae('0x50')]&&(this[_0x26ae('0x24')]=!0x1,this[_0x26ae('0x4b')]()),_0x58baf2){if(!_0xf852e7[_0x26ae('0x50')])return void this['_handleReconnectionError']();this[_0x26ae('0x51')]['reset'](),this[_0x26ae('0x31')]=_0xf852e7[_0x26ae('0x4')],this[_0x26ae('0x51')][_0x26ae('0xc')]=this[_0x26ae('0x31')],await this['_handleServerResponse'](_0x36a533,_0xf852e7,_0x26ae('0x80'));}else await this[_0x26ae('0x63')](_0xf852e7,_0x36a533);this[_0x26ae('0xb8')](),this[_0x26ae('0x36')]=!0x0;}[_0x26ae('0xb8')](){const _0x195647=this[_0x26ae('0x2d')]['plugins'][_0x26ae('0x9c')](_0x466843),_0x1aac1b=this[_0x26ae('0x2d')][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x10b6c8),_0x1a400f=_0x195647[_0x26ae('0xd')][_0x26ae('0x9c')](this[_0x26ae('0x55')]);_0x1a400f&&_0x1a400f['length']>0x1?_0x1aac1b['createUserMarkerOperations']():this[_0x26ae('0x2a')](_0x195647,_0x26ae('0x3f')+this[_0x26ae('0x55')],()=>{0x2===_0x195647['channelSessions'][_0x26ae('0x9c')](this[_0x26ae('0x55')])[_0x26ae('0x32')]&&_0x1aac1b['createUserMarkerOperations']();});}async[_0x26ae('0xa')](_0x43da0a,_0x195c48,_0x300b2f,_0x12bd74){if(!this[_0x26ae('0x24')]&&this[_0x26ae('0xa5')][_0x26ae('0xc')]==_0x195c48){const _0x2e2e3c=this[_0x26ae('0x1')](_0x300b2f,_0x12bd74);await this[_0x26ae('0xbf')](_0x2e2e3c),this[_0x26ae('0x99')](_0x2e2e3c,_0x195c48,_0x300b2f[_0x26ae('0xad')])||this['_crash'](_0x26ae('0xe'));}}async[_0x26ae('0x42')](){this[_0x26ae('0x5b')]();const {locale:_0x448eb5}=this[_0x26ae('0x2d')];let _0x561bc7;try{_0x561bc7=await this[_0x26ae('0x10')][_0x26ae('0xb4')]();}catch(_0x3b46bc){const _0xe4ff88=_0x2c78c5(_0x448eb5,'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[_0x26ae('0x57')](_0xe4ff88);}const _0x3c9bf7=_0x561bc7[_0x26ae('0xb2')]||_0x561bc7[_0x26ae('0x43')];if(this[_0x26ae('0x19')]===_0x3c9bf7['lastOperationId'])await this['_connectService'](this[_0x26ae('0x2d')]['model']['document']['history']['getOperations'](),!0x0);else{const _0x4b7335=_0x2c78c5(_0x448eb5,_0x26ae('0x72'));this[_0x26ae('0x57')](_0x4b7335);}}[_0x26ae('0x5b')](){this['_service'][_0x26ae('0x77')](),this[_0x26ae('0xa6')]=[],clearTimeout(this[_0x26ae('0x20')]),this['stopListening'](this['_service']);}[_0x26ae('0x3e')](_0x19d62c){const _0x3779c1=this['editor'][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x466843);this[_0x26ae('0x2a')](_0x3779c1,_0x26ae('0x3f')+this[_0x26ae('0x55')],(_0x26da74,{session:_0x10104c})=>{if(_0x10104c['id']===_0x3779c1[_0x26ae('0xc0')]){_0x26da74[_0x26ae('0x15')]();const _0x27956a=this[_0x26ae('0x2d')][_0x26ae('0x4e')][_0x26ae('0x9e')](_0x26ae('0x17'))&&this['editor'][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x26ae('0x17'));let _0x4f84cf=_0x10104c[_0x26ae('0x5d')];_0x27956a&&_0x27956a[_0x26ae('0x88')]&&(_0x4f84cf=_0x4f84cf[_0x26ae('0x9d')](_0x3d9796=>'document:write'!==_0x3d9796)),this[_0x26ae('0x2d')][_0x26ae('0x4e')][_0x26ae('0x9c')]('Permissions')['setPermissions'](_0x4f84cf,this[_0x26ae('0x55')]);}}),_0x3779c1[_0x26ae('0x34')](this[_0x26ae('0x55')],_0x19d62c);}['_initThrowingOnDataSet'](){const _0x31b0d9=this[_0x26ae('0x2d')]['data'][_0x26ae('0x28')];this[_0x26ae('0x2d')][_0x26ae('0x21')][_0x26ae('0x28')]=(..._0x434af6)=>{if(!_0x434af6[_0x434af6[_0x26ae('0x32')]-0x1][_0x26ae('0x1c')])throw new _0x4d77ef(_0x26ae('0x2f'),this);_0x31b0d9[_0x26ae('0x18')](this[_0x26ae('0x2d')][_0x26ae('0x21')],_0x434af6);};}['_setUpDataInit'](){this[_0x26ae('0x2d')][_0x26ae('0x21')]['on'](_0x26ae('0x8d'),(_0x2bafff,[_0x56c2f4])=>{if(this[_0x26ae('0xa5')][_0x26ae('0xc')])throw new _0x4d77ef(_0x26ae('0xcc'),this);_0x2bafff[_0x26ae('0x6')](),this['_setPendingAction']();const _0x5a36fb=this[_0x26ae('0x2d')][_0x26ae('0x2e')]['get'](_0x26ae('0x33')),_0x503485=this['_getOperationsFromInitData'](_0x56c2f4,_0x5a36fb);_0x2bafff[_0x26ae('0x84')]=this[_0x26ae('0x6e')](_0x503485)[_0x26ae('0x5e')](()=>{this['editor'][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x12b3fb)[_0x26ae('0x1e')](this),this['editor'][_0x26ae('0x21')][_0x26ae('0xb6')](_0x26ae('0xa1'));})[_0x26ae('0x4a')](_0x5db884=>this[_0x26ae('0xc2')](_0x26ae('0xa8'),_0x5db884))[_0x26ae('0x5')](()=>this[_0x26ae('0x4b')]());},{'priority':_0x26ae('0x8b')});}async[_0x26ae('0xbf')](_0xc3baab){const _0x4c0d8d=this[_0x26ae('0x2d')][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x21abf3),{connection:_0x473e1f}=this['editor'][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x12b3fb),_0x24a7e2=new Set();for(const _0x209853 of _0xc3baab){const _0x1a19d8=_0x209853[_0x26ae('0x5f')];_0x1a19d8&&!_0x4c0d8d['getUser'](_0x1a19d8)&&_0x24a7e2[_0x26ae('0x8')](_0x1a19d8);}if(0x0===_0x24a7e2[_0x26ae('0x3d')])return;const _0x355eb4=await _0x2484c6[_0x26ae('0x93')](_0x473e1f,Array[_0x26ae('0xc4')](_0x24a7e2));for(const _0x3632b5 of _0x355eb4)_0x4c0d8d[_0x26ae('0x94')](_0x3632b5['id'])||_0x4c0d8d[_0x26ae('0xb1')](_0x3632b5);}[_0x26ae('0xf')](_0x5f4474,_0x4ccce9={}){const _0x39839b=this[_0x26ae('0x2d')][_0x26ae('0x4f')],_0x21edef=[];let _0x3c766b=0x0;const _0x414da6=_0x26ae('0x6b')==typeof _0x5f4474?{'main':_0x5f4474}:_0x5f4474;for(const _0x2352a5 of Object['keys'](_0x414da6)){if(!this[_0x26ae('0xa5')][_0x26ae('0x7c')][_0x26ae('0x9e')](_0x2352a5))throw new _0x4d77ef(_0x26ae('0xc9'),this);const _0x189d56=this[_0x26ae('0x2d')]['data'][_0x26ae('0x2')](_0x414da6[_0x2352a5]),_0x325049=this[_0x26ae('0xa5')][_0x26ae('0x67')](_0x2352a5),_0x4de86d=new _0x2560e6(_0x39839b['createPositionAt'](_0x325049,0x0),_0x189d56,_0x3c766b++);_0x21edef[_0x26ae('0x8a')](_0x4de86d);for(const [_0x2600e8,_0x40be8b]of _0x189d56[_0x26ae('0x7')]){const _0x5b926a=_0x39839b[_0x26ae('0x53')](_0x39839b[_0x26ae('0x54')](_0x325049,_0x40be8b[_0x26ae('0xbb')]['path']['slice']()),_0x39839b[_0x26ae('0x54')](_0x325049,_0x40be8b[_0x26ae('0xa7')]['path'][_0x26ae('0xb5')]())),_0x44779e=new _0x30850e(_0x2600e8,null,_0x5b926a,_0x39839b[_0x26ae('0x7')],!0x0,_0x3c766b++);_0x21edef[_0x26ae('0x8a')](_0x44779e);}}if(_0x4ccce9)for(const [_0x2280fa,_0x222d7d]of Object['entries'](_0x4ccce9)){const _0x444692=_0x39839b[_0x26ae('0x2b')]['getRoot'](_0x2280fa);if(!_0x444692)throw new _0x4d77ef(_0x26ae('0x1d'),null);for(const [_0x3c202f,_0x5a96ec]of Object[_0x26ae('0xb3')](_0x222d7d))if(null!==_0x5a96ec){const _0x51e7e2=new _0x301496(_0x444692,_0x3c202f,null,_0x5a96ec,_0x3c766b++);_0x21edef[_0x26ae('0x8a')](_0x51e7e2);}}return _0x21edef;}async[_0x26ae('0x63')](_0x57c939,_0x5e88ae){let _0x2c3b55;this[_0x26ae('0x31')]=_0x57c939['offset'];const _0x46d936=_0x57c939[_0x26ae('0x50')]&&!_0x57c939['initData'],_0x3d357b=_0x46d936?0x0:_0x57c939[_0x26ae('0x21')][_0x26ae('0x49')];if(_0x46d936)_0x2c3b55=_0x5e88ae,_0x2c3b55[_0x26ae('0xaa')](_0xe98c3b=>{_0xe98c3b['createdAt']=_0x57c939[_0x26ae('0xc7')],_0xe98c3b[_0x26ae('0x4c')]=!0x0,_0xe98c3b['_authorId']=null;}),this[_0x26ae('0x89')](_0x2c3b55,_0x46d936);else{if(_0x57c939['initData']){const _0x2184e8=this['_getOperationsFromInitData'](_0x57c939[_0x26ae('0x83')]);this[_0x26ae('0xa5')][_0x26ae('0xc1')]['version']=-_0x2184e8[_0x26ae('0x32')],_0x2184e8[_0x26ae('0xaa')](_0x2f43c=>{_0x2f43c['baseVersion']-=_0x2184e8[_0x26ae('0x32')],_0x2f43c[_0x26ae('0x95')]=_0x57c939[_0x26ae('0xc7')],_0x2f43c[_0x26ae('0x4c')]=!0x0,_0x2f43c[_0x26ae('0x5f')]=null;}),this['_applyOperationsSet'](_0x2184e8,!0x0),this[_0x26ae('0x51')][_0x26ae('0xc')]=-_0x2184e8[_0x26ae('0x32')]+this[_0x26ae('0x31')],this[_0x26ae('0x1b')](_0x2184e8);}this[_0x26ae('0xa5')][_0x26ae('0xc1')][_0x26ae('0xc')]=_0x3d357b,_0x2c3b55=this[_0x26ae('0x1')](_0x57c939['data'],_0x57c939[_0x26ae('0x44')]),await this[_0x26ae('0xbf')](_0x2c3b55),this[_0x26ae('0x89')](_0x2c3b55,_0x46d936);}_0x57c939[_0x26ae('0xad')]&&(this[_0x26ae('0x86')]['setIdForTheLastOperation'](_0x2c3b55,_0x57c939['lastOperationId']),this[_0x26ae('0x19')]=_0x57c939[_0x26ae('0xad')]),this[_0x26ae('0x51')][_0x26ae('0xc')]=_0x3d357b+this[_0x26ae('0x31')],this[_0x26ae('0x1b')](_0x2c3b55);}[_0x26ae('0xc2')](_0x58d5b4,_0x29086f){throw this[_0x26ae('0x24')]=!0x0,_0x29086f&&console[_0x26ae('0xa9')](_0x29086f),new _0x4d77ef(_0x58d5b4,this[_0x26ae('0x2d')]);}[_0x26ae('0x65')](_0x36a2fe){this['_knownOperations']['has'](_0x36a2fe)||(this[_0x26ae('0x37')][_0x26ae('0x8')](_0x36a2fe),this[_0x26ae('0xa6')][_0x26ae('0x8a')](_0x36a2fe),this[_0x26ae('0x29')]||_0x26ae('0x62')==_0x36a2fe[_0x26ae('0x3c')]&&!_0x36a2fe['affectsData']||this[_0x26ae('0x76')]());}[_0x26ae('0x60')](_0x5778ce=!0x1){!_0x5778ce&&this[_0x26ae('0x24')]||(this[_0x26ae('0x24')]=!0x0,clearTimeout(this[_0x26ae('0x20')]),this[_0x26ae('0x20')]=setTimeout(()=>{this[_0x26ae('0x7a')]()[_0x26ae('0x5e')](_0x43ae68=>{_0x43ae68&&(this[_0x26ae('0x4b')](),this[_0x26ae('0x24')]=!0x1);})[_0x26ae('0x4a')](_0x44cfd1=>{if(this[_0x26ae('0x4b')](),this[_0x26ae('0x24')]=!0x1,!function(_0x576784){return _0x576784['message'][_0x26ae('0xb')]('cloud-services-internal-error:\x20Not\x20connected.')||_0x576784[_0x26ae('0x41')][_0x26ae('0xb')](_0x26ae('0x9'))||_0x576784[_0x26ae('0x41')][_0x26ae('0xb')](_0x26ae('0x59'));}(_0x44cfd1))throw _0x44cfd1;});},this['_currentBufferDelay']));}async[_0x26ae('0x7a')](){const _0x5de48e=this[_0x26ae('0x2d')][_0x26ae('0x4e')]['get'](_0x10b6c8);if(this['_shouldSendSelectionUpdate']()&&(_0x5de48e[_0x26ae('0x92')](),this['_hasSelectionChanged']=!0x1),!this[_0x26ae('0x9a')]())return!0x0;const _0x58210c=[...this[_0x26ae('0xa6')]];for(const _0x1ee1fe of _0x58210c)_0x1ee1fe['wasUndone']=this[_0x26ae('0xa5')][_0x26ae('0xc1')]['isUndoneOperation'](_0x1ee1fe);const _0x4b8850=this[_0x26ae('0x86')]['getIdOfTheLastOperation'](_0x58210c),_0x1a5b44=j++,_0x2c18c3=this[_0x26ae('0x73')](_0x58210c),_0x5be3b9=await this[_0x26ae('0x10')][_0x26ae('0x40')](_0x2c18c3,_0x2c18c3[_0x26ae('0x49')],_0x4b8850);try{return await this[_0x26ae('0xc5')](_0x58210c,_0x5be3b9,_0x1a5b44);}catch(_0x49cdfc){return this[_0x26ae('0xc2')](_0x26ae('0x23'),_0x49cdfc);}}async[_0x26ae('0xc5')](_0x462bca,_0x407dee,_0x539c3d){if('error'in _0x407dee)throw _0x407dee[_0x26ae('0xa9')];let _0x31d571=!0x1;if(_0x407dee[_0x26ae('0x50')]){_0x407dee[_0x26ae('0xad')]&&(this[_0x26ae('0x19')]=_0x407dee[_0x26ae('0xad')]),this[_0x26ae('0xa6')]=this[_0x26ae('0xa6')]['filter'](_0xce0097=>!_0x462bca[_0x26ae('0x74')](_0xce0097));for(const _0x4d42b6 of _0x462bca)_0x4d42b6[_0x26ae('0x95')]=_0x26ae('0x48')in _0x407dee&&_0x407dee[_0x26ae('0x48')]||void 0x0;this[_0x26ae('0x1b')](_0x462bca),_0x31d571=!0x0,this[_0x26ae('0x7f')]=this[_0x26ae('0x70')];}else{const _0x53b8a2=this[_0x26ae('0x1')](_0x407dee[_0x26ae('0x21')],_0x407dee['metadata'])['filter'](_0x53f16c=>_0x53f16c[_0x26ae('0x49')]>=this[_0x26ae('0x5c')]);await this[_0x26ae('0xbf')](_0x53b8a2),_0x31d571=this['_handleExternalOperations'](_0x53b8a2,_0x407dee[_0x26ae('0xc')],_0x407dee[_0x26ae('0xad')]),this[_0x26ae('0x7f')]=Math[_0x26ae('0xab')](this[_0x26ae('0x7f')]/0x2);}return _0x31d571?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this[_0x26ae('0xc2')](_0x26ae('0x8e'));}[_0x26ae('0x99')](_0x5bde9b,_0x5999c3,_0x60c576){try{const _0x124ca9={'document':this[_0x26ae('0xa5')],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x3f5866,operationsB:_0x2c18b6,originalOperations:_0x4ea3b2}=_0x4d4c02(_0x5bde9b,this[_0x26ae('0xa6')],_0x124ca9);H(_0x3f5866,this['_document']['version']),H(_0x2c18b6,_0x5999c3);for(const _0x4fa330 of _0x3f5866){const _0x57d69f=_0x4ea3b2[_0x26ae('0x9c')](_0x4fa330);_0x4fa330[_0x26ae('0x5f')]=_0x57d69f?_0x57d69f[_0x26ae('0x5f')]:null;}_0x60c576&&(this[_0x26ae('0x86')][_0x26ae('0x38')](_0x5bde9b,_0x60c576),this['_lastSyncedOperationId']=_0x60c576),this[_0x26ae('0xa6')]=[..._0x2c18b6],this[_0x26ae('0x89')](_0x3f5866),this[_0x26ae('0x1b')](_0x5bde9b);}catch(_0x4d1a03){return console[_0x26ae('0xa9')](_0x4d1a03),!0x1;}return!0x0;}['_applyOperationsSet'](_0x3e5e48,_0x41b3a1=!0x1){this[_0x26ae('0x2d')][_0x26ae('0x4f')][_0x26ae('0xa3')]({'isUndoable':!0x1,'isLocal':!0x1},_0x23518b=>{for(const _0x52f408 of _0x3e5e48)this['_knownOperations'][_0x26ae('0x8')](_0x52f408),_0x23518b[_0x26ae('0x1f')][_0x26ae('0x25')](_0x52f408),this[_0x26ae('0x2d')][_0x26ae('0x4f')][_0x26ae('0x3')](_0x52f408);});}['_updateServerHistory'](_0x2c99ad){_0x2c99ad['forEach'](_0x1ff9be=>{const _0x2d1b52=_0x1ff9be[_0x26ae('0x2c')]();_0x2d1b52[_0x26ae('0x5f')]=_0x1ff9be[_0x26ae('0x5f')],_0x2d1b52['_isInit']=!!_0x1ff9be[_0x26ae('0x4c')],_0x2d1b52[_0x26ae('0x95')]=_0x1ff9be[_0x26ae('0x95')],_0x2d1b52[_0x26ae('0x49')]+=this[_0x26ae('0x31')],_0x1ff9be[_0x26ae('0x3b')]&&this[_0x26ae('0xb0')][_0x26ae('0x8')](_0x2d1b52),this['serverHistory'][_0x26ae('0x25')](_0x2d1b52);});}[_0x26ae('0x57')](_0x197b6b){const _0x4fc273=this[_0x26ae('0x2d')]['plugins'][_0x26ae('0x9c')](_0x26ae('0x85')),_0xf9fda6=this['editor'][_0x26ae('0x8f')];_0x197b6b||(_0x197b6b=_0x2c78c5(_0xf9fda6,_0x26ae('0x7b'))),_0x4fc273['showWarning'](_0x197b6b,{'title':_0x2c78c5(_0xf9fda6,_0x26ae('0x26')),'namespace':_0x26ae('0x87')}),this[_0x26ae('0x13')]=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this[_0x26ae('0xa6')]=[],this[_0x26ae('0x2d')][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x12b3fb)[_0x26ae('0x5a')]();}[_0x26ae('0x76')](){this[_0x26ae('0x29')]||(this['_pendingAction']=this[_0x26ae('0x2d')]['plugins']['get'](_0x3e37cc)['add'](_0x2c78c5(this[_0x26ae('0x2d')][_0x26ae('0x8f')],_0x26ae('0x46'))));}[_0x26ae('0x4b')](){this['_pendingAction']&&(this[_0x26ae('0x2d')][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x3e37cc)['remove'](this[_0x26ae('0x29')]),this[_0x26ae('0x29')]=null);}['_compressOperations'](_0x305f9b){const _0x383aeb=_0x305f9b[_0x26ae('0xaf')](_0x5369ad=>_0x5369ad[_0x26ae('0x9b')]());return this[_0x26ae('0x96')]['compress'](_0x383aeb);}['_decompressOperations'](_0x4c4584,_0x453d4f){return this[_0x26ae('0x96')][_0x26ae('0x82')](_0x4c4584)[_0x26ae('0xaf')]((_0x2cd79c,_0x216f28)=>{const _0x203acc=_0x26ae('0x8d')==_0x453d4f[_0x216f28]['type'];if(_0x203acc&&'InsertOperation'==_0x2cd79c[_0x26ae('0x64')]){const _0x31c7d6=_0x2cd79c[_0x26ae('0x45')]['root'];if(!this[_0x26ae('0xa5')][_0x26ae('0x67')](_0x31c7d6)){const _0x57fc94=new _0x4dfaf5(_0x31c7d6,_0x26ae('0x0'),!0x0,this['_document'],null);this[_0x26ae('0xa5')][_0x26ae('0x67')](_0x31c7d6)[_0x26ae('0x30')]=!0x0,this[_0x26ae('0xa5')][_0x26ae('0xb7')][_0x26ae('0x22')](_0x57fc94);}}else{if('RootOperation'==_0x2cd79c[_0x26ae('0x64')]&&_0x2cd79c[_0x26ae('0x81')]){const _0x487444=this[_0x26ae('0xa5')]['getRoot'](_0x2cd79c[_0x26ae('0x6c')]);_0x487444&&_0x487444['isAttached']()&&(_0x487444[_0x26ae('0x30')]=!0x1);}}const _0x50eefd=_0x42b1b0[_0x26ae('0xcb')](_0x2cd79c,this[_0x26ae('0xa5')]);return _0x50eefd[_0x26ae('0xc6')]=_0x2cd79c[_0x26ae('0xc6')],_0x50eefd[_0x26ae('0x4c')]=_0x203acc,_0x50eefd[_0x26ae('0x5f')]=_0x203acc?null:_0x453d4f[_0x216f28][_0x26ae('0xc3')],_0x50eefd['_isDisconnection']=_0x26ae('0x1a')===_0x453d4f[_0x216f28][_0x26ae('0x3c')],_0x50eefd[_0x26ae('0x95')]=_0x453d4f[_0x216f28][_0x26ae('0x95')],_0x50eefd;});}[_0x26ae('0xa4')](){this[_0x26ae('0x47')]=!0x0,this['_shouldSendSelectionUpdate']()?this[_0x26ae('0x60')]():this[_0x26ae('0x47')]=!0x1;}[_0x26ae('0x90')](){const _0x58355f=this[_0x26ae('0x2d')][_0x26ae('0x4e')][_0x26ae('0x9c')](_0x466843)[_0x26ae('0xd')][_0x26ae('0x9c')](this['_channelId']);return Boolean(!this[_0x26ae('0x2d')][_0x26ae('0xa0')]&&_0x58355f&&_0x58355f[_0x26ae('0x32')]>0x1&&this[_0x26ae('0x47')]);}[_0x26ae('0x9a')](){return this[_0x26ae('0xa6')][_0x26ae('0x32')]>0x0||this[_0x26ae('0x90')]();}}l[_0x26ae('0x8c')]=_0x4ac2c5;class F extends Error{}function H(_0x38014b,_0x9c1a39){for(const _0x3fda72 of _0x38014b)_0x3fda72[_0x26ae('0x49')]=_0x9c1a39++;}class q{constructor(_0x444414){this[_0x26ae('0x39')]=_0x444414,this['_operationToId']=new WeakMap();}[_0x26ae('0x52')](_0x56d111){let _0x2691f7=_0x56d111[_0x26ae('0x32')];for(;_0x2691f7--;){const _0x58d1f7=_0x56d111[_0x2691f7];if(!this[_0x26ae('0x39')]['has'](_0x58d1f7)){if(!this[_0x26ae('0x61')][_0x26ae('0x9e')](_0x58d1f7)){const _0x164b2e=_0x1fbea5()[_0x26ae('0xb5')](0x1,0x12);this[_0x26ae('0x61')][_0x26ae('0x28')](_0x58d1f7,_0x164b2e);}return this[_0x26ae('0x61')][_0x26ae('0x9c')](_0x58d1f7);}}}[_0x26ae('0x38')](_0x1c648a,_0x3355ea){if(!_0x3355ea)return;let _0x563a7e=_0x1c648a['length'];for(;_0x563a7e--;){const _0x2b8f02=_0x1c648a[_0x563a7e];this['_ignoredOperations']['has'](_0x2b8f02)||this[_0x26ae('0x61')][_0x26ae('0x28')](_0x2b8f02,_0x3355ea);}}}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * @module real-time-collaboration/realtimecollaborativeediting/sessions
3
+ * @publicApi
4
+ */
5
+ import { ContextPlugin, type ContextPluginDependencies, type Editor, type Context } from 'ckeditor5/src/core';
6
+ import { Collection } from 'ckeditor5/src/utils';
7
+ import { type User } from 'ckeditor5-collaboration/src/collaboration-core';
8
+ import type SessionCollection from '@ckeditor/ckeditor-cloud-services-collaboration/src/sessions/sessioncollection';
9
+ import type { ISocket } from '@ckeditor/ckeditor-cloud-services-collaboration/src/sessions/sessioncollection';
10
+ import type ServerUserModel from '@ckeditor/ckeditor-cloud-services-collaboration/src/users/user';
11
+ type ServerUser = ServerUserModel & User;
12
+ /**
13
+ *
14
+ * The `Sessions` plugin stores the information about the users and sessions connected to the rich text editor.
15
+ *
16
+ * The difference between the sessions plugin and the {@link module:collaboration-core/users~Users `Users` plugin} is that
17
+ * `Users` also keeps information about the users who are not currently connected to the editor (for example, a comment
18
+ * author who is currently offline).
19
+ *
20
+ * If your integration uses {@link module:core/context~Context} and there are multiple channels used, the `Sessions` plugin
21
+ * aggregates users connected to all the channels.
22
+ *
23
+ * There are two types of entries in the sessions plugin: connected users and sessions.
24
+ *
25
+ * There is one session for each connection to a given channel. For example, for each open editor instance connecting
26
+ * to a given channel ID, there will be a session. Every session has a user. However, the same user can be linked
27
+ * with multiple sessions (for example, the same user opened the same URL in multiple tabs).
28
+ *
29
+ * In other words, if the same user (with the same user ID) opens the same document in two different tabs, they will create
30
+ * two sessions but only one user will be connected. You will be able to see two selections in the same document, both in
31
+ * the same color, but only a single user in the {@link module:real-time-collaboration/presencelist~PresenceList user presence list}.
32
+ */
33
+ export default class Sessions extends ContextPlugin {
34
+ /**
35
+ * A map of session collections connected to the separate channels.
36
+ *
37
+ * The keys of the map are channel IDs and the values are collections of sessions.
38
+ *
39
+ * A session is represented by an object with the following properties:
40
+ * * `id` - A unique session ID.
41
+ * * `user` - A reference to the user.
42
+ */
43
+ channelSessions: Map<string, Collection<ISocket>>;
44
+ /**
45
+ * A map of user collections connected to the separate channels.
46
+ *
47
+ * The keys of the map are channel IDs and the values are collections of users.
48
+ */
49
+ channelConnectedUsers: Map<string, Collection<ISocket>>;
50
+ /**
51
+ * A collection of users currently connected to all channels.
52
+ */
53
+ allConnectedUsers: Collection<User>;
54
+ /**
55
+ * @inheritDoc
56
+ */
57
+ static get pluginName(): 'Sessions';
58
+ /**
59
+ * @inheritDoc
60
+ */
61
+ static get requires(): ContextPluginDependencies;
62
+ /**
63
+ * @inheritDoc
64
+ */
65
+ constructor(context: Editor | Context);
66
+ /**
67
+ * @inheritDoc
68
+ */
69
+ init(): void;
70
+ /**
71
+ * Observes given service sessions and updates session and users according to it.
72
+ */
73
+ register(channelId: string, serviceSessions: SessionCollection): void;
74
+ /**
75
+ * Stops observing given service sessions and remove all related sessions and users.
76
+ */
77
+ unregister(channelId: string): void;
78
+ /**
79
+ * Session id of the current client.
80
+ */
81
+ get mySessionId(): string;
82
+ /**
83
+ * Returns a reference to the user connected with a session with the given ID.
84
+ */
85
+ getUserBySessionId(sessionId: string): ServerUser | undefined;
86
+ /**
87
+ * Returns a set of ids of all currently connected sessions for the given user.
88
+ *
89
+ * When one user is connected to the same document in two separate browser tabs
90
+ * then this users belongs to the two sessions.
91
+ *
92
+ * Optionally the result can be limited to the given channelId.
93
+ */
94
+ getUserSessions(user: ServerUser, channelId?: string): Set<string>;
95
+ /**
96
+ * Returns the role of a given user.
97
+ */
98
+ getUserRole(user: ServerUser): string | undefined;
99
+ }
100
+ /**
101
+ * Fired when the new user session is added.
102
+ *
103
+ * @eventName ~Sessions#sessionAdd:channelId
104
+ */
105
+ export type SessionAddEvent = {
106
+ name: 'sessionAdd' | `sessionAdd:${string}`;
107
+ args: [
108
+ {
109
+ channelId: string;
110
+ session: ISocket;
111
+ }
112
+ ];
113
+ };
114
+ export {};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0xe1c5=['unregister','state','_handleSessionRemove','remove','set','stopListening','connection','plugins','forEach','add','_registeredSessions','listenTo','values','delete','pluginName','assign','_uniqueUsersCount','sessionId','sessions-unregister-not-exist','getUserSessions','user','allConnectedUsers','orderNumber','sessions-register-already-registered','sessionAdd:','context','channelSessions','_createUser','size','get','connected','clear','channelConnectedUsers','has','init','mySessionId','_users','_handleSessionAdd'];(function(_0xcad9ac,_0xe1c5a9){const _0x29f4c6=function(_0x52bf71){while(--_0x52bf71){_0xcad9ac['push'](_0xcad9ac['shift']());}};_0x29f4c6(++_0xe1c5a9);}(_0xe1c5,0x99));const _0x29f4=function(_0xcad9ac,_0xe1c5a9){_0xcad9ac=_0xcad9ac-0x0;let _0x29f4c6=_0xe1c5[_0xcad9ac];return _0x29f4c6;};import{ContextPlugin as _0x1035e2}from'ckeditor5/src/core';import{Collection as _0x3087ff,CKEditorError as _0x82d1ec}from'ckeditor5/src/utils';import _0x173586 from'./websocketgateway';import{Users as _0x22e139}from'ckeditor5-collaboration/src/collaboration-core';export default class r extends _0x1035e2{static get[_0x29f4('0xd')](){return'Sessions';}static get['requires'](){return[_0x173586,_0x22e139];}[_0x29f4('0x21')](){const _0x43832d=this[_0x29f4('0x18')],_0x73c967=_0x43832d[_0x29f4('0x6')][_0x29f4('0x1c')](_0x173586);this[_0x29f4('0x19')]=new Map(),this['channelConnectedUsers']=new Map(),this[_0x29f4('0x14')]=new _0x3087ff(),this[_0x29f4('0x9')]=new Map(),this[_0x29f4('0xf')]=0x0,this[_0x29f4('0x23')]=_0x43832d['plugins'][_0x29f4('0x1c')](_0x22e139),this[_0x29f4('0xa')](_0x73c967,'change:state',(_0x3c96fe,_0x59d8f3,_0x3b3b4b)=>{if(_0x29f4('0x1d')!==_0x3b3b4b)this[_0x29f4('0x19')][_0x29f4('0x7')](_0x51afdf=>_0x51afdf[_0x29f4('0x1e')]()),this['channelConnectedUsers'][_0x29f4('0x7')](_0x1ba7b6=>_0x1ba7b6[_0x29f4('0x1e')]()),this[_0x29f4('0x14')][_0x29f4('0x1e')]();else for(const [_0x2d505c,_0x4c759a]of this[_0x29f4('0x9')])for(const _0x4c3c85 of _0x4c759a)this[_0x29f4('0x24')](_0x2d505c,_0x4c3c85);}),this[_0x29f4('0x1a')](_0x73c967[_0x29f4('0x5')]['me'],!0x0);}['register'](_0x4b8f95,_0x481ffd){if(this[_0x29f4('0x9')]['has'](_0x4b8f95))throw new _0x82d1ec(_0x29f4('0x16'),null,{'channelId':_0x4b8f95});this[_0x29f4('0x9')][_0x29f4('0x3')](_0x4b8f95,_0x481ffd),this[_0x29f4('0x19')][_0x29f4('0x3')](_0x4b8f95,new _0x3087ff()),this[_0x29f4('0x1f')][_0x29f4('0x3')](_0x4b8f95,new _0x3087ff()),this[_0x29f4('0xa')](_0x481ffd,'add',(_0x548ef9,_0x26757f)=>this[_0x29f4('0x24')](_0x4b8f95,_0x26757f)),this[_0x29f4('0xa')](_0x481ffd,_0x29f4('0x2'),(_0x3faf40,_0x558a9f)=>this[_0x29f4('0x1')](_0x4b8f95,_0x558a9f));for(const _0x5cf251 of _0x481ffd)this['_handleSessionAdd'](_0x4b8f95,_0x5cf251);}[_0x29f4('0x25')](_0x36bcf5){if(!this['_registeredSessions'][_0x29f4('0x20')](_0x36bcf5))throw new _0x82d1ec(_0x29f4('0x11'),null,{'channelId':_0x36bcf5});const _0x48cf98=this[_0x29f4('0x9')][_0x29f4('0x1c')](_0x36bcf5);this[_0x29f4('0x4')](_0x48cf98);for(const _0x3038e6 of _0x48cf98)_0x29f4('0x1d')===this[_0x29f4('0x18')][_0x29f4('0x6')][_0x29f4('0x1c')](_0x173586)[_0x29f4('0x0')]&&this['_handleSessionRemove'](_0x36bcf5,_0x3038e6);this[_0x29f4('0x9')][_0x29f4('0xc')](_0x36bcf5),this['channelSessions']['delete'](_0x36bcf5),this[_0x29f4('0x1f')][_0x29f4('0xc')](_0x36bcf5);}get[_0x29f4('0x22')](){return this['context'][_0x29f4('0x6')][_0x29f4('0x1c')](_0x173586)[_0x29f4('0x5')][_0x29f4('0x10')];}['getUserBySessionId'](_0x371f2){for(const _0x49fa0a of this[_0x29f4('0x19')][_0x29f4('0xb')]())for(const _0x148152 of _0x49fa0a)if(_0x148152['id']===_0x371f2)return _0x148152[_0x29f4('0x13')];}[_0x29f4('0x12')](_0x4bc780,_0x5658d5){const _0x2896fd=_0x5658d5?[this[_0x29f4('0x19')][_0x29f4('0x1c')](_0x5658d5)]:this[_0x29f4('0x19')][_0x29f4('0xb')](),_0x5e9b92=new Set();for(const _0xaf14cd of _0x2896fd)for(const _0x5ab519 of _0xaf14cd)_0x5ab519[_0x29f4('0x13')]['id']===_0x4bc780['id']&&_0x5e9b92[_0x29f4('0x8')](_0x5ab519['id']);return _0x5e9b92;}['getUserRole'](_0x359108){for(const _0x2b019e of this['channelSessions'][_0x29f4('0xb')]())for(const _0x5b57fa of _0x2b019e)if(_0x5b57fa['user']===_0x359108)return _0x5b57fa['role'];}[_0x29f4('0x24')](_0x7319c,_0x76415b){if(_0x29f4('0x1d')!==this['context']['plugins'][_0x29f4('0x1c')](_0x173586)[_0x29f4('0x0')])return;const _0x3ffa15=_0x76415b['user'],_0x5b26ab=this[_0x29f4('0x23')]['getUser'](_0x3ffa15['id'])||this[_0x29f4('0x1a')](_0x3ffa15),_0x513e51=Object[_0x29f4('0xe')]({},_0x76415b,{'user':_0x5b26ab});this['channelSessions'][_0x29f4('0x1c')](_0x7319c)[_0x29f4('0x8')](_0x513e51);const _0x1dd863=this[_0x29f4('0x1f')]['get'](_0x7319c);_0x1dd863[_0x29f4('0x20')](_0x5b26ab['id'])||_0x1dd863[_0x29f4('0x8')](_0x5b26ab),this[_0x29f4('0x14')][_0x29f4('0x20')](_0x5b26ab['id'])||this[_0x29f4('0x14')][_0x29f4('0x8')](_0x5b26ab),this['fire'](_0x29f4('0x17')+_0x7319c,{'channelId':_0x7319c,'session':_0x513e51});}[_0x29f4('0x1')](_0x56672a,_0xa943fe){if(_0x29f4('0x1d')!==this[_0x29f4('0x18')][_0x29f4('0x6')][_0x29f4('0x1c')](_0x173586)[_0x29f4('0x0')])return;const _0x857cf9=this[_0x29f4('0x1f')][_0x29f4('0x1c')](_0x56672a),_0xa6f5e5=_0xa943fe['user'];this['channelSessions'][_0x29f4('0x1c')](_0x56672a)['remove'](_0xa943fe['id']),_0x857cf9[_0x29f4('0x20')](_0xa6f5e5['id'])&&!this[_0x29f4('0x12')](_0xa6f5e5,_0x56672a)[_0x29f4('0x1b')]&&_0x857cf9[_0x29f4('0x2')](_0xa6f5e5['id']),this['allConnectedUsers'][_0x29f4('0x1c')](_0xa6f5e5['id'])&&!this[_0x29f4('0x12')](_0xa6f5e5)[_0x29f4('0x1b')]&&this['allConnectedUsers'][_0x29f4('0x2')](_0xa6f5e5['id']);}[_0x29f4('0x1a')](_0x34cbde,_0xed99){const _0xa6dcf6=this[_0x29f4('0x23')]['addUser'](_0x34cbde);return _0xed99&&this[_0x29f4('0x23')]['defineMe'](_0x34cbde['id']),_0xa6dcf6[_0x29f4('0x15')]=this[_0x29f4('0xf')]++,_0xa6dcf6;}}
23
+ const _0x55eb=['register','size','change:state','_uniqueUsersCount','_handleSessionRemove','clear','pluginName','getUserSessions','init','has','assign','getUserRole','allConnectedUsers','_createUser','state','set','sessions-register-already-registered','channelConnectedUsers','_users','connected','add','getUserBySessionId','fire','plugins','getUser','_registeredSessions','channelSessions','forEach','_handleSessionAdd','Sessions','delete','unregister','sessionAdd:','stopListening','requires','sessionId','remove','values','context','connection','get','listenTo','orderNumber','user','role'];(function(_0x5864bf,_0x55eb6f){const _0x8bd2c8=function(_0x5e3517){while(--_0x5e3517){_0x5864bf['push'](_0x5864bf['shift']());}};_0x8bd2c8(++_0x55eb6f);}(_0x55eb,0x1d7));const _0x8bd2=function(_0x5864bf,_0x55eb6f){_0x5864bf=_0x5864bf-0x0;let _0x8bd2c8=_0x55eb[_0x5864bf];return _0x8bd2c8;};import{ContextPlugin as _0x2de16f}from'ckeditor5/src/core';import{Collection as _0x3f80f2,CKEditorError as _0x2aaad6}from'ckeditor5/src/utils';import _0x396ed7 from'./websocketgateway';import{Users as _0x3cf6d8}from'ckeditor5-collaboration/src/collaboration-core';export default class r extends _0x2de16f{static get[_0x8bd2('0x1e')](){return _0x8bd2('0x8');}static get[_0x8bd2('0xd')](){return[_0x396ed7,_0x3cf6d8];}constructor(_0x450789){super(_0x450789),this[_0x8bd2('0x5')]=new Map(),this[_0x8bd2('0x29')]=new Map(),this[_0x8bd2('0x24')]=new _0x3f80f2(),this[_0x8bd2('0x4')]=new Map(),this[_0x8bd2('0x1b')]=0x0,this[_0x8bd2('0x2a')]=this[_0x8bd2('0x11')][_0x8bd2('0x2')][_0x8bd2('0x13')](_0x3cf6d8);}[_0x8bd2('0x20')](){const _0x9e1b37=this[_0x8bd2('0x11')][_0x8bd2('0x2')][_0x8bd2('0x13')](_0x396ed7);this['listenTo'](_0x9e1b37,_0x8bd2('0x1a'),(_0x7a8eb1,_0x59eaae,_0x37e3a4)=>{if(_0x8bd2('0x2b')!==_0x37e3a4)this[_0x8bd2('0x5')][_0x8bd2('0x6')](_0x2f1f5f=>_0x2f1f5f[_0x8bd2('0x1d')]()),this[_0x8bd2('0x29')][_0x8bd2('0x6')](_0x55abdf=>_0x55abdf[_0x8bd2('0x1d')]()),this[_0x8bd2('0x24')][_0x8bd2('0x1d')]();else for(const [_0x3ad442,_0x596ee6]of this['_registeredSessions'])for(const _0x564ee8 of _0x596ee6)this['_handleSessionAdd'](_0x3ad442,_0x564ee8);}),this[_0x8bd2('0x25')](_0x9e1b37[_0x8bd2('0x12')]['me'],!0x0);}[_0x8bd2('0x18')](_0x56ff9e,_0x105863){if(this[_0x8bd2('0x4')][_0x8bd2('0x21')](_0x56ff9e))throw new _0x2aaad6(_0x8bd2('0x28'),null,{'channelId':_0x56ff9e});this[_0x8bd2('0x4')][_0x8bd2('0x27')](_0x56ff9e,_0x105863),this[_0x8bd2('0x5')][_0x8bd2('0x27')](_0x56ff9e,new _0x3f80f2()),this[_0x8bd2('0x29')][_0x8bd2('0x27')](_0x56ff9e,new _0x3f80f2()),this[_0x8bd2('0x14')](_0x105863,'add',(_0x3e9864,_0x37c4ee)=>this[_0x8bd2('0x7')](_0x56ff9e,_0x37c4ee)),this[_0x8bd2('0x14')](_0x105863,_0x8bd2('0xf'),(_0x2679bc,_0x2813af)=>this[_0x8bd2('0x1c')](_0x56ff9e,_0x2813af));for(const _0x36b40e of _0x105863)this[_0x8bd2('0x7')](_0x56ff9e,_0x36b40e);}[_0x8bd2('0xa')](_0x5a7f2b){if(!this[_0x8bd2('0x4')][_0x8bd2('0x21')](_0x5a7f2b))throw new _0x2aaad6('sessions-unregister-not-exist',null,{'channelId':_0x5a7f2b});const _0x2fc11e=this[_0x8bd2('0x4')][_0x8bd2('0x13')](_0x5a7f2b);this[_0x8bd2('0xc')](_0x2fc11e);for(const _0x8798a1 of _0x2fc11e)_0x8bd2('0x2b')===this[_0x8bd2('0x11')][_0x8bd2('0x2')]['get'](_0x396ed7)['state']&&this['_handleSessionRemove'](_0x5a7f2b,_0x8798a1);this[_0x8bd2('0x4')][_0x8bd2('0x9')](_0x5a7f2b),this[_0x8bd2('0x5')][_0x8bd2('0x9')](_0x5a7f2b),this[_0x8bd2('0x29')]['delete'](_0x5a7f2b);}get['mySessionId'](){return this[_0x8bd2('0x11')][_0x8bd2('0x2')][_0x8bd2('0x13')](_0x396ed7)[_0x8bd2('0x12')][_0x8bd2('0xe')];}[_0x8bd2('0x0')](_0x178eca){for(const _0x54de88 of this[_0x8bd2('0x5')]['values']())for(const _0x30f5b9 of _0x54de88)if(_0x30f5b9['id']===_0x178eca)return _0x30f5b9[_0x8bd2('0x16')];}[_0x8bd2('0x1f')](_0x162dbb,_0x1c505d){const _0x269d37=_0x1c505d?[this[_0x8bd2('0x5')]['get'](_0x1c505d)]:this['channelSessions'][_0x8bd2('0x10')](),_0x1efe5f=new Set();for(const _0x583f97 of _0x269d37)for(const _0x1ca3ea of _0x583f97)_0x1ca3ea[_0x8bd2('0x16')]['id']===_0x162dbb['id']&&_0x1efe5f[_0x8bd2('0x2c')](_0x1ca3ea['id']);return _0x1efe5f;}[_0x8bd2('0x23')](_0x52de34){for(const _0x494394 of this[_0x8bd2('0x5')][_0x8bd2('0x10')]())for(const _0x1a9a99 of _0x494394)if(_0x1a9a99[_0x8bd2('0x16')]===_0x52de34)return _0x1a9a99[_0x8bd2('0x17')];}['_handleSessionAdd'](_0x3a609a,_0x41b78e){if(_0x8bd2('0x2b')!==this[_0x8bd2('0x11')]['plugins'][_0x8bd2('0x13')](_0x396ed7)[_0x8bd2('0x26')])return;const _0x1a366f=_0x41b78e[_0x8bd2('0x16')],_0x39811e=this[_0x8bd2('0x2a')][_0x8bd2('0x3')](_0x1a366f['id'])||this[_0x8bd2('0x25')](_0x1a366f),_0x1b0582=Object[_0x8bd2('0x22')]({},_0x41b78e,{'user':_0x39811e});this['channelSessions'][_0x8bd2('0x13')](_0x3a609a)[_0x8bd2('0x2c')](_0x1b0582);const _0x5531a8=this['channelConnectedUsers'][_0x8bd2('0x13')](_0x3a609a);_0x5531a8[_0x8bd2('0x21')](_0x39811e['id'])||_0x5531a8['add'](_0x39811e),this['allConnectedUsers'][_0x8bd2('0x21')](_0x39811e['id'])||this['allConnectedUsers'][_0x8bd2('0x2c')](_0x39811e),this[_0x8bd2('0x1')](_0x8bd2('0xb')+_0x3a609a,{'channelId':_0x3a609a,'session':_0x1b0582});}[_0x8bd2('0x1c')](_0x4b0118,_0x1f6326){if(_0x8bd2('0x2b')!==this[_0x8bd2('0x11')][_0x8bd2('0x2')][_0x8bd2('0x13')](_0x396ed7)[_0x8bd2('0x26')])return;const _0x5846d1=this[_0x8bd2('0x29')][_0x8bd2('0x13')](_0x4b0118),_0x10ecc3=_0x1f6326[_0x8bd2('0x16')];_0x10ecc3['id']&&(this['channelSessions'][_0x8bd2('0x13')](_0x4b0118)[_0x8bd2('0xf')](_0x1f6326['id']),_0x5846d1[_0x8bd2('0x21')](_0x10ecc3['id'])&&!this[_0x8bd2('0x1f')](_0x10ecc3,_0x4b0118)[_0x8bd2('0x19')]&&_0x5846d1['remove'](_0x10ecc3['id']),this[_0x8bd2('0x24')]['get'](_0x10ecc3['id'])&&!this[_0x8bd2('0x1f')](_0x10ecc3)[_0x8bd2('0x19')]&&this['allConnectedUsers'][_0x8bd2('0xf')](_0x10ecc3['id']));}[_0x8bd2('0x25')](_0x2d5cca,_0x14c7de){const _0x4457eb=this[_0x8bd2('0x2a')]['addUser'](_0x2d5cca);return _0x14c7de&&this['_users']['defineMe'](_0x2d5cca['id']),_0x4457eb[_0x8bd2('0x15')]=this['_uniqueUsersCount']++,_0x4457eb;}}