UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines • 13.3 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. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x4378ae=_0x471d;(function(_0x4c822f,_0x47d828){const _0x4f1329=_0x471d,_0x11e589=_0x4c822f();while(!![]){try{const _0x3c3716=parseInt(_0x4f1329(0x1c1))/0x1+parseInt(_0x4f1329(0x1cd))/0x2*(parseInt(_0x4f1329(0x1d3))/0x3)+parseInt(_0x4f1329(0x1ba))/0x4*(-parseInt(_0x4f1329(0x1cf))/0x5)+-parseInt(_0x4f1329(0x1a2))/0x6*(-parseInt(_0x4f1329(0x18d))/0x7)+-parseInt(_0x4f1329(0x1a1))/0x8*(parseInt(_0x4f1329(0x1ae))/0x9)+-parseInt(_0x4f1329(0x1cb))/0xa*(-parseInt(_0x4f1329(0x18b))/0xb)+-parseInt(_0x4f1329(0x18a))/0xc*(parseInt(_0x4f1329(0x1a9))/0xd);if(_0x3c3716===_0x47d828)break;else _0x11e589['push'](_0x11e589['shift']());}catch(_0x4e4fe5){_0x11e589['push'](_0x11e589['shift']());}}}(_0xbdb5,0x29a0c));import{ContextPlugin as _0x3d8209}from'ckeditor5/src/core.js';import{Rect as _0x562a93,CKEditorError as _0x3a2a3f}from'ckeditor5/src/utils.js';function _0xbdb5(){const _0x340200=['getIndex','destroy','setContainer','appendChild','length','element','change:_lastItem','list','bottom','clear','context','960xOtOkj','44NZxXiz','_attachToContainer','917QZhzWo','sidebar.container','_alignForBottomChange','view','_destroySidebarItemView','_alignToTargetRect','_spaceBetweenItems','sidebar-setcontainer-invalid-element','_recalculateBuffer','nodeType','_alignBeforeItem','_getItemBefore','get','_getTargetTop','_updateLastItem','render','_lastItem','getSidebarItemView','_alignForTopChange','set','39088XqJVJV','6690LufipF','stopListening','listenTo','class','last','_activeAnnotation','minHeight','53027wnwrGO','bind','_getMaxAvailableTop','unbind','max','450wqXGzW','addAnnotation','_recalculate','sidebar-attachtocontainer-missing-container','add','_annotationToSidebarItemView','_targetTop','container','isActive','_sidebarItemViewToAnnotation','define','isOfficialPlugin','8ZNJzaT','target','_createSidebarView','_getItemAfter','Sidebar','change:targetRect','targetRect','329639oAUevB','_annotations','refresh','updateHeight','content','pluginName','config','_alignAfterItem','push','isAnimationDisabled','362470RpxwCO','top','4EHnSjp','change:bottom','178670QUypwu','height','remove','init','287856aJAPQK','change:top','isPremiumPlugin','delete','_setItemTop','sidebar.preventScrollOutOfView','rearrange','object','_detachFromContainer','locale'];_0xbdb5=function(){return _0x340200;};return _0xbdb5();}import _0x4bc99e from'./view/sidebarview.js';import _0x498cc2 from'./view/sidebaritemview.js';function _0x471d(_0x2324e1,_0x1256cb){const _0xbdb53=_0xbdb5();return _0x471d=function(_0x471dc9,_0x1b2be3){_0x471dc9=_0x471dc9-0x182;let _0x20857d=_0xbdb53[_0x471dc9];return _0x20857d;},_0x471d(_0x2324e1,_0x1256cb);}export default class z extends _0x3d8209{static get[_0x4378ae(0x1c6)](){const _0x48c9f0=_0x4378ae;return _0x48c9f0(0x1be);}static get[_0x4378ae(0x1b9)](){return!0x0;}static get[_0x4378ae(0x1d5)](){return!0x0;}constructor(_0x5c0bfd){const _0x22c519=_0x4378ae;super(_0x5c0bfd),this[_0x22c519(0x1a0)](_0x22c519(0x19d),void 0x0),this[_0x22c519(0x190)]=this[_0x22c519(0x1bc)](),this[_0x22c519(0x1a0)](_0x22c519(0x1b5),null),this[_0x22c519(0x193)]=0x19,this[_0x22c519(0x1b7)]=new Map(),this[_0x22c519(0x1b3)]=new Map(),this[_0x22c519(0x189)][_0x22c519(0x1c7)][_0x22c519(0x1b8)](_0x22c519(0x1d8),!0x1),this[_0x22c519(0x1c2)]=null,this[_0x22c519(0x1a7)]=null,this[_0x22c519(0x195)]=[];}[_0x4378ae(0x1d2)](){const _0x541dc0=_0x4378ae,_0x5c0bc2=this[_0x541dc0(0x189)][_0x541dc0(0x1c7)][_0x541dc0(0x199)](_0x541dc0(0x18e));_0x5c0bc2&&this[_0x541dc0(0x1df)](_0x5c0bc2);}[_0x4378ae(0x1df)](_0x5575ad){const _0x1b5aa7=_0x4378ae;if(!y(_0x5575ad))throw new _0x3a2a3f(_0x1b5aa7(0x194));this[_0x1b5aa7(0x1b5)]=_0x5575ad;}[_0x4378ae(0x18c)]({viewClass:_0xad1b87='',spaceBetweenItems:_0x2ab6b0=0x19}={}){const _0x53ea6f=_0x4378ae;if(!y(this[_0x53ea6f(0x1b5)]))throw new _0x3a2a3f(_0x53ea6f(0x1b1),this);this[_0x53ea6f(0x1b5)][_0x53ea6f(0x182)](this[_0x53ea6f(0x190)][_0x53ea6f(0x184)]),this[_0x53ea6f(0x190)][_0x53ea6f(0x1a5)]=_0xad1b87,this[_0x53ea6f(0x193)]=_0x2ab6b0;}[_0x4378ae(0x1d9)]({removedAnnotation:_0x2f3e2e,previousAnnotation:_0x50c10d,nextAnnotation:_0x1149a3}){const _0x4df6c2=_0x4378ae,_0x4a927c=this[_0x4df6c2(0x19e)](_0x2f3e2e);this[_0x4df6c2(0x190)][_0x4df6c2(0x186)][_0x4df6c2(0x1d1)](_0x4a927c),this[_0x4df6c2(0x191)](_0x2f3e2e),_0x50c10d&&this[_0x4df6c2(0x192)](this[_0x4df6c2(0x19e)](_0x50c10d)),_0x1149a3&&this[_0x4df6c2(0x192)](this[_0x4df6c2(0x19e)](_0x1149a3)),this[_0x4df6c2(0x19b)]();}[_0x4378ae(0x1c3)]({blurredAnnotation:_0x475f05,activatedAnnotation:_0x1838a3,disableAnimationOnActivatedAnnotation:_0xcbfad3}){const _0x295ebf=_0x4378ae;if(this[_0x295ebf(0x1a7)]=_0x1838a3,_0x475f05){_0x475f05[_0x295ebf(0x1b6)]=!0x1;const _0x3d388d=this[_0x295ebf(0x19e)](_0x475f05);_0x3d388d&&_0xcbfad3&&(_0x3d388d[_0x295ebf(0x1ca)]=!0x1);}if(_0x1838a3){const _0x36fe5=this[_0x295ebf(0x19e)](_0x1838a3);_0x36fe5&&(_0x1838a3[_0x295ebf(0x1b6)]=!0x0,_0xcbfad3&&(_0x36fe5[_0x295ebf(0x1ca)]=!0x0,_0x36fe5[_0x295ebf(0x1cc)]+=0x1),this[_0x295ebf(0x192)](_0x36fe5));}}[_0x4378ae(0x1db)](_0x408da9){const _0x12cc03=_0x4378ae;if(this[_0x12cc03(0x190)][_0x12cc03(0x184)][_0x12cc03(0x1d1)](),_0x408da9){for(const _0x46d83c of _0x408da9)this[_0x12cc03(0x191)](_0x46d83c);}this[_0x12cc03(0x190)][_0x12cc03(0x186)][_0x12cc03(0x188)](),this[_0x12cc03(0x190)][_0x12cc03(0x1a5)]='',this[_0x12cc03(0x19d)]=null;}[_0x4378ae(0x1af)](_0x3b3546,_0x51b78b){const _0x42bad2=_0x4378ae;_0x51b78b||(_0x51b78b=_0x3b3546[_0x42bad2(0x190)]);const _0x2436fd=new _0x498cc2(this[_0x42bad2(0x189)][_0x42bad2(0x1dc)]);this[_0x42bad2(0x1b7)][_0x42bad2(0x1a0)](_0x2436fd,_0x3b3546),this[_0x42bad2(0x1b3)][_0x42bad2(0x1a0)](_0x3b3546,_0x2436fd),_0x2436fd[_0x42bad2(0x1c5)][_0x42bad2(0x1b2)](_0x51b78b),this[_0x42bad2(0x1a4)](_0x3b3546[_0x42bad2(0x190)],_0x42bad2(0x1bf),(_0x342003,_0x29982f,_0xe81d94)=>{const _0xf053c7=_0x42bad2,_0x26d14f=this[_0xf053c7(0x19a)](_0x3b3546,_0xe81d94);_0x2436fd[_0xf053c7(0x1b4)]!=_0x26d14f&&(_0x2436fd[_0xf053c7(0x1b4)]=_0x26d14f,this[_0xf053c7(0x1d7)](_0x2436fd,_0x26d14f));}),this[_0x42bad2(0x1a4)](_0x2436fd,_0x42bad2(0x1d4),()=>{const _0x35c3c6=_0x42bad2;this[_0x35c3c6(0x1b0)](_0x2436fd,_0x35c3c6(0x1cc));}),this[_0x42bad2(0x1a4)](_0x2436fd,_0x42bad2(0x1ce),()=>{const _0x279008=_0x42bad2;this[_0x279008(0x1b0)](_0x2436fd,_0x279008(0x187));}),this[_0x42bad2(0x192)](_0x2436fd);const _0x255df6=this[_0x42bad2(0x198)](_0x2436fd);if(_0x255df6)this[_0x42bad2(0x1c8)](_0x255df6,_0x2436fd)||this[_0x42bad2(0x192)](_0x2436fd);else this[_0x42bad2(0x192)](_0x2436fd);return this[_0x42bad2(0x19b)](),this[_0x42bad2(0x190)][_0x42bad2(0x186)][_0x42bad2(0x1b2)](_0x2436fd),_0x2436fd;}[_0x4378ae(0x19f)](_0x3618fb){const _0x44c284=_0x4378ae;if(!_0x3618fb[_0x44c284(0x1c5)][_0x44c284(0x183)])return;const _0x2f51c8=this[_0x44c284(0x198)](_0x3618fb);if(!_0x2f51c8)return;const _0x1ee8e4=this[_0x44c284(0x1b7)][_0x44c284(0x199)](_0x2f51c8),_0x1527df=this[_0x44c284(0x1a7)];_0x1527df&&_0x1527df===_0x1ee8e4?this[_0x44c284(0x1c8)](_0x2f51c8,_0x3618fb):this[_0x44c284(0x197)](_0x3618fb,_0x2f51c8);}[_0x4378ae(0x18f)](_0x41bbe8){const _0x20066d=_0x4378ae;if(!_0x41bbe8[_0x20066d(0x1c5)][_0x20066d(0x183)])return;const _0x46e575=this[_0x20066d(0x1bd)](_0x41bbe8);if(!_0x46e575)return;const _0x42d6d7=this[_0x20066d(0x1b7)][_0x20066d(0x199)](_0x46e575),_0x383de0=this[_0x20066d(0x189)][_0x20066d(0x1c7)][_0x20066d(0x199)](_0x20066d(0x1d8)),_0x81d9de=this[_0x20066d(0x1a7)];_0x81d9de&&_0x81d9de===_0x42d6d7&&_0x383de0?(this[_0x20066d(0x197)](_0x46e575,_0x41bbe8),this[_0x20066d(0x1c8)](_0x41bbe8,_0x46e575)):_0x81d9de&&_0x81d9de===_0x42d6d7?this[_0x20066d(0x197)](_0x46e575,_0x41bbe8):this[_0x20066d(0x1c8)](_0x41bbe8,_0x46e575);}[_0x4378ae(0x1b0)](_0x14664b,_0x4c00f3){const _0x380124=_0x4378ae;0x0===this[_0x380124(0x195)][_0x380124(0x183)]&&setTimeout(()=>{const _0x3bf3a0=_0x380124;for(const {sidebarItemView:_0x1efc4f,changedProp:_0x8bc6ff}of this[_0x3bf3a0(0x195)])_0x3bf3a0(0x1cc)===_0x8bc6ff?this[_0x3bf3a0(0x19f)](_0x1efc4f):this[_0x3bf3a0(0x18f)](_0x1efc4f);this[_0x3bf3a0(0x195)]=[];},0xa),this[_0x380124(0x195)][_0x380124(0x1c9)]({'sidebarItemView':_0x14664b,'changedProp':_0x4c00f3});}[_0x4378ae(0x19e)](_0x5f1d18){const _0x4c8f7f=_0x4378ae;return this[_0x4c8f7f(0x1b3)][_0x4c8f7f(0x199)](_0x5f1d18);}[_0x4378ae(0x1de)](){const _0x4c1b9d=_0x4378ae;this[_0x4c1b9d(0x1a3)](),this[_0x4c1b9d(0x190)][_0x4c1b9d(0x1de)]();}[_0x4378ae(0x191)](_0x4b138b){const _0x49856c=_0x4378ae,_0x4a6504=this[_0x49856c(0x19e)](_0x4b138b);this[_0x49856c(0x1a3)](_0x4a6504),this[_0x49856c(0x1a3)](_0x4b138b[_0x49856c(0x190)]),_0x4a6504[_0x49856c(0x1de)](),this[_0x49856c(0x1b3)][_0x49856c(0x1d6)](_0x4b138b),this[_0x49856c(0x1b7)][_0x49856c(0x1d6)](_0x4a6504);}[_0x4378ae(0x1bc)](){const _0x38e639=_0x4378ae,_0x385ac6=new _0x4bc99e(this[_0x38e639(0x189)][_0x38e639(0x1dc)]);return _0x385ac6[_0x38e639(0x19c)](),this['on'](_0x38e639(0x185),(_0x5e7d75,_0x25124a,_0x449f00,_0x15fe73)=>{const _0x4c8416=_0x38e639;_0x15fe73&&_0x385ac6[_0x4c8416(0x1ac)](_0x4c8416(0x1a8)),_0x449f00?_0x385ac6[_0x4c8416(0x1aa)](_0x4c8416(0x1a8))['to'](_0x449f00,_0x4c8416(0x187)):_0x385ac6[_0x4c8416(0x1a8)]=null;}),_0x385ac6;}[_0x4378ae(0x19b)](){const _0x2ae130=_0x4378ae;var _0x38112a;this[_0x2ae130(0x19d)]=(null===(_0x38112a=this[_0x2ae130(0x1c2)])||void 0x0===_0x38112a?void 0x0:_0x38112a[_0x2ae130(0x1a6)])?this[_0x2ae130(0x19e)](this[_0x2ae130(0x1c2)][_0x2ae130(0x1a6)]):null;}[_0x4378ae(0x198)](_0x20373e){const _0x28ec3f=_0x4378ae;var _0x5e4290;const _0x5e4358=this[_0x28ec3f(0x1b7)][_0x28ec3f(0x199)](_0x20373e),_0x59e650=_0x5e4358&&(null===(_0x5e4290=this[_0x28ec3f(0x1c2)])||void 0x0===_0x5e4290?void 0x0:_0x5e4290[_0x28ec3f(0x199)](this[_0x28ec3f(0x1c2)][_0x28ec3f(0x1dd)](_0x5e4358)-0x1));return _0x59e650&&this[_0x28ec3f(0x19e)](_0x59e650)||null;}[_0x4378ae(0x1bd)](_0x4a7247){const _0x96868f=_0x4378ae;var _0x2b4985;const _0x580a29=this[_0x96868f(0x1b7)][_0x96868f(0x199)](_0x4a7247),_0x286379=_0x580a29&&(null===(_0x2b4985=this[_0x96868f(0x1c2)])||void 0x0===_0x2b4985?void 0x0:_0x2b4985[_0x96868f(0x199)](this[_0x96868f(0x1c2)][_0x96868f(0x1dd)](_0x580a29)+0x1));return _0x286379&&this[_0x96868f(0x19e)](_0x286379)||null;}[_0x4378ae(0x197)](_0x5928c6,_0x258fce){const _0x53221b=_0x4378ae;_0x5928c6[_0x53221b(0x1c4)]();const _0x1dac04=R(_0x258fce[_0x53221b(0x187)]+this[_0x53221b(0x193)],_0x5928c6[_0x53221b(0x1cc)]);return!!_0x1dac04&&(this[_0x53221b(0x1d7)](_0x258fce,_0x258fce[_0x53221b(0x1cc)]-_0x1dac04),!0x0);}[_0x4378ae(0x1c8)](_0x36bf6d,_0x5666a8){const _0x2f4a14=_0x4378ae;_0x36bf6d[_0x2f4a14(0x1c4)]();const _0x48d790=R(_0x36bf6d[_0x2f4a14(0x187)]+this[_0x2f4a14(0x193)],_0x5666a8[_0x2f4a14(0x1cc)]);return!!_0x48d790&&(this[_0x2f4a14(0x1d7)](_0x5666a8,_0x5666a8[_0x2f4a14(0x1cc)]+_0x48d790,!0x1),!0x0);}[_0x4378ae(0x192)](_0x379258){const _0xb23f81=_0x4378ae,_0xb05b40=this[_0xb23f81(0x1b7)][_0xb23f81(0x199)](_0x379258);if(!_0xb05b40||!_0xb05b40[_0xb23f81(0x1bb)]||!_0xb05b40[_0xb23f81(0x1c0)])return;const _0x2a7b6c=this[_0xb23f81(0x19a)](_0xb05b40,_0xb05b40[_0xb23f81(0x1c0)]);this[_0xb23f81(0x1d7)](_0x379258,_0x2a7b6c);}[_0x4378ae(0x19a)](_0x48e513,_0x16c9f0){const _0x414e36=_0x4378ae;if(null===_0x16c9f0)return 0x0;if(_0x48e513[_0x414e36(0x1bb)]instanceof _0x562a93)return _0x16c9f0[_0x414e36(0x1cc)];{const _0x27f5ad=new _0x562a93(this[_0x414e36(0x190)][_0x414e36(0x184)])[_0x414e36(0x1cc)];return _0x16c9f0[_0x414e36(0x1cc)]-_0x27f5ad;}}[_0x4378ae(0x1d7)](_0x414981,_0x21c87f,_0x2023b4=this[_0x4378ae(0x189)][_0x4378ae(0x1c7)][_0x4378ae(0x199)](_0x4378ae(0x1d8))){const _0x39fb90=_0x4378ae;_0x2023b4&&(_0x21c87f=Math[_0x39fb90(0x1ad)](_0x21c87f,this[_0x39fb90(0x1ab)](_0x414981))),_0x414981[_0x39fb90(0x1cc)]=_0x21c87f;}[_0x4378ae(0x1ab)](_0x15fa01){const _0x283df0=_0x4378ae;let _0x4775b9=this[_0x283df0(0x198)](_0x15fa01),_0x58d796=0x0;for(;_0x4775b9;)_0x4775b9[_0x283df0(0x1c4)](),_0x58d796+=this[_0x283df0(0x193)]+_0x4775b9[_0x283df0(0x1d0)],_0x4775b9=this[_0x283df0(0x198)](_0x4775b9);return _0x58d796;}}function R(_0x3bf530,_0x26ec06){const _0x557840=_0x4378ae;return Math[_0x557840(0x1ad)](_0x3bf530-_0x26ec06,0x0);}function y(_0x426958){const _0x4d2701=_0x4378ae;return null!==_0x426958&&_0x4d2701(0x1da)==typeof _0x426958&&0x1===_0x426958[_0x4d2701(0x196)];}