@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
28 lines • 185 kB
JavaScript
/*
* Copyright (c) 2003-2026, 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. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
import{Command as _0x5de849,Context as _0x2e85d8,ContextPlugin as _0x5d945e,Editor as _0x8c9b70,PendingActions as _0x4019cf,Plugin as _0x32d196}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x460944,Collection as _0x1d3c5e,DomEmitterMixin as _0x270b14,FocusTracker as _0x46cfaf,KeystrokeHandler as _0x44e221,ObservableMixin as _0x4f4856,Rect as _0x3f41c9,diff as _0x4d2557,first as _0x1a2afb,getEnvKeystrokeText as _0x5bcf0b,keyCodes as _0x40bd72,priorities as _0x48ddaa,scrollViewportToShowTarget as _0x474fe7,toUnit as _0x4b19c0,uid as _0x4ff4e9}from'@ckeditor/ckeditor5-utils';import{AriaDescriptionView as _0x30e892,ConfirmMixin as _0x505bcf,FOCUS_ANNOTATION_KEYSTROKE as _0x4e8a21,LateFocusButtonView as _0x4ccc42,LateFocusDropdownButtonView as _0x3bd6df,UserView as _0x95843f,Users as _0x5d61c1,getAllMarkersDomElementsSorted as _0x3df547,getDateTimeFormatter as _0x5b4e92,hashObject as _0x5ab5a3,setupThreadKeyboardNavigation as _0x2c8780,surroundingMarkersDetector as _0x5a3dd3,trimHtml as _0x3e71f1}from'@ckeditor/ckeditor5-collaboration-core';import{cloneDeep as _0x172f46,debounce as _0x1ebf5f,isEqual as _0x440498,set as _0x4f2003,throttle as _0x17f62c,unset as _0x59ab04}from'es-toolkit/compat';import{IconAddComment as _0x1f3af2,IconCheck as _0x3aa4d1,IconCommentsArchive as _0x4a6a61,IconPencil as _0xb8044e,IconRemoveComment as _0x2d40b9,IconThreeVerticalDots as _0x4b53ab,IconUndo as _0x16ab3a}from'@ckeditor/ckeditor5-icons';import{BalloonPanelView as _0xd4a3f7,BodyCollection as _0x701dbb,ButtonView as _0x5a263d,ContextualBalloon as _0x63646c,Dialog as _0x3da067,DialogViewPosition as _0x3cf2f2,EditorUI as tt,EditorUIView as it,FocusCycler as et,InlineEditableUIView as st,ListItemView as nt,ListView as ot,MenuBarMenuListItemButtonView as rt,View as ht,ViewCollection as at,createDropdown as ct,focusChildOnDropdownOpen as dt}from'@ckeditor/ckeditor5-ui';import{MouseObserver as lt,disableViewPlaceholder as mt,enableViewPlaceholder as ut}from'@ckeditor/ckeditor5-engine';import{Clipboard as ft,ClipboardMarkersUtils as pt,ClipboardPipeline as wt}from'@ckeditor/ckeditor5-clipboard';import{Enter as gt,ShiftEnter as _t}from'@ckeditor/ckeditor5-enter';import{SelectAll as At}from'@ckeditor/ckeditor5-select-all';import{Typing as vt}from'@ckeditor/ckeditor5-typing';import{Undo as yt}from'@ckeditor/ckeditor5-undo';import{Paragraph as Tt}from'@ckeditor/ckeditor5-paragraph';import{toWidget as Ct}from'@ckeditor/ckeditor5-widget';const It=/* #__PURE__ -- @preserve */
_0x4f4856();var bt=class extends It{['model'];['view'];constructor(_0x494d1d,_0x5a515c){super(),this['model']=_0x494d1d,this['model']['_isAttached']=!0x0,this['view']=_0x5a515c,this['listenTo'](_0x5a515c,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0x5a515c,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0x5a515c,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0x5a515c,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0x5a515c,'addComment',(_0x3e2272,_0x17e785)=>this['addComment'](_0x17e785)),this['listenTo'](_0x5a515c,'updateComment',(_0x1795d0,_0x1af990,_0x5c0eab)=>this['updateComment'](_0x1af990,_0x5c0eab)),this['listenTo'](_0x5a515c,'removeComment',(_0x5df4d1,_0x4874fe)=>this['removeComment'](_0x4874fe));}['submit'](){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}['addComment'](_0x3994db){this['model']['addComment']({'content':_0x3994db,'authorId':this['view']['_localUser']['id']});}['updateComment'](_0x5054ca,_0x45ef48){this['model']['getComment'](_0x5054ca)['update']({'content':_0x45ef48});}['removeComment'](_0x324560){this['model']['getComment'](_0x324560)['remove']();}['destroy'](){this['stopListening'](),this['model']['_isAttached']=!0x1;}};function Et(_0x38e5f1,_0x8f1cf,_0x582ee3){const t=_0x38e5f1['t'];switch(_0x8f1cf){case'PENDING_ACTION_COMMENT_THREAD':return t({'string':'Unsaved\x20change\x20in\x20comment\x20thread.','id':'PENDING_ACTION_COMMENT_THREAD'});case'Comment':return t('Comment');case'Reply...':return t('Reply...');case'Reply\x20to\x20reopen\x20discussion...':return t('Reply\x20to\x20reopen\x20discussion...');case'Write\x20a\x20comment...':return t('Write\x20a\x20comment...');case'Comment\x20was\x20made\x20on\x20an\x20element':return t('Comment\x20was\x20made\x20on\x20an\x20element');case'Comment\x20editor':return t('Comment\x20editor');case'Delete\x20comment\x20thread?':return t('Delete\x20comment\x20thread?');case'Delete\x20comment?':return t('Delete\x20comment?');case'Marked\x20as\x20resolved':return t('Marked\x20as\x20resolved');case'Show\x20more\x20items':return t('Show\x20more\x20items');case'Cancel':return t('Cancel');case'Edit':return t('Edit');case'Resolve':return t('Resolve');case'Reopen':return t('Reopen');case'Remove':return t('Remove');case'Reply':return t('Reply');case'Save':return t('Save');case'Annotations\x20sidebar':return t('Annotations\x20sidebar');case'Annotations\x20list':return t('Annotations\x20list');case'Thread\x20comments':return t('Thread\x20comments');case'THREAD_CONTEXT_LABEL':return t({'string':'Thread\x20context:\x20%0','id':'THREAD_CONTEXT_LABEL'},_0x582ee3);case'COMMENT_THREAD_LABEL':return t({'string':'Comment\x20thread\x20by\x20%1.\x20%0\x20reply.','plural':'Comment\x20thread\x20by\x20%1.\x20%0\x20replies.','id':'COMMENT_THREAD_LABEL'},_0x582ee3);case'COMMENT_THREAD_DESCRIPTION':return t({'string':'Press\x20Enter\x20for\x20more\x20options.\x20Press\x20Escape\x20to\x20exit.','id':'COMMENT_THREAD_DESCRIPTION'});case'COMMENT_ARIA_LABEL':return t({'string':'Comment\x20by\x20%0.\x20Created\x20on\x20%1.\x20%2.\x20%3','id':'COMMENT_ARIA_LABEL'},_0x582ee3);case'LEAVE_COMMENT_ANNOUNCEMENT':return t({'string':'Leaving\x20a\x20content\x20with\x20comments.','id':'LEAVE_COMMENT_ANNOUNCEMENT'});case'ENTER_COMMENT_ANNOUNCEMENT':return t({'string':'Entering\x20a\x20content\x20with\x20comments.\x20Press\x20%0\x20to\x20go\x20to\x20the\x20discussion.','id':'ENTER_COMMENT_ANNOUNCEMENT'},_0x582ee3);case'NUMBER_OF_COMMENTS':return t({'string':'%0\x20Comment','plural':'%0\x20Comments','id':'NUMBER_OF_COMMENTS'},_0x582ee3);case'TOO_LONG_COMMENT_ALERT':return t({'string':'Comment\x20content\x20is\x20too\x20long.\x20Your\x20comment\x20has\x20%0\x20characters\x20but\x20the\x20limit\x20is\x20%1\x20characters.','id':'TOO_LONG_COMMENT_ALERT'},_0x582ee3);case'EXTERNAL_COMMENT':return t({'string':'This\x20comment\x20comes\x20from\x20an\x20external\x20source.','id':'EXTERNAL_COMMENT'});case'EXTERNAL_IMPORT_WORD_COMMENT':return t({'string':'This\x20comment\x20comes\x20from\x20an\x20imported\x20Word\x20file.','id':'EXTERNAL_IMPORT_WORD_COMMENT'});case'EXTERNAL_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20external\x20source\x20(added\x20by\x20%0)','id':'EXTERNAL_AVATAR'},_0x582ee3);case'EXTERNAL_IMPORT_WORD_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20a\x20Word\x20document\x20imported\x20by\x20%0','id':'EXTERNAL_IMPORT_WORD_AVATAR'},_0x582ee3);case'COMMENTS_ARCHIVE':return t({'string':'Comments\x20archive','id':'COMMENTS_ARCHIVE'});case'EMPTY_COMMENTS_ARCHIVE':return t({'string':'There\x20are\x20no\x20archived\x20comment\x20threads.','id':'EMPTY_COMMENTS_ARCHIVE'});case'COMMENTS_ARCHIVE_LIST_LABEL':return t({'string':'List\x20of\x20comments','id':'COMMENTS_ARCHIVE_LIST_LABEL'});case'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP':return t({'string':'Keystrokes\x20for\x20interacting\x20with\x20annotation\x20threads\x20(e.g.\x20comments,\x20track\x20changes\x20suggestions)','id':'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'});case'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO':return t({'string':'Move\x20focus\x20to\x20the\x20thread\x20when\x20the\x20selection\x20is\x20anchored\x20in\x20its\x20marker','id':'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'});case'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT':return t({'string':'Exit\x20the\x20annotation\x20and\x20move\x20focus\x20back\x20to\x20the\x20edited\x20content','id':'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'});case'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER':return t({'string':'Browse\x20the\x20focused\x20annotation\x20thread\x20or\x20thread\x20comment','id':'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'});case'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS':return t({'string':'Move\x20across\x20internals\x20of\x20the\x20annotation\x20thread','id':'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'});case'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT':return t({'string':'Submit\x20the\x20reply\x20while\x20writing\x20a\x20comment','id':'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'});case'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS':return t({'string':'Move\x20to\x20the\x20previous\x20or\x20next\x20thread\x20in\x20the\x20annotations\x20sidebar\x20or\x20comments\x20archive','id':'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'});default:return'';}}var kt=class extends it{['main'];['editable'];constructor(_0x322a5f,_0x5196d7){super(_0x322a5f);const _0x14c587=_0x4ff4e9();this['main']=this['createCollection'](),this['editable']=new st(_0x322a5f,_0x5196d7,void 0x0,{'label':()=>Et(_0x322a5f,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0x322a5f['uiLanguageDirection'],'lang':_0x322a5f['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0x14c587},'children':[{'tag':'div','attributes':{'class':'ck-editor__main','role':'presentation'},'children':this['main']}]});}['render'](){super['render'](),this['main']['add'](this['editable']);}['focus'](){this['editable']['element']['focus']();}},Nt=class extends tt{['view'];constructor(_0x1343d7){super(_0x1343d7),this['view']=new kt(_0x1343d7['locale'],_0x1343d7['editing']['view']);}get['element'](){return this['view']['element'];}['init'](){const _0x2045e7=this['editor']['editing']['view'],_0xc99982=this['view']['editable'];_0xc99982['name']=_0x2045e7['document']['getRoot']()['rootName'],this['view']['render']();const _0x2fbda9=_0xc99982['element'];this['setEditableElement'](_0xc99982['name'],_0x2fbda9),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x2045e7['attachDomRoot'](_0x2fbda9),this['fire']('ready');}['destroy'](){super['destroy'](),this['view']['destroy']();}};const Ot=[ft,gt,_t,At,vt,yt,Tt],Mt=/* #__PURE__ -- @preserve */
_0x4f4856(_0x8c9b70);var Rt=class CommentEditor extends Mt{static ['defaultPlugins']=/* #__PURE__ -- @preserve */
((()=>Ot)());constructor(_0x822e7e={}){(_0x822e7e=Object['assign']({},_0x822e7e))['plugins']||(_0x822e7e['plugins']=CommentEditor['defaultPlugins']),super(_0x822e7e),this['ui']=new Nt(this),this['set']('placeholder',''),this['model']['document']['on']('change',()=>this['_updatePlaceholder'](),{'priority':'low'}),this['on']('change:placeholder',()=>this['_updatePlaceholder']()),this['model']['document']['createRoot'](),this['editing']['view']['_overlayModeHint']='auto',this['_sendUsageRequest']=()=>window['Promise']['resolve']({'status':'ok'});}['create'](){const _0x2f185f=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x2f185f))['then'](()=>this['fire']('ready'));}['destroy'](){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x5dd30a=>{const _0x4f02d4=this['model']['document']['getRoot'](),_0x12b37e=_0x4f02d4&&_0x4f02d4['getChild'](_0x4f02d4['childCount']-0x1);_0x5dd30a['setSelection'](_0x12b37e,'end'),this['editing']['view']['focus']();});}['_updatePlaceholder'](){const _0x1d22f8=this['editing']['view'],_0x377e9a=_0x1d22f8['document']['getRoot'](),_0x546e1e=_0x377e9a['getChild'](0x0);_0x377e9a['childCount']>0x1||!_0x546e1e||'p'!=_0x546e1e['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(mt(_0x1d22f8,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x546e1e['placeholder']=this['placeholder']),ut({'view':_0x1d22f8,'element':_0x546e1e,'keepOnFocus':!0x0}),this['placeholderElement']=_0x546e1e);}},St=class extends ht{['keystrokes'];['focusTracker'];['focusables'];['focusCycler'];['submitButtonView'];['cancelButtonView'];['_editorConfig'];constructor(_0x40664d,_0x54b9fd={}){super(_0x40664d),this['editor']=null,this['_editorConfig']=_0x54b9fd,this['set']('value',_0x54b9fd['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Et(_0x40664d,'Reply...')),this['set']('submitLabel',Et(_0x40664d,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new _0x44e221(),this['focusTracker']=new _0x46cfaf(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x406e21=>!_0x406e21['defaultPrevented']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-comment__input-actions',this['bindTemplate']['if']('showButtons','ck-comment__input-actions--active')]},'children':[this['submitButtonView'],this['cancelButtonView']]}]}),this['keystrokes']['set']('Esc',(_0x4a0df5,_0x274328)=>{this['cancelButtonView']['fire']('execute'),_0x274328();}),this['keystrokes']['set']('Ctrl+Enter',(_0x23f65f,_0x42dec2)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x42dec2());}),this['on']('submit',(_0x424440,_0x30e4ce)=>{_0x30e4ce['length']>0xfde8?(alert(Et(_0x40664d,'TOO_LONG_COMMENT_ALERT',[_0x30e4ce['length'],0xfde8])),_0x424440['stop']()):this['editor']['setData']('');},{'priority':'high'});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}['createEditor'](){return this['editor']||(this['editor']=new Rt(this['_editorConfig']),this['_editorCreationPromise']=this['editor']['create']()['then'](()=>{if(this['_isDestroyed'])return;const _0x4656d4=this['editor'];this['element']['insertBefore'](_0x4656d4['ui']['element'],this['element']['firstChild']),_0x4656d4['model']['document']['on']('change',()=>this['value']=_0x4656d4['getData']()),_0x4656d4['bind']('placeholder')['to'](this),this['focusables']['add'](_0x4656d4['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x2f5265){-0x1===_0x2f5265?(this['focusCycler']['focusFirst'](),this['focusCycler']['focusLast']()):this['focusCycler']['focusFirst']();}async['destroy'](){this['_isDestroyed']||(this['_isDestroyed']=!0x0,this['editor']&&(await this['_editorCreationPromise'],await this['editor']['destroy'](),this['fire']('editorDestroyed',this['editor'])),await super['destroy']());}['_createSubmitButton'](){const {locale:_0x3f51a9}=this,_0xc934d4=new _0x5a263d(_0x3f51a9);return _0xc934d4['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0xc934d4['withText']=!0x0,_0xc934d4['bind']('label')['to'](this,'submitLabel'),_0xc934d4['on']('execute',()=>{this['fire']('submit',this['value']);}),_0xc934d4['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x630cd5,_0x2e45ae)=>!_0x2e45ae&&!!_0x630cd5['trim']()),_0xc934d4;}['_createCancelButton'](){const {locale:_0x4db6f5}=this,_0x484228=new _0x5a263d(_0x4db6f5);return _0x484228['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x484228['label']=Et(_0x4db6f5,'Cancel'),_0x484228['withText']=!0x0,_0x484228['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x484228;}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x38b223=>{this['focusTracker']['add'](_0x38b223['element']);}),this['focusables']['on']('change',(_0x23c0f8,_0x17bacc)=>{for(const _0x58c280 of Array['from'](_0x17bacc['added'])['reverse']())this['focusTracker']['add'](_0x58c280['element']);});}},xt=class extends ht{constructor(_0x43f68d,_0x2a8c04,_0x45bb7b){super(_0x43f68d),this['commentInputView']=new St(_0x43f68d,_0x45bb7b),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x118229,_0x4321a5)=>_0x118229||!!_0x4321a5),this['set']('showInput',!0x1),this['on']('change:showInput',()=>{this['showInput']&&!this['commentInputView']['editor']&&this['commentInputView']['createEditor']();}),this['commentInputView']['delegate']('editorReady')['to'](this),this['commentInputView']['delegate']('editorDestroyed')['to'](this),this['userView']=new _0x95843f(_0x43f68d,_0x2a8c04),this['userView']['extendTemplate']({'attributes':{'class':'ck-thread__user','aria-hidden':!0x0}}),this['commentInputView']['extendTemplate']({'attributes':{'class':'ck-thread__input'}}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-comment__input-container',this['bindTemplate']['if']('showInput','ck-comment__input-container--active')]},'children':[this['userView'],this['commentInputView']]});}['render'](){super['render'](),this['_focusOnNonInteractiveMouseDown']();}['destroy'](){return this['commentInputView']['destroy']()['then'](()=>super['destroy']());}['focus'](_0x475a0b){this['commentInputView']['focus'](_0x475a0b);}['_focusOnNonInteractiveMouseDown'](){this['listenTo'](this['element'],'mousedown',(_0x27adb0,_0x4281e3)=>{const {submitButtonView:_0x4ee7c8,cancelButtonView:_0x360777,editor:_0x219ea1}=this['commentInputView'];[_0x4ee7c8['element'],_0x360777['element'],_0x219ea1?_0x219ea1['editing']['view']['getDomRoot']():null]['filter'](_0x42a9b6=>_0x42a9b6)['some'](_0xc47986=>_0xc47986['contains'](_0x4281e3['target']))||(this['focus'](),_0x4281e3['preventDefault']());});}},Pt=class extends ht{constructor(_0x2def75){super(_0x2def75);const _0x149537=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x149537['to']('count',_0x11c34a=>Et(_0x2def75,'NUMBER_OF_COMMENTS',_0x11c34a))}]});}},Lt=class extends ht{['commentViews'];['resolvedCommentView'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];['_collapsedCommentsView'];constructor(_0x1d864f,_0x8c9843,_0x1c9cbe){super(_0x1d864f);const _0x213902=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x8c9843['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x8c9843,this['_config']=_0x1c9cbe,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x46cfaf(),this['keystrokes']=new _0x44e221(),this['focusCycler']=new et({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x3681f3=>this['commentViews']['map'](_0x168a05=>_0x168a05['element'])['includes'](_0x3681f3['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Pt(_0x1d864f),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x14dec0=>_0x14dec0-this['_config']['maxCommentsWhenCollapsed']);for(const _0x5b56a9 of _0x8c9843['comments'])this['_handleNewCommentModel'](_0x5b56a9);this['_handleInfoComment'](),this['listenTo'](_0x8c9843['comments'],'add',(_0x35001b,_0x32c6fc)=>{const _0x1290f6=this['_calculatePosition'](_0x32c6fc);this['length']++,this['_handleNewCommentModel'](_0x32c6fc,_0x1290f6),this['refreshVisibleViews']();}),this['listenTo'](_0x8c9843['comments'],'remove',(_0x532604,_0x40b744)=>{this['length']--,this['_handleRemoveCommentModel'](_0x40b744),this['refreshVisibleViews']();}),this['listenTo'](_0x8c9843,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x8c9843,'change:isResolved',()=>this['_handleInfoComment']()),this['on']('change:isActive',()=>this['refreshVisibleViews']()),this['on']('change:hasDirtyComment',()=>this['refreshVisibleViews']()),this['setTemplate']({'tag':'ul','attributes':{'class':['ck-thread__comments',_0x213902['if']('length','ck-hidden',_0x5c5f12=>!_0x5c5f12)],'aria-label':Et(_0x1d864f,'Thread\x20comments')},'children':this['visibleViews']});}get['_shouldCollapse'](){return this['_model']['weight']>this['_config']['maxThreadTotalWeight']&&!this['isActive']&&!this['hasDirtyComment'];}['render'](){super['render'](),this['refreshVisibleViews'](),this['_setupKeyboardNavigation']();}['focus'](_0x494c72){-0x1===_0x494c72?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['destroy'](){this['_collapsedCommentsView']['destroy']();for(const _0x1e7cad of this['commentViews'])_0x1e7cad['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}['_handleNewCommentModel'](_0x8b8237,_0x5ae593){const _0x562c40=new this['_config']['CommentView'](this['locale'],_0x8b8237,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x562c40['viewUid']=_0x8b8237['id'],_0x562c40['delegate']('removeComment')['to'](this),_0x562c40['delegate']('updateComment')['to'](this),_0x562c40['delegate']('resolveCommentThread')['to'](this),_0x562c40['delegate']('editorReady')['to'](this),_0x562c40['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x562c40,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x562c40,_0x5ae593);}['_calculatePosition'](_0xbaaa76){const _0x13d461=this['_model']['_findOptimalIndex'](_0xbaaa76);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0xbaaa76['authoredAt']?_0x13d461-0x1:_0x13d461:_0x13d461-0x1;}['_handleInfoComment'](){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x29cd10={'id':'resolved','author':this['_model']['resolvedBy'],'authoredAt':this['_model']['resolvedAt'],'content':Et(this['locale'],'Marked\x20as\x20resolved'),'attributes':{}};this['resolvedCommentView']=new this['_config']['CommentView'](this['locale'],_0x29cd10,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x29cd10));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}['_handleRemoveCommentModel'](_0x143125){const _0x28b79e=this['commentViews']['remove'](_0x143125['id']);this['stopListening'](_0x28b79e),_0x28b79e['isEditMode']&&this['_updateHasDirtyComment'](),_0x28b79e['destroy']();}['_updateHasDirtyComment'](){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x5e6470=>_0x5e6470['isEditMode']);}['_rearrangeCollapse'](){const _0x1a17dc=function(_0x1bd657){const _0x3b6ad2=new _0x1d3c5e();for(const _0x4199ec of _0x1bd657)_0x3b6ad2['add'](_0x4199ec);return _0x3b6ad2;}(this['commentViews']),_0x53e5e0=this['_collapsedCommentsView']['count'];for(let _0xd5a7f2=0x1;_0xd5a7f2<=_0x53e5e0;_0xd5a7f2++)_0x1a17dc['remove'](0x1);for(const _0x2cf8ed of _0x1a17dc)_0x2cf8ed['collapse']();_0x53e5e0>0x0&&_0x1a17dc['add'](this['_collapsedCommentsView'],0x1),Dt(_0x4d2557(Array['from'](this['visibleViews']),Array['from'](_0x1a17dc)),this['visibleViews'],_0x1a17dc);}['_rearrangeExpand'](){Dt(_0x4d2557(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x3ba061 of this['visibleViews'])_0x3ba061['expand']();}['_setupKeyboardNavigation'](){this['commentViews']['forEach'](_0x37e9ce=>{this['focusTracker']['add'](_0x37e9ce['element']),this['keystrokes']['listenTo'](_0x37e9ce['element']);}),this['commentViews']['on']('change',(_0x12a9bf,_0x138601)=>{for(const _0x59f434 of _0x138601['removed'])this['focusTracker']['remove'](_0x59f434['element']),this['keystrokes']['stopListening'](_0x59f434['element']);for(const _0x14c02e of Array['from'](_0x138601['added'])['reverse']())this['focusTracker']['add'](_0x14c02e['element']),this['keystrokes']['listenTo'](_0x14c02e['element']);});}};function Dt(_0xac38fe,_0x9325d1,_0x1b036c){let _0x46b3f2=0x0;for(const _0x5d2646 of _0xac38fe)switch(_0x5d2646){case'insert':_0x9325d1['add'](_0x1b036c['get'](_0x46b3f2),_0x46b3f2),_0x46b3f2++;break;case'delete':_0x9325d1['remove'](_0x46b3f2);break;case'equal':_0x46b3f2++;}}var Vt=class extends ht{constructor(_0x169269){super(_0x169269);const _0x359cd6=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x359cd6['to']('contextValue',_0x5812b1=>Et(_0x169269,'THREAD_CONTEXT_LABEL',_0x5812b1)),'tabindex':-0x1},'children':[{'text':_0x359cd6['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},Bt=class extends ht{['_model'];['reopenButtonView'];['contextView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0x4601fe,_0x5522ca){super(_0x4601fe);const _0x3498d7=this['bindTemplate'];this['_model']=_0x5522ca,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x46cfaf(),this['keystrokes']=new _0x44e221(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['bind']('hasContext')['to'](this['_model'],'context',_0xba422=>!!_0xba422),this['bind']('contextValue')['to'](this['_model'],'context',_0xe29092=>_0xe29092&&_0xe29092['value']?this['_trimContextValue'](_0xe29092['value']):Et(this['locale'],'Comment\x20was\x20made\x20on\x20an\x20element')),this['setTemplate']({'tag':'div','attributes':{'class':['ck-thread__header']},'children':[{'tag':'div','attributes':{'class':['ck-context-wrapper']},'children':[{'tag':'div','attributes':{'class':['ck-context',_0x3498d7['if']('hasContext','ck-context--quotes')]},'children':[this['contextView']]}]},{'tag':'div','attributes':{'class':['ck-annotation__actions']},'children':[this['reopenButtonView']]}]});}['render'](){super['render'](),this['_attachContextActions'](),this['_setupKeyboardNavigation']();}['focus'](){this['focusCycler']['focusFirst']();}['_createReopenButton'](){const _0x3e56fa=new _0x5a263d(this['locale']);return _0x3e56fa['label']=Et(this['locale'],'Reopen'),_0x3e56fa['tooltip']=Et(this['locale'],'Reopen'),_0x3e56fa['icon']=_0x16ab3a,_0x3e56fa['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x393f80=>!_0x393f80),_0x3e56fa['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x3357ff,_0x202f3d)=>_0x3357ff&&_0x202f3d),_0x3e56fa['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x3e56fa;}['_trimContextValue'](_0x312959){if(_0x312959['length']<0x96)return _0x312959;const _0x2ab65d=_0x312959['lastIndexOf']('\x20',0x93);return _0x312959['substring'](0x0,_0x2ab65d>-0x1?_0x2ab65d:0x93)+'...';}['_attachContextActions'](){const _0xdb275e=this['element']['querySelector']('.ck-context'),_0x57a004=_0xdb275e['querySelector']('.ck-context__value');this['listenTo'](_0xdb275e,'mouseenter',()=>{_0x57a004['offsetWidth']<_0x57a004['scrollWidth']&&_0xdb275e['classList']['add']('overlay');}),this['listenTo'](_0xdb275e,'mouseleave',()=>{_0xdb275e['classList']['remove']('overlay');});}['_setupKeyboardNavigation'](){this['keystrokes']['listenTo'](this['element']);for(const _0x2bd506 of this['focusables'])this['focusTracker']['add'](_0x2bd506['element']),this['keystrokes']['listenTo'](_0x2bd506['element']);}['_createContextView'](){const _0x36b0a6=new Vt(this['locale']);return _0x36b0a6['bind']('contextValue')['to'](this),_0x36b0a6;}},Ht=class extends ht{['_model'];['_config'];['commentThreadHeaderView'];['commentThreadInputView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];constructor(_0x25a382,_0x295a65,_0x4342da,_0x222e5e){super(_0x25a382),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x295a65,this['_localUser']=_0x4342da,this['_config']=_0x222e5e,this['commentThreadHeaderView']=new Bt(_0x25a382,_0x295a65),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x30e892(_0x25a382,Et(_0x25a382,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Lt(_0x25a382,_0x295a65,Object['assign']({'CommentView':this['_config']['CommentView']},_0x222e5e)),this['commentsListView']['delegate']('removeComment')['to'](this),this['commentsListView']['delegate']('updateComment')['to'](this),this['commentsListView']['delegate']('resolveCommentThread')['to'](this),this['commentsListView']['delegate']('editorReady')['to'](this),this['commentsListView']['delegate']('editorDestroyed')['to'](this),this['commentsListView']['bind']('isActive')['to'](this),this['listenTo'](this,'resolveCommentThread',()=>{this['focus']();}),this['set']('length',this['commentsListView']['length']),this['bind']('length')['to'](this['commentsListView'],'length'),this['commentThreadInputView']=this['_createCommentThreadInputView'](),this['commentThreadInputView']['delegate']('editorReady')['to'](this),this['commentThreadInputView']['delegate']('editorDestroyed')['to'](this),this['on']('removeComment',()=>this['focus']()),this['bind']('isDirty')['to'](this['commentsListView'],'hasDirtyComment',this['commentThreadInputView']['commentInputView'],'value',(_0x3f61e7,_0x4458ea)=>_0x3f61e7||!!_0x4458ea),this['bind']('isUnlinked')['to'](_0x295a65,'unlinkedAt',_0x385660=>!!_0x385660);let _0x429abb=null;const _0x47e1c3=()=>{const _0x69e296=this['_model']['comments']['first']||null;_0x69e296!==_0x429abb&&(_0x429abb&&this['stopListening'](_0x429abb,'change:content'),_0x429abb=_0x69e296,_0x69e296&&this['listenTo'](_0x69e296,'change:content',_0x47e1c3));const _0x224c03=_0x69e296?_0x69e296['author']['name']:this['_localUser']['name'],_0x21a8ee=_0x69e296?new DOMParser()['parseFromString'](_0x3e71f1(_0x69e296['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']}),'text/html')['body']['textContent']:'',_0x35c4cb=Et(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x224c03]);this['set']('ariaLabel',_0x21a8ee?_0x35c4cb+'\x20'+_0x21a8ee:_0x35c4cb);};this['listenTo'](this['_model']['comments'],'change',_0x47e1c3),_0x47e1c3(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x46cfaf(),this['keystrokes']=new _0x44e221(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x300152=>_0x300152['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x2c8780(this,this['focusables']);}async['destroy'](){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}['_createCommentThreadInputView'](){const _0x357e2f=new xt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x11501f=_0x357e2f['commentInputView'];return _0x357e2f['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x11501f,'value',(_0xe871b,_0x2d45ca,_0x5b2158,_0x232892,_0x27e3e6)=>!!_0x27e3e6||!!_0x232892&&_0x5b2158&&!_0x2d45ca||_0xe871b&&_0x5b2158&&!_0x2d45ca),_0x11501f['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x1c88fc,_0x2f35bd,_0x43b485)=>{let _0x217c91;return _0x217c91=_0x43b485&&_0x2f35bd?'Reply\x20to\x20reopen\x20discussion...':_0x1c88fc?'Reply...':'Write\x20a\x20comment...',Et(this['locale'],_0x217c91);}),_0x11501f['bind']('submitLabel')['to'](this,'length',_0x5c7506=>Et(this['locale'],_0x5c7506?'Reply':'Comment')),_0x11501f['on']('submit',(_0x228877,_0x5981d0)=>{this['fire']('addComment',_0x5981d0),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x11501f['on']('cancel',()=>{this['focus']();}),_0x11501f['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x11501f['on']('cancel',_0x465109=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x465109['stop']());}),this['on']('change:isActive',(_0x230326,_0x359d21,_0x308afe)=>{_0x308afe||this['length']||_0x11501f['value']||this['fire']('removeCommentThread');}),_0x357e2f;}};const Ft=/* #__PURE__ -- @preserve */
_0x505bcf(Ht);var Ut=class extends Ft{['commentThreadChildren'];['containerElement'];['resolveButton'];['_boundFirstCommentView'];constructor(_0x2feeda,_0x32dd10,_0x2bed55,_0x284d96){super(_0x2feeda,_0x32dd10,_0x2bed55,_0x284d96),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x2feeda,this['resolveButton']=this['_createResolveButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x3935c6,_0x551d68,_0x2a8ed2)=>{_0x2a8ed2||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0xf754e2,_0x1bfcc5,_0x3142a0)=>{_0x3142a0&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}['getTemplate'](){const _0x3e6cdb=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x3e6cdb['if']('isActive','ck-thread--active'),_0x3e6cdb['if']('isUnlinked','ck-thread--unlinked'),_0x3e6cdb['to']('actionIndicator',_0x36413c=>_0x36413c?'ck-thread--'+_0x36413c:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x3e6cdb['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id']},'children':[{'tag':'div','attributes':{'class':'ck-thread__container'},'children':this['commentThreadChildren']}]};}['render'](){super['render'](),this['containerElement']=this['element']['querySelector']('.ck-thread__container'),this['_model']['on']('change:archivedAt',()=>{this['_updateArchivedThreadHeader']();}),this['_updateArchivedThreadHeader']();}['_cancelAllConfirms'](){this['cancelConfirm']();for(const _0xfdaef8 of this['commentsListView']['commentViews'])_0xfdaef8['cancelConfirm']();}['_bindFirstCommentView'](){const {locale:_0x214c74}=this,_0x293cfc=this['commentsListView']['commentViews']['get'](0x0);_0x293cfc===this['_boundFirstCommentView']||_0x293cfc['isSystemComment']||(this['_boundFirstCommentView']=_0x293cfc,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x293cfc,'actionIndicator',_0x5b41f0=>'remove'===_0x5b41f0?'remove':null),_0x293cfc['placeholder']=Et(_0x214c74,'Write\x20a\x20comment...'),_0x293cfc['removeButton']['on']('execute',_0x4d90f1=>{_0x4d90f1['stop'](),this['showConfirm'](Et(_0x214c74,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x293cfc['focus']();}),_0x293cfc['actionBar']['add'](this['resolveButton'],0x0),_0x293cfc['focusables']['add'](this['resolveButton'],0x0));}['_createResolveButton'](){const _0x5d7454=new _0x4ccc42(this['locale']);return _0x5d7454['label']=Et(this['locale'],'Resolve'),_0x5d7454['tooltip']=Et(this['locale'],'Resolve'),_0x5d7454['icon']=_0x3aa4d1,_0x5d7454['extendTemplate']({'attributes':{'class':'ck-comment--resolve'}}),_0x5d7454['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x59a239=>!_0x59a239),_0x5d7454['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x3ca23f,_0x4ab7f5)=>_0x3ca23f&&!_0x4ab7f5),_0x5d7454['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x5d7454;}['_updateArchivedThreadHeader'](){this['_model']['archivedAt']?this['commentThreadChildren']['has'](this['commentThreadHeaderView'])||(this['commentThreadChildren']['add'](this['commentThreadHeaderView'],0x0),this['focusables']['add'](this['commentThreadHeaderView'],0x0)):this['commentThreadChildren']['has'](this['commentThreadHeaderView'])&&(this['commentThreadChildren']['remove'](this['commentThreadHeaderView']),this['focusables']['remove'](this['commentThreadHeaderView']));}},Wt=class extends ht{constructor(_0x4d8399){super(_0x4d8399),this['set']('content',''),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',(_0x15917b,_0x4aea08,_0x4dbeb5)=>{this['element']['innerHTML']=_0x4dbeb5;}),this['element']['innerHTML']=this['content'];}},Kt=class extends ht{['visibleView'];['ariaDescriptionView'];['focusables'];['focusTracker'];['keystrokes'];['focusCycler'];['_model'];['_config'];constructor(_0x35c469,_0x30538f,_0x5177f6){super(_0x35c469),this['_model']=_0x30538f,this['_config']=_0x5177f6,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['bind']('ariaLabel')['to'](_0x30538f,'content',_0x30538f,'authoredAt',(_0x5ef655,_0x9b5348)=>Et(_0x35c469,'COMMENT_ARIA_LABEL',[_0x30538f['author']['name'],_0x5177f6['formatDateTime'](_0x9b5348),new DOMParser()['parseFromString'](_0x5ef655,'text/html')['body']['textContent'],_0x30538f['isExternal']?this['getExternalCommentNote']():''])),this['ariaDescriptionView']=new _0x30e892(_0x35c469,Et(_0x35c469,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new at(),this['focusTracker']=new _0x46cfaf(),this['keystrokes']=new _0x44e221(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x410e99=>_0x410e99['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['expand'](){this['isCollapsed']=!0x1;}['collapse'](){this['isEditMode']||(this['isCollapsed']=!0x0);}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['_setupKeyboardNavigation']();}async['destroy'](){await this['visibleView']['get'](0x0)['destroy'](),super['destroy']();}['switchToEditMode'](){this['isEditMode']||(this['isEditMode']=!0x0,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentInputView']()));}['switchToDisplayMode'](){this['isEditMode']&&(this['isEditMode']=!0x1,this['visibleView']['remove'](0x0)['destroy'](),this['visibleView']['add'](this['_createCommentContentView']()));}['getExternalCommentNote'](){return'importWord'===this['_model']['attributes']['@external']['source']?Et(this['locale'],'EXTERNAL_IMPORT_WORD_COMMENT'):Et(this['locale'],'EXTERNAL_COMMENT');}['getUserViewNotificationText'](){return this['_model']['isExternal']?'importWord'===this['_model']['attributes']['@external']['source']?Et(this['locale'],'EXTERNAL_IMPORT_WORD_AVATAR',this['_model']['creator']['name']):Et(this['locale'],'EXTERNAL_AVATAR',this['_model']['creator']['name']):null;}['_createCommentContentView'](){const _0x54f75c=new Wt(this['locale']);return _0x54f75c['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0xd48704,_0x596b8f)=>_0x596b8f?_0x3e71f1(_0xd48704,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0xd48704),_0x54f75c;}['_createCommentInputView'](){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0x4a84b9=new St(this['locale'],this['_config']['editorConfig']);return _0x4a84b9['value']=this['_model']['content'],_0x4a84b9['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x4a84b9['submitLabel']=Et(this['locale'],'Save'),_0x4a84b9['on']('submit',(_0x45646e,_0x484aa4)=>{this['fire']('updateComment',this['_model']['id'],_0x484aa4),this['switchToDisplayMode'](),this['focus']();}),_0x4a84b9['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0x4a84b9['once']('editorReady',()=>{_0x4a84b9['focus']();}),_0x4a84b9['createEditor'](),_0x4a84b9['delegate']('editorReady')['to'](this),_0x4a84b9['delegate']('editorDestroyed')['to'](this),_0x4a84b9;}['_setupKeyboardNavigation'](){const _0x4790a5=this['element'];this['keystrokes']['listenTo'](_0x4790a5);for(const _0xdf5d7e of this['focusables'])this['focusTracker']['add'](_0xdf5d7e['element']),this['keystrokes']['listenTo'](_0xdf5d7e['element']);this['focusables']['on']('change',(_0x4255cb,_0x62915c)=>{for(const _0x4afe9b of _0x62915c['removed'])this['focusTracker']['remove'](_0x4afe9b['element']),this['keystrokes']['stopListening'](_0x4afe9b['element']);for(const _0x445887 of _0x62915c['added'])this['focusTracker']['add'](_0x445887['element']),this['keystrokes']['listenTo'](_0x445887['element']);}),this['keystrokes']['set']('enter',(_0x105e10,_0xa5c4e3)=>{_0x4790a5===_0x105e10['target']&&(this['focusCycler']['focusFirst'](),_0xa5c4e3());}),this['keystrokes']['set']('esc',(_0x45bad2,_0x107672)=>{_0x4790a5!==_0x45bad2['target']&&(this['focus'](),_0x107672());});}};const Gt=/* #__PURE__ -- @preserve */
_0x505bcf(Kt);var Yt=class extends Gt{['actionBar'];['userView'];constructor(_0x3faaaf,_0x133b61,_0x1e16f6){super(_0x3faaaf,_0x133b61,_0x1e16f6),this['set']('actionIndicator',null),this['set']('placeholder',Et(_0x3faaaf,'Reply...')),this['bind']('authoredAt')['to'](_0x133b61),this['bind']('resolvedAt')['to'](_0x133b61),this['actionBar']=this['createCollection'](),this['isSystemComment']||(this['editButton']=this['_createEditButton'](),this['removeButton']=this['_createRemoveButton'](),this['items']=this['createCollection'](),this['items']['addMany']([this['editButton'],this['removeButton']]),this['dropdown']=this['_createDropdown'](),this['actionBar']['add'](this['dropdown']),this['focusables']['add'](this['dropdown'])),this['userView']=new _0x95843f(_0x3faaaf,_0x133b61['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0x133b61,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}['getTemplate'](){const _0x10c053=this['bindTemplate'],_0x50bdb3=[{'tag':'div','attributes':{'class':['ck-comment__info','ck-annotation__info']},'children':[{'tag':'span','children':[{'text':this['userView']['name']}],'attributes':{'class':['ck-comment__info-name','ck-annotation__info-name'],'data-cke-tooltip-text':this['userView']['name']}},{'tag':'time','attributes':{'datetime':_0x10c053['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x10c053['to']('authoredAt',_0x40024=>this['_config']['formatDateTime'](_0x40024))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x10c053['if']('isEditMode','ck-comment__actions--hidden'),_0x10c053['if']('isEditMode','ck-annotation__actions--hidden')]},'children':this['actionBar']},{'tag':'div','attributes':{'class':['ck-annotation__content-wrapper']},'children':this['visibleView']},this['ariaDescriptionView']];return this['_model']['isExternal']&&_0x50bdb3['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper'],'tabindex':-0x1,'aria-label':_0x10c053['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x10c053['if']('isEditMode','ck-comment--edit'),_0x10c053['if']('isSystemComment','ck-comment--info'),_0x10c053['to']('actionIndicator',_0x1b058d=>_0x1b058d?'ck-comment--'+_0x1b058d:'')],'data-author-id':this['_model']['author']['id'],'data-comment-id':this['_model']['id'],'role':'group'},'children':[this['userView'],{'tag':'div','attributes':{'class':['ck-comment__main','ck-annotation__main']},'children':_0x50bdb3}]}]};}['_createEditButton'](){const _0x2f63e5=new _0x5a263d(this['locale']);return _0x2f63e5['label']=Et(this['locale'],'Edit'),_0x2f63e5['icon']=_0xb8044e,_0x2f63e5['withText']=!0x0,_0x2f63e5['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0x2f63e5['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x5c856a=>!_0x5c856a),_0x2f63e5['bind']('isVisible')['to'](this['_model'],'isEditable'),_0x2f63e5['on']('execute',()=>this['switchToEditMode']()),_0x2f63e5;}['_createRemoveButton'](){const _0x488a62=new _0x5a263d(this['locale']);return _0x488a62['label']=Et(this['locale'],'Remove'),_0x488a62['icon']=_0x2d40b9,_0x488a62['withText']=!0x0,_0x488a62['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0x488a62['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x57272d=>!_0x57272d),_0x488a62['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0x488a62['on']('execute',()=>{this['showConfirm'](Et(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0x488a62;}['_createDropdown'](){const _0x4cdc19=ct(this['locale'],_0x3bd6df),_0x43cfb1=_0x4cdc19['panelView']['children'],_0x222ba8=new ot(this['locale']),_0x4da45a=_0x4cdc19['bindTemplate'];dt(_0x4cdc19,()=>this['items']['find'](_0x5d31ca=>_0x5d31ca['isVisible'])),_0x4cdc19['extendTemplate']({'attributes':{'class':[_0x4da45a['if']('isVisible','ck-hidden',_0x354f67=>!_0x354f67)]}});const _0x56a757=(_0x80ef74,_0x314728=-0x1)=>{const _0x38ec92=new nt(this['locale']);_0x38ec92['children']['add'](_0x80ef74);const _0x5cbe6b=_0x314728>-0x1?_0x314728:_0x222ba8['items']['length'];_0x222ba8['items']['add'](_0x38ec92,_0x5cbe6b);const _0x1092ba=Array['from'](this['items']);_0x4cdc19['unbind']('isEnabled','isVisible'),_0x4cdc19['bind']('isEnabled')['toMany'](_0x1092ba,'isEnabled',(..._0x2eec7a)=>_0x2eec7a['some'](_0x518e39=>_0x518e39)),_0x4cdc19['bind']('isVisible')['toMany'](_0x1092ba,'isVisible',(..._0x513463)=>_0x513463['some'](_0x19e213=>_0x19e213));};_0x4cdc19['panelPosition']='sw',_0x4cdc19['buttonView']['set']({'label':Et(this['locale'],'Show\x20more\x20items'),'icon':_0x4b53ab});for(const _0x46f3c3 of this['items'])_0x56a757(_0x46f3c3);return _0x43cfb1['add'](_0x222ba8),_0x4cdc19['listenTo'](this['items'],'add',(_0x43d699,_0x440b27,_0x10c33a)=>{_0x56a757(_0x440b27,_0x10c33a);}),_0x4cdc19['listenTo'](this['items'],'remove',(_0x1720dc,_0x4c784d,_0x1a2479)=>{_0x222ba8['items']['remove'](_0x1a2479);}),_0x4cdc19;}['_attachActions'](_0x12914b,_0x4764c9){const _0x474dc2=_0x12914b&&_0x12914b['element'];_0x474dc2&&(this['listenTo'](_0x474dc2,'mouseenter',()=>this['actionIndicator']=_0x4764c9),this['listenTo'](_0x474dc2,'focus',()=>this['actionIndicator']=_0x4764c9),this['listenTo'](_0x474dc2,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0x474dc2,'blur',()=>this['actionIndicator']=null));}['_createCommentInputView'](){const _0x21b587=super['_createCommentInputView']();return _0x21b587['bind']('placeholder')['to'](this),_0x21b587;}['render'](){super['render'](),this['_attachActions'](this['editButton'],'edit'),this['_attachActions'](this['removeButton'],'remove');}};function Xt(_0xb0dd0){const _0x3b9c66=_0x17f62c(_0xb0dd0,0x1e),_0xa76c01=new MutationObserver(_0x2d3521=>{for(const _0x24d914 of _0x2d3521)('attributes'==_0x24d914['type']&&'class'==_0x24d914['attributeName']||'childList'==_0x24d914['type']||'characterData'==_0x24d914['type'])&&_0x3b9c66();});return{'attach'(_0x40881d){_0xa76c01['observe'](_0x40881d,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterD