@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 15.6 kB
JavaScript
/*
* 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 _0x5f31d7=_0x3e78;(function(_0x23bc9f,_0x67cfd3){const _0x40f898=_0x3e78,_0x3d11c9=_0x23bc9f();while(!![]){try{const _0x74414=parseInt(_0x40f898(0x198))/0x1+parseInt(_0x40f898(0x1eb))/0x2+-parseInt(_0x40f898(0x1a9))/0x3+-parseInt(_0x40f898(0x1e3))/0x4+parseInt(_0x40f898(0x178))/0x5*(-parseInt(_0x40f898(0x1ac))/0x6)+parseInt(_0x40f898(0x1b6))/0x7*(-parseInt(_0x40f898(0x192))/0x8)+parseInt(_0x40f898(0x1c2))/0x9;if(_0x74414===_0x67cfd3)break;else _0x3d11c9['push'](_0x3d11c9['shift']());}catch(_0x46ff8c){_0x3d11c9['push'](_0x3d11c9['shift']());}}}(_0x45a8,0xda3d4));import{ContextPlugin as _0x30a9f1,Context as _0x52c8a2}from'ckeditor5/src/core.js';import _0x5eb092 from'./annotationsuis.js';function _0x3e78(_0x41a2ba,_0xee144c){const _0x45a8c3=_0x45a8();return _0x3e78=function(_0x3e7840,_0x3d34b0){_0x3e7840=_0x3e7840-0x171;let _0x1f176c=_0x45a8c3[_0x3e7840];return _0x1f176c;},_0x3e78(_0x41a2ba,_0xee144c);}import _0x10fd0a from'./sidebar.js';import _0x393922 from'./view/annotationcounterbuttonview.js';import{BalloonPanelView as _0x57a189,BodyCollection as _0x21804a}from'ckeditor5/src/ui.js';import{CKEditorError as _0x12106b,DomEmitterMixin as _0x10dc8e,keyCodes as _0x4b599d,Collection as _0xdb0fd0}from'ckeditor5/src/utils.js';import'../../theme/sidebar-narrow.css';function _0x45a8(){const _0x2a3047=['low','plugins','get','has','_annotations','rearrange','find','clear','target','preventClosingBalloon','set','getByView','isPremiumPlugin','esc','blur','defaultPositions','stopListening','values','annotations','focusableElements','attach','narrowSidebar','_destroyEditorAnnotationsIntegration','16wGznxQ','bind','preventDefault','narrowsidebar-detach-not-attached','_updateBalloonPosition','_attachToContainer','967075yjCXYV','set:container','refresh','hasDomSelection','NarrowSidebar','southArrowNorthEast','stop','change:container','bodyCollection','init','northArrowSouthWest','high','isVisible','mousedown','pin','refreshPositioning','southArrowNorth','2253717MVMsjx','stopPropagation','length','30KCxiYn','change:height','addAnnotation','keydown','create','balloonPanelView','cancel','locale','add','EditorAnnotations','1489901ipMrPq','from','context','isDirty','element','southArrowNorthWest','narrowsidebar-attach-already-attached','_refreshPositioning','northArrowSouth','_attachListeners','number','_editorAnnotations','25091388IocLIA','getSidebarItemView','setActiveAnnotation','view','_annotationToNarrowView','content','_setSelectedAnnotations','type','pluginName','uiUpdate','remove','resize','requires','_detachListeners','delete','ready','removeEventListener','keyCode','isAttached','_refreshPositioningDebounced','_domEmitter','attachToDom','listenTo','_showBalloon','isOfficialPlugin','_selectedAnnotations','focus','detach','getOrderedSelectedAnnotations','off','detachFromDom','contains','northArrowSouthEast','4950580EMayAc','execute','_hideBalloon','Esc','register','includes','_manuallyClosedAnnotationViews','annotationType','670832bIjCLB','activeAnnotation','_integrateWithEditorAnnotations','addEventListener','editors','_detachFromContainer','first','unpin','781945rCUrdd','ck-sidebar--narrow','destroy'];_0x45a8=function(){return _0x2a3047;};return _0x45a8();}import{debounce as _0x1935be}from'es-toolkit/compat';export default class n extends _0x30a9f1{[_0x5f31d7(0x1d4)];[_0x5f31d7(0x18d)];[_0x5f31d7(0x1e9)];[_0x5f31d7(0x1d6)];[_0x5f31d7(0x1c6)];[_0x5f31d7(0x1db)];[_0x5f31d7(0x1c1)];[_0x5f31d7(0x1d5)];static get[_0x5f31d7(0x1ce)](){return[_0x10fd0a,_0x5eb092];}static get[_0x5f31d7(0x1ca)](){const _0x1ec9a4=_0x5f31d7;return _0x1ec9a4(0x19c);}static get[_0x5f31d7(0x1da)](){return!0x0;}static get[_0x5f31d7(0x187)](){return!0x0;}constructor(_0x56603c){const _0x3cd2e7=_0x5f31d7;super(_0x56603c),this[_0x3cd2e7(0x1d4)]=!0x1,this[_0x3cd2e7(0x1e9)]=new Set(),this[_0x3cd2e7(0x1d6)]=Object[_0x3cd2e7(0x1b0)](_0x10dc8e),this[_0x3cd2e7(0x1c6)]=new Map(),this[_0x3cd2e7(0x185)](_0x3cd2e7(0x171),null),this[_0x3cd2e7(0x18d)]=null,this[_0x3cd2e7(0x1db)]=[],this[_0x3cd2e7(0x1c1)]=new _0xdb0fd0(),this[_0x3cd2e7(0x1d5)]=_0x1935be(()=>{const _0x1c9f09=_0x3cd2e7;this[_0x1c9f09(0x1bd)]();},0xfa,{'leading':!0x1});}[_0x5f31d7(0x1a1)](){const _0x75a12=_0x5f31d7;this[_0x75a12(0x1b8)][_0x75a12(0x17c)][_0x75a12(0x17d)](_0x5eb092)[_0x75a12(0x1e7)](_0x75a12(0x190),this),this[_0x75a12(0x1a0)]=new _0x21804a(this[_0x75a12(0x1b8)][_0x75a12(0x1b3)]),this[_0x75a12(0x1b1)]=new _0x57a189(this[_0x75a12(0x1b8)][_0x75a12(0x1b3)]),this[_0x75a12(0x1a0)][_0x75a12(0x1d7)](),this[_0x75a12(0x1a0)][_0x75a12(0x1b4)](this[_0x75a12(0x1b1)]);}[_0x5f31d7(0x18f)](_0xc8f0da){const _0x53a84c=_0x5f31d7;this[_0x53a84c(0x18d)]=_0xc8f0da;const _0x879d81=this[_0x53a84c(0x1b8)][_0x53a84c(0x17c)][_0x53a84c(0x17d)](_0x10fd0a),_0x4bff75=this[_0x53a84c(0x1b1)];if(_0x879d81[_0x53a84c(0x17f)]=_0xc8f0da,this[_0x53a84c(0x1d4)])throw new _0x12106b(_0x53a84c(0x1bc),this);this[_0x53a84c(0x1d4)]=!0x0,this[_0x53a84c(0x1d8)](_0x879d81,_0x53a84c(0x199),()=>{const _0x4cf0f7=_0x53a84c;this[_0x4cf0f7(0x1dd)](),this[_0x4cf0f7(0x1d8)](_0x879d81,_0x4cf0f7(0x19f),_0x400cae=>{const _0x5c5243=_0x4cf0f7;_0x400cae[_0x5c5243(0x1df)](),this[_0x5c5243(0x18f)](_0xc8f0da);});}),_0x879d81[_0x53a84c(0x197)]({'viewClass':_0x53a84c(0x179),'spaceBetweenItems':0x5});const _0x2377f4=_0x436a23=>{const _0x3ec551=_0x53a84c,_0x45f562=new _0x393922(this[_0x3ec551(0x1b8)][_0x3ec551(0x1b3)]);_0x879d81[_0x3ec551(0x1ae)](_0x436a23,_0x45f562),this[_0x3ec551(0x1c6)][_0x3ec551(0x185)](_0x436a23,_0x45f562),_0x45f562[_0x3ec551(0x193)](_0x3ec551(0x1b9),_0x3ec551(0x1ea),_0x3ec551(0x1c0))['to'](_0x436a23[_0x3ec551(0x1c5)],_0x3ec551(0x1b9),_0x3ec551(0x1c9),_0x3ec551(0x1ab)),_0x45f562['on'](_0x3ec551(0x1e4),()=>{const _0xdc96ee=_0x3ec551;this[_0xdc96ee(0x1e9)][_0xdc96ee(0x182)](),_0x4bff75[_0xdc96ee(0x1c7)][_0xdc96ee(0x176)]!==_0x436a23[_0xdc96ee(0x1c5)]?(this[_0xdc96ee(0x1d9)](_0x436a23),_0x436a23[_0xdc96ee(0x1c5)][_0xdc96ee(0x1ba)][_0xdc96ee(0x1dc)](),this[_0xdc96ee(0x1c4)](_0x436a23)):this[_0xdc96ee(0x1c4)](null);});};for(const _0x1988c7 of _0xc8f0da)_0x2377f4(_0x1988c7);this[_0x53a84c(0x1d8)](_0xc8f0da,_0x53a84c(0x1b4),(_0x29308f,_0x171d02)=>{_0x2377f4(_0x171d02);}),this[_0x53a84c(0x1d8)](_0xc8f0da,_0x53a84c(0x1cc),(_0x1eeae8,_0x1e24a3,_0x56d798)=>{const _0x433db9=_0x53a84c;this[_0x433db9(0x1c6)][_0x433db9(0x17d)](_0x1e24a3)[_0x433db9(0x17a)](),this[_0x433db9(0x1c6)][_0x433db9(0x1d0)](_0x1e24a3),_0x879d81[_0x433db9(0x180)]({'removedAnnotation':_0x1e24a3,'previousAnnotation':_0xc8f0da[_0x433db9(0x17d)](_0x56d798-0x1),'nextAnnotation':_0xc8f0da[_0x433db9(0x17d)](_0x56d798+0x1)}),_0x1e24a3===this[_0x433db9(0x171)]&&this[_0x433db9(0x1c4)](null);},{'priority':_0x53a84c(0x17b)}),this[_0x53a84c(0x1d8)](_0xc8f0da,_0x53a84c(0x1dc),(_0x57a8eb,_0x57260d)=>{const _0x1ad4e6=_0x53a84c;this[_0x1ad4e6(0x1c4)](_0x57260d);}),this[_0x53a84c(0x1d8)](_0xc8f0da,_0x53a84c(0x189),()=>{const _0x282024=_0x53a84c;this[_0x282024(0x1c4)](null);}),this[_0x53a84c(0x1d6)][_0x53a84c(0x1d8)](document,_0x53a84c(0x1af),(_0x1f1528,_0x48b5e1)=>{const _0x27365c=_0x53a84c;_0x48b5e1[_0x27365c(0x1d3)]===_0x4b599d[_0x27365c(0x188)]&&_0x4bff75[_0x27365c(0x1a4)]&&(this[_0x27365c(0x1e9)][_0x27365c(0x1b4)](_0x4bff75[_0x27365c(0x1c7)][_0x27365c(0x176)]),this[_0x27365c(0x1e5)](),_0x48b5e1[_0x27365c(0x1aa)](),_0x48b5e1[_0x27365c(0x194)]());}),this[_0x53a84c(0x1d6)][_0x53a84c(0x1d8)](document,_0x53a84c(0x1a5),(_0xca2f6c,_0x2586b3)=>{const _0x20247f=_0x53a84c,_0x2a8175=_0x2586b3[_0x20247f(0x183)];_0x4bff75[_0x20247f(0x1a4)]&&_0x4bff75[_0x20247f(0x1ba)][_0x20247f(0x1e1)](_0x2a8175)||_0x879d81[_0x20247f(0x1c5)][_0x20247f(0x1ba)][_0x20247f(0x1e1)](_0x2a8175)||_0xca2f6c[_0x20247f(0x184)]||this[_0x20247f(0x171)]&&this[_0x20247f(0x171)][_0x20247f(0x18e)][_0x20247f(0x181)](_0x3e8c1c=>_0x3e8c1c[_0x20247f(0x1e1)](_0x2a8175))||(this[_0x20247f(0x1e9)][_0x20247f(0x182)](),this[_0x20247f(0x1e5)](),this[_0x20247f(0x1c4)](null));});const _0x4c5979=this[_0x53a84c(0x1b8)]instanceof _0x52c8a2?this[_0x53a84c(0x1b8)][_0x53a84c(0x174)]:new _0xdb0fd0([this[_0x53a84c(0x1b8)]]);for(const _0xd80609 of _0x4c5979)this[_0x53a84c(0x172)](_0xd80609);this[_0x53a84c(0x1d8)](_0x4c5979,_0x53a84c(0x1b4),(_0xb9ed21,_0x200509)=>{const _0x4d8013=_0x53a84c;this[_0x4d8013(0x1d8)](_0x200509,_0x4d8013(0x1d1),()=>{const _0x12d99f=_0x4d8013;this[_0x12d99f(0x172)](_0x200509);});}),this[_0x53a84c(0x1d8)](_0x4c5979,_0x53a84c(0x1cc),(_0x310f95,_0x2ac7fc)=>{const _0x19443a=_0x53a84c;_0x2ac7fc[_0x19443a(0x17c)][_0x19443a(0x17e)](_0x19443a(0x1b5))&&this[_0x19443a(0x191)](_0x2ac7fc[_0x19443a(0x17c)][_0x19443a(0x17d)](_0x19443a(0x1b5)));}),window[_0x53a84c(0x173)](_0x53a84c(0x1cd),this[_0x53a84c(0x1d5)]),this[_0x53a84c(0x1bd)]();}[_0x5f31d7(0x1c4)](_0x1f7a67){const _0x124295=_0x5f31d7;if(_0x1f7a67===this[_0x124295(0x171)])return;const _0x364779=this[_0x124295(0x1b8)][_0x124295(0x17c)][_0x124295(0x17d)](_0x10fd0a);if(_0x364779[_0x124295(0x19a)]({'blurredAnnotation':this[_0x124295(0x171)],'activatedAnnotation':_0x1f7a67,'disableAnimationOnActivatedAnnotation':!0x0}),_0x1f7a67)_0x364779[_0x124295(0x1c3)](_0x1f7a67)?this[_0x124295(0x1d9)](_0x1f7a67):this[_0x124295(0x1e5)]();else this[_0x124295(0x1e5)]();this[_0x124295(0x171)]=_0x1f7a67;}[_0x5f31d7(0x1dd)](){const _0x30310b=_0x5f31d7;if(!this[_0x30310b(0x1d4)])throw new _0x12106b(_0x30310b(0x195),this);this[_0x30310b(0x1c4)](null);const _0x52d965=this[_0x30310b(0x1b8)][_0x30310b(0x17c)][_0x30310b(0x17d)](_0x10fd0a);this[_0x30310b(0x1e5)](),Array[_0x30310b(0x1b7)](this[_0x30310b(0x1c6)][_0x30310b(0x18c)](),_0x2844b9=>_0x2844b9[_0x30310b(0x17a)]()),this[_0x30310b(0x1c6)][_0x30310b(0x182)](),_0x52d965[_0x30310b(0x175)](this[_0x30310b(0x18d)]),this[_0x30310b(0x18b)](),this[_0x30310b(0x1d6)][_0x30310b(0x18b)](),this[_0x30310b(0x1b8)]instanceof _0x52c8a2&&this[_0x30310b(0x18b)](this[_0x30310b(0x1b8)][_0x30310b(0x174)]);for(const _0x243292 of Array[_0x30310b(0x1b7)](this[_0x30310b(0x1c1)]))this[_0x30310b(0x191)](_0x243292);window[_0x30310b(0x1d2)](_0x30310b(0x1cd),this[_0x30310b(0x1d5)]),this[_0x30310b(0x1d5)][_0x30310b(0x1b2)](),this[_0x30310b(0x1db)]=[],this[_0x30310b(0x1d4)]=!0x1,this[_0x30310b(0x18d)]=null;}[_0x5f31d7(0x17a)](){const _0xa7e2e4=_0x5f31d7;this[_0xa7e2e4(0x1d4)]&&this[_0xa7e2e4(0x1dd)](),this[_0xa7e2e4(0x1a0)][_0xa7e2e4(0x1e0)]();}[_0x5f31d7(0x172)](_0x398c4c){const _0x3871e9=_0x5f31d7;if(!_0x398c4c[_0x3871e9(0x17c)][_0x3871e9(0x17e)](_0x3871e9(0x1b5)))return;const _0x44922c=_0x398c4c[_0x3871e9(0x17c)][_0x3871e9(0x17d)](_0x3871e9(0x1b5)),_0x18c885=this[_0x3871e9(0x1b8)][_0x3871e9(0x17c)][_0x3871e9(0x17d)](_0x10fd0a),_0x5ddb08=this[_0x3871e9(0x18d)],_0x1ae96a=this[_0x3871e9(0x1b1)],_0x308572=()=>{const _0x4a039a=_0x3871e9,_0x50ba48=_0x44922c[_0x4a039a(0x1de)]({'annotations':this[_0x4a039a(0x18d)],'activeAnnotation':this[_0x4a039a(0x171)]});this[_0x4a039a(0x1c8)](_0x50ba48),this[_0x4a039a(0x1c4)](_0x50ba48[0x0]||null);};this[_0x3871e9(0x1d8)](_0x44922c,_0x3871e9(0x19a),_0x308572),this[_0x3871e9(0x1d8)](_0x44922c,_0x3871e9(0x189),(_0x39e185,{isAnnotationTracked:_0x42da9f})=>{const _0x45f4c9=_0x3871e9;this[_0x45f4c9(0x171)]&&_0x42da9f(this[_0x45f4c9(0x171)])&&(this[_0x45f4c9(0x1c8)]([]),this[_0x45f4c9(0x1c4)](null));}),this[_0x3871e9(0x1d8)](_0x44922c,_0x3871e9(0x1cb),()=>{const _0x45a731=_0x3871e9;this[_0x45a731(0x1d5)]();}),this[_0x3871e9(0x1d8)](_0x5ddb08,_0x3871e9(0x189),_0x600664=>{const _0x340427=_0x3871e9;_0x44922c[_0x340427(0x19b)]()&&_0x600664[_0x340427(0x19e)]();},{'priority':_0x3871e9(0x1a3)}),this[_0x3871e9(0x1d8)](this[_0x3871e9(0x1d6)],_0x3871e9(0x1a5),(_0x285849,_0x538bf7)=>{const _0x4727d5=_0x3871e9,_0x32ae8e=_0x538bf7[_0x4727d5(0x183)];_0x1ae96a[_0x4727d5(0x1a4)]&&_0x1ae96a[_0x4727d5(0x1ba)][_0x4727d5(0x1e1)](_0x32ae8e)||_0x18c885[_0x4727d5(0x1c5)][_0x4727d5(0x1ba)][_0x4727d5(0x1e1)](_0x32ae8e)||this[_0x4727d5(0x171)]&&_0x44922c[_0x4727d5(0x19b)]()&&(_0x308572(),_0x285849[_0x4727d5(0x184)]=!0x0);},{'priority':_0x3871e9(0x1a3)}),this[_0x3871e9(0x1c1)][_0x3871e9(0x1b4)](_0x44922c);}[_0x5f31d7(0x191)](_0x4458ca){const _0xbccbd3=_0x5f31d7;_0x4458ca&&(this[_0xbccbd3(0x18b)](_0x4458ca),this[_0xbccbd3(0x1c1)][_0xbccbd3(0x1cc)](_0x4458ca));}[_0x5f31d7(0x1c8)](_0x538371){const _0x406c74=_0x5f31d7;for(const _0x202b4c of this[_0x406c74(0x1db)])_0x538371[_0x406c74(0x1e8)](_0x202b4c)||this[_0x406c74(0x1e9)][_0x406c74(0x1d0)](_0x202b4c[_0x406c74(0x1c5)]);this[_0x406c74(0x1db)]=_0x538371;}[_0x5f31d7(0x1bd)](){const _0x12f6c5=_0x5f31d7,_0x3c672a=this[_0x12f6c5(0x1b1)];this[_0x12f6c5(0x18d)][_0x12f6c5(0x1a7)](),_0x3c672a[_0x12f6c5(0x1a4)]&&this[_0x12f6c5(0x196)]();}[_0x5f31d7(0x1d9)](_0x5bfb27){const _0x175d8d=_0x5f31d7;if(this[_0x175d8d(0x1e9)][_0x175d8d(0x17e)](_0x5bfb27[_0x175d8d(0x1c5)]))return;const _0x1b31c6=this[_0x175d8d(0x1b1)][_0x175d8d(0x1c7)][_0x175d8d(0x176)];_0x1b31c6!==_0x5bfb27[_0x175d8d(0x1c5)]?(_0x1b31c6&&this[_0x175d8d(0x1cf)](_0x1b31c6),this[_0x175d8d(0x1bf)](_0x5bfb27[_0x175d8d(0x1c5)]),this[_0x175d8d(0x1b1)][_0x175d8d(0x1c7)][_0x175d8d(0x182)](),this[_0x175d8d(0x1b1)][_0x175d8d(0x1c7)][_0x175d8d(0x1b4)](_0x5bfb27[_0x175d8d(0x1c5)]),this[_0x175d8d(0x196)]()):this[_0x175d8d(0x196)]();}[_0x5f31d7(0x196)](){const _0x126122=_0x5f31d7,_0x38365b=this[_0x126122(0x1b1)][_0x126122(0x1c7)][_0x126122(0x176)],_0x5709b0=_0x38365b&&this[_0x126122(0x18d)][_0x126122(0x186)](_0x38365b);if(!_0x5709b0||!this[_0x126122(0x1c6)][_0x126122(0x17e)](_0x5709b0))return;const _0xa3110c=this[_0x126122(0x1c6)][_0x126122(0x17d)](_0x5709b0)[_0x126122(0x1ba)],_0x2cb435=(function(){const _0x1edca8=_0x126122,_0x1fb8ce=_0x57a189[_0x1edca8(0x18a)];return[_0x1fb8ce[_0x1edca8(0x19d)],_0x1fb8ce[_0x1edca8(0x1e2)],_0x1fb8ce[_0x1edca8(0x1a8)],_0x1fb8ce[_0x1edca8(0x1be)],_0x1fb8ce[_0x1edca8(0x1bb)],_0x1fb8ce[_0x1edca8(0x1a2)]];}());this[_0x126122(0x1b1)][_0x126122(0x1a6)]({'target':_0xa3110c,'positions':_0x2cb435});}[_0x5f31d7(0x1e5)](){const _0x18751f=_0x5f31d7,_0x228965=this[_0x18751f(0x1b1)],_0x462439=_0x228965[_0x18751f(0x1c7)][_0x18751f(0x176)];_0x462439&&(this[_0x18751f(0x1cf)](_0x462439),_0x228965[_0x18751f(0x177)](),_0x228965[_0x18751f(0x1c7)][_0x18751f(0x182)]());}[_0x5f31d7(0x1bf)](_0x40e99e){const _0x2aeb04=_0x5f31d7;this[_0x2aeb04(0x1d8)](_0x40e99e,_0x2aeb04(0x1ad),()=>this[_0x2aeb04(0x196)]()),this[_0x2aeb04(0x1d8)](_0x40e99e,_0x2aeb04(0x1e6),(_0x4579a6,_0x5c333f)=>{const _0x4da09b=_0x2aeb04;this[_0x4da09b(0x1e9)][_0x4da09b(0x1b4)](_0x40e99e),this[_0x4da09b(0x1e5)](),_0x5c333f();});}[_0x5f31d7(0x1cf)](_0x58d1a9){const _0x4a203f=_0x5f31d7;this[_0x4a203f(0x18b)](_0x58d1a9);}}