@ckeditor/ckeditor5-real-time-collaboration 38.2.0-alpha.0 → 39.0.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 (49) hide show
  1. package/README.md +0 -1
  2. package/build/real-time-collaboration.js +1 -1
  3. package/package.json +7 -8
  4. package/src/augmentation.d.ts +4 -0
  5. package/src/augmentation.js +1 -1
  6. package/src/common-translations.d.ts +4 -0
  7. package/src/common-translations.js +2 -2
  8. package/src/config.d.ts +4 -0
  9. package/src/config.js +1 -1
  10. package/src/index.d.ts +4 -0
  11. package/src/index.js +1 -1
  12. package/src/presencelist/presencelistui.d.ts +4 -0
  13. package/src/presencelist/presencelistui.js +2 -2
  14. package/src/presencelist/view/presencecounterview.d.ts +4 -0
  15. package/src/presencelist/view/presencecounterview.js +2 -2
  16. package/src/presencelist/view/presencedropdownlistitemview.d.ts +4 -0
  17. package/src/presencelist/view/presencedropdownlistitemview.js +2 -2
  18. package/src/presencelist/view/presencedropdownlistview.d.ts +4 -0
  19. package/src/presencelist/view/presencedropdownlistview.js +2 -2
  20. package/src/presencelist/view/presenceinlinelistitemview.d.ts +4 -0
  21. package/src/presencelist/view/presenceinlinelistitemview.js +2 -2
  22. package/src/presencelist/view/presenceinlinelistview.d.ts +4 -0
  23. package/src/presencelist/view/presenceinlinelistview.js +2 -2
  24. package/src/presencelist/view/presencelistview.d.ts +4 -0
  25. package/src/presencelist/view/presencelistview.js +2 -2
  26. package/src/presencelist.d.ts +4 -0
  27. package/src/presencelist.js +2 -2
  28. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +4 -0
  29. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
  30. package/src/realtimecollaborativecomments.d.ts +4 -0
  31. package/src/realtimecollaborativecomments.js +2 -2
  32. package/src/realtimecollaborativeediting/realtimecollaborationclient.d.ts +14 -0
  33. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
  34. package/src/realtimecollaborativeediting/sessions.d.ts +4 -0
  35. package/src/realtimecollaborativeediting/sessions.js +2 -2
  36. package/src/realtimecollaborativeediting/usermarkers.d.ts +4 -0
  37. package/src/realtimecollaborativeediting/usermarkers.js +2 -2
  38. package/src/realtimecollaborativeediting/websocketgateway.d.ts +4 -0
  39. package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
  40. package/src/realtimecollaborativeediting.d.ts +4 -0
  41. package/src/realtimecollaborativeediting.js +2 -2
  42. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +4 -0
  43. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
  44. package/src/realtimecollaborativerevisionhistory.d.ts +4 -0
  45. package/src/realtimecollaborativerevisionhistory.js +2 -2
  46. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +4 -0
  47. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
  48. package/src/realtimecollaborativetrackchanges.d.ts +4 -0
  49. package/src/realtimecollaborativetrackchanges.js +2 -2
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4d99=['getMany','register','enqueueChange','addRoot','getRoot','_decompressOperations','reset','_saveOperationInBuffer','rootName','config','baseVersion','_refreshUserSelectionMarkers','getIdOfTheLastOperation','selection','_authorId','path','lastSyncVersion','getDocumentDetails','model','_connectService','_handleSendingSelectionMarkers','position','connected','Notification','_sendBufferedOperations','slice','_hasSynchronizationProblem','editing','_knownOperations','_isInit','_pendingAction','_isAttached','batch','addUser','permissions','rootsAttributes','_disconnectService','_crash','_operationIdentifier','real-time-collaboration','cloudDocumentVersion','addToReconnectionStack','document','_currentBufferDelay','code','start','finally','root','stopListening','operationsReceived','realtimecollaborationclient-init-document-already-initialized','_handleReconnectionError','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','setPermissions','data','map','realtimecollaborationclient-handleserverresponse','editor','disableReadOnlyMode','affectsData','entries','catch','isAttached','_ignoredOperations','_compressOperations','Synchronization\x20issue','bufferOperation','from','differ','_document','applyOperation','_shouldSendUpdate','_operationToId','keys','showWarning','currentDocumentSession','then','getUser','getOperations','_connectAfterSessionHasBeenFlushed','size','stop','round','lastOperationId','fromJSON','off','_offset','plugins','userId','_baseBufferDelay','sessionAdd:','_handleServerResponse','change:range','state','_lastSyncedOperationId','sessionId','_sendBufferedOperationsDelayed','sendOperations','markers','unregister','_isConnected','roots','marker','document:write','_fetchMissingUsers','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','high','_setUpDataInit','version','forEach','cs:removeUser','_applyOperationsSet','_initSessionsHandling','cloud-services-internal-error:\x20Not\x20connected.','reconnect','push','createdAt','sessionCreatedAt','locale','InsertOperation','realtimecollaborationclient-sendbufferedoperations','collaboration.channelId','multi-root-editor-root-attributes-no-root','lastOperationAcceptedAt','decompress','wereChangesApplied','collaboration','CommentsOnly','listenTo','getReversed','realtimecollaborationclient-initservice-internal-error','isUndoneOperation','wasUndone','bind','mySessionId','detachRoot','change:_isEditingAllowed','has','_compressor','includes','_sendBufferedOperationsDelayId','_isDisconnection','createUserMarkerOperations','fire','return','createPositionFromPath','getConnectedSessions','_disconnectionOperations','suppressErrorInCollaboration','get','length','remove','filter','_updateServerHistory','destroy','realtimecollaborationclient-init-connection-failed','_handleExternalOperations','_lastServerVersion','serverHistory','history','_clearPendingAction','_isPendingUpdate','_initThrowingOnDataSet','createPositionAt','realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration','addOperation','PENDING_ACTION_SENDING_DATA','realtimecollaborationclient-init-non-existent-root','disconnected','isEnabled','clone','_setPendingAction','startsWith','_shouldSendSelectionUpdate','initData','getOperationAuthor','error','_isEditingAllowed','offset','string','isDocumentOperation','_handleReconnectionResponse','ready','set','_service','collaboration-missing-channelid','channelSessions','setIdForTheLastOperation','init','_handleInitialConnectionData','change:hasDomSelection','metadata','CollaborativeEditingService','type','_getOperationsFromInitData','__className','rtc-offline','add','_bufferedOperations','_hasSelectionChanged','realtimecollaborationclient-initservice-incorrect-server-operation','enableReadOnlyMode','end','message','_handleReceivedOperations','$root','_channelId','409'];(function(_0x20ec1d,_0x4d9972){const _0x1ff87c=function(_0x8a1237){while(--_0x8a1237){_0x20ec1d['push'](_0x20ec1d['shift']());}};_0x1ff87c(++_0x4d9972);}(_0x4d99,0xee));const _0x1ff8=function(_0x20ec1d,_0x4d9972){_0x20ec1d=_0x20ec1d-0x0;let _0x1ff87c=_0x4d99[_0x20ec1d];return _0x1ff87c;};import{Plugin as _0x3b6862,PendingActions as _0x324ee1}from'ckeditor5/src/core';import{CKEditorError as _0x5dd375,version as _0xc46171,uid as _0x11c03c}from'ckeditor5/src/utils';import{Notification as _0x58a3a9}from'ckeditor5/src/ui';import{transformSets as _0x102a41,InsertOperation as _0x3a02d9,MarkerOperation as _0xe47163,RootAttributeOperation as _0x1f3dfe,RootOperation as _0x4dba35,OperationFactory as _0xf26184,History as _0xa6fbf6}from'ckeditor5/src/engine';import _0x5b34bb from'./websocketgateway';import _0x48d74d from'./sessions';import _0x237cb1 from'./usermarkers';import{getTranslation as _0x48ee11}from'../common-translations';import _0x32fd40 from'@ckeditor/ckeditor5-operations-compressor/src/compressor';import{Users as _0x26951f}from'ckeditor5-collaboration/src/collaboration-core';import{User as _0x11b57d}from'@ckeditor/ckeditor-cloud-services-collaboration';import{CollaborativeEditingService as _0x18ad1b}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services';let $=0x1;export default class l extends _0x3b6862{static get['requires'](){return[_0x5b34bb,_0x48d74d,_0x237cb1,_0x324ee1,_0x26951f,_0x58a3a9];}static get['pluginName'](){return'RealTimeCollaborationClient';}get[_0x1ff8('0xa')](){return this['_lastServerVersion']+this[_0x1ff8('0x38')];}get[_0x1ff8('0x7f')](){return this[_0x1ff8('0x80')]['version']-this[_0x1ff8('0x38')];}get['lastSyncVersion'](){const _0x189b0a=this[_0x1ff8('0x80')][_0x1ff8('0x30')]();for(let _0x2e943c=_0x189b0a[_0x1ff8('0x78')]-0x1;_0x2e943c>=0x0;_0x2e943c--){const _0x5b0be5=_0x189b0a[_0x2e943c];if(!this[_0x1ff8('0x75')][_0x1ff8('0x6b')](_0x5b0be5))return _0x5b0be5[_0x1ff8('0xbc')]+0x1-this[_0x1ff8('0x38')];}return 0x0;}constructor(_0x391263){if(super(_0x391263),this[_0x1ff8('0x38')]=0x0,this[_0x1ff8('0x41')]=null,this['serverHistory']=new _0xa6fbf6(),this[_0x1ff8('0x1b')]['config']['define'](_0x1ff8('0x60'),{}),this[_0x1ff8('0xb0')]=this[_0x1ff8('0x1b')][_0x1ff8('0xbb')][_0x1ff8('0x77')](_0x1ff8('0x5b')),!this['_channelId'])throw new _0x5dd375(_0x1ff8('0x9b'),this);const _0x1c2ba5=_0x391263[_0x1ff8('0xbb')][_0x1ff8('0x77')]('cloudServices.bundleVersion')||_0xc46171;this[_0x1ff8('0x9a')]=new l[(_0x1ff8('0xa2'))](_0x1c2ba5,this['_channelId']),this['_document']=this[_0x1ff8('0x1b')][_0x1ff8('0xc4')][_0x1ff8('0xc')],this[_0x1ff8('0x6c')]=new _0x32fd40(),this[_0x1ff8('0xa8')]=[],this['_knownOperations']=new WeakSet(),this['set'](_0x1ff8('0x83'),!0x1),this[_0x1ff8('0x99')](_0x1ff8('0xcc'),!0x1),this[_0x1ff8('0x0')]=null,this['_hasSelectionChanged']=!0x1,this[_0x1ff8('0x6e')]=null,this[_0x1ff8('0x3b')]=0x12c,this[_0x1ff8('0xd')]=this['_baseBufferDelay'],this[_0x1ff8('0x40')]=null,this['_disconnectionOperations']=new WeakSet(),this[_0x1ff8('0x8')]=new Q(this[_0x1ff8('0x75')]);}[_0x1ff8('0x9e')](){const _0x2da172=this[_0x1ff8('0x1b')],_0x5f158b=_0x2da172[_0x1ff8('0x39')]['get'](_0x26951f),_0x5a31e8=_0x2da172[_0x1ff8('0x39')][_0x1ff8('0x77')](_0x5b34bb);this['listenTo'](_0x5f158b,_0x1ff8('0x91'),(_0x55abc0,_0x42d162)=>{const _0x5401d3=_0x42d162[0x0];_0x5401d3[_0x1ff8('0xc0')]&&(_0x55abc0[_0x1ff8('0x72')]=_0x5f158b['getUser'](_0x5401d3[_0x1ff8('0xc0')]),_0x55abc0['stop']()),null===_0x5401d3[_0x1ff8('0xc0')]&&(_0x55abc0[_0x1ff8('0x72')]=null,_0x55abc0[_0x1ff8('0x33')]());},{'priority':_0x1ff8('0x4c')}),this[_0x1ff8('0x62')](_0x2da172['model']['document'][_0x1ff8('0xbf')],_0x1ff8('0x3e'),(_0x27434e,_0x5a067d)=>{_0x5a067d['directChange']&&this[_0x1ff8('0xbd')]();}),this[_0x1ff8('0x62')](_0x2da172[_0x1ff8('0xcd')]['view'],_0x1ff8('0xa0'),()=>{this[_0x1ff8('0xbd')]();}),this[_0x1ff8('0x84')](),_0x2da172['model']['on'](_0x1ff8('0x28'),(_0x1409d3,_0x975858)=>{const _0x549247=_0x975858[0x0];_0x549247[_0x1ff8('0x96')]&&(this[_0x1ff8('0xb9')](_0x549247),this[_0x1ff8('0x29')]()&&this[_0x1ff8('0x42')]());}),this[_0x1ff8('0x4d')](),this[_0x1ff8('0x67')](_0x1ff8('0x93'))['to'](_0x5a31e8,_0x1ff8('0x3f'),this,_0x1ff8('0xcc'),(_0x4b4a9d,_0x1e80cb)=>_0x1ff8('0xc8')===_0x4b4a9d&&!_0x1e80cb),this['on'](_0x1ff8('0x6a'),()=>{this[_0x1ff8('0x93')]?_0x2da172[_0x1ff8('0x1c')]('rtc-offline'):_0x2da172[_0x1ff8('0xab')](_0x1ff8('0xa6'));}),this['_isEditingAllowed']?_0x2da172['disableReadOnlyMode'](_0x1ff8('0xa6')):_0x2da172[_0x1ff8('0xab')](_0x1ff8('0xa6')),this[_0x1ff8('0x99')](_0x1ff8('0x46'),!0x1);}async['reconnect'](){const _0x5404dd=this[_0x1ff8('0x1b')][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x48d74d),_0x2723be=this['editor'][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x5b34bb);try{this[_0x1ff8('0x83')]=!0x0,_0x5404dd[_0x1ff8('0x45')](this['_channelId']);const _0x141b21=await this[_0x1ff8('0x9a')][_0x1ff8('0x54')](_0x2723be['connection'],this[_0x1ff8('0xc2')]);await this[_0x1ff8('0x97')](_0x141b21)&&(this[_0x1ff8('0x83')]=!0x1,this['_clearPendingAction']());const _0x1296f0=await this[_0x1ff8('0x9a')][_0x1ff8('0x74')]();_0x5404dd[_0x1ff8('0xb3')](this[_0x1ff8('0xb0')],_0x1296f0),this[_0x1ff8('0xc6')](),this['_isConnected']=!0x0;}catch(_0x233fac){if(function(_0x34320b){return'404'===_0x34320b[_0x1ff8('0xe')];}(_0x233fac)&&this[_0x1ff8('0x41')])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x4d37dc){return _0x1ff8('0xb1')===_0x4d37dc[_0x1ff8('0xe')];}(_0x233fac)){const _0x254757=_0x48ee11(this['editor'][_0x1ff8('0x58')],_0x1ff8('0x4b'));this[_0x1ff8('0x15')](_0x254757);}else{if(!(_0x233fac instanceof J))throw _0x233fac;this['_handleReconnectionError']();}}}}[_0x1ff8('0x7c')](){const _0x1481cf=this[_0x1ff8('0x1b')][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x5b34bb),_0x1fdf22=this[_0x1ff8('0x1b')][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x48d74d);this[_0x1ff8('0x1b')][_0x1ff8('0xab')]('rtc-destroyed'),_0x1fdf22[_0x1ff8('0x9c')][_0x1ff8('0x6b')](this[_0x1ff8('0xb0')])&&_0x1fdf22[_0x1ff8('0x45')](this[_0x1ff8('0xb0')]),_0x1481cf['removeFromReconnectionStack'](this),this[_0x1ff8('0x6')](),super[_0x1ff8('0x7c')]();}async['_handleReconnectionResponse'](_0x37db2c){if(this['sessionId']!==_0x37db2c[_0x1ff8('0x41')]&&this[_0x1ff8('0x40')]!==_0x37db2c[_0x1ff8('0x35')])throw new J();return this['sessionId']=_0x37db2c['sessionId'],this['_handleServerResponse']([],{..._0x37db2c,'wereChangesApplied':!0x1,'data':_0x37db2c[_0x1ff8('0x18')]},'reconnect');}async[_0x1ff8('0xc5')](_0x2cf651,_0x15a593=!0x1){const {connection:_0x3529ca}=this[_0x1ff8('0x1b')][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x5b34bb);l[_0x1ff8('0xa2')][_0x1ff8('0x74')](_0x3529ca,this[_0x1ff8('0xb0')])[_0x1ff8('0x2e')](_0x568220=>this[_0x1ff8('0x52')](_0x568220))[_0x1ff8('0x1f')](_0x1c4c27=>{this[_0x1ff8('0x7')]('realtimecollaborationclient-init-session-connection-error',_0x1c4c27);}),this['listenTo'](this['_service'],_0x1ff8('0x13'),this[_0x1ff8('0xae')][_0x1ff8('0x67')](this)),this[_0x1ff8('0x62')](this[_0x1ff8('0x9a')],_0x1ff8('0x92'),(_0x1669c0,_0x48bee0)=>{this['_crash'](_0x1ff8('0x64'),_0x48bee0);}),this[_0x1ff8('0x62')](this[_0x1ff8('0x9a')],_0x1ff8('0x8a'),()=>{this[_0x1ff8('0x46')]=!0x1;});const _0x21a58a=this[_0x1ff8('0x8')][_0x1ff8('0xbe')](_0x2cf651),_0x13b56d=await this[_0x1ff8('0x9a')]['connect'](_0x3529ca,this[_0x1ff8('0x22')](_0x2cf651),_0x21a58a);if(this[_0x1ff8('0x41')]=_0x13b56d[_0x1ff8('0x41')],_0x13b56d[_0x1ff8('0x5f')]&&(this['_isPendingUpdate']=!0x1,this[_0x1ff8('0x82')]()),_0x15a593){if(!_0x13b56d[_0x1ff8('0x5f')])return void this['_handleReconnectionError']();this[_0x1ff8('0x80')][_0x1ff8('0xb8')](),this['_offset']=_0x13b56d['offset'],this[_0x1ff8('0x80')][_0x1ff8('0x4e')]=this[_0x1ff8('0x38')],await this[_0x1ff8('0x3d')](_0x2cf651,_0x13b56d,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x13b56d,_0x2cf651);this[_0x1ff8('0xc6')](),this['_isConnected']=!0x0;}[_0x1ff8('0xc6')](){const _0x346cb4=this[_0x1ff8('0x1b')][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x48d74d),_0x1da4b8=this[_0x1ff8('0x1b')][_0x1ff8('0x39')]['get'](_0x237cb1),_0x285b46=_0x346cb4[_0x1ff8('0x9c')][_0x1ff8('0x77')](this[_0x1ff8('0xb0')]);_0x285b46&&_0x285b46['length']>0x1?_0x1da4b8[_0x1ff8('0x70')]():this[_0x1ff8('0x62')](_0x346cb4,_0x1ff8('0x3c')+this[_0x1ff8('0xb0')],()=>{0x2===_0x346cb4[_0x1ff8('0x9c')]['get'](this['_channelId'])[_0x1ff8('0x78')]&&_0x1da4b8[_0x1ff8('0x70')]();});}async['_handleReceivedOperations'](_0x52416e,_0x4cfa34,_0x4a6308,_0x124852){if(!this[_0x1ff8('0x83')]&&this[_0x1ff8('0x27')][_0x1ff8('0x4e')]==_0x4cfa34){const _0x4acfbf=this[_0x1ff8('0xb7')](_0x4a6308,_0x124852);await this[_0x1ff8('0x4a')](_0x4acfbf),this[_0x1ff8('0x7e')](_0x4acfbf,_0x4cfa34,_0x4a6308[_0x1ff8('0x35')])||this['_crash'](_0x1ff8('0xaa'));}}async[_0x1ff8('0x31')](){this['_disconnectService']();const {locale:_0x5e3514}=this['editor'];let _0x35fc16;try{_0x35fc16=await this[_0x1ff8('0x9a')][_0x1ff8('0xc3')]();}catch(_0x1c8932){const _0x55ee9d=_0x48ee11(_0x5e3514,_0x1ff8('0x16'));return void this[_0x1ff8('0x15')](_0x55ee9d);}const _0x133e8f=_0x35fc16[_0x1ff8('0x2d')]||_0x35fc16['lastDocumentSession'];if(this[_0x1ff8('0x40')]===_0x133e8f[_0x1ff8('0x35')])await this[_0x1ff8('0xc5')](this[_0x1ff8('0x1b')]['model'][_0x1ff8('0xc')][_0x1ff8('0x81')][_0x1ff8('0x30')](),!0x0);else{const _0x715410=_0x48ee11(_0x5e3514,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this[_0x1ff8('0x15')](_0x715410);}}[_0x1ff8('0x6')](){this[_0x1ff8('0x9a')]['disconnect'](),this[_0x1ff8('0xa8')]=[],clearTimeout(this[_0x1ff8('0x6e')]),this[_0x1ff8('0x12')](this[_0x1ff8('0x9a')]);}[_0x1ff8('0x52')](_0x3b72f5){const _0x50fc26=this[_0x1ff8('0x1b')]['plugins']['get'](_0x48d74d);this[_0x1ff8('0x62')](_0x50fc26,'sessionAdd:'+this[_0x1ff8('0xb0')],(_0x4b46f6,{session:_0x2d523a})=>{if(_0x2d523a['id']===_0x50fc26[_0x1ff8('0x68')]){_0x4b46f6[_0x1ff8('0x37')]();const _0x226f9e=this['editor'][_0x1ff8('0x39')][_0x1ff8('0x6b')]('CommentsOnly')&&this['editor'][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x1ff8('0x61'));let _0x983c26=_0x2d523a[_0x1ff8('0x4')];_0x226f9e&&_0x226f9e[_0x1ff8('0x8b')]&&(_0x983c26=_0x983c26[_0x1ff8('0x7a')](_0x2148d9=>_0x1ff8('0x49')!==_0x2148d9)),this[_0x1ff8('0x1b')][_0x1ff8('0x39')]['get']('Permissions')[_0x1ff8('0x17')](_0x983c26,this[_0x1ff8('0xb0')]);}}),_0x50fc26[_0x1ff8('0xb3')](this[_0x1ff8('0xb0')],_0x3b72f5);}[_0x1ff8('0x84')](){const _0x831a72=this['editor'][_0x1ff8('0x18')][_0x1ff8('0x99')];this['editor'][_0x1ff8('0x18')][_0x1ff8('0x99')]=(..._0x151f11)=>{if(!_0x151f11[_0x151f11['length']-0x1][_0x1ff8('0x76')])throw new _0x5dd375(_0x1ff8('0x86'),this);_0x831a72['apply'](this[_0x1ff8('0x1b')][_0x1ff8('0x18')],_0x151f11);};}[_0x1ff8('0x4d')](){this[_0x1ff8('0x1b')][_0x1ff8('0x18')]['on']('init',(_0x2a6f9d,[_0xff8d7e])=>{if(this[_0x1ff8('0x27')][_0x1ff8('0x4e')])throw new _0x5dd375(_0x1ff8('0x14'),this);_0x2a6f9d[_0x1ff8('0x33')](),this[_0x1ff8('0x8d')]();const _0xdd053a=this[_0x1ff8('0x1b')][_0x1ff8('0xbb')][_0x1ff8('0x77')](_0x1ff8('0x5')),_0x108e51=this['_getOperationsFromInitData'](_0xff8d7e,_0xdd053a);_0x2a6f9d[_0x1ff8('0x72')]=this['_connectService'](_0x108e51)[_0x1ff8('0x2e')](()=>{this[_0x1ff8('0x1b')][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x5b34bb)[_0x1ff8('0xb')](this),this['editor'][_0x1ff8('0x18')][_0x1ff8('0x71')](_0x1ff8('0x98'));})[_0x1ff8('0x1f')](_0x3efeb1=>this['_crash'](_0x1ff8('0x7d'),_0x3efeb1))[_0x1ff8('0x10')](()=>this['_clearPendingAction']());},{'priority':_0x1ff8('0x4c')});}async[_0x1ff8('0x4a')](_0x5b26dd){const _0x15f625=this['editor']['plugins']['get'](_0x26951f),{connection:_0x51cdf0}=this[_0x1ff8('0x1b')][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x5b34bb),_0x3654cc=new Set();for(const _0x4574b4 of _0x5b26dd){const _0xcf99b9=_0x4574b4[_0x1ff8('0xc0')];_0xcf99b9&&!_0x15f625[_0x1ff8('0x2f')](_0xcf99b9)&&_0x3654cc[_0x1ff8('0xa7')](_0xcf99b9);}if(0x0===_0x3654cc[_0x1ff8('0x32')])return;const _0x31b4cb=await _0x11b57d[_0x1ff8('0xb2')](_0x51cdf0,Array[_0x1ff8('0x25')](_0x3654cc));for(const _0x14211a of _0x31b4cb)_0x15f625['getUser'](_0x14211a['id'])||_0x15f625[_0x1ff8('0x3')](_0x14211a);}[_0x1ff8('0xa4')](_0x314470,_0x281805={}){const _0x1da7d0=this[_0x1ff8('0x1b')][_0x1ff8('0xc4')],_0x465f78=[];let _0x42c989=0x0;const _0x1c6007=_0x1ff8('0x95')==typeof _0x314470?{'main':_0x314470}:_0x314470;for(const _0x1ddf15 of Object[_0x1ff8('0x2b')](_0x1c6007)){if(!this[_0x1ff8('0x27')][_0x1ff8('0x47')][_0x1ff8('0x6b')](_0x1ddf15))throw new _0x5dd375(_0x1ff8('0x89'),this);const _0x2d08a5=this['editor']['data']['parse'](_0x1c6007[_0x1ddf15]),_0x3ee79b=this[_0x1ff8('0x27')][_0x1ff8('0xb6')](_0x1ddf15),_0x3f1632=new _0x3a02d9(_0x1da7d0[_0x1ff8('0x85')](_0x3ee79b,0x0),_0x2d08a5,_0x42c989++);_0x465f78['push'](_0x3f1632);for(const [_0x29ff03,_0x70b817]of _0x2d08a5['markers']){const _0x1b9977=_0x1da7d0['createRange'](_0x1da7d0[_0x1ff8('0x73')](_0x3ee79b,_0x70b817[_0x1ff8('0xf')][_0x1ff8('0xc1')][_0x1ff8('0xcb')]()),_0x1da7d0[_0x1ff8('0x73')](_0x3ee79b,_0x70b817[_0x1ff8('0xac')]['path'][_0x1ff8('0xcb')]())),_0x5acb31=new _0xe47163(_0x29ff03,null,_0x1b9977,_0x1da7d0[_0x1ff8('0x44')],!0x0,_0x42c989++);_0x465f78[_0x1ff8('0x55')](_0x5acb31);}}if(_0x281805)for(const [_0x5c5524,_0x59a4f3]of Object[_0x1ff8('0x1e')](_0x281805)){const _0xc8ceb7=_0x1da7d0['document'][_0x1ff8('0xb6')](_0x5c5524);if(!_0xc8ceb7)throw new _0x5dd375(_0x1ff8('0x5c'),null);for(const [_0xa7d145,_0x47ff93]of Object['entries'](_0x59a4f3))if(null!==_0x47ff93){const _0x1ca27c=new _0x1f3dfe(_0xc8ceb7,_0xa7d145,null,_0x47ff93,_0x42c989++);_0x465f78['push'](_0x1ca27c);}}return _0x465f78;}async[_0x1ff8('0x9f')](_0x54b27c,_0x4100b1){let _0x4deb33;this[_0x1ff8('0x38')]=_0x54b27c[_0x1ff8('0x94')];const _0x58dcf8=_0x54b27c['wereChangesApplied']&&!_0x54b27c[_0x1ff8('0x90')],_0x5f3150=_0x58dcf8?0x0:_0x54b27c[_0x1ff8('0x18')][_0x1ff8('0xbc')];if(_0x58dcf8)_0x4deb33=_0x4100b1,_0x4deb33[_0x1ff8('0x4f')](_0x2f1f70=>{_0x2f1f70[_0x1ff8('0x56')]=_0x54b27c[_0x1ff8('0x57')],_0x2f1f70[_0x1ff8('0xcf')]=!0x0,_0x2f1f70[_0x1ff8('0xc0')]=null;}),this[_0x1ff8('0x51')](_0x4deb33,_0x58dcf8);else{if(_0x54b27c['initData']){const _0x102dc3=this['_getOperationsFromInitData'](_0x54b27c[_0x1ff8('0x90')]);this[_0x1ff8('0x27')]['history'][_0x1ff8('0x4e')]=-_0x102dc3[_0x1ff8('0x78')],_0x102dc3['forEach'](_0x36b743=>{_0x36b743['baseVersion']-=_0x102dc3[_0x1ff8('0x78')],_0x36b743[_0x1ff8('0x56')]=_0x54b27c[_0x1ff8('0x57')],_0x36b743[_0x1ff8('0xcf')]=!0x0,_0x36b743['_authorId']=null;}),this[_0x1ff8('0x51')](_0x102dc3,!0x0),this[_0x1ff8('0x80')][_0x1ff8('0x4e')]=-_0x102dc3[_0x1ff8('0x78')]+this['_offset'],this['_updateServerHistory'](_0x102dc3);}this[_0x1ff8('0x27')][_0x1ff8('0x81')][_0x1ff8('0x4e')]=_0x5f3150,_0x4deb33=this[_0x1ff8('0xb7')](_0x54b27c['data'],_0x54b27c[_0x1ff8('0xa1')]),await this[_0x1ff8('0x4a')](_0x4deb33),this[_0x1ff8('0x51')](_0x4deb33,_0x58dcf8);}_0x54b27c[_0x1ff8('0x35')]&&(this[_0x1ff8('0x8')][_0x1ff8('0x9d')](_0x4deb33,_0x54b27c['lastOperationId']),this[_0x1ff8('0x40')]=_0x54b27c[_0x1ff8('0x35')]),this[_0x1ff8('0x80')][_0x1ff8('0x4e')]=_0x5f3150+this[_0x1ff8('0x38')],this[_0x1ff8('0x7b')](_0x4deb33);}[_0x1ff8('0x7')](_0x10db76,_0x392142){throw this[_0x1ff8('0x83')]=!0x0,_0x392142&&console[_0x1ff8('0x92')](_0x392142),new _0x5dd375(_0x10db76,this[_0x1ff8('0x1b')]);}[_0x1ff8('0xb9')](_0xd5a038){this[_0x1ff8('0xce')][_0x1ff8('0x6b')](_0xd5a038)||(this[_0x1ff8('0xce')][_0x1ff8('0xa7')](_0xd5a038),this[_0x1ff8('0xa8')][_0x1ff8('0x55')](_0xd5a038),this[_0x1ff8('0x0')]||_0x1ff8('0x48')==_0xd5a038[_0x1ff8('0xa3')]&&!_0xd5a038[_0x1ff8('0x1d')]||this['_setPendingAction']());}[_0x1ff8('0x42')](_0x263437=!0x1){!_0x263437&&this[_0x1ff8('0x83')]||(this[_0x1ff8('0x83')]=!0x0,clearTimeout(this[_0x1ff8('0x6e')]),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this[_0x1ff8('0xca')]()[_0x1ff8('0x2e')](_0x1164c6=>{_0x1164c6&&(this[_0x1ff8('0x82')](),this[_0x1ff8('0x83')]=!0x1);})[_0x1ff8('0x1f')](_0x37bb9b=>{if(this[_0x1ff8('0x82')](),this[_0x1ff8('0x83')]=!0x1,!function(_0x4d81f0){return _0x4d81f0['message']['startsWith'](_0x1ff8('0x53'))||_0x4d81f0[_0x1ff8('0xad')][_0x1ff8('0x8e')]('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x4d81f0[_0x1ff8('0xad')][_0x1ff8('0x8e')]('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x37bb9b))throw _0x37bb9b;});},this[_0x1ff8('0xd')]));}async['_sendBufferedOperations'](){const _0x8371c3=this[_0x1ff8('0x1b')][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x237cb1);if(this[_0x1ff8('0x8f')]()&&(_0x8371c3[_0x1ff8('0x70')](),this[_0x1ff8('0xa9')]=!0x1),!this[_0x1ff8('0x29')]())return!0x0;const _0x232337=[...this[_0x1ff8('0xa8')]];for(const _0x586f59 of _0x232337)_0x586f59[_0x1ff8('0x66')]=this[_0x1ff8('0x27')]['history'][_0x1ff8('0x65')](_0x586f59);const _0x3fec4e=this[_0x1ff8('0x8')][_0x1ff8('0xbe')](_0x232337),_0x3daf12=$++,_0x4b131d=this[_0x1ff8('0x22')](_0x232337),_0x3ae3bd=await this[_0x1ff8('0x9a')][_0x1ff8('0x43')](_0x4b131d,_0x4b131d[_0x1ff8('0xbc')],_0x3fec4e);try{return await this['_handleServerResponse'](_0x232337,_0x3ae3bd,_0x3daf12);}catch(_0xd91a17){return this[_0x1ff8('0x7')](_0x1ff8('0x5a'),_0xd91a17);}}async[_0x1ff8('0x3d')](_0x1a90ba,_0x24e33,_0x1bc28a){if('error'in _0x24e33)throw _0x24e33[_0x1ff8('0x92')];let _0xb58b30=!0x1;if(_0x24e33[_0x1ff8('0x5f')]){_0x24e33[_0x1ff8('0x35')]&&(this[_0x1ff8('0x40')]=_0x24e33[_0x1ff8('0x35')]),this[_0x1ff8('0xa8')]=this[_0x1ff8('0xa8')][_0x1ff8('0x7a')](_0x482756=>!_0x1a90ba[_0x1ff8('0x6d')](_0x482756));for(const _0x279e5e of _0x1a90ba)_0x279e5e['createdAt']=_0x1ff8('0x5d')in _0x24e33&&_0x24e33['lastOperationAcceptedAt']||void 0x0;this[_0x1ff8('0x7b')](_0x1a90ba),_0xb58b30=!0x0,this[_0x1ff8('0xd')]=this[_0x1ff8('0x3b')];}else{const _0x5d7bfa=this[_0x1ff8('0xb7')](_0x24e33[_0x1ff8('0x18')],_0x24e33['metadata'])['filter'](_0x5060dd=>_0x5060dd[_0x1ff8('0xbc')]>=this[_0x1ff8('0x7f')]);await this[_0x1ff8('0x4a')](_0x5d7bfa),_0xb58b30=this['_handleExternalOperations'](_0x5d7bfa,_0x24e33[_0x1ff8('0x4e')],_0x24e33[_0x1ff8('0x35')]),this['_currentBufferDelay']=Math[_0x1ff8('0x34')](this[_0x1ff8('0xd')]/0x2);}return _0xb58b30?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this[_0x1ff8('0x7')](_0x1ff8('0x1a'));}[_0x1ff8('0x7e')](_0x18d2d5,_0x373964,_0x37638d){try{const _0x68ec24={'document':this[_0x1ff8('0x27')],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x599809,operationsB:_0x4ce2e0,originalOperations:_0x514637}=_0x102a41(_0x18d2d5,this['_bufferedOperations'],_0x68ec24);K(_0x599809,this['_document'][_0x1ff8('0x4e')]),K(_0x4ce2e0,_0x373964);for(const _0xf9f62 of _0x599809){const _0x355875=_0x514637['get'](_0xf9f62);_0xf9f62[_0x1ff8('0xc0')]=_0x355875?_0x355875[_0x1ff8('0xc0')]:null;}_0x37638d&&(this[_0x1ff8('0x8')][_0x1ff8('0x9d')](_0x18d2d5,_0x37638d),this[_0x1ff8('0x40')]=_0x37638d),this[_0x1ff8('0xa8')]=[..._0x4ce2e0],this[_0x1ff8('0x51')](_0x599809),this[_0x1ff8('0x7b')](_0x18d2d5);}catch(_0x21b172){return console[_0x1ff8('0x92')](_0x21b172),!0x1;}return!0x0;}[_0x1ff8('0x51')](_0x141bc7,_0x12b2d1=!0x1){this[_0x1ff8('0x1b')]['model'][_0x1ff8('0xb4')]({'isUndoable':!0x1,'isLocal':!0x1},_0x1f2e3c=>{for(const _0x1707a2 of _0x141bc7)this[_0x1ff8('0xce')][_0x1ff8('0xa7')](_0x1707a2),_0x1f2e3c[_0x1ff8('0x2')][_0x1ff8('0x87')](_0x1707a2),this['editor'][_0x1ff8('0xc4')][_0x1ff8('0x28')](_0x1707a2);});}[_0x1ff8('0x7b')](_0x492796){_0x492796['forEach'](_0x1cd1c4=>{const _0x15c7c3=_0x1cd1c4[_0x1ff8('0x8c')]();_0x15c7c3[_0x1ff8('0xc0')]=_0x1cd1c4['_authorId'],_0x15c7c3[_0x1ff8('0xcf')]=!!_0x1cd1c4[_0x1ff8('0xcf')],_0x15c7c3[_0x1ff8('0x56')]=_0x1cd1c4[_0x1ff8('0x56')],_0x15c7c3['baseVersion']+=this[_0x1ff8('0x38')],_0x1cd1c4[_0x1ff8('0x6f')]&&this[_0x1ff8('0x75')][_0x1ff8('0xa7')](_0x15c7c3),this[_0x1ff8('0x80')][_0x1ff8('0x87')](_0x15c7c3);});}[_0x1ff8('0x15')](_0x3a7e6d){const _0x511ca1=this[_0x1ff8('0x1b')]['plugins'][_0x1ff8('0x77')](_0x1ff8('0xc9')),_0x37e0e8=this[_0x1ff8('0x1b')]['locale'];_0x3a7e6d||(_0x3a7e6d=_0x48ee11(_0x37e0e8,'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.')),_0x511ca1[_0x1ff8('0x2c')](_0x3a7e6d,{'title':_0x48ee11(_0x37e0e8,_0x1ff8('0x23')),'namespace':_0x1ff8('0x9')}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this[_0x1ff8('0x6e')]),this[_0x1ff8('0xa8')]=[],this['editor']['plugins'][_0x1ff8('0x77')](_0x5b34bb)[_0x1ff8('0x7c')]();}[_0x1ff8('0x8d')](){this[_0x1ff8('0x0')]||(this[_0x1ff8('0x0')]=this[_0x1ff8('0x1b')][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x324ee1)[_0x1ff8('0xa7')](_0x48ee11(this[_0x1ff8('0x1b')][_0x1ff8('0x58')],_0x1ff8('0x88'))));}[_0x1ff8('0x82')](){this[_0x1ff8('0x0')]&&(this[_0x1ff8('0x1b')][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x324ee1)[_0x1ff8('0x79')](this[_0x1ff8('0x0')]),this[_0x1ff8('0x0')]=null);}['_compressOperations'](_0x2bb31b){const _0x47960d=_0x2bb31b[_0x1ff8('0x19')](_0x363dca=>_0x363dca['toJSON']());return this['_compressor']['compress'](_0x47960d);}[_0x1ff8('0xb7')](_0x1baa97,_0x37c213){const _0x1d94ae=new Set();return this[_0x1ff8('0x6c')][_0x1ff8('0x5e')](_0x1baa97)[_0x1ff8('0x19')]((_0xe34627,_0x3884e5)=>{const _0x4377e5=_0x1ff8('0x9e')==_0x37c213[_0x3884e5][_0x1ff8('0xa3')];if(_0x4377e5&&_0x1ff8('0x59')==_0xe34627[_0x1ff8('0xa5')]){const _0x31d4a1=_0xe34627[_0x1ff8('0xc7')][_0x1ff8('0x11')];if(!this[_0x1ff8('0x27')][_0x1ff8('0xb6')](_0x31d4a1)){const _0x34ddaa=new _0x4dba35(_0x31d4a1,_0x1ff8('0xaf'),!0x0,this[_0x1ff8('0x27')],null);this[_0x1ff8('0x27')]['getRoot'](_0x31d4a1)[_0x1ff8('0x1')]=!0x0,this[_0x1ff8('0x27')][_0x1ff8('0x26')][_0x1ff8('0x24')](_0x34ddaa);}}const _0x2eff26=_0xf26184[_0x1ff8('0x36')](_0xe34627,this[_0x1ff8('0x27')]);if(_0x1ff8('0x69')==_0x2eff26[_0x1ff8('0xa3')])_0x1d94ae['add'](_0xe34627[_0x1ff8('0xba')]);else{if(_0x1ff8('0xb5')==_0x2eff26[_0x1ff8('0xa3')]){const _0x209c02=this[_0x1ff8('0x27')][_0x1ff8('0xb6')](_0xe34627['rootName']);_0x209c02&&_0x209c02[_0x1ff8('0x20')]()&&!_0x1d94ae['has'](_0xe34627[_0x1ff8('0xba')])&&(_0x209c02['_isAttached']=!0x1,this[_0x1ff8('0x27')]['differ'][_0x1ff8('0x24')](_0x2eff26[_0x1ff8('0x63')]()));}}return _0x2eff26['wasUndone']=_0xe34627[_0x1ff8('0x66')],_0x2eff26[_0x1ff8('0xcf')]=_0x4377e5,_0x2eff26[_0x1ff8('0xc0')]=_0x4377e5?null:_0x37c213[_0x3884e5][_0x1ff8('0x3a')],_0x2eff26[_0x1ff8('0x6f')]=_0x1ff8('0x50')===_0x37c213[_0x3884e5][_0x1ff8('0xa3')],_0x2eff26[_0x1ff8('0x56')]=_0x37c213[_0x3884e5]['createdAt'],_0x2eff26;});}[_0x1ff8('0xbd')](){this[_0x1ff8('0xa9')]=!0x0,this['_shouldSendSelectionUpdate']()?this[_0x1ff8('0x42')]():this[_0x1ff8('0xa9')]=!0x1;}[_0x1ff8('0x8f')](){const _0x5f535b=this[_0x1ff8('0x1b')][_0x1ff8('0x39')][_0x1ff8('0x77')](_0x48d74d)[_0x1ff8('0x9c')][_0x1ff8('0x77')](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x5f535b&&_0x5f535b[_0x1ff8('0x78')]>0x1&&this[_0x1ff8('0xa9')];}[_0x1ff8('0x29')](){return this[_0x1ff8('0xa8')][_0x1ff8('0x78')]>0x0||this[_0x1ff8('0x8f')]();}}l[_0x1ff8('0xa2')]=_0x18ad1b;class J extends Error{}function K(_0x3897a2,_0x531b92){for(const _0x42969d of _0x3897a2)_0x42969d[_0x1ff8('0xbc')]=_0x531b92++;}class Q{constructor(_0x417d26){this[_0x1ff8('0x21')]=_0x417d26,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x5bf358){let _0x320f98=_0x5bf358[_0x1ff8('0x78')];for(;_0x320f98--;){const _0x15af47=_0x5bf358[_0x320f98];if(!this[_0x1ff8('0x21')][_0x1ff8('0x6b')](_0x15af47)){if(!this[_0x1ff8('0x2a')][_0x1ff8('0x6b')](_0x15af47)){const _0x2cb550=_0x11c03c()[_0x1ff8('0xcb')](0x1,0x12);this[_0x1ff8('0x2a')]['set'](_0x15af47,_0x2cb550);}return this[_0x1ff8('0x2a')][_0x1ff8('0x77')](_0x15af47);}}}[_0x1ff8('0x9d')](_0x487f6d,_0x4c2251){if(!_0x4c2251)return;let _0x5f2e01=_0x487f6d['length'];for(;_0x5f2e01--;){const _0x4dac4c=_0x487f6d[_0x5f2e01];this['_ignoredOperations'][_0x1ff8('0x6b')](_0x4dac4c)||this[_0x1ff8('0x2a')][_0x1ff8('0x99')](_0x4dac4c,_0x4c2251);}}}
23
+ const _0x4002=['realtimecollaborationclient-init-non-existent-root','unregister','destroy','plugins','init','entries','cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.','getUser','_setUpDataInit','real-time-collaboration','targetPosition','enableReadOnlyMode','remove','realtimecollaborationclient-initservice-internal-error','return','config','Notification','getDocumentDetails','sessionAdd:','getOperationAuthor','_baseBufferDelay','_handleServerResponse','sendOperations','_disconnectService','startsWith','_handleInitialConnectionData','version','isDocumentOperation','reconnection:\x20flushed\x20session','_setPendingAction','PENDING_ACTION_SENDING_DATA','CollaborativeEditingService','getIdOfTheLastOperation','initData','baseVersion','from','enqueueChange','reset','batch','userId','_connectService','operationsReceived','cloudServices.bundleVersion','_isEditingAllowed','_fetchMissingUsers','lastSyncVersion','__className','_hasSelectionChanged','lastOperationAcceptedAt','get','_lastServerVersion','_handleReconnectionResponse','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.','_addKnownRoot','map','serverHistory','_crash','wereChangesApplied','attributes','_initSessionsHandling','code','error','_waitUntilSynced','fire','finally','wasUndone','_clearPendingAction','type','_sendBufferedOperationsDelayed','_handleReceivedOperations','getConnectedSessions','lastDocumentSession','set','change:_isPendingUpdate','sessionId','end','connected','_isConnected','_isLoaded','model','forEach','applyOperation','_authorId','_ignoredOperations','insert','isUndoneOperation','addOperation','add','_isInit','createdAt','editing','listenTo','collaboration.channelId','_compressor','requires','_disconnectionOperations','_saveOperationInBuffer','pluginName','document:write','has','_applyOperationsSet','data','_knownOperations','editor','setPermissions','position','history','$root','then','parse','lastOperationId','CommentsOnly','409','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.','_knownRootNames','_operationToId','_operationIdentifier','affectedSelectable','_isDisconnection','apply','locale','start','_refreshUserSelectionMarkers','_compressOperations','cloudDocumentVersion','showWarning','addToReconnectionStack','createRange','directChange','_handleExternalOperations','catch','Permissions','offset','metadata','_getAffectedRoot','_updateServerHistory','createRoot','_bufferedOperations','removeFromReconnectionStack','sessionCreatedAt','root','newRange','selection','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','_sendBufferedOperationsDelayId','push','disconnect','size','register','change:_isEditingAllowed','_lastSyncedOperationId','off','fromJSON','_shouldSendSelectionUpdate','_channelId','marker','_decompressOperations','cs:removeUser','_connectAfterSessionHasBeenFlushed','toJSON','realtimecollaborationclient-init-session-connection-error','clone','_getOperationsFromInitData','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','_document','message','rootsAttributes','404','path','high','_hasSynchronizationProblem','markers','_isPendingUpdate','_pendingAction','_shouldSendUpdate','_loadRoot','change:hasDomSelection','addUser','_initThrowingOnDataSet','roots','rtc-destroyed','stop','_currentBufferDelay','_handleSendingSelectionMarkers','_sendBufferedOperations','createUserMarkerOperations','realtimecollaborationclient-sendbufferedoperations','_service','compress','disableReadOnlyMode','length','_handleReconnectionError','view','rtc-offline','differ','reconnect','slice','loadRoot','_offset','getMany','bind','collaboration','getRoot','state','filter','suppressErrorInCollaboration','setIdForTheLastOperation','connection','channelSessions','realtimecollaborationclient-handleserverresponse','document','_bufferRootLoad','multi-root-editor-root-attributes-no-root','createPositionFromPath','getOperations'];(function(_0x18ed08,_0x4002e6){const _0x753e69=function(_0x137a65){while(--_0x137a65){_0x18ed08['push'](_0x18ed08['shift']());}};_0x753e69(++_0x4002e6);}(_0x4002,0xcc));const _0x753e=function(_0x18ed08,_0x4002e6){_0x18ed08=_0x18ed08-0x0;let _0x753e69=_0x4002[_0x18ed08];return _0x753e69;};import{Plugin as _0x38e2f0,PendingActions as _0x3d6ce7}from'ckeditor5/src/core';import{CKEditorError as _0x1ec180,version as _0x5dc327,uid as _0x44ff49}from'ckeditor5/src/utils';import{Notification as _0x294b18}from'ckeditor5/src/ui';import{transformSets as _0x4085bc,NoOperation as _0x5046ce,InsertOperation as _0x5d24f5,MarkerOperation as _0x1d9613,RootAttributeOperation as _0x24bf8f,OperationFactory as _0x5083a4,History as _0x371aa5}from'ckeditor5/src/engine';import _0x3b52c0 from'./websocketgateway';import _0x5827a3 from'./sessions';import _0x413fa9 from'./usermarkers';import{getTranslation as _0xb256f}from'../common-translations';import _0x45b244 from'@ckeditor/ckeditor5-operations-compressor/src/compressor';import{Users as _0x167402}from'ckeditor5-collaboration/src/collaboration-core';import{User as _0x551b15}from'@ckeditor/ckeditor-cloud-services-collaboration';import{CollaborativeEditingService as _0x5739c3}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services';let $=0x1;export default class l extends _0x38e2f0{static get[_0x753e('0x69')](){return[_0x3b52c0,_0x5827a3,_0x413fa9,_0x3d6ce7,_0x167402,_0x294b18];}static get[_0x753e('0x6c')](){return'RealTimeCollaborationClient';}get[_0x753e('0x87')](){return this[_0x753e('0x3d')]+this[_0x753e('0xd1')];}get[_0x753e('0x3d')](){return this[_0x753e('0x42')][_0x753e('0x25')]-this[_0x753e('0xd1')];}get[_0x753e('0x38')](){const _0x1dc139=this[_0x753e('0x42')][_0x753e('0xa')]();for(let _0x531737=_0x1dc139[_0x753e('0xc9')]-0x1;_0x531737>=0x0;_0x531737--){const _0x11a340=_0x1dc139[_0x531737];if(!this[_0x753e('0x6a')]['has'](_0x11a340))return _0x11a340[_0x753e('0x2d')]+0x1-this['_offset'];}return 0x0;}constructor(_0x6d592f){if(super(_0x6d592f),this[_0x753e('0xd1')]=0x0,this[_0x753e('0x55')]=null,this[_0x753e('0x42')]=new _0x371aa5(),this[_0x753e('0x72')][_0x753e('0x1a')]['define'](_0x753e('0xd4'),{}),this[_0x753e('0xa5')]=this['editor'][_0x753e('0x1a')][_0x753e('0x3c')](_0x753e('0x67')),!this[_0x753e('0xa5')])throw new _0x1ec180('collaboration-missing-channelid',this);const _0xb5e968=_0x6d592f[_0x753e('0x1a')][_0x753e('0x3c')](_0x753e('0x35'))||_0x5dc327;this['_service']=new l[(_0x753e('0x2a'))](_0xb5e968,this[_0x753e('0xa5')]),this[_0x753e('0xaf')]=this[_0x753e('0x72')][_0x753e('0x5a')][_0x753e('0x6')],this[_0x753e('0x68')]=new _0x45b244(),this[_0x753e('0x94')]=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this[_0x753e('0x53')](_0x753e('0xb7'),!0x1),this[_0x753e('0x53')](_0x753e('0xb5'),!0x1),this[_0x753e('0xb8')]=null,this[_0x753e('0x3a')]=!0x1,this[_0x753e('0x9b')]=null,this[_0x753e('0x1f')]=0x12c,this[_0x753e('0xc1')]=this['_baseBufferDelay'],this[_0x753e('0xa1')]=null,this[_0x753e('0x6a')]=new WeakSet(),this[_0x753e('0x7f')]=new Q(this[_0x753e('0x6a')]);}[_0x753e('0xf')](){const _0x73e222=this[_0x753e('0x72')],_0x5007d6=_0x73e222[_0x753e('0xe')][_0x753e('0x3c')](_0x167402),_0x5c6bd4=_0x73e222[_0x753e('0xe')]['get'](_0x3b52c0);this[_0x753e('0x66')](_0x5007d6,_0x753e('0x1e'),(_0x329bf7,_0x2d578e)=>{const _0xf44a92=_0x2d578e[0x0];_0xf44a92[_0x753e('0x5d')]&&(_0x329bf7[_0x753e('0x19')]=_0x5007d6[_0x753e('0x12')](_0xf44a92[_0x753e('0x5d')]),_0x329bf7['stop']()),null===_0xf44a92[_0x753e('0x5d')]&&(_0x329bf7[_0x753e('0x19')]=null,_0x329bf7[_0x753e('0xc0')]());},{'priority':_0x753e('0xb4')}),this[_0x753e('0x66')](_0x73e222['model']['document'][_0x753e('0x99')],'change:range',(_0x2ca362,_0x56d45a)=>{_0x56d45a[_0x753e('0x8b')]&&this[_0x753e('0x85')]();}),this[_0x753e('0x66')](_0x73e222[_0x753e('0x65')][_0x753e('0xcb')],_0x753e('0xbb'),()=>{this[_0x753e('0x85')]();}),this['_initThrowingOnDataSet'](),_0x73e222['model']['on'](_0x753e('0x5c'),(_0x11dfd4,_0x5044d0)=>{const _0x30cf83=_0x5044d0[0x0];_0x30cf83[_0x753e('0x26')]&&(this[_0x753e('0x6b')](_0x30cf83),this[_0x753e('0xb9')]()&&this[_0x753e('0x4f')]());}),this[_0x753e('0x13')](),this[_0x753e('0xd3')](_0x753e('0x36'))['to'](_0x5c6bd4,_0x753e('0xd6'),this,'_hasSynchronizationProblem',(_0x18c4ef,_0x4def0b)=>_0x753e('0x57')===_0x18c4ef&&!_0x4def0b),this['on'](_0x753e('0xa0'),()=>{this[_0x753e('0x36')]?_0x73e222[_0x753e('0xc8')](_0x753e('0xcc')):_0x73e222[_0x753e('0x16')](_0x753e('0xcc'));}),this[_0x753e('0x36')]?_0x73e222[_0x753e('0xc8')](_0x753e('0xcc')):_0x73e222[_0x753e('0x16')](_0x753e('0xcc')),this[_0x753e('0x53')](_0x753e('0x58'),!0x1);}async['reconnect'](){const _0x1f6576=this['editor']['plugins']['get'](_0x5827a3),_0x12864e=this[_0x753e('0x72')][_0x753e('0xe')][_0x753e('0x3c')](_0x3b52c0);try{this[_0x753e('0xb7')]=!0x0,_0x1f6576[_0x753e('0xc')](this[_0x753e('0xa5')]);const _0x4a1e19=await this['_service'][_0x753e('0xce')](_0x12864e[_0x753e('0x3')],this['lastSyncVersion']);await this[_0x753e('0x3e')](_0x4a1e19)&&(this[_0x753e('0xb7')]=!0x1,this[_0x753e('0x4d')]());const _0x275d58=await this['_service'][_0x753e('0x51')]();_0x1f6576[_0x753e('0x9f')](this[_0x753e('0xa5')],_0x275d58),this[_0x753e('0xc2')](),this[_0x753e('0x58')]=!0x0;}catch(_0x5c2007){if(function(_0x2d2807){return _0x753e('0xb2')===_0x2d2807[_0x753e('0x47')];}(_0x5c2007)&&this['sessionId'])await this[_0x753e('0xa9')]();else{if(function(_0x343613){return _0x753e('0x7b')===_0x343613['code'];}(_0x5c2007)){const _0x2138fb=_0xb256f(this['editor'][_0x753e('0x83')],_0x753e('0x9a'));this['_handleReconnectionError'](_0x2138fb);}else{if(!(_0x5c2007 instanceof K))throw _0x5c2007;this[_0x753e('0xca')]();}}}}[_0x753e('0xd')](){const _0x37d64e=this[_0x753e('0x72')][_0x753e('0xe')][_0x753e('0x3c')](_0x3b52c0),_0x5363bb=this[_0x753e('0x72')]['plugins'][_0x753e('0x3c')](_0x5827a3);this[_0x753e('0x72')][_0x753e('0x16')](_0x753e('0xbf')),_0x5363bb['channelSessions']['has'](this[_0x753e('0xa5')])&&_0x5363bb[_0x753e('0xc')](this['_channelId']),_0x37d64e[_0x753e('0x95')](this),this[_0x753e('0x22')](),super[_0x753e('0xd')]();}async['_handleReconnectionResponse'](_0x50238d){if(this[_0x753e('0x55')]!==_0x50238d[_0x753e('0x55')]&&this[_0x753e('0xa1')]!==_0x50238d[_0x753e('0x79')])throw new K();return this[_0x753e('0x55')]=_0x50238d[_0x753e('0x55')],this[_0x753e('0x20')]([],{..._0x50238d,'wereChangesApplied':!0x1,'data':_0x50238d[_0x753e('0x70')]},_0x753e('0xce'));}async['_connectService'](_0x32b8c3,_0x88ef5f=!0x1){const {connection:_0x2caf34}=this['editor'][_0x753e('0xe')]['get'](_0x3b52c0);l[_0x753e('0x2a')]['getConnectedSessions'](_0x2caf34,this['_channelId'])[_0x753e('0x77')](_0x1b06b8=>this[_0x753e('0x46')](_0x1b06b8))[_0x753e('0x8d')](_0x5682f5=>{this[_0x753e('0x43')](_0x753e('0xab'),_0x5682f5);}),this['listenTo'](this[_0x753e('0xc6')],_0x753e('0x34'),this[_0x753e('0x50')][_0x753e('0xd3')](this)),this['listenTo'](this[_0x753e('0xc6')],_0x753e('0x48'),(_0x313b54,_0x30059e)=>{this['_crash'](_0x753e('0x18'),_0x30059e);}),this[_0x753e('0x66')](this[_0x753e('0xc6')],'disconnected',()=>{this[_0x753e('0x58')]=!0x1;});const _0x16bb77=this['_operationIdentifier'][_0x753e('0x2b')](_0x32b8c3);this[_0x753e('0xb7')]=!0x0;const _0x819e9d=await this['_service']['connect'](_0x2caf34,this[_0x753e('0x86')](_0x32b8c3),_0x16bb77);if(this['sessionId']=_0x819e9d['sessionId'],_0x88ef5f){if(!_0x819e9d[_0x753e('0x44')])return void this[_0x753e('0xca')]();this[_0x753e('0xb7')]=!0x1,this[_0x753e('0x4d')](),this['serverHistory'][_0x753e('0x30')](),this['_offset']=_0x819e9d[_0x753e('0x8f')],this[_0x753e('0x42')][_0x753e('0x25')]=this[_0x753e('0xd1')],await this[_0x753e('0x20')](_0x32b8c3,_0x819e9d,_0x753e('0x27'));}else await this[_0x753e('0x24')](_0x819e9d,_0x32b8c3);this[_0x753e('0xc2')](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x488703=this['editor']['plugins'][_0x753e('0x3c')](_0x5827a3),_0x397610=this[_0x753e('0x72')][_0x753e('0xe')][_0x753e('0x3c')](_0x413fa9),_0x5c786d=_0x488703[_0x753e('0x4')][_0x753e('0x3c')](this[_0x753e('0xa5')]);_0x5c786d&&_0x5c786d[_0x753e('0xc9')]>0x1?_0x397610[_0x753e('0xc4')]():this['listenTo'](_0x488703,_0x753e('0x1d')+this[_0x753e('0xa5')],()=>{0x2===_0x488703[_0x753e('0x4')][_0x753e('0x3c')](this[_0x753e('0xa5')])[_0x753e('0xc9')]&&_0x397610[_0x753e('0xc4')]();});}async[_0x753e('0x50')](_0x235e25,_0x503c5c,_0x566a70,_0x30cb5a){if(!this[_0x753e('0xb7')]&&this[_0x753e('0xaf')][_0x753e('0x25')]==_0x503c5c){const _0x3969e3=this[_0x753e('0xa7')](_0x566a70,_0x30cb5a);await this['_fetchMissingUsers'](_0x3969e3),this[_0x753e('0x8c')](_0x3969e3,_0x503c5c,_0x566a70['lastOperationId'])||this[_0x753e('0x43')]('realtimecollaborationclient-initservice-incorrect-server-operation');}}async[_0x753e('0xa9')](){this['_disconnectService']();const {locale:_0x2d6dc2}=this['editor'];let _0xdeede8;try{_0xdeede8=await this[_0x753e('0xc6')][_0x753e('0x1c')]();}catch(_0x508251){const _0x2080e9=_0xb256f(_0x2d6dc2,_0x753e('0xae'));return void this[_0x753e('0xca')](_0x2080e9);}const _0x4eec4f=_0xdeede8['currentDocumentSession']||_0xdeede8[_0x753e('0x52')];if(this[_0x753e('0xa1')]===_0x4eec4f['lastOperationId'])await this[_0x753e('0x33')](this[_0x753e('0x72')][_0x753e('0x5a')][_0x753e('0x6')]['history'][_0x753e('0xa')](),!0x0);else{const _0x35b442=_0xb256f(_0x2d6dc2,_0x753e('0x7c'));this[_0x753e('0xca')](_0x35b442);}}[_0x753e('0x22')](){this['_service'][_0x753e('0x9d')](),this[_0x753e('0x94')]=[],clearTimeout(this[_0x753e('0x9b')]),this['stopListening'](this[_0x753e('0xc6')]);}[_0x753e('0x46')](_0x51eb61){const _0x46545d=this[_0x753e('0x72')]['plugins'][_0x753e('0x3c')](_0x5827a3);this[_0x753e('0x66')](_0x46545d,_0x753e('0x1d')+this['_channelId'],(_0x100b51,{session:_0x4a3724})=>{if(_0x4a3724['id']===_0x46545d['mySessionId']){_0x100b51[_0x753e('0xa2')]();const _0x24917b=this[_0x753e('0x72')][_0x753e('0xe')]['has']('CommentsOnly')&&this['editor']['plugins'][_0x753e('0x3c')](_0x753e('0x7a'));let _0x45659c=_0x4a3724['permissions'];_0x24917b&&_0x24917b['isEnabled']&&(_0x45659c=_0x45659c['filter'](_0x25e3c8=>_0x753e('0x6d')!==_0x25e3c8)),this[_0x753e('0x72')][_0x753e('0xe')]['get'](_0x753e('0x8e'))[_0x753e('0x73')](_0x45659c,this[_0x753e('0xa5')]);}}),_0x46545d[_0x753e('0x9f')](this['_channelId'],_0x51eb61);}[_0x753e('0xbd')](){const _0x1960db=this[_0x753e('0x72')][_0x753e('0x70')][_0x753e('0x53')];this[_0x753e('0x72')][_0x753e('0x70')]['set']=(..._0x427edf)=>{if(!_0x427edf[_0x427edf[_0x753e('0xc9')]-0x1][_0x753e('0x1')])throw new _0x1ec180('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x1960db[_0x753e('0x82')](this['editor'][_0x753e('0x70')],_0x427edf);};}[_0x753e('0x13')](){this[_0x753e('0x72')][_0x753e('0x70')]['on']('init',(_0x427393,[_0x3fa66e])=>{if(this[_0x753e('0xaf')][_0x753e('0x25')])throw new _0x1ec180('realtimecollaborationclient-init-document-already-initialized',this);_0x427393['stop'](),this[_0x753e('0x28')]();const _0x10549c=this[_0x753e('0x72')][_0x753e('0x1a')][_0x753e('0x3c')](_0x753e('0xb1')),_0x529a69=this['_getOperationsFromInitData'](_0x3fa66e,_0x10549c);0x0==_0x529a69[_0x753e('0xc9')]&&_0x529a69[_0x753e('0x9c')](new _0x5046ce(0x0)),_0x427393[_0x753e('0x19')]=this['_connectService'](_0x529a69)[_0x753e('0x77')](()=>{this[_0x753e('0x72')]['plugins'][_0x753e('0x3c')](_0x3b52c0)[_0x753e('0x89')](this),this['editor']['data'][_0x753e('0x4a')]('ready');})['catch'](_0x5807bf=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x5807bf))[_0x753e('0x4b')](()=>this[_0x753e('0x4d')]());},{'priority':_0x753e('0xb4')}),this[_0x753e('0x72')]['on'](_0x753e('0xd0'),async(_0x4cd2ef,[_0x1ac765,_0x296545])=>{_0x4cd2ef[_0x753e('0xc0')]();const _0x2e9be4=this[_0x753e('0x72')]['model'][_0x753e('0x6')][_0x753e('0xd5')](_0x1ac765);if(!this[_0x753e('0x7d')]['has'](_0x1ac765)){const _0x204083=_0x296545&&_0x296545[_0x753e('0x70')]?_0x296545[_0x753e('0x70')]:'',_0x4a2dc9=_0x296545&&_0x296545[_0x753e('0x45')]?_0x296545['attributes']:{};await this[_0x753e('0xba')](_0x1ac765,_0x204083,_0x4a2dc9);}this['editor'][_0x753e('0x5a')][_0x753e('0x2f')]({'isUndoable':!0x1},()=>{_0x2e9be4[_0x753e('0x59')]=!0x0,this[_0x753e('0x72')]['model']['document'][_0x753e('0xcd')][_0x753e('0x7')](_0x2e9be4);});},{'priority':_0x753e('0xb4')});}async[_0x753e('0x37')](_0x46eeb4){const _0x2fe4f3=this[_0x753e('0x72')][_0x753e('0xe')][_0x753e('0x3c')](_0x167402),{connection:_0x2a7a42}=this['editor'][_0x753e('0xe')][_0x753e('0x3c')](_0x3b52c0),_0x40dc84=new Set();for(const _0xf68442 of _0x46eeb4){const _0x2fd231=_0xf68442['_authorId'];_0x2fd231&&!_0x2fe4f3['getUser'](_0x2fd231)&&_0x40dc84[_0x753e('0x62')](_0x2fd231);}if(0x0===_0x40dc84[_0x753e('0x9e')])return;const _0x36a0cd=await _0x551b15[_0x753e('0xd2')](_0x2a7a42,Array[_0x753e('0x2e')](_0x40dc84));for(const _0x368b9c of _0x36a0cd)_0x2fe4f3[_0x753e('0x12')](_0x368b9c['id'])||_0x2fe4f3[_0x753e('0xbc')](_0x368b9c);}[_0x753e('0xad')](_0x34521d,_0x3e3fac={}){const _0x10a331=this[_0x753e('0x72')]['model'],_0x5e832a=[];let _0x4fcfa6=0x0;const _0x50a9c9='string'==typeof _0x34521d?{'main':_0x34521d}:_0x34521d;for(const _0x51cce1 of Object['keys'](_0x50a9c9)){if(!this[_0x753e('0xaf')][_0x753e('0xbe')][_0x753e('0x6e')](_0x51cce1))throw new _0x1ec180(_0x753e('0xb'),this);const _0x24a82e=this['editor']['data'][_0x753e('0x78')](_0x50a9c9[_0x51cce1]),_0x390eed=this['_document'][_0x753e('0xd5')](_0x51cce1),_0x544934=new _0x5d24f5(_0x10a331['createPositionAt'](_0x390eed,0x0),_0x24a82e,_0x4fcfa6++);_0x5e832a[_0x753e('0x9c')](_0x544934);for(const [_0x4eb392,_0x3ba282]of _0x24a82e[_0x753e('0xb6')]){const _0x3c7131=_0x10a331[_0x753e('0x8a')](_0x10a331[_0x753e('0x9')](_0x390eed,_0x3ba282[_0x753e('0x84')][_0x753e('0xb3')]['slice']()),_0x10a331[_0x753e('0x9')](_0x390eed,_0x3ba282[_0x753e('0x56')]['path']['slice']())),_0x1b9dd3=new _0x1d9613(_0x4eb392,null,_0x3c7131,_0x10a331[_0x753e('0xb6')],!0x0,_0x4fcfa6++);_0x5e832a['push'](_0x1b9dd3);}}if(_0x3e3fac)for(const [_0x32cdd0,_0x44344e]of Object[_0x753e('0x10')](_0x3e3fac)){const _0x4a7a17=_0x10a331['document']['getRoot'](_0x32cdd0);if(!_0x4a7a17)throw new _0x1ec180(_0x753e('0x8'),null);for(const [_0x44b615,_0xb6fadd]of Object['entries'](_0x44344e))if(null!==_0xb6fadd){const _0x4ea303=new _0x24bf8f(_0x4a7a17,_0x44b615,null,_0xb6fadd,_0x4fcfa6++);_0x5e832a[_0x753e('0x9c')](_0x4ea303);}}return _0x5e832a;}async[_0x753e('0xba')](_0x2ffbdf,_0x4686c1,_0x7b302d){this[_0x753e('0xad')]({[_0x2ffbdf]:_0x4686c1},{[_0x2ffbdf]:_0x7b302d})[_0x753e('0x5b')]((_0x1b486f,_0x26ba94)=>{_0x1b486f[_0x753e('0x2d')]=this[_0x753e('0xaf')][_0x753e('0x25')]+_0x26ba94,_0x1b486f[_0x753e('0x63')]=!0x0,this[_0x753e('0x6b')](_0x1b486f);}),this[_0x753e('0x4f')](),await this[_0x753e('0x49')]();}async[_0x753e('0x24')](_0x3162c9,_0xf41065){let _0x5ab129;this['_offset']=_0x3162c9[_0x753e('0x8f')];const _0x469891=_0x3162c9[_0x753e('0x44')]&&!_0x3162c9[_0x753e('0x2c')],_0x4fab58=_0x469891?0x0:_0x3162c9['data'][_0x753e('0x2d')];if(_0xf41065[_0x753e('0x5b')](_0x1a3e25=>{_0x1a3e25[_0x753e('0x63')]=!0x0,_0x1a3e25[_0x753e('0x64')]=_0x3162c9[_0x753e('0x96')],_0x1a3e25[_0x753e('0x5d')]=null;}),_0x469891)_0x5ab129=_0xf41065,this[_0x753e('0x6f')](_0x5ab129,_0x469891);else{if(_0x3162c9[_0x753e('0x2c')]){const _0xa74fc1=this[_0x753e('0xad')](_0x3162c9['initData']);this[_0x753e('0xaf')][_0x753e('0x75')][_0x753e('0x25')]=-_0xa74fc1[_0x753e('0xc9')],_0xa74fc1[_0x753e('0x5b')](_0x12c731=>{_0x12c731[_0x753e('0x2d')]-=_0xa74fc1[_0x753e('0xc9')],_0x12c731[_0x753e('0x64')]=_0x3162c9['sessionCreatedAt'],_0x12c731[_0x753e('0x63')]=!0x0,_0x12c731[_0x753e('0x5d')]=null;}),this['_applyOperationsSet'](_0xa74fc1,!0x0),this[_0x753e('0x42')][_0x753e('0x25')]=-_0xa74fc1[_0x753e('0xc9')]+this['_offset'],this[_0x753e('0x92')](_0xa74fc1);}this['_document'][_0x753e('0x75')][_0x753e('0x25')]=_0x4fab58,_0x5ab129=this['_decompressOperations'](_0x3162c9['data'],_0x3162c9[_0x753e('0x90')]),await this[_0x753e('0x37')](_0x5ab129),this['_applyOperationsSet'](_0x5ab129,_0x469891);}_0x3162c9[_0x753e('0x79')]&&(this[_0x753e('0x7f')]['setIdForTheLastOperation'](_0x5ab129,_0x3162c9[_0x753e('0x79')]),this['_lastSyncedOperationId']=_0x3162c9[_0x753e('0x79')]),this['serverHistory'][_0x753e('0x25')]=_0x4fab58+this['_offset'],this[_0x753e('0x92')](_0x5ab129),_0xf41065['filter'](_0x324ced=>{const _0x193373=this[_0x753e('0x91')](_0x324ced);return _0x193373&&!this[_0x753e('0x7d')][_0x753e('0x6e')](_0x193373);})['forEach']((_0x5d128c,_0x59189a)=>{_0x5d128c[_0x753e('0x2d')]=this[_0x753e('0xaf')][_0x753e('0x25')]+_0x59189a,this[_0x753e('0x6b')](_0x5d128c);}),this[_0x753e('0xb9')]()?(this['_currentBufferDelay']=0x0,this[_0x753e('0x4f')](!0x0),await this[_0x753e('0x49')]()):(this[_0x753e('0xb7')]=!0x1,this[_0x753e('0x4d')]());}[_0x753e('0x43')](_0xe5eba8,_0x199bc8){throw this[_0x753e('0xb7')]=!0x0,_0x199bc8&&console[_0x753e('0x48')](_0x199bc8),new _0x1ec180(_0xe5eba8,this[_0x753e('0x72')]);}[_0x753e('0x6b')](_0x2bc14b){this[_0x753e('0x71')][_0x753e('0x6e')](_0x2bc14b)||(this['_knownOperations'][_0x753e('0x62')](_0x2bc14b),this[_0x753e('0x94')][_0x753e('0x9c')](_0x2bc14b),this[_0x753e('0xb8')]||_0x753e('0xa6')==_0x2bc14b[_0x753e('0x4e')]&&!_0x2bc14b['affectsData']||this['_setPendingAction']());}[_0x753e('0x4f')](_0x41c36a=!0x1){!_0x41c36a&&this[_0x753e('0xb7')]||(this[_0x753e('0xb7')]=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this[_0x753e('0xc3')]()[_0x753e('0x77')](_0x54e9dc=>{_0x54e9dc&&(this['_clearPendingAction'](),this[_0x753e('0xb7')]=!0x1);})[_0x753e('0x8d')](_0x550557=>{if(this[_0x753e('0x4d')](),this[_0x753e('0xb7')]=!0x1,!function(_0x1aca1f){return _0x1aca1f[_0x753e('0xb0')][_0x753e('0x23')]('cloud-services-internal-error:\x20Not\x20connected.')||_0x1aca1f[_0x753e('0xb0')]['startsWith'](_0x753e('0x11'))||_0x1aca1f[_0x753e('0xb0')][_0x753e('0x23')]('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x550557))throw _0x550557;});},this[_0x753e('0xc1')]));}[_0x753e('0x49')](){return new Promise(_0x551237=>{this['on'](_0x753e('0x54'),()=>{_0x551237();});});}async[_0x753e('0xc3')](){const _0x4b50df=this[_0x753e('0x72')][_0x753e('0xe')][_0x753e('0x3c')](_0x413fa9);if(this['_shouldSendSelectionUpdate']()&&(_0x4b50df[_0x753e('0xc4')](),this[_0x753e('0x3a')]=!0x1),!this[_0x753e('0xb9')]())return!0x0;const _0x1328c5=[...this['_bufferedOperations']];for(const _0xc14e8b of _0x1328c5)_0xc14e8b[_0x753e('0x4c')]=this[_0x753e('0xaf')][_0x753e('0x75')][_0x753e('0x60')](_0xc14e8b);const _0x4dfa06=this[_0x753e('0x7f')][_0x753e('0x2b')](_0x1328c5),_0xd8535b=$++,_0x83c0aa=this['_compressOperations'](_0x1328c5),_0x2cb300=await this['_service'][_0x753e('0x21')](_0x83c0aa,_0x83c0aa[_0x753e('0x2d')],_0x4dfa06);try{return await this[_0x753e('0x20')](_0x1328c5,_0x2cb300,_0xd8535b);}catch(_0x556227){return this[_0x753e('0x43')](_0x753e('0xc5'),_0x556227);}}async['_handleServerResponse'](_0x250dad,_0x430b8d,_0x23361e){if('error'in _0x430b8d)throw _0x430b8d[_0x753e('0x48')];let _0xfbda45=!0x1;if(_0x430b8d[_0x753e('0x44')]){_0x430b8d[_0x753e('0x79')]&&(this[_0x753e('0xa1')]=_0x430b8d[_0x753e('0x79')]),this[_0x753e('0x94')]=this[_0x753e('0x94')][_0x753e('0x0')](_0x1e18ab=>!_0x250dad['includes'](_0x1e18ab));for(const _0x4c6215 of _0x250dad)_0x4c6215[_0x753e('0x64')]=_0x753e('0x3b')in _0x430b8d&&_0x430b8d[_0x753e('0x3b')]||void 0x0;J(_0x250dad,_0x430b8d[_0x753e('0x25')]-_0x250dad[_0x753e('0xc9')]),this[_0x753e('0x92')](_0x250dad);const _0x22eee2=_0x250dad['filter'](_0x13d539=>{if(!_0x13d539[_0x753e('0x63')])return!0x1;const _0x410400=this[_0x753e('0x91')](_0x13d539);return _0x410400&&!this[_0x753e('0x7d')][_0x753e('0x6e')](_0x410400);});J(_0x22eee2,this[_0x753e('0xaf')][_0x753e('0x25')]),this[_0x753e('0x6f')](_0x22eee2),_0xfbda45=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x4aae43=this['_decompressOperations'](_0x430b8d[_0x753e('0x70')],_0x430b8d[_0x753e('0x90')])['filter'](_0x17e1bb=>_0x17e1bb[_0x753e('0x2d')]>=this[_0x753e('0x3d')]);_0x4aae43[_0x753e('0x5b')](_0x53d8b5=>this[_0x753e('0x40')](_0x53d8b5)),this[_0x753e('0x94')]=this[_0x753e('0x94')][_0x753e('0x0')](_0x4cdd5f=>!_0x4cdd5f[_0x753e('0x63')]||!this['_knownRootNames']['has'](this[_0x753e('0x91')](_0x4cdd5f))),this[_0x753e('0x94')][_0x753e('0xc9')]&&J(this[_0x753e('0x94')],this[_0x753e('0x94')][0x0][_0x753e('0x2d')]),await this[_0x753e('0x37')](_0x4aae43),_0xfbda45=this[_0x753e('0x8c')](_0x4aae43,_0x430b8d[_0x753e('0x25')],_0x430b8d[_0x753e('0x79')]),this['_currentBufferDelay']=Math['round'](this[_0x753e('0xc1')]/0x2);}return _0xfbda45?!this[_0x753e('0xb9')]()||(this[_0x753e('0x4f')](!0x0),!0x1):this[_0x753e('0x43')](_0x753e('0x5'));}[_0x753e('0x8c')](_0xf04c80,_0x2393b4,_0x440c2c){try{const _0x58fccb={'document':this[_0x753e('0xaf')],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x1d301d,operationsB:_0x3ea023,originalOperations:_0x33b873}=_0x4085bc(_0xf04c80,this[_0x753e('0x94')],_0x58fccb);J(_0x1d301d,this[_0x753e('0xaf')]['version']),J(_0x3ea023,_0x2393b4);for(const _0x131826 of _0x1d301d){const _0x174d0e=_0x33b873[_0x753e('0x3c')](_0x131826);_0x131826[_0x753e('0x5d')]=_0x174d0e?_0x174d0e[_0x753e('0x5d')]:null;}_0x440c2c&&(this[_0x753e('0x7f')][_0x753e('0x2')](_0xf04c80,_0x440c2c),this[_0x753e('0xa1')]=_0x440c2c),this[_0x753e('0x94')]=[..._0x3ea023],this[_0x753e('0x6f')](_0x1d301d),this[_0x753e('0x92')](_0xf04c80);}catch(_0x1aeeff){return console[_0x753e('0x48')](_0x1aeeff),!0x1;}return!0x0;}[_0x753e('0x6f')](_0x584f21,_0x5d0804=!0x1){this['editor'][_0x753e('0x5a')][_0x753e('0x2f')]({'isUndoable':!0x1,'isLocal':!0x1},_0x1f9b70=>{for(const _0x5c84ec of _0x584f21)this['_knownOperations'][_0x753e('0x62')](_0x5c84ec),this['_addKnownRoot'](_0x5c84ec),_0x1f9b70[_0x753e('0x31')][_0x753e('0x61')](_0x5c84ec),this[_0x753e('0x72')][_0x753e('0x5a')][_0x753e('0x5c')](_0x5c84ec);});}[_0x753e('0x40')](_0x2ba7c0){const _0x58f225=this[_0x753e('0x91')](_0x2ba7c0);_0x58f225&&this[_0x753e('0x7d')][_0x753e('0x62')](_0x58f225);}['_getAffectedRoot'](_0x4e2c26){let _0x2d4ae4,_0x3a8f22;switch(_0x4e2c26[_0x753e('0x4e')]){case _0x753e('0x5f'):_0x2d4ae4=_0x4e2c26[_0x753e('0x74')][_0x753e('0x97')];break;case'marker':if(_0x3a8f22=_0x4e2c26[_0x753e('0x98')],!_0x3a8f22)return null;_0x2d4ae4=_0x3a8f22[_0x753e('0x97')];break;case'addRootAttribute':_0x2d4ae4=_0x4e2c26['root'];break;case'addRoot':_0x2d4ae4=_0x4e2c26[_0x753e('0x80')];break;case'move':_0x2d4ae4=_0x4e2c26[_0x753e('0x15')]['root'];break;default:return null;}return _0x2d4ae4['rootName'];}[_0x753e('0x92')](_0x49efad){_0x49efad['forEach'](_0x33ccff=>{const _0x3f823c=_0x33ccff[_0x753e('0xac')]();_0x3f823c['_authorId']=_0x33ccff['_authorId'],_0x3f823c['_isInit']=!!_0x33ccff[_0x753e('0x63')],_0x3f823c['createdAt']=_0x33ccff[_0x753e('0x64')],_0x3f823c[_0x753e('0x2d')]+=this[_0x753e('0xd1')],_0x33ccff[_0x753e('0x81')]&&this[_0x753e('0x6a')][_0x753e('0x62')](_0x3f823c),this[_0x753e('0x42')][_0x753e('0x61')](_0x3f823c);});}['_handleReconnectionError'](_0x1f34ca){const _0x6d763f=this['editor'][_0x753e('0xe')][_0x753e('0x3c')](_0x753e('0x1b')),_0x2468f4=this[_0x753e('0x72')][_0x753e('0x83')];_0x1f34ca||(_0x1f34ca=_0xb256f(_0x2468f4,_0x753e('0x3f'))),_0x6d763f[_0x753e('0x88')](_0x1f34ca,{'title':_0xb256f(_0x2468f4,'Synchronization\x20issue'),'namespace':_0x753e('0x14')}),this[_0x753e('0xb5')]=!0x0,clearTimeout(this[_0x753e('0x9b')]),this[_0x753e('0x94')]=[],this['editor'][_0x753e('0xe')][_0x753e('0x3c')](_0x3b52c0)['destroy']();}[_0x753e('0x28')](){this[_0x753e('0xb8')]||(this[_0x753e('0xb8')]=this[_0x753e('0x72')][_0x753e('0xe')][_0x753e('0x3c')](_0x3d6ce7)[_0x753e('0x62')](_0xb256f(this[_0x753e('0x72')][_0x753e('0x83')],_0x753e('0x29'))));}['_clearPendingAction'](){this[_0x753e('0xb8')]&&(this[_0x753e('0x72')][_0x753e('0xe')]['get'](_0x3d6ce7)[_0x753e('0x17')](this[_0x753e('0xb8')]),this[_0x753e('0xb8')]=null);}[_0x753e('0x86')](_0x40eea1){const _0x1189e6=_0x40eea1[_0x753e('0x41')](_0x5e7f7a=>_0x5e7f7a[_0x753e('0xaa')]());return this[_0x753e('0x68')][_0x753e('0xc7')](_0x1189e6);}[_0x753e('0xa7')](_0x5dc6aa,_0x232284){return this[_0x753e('0x68')]['decompress'](_0x5dc6aa)['map']((_0x565ff7,_0x5d97a2)=>{const _0x45c74d='init'==_0x232284[_0x5d97a2][_0x753e('0x4e')];if('InsertOperation'==_0x565ff7[_0x753e('0x39')]){const _0x5151be=_0x565ff7[_0x753e('0x74')][_0x753e('0x97')];!this[_0x753e('0xaf')][_0x753e('0xd5')](_0x5151be)&&(this[_0x753e('0xaf')][_0x753e('0x93')](_0x753e('0x76'),_0x5151be)['_isAttached']=!0x1);}const _0x3e1a6b=_0x5083a4[_0x753e('0xa3')](_0x565ff7,this[_0x753e('0xaf')]);return _0x3e1a6b[_0x753e('0x4c')]=_0x565ff7[_0x753e('0x4c')],_0x3e1a6b[_0x753e('0x63')]=_0x45c74d,_0x3e1a6b[_0x753e('0x5d')]=_0x45c74d?null:_0x232284[_0x5d97a2][_0x753e('0x32')],_0x3e1a6b[_0x753e('0x81')]=_0x753e('0xa8')===_0x232284[_0x5d97a2][_0x753e('0x4e')],_0x3e1a6b['createdAt']=_0x232284[_0x5d97a2][_0x753e('0x64')],_0x3e1a6b;});}[_0x753e('0x85')](){this[_0x753e('0x3a')]=!0x0,this[_0x753e('0xa4')]()?this[_0x753e('0x4f')]():this[_0x753e('0x3a')]=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2c995a=this['editor']['plugins']['get'](_0x5827a3)[_0x753e('0x4')]['get'](this[_0x753e('0xa5')]);return!this[_0x753e('0x72')]['isReadOnly']&&!!_0x2c995a&&_0x2c995a[_0x753e('0xc9')]>0x1&&this[_0x753e('0x3a')];}[_0x753e('0xb9')](){return this[_0x753e('0x94')]['length']>0x0||this[_0x753e('0xa4')]();}}l[_0x753e('0x2a')]=_0x5739c3;class K extends Error{}function J(_0x111b04,_0x5e63e6){for(const _0x116891 of _0x111b04)_0x116891[_0x753e('0x2d')]=_0x5e63e6++;}class Q{constructor(_0x20f216){this[_0x753e('0x5e')]=_0x20f216,this[_0x753e('0x7e')]=new WeakMap();}[_0x753e('0x2b')](_0x15d586){let _0x39376a=_0x15d586[_0x753e('0xc9')];for(;_0x39376a--;){const _0x19a0fa=_0x15d586[_0x39376a];if(!this[_0x753e('0x5e')][_0x753e('0x6e')](_0x19a0fa)){if(!this[_0x753e('0x7e')]['has'](_0x19a0fa)){const _0x2a2ebd=_0x44ff49()[_0x753e('0xcf')](0x1,0x12);this[_0x753e('0x7e')]['set'](_0x19a0fa,_0x2a2ebd);}return this[_0x753e('0x7e')]['get'](_0x19a0fa);}}}[_0x753e('0x2')](_0x28a161,_0xeb3960){if(!_0xeb3960)return;let _0x1c4489=_0x28a161['length'];for(;_0x1c4489--;){const _0x4c5f3f=_0x28a161[_0x1c4489];this[_0x753e('0x5e')][_0x753e('0x6e')](_0x4c5f3f)||this[_0x753e('0x7e')]['set'](_0x4c5f3f,_0xeb3960);}}}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @module real-time-collaboration/realtimecollaborativeediting/sessions
3
7
  * @publicApi
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2270=['_registeredSessions','user','fire','getUser','set','state','getUserSessions','_uniqueUsersCount','plugins','listenTo','_handleSessionRemove','remove','role','defineMe','unregister','delete','connected','forEach','has','_handleSessionAdd','size','channelConnectedUsers','sessions-unregister-not-exist','mySessionId','get','values','change:state','_createUser','add','_users','context','sessions-register-already-registered','channelSessions','getUserBySessionId','allConnectedUsers','register','addUser','connection','clear'];(function(_0x43aeff,_0x227083){const _0x25e879=function(_0x2b7c06){while(--_0x2b7c06){_0x43aeff['push'](_0x43aeff['shift']());}};_0x25e879(++_0x227083);}(_0x2270,0x180));const _0x25e8=function(_0x43aeff,_0x227083){_0x43aeff=_0x43aeff-0x0;let _0x25e879=_0x2270[_0x43aeff];return _0x25e879;};import{ContextPlugin as _0x5e497f}from'ckeditor5/src/core';import{Collection as _0x463cf0,CKEditorError as _0x554cb9}from'ckeditor5/src/utils';import _0x4cadf4 from'./websocketgateway';import{Users as _0x259ec5}from'ckeditor5-collaboration/src/collaboration-core';export default class r extends _0x5e497f{static get['pluginName'](){return'Sessions';}static get['requires'](){return[_0x4cadf4,_0x259ec5];}constructor(_0x2d09ca){super(_0x2d09ca),this[_0x25e8('0x26')]=new Map(),this[_0x25e8('0x1b')]=new Map(),this[_0x25e8('0x1')]=new _0x463cf0(),this['_registeredSessions']=new Map(),this[_0x25e8('0xd')]=0x0,this[_0x25e8('0x23')]=this[_0x25e8('0x24')]['plugins']['get'](_0x259ec5);}['init'](){const _0x2d9039=this[_0x25e8('0x24')][_0x25e8('0xe')][_0x25e8('0x1e')](_0x4cadf4);this[_0x25e8('0xf')](_0x2d9039,_0x25e8('0x20'),(_0x4cf349,_0x31f7d6,_0x3bb750)=>{if(_0x25e8('0x16')!==_0x3bb750)this[_0x25e8('0x26')][_0x25e8('0x17')](_0x223cb5=>_0x223cb5[_0x25e8('0x5')]()),this['channelConnectedUsers'][_0x25e8('0x17')](_0x985edd=>_0x985edd[_0x25e8('0x5')]()),this[_0x25e8('0x1')][_0x25e8('0x5')]();else for(const [_0x4a8d16,_0x14a9ee]of this[_0x25e8('0x6')])for(const _0x3c0df3 of _0x14a9ee)this['_handleSessionAdd'](_0x4a8d16,_0x3c0df3);}),this['_createUser'](_0x2d9039[_0x25e8('0x4')]['me'],!0x0);}[_0x25e8('0x2')](_0x353b5e,_0x33ae9a){if(this[_0x25e8('0x6')]['has'](_0x353b5e))throw new _0x554cb9(_0x25e8('0x25'),null,{'channelId':_0x353b5e});this[_0x25e8('0x6')][_0x25e8('0xa')](_0x353b5e,_0x33ae9a),this[_0x25e8('0x26')][_0x25e8('0xa')](_0x353b5e,new _0x463cf0()),this['channelConnectedUsers']['set'](_0x353b5e,new _0x463cf0()),this['listenTo'](_0x33ae9a,'add',(_0xc82d9d,_0x1b7198)=>this[_0x25e8('0x19')](_0x353b5e,_0x1b7198)),this[_0x25e8('0xf')](_0x33ae9a,'remove',(_0x44389f,_0x47a796)=>this['_handleSessionRemove'](_0x353b5e,_0x47a796));for(const _0x22b755 of _0x33ae9a)this['_handleSessionAdd'](_0x353b5e,_0x22b755);}[_0x25e8('0x14')](_0x4e18c7){if(!this[_0x25e8('0x6')][_0x25e8('0x18')](_0x4e18c7))throw new _0x554cb9(_0x25e8('0x1c'),null,{'channelId':_0x4e18c7});const _0x143e89=this[_0x25e8('0x6')][_0x25e8('0x1e')](_0x4e18c7);this['stopListening'](_0x143e89);for(const _0x3b9233 of _0x143e89)_0x25e8('0x16')===this[_0x25e8('0x24')][_0x25e8('0xe')][_0x25e8('0x1e')](_0x4cadf4)['state']&&this[_0x25e8('0x10')](_0x4e18c7,_0x3b9233);this[_0x25e8('0x6')][_0x25e8('0x15')](_0x4e18c7),this['channelSessions'][_0x25e8('0x15')](_0x4e18c7),this[_0x25e8('0x1b')][_0x25e8('0x15')](_0x4e18c7);}get[_0x25e8('0x1d')](){return this[_0x25e8('0x24')][_0x25e8('0xe')][_0x25e8('0x1e')](_0x4cadf4)[_0x25e8('0x4')]['sessionId'];}[_0x25e8('0x0')](_0x3bed2b){for(const _0x206c79 of this['channelSessions']['values']())for(const _0x24ff20 of _0x206c79)if(_0x24ff20['id']===_0x3bed2b)return _0x24ff20[_0x25e8('0x7')];}[_0x25e8('0xc')](_0x43da13,_0x4dbc98){const _0x2665a5=_0x4dbc98?[this['channelSessions']['get'](_0x4dbc98)]:this[_0x25e8('0x26')]['values'](),_0x4956a8=new Set();for(const _0x2a67a7 of _0x2665a5)for(const _0x3ce21a of _0x2a67a7)_0x3ce21a[_0x25e8('0x7')]['id']===_0x43da13['id']&&_0x4956a8[_0x25e8('0x22')](_0x3ce21a['id']);return _0x4956a8;}['getUserRole'](_0x206c52){for(const _0x157821 of this[_0x25e8('0x26')][_0x25e8('0x1f')]())for(const _0x50fa02 of _0x157821)if(_0x50fa02[_0x25e8('0x7')]===_0x206c52)return _0x50fa02[_0x25e8('0x12')];}[_0x25e8('0x19')](_0x45f5b8,_0x1c0414){if(_0x25e8('0x16')!==this[_0x25e8('0x24')]['plugins'][_0x25e8('0x1e')](_0x4cadf4)[_0x25e8('0xb')])return;const _0x5f1bf0=_0x1c0414['user'],_0x3fe18f=this[_0x25e8('0x23')][_0x25e8('0x9')](_0x5f1bf0['id'])||this[_0x25e8('0x21')](_0x5f1bf0),_0x12b449=Object['assign']({},_0x1c0414,{'user':_0x3fe18f});this[_0x25e8('0x26')][_0x25e8('0x1e')](_0x45f5b8)['add'](_0x12b449);const _0x31c11f=this[_0x25e8('0x1b')][_0x25e8('0x1e')](_0x45f5b8);_0x31c11f[_0x25e8('0x18')](_0x3fe18f['id'])||_0x31c11f[_0x25e8('0x22')](_0x3fe18f),this[_0x25e8('0x1')][_0x25e8('0x18')](_0x3fe18f['id'])||this['allConnectedUsers'][_0x25e8('0x22')](_0x3fe18f),this[_0x25e8('0x8')]('sessionAdd:'+_0x45f5b8,{'channelId':_0x45f5b8,'session':_0x12b449});}['_handleSessionRemove'](_0x4157c7,_0x4d79e){if('connected'!==this[_0x25e8('0x24')]['plugins'][_0x25e8('0x1e')](_0x4cadf4)[_0x25e8('0xb')])return;const _0x4740d2=this['channelConnectedUsers'][_0x25e8('0x1e')](_0x4157c7),_0x4af1d3=_0x4d79e[_0x25e8('0x7')];_0x4af1d3['id']&&(this[_0x25e8('0x26')][_0x25e8('0x1e')](_0x4157c7)[_0x25e8('0x11')](_0x4d79e['id']),_0x4740d2[_0x25e8('0x18')](_0x4af1d3['id'])&&!this[_0x25e8('0xc')](_0x4af1d3,_0x4157c7)[_0x25e8('0x1a')]&&_0x4740d2['remove'](_0x4af1d3['id']),this['allConnectedUsers'][_0x25e8('0x1e')](_0x4af1d3['id'])&&!this[_0x25e8('0xc')](_0x4af1d3)[_0x25e8('0x1a')]&&this[_0x25e8('0x1')][_0x25e8('0x11')](_0x4af1d3['id']));}[_0x25e8('0x21')](_0x3781ea,_0x46b5be){const _0x1d8e5d=this['_users'][_0x25e8('0x3')](_0x3781ea);return _0x46b5be&&this['_users'][_0x25e8('0x13')](_0x3781ea['id']),_0x1d8e5d['orderNumber']=this[_0x25e8('0xd')]++,_0x1d8e5d;}}
23
+ const _0x33d2=['register','init','channelSessions','_createUser','orderNumber','fire','_uniqueUsersCount','defineMe','getUserSessions','requires','allConnectedUsers','channelConnectedUsers','connection','_handleSessionRemove','sessions-register-already-registered','Sessions','unregister','set','forEach','change:state','remove','_users','add','listenTo','get','_handleSessionAdd','size','sessionId','clear','addUser','state','delete','context','getUser','values','_registeredSessions','role','has','plugins','getUserBySessionId','user','connected'];(function(_0x5e4cd6,_0x33d272){const _0x26972c=function(_0x18b9e7){while(--_0x18b9e7){_0x5e4cd6['push'](_0x5e4cd6['shift']());}};_0x26972c(++_0x33d272);}(_0x33d2,0x1f0));const _0x2697=function(_0x5e4cd6,_0x33d272){_0x5e4cd6=_0x5e4cd6-0x0;let _0x26972c=_0x33d2[_0x5e4cd6];return _0x26972c;};import{ContextPlugin as _0x3026e9}from'ckeditor5/src/core';import{Collection as _0x5b2637,CKEditorError as _0x3488d}from'ckeditor5/src/utils';import _0x5f4c4c from'./websocketgateway';import{Users as _0x4f55d9}from'ckeditor5-collaboration/src/collaboration-core';export default class r extends _0x3026e9{static get['pluginName'](){return _0x2697('0x17');}static get[_0x2697('0x11')](){return[_0x5f4c4c,_0x4f55d9];}constructor(_0x2b8da7){super(_0x2b8da7),this[_0x2697('0xa')]=new Map(),this[_0x2697('0x13')]=new Map(),this[_0x2697('0x12')]=new _0x5b2637(),this['_registeredSessions']=new Map(),this[_0x2697('0xe')]=0x0,this['_users']=this[_0x2697('0x28')]['plugins']['get'](_0x4f55d9);}[_0x2697('0x9')](){const _0x24f3a8=this[_0x2697('0x28')][_0x2697('0x4')]['get'](_0x5f4c4c);this['listenTo'](_0x24f3a8,_0x2697('0x1b'),(_0xa673c2,_0x17ad3b,_0x10e2dd)=>{if(_0x2697('0x7')!==_0x10e2dd)this[_0x2697('0xa')]['forEach'](_0x297f0d=>_0x297f0d[_0x2697('0x24')]()),this['channelConnectedUsers'][_0x2697('0x1a')](_0x1101b2=>_0x1101b2[_0x2697('0x24')]()),this[_0x2697('0x12')][_0x2697('0x24')]();else for(const [_0x2f482d,_0x2352b0]of this[_0x2697('0x1')])for(const _0x36f896 of _0x2352b0)this[_0x2697('0x21')](_0x2f482d,_0x36f896);}),this[_0x2697('0xb')](_0x24f3a8['connection']['me'],!0x0);}[_0x2697('0x8')](_0x1dab05,_0x1953af){if(this[_0x2697('0x1')][_0x2697('0x3')](_0x1dab05))throw new _0x3488d(_0x2697('0x16'),null,{'channelId':_0x1dab05});this[_0x2697('0x1')][_0x2697('0x19')](_0x1dab05,_0x1953af),this[_0x2697('0xa')][_0x2697('0x19')](_0x1dab05,new _0x5b2637()),this[_0x2697('0x13')][_0x2697('0x19')](_0x1dab05,new _0x5b2637()),this[_0x2697('0x1f')](_0x1953af,_0x2697('0x1e'),(_0x3b4232,_0x476960)=>this['_handleSessionAdd'](_0x1dab05,_0x476960)),this[_0x2697('0x1f')](_0x1953af,_0x2697('0x1c'),(_0xbe47a4,_0xf890a1)=>this['_handleSessionRemove'](_0x1dab05,_0xf890a1));for(const _0x4524ac of _0x1953af)this[_0x2697('0x21')](_0x1dab05,_0x4524ac);}[_0x2697('0x18')](_0x437130){if(!this[_0x2697('0x1')][_0x2697('0x3')](_0x437130))throw new _0x3488d('sessions-unregister-not-exist',null,{'channelId':_0x437130});const _0x5aa735=this[_0x2697('0x1')][_0x2697('0x20')](_0x437130);this['stopListening'](_0x5aa735);for(const _0x54f963 of _0x5aa735)_0x2697('0x7')===this[_0x2697('0x28')][_0x2697('0x4')]['get'](_0x5f4c4c)['state']&&this[_0x2697('0x15')](_0x437130,_0x54f963);this[_0x2697('0x1')][_0x2697('0x27')](_0x437130),this[_0x2697('0xa')][_0x2697('0x27')](_0x437130),this[_0x2697('0x13')][_0x2697('0x27')](_0x437130);}get['mySessionId'](){return this[_0x2697('0x28')][_0x2697('0x4')][_0x2697('0x20')](_0x5f4c4c)[_0x2697('0x14')][_0x2697('0x23')];}[_0x2697('0x5')](_0x48e872){for(const _0x4547ed of this[_0x2697('0xa')][_0x2697('0x0')]())for(const _0x2e4c67 of _0x4547ed)if(_0x2e4c67['id']===_0x48e872)return _0x2e4c67[_0x2697('0x6')];}[_0x2697('0x10')](_0x494b01,_0x4568e6){const _0x3d81f2=_0x4568e6?[this['channelSessions']['get'](_0x4568e6)]:this[_0x2697('0xa')][_0x2697('0x0')](),_0x2e064f=new Set();for(const _0x4ec92a of _0x3d81f2)for(const _0x123a55 of _0x4ec92a)_0x123a55[_0x2697('0x6')]['id']===_0x494b01['id']&&_0x2e064f[_0x2697('0x1e')](_0x123a55['id']);return _0x2e064f;}['getUserRole'](_0x5b159c){for(const _0x486cd8 of this[_0x2697('0xa')][_0x2697('0x0')]())for(const _0x382f63 of _0x486cd8)if(_0x382f63[_0x2697('0x6')]===_0x5b159c)return _0x382f63[_0x2697('0x2')];}['_handleSessionAdd'](_0x13f471,_0xa80543){if(_0x2697('0x7')!==this['context']['plugins'][_0x2697('0x20')](_0x5f4c4c)[_0x2697('0x26')])return;const _0x18fe95=_0xa80543[_0x2697('0x6')],_0x2b0a9a=this[_0x2697('0x1d')][_0x2697('0x29')](_0x18fe95['id'])||this[_0x2697('0xb')](_0x18fe95),_0x4d5b11=Object['assign']({},_0xa80543,{'user':_0x2b0a9a});this[_0x2697('0xa')][_0x2697('0x20')](_0x13f471)['add'](_0x4d5b11);const _0x3d6868=this[_0x2697('0x13')][_0x2697('0x20')](_0x13f471);_0x3d6868[_0x2697('0x3')](_0x2b0a9a['id'])||_0x3d6868['add'](_0x2b0a9a),this[_0x2697('0x12')][_0x2697('0x3')](_0x2b0a9a['id'])||this['allConnectedUsers'][_0x2697('0x1e')](_0x2b0a9a),this[_0x2697('0xd')]('sessionAdd:'+_0x13f471,{'channelId':_0x13f471,'session':_0x4d5b11});}['_handleSessionRemove'](_0x17f14e,_0xe117d3){if(_0x2697('0x7')!==this[_0x2697('0x28')][_0x2697('0x4')]['get'](_0x5f4c4c)[_0x2697('0x26')])return;const _0x5c84cd=this[_0x2697('0x13')][_0x2697('0x20')](_0x17f14e),_0xa14cbf=_0xe117d3[_0x2697('0x6')];_0xa14cbf['id']&&(this['channelSessions']['get'](_0x17f14e)[_0x2697('0x1c')](_0xe117d3['id']),_0x5c84cd[_0x2697('0x3')](_0xa14cbf['id'])&&!this['getUserSessions'](_0xa14cbf,_0x17f14e)[_0x2697('0x22')]&&_0x5c84cd[_0x2697('0x1c')](_0xa14cbf['id']),this[_0x2697('0x12')][_0x2697('0x20')](_0xa14cbf['id'])&&!this[_0x2697('0x10')](_0xa14cbf)[_0x2697('0x22')]&&this[_0x2697('0x12')][_0x2697('0x1c')](_0xa14cbf['id']));}[_0x2697('0xb')](_0x623eac,_0x201758){const _0x2acbc7=this[_0x2697('0x1d')][_0x2697('0x25')](_0x623eac);return _0x201758&&this[_0x2697('0x1d')][_0x2697('0xf')](_0x623eac['id']),_0x2acbc7[_0x2697('0xc')]=this[_0x2697('0xe')]++,_0x2acbc7;}}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  import { Plugin } from 'ckeditor5/src/core';
2
6
  import Sessions from './sessions';
3
7
  import '../../theme/usermarkers.css';
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5ce4=['requires','UserMarkers','$text','split','init','clear','getUserBySessionId','nodeAfter','model','parent','createRange','deletionPosition','view','change:range','data-session-id','_createdBatches','startsWith','getContainedElement','oldRange','editing','marker','document','$graveyard','type','orderNumber','fromRange','hasDomSelection','markerToElement','hasContent','removeMarker','user:','selection','conversion','enqueueChange','getAttribute','reconvertMarker','editor','change','start','mySessionId','set','user:position','ck-user__selection','isCollapsed','getPositions','end','root','afterInit','get','span','addMarker','getMarkerClass','editingDowncast','newRange','rootName','getStart','createUIElement','toRange','markers','schema','markerName','delete','getRange','getNearestSelectionRange','user:range','color','userPositionMarker','isInline','undo','getCustomProperty','updateMarker','plugins','highest','applyOperation','detach','has','user:range:','batch','isSimilar','user:position:','name','isObject','update:user:range'];(function(_0x103236,_0x5ce4fd){const _0x5af89d=function(_0x40f415){while(--_0x40f415){_0x103236['push'](_0x103236['shift']());}};_0x5af89d(++_0x5ce4fd);}(_0x5ce4,0xa8));const _0x5af8=function(_0x103236,_0x5ce4fd){_0x103236=_0x103236-0x0;let _0x5af89d=_0x5ce4[_0x103236];return _0x5af89d;};import{Plugin as _0x2a66e2}from'ckeditor5/src/core';import _0x1acddb from'./sessions';import{LiveRange as _0x550e49}from'ckeditor5/src/engine';import'../../theme/usermarkers.css';export default class j extends _0x2a66e2{static get[_0x5af8('0x51')](){return[_0x1acddb];}static get['pluginName'](){return _0x5af8('0x52');}[_0x5af8('0x2')](){const _0x14db17=this['editor'],_0x36b2e6=_0x14db17[_0x5af8('0x45')][_0x5af8('0x2e')](_0x1acddb);_0x14db17[_0x5af8('0x1e')]['for'](_0x5af8('0x32'))[_0x5af8('0x19')]({'model':_0x5af8('0x27'),'view':(_0x555d07,{writer:_0x1079b1})=>function(_0xf9e39c,_0x568e09,_0x2594a5,_0x2b1819){const _0x55be22=_0xf9e39c['markerName']['split'](':')[0x2],_0x242267=_0x2594a5[_0x5af8('0x4')](_0x55be22);if(!_0x242267||_0x55be22===_0x2594a5[_0x5af8('0x25')])return;if(!_0x2b1819[_0x5af8('0x6')][_0x5af8('0x39')]['checkChild'](_0xf9e39c['markerRange'][_0x5af8('0x24')],_0x5af8('0x0')))return;const _0x3506b3={'class':'ck-user__marker\x20'+_0x242267[_0x5af8('0x3f')][_0x5af8('0x31')](),'data-name':_0x242267[_0x5af8('0x4e')],'data-session-id':_0x55be22},_0x412413=_0x2b1819['model'][_0x5af8('0x38')][_0x5af8('0x2e')](_0xf9e39c[_0x5af8('0x3a')]),_0x46e184=_0x412413[_0x5af8('0x35')](),_0xcddf1=_0x46e184[_0x5af8('0x5')],_0x205f6a=_0x2b1819[_0x5af8('0x6')][_0x5af8('0x39')];if(_0xcddf1&&_0x205f6a[_0x5af8('0x4f')](_0xcddf1)&&_0x205f6a[_0x5af8('0x41')](_0xcddf1)&&!_0x2b1819[_0x5af8('0x6')][_0x5af8('0x38')][_0x5af8('0x2e')](_0x5af8('0x4a')+_0x55be22)[_0x5af8('0x3c')]()[_0x5af8('0x29')])return;const _0x31a8c2=_0x46e184[_0x5af8('0x7')];return _0x2b1819[_0x5af8('0x6')][_0x5af8('0x39')]['isLimit'](_0x31a8c2)&&!_0x2b1819[_0x5af8('0x6')][_0x5af8('0x1a')](_0x31a8c2)&&(_0x3506b3['contenteditable']=!0x1),function(_0x5ca1bb,_0x528202){const _0x5ba1f7=_0x5ca1bb[_0x5af8('0x36')](_0x5af8('0x2f'),_0x528202);return _0x5ca1bb['setCustomProperty'](_0x5af8('0x40'),!0x0,_0x5ba1f7),_0x5ba1f7['render']=function(_0x50d542){const _0x1a0aba=this['toDomElement'](_0x50d542);return _0x1a0aba['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>⁠',_0x1a0aba;},_0x5ba1f7[_0x5af8('0x4c')]=function(_0x292cab){return!(!this[_0x5af8('0x43')](_0x5af8('0x40'))||!_0x292cab[_0x5af8('0x43')](_0x5af8('0x40'))||this[_0x5af8('0x20')](_0x5af8('0xc'))!=_0x292cab['getAttribute'](_0x5af8('0xc')));},_0x5ba1f7;}(_0x568e09,_0x3506b3);}(_0x555d07,_0x1079b1,_0x36b2e6,_0x14db17)}),_0x14db17[_0x5af8('0x1e')]['for'](_0x5af8('0x32'))['markerToHighlight']({'model':_0x5af8('0x3e'),'view':_0x2a29f8=>function(_0x236388,_0x5342a9){const _0x598572=_0x236388[_0x5af8('0x3a')][_0x5af8('0x1')](':')[0x2];if(_0x598572===_0x5342a9[_0x5af8('0x25')])return null;const _0x240971=_0x5342a9[_0x5af8('0x4')](_0x598572);if(!_0x240971)return{'id':_0x598572,'classes':[]};return{'id':_0x598572,'classes':[_0x5af8('0x28'),_0x240971[_0x5af8('0x3f')]['getSelectionClass']()],'attributes':{'data-session-id':_0x598572},'priority':0x7d0+_0x240971[_0x5af8('0x16')]};}(_0x2a29f8,_0x36b2e6)}),function(_0x529b17){const _0x223f60=_0x529b17[_0x5af8('0x6')],_0x5a6746=new Map(),_0x24600f=_0x529b17[_0x5af8('0x45')]['get'](_0x1acddb);_0x223f60[_0x5af8('0x38')]['on'](_0x5af8('0x50'),(_0x1d543d,_0x17f127,_0x16777c,_0xd79a5)=>{if(!_0xd79a5&&_0x5a6746[_0x5af8('0x2e')](_0x17f127[_0x5af8('0x4e')]))return _0x5a6746[_0x5af8('0x2e')](_0x17f127[_0x5af8('0x4e')])[_0x5af8('0x48')](),void _0x5a6746[_0x5af8('0x3b')](_0x17f127['name']);const _0x245a3d=_0x17f127[_0x5af8('0x4e')][_0x5af8('0x1')](':')[0x2];if(_0x245a3d===_0x24600f[_0x5af8('0x25')])return;const _0x371e7e=_0x5af8('0x4d')+_0x245a3d;_0x223f60[_0x5af8('0x38')][_0x5af8('0x49')](_0x371e7e)&&_0x529b17['editing'][_0x5af8('0x21')](_0x371e7e),_0x17f127['on'](_0x5af8('0xb'),(_0x2a5b03,_0x4e7d06,_0xf2d878)=>{if(_0x5af8('0x14')!=_0x4e7d06[_0x5af8('0x2c')]['rootName']&&_0x5af8('0x14')==_0x17f127['getRange']()['root'][_0x5af8('0x34')]&&!_0x5a6746[_0x5af8('0x49')](_0x17f127['name'])){const _0x1df7a8=_0x223f60['schema'][_0x5af8('0x3d')](_0xf2d878[_0x5af8('0x9')]);if(_0x1df7a8){const _0x5b6006=_0x550e49[_0x5af8('0x17')](_0x1df7a8);_0x5a6746[_0x5af8('0x26')](_0x17f127[_0x5af8('0x4e')],_0x5b6006),_0x5b6006['on'](_0x5af8('0xb'),(_0x52ee8a,_0x256279,_0x1c802a)=>{if('$graveyard'==_0x5b6006[_0x5af8('0x2c')]['rootName']){const _0x275df9=_0x223f60['schema'][_0x5af8('0x3d')](_0x1c802a[_0x5af8('0x9')]);_0x275df9?(_0x5b6006[_0x5af8('0x24')]=_0x275df9[_0x5af8('0x24')],_0x5b6006[_0x5af8('0x2b')]=_0x275df9[_0x5af8('0x2b')]):(_0x5a6746[_0x5af8('0x3b')](_0x17f127[_0x5af8('0x4e')]),_0x5b6006['detach']());}});}}});}),_0x223f60[_0x5af8('0x13')]['on'](_0x5af8('0x23'),()=>{_0x5a6746['size']>0x0&&_0x223f60[_0x5af8('0x1f')]({'isUndoable':!0x1},_0x37cd5d=>{for(const [_0x13375c,_0x7d32f6]of _0x5a6746)_0x5af8('0x14')==_0x223f60['markers'][_0x5af8('0x2e')](_0x13375c)['getRange']()[_0x5af8('0x2c')]['rootName']&&(Y(_0x13375c[_0x5af8('0x1')](':')[0x2],_0x7d32f6[_0x5af8('0x37')](),_0x223f60,_0x37cd5d),_0x7d32f6[_0x5af8('0x48')]());_0x5a6746[_0x5af8('0x3')]();});});}(_0x14db17);}[_0x5af8('0x2d')](){const _0x85e6e3=this[_0x5af8('0x22')],_0x420a4f=_0x85e6e3['commands'][_0x5af8('0x2e')](_0x5af8('0x42'));_0x420a4f&&_0x85e6e3['model']['on'](_0x5af8('0x47'),(_0x39cef1,_0x13dcfc)=>{const _0x4ff08b=_0x13dcfc[0x0];if(_0x5af8('0x12')!=_0x4ff08b[_0x5af8('0x15')]||!_0x4ff08b[_0x5af8('0x4e')][_0x5af8('0xe')](_0x5af8('0x1c')))return;const _0x59c256=_0x4ff08b[_0x5af8('0x4b')];_0x420a4f[_0x5af8('0xd')][_0x5af8('0x49')](_0x59c256)&&(_0x4ff08b[_0x5af8('0x33')]=_0x4ff08b[_0x5af8('0x10')]?_0x85e6e3['model'][_0x5af8('0x8')](_0x4ff08b['oldRange']['start'],_0x4ff08b[_0x5af8('0x10')][_0x5af8('0x2b')]):null);},{'priority':_0x5af8('0x46')});}['createUserMarkerOperations'](){const _0x5b30f2=this['editor'],_0x5a43c1=_0x5b30f2[_0x5af8('0x6')][_0x5af8('0x13')],_0xc6b797=_0x5b30f2[_0x5af8('0x45')][_0x5af8('0x2e')](_0x1acddb);_0x5b30f2['model']['enqueueChange']({'isUndoable':!0x1},_0x241ee4=>{const _0x45b0bd=_0x5af8('0x4a')+_0xc6b797['mySessionId'],_0x269ab9=_0x5af8('0x4d')+_0xc6b797['mySessionId'],_0x46d2d7=_0x5b30f2[_0x5af8('0x6')][_0x5af8('0x38')][_0x5af8('0x49')](_0x45b0bd);_0x5b30f2[_0x5af8('0x11')][_0x5af8('0xa')][_0x5af8('0x18')]?Y(_0xc6b797['mySessionId'],_0x5a43c1[_0x5af8('0x1d')]['getFirstRange'](),_0x5b30f2['model'],_0x241ee4):_0x46d2d7&&(_0x241ee4[_0x5af8('0x1b')](_0x45b0bd),_0x241ee4['removeMarker'](_0x269ab9));});}}function Y(_0x4bd030,_0xbbd2f6,_0x249058,_0x445631){const _0x2f8300=_0x5af8('0x4a')+_0x4bd030,_0x57dcf8='user:position:'+_0x4bd030,_0xa5fd15=_0xbbd2f6[_0x5af8('0xf')]();let _0x40187b=_0xbbd2f6[_0x5af8('0x24')];_0xa5fd15&&_0xa5fd15['is']('element','tableCell')&&(_0x40187b=function(_0x2dd246,_0x527c31){for(const _0x3a8dcd of _0x2dd246[_0x5af8('0x2a')]())if(_0x527c31[_0x5af8('0x39')]['checkChild'](_0x3a8dcd,_0x5af8('0x0')))return _0x3a8dcd;}(_0xbbd2f6,_0x249058),_0xbbd2f6=_0x445631[_0x5af8('0x8')](_0x40187b));const _0x339221=_0x445631[_0x5af8('0x8')](_0x40187b);_0x249058[_0x5af8('0x38')][_0x5af8('0x49')](_0x2f8300)?(_0x445631[_0x5af8('0x44')](_0x2f8300,{'range':_0xbbd2f6}),_0x445631['updateMarker'](_0x57dcf8,{'range':_0x339221})):(_0x445631[_0x5af8('0x30')](_0x2f8300,{'range':_0xbbd2f6,'usingOperation':!0x0}),_0x445631[_0x5af8('0x30')](_0x57dcf8,{'range':_0x339221,'usingOperation':!0x0}));}
23
+ const _0x7a99=['plugins','createRange','editor','isSimilar','isLimit','updateMarker','getCustomProperty','_createdBatches','markers','checkChild','isCollapsed','render','detach','split','createUIElement','editingDowncast','root','color','start','reconvertMarker','user:position:','getUserBySessionId','end','editing','init','element','orderNumber','schema','hasContent','userPositionMarker','getNearestSelectionRange','getRange','undo','getContainedElement','type','addMarker','tableCell','newRange','commands','has','user:range:','get','removeMarker','innerHTML','getStart','markerToHighlight','for','mySessionId','ck-user__selection','user:position','data-session-id','$text','view','model','afterInit','name','marker','getMarkerClass','fromRange','change','getSelectionClass','getPositions','markerRange','selection','hasDomSelection','delete','highest','deletionPosition','UserMarkers','rootName','conversion','pluginName','nodeAfter','toDomElement','user:','⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>⁠','requires','$graveyard','oldRange','getAttribute','clear','parent','change:range','markerName','setCustomProperty'];(function(_0x2d2da0,_0x7a9991){const _0x422dda=function(_0x80358d){while(--_0x80358d){_0x2d2da0['push'](_0x2d2da0['shift']());}};_0x422dda(++_0x7a9991);}(_0x7a99,0x121));const _0x422d=function(_0x2d2da0,_0x7a9991){_0x2d2da0=_0x2d2da0-0x0;let _0x422dda=_0x7a99[_0x2d2da0];return _0x422dda;};import{Plugin as _0x138dc6}from'ckeditor5/src/core';import _0x1eef1d from'./sessions';import{LiveRange as _0x21aa34}from'ckeditor5/src/engine';import'../../theme/usermarkers.css';export default class j extends _0x138dc6{static get[_0x422d('0x2a')](){return[_0x1eef1d];}static get[_0x422d('0x25')](){return _0x422d('0x22');}[_0x422d('0x4b')](){const _0x501cfd=this[_0x422d('0x35')],_0x518dd1=_0x501cfd[_0x422d('0x33')][_0x422d('0x7')](_0x1eef1d);_0x501cfd[_0x422d('0x24')][_0x422d('0xc')]('editingDowncast')['markerToElement']({'model':_0x422d('0xf'),'view':(_0x195bf1,{writer:_0x14b73d})=>function(_0x2d95a4,_0x5dcdef,_0x2ce493,_0x511789){const _0x4f6b57=_0x2d95a4[_0x422d('0x31')][_0x422d('0x40')](':')[0x2],_0x36fa53=_0x2ce493['getUserBySessionId'](_0x4f6b57);if(!_0x36fa53||_0x4f6b57===_0x2ce493[_0x422d('0xd')])return;if(!_0x511789[_0x422d('0x13')]['schema']['checkChild'](_0x2d95a4[_0x422d('0x1c')][_0x422d('0x45')],_0x422d('0x11')))return;const _0x1c8393={'class':'ck-user__marker\x20'+_0x36fa53['color'][_0x422d('0x17')](),'data-name':_0x36fa53['name'],'data-session-id':_0x4f6b57},_0x15dca4=_0x511789[_0x422d('0x13')][_0x422d('0x3b')][_0x422d('0x7')](_0x2d95a4[_0x422d('0x31')]),_0x52ee81=_0x15dca4[_0x422d('0xa')](),_0x38e80a=_0x52ee81[_0x422d('0x26')],_0x4388e4=_0x511789[_0x422d('0x13')][_0x422d('0x4e')];if(_0x38e80a&&_0x4388e4['isObject'](_0x38e80a)&&_0x4388e4['isInline'](_0x38e80a)&&!_0x511789[_0x422d('0x13')][_0x422d('0x3b')][_0x422d('0x7')](_0x422d('0x6')+_0x4f6b57)[_0x422d('0x52')]()[_0x422d('0x3d')])return;const _0x189bd3=_0x52ee81[_0x422d('0x2f')];return _0x511789[_0x422d('0x13')][_0x422d('0x4e')][_0x422d('0x37')](_0x189bd3)&&!_0x511789[_0x422d('0x13')][_0x422d('0x4f')](_0x189bd3)&&(_0x1c8393['contenteditable']=!0x1),function(_0x39ac29,_0x5e80cf){const _0x4e8af0=_0x39ac29[_0x422d('0x41')]('span',_0x5e80cf);return _0x39ac29[_0x422d('0x32')](_0x422d('0x50'),!0x0,_0x4e8af0),_0x4e8af0[_0x422d('0x3e')]=function(_0x1afde7){const _0xb522e5=this[_0x422d('0x27')](_0x1afde7);return _0xb522e5[_0x422d('0x9')]=_0x422d('0x29'),_0xb522e5;},_0x4e8af0[_0x422d('0x36')]=function(_0x5f5881){return!(!this[_0x422d('0x39')]('userPositionMarker')||!_0x5f5881[_0x422d('0x39')](_0x422d('0x50'))||this[_0x422d('0x2d')](_0x422d('0x10'))!=_0x5f5881[_0x422d('0x2d')](_0x422d('0x10')));},_0x4e8af0;}(_0x5dcdef,_0x1c8393);}(_0x195bf1,_0x14b73d,_0x518dd1,_0x501cfd)}),_0x501cfd[_0x422d('0x24')][_0x422d('0xc')](_0x422d('0x42'))[_0x422d('0xb')]({'model':'user:range','view':_0x5a94a0=>function(_0x460d3e,_0x42091a){const _0x56a65f=_0x460d3e[_0x422d('0x31')]['split'](':')[0x2];if(_0x56a65f===_0x42091a[_0x422d('0xd')])return null;const _0x56b97c=_0x42091a[_0x422d('0x48')](_0x56a65f);if(!_0x56b97c)return{'id':_0x56a65f,'classes':[]};return{'id':_0x56a65f,'classes':[_0x422d('0xe'),_0x56b97c[_0x422d('0x44')][_0x422d('0x1a')]()],'attributes':{'data-session-id':_0x56a65f},'priority':0x7d0+_0x56b97c[_0x422d('0x4d')]};}(_0x5a94a0,_0x518dd1)}),function(_0x97af01){const _0x5a8b43=_0x97af01[_0x422d('0x13')],_0x107626=new Map(),_0x26e5a7=_0x97af01['plugins'][_0x422d('0x7')](_0x1eef1d);_0x5a8b43[_0x422d('0x3b')]['on']('update:user:range',(_0x15a1dd,_0x2e78ed,_0x17a27f,_0x43998e)=>{if(!_0x43998e&&_0x107626['get'](_0x2e78ed[_0x422d('0x15')]))return _0x107626[_0x422d('0x7')](_0x2e78ed[_0x422d('0x15')])[_0x422d('0x3f')](),void _0x107626[_0x422d('0x1f')](_0x2e78ed[_0x422d('0x15')]);const _0x1b5cf6=_0x2e78ed[_0x422d('0x15')][_0x422d('0x40')](':')[0x2];if(_0x1b5cf6===_0x26e5a7[_0x422d('0xd')])return;const _0x1abd96='user:position:'+_0x1b5cf6;_0x5a8b43[_0x422d('0x3b')][_0x422d('0x5')](_0x1abd96)&&_0x97af01[_0x422d('0x4a')][_0x422d('0x46')](_0x1abd96),_0x2e78ed['on'](_0x422d('0x30'),(_0x601bfd,_0xbed972,_0x1fc264)=>{if(_0x422d('0x2b')!=_0xbed972['root']['rootName']&&_0x422d('0x2b')==_0x2e78ed[_0x422d('0x52')]()['root']['rootName']&&!_0x107626['has'](_0x2e78ed['name'])){const _0x241c1e=_0x5a8b43['schema'][_0x422d('0x51')](_0x1fc264[_0x422d('0x21')]);if(_0x241c1e){const _0xbd27d0=_0x21aa34[_0x422d('0x18')](_0x241c1e);_0x107626['set'](_0x2e78ed[_0x422d('0x15')],_0xbd27d0),_0xbd27d0['on']('change:range',(_0x424649,_0x4aebeb,_0x30b547)=>{if(_0x422d('0x2b')==_0xbd27d0[_0x422d('0x43')][_0x422d('0x23')]){const _0x45fa8f=_0x5a8b43[_0x422d('0x4e')][_0x422d('0x51')](_0x30b547[_0x422d('0x21')]);_0x45fa8f?(_0xbd27d0[_0x422d('0x45')]=_0x45fa8f[_0x422d('0x45')],_0xbd27d0[_0x422d('0x49')]=_0x45fa8f[_0x422d('0x49')]):(_0x107626[_0x422d('0x1f')](_0x2e78ed[_0x422d('0x15')]),_0xbd27d0[_0x422d('0x3f')]());}});}}});}),_0x5a8b43['document']['on'](_0x422d('0x19'),()=>{_0x107626['size']>0x0&&_0x5a8b43['enqueueChange']({'isUndoable':!0x1},_0x12cd28=>{for(const [_0x483cf4,_0x162327]of _0x107626)_0x422d('0x2b')==_0x5a8b43['markers'][_0x422d('0x7')](_0x483cf4)[_0x422d('0x52')]()[_0x422d('0x43')][_0x422d('0x23')]&&(Y(_0x483cf4[_0x422d('0x40')](':')[0x2],_0x162327['toRange'](),_0x5a8b43,_0x12cd28),_0x162327[_0x422d('0x3f')]());_0x107626[_0x422d('0x2e')]();});});}(_0x501cfd);}[_0x422d('0x14')](){const _0x1e13e3=this[_0x422d('0x35')],_0x2351a0=_0x1e13e3[_0x422d('0x4')][_0x422d('0x7')](_0x422d('0x53'));_0x2351a0&&_0x1e13e3['model']['on']('applyOperation',(_0x6b56f5,_0x3ee48a)=>{const _0x5ba114=_0x3ee48a[0x0];if(_0x422d('0x16')!=_0x5ba114[_0x422d('0x0')]||!_0x5ba114[_0x422d('0x15')]['startsWith'](_0x422d('0x28')))return;const _0x27e1ec=_0x5ba114['batch'];_0x2351a0[_0x422d('0x3a')][_0x422d('0x5')](_0x27e1ec)&&(_0x5ba114[_0x422d('0x3')]=_0x5ba114['oldRange']?_0x1e13e3[_0x422d('0x13')][_0x422d('0x34')](_0x5ba114[_0x422d('0x2c')]['start'],_0x5ba114[_0x422d('0x2c')][_0x422d('0x49')]):null);},{'priority':_0x422d('0x20')});}['createUserMarkerOperations'](){const _0x29e542=this['editor'],_0x3959ae=_0x29e542[_0x422d('0x13')]['document'],_0x3ecf04=_0x29e542['plugins'][_0x422d('0x7')](_0x1eef1d);_0x29e542[_0x422d('0x13')]['enqueueChange']({'isUndoable':!0x1},_0x40aa89=>{const _0x2b59c0=_0x422d('0x6')+_0x3ecf04[_0x422d('0xd')],_0xfab3b9=_0x422d('0x47')+_0x3ecf04[_0x422d('0xd')],_0xa818b1=_0x29e542[_0x422d('0x13')][_0x422d('0x3b')]['has'](_0x2b59c0);_0x29e542['editing'][_0x422d('0x12')][_0x422d('0x1e')]?Y(_0x3ecf04[_0x422d('0xd')],_0x3959ae[_0x422d('0x1d')]['getFirstRange'](),_0x29e542[_0x422d('0x13')],_0x40aa89):_0xa818b1&&(_0x40aa89[_0x422d('0x8')](_0x2b59c0),_0x40aa89[_0x422d('0x8')](_0xfab3b9));});}}function Y(_0x3fb501,_0xa1ce33,_0x2730bd,_0xc6deb0){const _0x1a46c3=_0x422d('0x6')+_0x3fb501,_0x303988=_0x422d('0x47')+_0x3fb501,_0x3f961b=_0xa1ce33[_0x422d('0x54')]();let _0x5a9982=_0xa1ce33[_0x422d('0x45')];_0x3f961b&&_0x3f961b['is'](_0x422d('0x4c'),_0x422d('0x2'))&&(_0x5a9982=function(_0x2602fc,_0x435ea6){for(const _0x51cdb8 of _0x2602fc[_0x422d('0x1b')]())if(_0x435ea6[_0x422d('0x4e')][_0x422d('0x3c')](_0x51cdb8,'$text'))return _0x51cdb8;}(_0xa1ce33,_0x2730bd),_0xa1ce33=_0xc6deb0['createRange'](_0x5a9982));const _0x3c8261=_0xc6deb0[_0x422d('0x34')](_0x5a9982);_0x2730bd[_0x422d('0x3b')][_0x422d('0x5')](_0x1a46c3)?(_0xc6deb0[_0x422d('0x38')](_0x1a46c3,{'range':_0xa1ce33}),_0xc6deb0[_0x422d('0x38')](_0x303988,{'range':_0x3c8261})):(_0xc6deb0[_0x422d('0x1')](_0x1a46c3,{'range':_0xa1ce33,'usingOperation':!0x0}),_0xc6deb0[_0x422d('0x1')](_0x303988,{'range':_0x3c8261,'usingOperation':!0x0}));}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @module real-time-collaboration/realtimecollaborativeediting/websocketgateway
3
7
  * @publicApi
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2aff=['function','_reconnectionStack','context','create','_reconnect','cloudServices.connectionTimeout','webSocketUrl','isInReconnectionStack','reconnect','state','real-time-collaboration','add','stopListening','config','CONNECTING','limitExceeded','_isBrowserOffline','websocketgateway-plugin-already-registered','initialReconnectionInterval','error','disconnect','change:me','websocketgateway-invalid-plugin-interface','set','requires','_shouldPluginsReconnect','catch','_domEmitter','connect','cloudServices.requestTimeout','token','constructor','online','removeFromReconnectionStack','get','CONNECTED','connected','cloudservices-init','listenTo','WebSocketGateway','then','all','addToReconnectionStack','cloudservices-reconnection-error','DISCONNECTED','define','CloudServices','init','delete','connection','bind','plugins','showWarning','destroy','pluginName','websocketgateway-missing-websocket-url','offline','from'];(function(_0x5063e6,_0x2aff52){const _0x63ef18=function(_0xf8920f){while(--_0xf8920f){_0x5063e6['push'](_0x5063e6['shift']());}};_0x63ef18(++_0x2aff52);}(_0x2aff,0x1b6));const _0x63ef=function(_0x5063e6,_0x2aff52){_0x5063e6=_0x5063e6-0x0;let _0x63ef18=_0x2aff[_0x5063e6];return _0x63ef18;};import{ContextPlugin as _0x268506}from'ckeditor5/src/core';import{DomEmitterMixin as _0x5d1647,CKEditorError as _0x21941e}from'ckeditor5/src/utils';import{WebSocketGateway as _0x5f4684,WEB_SOCKET_GATEWAY_STATES as _0x22092f}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services';import{Notification as _0x15fc42}from'ckeditor5/src/ui';export default class c extends _0x268506{static get[_0x63ef('0x32')](){return[_0x63ef('0xe'),_0x15fc42];}static get[_0x63ef('0x16')](){return _0x63ef('0x7');}constructor(_0x4000f9){super(_0x4000f9),this[_0x63ef('0x31')](_0x63ef('0x23'),_0x22092f[_0x63ef('0x3')]),this['set'](_0x63ef('0x2a'),!0x1),this['_reconnectionStack']=new Set(),this[_0x63ef('0x33')]=!0x1,this[_0x63ef('0x35')]=Object[_0x63ef('0x1d')](_0x5d1647);}[_0x63ef('0xf')](){const _0x41a775=this[_0x63ef('0x1c')],_0x2e6072=_0x41a775['plugins'][_0x63ef('0x2')](_0x63ef('0xe')),_0x314381=_0x41a775[_0x63ef('0x13')][_0x63ef('0x2')](_0x15fc42);if(!_0x2e6072['token'])throw new _0x21941e('websocketgateway-missing-token',this);if(!_0x2e6072[_0x63ef('0x20')])throw new _0x21941e(_0x63ef('0x17'),this);return this['_domEmitter'][_0x63ef('0x6')](window,_0x63ef('0x18'),()=>this[_0x63ef('0x2a')]=!0x0),this[_0x63ef('0x35')][_0x63ef('0x6')](window,_0x63ef('0x0'),()=>this['_isBrowserOffline']=!0x1),this[_0x63ef('0x1c')][_0x63ef('0x27')][_0x63ef('0xd')](_0x63ef('0x1f'),0xa),this[_0x63ef('0x1c')][_0x63ef('0x27')][_0x63ef('0xd')](_0x63ef('0x37'),0x14),c['WebSocketGateway'][_0x63ef('0x36')](_0x2e6072[_0x63ef('0x38')],_0x2e6072[_0x63ef('0x20')],{'timeout':0x3e8*this[_0x63ef('0x1c')][_0x63ef('0x27')]['get'](_0x63ef('0x1f')),'requestTimeout':0x3e8*this['context'][_0x63ef('0x27')][_0x63ef('0x2')](_0x63ef('0x37'))})[_0x63ef('0x8')](_0x137ce0=>{if(this[_0x63ef('0x11')]=_0x137ce0,this[_0x63ef('0x12')](_0x63ef('0x23'))['to'](_0x137ce0,_0x63ef('0x23'),this,_0x63ef('0x2a'),(_0x4e873e,_0x796f38)=>(_0x63ef('0x4')!==_0x4e873e&&(this[_0x63ef('0x33')]=!0x0),_0x796f38||_0x4e873e!==_0x22092f[_0x63ef('0x3')]?_0x22092f[_0x63ef('0xc')]:this['state']==_0x22092f[_0x63ef('0xc')]&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this[_0x63ef('0x1e')](),_0x22092f[_0x63ef('0x28')]):_0x22092f['CONNECTED'])),this[_0x63ef('0x11')]['on']('error',(_0x425ddd,_0x5d249d)=>{if(_0x63ef('0x29')!==_0x5d249d['code'])throw console[_0x63ef('0x2d')](_0x5d249d),new _0x21941e(_0x63ef('0x5'),null,{'originalError':_0x5d249d});_0x314381[_0x63ef('0x14')]('The\x20limit\x20of\x20maximum\x20concurrent\x20connections\x20that\x20the\x20collaboration\x20server\x20can\x20handle\x20has\x20been\x20reached.\x20Try\x20opening\x20the\x20document\x20again\x20in\x20a\x20few\x20minutes.\x20Please\x20contact\x20your\x20system\x20administrator\x20if\x20the\x20problem\x20persists.',{'title':'Connected\x20users\x20limit\x20exceeded','namespace':_0x63ef('0x24')});}),!_0x137ce0['me'])return new Promise(_0x40a381=>_0x137ce0['on'](_0x63ef('0x2f'),_0x40a381));})['catch'](_0x3538e1=>{throw console['error'](_0x3538e1),new _0x21941e('cloudservices-init',null,{'originalError':_0x3538e1});});}[_0x63ef('0xa')](_0x2ee5a2){if(_0x63ef('0x1a')!=typeof _0x2ee5a2[_0x63ef('0x22')])throw new _0x21941e(_0x63ef('0x30'),this);if(this[_0x63ef('0x21')](_0x2ee5a2))throw new _0x21941e(_0x63ef('0x2b'),this,{'name':_0x2ee5a2[_0x63ef('0x39')][_0x63ef('0x16')]});this['_reconnectionStack'][_0x63ef('0x25')](_0x2ee5a2);}[_0x63ef('0x1')](_0x5b0ecd){this[_0x63ef('0x1b')][_0x63ef('0x10')](_0x5b0ecd);}['isInReconnectionStack'](_0x50edb8){return this[_0x63ef('0x1b')]['has'](_0x50edb8);}[_0x63ef('0x1e')](){return this['connection'][_0x63ef('0x22')]()['then'](()=>Promise[_0x63ef('0x9')](Array[_0x63ef('0x19')](this[_0x63ef('0x1b')],_0x3bfc19=>_0x3bfc19[_0x63ef('0x22')]())))[_0x63ef('0x8')](()=>this['state']=_0x22092f[_0x63ef('0x3')])[_0x63ef('0x34')](_0x4a9952=>{throw console[_0x63ef('0x2d')](_0x4a9952),new _0x21941e(_0x63ef('0xb'),this[_0x63ef('0x1c')]);});}[_0x63ef('0x15')](){this['connection']&&this[_0x63ef('0x11')][_0x63ef('0x2e')](),this[_0x63ef('0x23')]=_0x22092f[_0x63ef('0xc')],this[_0x63ef('0x35')][_0x63ef('0x26')](),super['destroy']();}}c[_0x63ef('0x7')]=_0x5f4684,c[_0x63ef('0x2c')]=0x3e8;
23
+ const _0x10f1=['_reconnectionStack','WebSocketGateway','then','all','context','change:me','get','addToReconnectionStack','init','stopListening','connect','CloudServices','listenTo','websocketgateway-plugin-already-registered','_shouldPluginsReconnect','disconnect','plugins','online','isInReconnectionStack','cloudServices.connectionTimeout','state','CONNECTED','_reconnect','limitExceeded','CONNECTING','token','config','requires','webSocketUrl','has','delete','reconnect','_isBrowserOffline','cloudservices-init','connection','function','The\x20limit\x20of\x20maximum\x20concurrent\x20connections\x20that\x20the\x20collaboration\x20server\x20can\x20handle\x20has\x20been\x20reached.\x20Try\x20opening\x20the\x20document\x20again\x20in\x20a\x20few\x20minutes.\x20Please\x20contact\x20your\x20system\x20administrator\x20if\x20the\x20problem\x20persists.','constructor','cloudServices.requestTimeout','from','showWarning','websocketgateway-missing-websocket-url','error','cloudservices-reconnection-error','destroy','add','websocketgateway-missing-token','pluginName','create','define','Connected\x20users\x20limit\x20exceeded','_domEmitter','catch','code','DISCONNECTED','set','initialReconnectionInterval'];(function(_0x2643a6,_0x10f177){const _0x359688=function(_0x23ee6c){while(--_0x23ee6c){_0x2643a6['push'](_0x2643a6['shift']());}};_0x359688(++_0x10f177);}(_0x10f1,0x104));const _0x3596=function(_0x2643a6,_0x10f177){_0x2643a6=_0x2643a6-0x0;let _0x359688=_0x10f1[_0x2643a6];return _0x359688;};import{ContextPlugin as _0x2bcefd}from'ckeditor5/src/core';import{DomEmitterMixin as _0x2324cc,CKEditorError as _0x835ef0}from'ckeditor5/src/utils';import{WebSocketGateway as _0x38d183,WEB_SOCKET_GATEWAY_STATES as _0x193dbf}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services';import{Notification as _0x3fd095}from'ckeditor5/src/ui';export default class c extends _0x2bcefd{static get[_0x3596('0x34')](){return[_0x3596('0x24'),_0x3fd095];}static get[_0x3596('0xf')](){return'WebSocketGateway';}constructor(_0x5a9f2e){super(_0x5a9f2e),this[_0x3596('0x17')](_0x3596('0x2d'),_0x193dbf[_0x3596('0x2e')]),this['set'](_0x3596('0x0'),!0x1),this[_0x3596('0x19')]=new Set(),this[_0x3596('0x27')]=!0x1,this['_domEmitter']=Object[_0x3596('0x10')](_0x2324cc);}[_0x3596('0x21')](){const _0x20caf1=this[_0x3596('0x1d')],_0x2952a5=_0x20caf1[_0x3596('0x29')][_0x3596('0x1f')](_0x3596('0x24')),_0x2e37a7=_0x20caf1['plugins'][_0x3596('0x1f')](_0x3fd095);if(!_0x2952a5['token'])throw new _0x835ef0(_0x3596('0xe'),this);if(!_0x2952a5[_0x3596('0x35')])throw new _0x835ef0(_0x3596('0x9'),this);return this[_0x3596('0x13')][_0x3596('0x25')](window,'offline',()=>this[_0x3596('0x0')]=!0x0),this[_0x3596('0x13')]['listenTo'](window,_0x3596('0x2a'),()=>this[_0x3596('0x0')]=!0x1),this['context']['config'][_0x3596('0x11')]('cloudServices.connectionTimeout',0xa),this[_0x3596('0x1d')]['config'][_0x3596('0x11')](_0x3596('0x6'),0x14),c[_0x3596('0x1a')][_0x3596('0x23')](_0x2952a5[_0x3596('0x32')],_0x2952a5['webSocketUrl'],{'timeout':0x3e8*this[_0x3596('0x1d')][_0x3596('0x33')][_0x3596('0x1f')](_0x3596('0x2c')),'requestTimeout':0x3e8*this[_0x3596('0x1d')][_0x3596('0x33')][_0x3596('0x1f')](_0x3596('0x6'))})['then'](_0x131371=>{if(this[_0x3596('0x2')]=_0x131371,this['bind'](_0x3596('0x2d'))['to'](_0x131371,_0x3596('0x2d'),this,_0x3596('0x0'),(_0x18719f,_0x27fa03)=>('connected'!==_0x18719f&&(this[_0x3596('0x27')]=!0x0),_0x27fa03||_0x18719f!==_0x193dbf[_0x3596('0x2e')]?_0x193dbf[_0x3596('0x16')]:this[_0x3596('0x2d')]==_0x193dbf[_0x3596('0x16')]&&this[_0x3596('0x27')]?(this[_0x3596('0x27')]=!0x1,this[_0x3596('0x2f')](),_0x193dbf[_0x3596('0x31')]):_0x193dbf[_0x3596('0x2e')])),this['connection']['on'](_0x3596('0xa'),(_0x491495,_0xe6634e)=>{if(_0x3596('0x30')!==_0xe6634e[_0x3596('0x15')])throw console['error'](_0xe6634e),new _0x835ef0(_0x3596('0x1'),null,{'originalError':_0xe6634e});_0x2e37a7[_0x3596('0x8')](_0x3596('0x4'),{'title':_0x3596('0x12'),'namespace':'real-time-collaboration'});}),!_0x131371['me'])return new Promise(_0x5992a1=>_0x131371['on'](_0x3596('0x1e'),_0x5992a1));})['catch'](_0x483be5=>{throw console['error'](_0x483be5),new _0x835ef0(_0x3596('0x1'),null,{'originalError':_0x483be5});});}[_0x3596('0x20')](_0x3338e9){if(_0x3596('0x3')!=typeof _0x3338e9[_0x3596('0x38')])throw new _0x835ef0('websocketgateway-invalid-plugin-interface',this);if(this[_0x3596('0x2b')](_0x3338e9))throw new _0x835ef0(_0x3596('0x26'),this,{'name':_0x3338e9[_0x3596('0x5')][_0x3596('0xf')]});this[_0x3596('0x19')][_0x3596('0xd')](_0x3338e9);}['removeFromReconnectionStack'](_0x5ba920){this['_reconnectionStack'][_0x3596('0x37')](_0x5ba920);}[_0x3596('0x2b')](_0x2ca033){return this[_0x3596('0x19')][_0x3596('0x36')](_0x2ca033);}['_reconnect'](){return this[_0x3596('0x2')][_0x3596('0x38')]()[_0x3596('0x1b')](()=>Promise[_0x3596('0x1c')](Array[_0x3596('0x7')](this[_0x3596('0x19')],_0x4cabe0=>_0x4cabe0[_0x3596('0x38')]())))[_0x3596('0x1b')](()=>this[_0x3596('0x2d')]=_0x193dbf[_0x3596('0x2e')])[_0x3596('0x14')](_0x210aab=>{throw console[_0x3596('0xa')](_0x210aab),new _0x835ef0(_0x3596('0xb'),this[_0x3596('0x1d')]);});}[_0x3596('0xc')](){this[_0x3596('0x2')]&&this[_0x3596('0x2')][_0x3596('0x28')](),this[_0x3596('0x2d')]=_0x193dbf[_0x3596('0x16')],this[_0x3596('0x13')][_0x3596('0x22')](),super[_0x3596('0xc')]();}}c[_0x3596('0x1a')]=_0x38d183,c[_0x3596('0x18')]=0x3e8;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @module real-time-collaboration/realtimecollaborativeediting
3
7
  * @publicApi
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- var _0x5a97=['pluginName','RealTimeCollaborativeEditing'];(function(_0x2df1fc,_0x5a977b){var _0x3ef16a=function(_0x49ab50){while(--_0x49ab50){_0x2df1fc['push'](_0x2df1fc['shift']());}};_0x3ef16a(++_0x5a977b);}(_0x5a97,0x125));var _0x3ef1=function(_0x2df1fc,_0x5a977b){_0x2df1fc=_0x2df1fc-0x0;var _0x3ef16a=_0x5a97[_0x2df1fc];return _0x3ef16a;};import{Plugin as _0x59b4cb}from'ckeditor5/src/core';import _0x26a18e from'./realtimecollaborativeediting/realtimecollaborationclient';export default class n extends _0x59b4cb{static get['requires'](){return[_0x26a18e];}static get[_0x3ef1('0x1')](){return _0x3ef1('0x0');}}
23
+ var _0x2864=['requires','pluginName','RealTimeCollaborativeEditing'];(function(_0x1f179e,_0x286492){var _0x23cc9e=function(_0x4c84be){while(--_0x4c84be){_0x1f179e['push'](_0x1f179e['shift']());}};_0x23cc9e(++_0x286492);}(_0x2864,0xe6));var _0x23cc=function(_0x1f179e,_0x286492){_0x1f179e=_0x1f179e-0x0;var _0x23cc9e=_0x2864[_0x1f179e];return _0x23cc9e;};import{Plugin as _0x5e0bfb}from'ckeditor5/src/core';import _0x61ac05 from'./realtimecollaborativeediting/realtimecollaborationclient';export default class n extends _0x5e0bfb{static get[_0x23cc('0x1')](){return[_0x61ac05];}static get[_0x23cc('0x2')](){return _0x23cc('0x0');}}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @module real-time-collaboration/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter
3
7
  * @publicApi
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x7b61=['buildRevisionData','marker','plugins','_handleRevisionsUpdate','revisionsUpdated','editor','connection','currentRevision','isBundleUploaded','serverHistory','addUser','repository','state','max','_getLatestVersionFromServerOperations','updateRevisions','isEnabled','reverse','cloud-services-internal-error:\x20Request\x20timeout.','init','get','_bufferedUpdates','connect','_fixRevision','_getLatestVersion','startsWith','_update','remove','diffData','addToReconnectionStack','getRevisions','addRevisionData','400','add','_waitForServiceReady','createdAt','_startingVersion','_revisionDataBuilder','toVersion','reInit','sessionId','setSource','setRevisionData','_revisions','_revisionHistoryService','_lastRequestId','_bufferUpdate','getRevision','connected','change:_isPendingUpdate','once','getOperations','bind','then','wrongRequestId','requires','_createCurrentRevision','_isPendingUpdate','reconnect','baseVersion','sendBufferedUpdates','_offset','_fetchMissingUsers','isEmptyCurrent','cloud-services-internal-error:\x20Not\x20connected.','creatorId','data','listenTo','isConnected','map','fromVersion','authorsIds','config','catch','message','change:_isConnected','getMany','off','getUser','_preventResendingRevisionData','length','_isConnected','_revisionTracker','RevisionTracker','affectsData','_oldOffset'];(function(_0x56dc8e,_0x7b6110){const _0x272156=function(_0x4bc61f){while(--_0x4bc61f){_0x56dc8e['push'](_0x56dc8e['shift']());}};_0x272156(++_0x7b6110);}(_0x7b61,0x7a));const _0x2721=function(_0x56dc8e,_0x7b6110){_0x56dc8e=_0x56dc8e-0x0;let _0x272156=_0x7b61[_0x56dc8e];return _0x272156;};import{Plugin as _0x282dff}from'ckeditor5/src/core';import{version as _0x21279e}from'ckeditor5/src/utils';import{Users as _0x4b27a5}from'ckeditor5-collaboration/src/collaboration-core';import _0xebc2e5 from'../realtimecollaborativeediting/realtimecollaborationclient';import _0x13e1f3 from'../realtimecollaborativeediting/websocketgateway';import _0x41d8bd from'../realtimecollaborativeediting/sessions';import{User as _0x1cb1e7}from'@ckeditor/ckeditor-cloud-services-collaboration';import{RevisionHistoryService as _0xe9febc,EditorService as _0x2acb12,WEB_SOCKET_GATEWAY_STATES as _0x2d757d}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services';export default class v extends _0x282dff{static get[_0x2721('0x13')](){return[_0x13e1f3,_0xebc2e5,'RevisionTracker',_0x41d8bd,_0x4b27a5];}constructor(_0x3dca9c){super(_0x3dca9c);const _0x25b427=this[_0x2721('0x37')][_0x2721('0x24')]['get']('collaboration.channelId');this[_0x2721('0x9')]=null,this[_0x2721('0x2e')]=this[_0x2721('0x37')][_0x2721('0x34')][_0x2721('0x46')](_0x2721('0x2f')),this[_0x2721('0x8')]=new v['RevisionHistoryService'](_0x25b427);}async[_0x2721('0x45')](){const _0x1846a7=this[_0x2721('0x37')][_0x2721('0x34')][_0x2721('0x46')](_0xebc2e5),_0x23f01b=_0x1846a7[_0x2721('0x3b')],_0x2cc0c9=this[_0x2721('0x37')][_0x2721('0x34')][_0x2721('0x46')](_0x13e1f3);this[_0x2721('0x2e')][_0x2721('0x5')]({'history':_0x23f01b,'getLatestVersion':()=>this[_0x2721('0x4a')](),'getCurrentRevisionId':()=>_0x1846a7[_0x2721('0x4')]});const _0x324026=this['editor']['config'][_0x2721('0x46')]('cloudServices.bundleVersion')||_0x21279e,_0x524091=await _0x2acb12[_0x2721('0x3a')](_0x2cc0c9[_0x2721('0x38')],_0x324026);this[_0x2721('0x2e')]['adapter']={'getRevision':async({revisionId:_0x4c2c1c})=>(await this[_0x2721('0x54')](),await this['_revisionHistoryService']['getRevision'](_0x4c2c1c)),'updateRevisions':async _0x15b90e=>{await this[_0x2721('0x54')]();const _0x4162c5=this['_revisionTracker'][_0x2721('0x39')];if(_0x524091&&0x1===_0x15b90e['length']&&_0x15b90e[0x0]['id']===_0x4162c5['id'])return _0x15b90e;for(const _0x181a20 of _0x15b90e)_0x181a20['id']===_0x4162c5['id']&&(_0x181a20[_0x2721('0x1b')]=_0x181a20[_0x2721('0x22')]===_0x181a20[_0x2721('0x2')]);return this['_revisionHistoryService'][_0x2721('0x41')](_0x15b90e,this[_0x2721('0x9')])[_0x2721('0x11')](_0x2724a1=>(this[_0x2721('0x9')]=_0x2724a1,_0x15b90e))[_0x2721('0x25')](_0x4cf4df=>{if(st(_0x4cf4df)||_0x2721('0x52')===_0x4cf4df['code']&&void 0x0!==_0x4cf4df[_0x2721('0x1e')][_0x2721('0x12')]){for(const _0x1e4cde of _0x15b90e){!this[_0x2721('0x2e')][_0x2721('0x3d')][_0x2721('0xb')](_0x1e4cde['id'])||this[_0x2721('0x2e')]['_bufferUpdate'](_0x1e4cde['id'],_0x1e4cde,!0x1);}if(st(_0x4cf4df))throw _0x4cf4df;return _0x15b90e;}throw _0x4cf4df;});}},this[_0x2721('0x1f')](this[_0x2721('0x8')],_0x2721('0x36'),(_0x54c5ec,{revisionsData:_0x152a77,requestId:_0x3484d7})=>{Math[_0x2721('0x3f')](..._0x152a77[_0x2721('0x21')](_0x1e4de3=>_0x1e4de3[_0x2721('0x2')]))>this['_getLatestVersionFromServerOperations']()-0x1?this[_0x2721('0x4a')]()[_0x2721('0x11')](()=>{this['_handleRevisionsUpdate'](_0x152a77,_0x3484d7);}):this['_handleRevisionsUpdate'](_0x152a77,_0x3484d7);});const {revisions:_0x16b499,requestId:_0x2b4a3b}=await this['_revisionHistoryService'][_0x2721('0x48')](_0x2cc0c9[_0x2721('0x38')]);_0x2cc0c9[_0x2721('0x4f')](this),this['_lastRequestId']=_0x2b4a3b,await this[_0x2721('0x1a')](_0x16b499);for(const _0x22e033 of _0x16b499)this[_0x2721('0x2e')][_0x2721('0x51')](_0x22e033);this['listenTo'](_0x1846a7,_0x2721('0x27'),(_0x51c6be,_0x4d7fcc,_0x46d5e8)=>{_0x46d5e8&&(this[_0x2721('0x31')]=_0x1846a7[_0x2721('0x19')],_0x51c6be['off']());}),this['_revisionTracker'][_0x2721('0x10')](_0x2721('0x42'))['to'](_0x2cc0c9,_0x2721('0x3e'),_0xb7fbb=>_0xb7fbb===_0x2d757d['CONNECTED']);}async[_0x2721('0x16')](){const _0x45aa19=this[_0x2721('0x37')]['plugins'][_0x2721('0x46')](_0x13e1f3),_0x503baa=this[_0x2721('0x37')][_0x2721('0x34')]['get'](_0xebc2e5),_0x14b200=async()=>{const _0x2e77b9=this[_0x2721('0x2e')][_0x2721('0x39')],_0x531fbc=_0x2e77b9['id'],_0x16b4b4=_0x531fbc!==_0x503baa[_0x2721('0x4')];if(_0x16b4b4){const _0x1a5535=_0x503baa[_0x2721('0x19')]-this[_0x2721('0x31')],_0x134a95=this['_getLatestVersionFromServerOperations']();this[_0x2721('0x2e')][_0x2721('0x1')][_0x2721('0x3')]();if(_0x2e77b9[_0x2721('0x2')]+_0x1a5535!==_0x134a95){const _0x19b38c=_0x2e77b9[_0x2721('0x22')]+_0x1a5535,_0x40dc67=this[_0x2721('0x37')][_0x2721('0x34')]['get'](_0x4b27a5),_0x4c3691=this['_revisionTracker'][_0x2721('0x32')]({'revision':_0x2e77b9,'from':_0x19b38c,'to':_0x134a95});_0x4c3691['id']=_0x2e77b9['id'];const _0x4245f3=_0x4c3691[_0x2721('0x23')]['map'](_0x3ab791=>_0x40dc67[_0x2721('0x2a')](_0x3ab791));_0x2e77b9[_0x2721('0x4c')]({..._0x4c3691,'authors':_0x4245f3},!0x0),this[_0x2721('0x2e')]['_bufferUpdate'](_0x2e77b9['id'],_0x4c3691,!0x0);}this['_revisionTracker'][_0x2721('0x0')]=_0x134a95,(_0x2e77b9[_0x2721('0x2')]===_0x2e77b9['fromVersion']&&!this[_0x2721('0x2e')][_0x2721('0x47')]['has'](_0x531fbc)&&this[_0x2721('0x2e')][_0x2721('0x3d')][_0x2721('0x7')][_0x2721('0x4d')](_0x531fbc),this[_0x2721('0x2e')][_0x2721('0x14')](_0x134a95));}const {revisions:_0x44aa1e,requestId:_0x2833ee}=await this[_0x2721('0x8')]['reconnect'](_0x45aa19[_0x2721('0x38')],this[_0x2721('0x9')]);_0x16b4b4&&_0x44aa1e['length']>0x0?_0x503baa['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x44aa1e),this[_0x2721('0x35')](_0x44aa1e,_0x2833ee),this[_0x2721('0x2e')][_0x2721('0x18')]());};return _0x503baa[_0x2721('0x2d')]?_0x14b200():new Promise((_0x85b76c,_0x517cdb)=>{_0x503baa['once'](_0x2721('0x27'),()=>{_0x14b200()['then'](_0x85b76c)['catch'](_0x517cdb);});});}['destroy'](){super['destroy']();}async[_0x2721('0x54')](){this['_revisionHistoryService'][_0x2721('0x20')]||await new Promise(_0x3cdbb7=>{this['listenTo'](this['_revisionHistoryService'],_0x2721('0xc'),_0x26b196=>{_0x26b196[_0x2721('0x29')](),_0x3cdbb7();});});}['_getLatestVersionFromServerOperations'](){const _0x241b18=this[_0x2721('0x37')][_0x2721('0x34')][_0x2721('0x46')](_0xebc2e5)[_0x2721('0x3b')][_0x2721('0xf')]()[_0x2721('0x43')]();for(const _0x1da418 of _0x241b18)if(_0x2721('0x33')!==_0x1da418['type']||_0x1da418[_0x2721('0x30')])return _0x1da418[_0x2721('0x17')]+0x1;}['_getLatestVersion'](){const _0x459792=this[_0x2721('0x37')][_0x2721('0x34')][_0x2721('0x46')](_0xebc2e5);return new Promise(_0x4216f3=>{_0x459792[_0x2721('0x15')]?_0x459792[_0x2721('0xe')](_0x2721('0xd'),()=>{_0x4216f3(this[_0x2721('0x40')]());}):_0x4216f3(this[_0x2721('0x40')]());});}[_0x2721('0x35')](_0x510638,_0x56d8f9){const _0x5671b9=this[_0x2721('0x2e')][_0x2721('0x3d')];this[_0x2721('0x9')]=_0x56d8f9;for(const _0xa46d42 of _0x510638){const _0x13730e=_0x5671b9[_0x2721('0xb')](_0xa46d42['id']);if(_0x13730e){if((_0xa46d42['fromVersion']||_0xa46d42[_0x2721('0x2')])&&(_0xa46d42[_0x2721('0x4e')]=null),_0x13730e===this['_revisionTracker'][_0x2721('0x39')]){const _0x543562=Math['max'](_0x13730e[_0x2721('0x2')],_0xa46d42[_0x2721('0x2')]),_0x24d527=Math[_0x2721('0x3f')](_0x13730e[_0x2721('0x22')],_0xa46d42[_0x2721('0x22')]);let _0x171cdf;_0x13730e[_0x2721('0x2')]===_0xa46d42['toVersion']&&_0x13730e[_0x2721('0x22')]===_0xa46d42[_0x2721('0x22')]?(_0x171cdf=!0x0,this[_0x2721('0x2b')](_0xa46d42)):_0xa46d42[_0x2721('0x2')]===_0x543562&&_0xa46d42['fromVersion']===_0x24d527?_0x171cdf=!0x1:(_0x13730e['toVersion']===_0x543562&&_0x13730e[_0x2721('0x22')]===_0x24d527||this[_0x2721('0x49')]({'revision':_0x13730e,'from':_0x24d527,'to':_0x543562}),_0x171cdf=!0x0),_0x171cdf&&(delete _0xa46d42[_0x2721('0x22')],delete _0xa46d42[_0x2721('0x2')],delete _0xa46d42[_0x2721('0x4e')],delete _0xa46d42[_0x2721('0x55')],delete _0xa46d42[_0x2721('0x23')]);}this['_revisionTracker'][_0x2721('0x6')](_0xa46d42),this[_0x2721('0x2b')](_0xa46d42);}else this['_revisionTracker'][_0x2721('0x51')](_0xa46d42);}const _0x2cec3b=_0x5671b9[_0x2721('0x50')]();_0x2cec3b[_0x2721('0x43')]();for(let _0x29979a=0x0;_0x29979a<_0x2cec3b[_0x2721('0x2c')]-0x1;_0x29979a++){const _0x1396c3=_0x2cec3b[_0x29979a],_0x46c881=_0x2cec3b[_0x29979a+0x1];if(_0x1396c3['fromVersion']<_0x46c881['toVersion']){const _0x3743b6=_0x46c881[_0x2721('0x2')],_0x3a6547=Math['max'](_0x3743b6,_0x1396c3[_0x2721('0x2')]);this['_fixRevision']({'revision':_0x1396c3,'from':_0x3743b6,'to':_0x3a6547});}}}[_0x2721('0x49')]({revision:_0x26b2b4,from:_0x38cd6f,to:_0x451ce7}={}){const _0x572611=this[_0x2721('0x37')][_0x2721('0x34')][_0x2721('0x46')](_0x4b27a5),_0x3691a0=this[_0x2721('0x2e')][_0x2721('0x32')]({'revision':_0x26b2b4,'from':_0x38cd6f,'to':_0x451ce7});_0x3691a0['authors']=_0x3691a0['authorsIds'][_0x2721('0x21')](_0x37409d=>_0x572611[_0x2721('0x2a')](_0x37409d)),_0x26b2b4['_update'](_0x3691a0);}[_0x2721('0x2b')](_0x4b6cc4){const _0x4c8e16={};_0x4c8e16['id']=_0x4b6cc4['id'];for(const _0x16959e of Object['keys'](_0x4b6cc4))'id'!==_0x16959e&&(_0x4c8e16[_0x16959e]=void 0x0);this['_revisionTracker'][_0x2721('0xa')](_0x4c8e16['id'],_0x4c8e16,!0x0);}async[_0x2721('0x1a')](_0x12cd6c){const _0x1c9e79=this[_0x2721('0x37')][_0x2721('0x34')][_0x2721('0x46')](_0x4b27a5),{connection:_0x562527}=this[_0x2721('0x37')][_0x2721('0x34')]['get'](_0x13e1f3),_0x5d11e8=new Set();for(const _0x5d0d00 of _0x12cd6c){for(const _0x410aa9 of _0x5d0d00[_0x2721('0x23')])_0x2957b6(_0x410aa9);_0x5d0d00[_0x2721('0x1d')]&&_0x2957b6(_0x5d0d00[_0x2721('0x1d')]);}if(0x0===_0x5d11e8['size'])return;const _0x175921=await _0x1cb1e7[_0x2721('0x28')](_0x562527,Array['from'](_0x5d11e8));for(const _0x2fc565 of _0x175921)_0x1c9e79[_0x2721('0x2a')](_0x2fc565['id'])||_0x1c9e79[_0x2721('0x3c')](_0x2fc565);function _0x2957b6(_0x39dece){_0x1c9e79[_0x2721('0x2a')](_0x39dece)||_0x5d11e8[_0x2721('0x53')](_0x39dece);}}}function st(_0x166bc4){return _0x166bc4[_0x2721('0x26')][_0x2721('0x4b')]('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x166bc4[_0x2721('0x26')][_0x2721('0x4b')](_0x2721('0x1c'))||_0x166bc4['message']['startsWith'](_0x2721('0x44'));}v['RevisionHistoryService']=_0xe9febc;
23
+ const _0x41cc=['_createCurrentRevision','_handleReconnectionError','_bufferUpdate','cloud-services-internal-error:\x20Not\x20connected.','_startingVersion','listenTo','_revisions','_preventResendingRevisionData','_bufferedUpdates','max','reverse','config','setRevisionData','length','code','getUser','requires','connection','addRevisionData','type','_fixRevision','off','data','getOperations','size','repository','_handleRevisionsUpdate','reInit','map','state','isEnabled','wrongRequestId','_lastRequestId','connected','cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.','sendBufferedUpdates','addUser','_fetchMissingUsers','_oldOffset','cloud-services-internal-error:\x20Request\x20timeout.','creatorId','_isPendingUpdate','_getLatestVersion','revisionsUpdated','authorsIds','_getLatestVersionFromServerOperations','connect','_waitForServiceReady','message','authors','_revisionHistoryService','then','createdAt','serverHistory','catch','add','diffData','setSource','RevisionTracker','sessionId','startsWith','getRevisions','keys','editor','fromVersion','change:_isConnected','destroy','isConnected','isEmptyCurrent','addToReconnectionStack','400','marker','_update','collaboration.channelId','_revisionDataBuilder','cloudServices.bundleVersion','currentRevision','getRevision','buildRevisionData','adapter','_revisionTracker','init','bind','baseVersion','get','toVersion','plugins','updateRevisions'];(function(_0x4a2d3d,_0x41cc67){const _0x1ee876=function(_0x49788e){while(--_0x49788e){_0x4a2d3d['push'](_0x4a2d3d['shift']());}};_0x1ee876(++_0x41cc67);}(_0x41cc,0x19b));const _0x1ee8=function(_0x4a2d3d,_0x41cc67){_0x4a2d3d=_0x4a2d3d-0x0;let _0x1ee876=_0x41cc[_0x4a2d3d];return _0x1ee876;};import{Plugin as _0x4421aa}from'ckeditor5/src/core';import{version as _0x37b887}from'ckeditor5/src/utils';import{Users as _0x3c0905}from'ckeditor5-collaboration/src/collaboration-core';import _0x184c45 from'../realtimecollaborativeediting/realtimecollaborationclient';import _0x16c509 from'../realtimecollaborativeediting/websocketgateway';import _0x160d73 from'../realtimecollaborativeediting/sessions';import{User as _0x42528e}from'@ckeditor/ckeditor-cloud-services-collaboration';import{RevisionHistoryService as _0x431396,EditorService as _0x516e37,WEB_SOCKET_GATEWAY_STATES as _0xc9b7c5}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services';export default class v extends _0x4421aa{static get[_0x1ee8('0x2d')](){return[_0x16c509,_0x184c45,'RevisionTracker',_0x160d73,_0x3c0905];}constructor(_0x326212){super(_0x326212);const _0x430242=this[_0x1ee8('0x4')][_0x1ee8('0x28')][_0x1ee8('0x19')](_0x1ee8('0xe'));this[_0x1ee8('0x3d')]=null,this['_revisionTracker']=this[_0x1ee8('0x4')]['plugins']['get'](_0x1ee8('0x57')),this[_0x1ee8('0x4f')]=new v['RevisionHistoryService'](_0x430242);}async[_0x1ee8('0x16')](){const _0x1f16da=this['editor'][_0x1ee8('0x1b')][_0x1ee8('0x19')](_0x184c45),_0x2e730f=_0x1f16da[_0x1ee8('0x52')],_0x3367f0=this[_0x1ee8('0x4')][_0x1ee8('0x1b')][_0x1ee8('0x19')](_0x16c509);this['_revisionTracker'][_0x1ee8('0x56')]({'history':_0x2e730f,'getLatestVersion':()=>this[_0x1ee8('0x47')](),'getCurrentRevisionId':()=>_0x1f16da[_0x1ee8('0x0')]});const _0xc2ba0=this['editor'][_0x1ee8('0x28')]['get'](_0x1ee8('0x10'))||_0x37b887,_0xd90488=await _0x516e37['isBundleUploaded'](_0x3367f0['connection'],_0xc2ba0);this[_0x1ee8('0x15')][_0x1ee8('0x14')]={'getRevision':async({revisionId:_0x462ede})=>(await this['_waitForServiceReady'](),await this[_0x1ee8('0x4f')][_0x1ee8('0x12')](_0x462ede)),'updateRevisions':async _0x454fe2=>{await this['_waitForServiceReady']();const _0x46a189=this[_0x1ee8('0x15')][_0x1ee8('0x11')];if(_0xd90488&&0x1===_0x454fe2['length']&&_0x454fe2[0x0]['id']===_0x46a189['id'])return _0x454fe2;for(const _0x7b5771 of _0x454fe2)_0x7b5771['id']===_0x46a189['id']&&(_0x7b5771[_0x1ee8('0x9')]=_0x7b5771[_0x1ee8('0x5')]===_0x7b5771[_0x1ee8('0x1a')]);return this['_revisionHistoryService'][_0x1ee8('0x1c')](_0x454fe2,this[_0x1ee8('0x3d')])[_0x1ee8('0x50')](_0x1e5168=>(this[_0x1ee8('0x3d')]=_0x1e5168,_0x454fe2))[_0x1ee8('0x53')](_0x33fc64=>{if(st(_0x33fc64)||_0x1ee8('0xb')===_0x33fc64[_0x1ee8('0x2b')]&&void 0x0!==_0x33fc64[_0x1ee8('0x33')][_0x1ee8('0x3c')]){for(const _0x4deef5 of _0x454fe2){!this[_0x1ee8('0x15')][_0x1ee8('0x36')][_0x1ee8('0x12')](_0x4deef5['id'])||this[_0x1ee8('0x15')][_0x1ee8('0x1f')](_0x4deef5['id'],_0x4deef5,!0x1);}if(st(_0x33fc64))throw _0x33fc64;return _0x454fe2;}throw _0x33fc64;});}},this[_0x1ee8('0x22')](this[_0x1ee8('0x4f')],_0x1ee8('0x48'),(_0xa98391,{revisionsData:_0x1265f3,requestId:_0x8199fe})=>{Math[_0x1ee8('0x26')](..._0x1265f3[_0x1ee8('0x39')](_0x4ffd2a=>_0x4ffd2a['toVersion']))>this[_0x1ee8('0x4a')]()-0x1?this[_0x1ee8('0x47')]()['then'](()=>{this[_0x1ee8('0x37')](_0x1265f3,_0x8199fe);}):this['_handleRevisionsUpdate'](_0x1265f3,_0x8199fe);});const {revisions:_0x8ea85b,requestId:_0x583b48}=await this[_0x1ee8('0x4f')][_0x1ee8('0x4b')](_0x3367f0[_0x1ee8('0x2e')]);_0x3367f0[_0x1ee8('0xa')](this),this[_0x1ee8('0x3d')]=_0x583b48,await this[_0x1ee8('0x42')](_0x8ea85b);for(const _0x10c408 of _0x8ea85b)this['_revisionTracker'][_0x1ee8('0x2f')](_0x10c408);this[_0x1ee8('0x22')](_0x1f16da,_0x1ee8('0x6'),(_0x3a2dc5,_0x2bcd0c,_0x385493)=>{_0x385493&&(this[_0x1ee8('0x43')]=_0x1f16da['_offset'],_0x3a2dc5[_0x1ee8('0x32')]());}),this[_0x1ee8('0x15')][_0x1ee8('0x17')](_0x1ee8('0x3b'))['to'](_0x3367f0,_0x1ee8('0x3a'),_0x2efb60=>_0x2efb60===_0xc9b7c5['CONNECTED']);}async['reconnect'](){const _0x4bc06f=this[_0x1ee8('0x4')][_0x1ee8('0x1b')]['get'](_0x16c509),_0x55d1b5=this['editor'][_0x1ee8('0x1b')][_0x1ee8('0x19')](_0x184c45),_0x59f4dc=async()=>{const _0x420e13=this[_0x1ee8('0x15')]['currentRevision'],_0x2e2349=_0x420e13['id'],_0xf4e51a=_0x2e2349!==_0x55d1b5['sessionId'];if(_0xf4e51a){const _0x469516=_0x55d1b5['_offset']-this[_0x1ee8('0x43')],_0x1d385d=this['_getLatestVersionFromServerOperations']();this[_0x1ee8('0x15')][_0x1ee8('0xf')][_0x1ee8('0x38')]();if(_0x420e13[_0x1ee8('0x1a')]+_0x469516!==_0x1d385d){const _0x1bd679=_0x420e13[_0x1ee8('0x5')]+_0x469516,_0x5e8b88=this['editor']['plugins'][_0x1ee8('0x19')](_0x3c0905),_0x199b80=this[_0x1ee8('0x15')][_0x1ee8('0x13')]({'revision':_0x420e13,'from':_0x1bd679,'to':_0x1d385d});_0x199b80['id']=_0x420e13['id'];const _0x4e0453=_0x199b80['authorsIds'][_0x1ee8('0x39')](_0x3aa742=>_0x5e8b88[_0x1ee8('0x2c')](_0x3aa742));_0x420e13[_0x1ee8('0xd')]({..._0x199b80,'authors':_0x4e0453},!0x0),this[_0x1ee8('0x15')][_0x1ee8('0x1f')](_0x420e13['id'],_0x199b80,!0x0);}this['_revisionTracker'][_0x1ee8('0x21')]=_0x1d385d,(_0x420e13[_0x1ee8('0x1a')]===_0x420e13['fromVersion']&&!this[_0x1ee8('0x15')][_0x1ee8('0x25')]['has'](_0x2e2349)&&this[_0x1ee8('0x15')][_0x1ee8('0x36')][_0x1ee8('0x23')]['remove'](_0x2e2349),this[_0x1ee8('0x15')][_0x1ee8('0x1d')](_0x1d385d));}const {revisions:_0x3af28f,requestId:_0x4bcfb7}=await this[_0x1ee8('0x4f')]['reconnect'](_0x4bc06f['connection'],this['_lastRequestId']);_0xf4e51a&&_0x3af28f[_0x1ee8('0x2a')]>0x0?_0x55d1b5[_0x1ee8('0x1e')]():(await this['_fetchMissingUsers'](_0x3af28f),this['_handleRevisionsUpdate'](_0x3af28f,_0x4bcfb7),this[_0x1ee8('0x15')][_0x1ee8('0x40')]());};return _0x55d1b5['_isConnected']?_0x59f4dc():new Promise((_0x22b7f5,_0x439e90)=>{_0x55d1b5['once'](_0x1ee8('0x6'),()=>{_0x59f4dc()[_0x1ee8('0x50')](_0x22b7f5)[_0x1ee8('0x53')](_0x439e90);});});}[_0x1ee8('0x7')](){super[_0x1ee8('0x7')]();}async[_0x1ee8('0x4c')](){this[_0x1ee8('0x4f')][_0x1ee8('0x8')]||await new Promise(_0x1210ae=>{this[_0x1ee8('0x22')](this[_0x1ee8('0x4f')],_0x1ee8('0x3e'),_0x253224=>{_0x253224[_0x1ee8('0x32')](),_0x1210ae();});});}['_getLatestVersionFromServerOperations'](){const _0x5731da=this[_0x1ee8('0x4')][_0x1ee8('0x1b')][_0x1ee8('0x19')](_0x184c45)[_0x1ee8('0x52')][_0x1ee8('0x34')]()[_0x1ee8('0x27')]();for(const _0x40b661 of _0x5731da)if(_0x1ee8('0xc')!==_0x40b661[_0x1ee8('0x30')]||_0x40b661['affectsData'])return _0x40b661[_0x1ee8('0x18')]+0x1;}['_getLatestVersion'](){const _0x1a8995=this['editor'][_0x1ee8('0x1b')][_0x1ee8('0x19')](_0x184c45);return new Promise(_0xc643eb=>{_0x1a8995[_0x1ee8('0x46')]?_0x1a8995['once']('change:_isPendingUpdate',()=>{_0xc643eb(this[_0x1ee8('0x4a')]());}):_0xc643eb(this[_0x1ee8('0x4a')]());});}[_0x1ee8('0x37')](_0x4b682f,_0x3941b9){const _0x1b7414=this[_0x1ee8('0x15')][_0x1ee8('0x36')];this[_0x1ee8('0x3d')]=_0x3941b9;for(const _0x5e7987 of _0x4b682f){const _0x504398=_0x1b7414[_0x1ee8('0x12')](_0x5e7987['id']);if(_0x504398){if((_0x5e7987[_0x1ee8('0x5')]||_0x5e7987[_0x1ee8('0x1a')])&&(_0x5e7987[_0x1ee8('0x55')]=null),_0x504398===this[_0x1ee8('0x15')][_0x1ee8('0x11')]){const _0x162712=Math[_0x1ee8('0x26')](_0x504398[_0x1ee8('0x1a')],_0x5e7987[_0x1ee8('0x1a')]),_0x469d47=Math['max'](_0x504398[_0x1ee8('0x5')],_0x5e7987[_0x1ee8('0x5')]);let _0x5bf2d7;_0x504398[_0x1ee8('0x1a')]===_0x5e7987[_0x1ee8('0x1a')]&&_0x504398['fromVersion']===_0x5e7987['fromVersion']?(_0x5bf2d7=!0x0,this[_0x1ee8('0x24')](_0x5e7987)):_0x5e7987[_0x1ee8('0x1a')]===_0x162712&&_0x5e7987['fromVersion']===_0x469d47?_0x5bf2d7=!0x1:(_0x504398[_0x1ee8('0x1a')]===_0x162712&&_0x504398[_0x1ee8('0x5')]===_0x469d47||this[_0x1ee8('0x31')]({'revision':_0x504398,'from':_0x469d47,'to':_0x162712}),_0x5bf2d7=!0x0),_0x5bf2d7&&(delete _0x5e7987[_0x1ee8('0x5')],delete _0x5e7987[_0x1ee8('0x1a')],delete _0x5e7987[_0x1ee8('0x55')],delete _0x5e7987[_0x1ee8('0x51')],delete _0x5e7987['authorsIds']);}this[_0x1ee8('0x15')][_0x1ee8('0x29')](_0x5e7987),this[_0x1ee8('0x24')](_0x5e7987);}else this[_0x1ee8('0x15')]['addRevisionData'](_0x5e7987);}const _0x1a446a=_0x1b7414[_0x1ee8('0x2')]();_0x1a446a[_0x1ee8('0x27')]();for(let _0x5cd3bd=0x0;_0x5cd3bd<_0x1a446a[_0x1ee8('0x2a')]-0x1;_0x5cd3bd++){const _0x329d84=_0x1a446a[_0x5cd3bd],_0x2f6a62=_0x1a446a[_0x5cd3bd+0x1];if(_0x329d84[_0x1ee8('0x5')]<_0x2f6a62[_0x1ee8('0x1a')]){const _0x5cb7d0=_0x2f6a62[_0x1ee8('0x1a')],_0x21c52a=Math[_0x1ee8('0x26')](_0x5cb7d0,_0x329d84[_0x1ee8('0x1a')]);this[_0x1ee8('0x31')]({'revision':_0x329d84,'from':_0x5cb7d0,'to':_0x21c52a});}}}[_0x1ee8('0x31')]({revision:_0x1b083a,from:_0xaaec96,to:_0x1b9d25}={}){const _0x31569c=this[_0x1ee8('0x4')][_0x1ee8('0x1b')][_0x1ee8('0x19')](_0x3c0905),_0x83fac1=this[_0x1ee8('0x15')][_0x1ee8('0x13')]({'revision':_0x1b083a,'from':_0xaaec96,'to':_0x1b9d25});_0x83fac1[_0x1ee8('0x4e')]=_0x83fac1[_0x1ee8('0x49')][_0x1ee8('0x39')](_0x897b18=>_0x31569c[_0x1ee8('0x2c')](_0x897b18)),_0x1b083a[_0x1ee8('0xd')](_0x83fac1);}['_preventResendingRevisionData'](_0x41a840){const _0x33f97d={};_0x33f97d['id']=_0x41a840['id'];for(const _0x1155a8 of Object[_0x1ee8('0x3')](_0x41a840))'id'!==_0x1155a8&&(_0x33f97d[_0x1155a8]=void 0x0);this[_0x1ee8('0x15')]['_bufferUpdate'](_0x33f97d['id'],_0x33f97d,!0x0);}async['_fetchMissingUsers'](_0x3e9324){const _0xbcb81d=this[_0x1ee8('0x4')][_0x1ee8('0x1b')]['get'](_0x3c0905),{connection:_0x176fa8}=this[_0x1ee8('0x4')][_0x1ee8('0x1b')][_0x1ee8('0x19')](_0x16c509),_0x2ea7af=new Set();for(const _0x150c7b of _0x3e9324){for(const _0x45d784 of _0x150c7b['authorsIds'])_0xbddc16(_0x45d784);_0x150c7b[_0x1ee8('0x45')]&&_0xbddc16(_0x150c7b['creatorId']);}if(0x0===_0x2ea7af[_0x1ee8('0x35')])return;const _0x321519=await _0x42528e['getMany'](_0x176fa8,Array['from'](_0x2ea7af));for(const _0xb2929c of _0x321519)_0xbcb81d[_0x1ee8('0x2c')](_0xb2929c['id'])||_0xbcb81d[_0x1ee8('0x41')](_0xb2929c);function _0xbddc16(_0x3ba77d){_0xbcb81d[_0x1ee8('0x2c')](_0x3ba77d)||_0x2ea7af[_0x1ee8('0x54')](_0x3ba77d);}}}function st(_0x5f3db2){return _0x5f3db2[_0x1ee8('0x4d')]['startsWith'](_0x1ee8('0x3f'))||_0x5f3db2[_0x1ee8('0x4d')][_0x1ee8('0x1')](_0x1ee8('0x20'))||_0x5f3db2['message']['startsWith'](_0x1ee8('0x44'));}v['RevisionHistoryService']=_0x431396;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @module real-time-collaboration/realtimecollaborativerevisionhistory
3
7
  * @publicApi