UNPKG

@ckeditor/ckeditor5-real-time-collaboration

Version:

A set of CKEditor 5 features enabling real-time collaboration within the editor using CKEditor Cloud Services.

23 lines 8.99 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ function _0x23bf(){const _0x48a7b8=['get','getUser','set','listenTo','sessions-unregister-not-exist','21971HWAknq','requires','plugins','sessionId','1694650BMnQuh','delete','state','42OVuNSC','Sessions','897165FMlLGl','remove','channelSessions','getUserBySessionId','_createUser','user','role','getUserSessions','values','connected','_registeredSessions','context','size','4BFSKWb','forEach','11wNYYQu','getUserRole','_users','fire','allConnectedUsers','stopListening','_uniqueUsersCount','1821948qBBYKe','sessions-register-already-registered','sessionAdd:','change:state','addUser','channelConnectedUsers','pluginName','orderNumber','isPremiumPlugin','82074MnJHfP','connection','_handleSessionAdd','_handleSessionRemove','unregister','mySessionId','init','1269569zDuuDM','8cJMmVU','27wzmBTG','3589890qJuLOo','register','assign','add','clear','isOfficialPlugin','isMe','defineMe','has','hiddenInPresenceList'];_0x23bf=function(){return _0x48a7b8;};return _0x23bf();}const _0x5e9961=_0x183e;(function(_0x5482e6,_0x55443e){const _0x21d7a3=_0x183e,_0x9e7cde=_0x5482e6();while(!![]){try{const _0x5a8c51=-parseInt(_0x21d7a3(0x1d1))/0x1*(-parseInt(_0x21d7a3(0x1d8))/0x2)+-parseInt(_0x21d7a3(0x1b8))/0x3+parseInt(_0x21d7a3(0x1e7))/0x4*(parseInt(_0x21d7a3(0x1da))/0x5)+parseInt(_0x21d7a3(0x1c2))/0x6+parseInt(_0x21d7a3(0x1bf))/0x7*(-parseInt(_0x21d7a3(0x1c0))/0x8)+parseInt(_0x21d7a3(0x1c1))/0x9*(-parseInt(_0x21d7a3(0x1d5))/0xa)+parseInt(_0x21d7a3(0x1e9))/0xb*(-parseInt(_0x21d7a3(0x1f0))/0xc);if(_0x5a8c51===_0x55443e)break;else _0x9e7cde['push'](_0x9e7cde['shift']());}catch(_0x118126){_0x9e7cde['push'](_0x9e7cde['shift']());}}}(_0x23bf,0x5a60e));import{ContextPlugin as _0x1ff861}from'ckeditor5/src/core.js';import{Collection as _0x9d80a7,CKEditorError as _0x1029eb}from'ckeditor5/src/utils.js';import{WebSocketGateway as _0x4ec331}from'./websocketgateway.js';function _0x183e(_0x2610c0,_0x2c2368){const _0x23bfb6=_0x23bf();return _0x183e=function(_0x183ee4,_0x234c2b){_0x183ee4=_0x183ee4-0x1b8;let _0x3990f9=_0x23bfb6[_0x183ee4];return _0x3990f9;},_0x183e(_0x2610c0,_0x2c2368);}import{Users as _0x37163d}from'ckeditor5-collaboration/src/collaboration-core.js';export class Sessions extends _0x1ff861{[_0x5e9961(0x1dc)];[_0x5e9961(0x1f5)];[_0x5e9961(0x1ed)];[_0x5e9961(0x1e4)];[_0x5e9961(0x1ef)];[_0x5e9961(0x1eb)];static get[_0x5e9961(0x1f6)](){const _0x4852d9=_0x5e9961;return _0x4852d9(0x1d9);}static get[_0x5e9961(0x1c7)](){return!0x0;}static get[_0x5e9961(0x1f8)](){return!0x0;}static get[_0x5e9961(0x1d2)](){return[_0x4ec331,_0x37163d];}constructor(_0xf4e0e5){const _0x41c53d=_0x5e9961;super(_0xf4e0e5),this[_0x41c53d(0x1dc)]=new Map(),this[_0x41c53d(0x1f5)]=new Map(),this[_0x41c53d(0x1ed)]=new _0x9d80a7(),this[_0x41c53d(0x1e4)]=new Map(),this[_0x41c53d(0x1ef)]=0x0,this[_0x41c53d(0x1eb)]=this[_0x41c53d(0x1e5)][_0x41c53d(0x1d3)][_0x41c53d(0x1cc)](_0x37163d);}[_0x5e9961(0x1be)](){const _0x54291b=_0x5e9961,_0x3ab987=this[_0x54291b(0x1e5)][_0x54291b(0x1d3)][_0x54291b(0x1cc)](_0x4ec331);this[_0x54291b(0x1cf)](_0x3ab987,_0x54291b(0x1f3),(_0x11e05c,_0x3a0059,_0x11a693)=>{const _0xca3ffc=_0x54291b;if(_0xca3ffc(0x1e3)!==_0x11a693)this[_0xca3ffc(0x1dc)][_0xca3ffc(0x1e8)](_0xb567b2=>_0xb567b2[_0xca3ffc(0x1c6)]()),this[_0xca3ffc(0x1f5)][_0xca3ffc(0x1e8)](_0x59ef29=>_0x59ef29[_0xca3ffc(0x1c6)]()),this[_0xca3ffc(0x1ed)][_0xca3ffc(0x1c6)]();else{for(const [_0x8f44aa,_0x4aa5e3]of this[_0xca3ffc(0x1e4)])for(const _0x2d041c of _0x4aa5e3)this[_0xca3ffc(0x1ba)](_0x8f44aa,_0x2d041c);}}),this[_0x54291b(0x1de)](_0x3ab987[_0x54291b(0x1b9)]['me'],!0x0);}[_0x5e9961(0x1c3)](_0x243ec9,_0x58fb4a){const _0x46c8fd=_0x5e9961;if(this[_0x46c8fd(0x1e4)][_0x46c8fd(0x1ca)](_0x243ec9))throw new _0x1029eb(_0x46c8fd(0x1f1),null,{'channelId':_0x243ec9});this[_0x46c8fd(0x1e4)][_0x46c8fd(0x1ce)](_0x243ec9,_0x58fb4a),this[_0x46c8fd(0x1dc)][_0x46c8fd(0x1ce)](_0x243ec9,new _0x9d80a7()),this[_0x46c8fd(0x1f5)][_0x46c8fd(0x1ce)](_0x243ec9,new _0x9d80a7()),this[_0x46c8fd(0x1cf)](_0x58fb4a,_0x46c8fd(0x1c5),(_0x5d63ca,_0xd0ebef)=>this[_0x46c8fd(0x1ba)](_0x243ec9,_0xd0ebef)),this[_0x46c8fd(0x1cf)](_0x58fb4a,_0x46c8fd(0x1db),(_0x4ffede,_0x456546)=>this[_0x46c8fd(0x1bb)](_0x243ec9,_0x456546));for(const _0x3c8fc9 of _0x58fb4a)this[_0x46c8fd(0x1ba)](_0x243ec9,_0x3c8fc9);}[_0x5e9961(0x1bc)](_0x4bd5de){const _0x3b8ce1=_0x5e9961;if(!this[_0x3b8ce1(0x1e4)][_0x3b8ce1(0x1ca)](_0x4bd5de))throw new _0x1029eb(_0x3b8ce1(0x1d0),null,{'channelId':_0x4bd5de});const _0x154a56=this[_0x3b8ce1(0x1e4)][_0x3b8ce1(0x1cc)](_0x4bd5de);this[_0x3b8ce1(0x1ee)](_0x154a56);for(const _0x33352d of _0x154a56)_0x3b8ce1(0x1e3)===this[_0x3b8ce1(0x1e5)][_0x3b8ce1(0x1d3)][_0x3b8ce1(0x1cc)](_0x4ec331)[_0x3b8ce1(0x1d7)]&&this[_0x3b8ce1(0x1bb)](_0x4bd5de,_0x33352d);this[_0x3b8ce1(0x1e4)][_0x3b8ce1(0x1d6)](_0x4bd5de),this[_0x3b8ce1(0x1dc)][_0x3b8ce1(0x1d6)](_0x4bd5de),this[_0x3b8ce1(0x1f5)][_0x3b8ce1(0x1d6)](_0x4bd5de);}get[_0x5e9961(0x1bd)](){const _0x1229a1=_0x5e9961;return this[_0x1229a1(0x1e5)][_0x1229a1(0x1d3)][_0x1229a1(0x1cc)](_0x4ec331)[_0x1229a1(0x1b9)][_0x1229a1(0x1d4)];}[_0x5e9961(0x1dd)](_0x4f6e68){const _0x364d9a=_0x5e9961;for(const _0x2869cb of this[_0x364d9a(0x1dc)][_0x364d9a(0x1e2)]())for(const _0x49bac8 of _0x2869cb)if(_0x49bac8['id']===_0x4f6e68)return _0x49bac8[_0x364d9a(0x1df)];}[_0x5e9961(0x1e1)](_0x29d769,_0x58fe78){const _0x281981=_0x5e9961,_0x8cd440=_0x58fe78?[this[_0x281981(0x1dc)][_0x281981(0x1cc)](_0x58fe78)]:this[_0x281981(0x1dc)][_0x281981(0x1e2)](),_0x16fda4=new Set();for(const _0x4c76a2 of _0x8cd440)for(const _0x10de69 of _0x4c76a2)_0x10de69[_0x281981(0x1df)]['id']===_0x29d769['id']&&_0x16fda4[_0x281981(0x1c5)](_0x10de69['id']);return _0x16fda4;}[_0x5e9961(0x1ea)](_0x272d2c){const _0x3ca505=_0x5e9961;for(const _0x84f86d of this[_0x3ca505(0x1dc)][_0x3ca505(0x1e2)]())for(const _0x2fa8ed of _0x84f86d)if(_0x2fa8ed[_0x3ca505(0x1df)]===_0x272d2c)return _0x2fa8ed[_0x3ca505(0x1e0)];}[_0x5e9961(0x1ba)](_0xb3c266,_0x3f421b){const _0x44ef62=_0x5e9961;if(_0x44ef62(0x1e3)!==this[_0x44ef62(0x1e5)][_0x44ef62(0x1d3)][_0x44ef62(0x1cc)](_0x4ec331)[_0x44ef62(0x1d7)])return;const _0x1ca411=_0x3f421b[_0x44ef62(0x1df)],_0xe05c80=this[_0x44ef62(0x1eb)][_0x44ef62(0x1cd)](_0x1ca411['id'])||this[_0x44ef62(0x1de)](_0x1ca411),_0x2e2523=Object[_0x44ef62(0x1c4)]({},_0x3f421b,{'user':_0xe05c80});if(this[_0x44ef62(0x1dc)][_0x44ef62(0x1cc)](_0xb3c266)[_0x44ef62(0x1c5)](_0x2e2523),!_0x1ca411[_0x44ef62(0x1cb)]){const _0x2cef3c=this[_0x44ef62(0x1f5)][_0x44ef62(0x1cc)](_0xb3c266);_0x2cef3c[_0x44ef62(0x1ca)](_0xe05c80['id'])||_0x2cef3c[_0x44ef62(0x1c5)](_0xe05c80),this[_0x44ef62(0x1ed)][_0x44ef62(0x1ca)](_0xe05c80['id'])||_0x1ca411[_0x44ef62(0x1cb)]||this[_0x44ef62(0x1ed)][_0x44ef62(0x1c5)](_0xe05c80,_0xe05c80[_0x44ef62(0x1c8)]?0x0:void 0x0);}this[_0x44ef62(0x1ec)](_0x44ef62(0x1f2)+_0xb3c266,{'channelId':_0xb3c266,'session':_0x2e2523});}[_0x5e9961(0x1bb)](_0x1f3fe2,_0x379cdf){const _0x4d7839=_0x5e9961;if(_0x4d7839(0x1e3)!==this[_0x4d7839(0x1e5)][_0x4d7839(0x1d3)][_0x4d7839(0x1cc)](_0x4ec331)[_0x4d7839(0x1d7)])return;const _0x90fe39=this[_0x4d7839(0x1f5)][_0x4d7839(0x1cc)](_0x1f3fe2),_0x95be84=_0x379cdf[_0x4d7839(0x1df)];_0x95be84['id']&&(this[_0x4d7839(0x1dc)][_0x4d7839(0x1cc)](_0x1f3fe2)[_0x4d7839(0x1db)](_0x379cdf['id']),_0x90fe39[_0x4d7839(0x1ca)](_0x95be84['id'])&&!this[_0x4d7839(0x1e1)](_0x95be84,_0x1f3fe2)[_0x4d7839(0x1e6)]&&_0x90fe39[_0x4d7839(0x1db)](_0x95be84['id']),this[_0x4d7839(0x1ed)][_0x4d7839(0x1cc)](_0x95be84['id'])&&!this[_0x4d7839(0x1e1)](_0x95be84)[_0x4d7839(0x1e6)]&&this[_0x4d7839(0x1ed)][_0x4d7839(0x1db)](_0x95be84['id']));}[_0x5e9961(0x1de)](_0x26667a,_0x37f219){const _0x51d249=_0x5e9961,_0x3a2912=this[_0x51d249(0x1eb)][_0x51d249(0x1f4)](_0x26667a);return _0x37f219&&this[_0x51d249(0x1eb)][_0x51d249(0x1c9)](_0x26667a['id']),_0x3a2912[_0x51d249(0x1f7)]=this[_0x51d249(0x1ef)]++,_0x3a2912;}}