@ckeditor/ckeditor5-comments 48.5.0-alpha.2 → 48.5.0-alpha.3
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.
- package/dist/index.js +11 -11
- package/package.json +16 -16
package/dist/index.js
CHANGED
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
((()=>Ot)());constructor(_0x241c87={}){(_0x241c87=Object['assign']({},_0x241c87))['plugins']||(_0x241c87['plugins']=CommentEditor['defaultPlugins']),super(_0x241c87),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 _0x2ebd4d=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x2ebd4d))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0x5b0d1b=>{const _0x33e84d=this['model']['document']['getRoot'](),_0x3f4e7e=_0x33e84d&&_0x33e84d['getChild'](_0x33e84d['childCount']-0x1);_0x5b0d1b['setSelection'](_0x3f4e7e,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0x3f6bd1=this['editing']['view'],_0x216852=_0x3f6bd1['document']['getRoot'](),_0x4da806=_0x216852['getChild'](0x0);_0x216852['childCount']>0x1||!_0x4da806||'p'!=_0x4da806['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(mt(_0x3f6bd1,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x4da806['placeholder']=this['placeholder']),ut({'view':_0x3f6bd1,'element':_0x4da806,'keepOnFocus':!0x0}),this['placeholderElement']=_0x4da806);}},St=class extends ht{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x50a424,_0x384d06={}){super(_0x50a424),this['editor']=null,this['_editorConfig']=_0x384d06,this['set']('value',_0x384d06['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Et(_0x50a424,'Reply...')),this['set']('submitLabel',Et(_0x50a424,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new _0x1c4986(),this['focusTracker']=new _0x52e6a6(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x2cf096=>!_0x2cf096['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',(_0x3b1778,_0x3aaf58)=>{this['cancelButtonView']['fire']('execute'),_0x3aaf58();}),this['keystrokes']['set']('Ctrl+Enter',(_0x591aef,_0x427c92)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x427c92());}),this['on']('submit',(_0x1871b8,_0x4fc26e)=>{_0x4fc26e['length']>0xfde8?(alert(Et(_0x50a424,'TOO_LONG_COMMENT_ALERT',[_0x4fc26e['length'],0xfde8])),_0x1871b8['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 _0x47a4b8=this['editor'];this['element']['insertBefore'](_0x47a4b8['ui']['element'],this['element']['firstChild']),_0x47a4b8['model']['document']['on']('change',()=>this['value']=_0x47a4b8['getData']()),_0x47a4b8['bind']('placeholder')['to'](this),this['focusables']['add'](_0x47a4b8['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x18fa9c){-0x1===_0x18fa9c?(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:_0x58f621}=this,_0xfc22dc=new _0x44164c(_0x58f621);return _0xfc22dc['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0xfc22dc['withText']=!0x0,_0xfc22dc['bind']('label')['to'](this,'submitLabel'),_0xfc22dc['on']('execute',()=>{this['fire']('submit',this['value']);}),_0xfc22dc['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x2fc519,_0x30e371)=>!_0x30e371&&!!_0x2fc519['trim']()),_0xfc22dc;}_createCancelButton(){const {locale:_0xe2dcc3}=this,_0x1249b3=new _0x44164c(_0xe2dcc3);return _0x1249b3['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x1249b3['label']=Et(_0xe2dcc3,'Cancel'),_0x1249b3['withText']=!0x0,_0x1249b3['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x1249b3;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x595d33=>{this['focusTracker']['add'](_0x595d33['element']);}),this['focusables']['on']('change',(_0x37f5b0,_0x1ffd3d)=>{for(const _0x2528e7 of Array['from'](_0x1ffd3d['added'])['reverse']())this['focusTracker']['add'](_0x2528e7['element']);});}},xt=class extends ht{constructor(_0x1bd4b4,_0x564a93,_0x5b0639){super(_0x1bd4b4),this['commentInputView']=new St(_0x1bd4b4,_0x5b0639),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x1991d2,_0x469d47)=>_0x1991d2||!!_0x469d47),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 _0x411e69(_0x1bd4b4,_0x564a93),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'](_0x183838){this['commentInputView']['focus'](_0x183838);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0x299f7f,_0x499242)=>{const {submitButtonView:_0x549171,cancelButtonView:_0x480125,editor:_0x43effa}=this['commentInputView'];[_0x549171['element'],_0x480125['element'],_0x43effa?_0x43effa['editing']['view']['getDomRoot']():null]['filter'](_0x4a1aa3=>_0x4a1aa3)['some'](_0x616465=>_0x616465['contains'](_0x499242['target']))||(this['focus'](),_0x499242['preventDefault']());});}},Pt=class extends ht{constructor(_0x27d606){super(_0x27d606);const _0x5edeee=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x5edeee['to']('count',_0x40d8e4=>Et(_0x27d606,'NUMBER_OF_COMMENTS',_0x40d8e4))}]});}},Lt=class extends ht{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0xcc9035,_0x4554fe,_0x3e9e3c){super(_0xcc9035);const _0x53fe45=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x4554fe['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x4554fe,this['_config']=_0x3e9e3c,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x52e6a6(),this['keystrokes']=new _0x1c4986(),this['focusCycler']=new et({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x9ba6dc=>this['commentViews']['map'](_0x2ad5f2=>_0x2ad5f2['element'])['includes'](_0x9ba6dc['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Pt(_0xcc9035),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x2f049a=>_0x2f049a-this['_config']['maxCommentsWhenCollapsed']);for(const _0x6d596b of _0x4554fe['comments'])this['_handleNewCommentModel'](_0x6d596b);this['_handleInfoComment'](),this['listenTo'](_0x4554fe['comments'],'add',(_0xe4d797,_0x37e16a)=>{const _0x4dccaf=this['_calculatePosition'](_0x37e16a);this['length']++,this['_handleNewCommentModel'](_0x37e16a,_0x4dccaf),this['refreshVisibleViews']();}),this['listenTo'](_0x4554fe['comments'],'remove',(_0x21c05c,_0x5da7c9)=>{this['length']--,this['_handleRemoveCommentModel'](_0x5da7c9),this['refreshVisibleViews']();}),this['listenTo'](_0x4554fe,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x4554fe,'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',_0x53fe45['if']('length','ck-hidden',_0x2c8e80=>!_0x2c8e80)],'aria-label':Et(_0xcc9035,'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'](_0x2a8279){-0x1===_0x2a8279?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x36c748 of this['commentViews'])_0x36c748['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0x46b3ec,_0x223021){const _0x3b123d=new this['_config']['CommentView'](this['locale'],_0x46b3ec,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x3b123d['viewUid']=_0x46b3ec['id'],_0x3b123d['delegate']('removeComment')['to'](this),_0x3b123d['delegate']('updateComment')['to'](this),_0x3b123d['delegate']('resolveCommentThread')['to'](this),_0x3b123d['delegate']('editorReady')['to'](this),_0x3b123d['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x3b123d,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x3b123d,_0x223021);}_calculatePosition(_0x65ce45){const _0x3bc0bf=this['_model']['_findOptimalIndex'](_0x65ce45);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x65ce45['authoredAt']?_0x3bc0bf-0x1:_0x3bc0bf:_0x3bc0bf-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x56ed36={'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'],_0x56ed36,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x56ed36));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x5e26e4){const _0x212caf=this['commentViews']['remove'](_0x5e26e4['id']);this['stopListening'](_0x212caf),_0x212caf['isEditMode']&&this['_updateHasDirtyComment'](),_0x212caf['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x15b53c=>_0x15b53c['isEditMode']);}['_rearrangeCollapse'](){const _0x4e5e0d=function(_0x1fb559){const _0x4ac516=new _0x43adb0();for(const _0x588199 of _0x1fb559)_0x4ac516['add'](_0x588199);return _0x4ac516;}(this['commentViews']),_0x42bc2c=this['_collapsedCommentsView']['count'];for(let _0x66694e=0x1;_0x66694e<=_0x42bc2c;_0x66694e++)_0x4e5e0d['remove'](0x1);for(const _0x3d21f9 of _0x4e5e0d)_0x3d21f9['collapse']();_0x42bc2c>0x0&&_0x4e5e0d['add'](this['_collapsedCommentsView'],0x1),Dt(_0x11a26f(Array['from'](this['visibleViews']),Array['from'](_0x4e5e0d)),this['visibleViews'],_0x4e5e0d);}['_rearrangeExpand'](){Dt(_0x11a26f(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x3f2807 of this['visibleViews'])_0x3f2807['expand']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x13a963=>{this['focusTracker']['add'](_0x13a963['element']),this['keystrokes']['listenTo'](_0x13a963['element']);}),this['commentViews']['on']('change',(_0x1563b0,_0x13f1d9)=>{for(const _0x3eda44 of _0x13f1d9['removed'])this['focusTracker']['remove'](_0x3eda44['element']),this['keystrokes']['stopListening'](_0x3eda44['element']);for(const _0x49228d of Array['from'](_0x13f1d9['added'])['reverse']())this['focusTracker']['add'](_0x49228d['element']),this['keystrokes']['listenTo'](_0x49228d['element']);});}};function Dt(_0x468410,_0xda65e5,_0x3b7184){let _0x418ca0=0x0;for(const _0x2de7ba of _0x468410)switch(_0x2de7ba){case'insert':_0xda65e5['add'](_0x3b7184['get'](_0x418ca0),_0x418ca0),_0x418ca0++;break;case'delete':_0xda65e5['remove'](_0x418ca0);break;case'equal':_0x418ca0++;}}var Vt=class extends ht{constructor(_0x1b6dab){super(_0x1b6dab);const _0x930c5d=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x930c5d['to']('contextValue',_0x235a73=>Et(_0x1b6dab,'THREAD_CONTEXT_LABEL',_0x235a73)),'tabindex':-0x1},'children':[{'text':_0x930c5d['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},Bt=class extends ht{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x406e67,_0x9b7484){super(_0x406e67);const _0x47da21=this['bindTemplate'];this['_model']=_0x9b7484,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x52e6a6(),this['keystrokes']=new _0x1c4986(),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',_0x4326a0=>!!_0x4326a0),this['bind']('contextValue')['to'](this['_model'],'context',_0x2f0a41=>_0x2f0a41&&_0x2f0a41['value']?this['_trimContextValue'](_0x2f0a41['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',_0x47da21['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 _0x56474f=new _0x44164c(this['locale']);return _0x56474f['label']=Et(this['locale'],'Reopen'),_0x56474f['tooltip']=Et(this['locale'],'Reopen'),_0x56474f['icon']=_0x55df86,_0x56474f['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x33f0a1=>!_0x33f0a1),_0x56474f['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x15de0b,_0x5d970b)=>_0x15de0b&&_0x5d970b),_0x56474f['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0x56474f;}_trimContextValue(_0x596aa7){if(_0x596aa7['length']<0x96)return _0x596aa7;const _0x1c05cd=_0x596aa7['lastIndexOf']('\x20',0x93);return _0x596aa7['substring'](0x0,_0x1c05cd>-0x1?_0x1c05cd:0x93)+'...';}_attachContextActions(){const _0x5b7730=this['element']['querySelector']('.ck-context'),_0x1f6177=_0x5b7730['querySelector']('.ck-context__value');this['listenTo'](_0x5b7730,'mouseenter',()=>{_0x1f6177['offsetWidth']<_0x1f6177['scrollWidth']&&_0x5b7730['classList']['add']('overlay');}),this['listenTo'](_0x5b7730,'mouseleave',()=>{_0x5b7730['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x370c22 of this['focusables'])this['focusTracker']['add'](_0x370c22['element']),this['keystrokes']['listenTo'](_0x370c22['element']);}_createContextView(){const _0x28ebf4=new Vt(this['locale']);return _0x28ebf4['bind']('contextValue')['to'](this),_0x28ebf4;}},Ht=class extends ht{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x1e57ed,_0x2f1e7a,_0x4de6e9,_0x2c6597){super(_0x1e57ed),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x2f1e7a,this['_localUser']=_0x4de6e9,this['_config']=_0x2c6597,this['commentThreadHeaderView']=new Bt(_0x1e57ed,_0x2f1e7a),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x49723f(_0x1e57ed,Et(_0x1e57ed,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Lt(_0x1e57ed,_0x2f1e7a,Object['assign']({'CommentView':this['_config']['CommentView']},_0x2c6597)),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',(_0x43cf9f,_0x3793ce)=>_0x43cf9f||!!_0x3793ce),this['bind']('isUnlinked')['to'](_0x2f1e7a,'unlinkedAt',_0x5458b7=>!!_0x5458b7);let _0x1ade67=null;const _0x5ee886=()=>{const _0x312c69=this['_model']['comments']['first']||null;_0x312c69!==_0x1ade67&&(_0x1ade67&&this['stopListening'](_0x1ade67,'change:content'),_0x1ade67=_0x312c69,_0x312c69&&this['listenTo'](_0x312c69,'change:content',_0x5ee886));const _0x21d407=_0x312c69?_0x312c69['author']['name']:this['_localUser']['name'],_0x161cf3=_0x312c69?new DOMParser()['parseFromString'](_0x3dfab0(_0x312c69['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']}),'text/html')['body']['textContent']:'',_0x1ddfea=Et(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x21d407]);this['set']('ariaLabel',_0x161cf3?_0x1ddfea+'\x20'+_0x161cf3:_0x1ddfea);};this['listenTo'](this['_model']['comments'],'change',_0x5ee886),_0x5ee886(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x52e6a6(),this['keystrokes']=new _0x1c4986(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x32701e=>_0x32701e['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x26d96b(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x304b87=new xt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x59a95c=_0x304b87['commentInputView'];return _0x304b87['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x59a95c,'value',(_0x7e2a95,_0x5ca7dc,_0x3d414c,_0x160aa5,_0xfec3bf)=>!!_0xfec3bf||!!_0x160aa5&&_0x3d414c&&!_0x5ca7dc||_0x7e2a95&&_0x3d414c&&!_0x5ca7dc),_0x59a95c['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x21e9f,_0x47aed5,_0x2e0437)=>{let _0x4e91db;return _0x4e91db=_0x2e0437&&_0x47aed5?'Reply\x20to\x20reopen\x20discussion...':_0x21e9f?'Reply...':'Write\x20a\x20comment...',Et(this['locale'],_0x4e91db);}),_0x59a95c['bind']('submitLabel')['to'](this,'length',_0x532bc9=>Et(this['locale'],_0x532bc9?'Reply':'Comment')),_0x59a95c['on']('submit',(_0x5f2392,_0x44d427)=>{this['fire']('addComment',_0x44d427),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x59a95c['on']('cancel',()=>{this['focus']();}),_0x59a95c['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x59a95c['on']('cancel',_0x4a15db=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x4a15db['stop']());}),this['on']('change:isActive',(_0x4212f3,_0x52284b,_0x46e52c)=>{_0x46e52c||this['length']||_0x59a95c['value']||this['fire']('removeCommentThread');}),_0x304b87;}};const Ft=/* #__PURE__ -- @preserve */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
_0xf65c5e();var $t=class Annotation extends jt{['view'];focusableElements;_type;_target;constructor({view:_0x120401,target:_0x40eddb,type:_0x2f40f8,isVisible:_0x4ed875=!0x0}){super(),this['view']=_0x120401,this['view']['element']||this['view']['render'](),this['_type']=_0x2f40f8,this['_target']=_0x40eddb,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x43adb0([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x4bdc95,_0x29c52f)=>{this['view']['focusTracker']['add'](_0x29c52f);}),this['focusableElements']['on']('remove',(_0x3d698e,_0xe12c11)=>{this['view']['focusTracker']['remove'](_0xe12c11);}),this['set']('isVisible',_0x4ed875);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x206fd4=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x206fd4),_0x206fd4;}get targetRect(){const _0x114161=this['target'];if(null===_0x114161)return null;if(_0x114161 instanceof _0x132048)return _0x114161;const _0x109bfc=_0x114161['filter'](_0x1633f5=>function(_0x219188){return!!_0x219188['offsetParent']||!!_0x219188['getClientRects']()['item'](0x0);}(_0x1633f5));return 0x0===_0x109bfc['length']?null:_0x132048['getDomElementRects'](_0x109bfc[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x5776bf){this['view']['isActive']=_0x5776bf,this['view']['mainView']['isActive']=_0x5776bf;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x1a085d){if(!(null===_0x1a085d||_0x1a085d instanceof _0x132048||Array['isArray'](_0x1a085d)&&_0x1a085d['every'](_0x719687=>zt(_0x719687))))throw new _0x587c70('annotation-invalid-target',null,{'target':_0x1a085d});}_getNormalizedTarget(){const _0x4a5e7b='function'==typeof this['_target']?this['_target']():this['_target'];return zt(_0x4a5e7b)?[_0x4a5e7b]:_0x4a5e7b;}};function zt(_0x351863){return null!==_0x351863&&'object'==typeof _0x351863&&'nodeType'in _0x351863&&0x1===_0x351863['nodeType'];}var Jt=class extends _0x43adb0{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x2f37ce=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x52e6a6(),this['_focusTracker']['on']('change:isFocused',(_0x5dc4b5,_0x1e734c,_0x35727d)=>{_0x35727d||this['fire']('blur');});for(const _0x1158e2 of _0x2f37ce)this['add'](_0x1158e2);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0x1356e7){if(this['has'](_0x1356e7))throw new _0x587c70('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0x1356e7['innerView'],_0x1356e7),this['_viewToAnnotation']['set'](_0x1356e7['view'],_0x1356e7);for(const _0xb52d59 of _0x1356e7['focusableElements'])this['_focusTracker']['add'](_0xb52d59);if(this['listenTo'](_0x1356e7['focusableElements'],'add',(_0x1dde7d,_0x5aa659)=>{this['_focusTracker']['add'](_0x5aa659);}),this['listenTo'](_0x1356e7['focusableElements'],'remove',(_0x742409,_0x17efa3)=>{this['_focusTracker']['remove'](_0x17efa3);}),this['listenTo'](_0x1356e7['view']['focusTracker'],'change:isFocused',(_0x3de8e4,_0x67cacd,_0xd77b71)=>{_0xd77b71&&this['fire']('focus',_0x1356e7);}),_0x1356e7['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0x4f3174 of this)_0x4f3174['updateTargetRect']();}const _0x2b389c=this['_getOrderInContent'](_0x1356e7['view']['targetRect']);return super['add'](_0x1356e7,_0x2b389c);}['remove'](_0x341d2c){if(!this['has'](_0x341d2c))throw new _0x587c70('annotationcollection-not-existing-item',null);this['stopListening'](_0x341d2c['view']['focusTracker']),this['stopListening'](_0x341d2c['focusableElements']);for(const _0x136e86 of _0x341d2c['focusableElements'])this['_focusTracker']['remove'](_0x136e86);return this['_viewToAnnotation']['delete'](_0x341d2c['view']),this['_innerViewToAnnotation']['delete'](_0x341d2c['innerView']),super['remove'](_0x341d2c);}getByInnerView(_0x5c8825){return this['_innerViewToAnnotation']['get'](_0x5c8825);}getByView(_0x183848){return this['_viewToAnnotation']['get'](_0x183848);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0x2628af of this)_0x2628af['updateTargetRect']();this['_sort']();}_sort(){const _0x16d881=Array['from'](this)['sort']((_0x3aedbe,_0x196339)=>Zt(_0x3aedbe['view']['targetRect'],_0x196339['view']['targetRect']));for(let _0x3907b2=_0x16d881['length']-0x1;_0x3907b2>0x0;_0x3907b2--){const _0x3f60cb=_0x16d881[_0x3907b2];_0x3907b2!==this['getIndex'](_0x3f60cb)&&(this['remove'](_0x3f60cb),this['add'](_0x3f60cb));}}_getOrderInContent(_0x541d39){let _0x3c0e99=0x0;if(!_0x541d39)return this['length'];for(const _0xce9921 of this){const _0x32fc6e=_0xce9921['view']['targetRect'];if(_0x32fc6e){if(Zt(_0x541d39,_0x32fc6e)<0x0)return _0x3c0e99;_0x3c0e99++;}}return _0x3c0e99;}_areCachedRectsStale(){const _0x49f6b9=this['get'](0x0);if(!_0x49f6b9)return!0x1;const _0x361a7b=_0x49f6b9['view']['targetRect'],_0x17ccfb=_0x49f6b9['targetRect'];return!(!_0x361a7b||!_0x17ccfb)&&(_0x361a7b['top']!==_0x17ccfb['top']||_0x361a7b['left']!==_0x17ccfb['left']);}};function Qt({source:_0x5ea43d,target:_0x2acf77,filter:_0x996aeb}){for(const _0x3f02d3 of _0x5ea43d)_0x996aeb(_0x3f02d3)&&_0x2acf77['add'](_0x3f02d3);_0x2acf77['listenTo'](_0x5ea43d,'add',(_0x46b02e,_0x3ee3ae)=>{_0x996aeb(_0x3ee3ae)&&_0x2acf77['add'](_0x3ee3ae);}),_0x2acf77['listenTo'](_0x5ea43d,'remove',(_0x504a5f,_0x57ea51)=>{_0x2acf77['has'](_0x57ea51)&&_0x2acf77['remove'](_0x57ea51);});}function Zt(_0x2b877f,_0x452e6d){if(null===_0x2b877f&&null===_0x452e6d)return 0x0;if(null===_0x2b877f)return-0x1;if(null===_0x452e6d)return 0x1;const _0x12e318=_0x2b877f['top']-_0x452e6d['top'];return 0x0==_0x12e318?_0x2b877f['left']-_0x452e6d['left']:_0x12e318;}var ti=class extends _0x2886e3{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x27bc20){if(super(_0x27bc20),this['collection']=new Jt(),this['_visibleAnnotations']=new Jt(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0x27bc20 instanceof _0x4acb07){const _0x3be5af=_0x27bc20['locale'];_0x27bc20['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Et(_0x3be5af,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Et(_0x3be5af,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Et(_0x3be5af,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Et(_0x3be5af,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Et(_0x3be5af,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Et(_0x3be5af,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Et(_0x3be5af,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x54be10){this['collection']['add'](_0x54be10);}['remove'](_0x1ff7a0){this['collection']['remove'](_0x1ff7a0),_0x1ff7a0['destroy']();}refreshVisibility(){for(const _0x301266 of this['collection'])_0x301266['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0x3d839b){return this['collection']['getByInnerView'](_0x3d839b);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0x5dce8e of this['collection'])_0x5dce8e['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0x5d7ecb){this['fire']('_activateAnnotation',_0x5d7ecb);}createAnnotation(_0xf84bc8){return new $t(_0xf84bc8);}createAnnotationView(_0x5d0398,_0x11e1e7){return new qt(_0x5d0398,_0x11e1e7);}_addActiveAnnotation(_0x3ffa79){const _0x5af2b0=new Set(this['activeAnnotations']);_0x5af2b0['add'](_0x3ffa79),this['activeAnnotations']=_0x5af2b0;}_removeActiveAnnotation(_0xf88f16){const _0x4b4f57=new Set(this['activeAnnotations']);_0x4b4f57['delete'](_0xf88f16),this['activeAnnotations']=_0x4b4f57;}_bindAnnotationsToVisibleAnnotations(){const _0x3ab9ef=this['collection'],_0x861fac=this['_visibleAnnotations'];function _0xff83b8(_0x19089b){const _0x314d8a=_0x19089b['source'];_0x314d8a['isVisible']&&!_0x861fac['has'](_0x314d8a)?_0x861fac['add'](_0x314d8a):!_0x314d8a['isVisible']&&_0x861fac['has'](_0x314d8a)&&_0x861fac['remove'](_0x314d8a),_0x314d8a['view']['focusTracker']['remove'](_0x314d8a['view']['element']),_0x314d8a['view']['focusTracker']['add'](_0x314d8a['view']['element']);}this['listenTo'](_0x3ab9ef,'add',(_0x84b8d6,_0xc6aa28)=>{_0xc6aa28['isVisible']&&_0x861fac['add'](_0xc6aa28),this['listenTo'](_0xc6aa28,'change:isVisible',_0xff83b8);}),this['listenTo'](_0x3ab9ef,'remove',(_0x35a69d,_0x1aa6d4)=>{_0x861fac['has'](_0x1aa6d4)&&_0x861fac['remove'](_0x1aa6d4),this['stopListening'](_0x1aa6d4,'change:isVisible',_0xff83b8);});}_setupEnterAnnotationKeystroke(){const _0x27600e=_0x32fd8e=>{_0x32fd8e['on']('ready',()=>{_0x32fd8e['keystrokes']['set'](_0x1880a8,(_0x342937,_0x4756e6)=>{const _0x3fe08d=_0x48a874(this['activeAnnotations']['values']());_0x3fe08d&&(_0x3fe08d['view']['focus'](),_0x4756e6());});});};this['context']instanceof _0x4acb07?_0x27600e(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0x1c0d9d,_0x5b69b5)=>{_0x27600e(_0x5b69b5);});}_setupEscapeAnnotationHandling(){const _0x1e81cc=_0x8c75e=>{const _0x583482=_0x8c75e['source'],_0x50defc=[];let _0x2a48fb;if(Array['isArray'](_0x583482['target'])){_0x2a48fb=_0x583482['target'][0x0],this['context']instanceof _0x4acb07?_0x50defc['push'](this['context']):this['context']['editors']&&_0x50defc['push'](...this['context']['editors']);for(const _0x262370 of _0x50defc)for(const _0x273be4 of _0x262370['editing']['view']['domRoots']['values']())if(_0x273be4['contains'](_0x2a48fb))return void _0x262370['editing']['view']['focus']();_0x2a48fb['focus']();}};this['listenTo'](this['collection'],'add',(_0x157967,_0x296c9c)=>{this['listenTo'](_0x296c9c,'escape',_0x1e81cc,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x3bf6e5,_0x1f4f64)=>{this['stopListening'](_0x1f4f64,'escape',_0x1e81cc);});}};const ii=Symbol('noChannel'),ei={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},si=/* #__PURE__ -- @preserve */
|
|
30
|
-
|
|
31
|
-
_0xf65c5e();var oi=class extends _0x2886e3{_threads;_threadToController;_viewToController;static get requires(){return[ti,_0x4847f1,_0x5b5781];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x17e576){super(_0x17e576),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0x3dc4cb=this['context']['config'];_0x3dc4cb['define']('comments.maxCommentsWhenCollapsed',0x2),_0x3dc4cb['define']('comments.maxThreadTotalWeight',0x1f4),_0x3dc4cb['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0x3dc4cb['define']('comments.CommentThreadView',Ut),_0x3dc4cb['define']('comments.CommentView',Yt),_0x3dc4cb['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0xab2371=this['context']['plugins']['get'](ti);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x5b7221,_0x1681c7)=>this['_addCommentThread'](_0x1681c7)),this['on']('submitCommentThread',(_0x2aed0b,_0x28534d)=>this['_submitCommentThread'](_0x28534d)),this['on']('resolveCommentThread',(_0x2b5045,_0xa1202d)=>this['_resolveCommentThread'](_0xa1202d)),this['on']('resolveCommentThread',(_0x4a69e7,_0x33aab2)=>this['_updateActiveAnnotation'](_0x33aab2),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x2ecba4,_0x5f30df)=>this['_reopenCommentThread'](_0x5f30df)),this['on']('reopenCommentThread',(_0x2292b3,_0x133942)=>this['_updateActiveAnnotation'](_0x133942),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x5955c4,_0x141357)=>this['_removeCommentThread'](_0x141357)),this['on']('updateCommentThread',(_0x2b075d,_0x1b5df9)=>this['_updateCommentThread'](_0x1b5df9)),this['on']('updateCommentThread',(_0x146647,_0x31dffb)=>this['_updateActiveAnnotation'](_0x31dffb),{'priority':'lowest'}),this['on']('addComment',(_0x557e21,_0x830b65)=>this['_addComment'](_0x830b65)),this['on']('updateComment',(_0x35eb35,_0x1f19e1)=>this['_updateComment'](_0x1f19e1)),this['on']('removeComment',(_0x39f667,_0x4fe31d)=>this['_removeComment'](_0x4fe31d)),this['on']('addComment',(_0x3d54c7,{threadId:_0xa21c44,isFromAdapter:_0x54fa05})=>{if(_0x54fa05)return;const _0x3a270b=this['getCommentThread'](_0xa21c44),_0x5cd942=_0x3a270b&&this['_threadToController']['get'](_0x3a270b);_0x5cd942&&_0x5cd942['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0xab2371,'change:activeAnnotations',(_0x7104d7,_0x3ba0b7,_0x3e7156)=>{const _0x229ed9=Array['from'](_0x3e7156)['map'](_0x9cfde4=>this['_viewToController']['get'](_0x9cfde4['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0x229ed9?_0x229ed9['model']:null;});}set adapter(_0x2ce41a){if(this['_adapter'])throw new _0x587c70('commentsrepository-adapter-already-set');this['_adapter']=_0x2ce41a;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x5e7fd6=ii,threadId:_0x2f0188=_0x348c57(),comments:_0x4a0c5d=[],unlinkedAt:_0x45d854=null,resolvedAt:_0x1b0c4a=null,resolvedBy:_0x5f1053=null,target:_0xc74584=null,context:_0x2a7e87=null,attributes:_0x1ead84={},isResolvable:_0x1acb07=!0x0,isSubmitted:_0x2eae2d=!0x1,isFromAdapter:_0x463c1a=!0x1}={}){return this['fire'](ai('addCommentThread',_0x5e7fd6),{'channelId':_0x5e7fd6,'threadId':_0x2f0188,'comments':_0x4a0c5d,'unlinkedAt':_0x45d854,'resolvedAt':_0x1b0c4a,'resolvedBy':_0x5f1053,'target':_0xc74584,'context':_0x2a7e87,'attributes':_0x1ead84,'isFromAdapter':_0x463c1a,'isResolvable':_0x1acb07,'isSubmitted':_0x2eae2d}),this['getCommentThread'](_0x2f0188);}openNewCommentThread({channelId:_0x48feb2=ii,threadId:_0x31d5f9=_0x348c57(),target:_0x34e8b1,context:_0x1b8294=null,isResolvable:_0x60f5d9=!0x0}){if(this['_readOnlyChannels']['has'](_0x48feb2)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0x34e8b1)throw new _0x587c70('commentsrepository-missing-target');const _0x5133f9=this['addCommentThread']({'channelId':_0x48feb2,'threadId':_0x31d5f9,'target':_0x34e8b1,'context':_0x1b8294,'isResolvable':_0x60f5d9});if(!_0x5133f9)return null;const _0x16df33=this['_threadToController']['get'](_0x5133f9),_0x3d57a9=_0x16df33['view']['commentThreadInputView']['commentInputView'],_0x4e5a14=this['context']['plugins']['get'](ti),_0x3d2bf6=_0x4e5a14['getByInnerView'](_0x16df33['view']);return _0x4e5a14['activate'](_0x3d2bf6),_0x3d57a9['once']('editorReady',()=>_0x3d57a9['focus']()),_0x5133f9;}hasCommentThread(_0x90e0c4){if('string'!=typeof _0x90e0c4)throw new _0x587c70('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0x90e0c4);}updateCommentThread({channelId:_0x483d9d=ii,threadId:_0x2902df,context:_0x2a5ca7,unlinkedAt:_0x5d856f,attributes:_0x8312e0,isFromAdapter:_0x5e5eb8=!0x1}){return this['fire'](ai('updateCommentThread',_0x483d9d),{'channelId':_0x483d9d,'threadId':_0x2902df,'context':_0x2a5ca7,'unlinkedAt':_0x5d856f,'attributes':_0x8312e0,'isFromAdapter':_0x5e5eb8}),this['getCommentThread'](_0x2902df);}getCommentThread(_0x2bdf6e){if('string'!=typeof _0x2bdf6e)throw new _0x587c70('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x2bdf6e);}fetchCommentThread({channelId:_0x5e6628,threadId:_0x28d536}={}){const _0xa9fa3e=this['getCommentThread'](_0x28d536);if(_0xa9fa3e)return Promise['resolve'](_0xa9fa3e);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x587c70('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x5e6628,'threadId':_0x28d536})['then'](_0x5cc87d=>this['hasCommentThread'](_0x28d536)?this['getCommentThread'](_0x28d536):_0x5cc87d?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x5e6628},_0x5cc87d)):void 0x0)['catch'](_0x4836c4=>{throw console['error'](_0x4836c4),new _0x587c70('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0x113489,skipNotAttached:_0x2bb703=!0x1,skipEmpty:_0x9689f6=!0x1,toJSON:_0x51bf93=!0x1}={}){const _0x560210=[];for(const _0x5db999 of this['_threads']['values']())_0x113489&&_0x5db999['channelId']!==_0x113489||_0x2bb703&&!_0x5db999['isAttached']||_0x9689f6&&0x0===_0x5db999['length']||_0x560210['push'](_0x5db999);return _0x51bf93?_0x560210['map'](_0x46a0a1=>_0x46a0a1['toJSON']()):_0x560210;}getAnnotationForCommentThread(_0x2b4264){const _0x307864=this['_threadToController']['get'](_0x2b4264);return _0x307864&&this['context']['plugins']['get'](ti)['getByInnerView'](_0x307864['view'])||null;}getCommentThreadForAnnotation(_0x14cae1){const _0x3ffd6f=this['_viewToController']['get'](_0x14cae1['innerView']);return _0x3ffd6f?_0x3ffd6f['model']:null;}setActiveCommentThread(_0x18a7df){const _0x1d6dae=this['context']['plugins']['get'](ti);if(!_0x18a7df)return void(this['activeCommentThread']&&_0x1d6dae['deactivateAll']());const _0x4070c4=this['getCommentThread'](_0x18a7df);if(!_0x4070c4)throw new _0x587c70('commentsrepository-active-missing-comment-thread',null,{'threadId':_0x18a7df});if(!this['_threadToController']['has'](_0x4070c4))throw new _0x587c70('commentsrepository-active-not-attached',null,{'threadId':_0x18a7df});const _0xfb9d75=_0x1d6dae['getByInnerView'](this['_threadToController']['get'](_0x4070c4)['view']);_0x1d6dae['activate'](_0xfb9d75);}switchReadOnly(_0xab5f0c,_0x19b24f){_0xab5f0c?this['_readOnlyChannels']['add'](_0x19b24f):this['_readOnlyChannels']['delete'](_0x19b24f),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x1721a3){return this['_readOnlyChannels']['has'](_0x1721a3)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x57f88b,_0x54bce1){return new bt(_0x57f88b,_0x54bce1);}setPermissions(_0x3f9781,_0x13ea02=ii){this['_permissions']['set'](_0x13ea02,_0x3f9781),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0x216ebb=ii){return this['_permissions']['has'](_0x216ebb)?this['_permissions']['get'](_0x216ebb):ei;}_addCommentThread({channelId:_0x47a90e,threadId:_0x4f88ee,comments:_0x5bf8cb,unlinkedAt:_0x141934,resolvedAt:_0xef070f,resolvedBy:_0x3e2ecb,target:_0x5cc771,context:_0x2ea1a7,attributes:_0x2ddbf9,isFromAdapter:_0x1b7db3,isResolvable:_0x339df5,isSubmitted:_0x29c598}){if('string'!=typeof _0x4f88ee)throw new _0x587c70('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x4f88ee});if(this['hasCommentThread'](_0x4f88ee))throw new _0x587c70('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x4f88ee});const _0x19671c=new ri(this,{'channelId':_0x47a90e,'id':_0x4f88ee,'context':_0x2ea1a7,'attributes':_0x2ddbf9,'unlinkedAt':_0x141934,'resolvedAt':_0xef070f,'resolvedBy':_0x3e2ecb?this['context']['plugins']['get'](_0x5b5781)['getUser'](_0x3e2ecb):null,'isResolvable':_0x339df5,'isSubmitted':_0x29c598||_0x1b7db3});this['_threads']['set'](_0x4f88ee,_0x19671c);for(const _0x3b9004 of _0x5bf8cb)_0x19671c['_add'](this['_createNewComment']({'threadId':_0x4f88ee,..._0x3b9004}));return _0x5cc771&&_0x19671c['attachTo'](_0x5cc771),_0x1b7db3||!_0x19671c['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x47a90e,'threadId':_0x4f88ee});}_submitCommentThread({channelId:_0x2c1610,threadId:_0x134297}){if(!this['hasCommentThread'](_0x134297))throw new _0x587c70('commentsrepository-missing-comment-thread',this);const _0x14855f=this['getCommentThread'](_0x134297);if(_0x14855f['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0x49d697,comments:_0x1e734a,resolvedAt:_0x5073e6,resolvedBy:_0x130fd7,context:_0x32d214,attributes:_0xff971d}=_0x14855f,_0x2e1b03=this['context']['plugins']['get']('PendingActions'),_0x58dd5c=_0x2e1b03['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x2c1610,'threadId':_0x49d697,'comments':_0x1e734a['map'](_0x370cb7=>_0x370cb7['toJSON']()),'resolvedAt':_0x5073e6,'resolvedBy':_0x130fd7?_0x130fd7['id']:_0x130fd7,'context':_0x32d214,'attributes':_0xff971d})['then'](({comments:_0x292da7})=>{_0x2e1b03['remove'](_0x58dd5c);for(const _0x41942c of _0x292da7)this['_updateComment']({'channelId':_0x2c1610,'threadId':_0x134297,'commentId':_0x41942c['commentId'],'createdAt':_0x41942c['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x52c9f7=>{throw console['error'](_0x52c9f7),new _0x587c70('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0x556a61,target:_0x5aa9c3}){const _0x5ea33d=this['getCommentThread'](_0x556a61);if(!_0x5ea33d)throw new _0x587c70('commentsrepository-attach-missing-comment-thread',this);const _0x4403dc=this['context']['plugins']['get']('PendingActions'),_0x3c5390=this['context']['plugins']['get'](ti),_0x4c5ddf=this['_createCommentThreadView'](_0x5ea33d),_0x18bd74=new bt(_0x5ea33d,_0x4c5ddf);let _0x514c10=null;_0x4c5ddf['on']('change:isDirty',(_0x520ddb,_0x25db1f,_0x205cb1)=>{_0x205cb1?_0x514c10=_0x4403dc['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x514c10&&(_0x4403dc['remove'](_0x514c10),_0x514c10=null);}),this['_threadToController']['set'](_0x5ea33d,_0x18bd74),this['_viewToController']['set'](_0x4c5ddf,_0x18bd74);const _0x36256c=new qt(this['context']['locale'],_0x4c5ddf);_0x36256c['bind']('length')['to'](_0x4c5ddf),_0x36256c['bind']('isDirty')['to'](_0x4c5ddf,'isDirty',_0x4c5ddf,'length',(_0xc4747,_0x372f4d)=>_0xc4747||!_0x372f4d),_0x36256c['bind']('isActive')['to'](_0x4c5ddf),_0x36256c['type']='comment';const _0x1986e6=new $t({'view':_0x36256c,'target':_0x5aa9c3,'type':'comment','isVisible':!_0x5ea33d['archivedAt']&&!!('function'==typeof _0x5aa9c3?_0x5aa9c3():_0x5aa9c3)});return _0x4c5ddf['on']('escape',()=>{_0x1986e6['fire']('escape');}),this['_bindAnnotationToEditors'](_0x4c5ddf,_0x1986e6),_0x3c5390['add'](_0x1986e6),_0x1986e6;}_bindAnnotationToEditors(_0x272d8e,_0x298b14){this['listenTo'](_0x272d8e,'editorReady',(_0xff473e,_0x400870)=>{const _0x2f9a8f=_0x400870['ui']['view']['body']['bodyCollectionContainer'];_0x298b14['focusableElements']['add'](_0x2f9a8f),this['context']instanceof _0x4acb07&&this['context']['ui']['focusTracker']['add'](_0x2f9a8f);},{'priority':'highest'}),this['listenTo'](_0x272d8e,'editorDestroyed',(_0x27a417,_0x3e4744)=>{const _0x30f5dd=_0x3e4744['ui']['view']['body']['bodyCollectionContainer'];_0x298b14['focusableElements']['has'](_0x30f5dd)&&_0x298b14['focusableElements']['remove'](_0x30f5dd),this['context']instanceof _0x4acb07&&this['context']['ui']['focusTracker']['remove'](_0x30f5dd);});}_unbindEditors(_0x2be805){this['stopListening'](_0x2be805,'editorReady'),this['stopListening'](_0x2be805,'editorDestroyed');}_createCommentThreadView(_0x2cc1f6){const _0x371732=this['context']['plugins']['get'](_0x5b5781),{config:_0xe53bb0,locale:_0x1e5611}=this['context'],_0x42905a=_0x3c2e31(_0xe53bb0['get']('locale'),_0x1e5611);return new(0x0,(_0xe53bb0['get']('comments'))['CommentThreadView'])(_0x1e5611,_0x2cc1f6,_0x371732['me'],{'editorConfig':{..._0xe53bb0['get']('comments.editorConfig'),'licenseKey':this['context']['config']['get']('licenseKey')},'copyMarkers':_0xe53bb0['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0xe53bb0['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0xe53bb0['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0xe53bb0['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x42905a,'CommentView':_0xe53bb0['get']('comments')['CommentView']});}_resolveCommentThread({threadId:_0x3499b0,channelId:_0xef2e1e,resolvedAt:_0x29f4ee,resolvedBy:_0x1f82d0,isFromAdapter:_0x440e30}){if(!this['hasCommentThread'](_0x3499b0))throw new _0x587c70('commentsrepository-missing-comment-thread',null,{'threadId':_0x3499b0});const _0x190dcf=this['getCommentThread'](_0x3499b0);if(_0x190dcf['isResolved'])throw new _0x587c70('commentsrepository-resolved-comment-thread',null,{'threadId':_0x3499b0});const _0x387fa6=this['context']['plugins']['get'](_0x5b5781);if(_0x190dcf['resolvedBy']=_0x387fa6['getUser'](_0x1f82d0),_0x190dcf['resolvedAt']=_0x29f4ee,_0x440e30||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0x147abc=this['context']['plugins']['get']('PendingActions'),_0x35152f=_0x147abc['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0xef2e1e,'threadId':_0x3499b0})['then'](({resolvedAt:_0x44f5c6,resolvedBy:_0x2c1b11})=>{_0x147abc['remove'](_0x35152f),_0x190dcf['resolvedBy']['id']!==_0x2c1b11&&(_0x190dcf['resolvedBy']=_0x387fa6['getUser'](_0x2c1b11)),_0x190dcf['resolvedAt']=_0x44f5c6;})['catch'](_0x9107b5=>{throw console['error'](_0x9107b5),new _0x587c70('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x5ddf2f,channelId:_0x50a65f,isFromAdapter:_0x96589b}){if(!this['hasCommentThread'](_0x5ddf2f))throw new _0x587c70('commentsrepository-missing-comment-thread',null,{'threadId':_0x5ddf2f});const _0x3f06d9=this['getCommentThread'](_0x5ddf2f);if(!_0x3f06d9['isResolved'])throw new _0x587c70('commentsrepository-reopen-comment-thread',null,{'threadId':_0x5ddf2f});if(_0x3f06d9['resolvedBy']=null,_0x3f06d9['resolvedAt']=null,_0x96589b||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x3ee4a1=this['context']['plugins']['get']('PendingActions'),_0x298833=_0x3ee4a1['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x50a65f,'threadId':_0x5ddf2f})['then'](()=>_0x3ee4a1['remove'](_0x298833))['catch'](_0x35ea89=>{throw console['error'](_0x35ea89),new _0x587c70('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0x5f17c3,isFromAdapter:_0x340bab}){const _0x5b9e2b=this['getCommentThread'](_0x5f17c3);if(!_0x5b9e2b)throw new _0x587c70('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0x5f17c3),this['_threads']['delete'](_0x5f17c3),!_0x5b9e2b['isSubmitted']||_0x340bab||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0x519a28=this['context']['plugins']['get']('PendingActions'),{channelId:_0x3a0329}=_0x5b9e2b,_0x40d289=_0x519a28['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x3a0329,'threadId':_0x5f17c3})['then'](()=>_0x519a28['remove'](_0x40d289))['catch'](_0x49b552=>{throw console['error'](_0x49b552),new _0x587c70('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x5b970a,unlinkedAt:_0x2a788c,context:_0x3b1f62,attributes:_0x5b7e72,isFromAdapter:_0x3911da}){if('string'!=typeof _0x5b970a)throw new _0x587c70('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x5b970a});if(!this['hasCommentThread'](_0x5b970a))throw new _0x587c70('commentsrepository-missing-comment-thread',null,{'threadId':_0x5b970a});const _0x57edf4=this['getCommentThread'](_0x5b970a);let _0x5b64ee=!0x1;if(void 0x0!==_0x3b1f62&&_0x57edf4['context']!==_0x3b1f62&&(_0x57edf4['context']=_0x3b1f62,_0x5b64ee=!0x0),void 0x0!==_0x2a788c&&_0x57edf4['unlinkedAt']!==_0x2a788c&&(_0x57edf4['unlinkedAt']=_0x2a788c,_0x5b64ee=!0x0),_0x5b7e72&&!_0x8ea8ca(_0x5b7e72,_0x57edf4['attributes'])&&(_0x57edf4['attributes']=_0x5b7e72,_0x5b64ee=!0x0),!_0x5b64ee)return Promise['resolve']();if(!_0x57edf4['isSubmitted']||_0x3911da||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0x15a122=this['context']['plugins']['get']('PendingActions'),{channelId:_0x7a4a4}=_0x57edf4,_0x2cecc0=_0x15a122['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x7a4a4,'threadId':_0x5b970a,'context':_0x3b1f62,'unlinkedAt':_0x2a788c,'attributes':_0x5b7e72})['then'](()=>_0x15a122['remove'](_0x2cecc0))['catch'](_0x438d56=>{throw console['error'](_0x438d56),new _0x587c70('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0x37ca0f){const _0x390bee=this['context']['plugins']['get'](ti),_0x48ad2d=this['getCommentThread'](_0x37ca0f);if(_0x48ad2d['_isAttached']=!0x1,this['_threadToController']['has'](_0x48ad2d)){const _0x3b65bf=this['_threadToController']['get'](_0x48ad2d),_0x181f9f=_0x3b65bf['view'],_0x529e81=_0x390bee['getByInnerView'](_0x181f9f);this['_threadToController']['delete'](_0x48ad2d),this['_viewToController']['delete'](_0x181f9f),_0x529e81&&_0x390bee['remove'](_0x529e81),_0x3b65bf['destroy'](),_0x181f9f['destroy']()['then'](()=>{this['_unbindEditors'](_0x181f9f);});}}_updateActiveAnnotation({threadId:_0x289640,resolvedAt:_0x5d199b,unlinkedAt:_0x53bb3d}){const _0x55674a=!!_0x5d199b,_0x2cb776=this['context']['plugins']['get'](ti),_0x1242ce=this['getCommentThread'](_0x289640);if(this['_threadToController']['has'](_0x1242ce)){const _0x5891c1=this['_threadToController']['get'](_0x1242ce)['view'],_0x27e55d=_0x2cb776['getByInnerView'](_0x5891c1);_0x27e55d&&(_0x55674a&&_0x2cb776['_removeActiveAnnotation'](_0x27e55d),_0x53bb3d?_0x27e55d['isVisible']=!0x1:_0x27e55d['refreshVisibility']());}}_getExternalAuthor(_0x30036c){const _0x54ce7a=this['context']['plugins']['get'](_0x5b5781),_0x172b32=_0x46a734('external:'+_0x30036c),_0x19929b=_0x54ce7a['getUser'](_0x172b32);return _0x19929b||_0x54ce7a['addUser']({'id':_0x172b32,'name':_0x30036c});}_createNewComment({threadId:_0x16b522,commentId:_0x2d0c84=_0x348c57(),content:_0x4ff08d,authorId:_0x1400f1,createdAt:_0xd114cc,attributes:_0x526870}){if('string'!=typeof _0x2d0c84)throw new _0x587c70('commentsrepository-invalid-commentid');if('string'!=typeof _0x1400f1)throw new _0x587c70('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0x4ff08d||!_0x4ff08d['trim']())throw new _0x587c70('commentsrepository-invalid-comment-content');const _0x211b7e=this['context']['plugins']['get'](_0x5b5781)['getUser'](_0x1400f1);if(!_0x211b7e)throw new _0x587c70('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0x1400f1});let _0x114b4a=null,_0x41a329=_0xd114cc;return _0x526870?.['@external']&&(_0x114b4a=this['_getExternalAuthor'](_0x526870['@external']['authorName']),_0x41a329=new Date(_0x526870['@external']['createdAt'])),new hi(this,{'threadId':_0x16b522,'id':_0x2d0c84,'author':_0x114b4a||_0x211b7e,'creator':_0x211b7e,'content':_0x4ff08d,'createdAt':_0xd114cc,'authoredAt':_0x41a329,'attributes':_0x526870});}_addComment(_0x350da5){let {threadId:_0x436557,content:_0x30a355,attributes:_0x262be8,isFromAdapter:_0x353c8c}=_0x350da5;const _0x574ed7=this['getCommentThread'](_0x350da5['threadId']);if(!_0x574ed7)throw new _0x587c70('commentsrepository-add-comment-to-missing-comment-thread',this);const _0x12c8ce=this['_createNewComment'](_0x350da5),{id:_0x4ae384}=_0x12c8ce;if(_0x574ed7['_add'](_0x12c8ce),_0x353c8c||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0x574ed7['isSubmitted'])return Promise['resolve']();const _0x5bc095=this['context']['plugins']['get']('PendingActions'),{channelId:_0x50be65}=_0x574ed7,_0xdd8b26=_0x5bc095['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x262be8||(_0x262be8={}),this['adapter']['addComment']({'channelId':_0x50be65,'threadId':_0x436557,'commentId':_0x4ae384,'content':_0x30a355,'attributes':_0x262be8})['then'](_0x18372e=>{_0x5bc095['remove'](_0xdd8b26),_0x18372e&&this['_updateComment']({'channelId':_0x50be65,'threadId':_0x436557,'commentId':_0x4ae384,'createdAt':_0x18372e['createdAt'],'isFromAdapter':!0x0});})['catch'](_0xda282f=>{throw console['error'](_0xda282f),new _0x587c70('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x2f5313,commentId:_0x3df1fd,content:_0x58c3f5,createdAt:_0x34d8ed,attributes:_0x7a9955,isFromAdapter:_0x4eff32}){if(void 0x0!==_0x58c3f5&&('string'!=typeof _0x58c3f5||!_0x58c3f5['trim']()['length']))throw new _0x587c70('commentsrepository-update-comment-invalid-content');const _0x9edf2d=this['getCommentThread'](_0x2f5313),_0xb28962=_0x9edf2d['getComment'](_0x3df1fd);if(!_0xb28962)throw new _0x587c70('commentsrepository-update-missing-comment',this);let _0x394171=!0x1;if(_0x58c3f5&&_0x58c3f5!==_0xb28962['content']&&(_0xb28962['isEditable']||_0x4eff32)&&(_0xb28962['content']=_0x58c3f5,_0x394171=!0x0),_0x34d8ed&&_0x34d8ed!==_0xb28962['createdAt']&&(_0xb28962['createdAt']=_0x34d8ed,_0xb28962['isExternal']||(_0xb28962['authoredAt']=_0x34d8ed),_0x394171=!0x0),_0x7a9955&&!_0x8ea8ca(_0x7a9955,_0xb28962['attributes'])&&(_0xb28962['attributes']=_0x7a9955,_0x394171=!0x0),!_0x394171)return Promise['resolve']();if(_0x9edf2d['fire']('commentUpdated'),_0x4eff32||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0x1ae7fa=this['context']['plugins']['get']('PendingActions'),{channelId:_0x415540}=this['getCommentThread'](_0xb28962['threadId']),_0x580f39=_0x1ae7fa['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0x415540,'threadId':_0x2f5313,'commentId':_0x3df1fd,'content':_0x58c3f5,'attributes':_0x7a9955})['then'](()=>_0x1ae7fa['remove'](_0x580f39))['catch'](_0x40740e=>{throw console['error'](_0x40740e),new _0x587c70('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0x30f25d,commentId:_0x373530,isFromAdapter:_0x1da79d}){const _0x57e32d=this['getCommentThread'](_0x30f25d),_0x543cb2=_0x57e32d['getComment'](_0x373530);if(!_0x543cb2)throw new _0x587c70('commentsrepository-remove-missing-comment',this);if(_0x57e32d['_remove'](_0x543cb2),_0x1da79d||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0x18b243=this['context']['plugins']['get']('PendingActions'),{channelId:_0x1c35a6}=_0x57e32d,_0x67d1bf=_0x18b243['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x1c35a6,'threadId':_0x30f25d,'commentId':_0x373530})['then'](()=>_0x18b243['remove'](_0x67d1bf))['catch'](_0x47472c=>{throw console['error'](_0x47472c),new _0x587c70('commentsrepository-remove-comment-internal-error',this);});}},ri=class extends si{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x5e008e,_0x3ba4b9){super();const _0x56e3da=_0x3ba4b9['isResolvable'];this['channelId']=_0x3ba4b9['channelId'],this['id']=_0x3ba4b9['id'],this['comments']=new _0x43adb0(),this['_repository']=_0x5e008e,this['_isAttached']=!0x1,this['_isSubmitted']=_0x3ba4b9['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x5e008e,'_permissions',_0x5e008e,'_readOnlyChannels',()=>_0x5e008e['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x5e008e,'_permissions',()=>_0x5e008e['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x5e008e,'_permissions',()=>{const _0x5d0342=_0x5e008e['getPermissions'](this['channelId']);return _0x5d0342['write']||_0x5d0342['admin'];}),this['bind']('isResolvable')['to'](_0x5e008e,'_permissions',()=>_0x56e3da&&_0x5e008e['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x3ba4b9['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0x5eb954,_0x5e7a36)=>_0x5eb954?_0x5e7a36?_0x5eb954<_0x5e7a36?_0x5eb954:_0x5e7a36:_0x5eb954:_0x5e7a36),this['set']('unlinkedAt',_0x3ba4b9['unlinkedAt']||null),this['set']('resolvedAt',_0x3ba4b9['resolvedAt']||null),this['set']('resolvedBy',_0x3ba4b9['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x15b5af=>!!_0x15b5af),this['set']('attributes',_0x3ba4b9['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x1ec4ad,_0x171985)=>_0x1ec4ad+_0x171985['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x31ba03,id:_0x593a36}=this;this['_repository']['fire'](ai('submitCommentThread',_0x31ba03),{'channelId':_0x31ba03,'threadId':_0x593a36});}setUnlinkedAt(_0x806dc6){this['_update']({'unlinkedAt':_0x806dc6});}['resolve']({resolvedAt:_0x2abc29=new Date(),resolvedBy:_0x12cfdc='',isFromAdapter:_0x7c87c0=!0x1}={}){const _0x93396d=this['_repository']['context']['plugins']['get'](_0x5b5781)['me'],{channelId:_0x2587cf,id:_0xb21653}=this;this['_repository']['fire'](ai('resolveCommentThread',_0x2587cf),{'channelId':_0x2587cf,'threadId':_0xb21653,'resolvedAt':_0x2abc29,'resolvedBy':_0x12cfdc||_0x93396d['id'],'isFromAdapter':_0x7c87c0});}['reopen']({isFromAdapter:_0x112741=!0x1}={}){const {channelId:_0x34a1ac,id:_0x4c10eb}=this;this['_repository']['fire'](ai('reopenCommentThread',_0x34a1ac),{'channelId':_0x34a1ac,'threadId':_0x4c10eb,'isFromAdapter':_0x112741});}setContext(_0x2c81b8){this['context']||this['_update']({'context':_0x2c81b8});}setAttribute(_0x474c0c,_0x477eef){const _0x1aeb65=_0x335fae(this['attributes']);_0xe4f958(_0x1aeb65,_0x474c0c,_0x477eef),this['_update']({'attributes':_0x1aeb65});}removeAttribute(_0x1c8c16){const _0xc08b30=_0x335fae(this['attributes']);_0x7243f(_0xc08b30,_0x1c8c16),this['_update']({'attributes':_0xc08b30});}['remove']({isFromAdapter:_0x42799c=!0x1}={}){const {channelId:_0x159b58,id:_0x598139}=this;this['_repository']['fire'](ai('removeCommentThread',_0x159b58),{'channelId':_0x159b58,'threadId':_0x598139,'isFromAdapter':_0x42799c});}attachTo(_0x4b48ae){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0x4b48ae});}addComment(_0x600103){const {channelId:_0x3129e4,id:_0x2b414c}=this;this['_repository']['fire'](ai('addComment',_0x3129e4,_0x2b414c),Object['assign']({'channelId':_0x3129e4,'threadId':_0x2b414c},_0x600103));}getComment(_0x31115e){if('string'!=typeof _0x31115e)throw new _0x587c70('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x31115e});return this['comments']['get'](_0x31115e);}toJSON(){return{'threadId':this['id'],'context':this['context'],'unlinkedAt':this['unlinkedAt'],'resolvedAt':this['resolvedAt'],'resolvedBy':this['resolvedBy']?this['resolvedBy']['id']:null,'archivedAt':this['archivedAt'],'comments':this['comments']['map'](_0x2f2c21=>_0x2f2c21['toJSON']()),'attributes':this['attributes']};}['_add'](_0x11f8cd){return this['listenTo'](_0x11f8cd,'change:authoredAt',()=>{const _0x23e216=this['_findOptimalIndex'](_0x11f8cd),_0x47d4da=this['comments'];_0x23e216-0x1!=_0x47d4da['getIndex'](_0x11f8cd)&&_0x23e216+0x1!=_0x47d4da['getIndex'](_0x11f8cd)&&(this['_remove'](_0x11f8cd),this['_add'](_0x11f8cd));}),this['comments']['add'](_0x11f8cd,this['_findOptimalIndex'](_0x11f8cd));}_update(_0x1dece1){const {channelId:_0x1867e2,id:_0x3a5709}=this;this['_repository']['fire'](ai('updateCommentThread',_0x1867e2),{..._0x1dece1,'channelId':_0x1867e2,'threadId':_0x3a5709});}['_remove'](_0x413347){return this['stopListening'](_0x413347),_0x413347['destroy'](),this['comments']['remove'](_0x413347);}_findOptimalIndex(_0x2af57a){const _0x40db4d=this['comments']['find'](_0x27bc62=>new Date(_0x27bc62['authoredAt'])['getTime']()>new Date(_0x2af57a['authoredAt'])['getTime']());return _0x40db4d?this['comments']['getIndex'](_0x40db4d):this['length'];}},hi=class extends ni{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x1c5037,_0x5ebfd6){super();const _0xab0c99=_0x1c5037['context']['plugins']['get'](_0x5b5781)['me'],_0x342d8a=_0x1c5037['getCommentThread'](_0x5ebfd6['threadId']),_0xc57f35=0x0===_0x342d8a['comments']['length'],_0x5d595b=_0xab0c99===_0x5ebfd6['author'];this['id']=_0x5ebfd6['id'],this['threadId']=_0x5ebfd6['threadId'],this['author']=_0x5ebfd6['author'],this['creator']=_0x5ebfd6['creator'],this['set']('content',_0x5ebfd6['content']),this['createdAt']=_0x5ebfd6['createdAt']||new Date(),this['set']('authoredAt',_0x5ebfd6['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0x342d8a,'resolvedAt'),this['set']('attributes',_0x5ebfd6['attributes']||{}),this['bind']('isEditable')['to'](_0x1c5037,'_permissions',()=>{const _0x15ff16=_0x1c5037['getPermissions'](_0x342d8a['channelId'])['write'],_0x578d23=_0x1c5037['getPermissions'](_0x342d8a['channelId'])['modifyAll'];return _0x5d595b&&_0x15ff16||!_0x5d595b&&_0x578d23;}),this['bind']('isRemovable')['to'](_0x342d8a,'isRemovable',_0x1c5037,'_permissions',_0xb2f75c=>{const _0x5814aa=_0x1c5037['getPermissions'](_0x342d8a['channelId'])['write'],_0x462227=_0x1c5037['getPermissions'](_0x342d8a['channelId'])['modifyAll'];return _0x5d595b&&_0x5814aa||_0xb2f75c&&_0xc57f35||!_0x5d595b&&_0x462227&&!_0xc57f35;}),this['bind']('isReadOnly')['to'](_0x342d8a,'isReadOnly'),this['_repository']=_0x1c5037;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x24c6f9){const _0x380a05=document['createElement']('div');return _0x380a05['innerHTML']=_0x24c6f9,_0x380a05['textContent']['length'];}(this['content']),0xc8);}update(_0x4d0458){const {threadId:_0x112dda,id:_0x40597b}=this;if(!this['_repository']['hasCommentThread'](_0x112dda))throw new _0x587c70('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x539ea5}=this['_repository']['getCommentThread'](_0x112dda);this['_repository']['fire'](ai('updateComment',_0x539ea5,_0x112dda),{'channelId':_0x539ea5,'threadId':_0x112dda,'commentId':_0x40597b,..._0x4d0458});}setAttribute(_0x363b08,_0x2cafba){const _0x42502f=_0x335fae(this['attributes']);_0xe4f958(_0x42502f,_0x363b08,_0x2cafba),this['update']({'attributes':_0x42502f});}removeAttribute(_0x4c938d){const _0x4cea64=_0x335fae(this['attributes']);_0x7243f(_0x4cea64,_0x4c938d),this['update']({'attributes':_0x4cea64});}['remove'](_0x4d4417={}){if(!_0x4d4417['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x27177a,id:_0x2d4fe6}=this;if(!this['_repository']['hasCommentThread'](_0x27177a))throw new _0x587c70('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0x376d59}=this['_repository']['getCommentThread'](_0x27177a);this['_repository']['fire'](ai('removeComment',_0x376d59,_0x27177a),{'channelId':_0x376d59,'threadId':_0x27177a,'commentId':_0x2d4fe6,..._0x4d4417});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ai(_0x1c3c36,..._0x31515d){for(const _0x2d591e of _0x31515d)void 0x0!==_0x2d591e&&(_0x1c3c36+=':'+String(_0x2d591e));return _0x1c3c36;}var ci=class extends _0x2d7293{constructor(_0xc0ee0b){super(_0xc0ee0b),this['set']('hasContent',!0x1);}['refresh'](){const _0x1201d0=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0x35063e of _0x1201d0['getRanges']())if(this['_hasContent'](_0x35063e))return void(this['hasContent']=!0x0);}execute({threadId:_0x569eb6=_0x348c57(),ranges:_0x255f3b,comment:_0x565750}={}){const _0x28809a=this['editor']['model'],_0x1ba68f=_0x255f3b??Array['from'](_0x28809a['document']['selection']['getRanges']()),_0x3d07c8=[];for(const _0x2e7101 of _0x1ba68f)this['_hasContent'](_0x2e7101)&&_0x3d07c8['push'](this['_trimToContent'](_0x2e7101));if(!_0x3d07c8['length'])throw new _0x587c70('addcommentthreadcommand-incorrect-ranges',null);_0x565750&&this['_createCommentThread'](_0x569eb6,_0x565750),this['_createMarkersFromRanges'](_0x569eb6,_0x3d07c8,!!_0x565750);}_createMarkersFromRanges(_0x5e002a,_0x59b7ea,_0x48e845){this['editor']['model']['change'](_0x4ab92c=>{for(const _0x244e3f of _0x59b7ea){const _0x52988c='comment:'+_0x5e002a+':'+_0x348c57()['substr'](0x1,0x5);_0x4ab92c['addMarker'](_0x52988c,{'range':_0x244e3f,'usingOperation':_0x48e845,'affectsData':_0x48e845});}});}_createCommentThread(_0x552b84,_0xe6125e){const _0x56c3e9=this['editor']['plugins']['get']('CommentsRepository'),_0x4f9096=this['editor']['config']['get']('collaboration.channelId'),_0x5e1869=this['editor']['plugins']['get']('Users')['me'];if(!_0x5e1869)throw new _0x587c70('addcommentthreadcommand-user-not-found',null);_0x56c3e9['addCommentThread']({'threadId':_0x552b84,'channelId':_0x4f9096,'comments':[{'authorId':_0x5e1869['id'],'content':_0xe6125e,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0x3ed400){for(const _0x3550c5 of _0x3ed400['getItems']())if(this['_itemIsContent'](_0x3550c5))return!0x0;return!0x1;}_itemIsContent(_0x1384e7){return _0x1384e7['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0x1384e7)&&!_0x1384e7['is']('element','tableCell');}_trimToContent(_0x412307){const _0x3ebfc1=_0x54ce23=>!this['_itemIsContent'](_0x54ce23['item']),_0x12129a=_0x412307['start']['getLastMatchingPosition'](_0x3ebfc1),_0x3e877c=_0x412307['end']['getLastMatchingPosition'](_0x3ebfc1,{'direction':'backward'});return this['editor']['model']['createRange'](_0x12129a,_0x3e877c);}},di=class extends _0x3831f5{_dataCollectors;_editorAnnotations;static get requires(){return[ti];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x445c3d){super(_0x445c3d),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0x57c7ee=this['editor'],_0x2a4c62=_0x57c7ee['model']['document']['selection'],_0x4e8c6b=_0xbc46bc(()=>this['refreshSelectedViews'](),0xa);_0x2a4c62['on']('change:range',(_0x3ce76a,_0x4080a1)=>{_0x4080a1['directChange']&&(_0x4e8c6b['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0x57c7ee['editing']['view']['document'],'change:isFocused',(_0x291e4b,_0x1158bb,_0x1f5277)=>{_0x1f5277&&_0x4e8c6b();}),this['listenTo'](_0x57c7ee['ui']['focusTracker'],'change:isFocused',(_0x297cfd,_0x3d1ad9,_0x238f5a)=>{_0x238f5a||this['fire']('blur',{'isAnnotationTracked':_0x5c3a97=>this['_editorAnnotationsData']['has'](_0x5c3a97['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0x31fca8){if(this['_editorAnnotations']['has'](_0x31fca8['view']))return;this['_editorAnnotations']['add'](_0x31fca8['view']),this['editor']['ui']['focusTracker']['add'](_0x31fca8['view']['element']);const _0x3ddc91=this['editor']['plugins']['get'](ti);this['listenTo'](_0x3ddc91['collection'],'remove',(_0x518b68,_0x3d069c)=>{this['editor']['ui']['focusTracker']['remove'](_0x3d069c['view']['element']),this['_editorAnnotations']['delete'](_0x3d069c['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0x1fae64){if('function'!=typeof _0x1fae64)throw new _0x587c70('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0x1fae64);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x2bb395,annotations:_0x175ae5}){const _0x2acbe7=[],_0x635bff=this['editor']['model']['document']['selection'],_0x202ec2=Array['from'](_0x635bff['getRanges']());for(const [_0xe6dd95,_0x214eaf]of this['_editorAnnotationsData']){const _0x3631e6=_0x188881(_0x214eaf),_0x3dc0a7=_0x175ae5['getByInnerView'](_0xe6dd95);_0x3631e6&&_0x3dc0a7&&_0x2acbe7['push']({'annotation':_0x3dc0a7,'range':_0x3631e6});}function _0x188881(_0x458f61){for(const _0x5a103f of _0x458f61)for(const _0x94926f of _0x202ec2)if(_0x5a103f['containsRange'](_0x94926f,!_0x635bff['isCollapsed']))return _0x5a103f;return null;}const _0x17a752=new Map(Array['from'](_0x175ae5,(_0x354556,_0x1b6ff7)=>[_0x354556,_0x1b6ff7]));return _0x2acbe7['sort']((_0x4e249d,_0x186d3a)=>{const _0x33194e=_0x4e249d['range'],_0x4c5b6d=_0x186d3a['range'];if(!_0x33194e['isEqual'](_0x4c5b6d)){if(_0x33194e['containsRange'](_0x4c5b6d,!0x0))return 0x1;if(_0x4c5b6d['containsRange'](_0x33194e,!0x0))return-0x1;}return _0x4e249d['annotation']==_0x2bb395?-0x1:_0x186d3a['annotation']==_0x2bb395?0x1:(_0x17a752['get'](_0x4e249d['annotation'])??0x0)-(_0x17a752['get'](_0x186d3a['annotation'])??0x0);})['map'](_0x37ca7a=>_0x37ca7a['annotation']);}get _editorAnnotationsData(){const _0x4b7674=new Map();for(const _0x3a659e of Array['from'](this['_dataCollectors']))for(const [_0x475dbe,_0x396061]of _0x3a659e())_0x4b7674['set'](_0x475dbe,_0x396061);return _0x4b7674;}},li=class extends _0x3831f5{afterInit(){const _0x1226b1=this['editor'];_0x1226b1['plugins']['has']('RestrictedEditingModeEditing')&&_0x1226b1['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},mi=class extends _0x3831f5{constructor(_0x49993a){super(_0x49993a),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x28be55=this['editor'],_0x52ae73=_0x28be55['commands']['get']('importWord'),_0x445f0d=_0x28be55['plugins']['get'](_0x5b5781);_0x52ae73&&(_0x52ae73['on']('execute',(_0x536fbe,[,_0x1a0ccd])=>{_0x1a0ccd['collaboration_features']={'comments':!0x0,'user_id':_0x445f0d['me']['id']};},{'priority':_0x48dc95['high']+0xa}),this['listenTo'](_0x52ae73,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x532204,_0x21cc89){const {comment_threads:_0x363713}=_0x21cc89;_0x363713&&_0x363713['forEach'](({thread_id:_0x6a1375,comments:_0x37de01,is_resolved:_0x2fcc8e})=>{const _0x5b350c=new Date(),_0xd9187b=_0x37de01['map'](({author:_0xb93db3,content:_0x3711fc,created_at:_0x157472})=>({'content':_0x3711fc,'authorId':this['editor']['plugins']['get'](_0x5b5781)['me']['id'],'createdAt':_0x5b350c,'attributes':{'@external':{'authorName':_0xb93db3,'createdAt':_0x157472?new Date(_0x157472):new Date(),'source':'importWord'}}})),_0x1b84c5=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](oi)['addCommentThread']({'channelId':_0x1b84c5,'threadId':_0x6a1375,'comments':_0xd9187b,'resolvedAt':_0x2fcc8e?_0x5b350c:null});});}},ui=class extends _0x3831f5{constructor(_0x381c71){super(_0x381c71),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[pt,wt];}afterInit(){const _0x26400d=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x26400d,'contentInsertion',(_0x366907,_0x43f129)=>this['_removeMarkersWithoutThreads'](_0x43f129['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x311017){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x311017;const _0x562bae=this['editor']['plugins']['get']('CommentsRepository');for(const _0x5cbd0d of _0x311017['keys']()){const [_0x313865,_0x3d9df6]=_0x5cbd0d['split'](':');'comment'!=_0x313865||_0x562bae['hasCommentThread'](_0x3d9df6)||_0x311017['delete'](_0x5cbd0d);}return _0x311017;}_registerMarkerInClipboardPipeline(){const _0x398ea8=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0x29408f=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0x29408f&&_0x398ea8['_registerMarkerToCopy']('comment',_0x29408f);}_mapCommentsCopyConfigToRegisterConfiguration(_0x5ef42a){switch(_0x5ef42a){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function fi(_0x39277b){const _0x200261=_0x39277b['split'](':');return{'group':_0x200261[0x0],'id':_0x200261[0x1],'part':_0x200261[0x2]};}var pi=class extends _0x3831f5{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0x50d8af,_0x94083b)=>{if(!_0x94083b['options']['showCommentHighlights'])return null;if(_0x94083b['options']['ignoreResolvedComments']){const {id:_0x5c19a5}=fi(_0x50d8af['markerName']);if(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x5c19a5)?.['isResolved']&&_0x50d8af['item'])return _0x94083b['consumable']['consume'](_0x50d8af['item'],'addMarker:'+_0x50d8af['markerName']),_0x94083b['consumable']['consume'](_0x50d8af['item'],'removeMarker:'+_0x50d8af['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x554122=>{_0x554122['on']('addMarker:comment',(_0x27b2ed,_0x4b1101,_0x4ca7c0)=>{if(!_0x4ca7c0['options']['showCommentHighlights'])return;const _0x46a7e4=_0x4b1101['item'];if(!_0x46a7e4)return;const _0x58caf6=_0x4ca7c0['mapper']['toViewElement'](_0x46a7e4);this['editor']['model']['schema']['isObject'](_0x46a7e4)&&_0x58caf6&&!_0x58caf6['getCustomProperty']('widget')&&_0x58caf6['is']('containerElement')&&Ct(_0x58caf6,_0x4ca7c0['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0x35b64d,{writer:_0x4eff74,options:_0x4dd0be})=>{if(!_0x4dd0be['showCommentHighlights'])return null;const _0x5e6367=_0x4eff74['createContainerElement']('div'),_0xcfd8b3=_0x4eff74['createEmptyElement']('hr');return _0x4eff74['addClass']('ck-horizontal-line',_0x5e6367),_0x4eff74['insert'](_0x4eff74['createPositionAt'](_0x5e6367,0x0),_0xcfd8b3),_0x5e6367;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0x138a3e,{writer:_0x297bde,options:_0x522889})=>{if(!_0x522889['showCommentHighlights'])return null;const _0x2d415d=_0x297bde['createContainerElement']('span'),_0x4e8276=_0x297bde['createEmptyElement']('img');return _0x297bde['addClass']('image-inline',_0x2d415d),_0x297bde['insert'](_0x297bde['createPositionAt'](_0x2d415d,0x0),_0x4e8276),_0x2d415d;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x2c5121,{writer:_0xc10cc1,options:_0x12c87b})=>{if(_0x12c87b['showCommentHighlights'])return _0xc10cc1['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0x2d25e7,_0x43d661,_0x3ab961)=>{_0x3ab961['options']['showCommentHighlights']&&_0x2d25e7['stop']();},{'priority':'high'});}},wi=class extends _0x3831f5{static get requires(){return[oi,di,_0x5b5781,li,mi,ui,pi];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4cdfdf){super(_0x4cdfdf),this['set']('isThreadsLoadingPaused',!0x0),_0x4cdfdf['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0x88da05,_0x41da60,_0x2fe6ed,_0x58e1f6)=>{const _0x2dce03=_0x4cdfdf['plugins']['get'](oi),_0x5ec456=_0x2fe6ed?fi(_0x2fe6ed)['id']:null;_0x4cdfdf['model']['change'](()=>{if(_0x5ec456){const _0x1df8b0=this['getAllMarkersForId'](_0x5ec456);for(const _0x38702b of _0x1df8b0)_0x4cdfdf['editing']['reconvertMarker'](_0x38702b);}if(_0x58e1f6){const {id:_0x124a50}=fi(_0x58e1f6),_0x110de9=_0x2dce03['getCommentThread'](_0x124a50);if(_0x110de9&&_0x110de9['unlinkedAt'])return;if(_0x110de9&&!_0x110de9['isAttached'])return;const _0x5df82a=this['getAllMarkersForId'](_0x124a50);for(const _0x46b059 of _0x5df82a)_0x4cdfdf['editing']['reconvertMarker'](_0x46b059);}}),_0x5ec456&&this['scrollToThreadMarker'](_0x5ec456);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0x44fccd=this['editor'],_0x705659=_0x44fccd['plugins']['get'](oi),_0x494f3e=_0x44fccd['config']['get']('collaboration.channelId'),_0x332aab=_0x705659['getCommentThreads']()['filter'](_0x4296a2=>_0x4296a2['channelId']!==_0x494f3e);_0x44fccd['commands']['add']('addCommentThread',new ci(_0x44fccd)),this['listenTo'](_0x44fccd,'change:isReadOnly',(_0x4c4c24,_0x435002,_0x3776c4)=>{_0x705659['switchReadOnly'](_0x3776c4,_0x44fccd['config']['get']('collaboration.channelId'));}),this['listenTo'](_0x705659,gi('addCommentThread',_0x494f3e),(_0x273487,{threadId:_0x4ad385})=>{this['editor']['plugins']['get'](oi)['getCommentThread'](_0x4ad385)?.['unlinkedAt']&&this['_attachArchivedThread'](_0x4ad385);}),this['listenTo'](_0x705659,gi('removeCommentThread',_0x494f3e),(_0x4f7bc1,{threadId:_0x10d84a})=>{_0x44fccd['model']['enqueueChange']({'isUndoable':!0x1},_0x1ba8e5=>{const _0x6f6154=this['getAllMarkersForId'](_0x10d84a);for(const _0x2bed15 of _0x6f6154)_0x1ba8e5['removeMarker'](_0x2bed15);});}),this['listenTo'](_0x705659,gi('resolveCommentThread',_0x494f3e),(_0x41c142,{threadId:_0x30d9c1})=>{this['_reconvertMarkers'](_0x30d9c1);const _0x487cfe=this['editor']['plugins']['get'](ti);(this['editor']['editing']['view']['hasDomSelection']||_0x487cfe['collection']['isFocused'])&&(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x30d9c1)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0x705659,gi('reopenCommentThread',_0x494f3e),(_0x3c4a58,{threadId:_0xe29a17})=>{this['_reconvertMarkers'](_0xe29a17);},{'priority':'low'}),this['listenTo'](_0x705659,gi('addComment',_0x494f3e),(_0x19c634,{threadId:_0x3f3bf2,isFromAdapter:_0x199d49})=>{const _0xecaeb5=this['getAllMarkersForId'](_0x3f3bf2);!_0x199d49&&0x0!=_0xecaeb5['length']&&_0x705659['hasCommentThread'](_0x3f3bf2)&&0x1===_0x705659['getCommentThread'](_0x3f3bf2)['length']&&_0x44fccd['model']['enqueueChange']({'isUndoable':!0x1},_0x238c4d=>{for(const _0x4543d5 of _0xecaeb5)_0x238c4d['updateMarker'](_0x4543d5,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0x332aab);}afterInit(){!async function(_0x8ee123){const _0x336a32='mr4z2yakM3x0phtD7jBw1T6qRfeUuZcOLNKVgQSPE9iGIHoXlJW8YsCb5AndFv',_0x1c9bf8=0x793f8,_0x1d9f8b={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x2ccabe(_0x37c19b){const _0x15a84d=new window['Promise'](_0x48fda8=>{_0x37c19b['once']('ready',_0x48fda8);}),_0x2a322b=window['Date']['now'](),_0x35a65e=_0x37c19b['config']['get']('licenseKey');async function _0x59b089(){let _0x39015c,_0x5d1f47=null,_0x242453=null;try{return'GPL'==_0x35a65e?'NotAllowed':(_0x39015c=_0x1d17aa(),_0x39015c?(_0x39015c['usageEndpoint']&&(_0x242453=_0x20043e(_0x39015c['usageEndpoint'],_0x39015c['jti'])),await _0x8b70b5()?_0x5a1d51()?_0x5e9bec()?'Expired':_0x34e171()?('evaluation'==_0x39015c['licenseType']&&(_0x5d1f47=_0x82e701('EvaluationLimit')),await _0x133e8c()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x5e9bec(){const _0x5dfe2a=['evaluation','trial']['includes'](_0x39015c['licenseType'])?_0x2a322b/0x3e8:0xe10*_0x1c9bf8;return _0x39015c['exp']<_0x5dfe2a;}function _0x5a1d51(){const _0x582fcd=_0x39015c['features'];if(!_0x582fcd)return!0x1;if(_0x582fcd['includes']('*'))return!0x0;if(_0x582fcd['includes']('CMT'))return!0x0;if(_0x582fcd['includes']('TRILIUM')&&_0x27dd1f())return!0x0;if(_0x582fcd['includes']('RCMT')){if(_0x16ecbe())return!0x0;if(_0x723ff4()||_0xf53d17())return!0x0;}return!0x1;}function _0x34e171(){const _0x56b0aa=_0x39015c['licensedHosts'];if(!_0x56b0aa||0x0==_0x56b0aa['length'])return!0x0;const {hostname:_0x4e13d8}=new URL(window['location']['href']);if(_0x56b0aa['includes'](_0x4e13d8))return!0x0;const _0x2e6d2a=_0x4e13d8['split']('.');return _0x56b0aa['filter'](_0x3f42cf=>_0x3f42cf['includes']('*'))['map'](_0x368bb2=>_0x368bb2['split']('.'))['filter'](_0x53586b=>_0x53586b['length']<=_0x2e6d2a['length'])['map'](_0x184f9f=>Array(_0x2e6d2a['length']-_0x184f9f['length'])['fill']('*'===_0x184f9f[0x0]?'*':'')['concat'](_0x184f9f))['some'](_0x4e1f29=>_0x2e6d2a['every']((_0x4b911c,_0x543210)=>_0x4e1f29[_0x543210]===_0x4b911c||'*'===_0x4e1f29[_0x543210]));}function _0x133e8c(){return _0x5d1f47&&_0x242453?new window['Promise']((_0x41ca58,_0xc8ca3f)=>{_0x5d1f47['then'](_0x41ca58,_0xc8ca3f),_0x242453['then'](_0x51874c=>{'Valid'!=_0x51874c&&_0x41ca58(_0x51874c);},_0xc8ca3f);}):_0x5d1f47||_0x242453||'Valid';}}function _0x20043e(_0x20a3b3,_0x3fddcf){return new window['Promise'](_0x976747=>{if(_0x271c93())return _0x976747('Valid');_0x56f508(),_0x37c19b['decorate']('_sendUsageRequest');let _0x469dd9=!0x1;const _0x3e1ce3=_0x348c57();function _0x12d001(_0x4001d3){return!!_0x4001d3&&('object'==typeof _0x4001d3||'function'==typeof _0x4001d3)&&'function'==typeof _0x4001d3['then']&&'function'==typeof _0x4001d3['catch'];}function _0x4d6f20(_0x1ffa99){_0x1bceac(_0x1ffa99)['then'](_0x1c5b97=>_0x1c5b97&&'ok'==_0x1c5b97['status']?_0x4b1d2d(_0x3b7a75(_0x3e1ce3+_0x3fddcf))!=_0x1c5b97['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x1ad9aa=>(_0x117417(),_0x1ad9aa),()=>{const _0xc2ce41=_0x51b95f();return null==_0xc2ce41?(_0x117417(),'Valid'):_0x2a322b-_0xc2ce41>0x240c8400?'UsageLimit':'Valid';})['then'](_0x976747)['catch'](()=>{_0x976747('UsageLimit');});const _0x55b806=0x36ee80;function _0x117417(){const _0x50cef9='llct-'+_0x4b1d2d(_0x3b7a75(_0x20a3b3)),_0x1fd82c=_0x790767(_0x4b1d2d(window['Math']['ceil'](_0x2a322b/_0x55b806)));window['localStorage']['setItem'](_0x50cef9,_0x1fd82c);}function _0x51b95f(){const _0x494948='llct-'+_0x4b1d2d(_0x3b7a75(_0x20a3b3)),_0x3c5c7b=window['localStorage']['getItem'](_0x494948);return _0x3c5c7b?window['parseInt'](_0x790767(_0x3c5c7b),0x10)*_0x55b806:null;}function _0x1bceac(_0x4535b9){return new window['Promise']((_0x2ea880,_0x29ca2a)=>{_0x4535b9['then'](_0x2ea880,_0x29ca2a),window['setTimeout'](_0x29ca2a,0x1d4c0);});}}_0x37c19b['on']('_sendUsageRequest',(_0x46beeb,_0x3c4615)=>{if(_0x3c4615[0x0]!=_0x20a3b3)return _0x976747('UsageLimit');_0x3c4615[0x1]={..._0x3c4615[0x1],'requestId':_0x3e1ce3};},{'priority':'high'}),_0x37c19b['on']('_sendUsageRequest',_0x3a18e8=>{_0x12d001(_0x3a18e8['return'])&&(_0x469dd9=!0x0,_0x4d6f20(_0x3a18e8['return']));},{'priority':'low'}),_0x15a84d['then'](()=>{_0x469dd9||_0x976747('UsageLimit');});});function _0x271c93(){return'auto'==_0x37c19b['editing']['view']['_overlayModeHint'];}function _0x56f508(){_0x37c19b['editing']['view']['_overlayModeHint']='auto';}}function _0x82e701(_0x326bee){const _0x2ee48f=[new window['Promise'](_0x28adce=>setTimeout(_0x28adce,0x93ecc)),_0x15a84d['then'](()=>new window['Promise'](_0x1df4b6=>{let _0x61590c=0x0;_0x37c19b['model']['on']('applyOperation',(_0x4b9054,_0x44b5c3)=>{_0x44b5c3[0x0]['isDocumentOperation']&&_0x61590c++,0x5e8==_0x61590c&&(_0x1df4b6(),_0x4b9054['off']());});}))];return window['Promise']['race'](_0x2ee48f)['then'](()=>_0x326bee);}async function _0x5a732e(){await _0x15a84d,_0x37c19b['model']['change']=_0x435c60,_0x37c19b['model']['enqueueChange']=_0x435c60,_0x37c19b['enableReadOnlyMode']('model');}function _0x27dd1f(){return window['glob']&&window['glob']['triliumVersion'];}function _0x16ecbe(){return _0x584f0a('WebSocketGateway')&&'connected'==_0x49bed2('WebSocketGateway')['state'];}function _0x723ff4(){return _0x584f0a('RevisionViewerIntegration');}function _0xf53d17(){return _0x584f0a('TrackChangesDataGetter');}function _0x5bedac(_0xb25f84){const _0xc6db43=_0x29b8b7();_0x37c19b[_0xc6db43]='commentsLicenseKey'+_0xb25f84,'Valid'!=_0xb25f84&&_0x5a732e();}function _0x29b8b7(){const _0x11dc87=window['String'](window['performance']['now']())['replace']('.','');let _0x2da00c='m';for(let _0x771fb4=0x0;_0x771fb4<_0x11dc87['length'];_0x771fb4+=0x2){let _0x38fd3d=window['parseInt'](_0x11dc87['substring'](_0x771fb4,_0x771fb4+0x2));_0x38fd3d>=0x3e&&(_0x38fd3d-=0x3e),_0x2da00c+=_0x336a32[_0x38fd3d];}return _0x2da00c;}function _0x1d17aa(){const _0x19380b=_0x35a65e['split']('.');if(0x3!=_0x19380b['length'])return null;return _0x348c46(_0x19380b[0x1]);function _0x348c46(_0x1924bd){const _0x579e56=_0x5125ad(_0x1924bd);return _0x579e56&&_0x8ffa6()?_0x579e56:null;function _0x8ffa6(){const _0x1d4262=_0x579e56['jti'],_0x17f0f8=window['parseInt'](_0x1d4262['substring'](_0x1d4262['length']-0x8),0x10),_0x24a7a5={..._0x579e56,'jti':_0x1d4262['substring'](0x0,_0x1d4262['length']-0x8)};return delete _0x24a7a5['vc'],_0x3b7a75(_0x24a7a5)==_0x17f0f8;}}}async function _0x8b70b5(){let _0x31b28a=!0x0;try{const [_0x2c4d5c,_0x265f3d,_0x4631e3]=_0x35a65e['split']('.');return _0x588228(_0x2c4d5c),await _0x5dd122(_0x2c4d5c,_0x265f3d,_0x4631e3),_0x31b28a;}catch{return!0x1;}function _0x588228(_0x3e532f){const _0x28d637=_0x5125ad(_0x3e532f);_0x28d637&&'ES256'==_0x28d637['alg']||(_0x31b28a=!0x1);}async function _0x5dd122(_0x17a8ca,_0x28af74,_0xc370b6){const _0x31f648=window['Uint8Array']['from'](_0x2bfc7d(_0xc370b6),_0x4ed60d=>_0x4ed60d['charCodeAt'](0x0)),_0x566653=new window['TextEncoder']()['encode'](_0x17a8ca+'.'+_0x28af74),_0x3b1b4b=window['crypto']['subtle'];if(!_0x3b1b4b)return;const _0x42f5ea=await _0x3b1b4b['importKey']('jwk',_0x1d9f8b,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3b1b4b['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x42f5ea,_0x31f648,_0x566653)||(_0x31b28a=!0x1);}}function _0x5125ad(_0x2a54bf){return _0x2a54bf['startsWith']('ey')?JSON['parse'](_0x2bfc7d(_0x2a54bf)):null;}function _0x2bfc7d(_0x55ba8b){return window['atob'](_0x55ba8b['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x3b7a75(_0x13f939){let _0x11a685=0x1505;function _0x4fb1ba(_0x1fd6ae){for(let _0x364ad0=0x0;_0x364ad0<_0x1fd6ae['length'];_0x364ad0++){const _0x202cc1=_0x1fd6ae['charCodeAt'](_0x364ad0);_0x11a685=(_0x11a685<<0x5)+_0x11a685+_0x202cc1,_0x11a685&=_0x11a685;}}function _0xfaba90(_0x55c97c){Array['isArray'](_0x55c97c)?_0x55c97c['forEach'](_0xfaba90):_0x55c97c&&'object'==typeof _0x55c97c?Object['entries'](_0x55c97c)['sort']()['forEach'](([_0x5c68ae,_0x18a6b2])=>{_0x4fb1ba(_0x5c68ae),_0xfaba90(_0x18a6b2);}):_0x4fb1ba(window['String'](_0x55c97c));}return _0xfaba90(_0x13f939),_0x11a685>>>0x0;}function _0x4b1d2d(_0x40e1bc){return _0x40e1bc['toString'](0x10)['padStart'](0x8,'0');}function _0x790767(_0x486f41){return _0x486f41['split']('')['reverse']()['join']('');}function _0x584f0a(_0x490faa){return _0x37c19b['plugins']['has'](_0x490faa);}function _0x49bed2(_0x3ba46a){return _0x37c19b['plugins']['get'](_0x3ba46a);}function _0x435c60(){}_0x5bedac(await _0x59b089());}_0x2ccabe(_0x8ee123['editor']);}(this);}destroy(){const _0x3d2719=this['editor']['plugins']['get'](oi),_0x2633d9=this['editor']['config']['get']('collaboration.channelId');for(const _0x31965f of _0x3d2719['getCommentThreads']({'channelId':_0x2633d9}))_0x3d2719['_detachCommentThread'](_0x31965f['id']),_0x3d2719['_threads']['delete'](_0x31965f['id']);super['destroy']();}['hasMarkerForId'](_0xc98574){return this['getAllMarkersForId'](_0xc98574)['length']>0x0;}getAllMarkersForId(_0x20ef7e){const _0x25ca2d=[];for(const _0x3ecf90 of this['editor']['model']['markers'])_0x3ecf90['name']['startsWith']('comment:'+_0x20ef7e)&&_0x25ca2d['push'](_0x3ecf90);return _0x25ca2d;}['scrollToThreadMarker'](_0x316cee){setTimeout(()=>{const _0x1fc8c0=this['_getTargetForId'](_0x316cee);_0x1fc8c0&&this['activeMarker']&&fi(this['activeMarker'])['id']===_0x316cee&&_0x2c8209({'target':_0x1fc8c0[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0x19ba19){this['editor']['model']['change'](()=>{for(const _0x15497c of this['getAllMarkersForId'](_0x19ba19))this['editor']['editing']['reconvertMarker'](_0x15497c);});}_attachArchivedThread(_0x570d4e){const _0x274e16=this['editor']['plugins']['get'](oi),_0x532060=this['editor']['plugins']['get'](di),_0x1488b5=_0x274e16['getCommentThread'](_0x570d4e);if(!_0x1488b5['isAttached']){const _0x3a221b=_0x1488b5['attachTo'](()=>this['_getTargetForId'](_0x1488b5['id']));_0x532060['registerAnnotation'](_0x3a221b),_0x1488b5['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x3a9b8e=this['editor'],_0x1e144e=_0x3a9b8e['plugins']['get'](_0x5b5781);_0x3a9b8e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x2aff67,_0x2ff732)=>{const {id:_0x2687ed}=fi(_0x2aff67['markerName']),_0xf64a5a=_0x3a9b8e['plugins']['get'](oi)['getCommentThread'](_0x2687ed),_0x36df5f=this['activeMarker']&&fi(this['activeMarker'])['id']===_0x2687ed;let _0x1e6119;if(_0xf64a5a&&_0xf64a5a['isResolved']&&!_0x36df5f&&_0x2aff67['item'])return _0x2ff732['consumable']['consume'](_0x2aff67['item'],'addMarker:'+_0x2aff67['markerName']),_0x2ff732['consumable']['consume'](_0x2aff67['item'],'removeMarker:'+_0x2aff67['markerName']),null;const _0x4a38d0=['ck-comment-marker'];return _0x36df5f&&_0x4a38d0['push']('ck-comment-marker--active'),_0x1e6119=_0xf64a5a?.['length']?_0xf64a5a['comments']['first']['author']['id']:_0x1e144e['me']['id'],{'classes':_0x4a38d0,'attributes':{'data-comment':_0x2687ed,'data-author-id':_0x1e6119}};}}),_0x3a9b8e['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x5e2df4,{options:_0x564fb9})=>{if(_0x564fb9['showCommentHighlights'])return null;const _0x10b17d=_0x3a9b8e['plugins']['get'](oi),_0x535312=_0x3a9b8e['model']['markers']['get'](_0x5e2df4),{id:_0x1a3fd0,part:_0x169f89}=fi(_0x5e2df4);return _0x535312&&!_0x535312['affectsData']||_0x564fb9['ignoreResolvedComments']&&_0x10b17d['getCommentThread'](_0x1a3fd0)?.['isResolved']?null:{'group':'comment','name':_0x169f89?_0x1a3fd0+':'+_0x169f89:_0x1a3fd0};}}),_0x3a9b8e['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x50af28,{writer:_0x2fca7b})=>_0x2fca7b['createElement']('$marker',{'data-name':'comment:'+_0x50af28['getAttribute']('id')})}),_0x3a9b8e['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0x499675=this['editor'],_0x5b9e02=_0x499675['plugins']['get'](oi),_0x5fd313=new Set(),_0x57bb63=new Set();_0x499675['model']['document']['registerPostFixer'](_0x44f2e3=>{let _0x1f5db2=!0x1;for(const {name:_0x4f67dd,data:_0x5d8bdf}of _0x499675['model']['document']['differ']['getChangedMarkers']()){const {group:_0x57e820,id:_0x179a0c}=fi(_0x4f67dd);let _0x510a0d=_0x5d8bdf['newRange'];if('comment'!==_0x57e820||!_0x510a0d)continue;const _0x4a7c54='$graveyard'===_0x510a0d['root']['rootName'];_0x4a7c54||(_0x510a0d=_i(_0x510a0d,_0x499675['model']),!_0x510a0d||_0x510a0d['isCollapsed']||!_0x5d8bdf['newRange']||_0x510a0d['isEqual'](_0x5d8bdf['newRange']))?_0x499675['model']['hasContent'](_0x510a0d)&&!_0x4a7c54?this['isThreadsLoadingPaused']?_0x5fd313['add'](_0x4f67dd):this['_handleThreadMarker'](_0x4f67dd,_0x179a0c):(_0x57bb63['add'](_0x4f67dd),_0x5fd313['delete'](_0x4f67dd),_0x44f2e3['removeMarker'](_0x4f67dd),_0x1f5db2=!0x0):(_0x44f2e3['updateMarker'](_0x4f67dd,{'range':_0x510a0d}),_0x1f5db2=!0x0);}return _0x1f5db2;}),this['on']('change:isThreadsLoadingPaused',(_0x2ee806,_0x1cd84d,_0x2d873a)=>{if(!_0x2d873a&&_0x5fd313['size'])for(const _0x35c3c2 of _0x5fd313){const {id:_0x5974f5}=fi(_0x35c3c2);_0x5fd313['delete'](_0x35c3c2),_0x499675['model']['markers']['get'](_0x35c3c2)&&this['_handleThreadMarker'](_0x35c3c2,_0x5974f5);}}),this['listenTo'](_0x499675['model']['document'],'change',()=>{for(const {name:_0x11a268,data:{newRange:_0x2ba7ad}}of _0x499675['model']['document']['differ']['getChangedMarkers']()){const {group:_0x46c83e,id:_0x40501e}=fi(_0x11a268);if('comment'!==_0x46c83e)continue;const _0x2762e8=_0x5b9e02['getCommentThread'](_0x40501e),_0x343107=this['hasMarkerForId'](_0x40501e);_0x2762e8&&(!_0x2762e8['_hasTargetInContent']&&_0x2ba7ad&&_0x499675['editing']['view']['once']('render',()=>{const _0x1d9d6d=_0x499675['plugins']['get'](ti),_0x4704a7=_0x5b9e02['_threadToController']['get'](_0x2762e8)['view'];_0x1d9d6d['getByInnerView'](_0x4704a7)['refreshVisibility']();},{'priority':'low'}),_0x2762e8['_hasTargetInContent']=_0x343107||!!_0x2ba7ad),_0x2ba7ad||(_0x57bb63['add'](_0x11a268),_0x5fd313['delete'](_0x11a268));}for(const _0x530471 of _0x57bb63){const {id:_0x5e3ba3}=fi(_0x530471),_0x19afdb=_0x5b9e02['getCommentThread'](_0x5e3ba3);if(_0x5fd313['delete'](_0x530471),!_0x19afdb)continue;const _0x542774=this['hasMarkerForId'](_0x5e3ba3);_0x542774||_0x19afdb['isSubmitted']?_0x542774||_0x19afdb['unlinkedAt']||_0x19afdb['setUnlinkedAt'](new Date()):_0x19afdb['remove']();}_0x57bb63['clear']();});}_handleInitialThreads(_0x544e91){_0x544e91['forEach'](_0x26c8ef=>{_0x26c8ef['unlinkedAt']&&this['_attachArchivedThread'](_0x26c8ef['id']);});}_getTargetForId(_0x4f6740){const _0xcc5484=this['editor'],_0x4e4288=this['getAllMarkersForId'](_0x4f6740);return _0x50ca2d(_0xcc5484['editing'],_0x4e4288);}_getTextContext(_0x29de1){const _0x9aecdc=this['getAllMarkersForId'](_0x29de1);let _0x1d43d7='',_0x5da236=!0x1;for(const _0x28da35 of _0x9aecdc){const _0x1f6e58=_0x28da35['getRange']();for(const _0xef10cb of Array['from'](_0x1f6e58['getItems']()))_0xef10cb['is']('$textProxy')?(_0x1d43d7&&_0x5da236&&(_0x1d43d7+='\x20',_0x5da236=!0x1),_0x1d43d7+=_0xef10cb['data']):_0x5da236=!0x0;_0x5da236=!0x0;}return _0x1d43d7['substring'](0x0,0x96);}_attachMarkerToThread(_0x91ca74,_0xa376fb){const _0x59429a=this['editor'],_0x4af915=_0x59429a['plugins']['get'](oi);let _0x2583f=_0x4af915['getCommentThread'](_0xa376fb);const _0x3b2a8c=_0x59429a['config']['get']('collaboration.channelId'),_0x3fe108=_0x59429a['plugins']['get'](di);return _0x2583f&&(_0x2583f['unlinkedAt']&&_0x2583f['setUnlinkedAt'](null),_0x2583f['isAttached'])||(this['getAllMarkersForId'](_0xa376fb)[0x0]['managedUsingOperations']?_0x4af915['fetchCommentThread']({'channelId':_0x3b2a8c,'threadId':_0xa376fb})['then'](_0x2fdbc6=>{if('destroyed'!==_0x59429a['state']){if(_0x2583f=_0x2fdbc6,_0x2583f&&!_0x2583f['isAttached']){const _0x411858=_0x2583f['attachTo'](()=>this['_getTargetForId'](_0xa376fb));_0x3fe108['registerAnnotation'](_0x411858),_0x2583f['isResolved']&&this['_reconvertMarkers'](_0xa376fb);}else{if(!_0x2583f){const _0x13367d=this['getAllMarkersForId'](_0xa376fb);_0x59429a['model']['change'](_0x15ea14=>{for(const _0x339114 of _0x13367d)_0x15ea14['removeMarker'](_0x339114);});}}}}):_0x59429a['editing']['view']['once']('render',()=>{if(_0x4af915['getCommentThread'](_0xa376fb))return;const _0x3fd83b=_0x59429a['plugins']['get'](ti);_0x2583f=_0x4af915['openNewCommentThread']({'channelId':_0x3b2a8c,'threadId':_0xa376fb,'target':()=>this['_getTargetForId'](_0xa376fb),'context':{'type':'text','value':this['_getTextContext'](_0xa376fb)}});const _0x586c61=_0x4af915['_threadToController']['get'](_0x2583f)['view'],_0x39fa7e=_0x3fd83b['getByInnerView'](_0x586c61);_0x39fa7e&&_0x3fe108['registerAnnotation'](_0x39fa7e);},{'priority':'low'})),_0x2583f;}['_handleThreadMarker'](_0x1a3ea1,_0x3eb6df){const _0x34d586=this['_attachMarkerToThread'](_0x1a3ea1,_0x3eb6df);_0x34d586&&!_0x34d586['context']&&_0x34d586['setContext']({'type':'text','value':this['_getTextContext'](_0x3eb6df)});}_initAriaMarkerChangeAnnouncements(){const _0x5aba12=this['editor'];_0x56ef5a(_0x5aba12['model'],({left:_0x46636e,entered:_0x1c5f9c})=>{for(const _0x22b642 of _0x46636e)if(Ai(_0x22b642)){_0x5aba12['ui']['ariaLiveAnnouncer']['announce'](Et(_0x5aba12['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0x14b9f7 of _0x1c5f9c)if(Ai(_0x14b9f7)){_0x5aba12['ui']['ariaLiveAnnouncer']['announce'](Et(_0x5aba12['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0x68f48c(_0x1880a8)));break;}});}};function gi(_0x31e6da,_0x27bb7f){return _0x27bb7f?_0x31e6da+':'+_0x27bb7f:_0x31e6da;}function _i(_0x43dfdd,_0x1284e2){const _0x28c83a=_0x1284e2['schema'],_0xf8fa5e=_0x1284e2['createRange'](_0x43dfdd['start']);for(const _0x2e09af of _0x43dfdd['getWalker']()){const {type:_0x3ca13f,item:_0x206550,nextPosition:_0x5ec198}=_0x2e09af;if('text'===_0x3ca13f||_0x28c83a['isObject'](_0x206550)){const _0x593d0b=_0x1284e2['createPositionBefore'](_0x206550);_0xf8fa5e['isCollapsed']&&(_0xf8fa5e['start']=_0x593d0b),_0xf8fa5e['end']=_0x5ec198;}}return _0xf8fa5e;}function Ai(_0x521ef4){return'comment'===fi(_0x521ef4['name'])['group'];}var vi=class extends _0x3831f5{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,wi,di,ti];}get CommentsListView(){return Lt;}get CommentThreadInputView(){return xt;}init(){const _0x1185a4=this['editor'],_0x5d9d9d=_0x1185a4['plugins']['get'](oi),_0xad5507=_0x1185a4['plugins']['get'](wi),_0x3ffc20=_0x1185a4['plugins']['get'](ti),_0x576e1d=_0x1185a4['plugins']['get'](di);_0x1185a4['ui']['componentFactory']['add']('comment',()=>{const _0x4c7168=this['_createUIButton'](_0x44164c);return _0x4c7168['tooltip']=!0x0,_0x4c7168;}),_0x1185a4['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](rt)),_0x576e1d['addSourceCollector'](()=>{const _0x25c404=[];for(const [_0x45214e,_0x5325b3]of _0x5d9d9d['_threadToController']){const _0x1a263c=_0xad5507['getAllMarkersForId'](_0x45214e['id']),_0x48bfc2=_0x1a263c['map'](_0x19c52a=>_0x19c52a['getRange']());_0x1a263c['length']>0x0&&_0x25c404['push']([_0x5325b3['view'],_0x48bfc2]);}return _0x25c404;}),this['listenTo'](_0x3ffc20,'change:activeAnnotations',(_0x5b9d50,_0x16da7d,_0x297ad7)=>{const _0x34301f=Array['from'](_0x297ad7)['map'](_0x389bbb=>_0x389bbb['innerView'])['find'](_0x12d2db=>_0x5d9d9d['_viewToController']['has'](_0x12d2db));if(!_0x34301f)return void(_0xad5507['activeMarker']=null);const _0x31fd61=_0x5d9d9d['_viewToController']['get'](_0x34301f)['model']['id'],_0x3834ab='comment:'+_0x31fd61;_0x31fd61&&_0xad5507['hasMarkerForId'](_0x31fd61)?_0xad5507['activeMarker']=_0x3834ab:_0xad5507['activeMarker']&&(_0xad5507['activeMarker']=null);}),this['listenTo'](_0x5d9d9d,'removeCommentThread',(_0x3acdc4,{threadId:_0x137c69,isFromAdapter:_0x42c8d6})=>{!_0x42c8d6&&_0x1185a4['ui']['focusTracker']['isFocused']&&_0xad5507['hasMarkerForId'](_0x137c69)&&_0x1185a4['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x5d9d9d,'addComment',(_0xa2fff,{threadId:_0x49789e,isFromAdapter:_0x3c2f6e})=>{!_0x3c2f6e&&_0xad5507['hasMarkerForId'](_0x49789e)&&_0x5d9d9d['hasCommentThread'](_0x49789e)&&0x1===_0x5d9d9d['getCommentThread'](_0x49789e)['length']&&(_0x1185a4['editing']['view']['focus'](),_0xa2fff['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x4c7031=[this['editor']];for(const _0x1e96fb of _0x4c7031){let _0x558b27;for(const _0x2f9463 in _0x1e96fb){const _0x46ee38=_0x2f9463,_0x3da2c4=_0x1e96fb[_0x46ee38];if('commentsLicenseKeyValid'==_0x3da2c4||'commentsLicenseKeyInvalid'==_0x3da2c4||'commentsLicenseKeyExpired'==_0x3da2c4||'commentsLicenseKeyDomainLimit'==_0x3da2c4||'commentsLicenseKeyNotAllowed'==_0x3da2c4||'commentsLicenseKeyEvaluationLimit'==_0x3da2c4||'commentsLicenseKeyUsageLimit'==_0x3da2c4){delete _0x1e96fb[_0x46ee38],_0x558b27=_0x3da2c4,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0x558b27&&_0x1e96fb['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0x558b27&&_0x1e96fb['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0x558b27&&_0x1e96fb['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0x558b27&&_0x1e96fb['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0x558b27&&_0x1e96fb['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0x558b27&&_0x1e96fb['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0xb62599){const _0x892d46=this['editor'],_0x5ad3ab=new _0xb62599(_0x892d46['locale']),_0x494875=_0x892d46['commands']['get']('addCommentThread');return _0x5ad3ab['set']({'label':Et(_0x892d46['locale'],'Comment'),'icon':_0x4f7611}),_0x5ad3ab['bind']('isEnabled')['to'](_0x494875,'isEnabled',_0x494875,'hasContent',(_0x5cfc8a,_0x1d4def)=>_0x5cfc8a&&_0x1d4def),this['listenTo'](_0x5ad3ab,'execute',()=>{_0x494875['execute']();}),_0x5ad3ab;}},yi=class extends _0x3831f5{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[wi];}constructor(_0x172bdf){super(_0x172bdf),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0x690e69,_0x204672,_0x4a9e23)=>{_0x4a9e23?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0x187267,_0x20966d]of this['editor']['commands'])_0x20966d['affectsData']&&'addCommentThread'!==_0x187267&&_0x20966d['forceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('DragDrop')&&this['editor']['plugins']['get']('DragDrop')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['forceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['forceDisabled']('commentsOnlyMode');const _0x350a98=this['editor']['editing']['view']['document'];this['listenTo'](_0x350a98,'cut',_0x5a1311=>_0x5a1311['stop'](),{'priority':'highest'}),this['listenTo'](_0x350a98,'clipboardInput',_0x46019c=>_0x46019c['stop'](),{'priority':'highest'}),this['listenTo'](_0x350a98,'delete',_0x58b646=>_0x58b646['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0x2278c6,_0x39928b]of this['editor']['commands'])_0x39928b['affectsData']&&'addCommentThread'!==_0x2278c6&&_0x39928b['clearForceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['clearForceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['clearForceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['clearForceDisabled']('commentsOnlyMode'),this['stopListening'](this['editor']['editing']['view']['document']);}},Ti=class extends _0x2886e3{activeUIs;uisData;['_uis'];static get requires(){return[ti];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1d9dbc){super(_0x1d9dbc),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x138ba3=this['context']['plugins']['get'](ti);this['listenTo'](_0x138ba3,'_activateAnnotation',(_0x31b0cd,_0x18d006)=>{for(const _0x374ec6 of this['activeUIs']){const _0x44a445=this['_uis']['get'](_0x374ec6);(0x0,this['uisData']['get'](_0x374ec6)['filter'])(_0x18d006)&&_0x44a445['setActiveAnnotation'](_0x18d006);}}),this['listenTo'](_0x138ba3,'_deactivateAllAnnotations',()=>{for(const _0x59b60f of this['activeUIs'])this['_uis']['get'](_0x59b60f)['setActiveAnnotation'](null);}),this['listenTo'](_0x138ba3['_visibleAnnotations'],'add',(_0x1dde00,_0x5e6caf)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x5e6caf);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0x672575){return this['activeUIs']['has'](_0x672575);}activate(_0x2b41cb,_0x42ea58=this['defaultFilter']){const _0x2c3934=this['context']['plugins']['get'](ti);if(!this['_uis']['has'](_0x2b41cb))throw new _0x587c70('annotationsuis-missing-ui',this,{'uiName':_0x2b41cb});this['isActive'](_0x2b41cb)&&this['deactivate'](_0x2b41cb),this['activeUIs']['add'](_0x2b41cb);const _0x5eac35=new Jt();Qt({'source':_0x2c3934['_visibleAnnotations'],'target':_0x5eac35,'filter':_0x42ea58}),this['uisData']['set'](_0x2b41cb,{'collection':_0x5eac35,'filter':_0x42ea58});const _0x4dc177=this['_uis']['get'](_0x2b41cb);_0x4dc177['attach'](_0x5eac35),this['listenTo'](_0x4dc177,'change:activeAnnotation',(_0xb84b3e,_0x589b53,_0x3ceb5f,_0x3f7d13)=>{_0x3f7d13&&_0x2c3934['_removeActiveAnnotation'](_0x3f7d13),_0x3ceb5f&&_0x2c3934['_addActiveAnnotation'](_0x3ceb5f);});}deactivate(_0x597f6d){if(this['activeUIs']['delete'](_0x597f6d),!this['_uis']['has'](_0x597f6d))throw new _0x587c70('annotationsuis-missing-ui',this,{'uiName':_0x597f6d});const _0x531242=this['_uis']['get'](_0x597f6d);_0x531242['detach'](),this['stopListening'](_0x531242),this['uisData']['get'](_0x597f6d)['collection']['destroy'](),this['uisData']['delete'](_0x597f6d);}switchTo(_0x50d62c){if(!this['_uis']['has'](_0x50d62c))throw new _0x587c70('annotationsuis-missing-ui',this,{'uiName':_0x50d62c});const _0x1bc7e8=this['context']['plugins']['get'](ti),_0xd033b5=Array['from'](_0x1bc7e8['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0x50d62c);const _0x10cfd9=this['_uis']['get'](_0x50d62c);_0x10cfd9['setActiveAnnotation'](_0xd033b5),_0x10cfd9['_setSelectedAnnotations']&&_0xd033b5&&_0x10cfd9['_setSelectedAnnotations']([_0xd033b5]);}deactivateAll(){for(const _0x2b9691 of this['activeUIs'])this['deactivate'](_0x2b9691);}register(_0x402076,_0x44d14b){if(this['_uis']['has'](_0x402076))throw new _0x587c70('annotationsuis-register-already-registered');if('function'!=typeof _0x44d14b['attach']||'function'!=typeof _0x44d14b['detach']||'function'!=typeof _0x44d14b['setActiveAnnotation'])throw new _0x587c70('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0x402076,_0x44d14b);}refilterAnnotations(){const _0x26b62e=this['context']['plugins']['get'](ti)['collection'],_0x3d85d2=new Map(),_0x59f780=Array['from'](this['activeUIs']);for(const _0x546d2c of this['activeUIs']){const _0x330385=this['uisData']['get'](_0x546d2c)['collection'];for(const _0x337708 of _0x330385)_0x3d85d2['set'](_0x337708,_0x546d2c);}for(const _0x5aaa1f of _0x26b62e){const _0x15b771=_0x3d85d2['get'](_0x5aaa1f);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x5aaa1f);const _0x3f0e63=_0x59f780['find'](_0x4ff3df=>this['uisData']['get'](_0x4ff3df)['filter'](_0x5aaa1f));_0x15b771!==_0x3f0e63&&(_0x15b771&&this['uisData']['get'](_0x15b771)['collection']['remove'](_0x5aaa1f),_0x3f0e63&&this['uisData']['get'](_0x3f0e63)['collection']['add'](_0x5aaa1f));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x4bd434){const _0x167e3a=[];for(const _0x43f48a of this['activeUIs']){(0x0,this['uisData']['get'](_0x43f48a)['filter'])(_0x4bd434)&&_0x167e3a['push'](_0x43f48a);}if(_0x167e3a['length']>0x1)throw new _0x587c70('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0x167e3a,'annotationType':_0x4bd434['type']});}};const Ci=/* #__PURE__ -- @preserve */
|
|
32
|
-
|
|
33
|
-
_0x455aab('px');var Ei=class extends ht{content;_targetTop;_mutationObserver;constructor(_0x2ed619){super(_0x2ed619),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x283093,_0x9bb678)=>_0x283093+_0x9bb678),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=Xt(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0x40d9e6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0x40d9e6['to']('isAnimationDisabled',_0x3be6e0=>_0x3be6e0?'ck-sidebar-item--no-animation':'')],'style':{'top':_0x40d9e6['to']('top',_0x5ec61c=>bi(_0x5ec61c))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x5ebc8c=this['element']['clientHeight'];_0x5ebc8c&&(this['height']=_0x5ebc8c);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},ki=class extends _0x2886e3{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x234038){super(_0x234038),this['set']('_lastItem',void 0x0),this['view']=this['_createSidebarView'](),this['set']('container',null),this['_spaceBetweenItems']=0x19,this['_sidebarItemViewToAnnotation']=new Map(),this['_annotationToSidebarItemView']=new Map(),this['context']['config']['define']('sidebar.preventScrollOutOfView',!0x1),this['_annotations']=null,this['_activeAnnotation']=null,this['_recalculateBuffer']=[];}init(){const _0x199318=this['context']['config']['get']('sidebar.container');_0x199318&&this['setContainer'](_0x199318);}setContainer(_0x3d9149){if(!Oi(_0x3d9149))throw new _0x587c70('sidebar-setcontainer-invalid-element');this['container']=_0x3d9149;}_attachToContainer({viewClass:_0x323d82='',spaceBetweenItems:_0x17405f=0x19}={}){if(!Oi(this['container']))throw new _0x587c70('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0x323d82,this['_spaceBetweenItems']=_0x17405f;}['rearrange']({removedAnnotation:_0x71f6b2,previousAnnotation:_0x132520,nextAnnotation:_0xce70cd}){const _0x2c41f6=this['getSidebarItemView'](_0x71f6b2);this['view']['list']['remove'](_0x2c41f6),this['_destroySidebarItemView'](_0x71f6b2),_0x132520&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x132520)),_0xce70cd&&this['_alignToTargetRect'](this['getSidebarItemView'](_0xce70cd)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0x589eea,activatedAnnotation:_0x303587,disableAnimationOnActivatedAnnotation:_0x5a4792}){if(this['_activeAnnotation']=_0x303587,_0x589eea){_0x589eea['isActive']=!0x1;const _0x413e85=this['getSidebarItemView'](_0x589eea);_0x413e85&&_0x5a4792&&(_0x413e85['isAnimationDisabled']=!0x1);}if(_0x303587){const _0x207f3c=this['getSidebarItemView'](_0x303587);_0x207f3c&&(_0x303587['isActive']=!0x0,_0x5a4792&&(_0x207f3c['isAnimationDisabled']=!0x0,_0x207f3c['top']+=0x1),this['_alignToTargetRect'](_0x207f3c));}}_detachFromContainer(_0x1e2919){if(this['view']['element']['remove'](),_0x1e2919){for(const _0x43f5a4 of _0x1e2919)this['_destroySidebarItemView'](_0x43f5a4);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x5da89a,_0x117b1e){_0x117b1e||(_0x117b1e=_0x5da89a['view']);const _0x586771=new Ei(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x586771,_0x5da89a),this['_annotationToSidebarItemView']['set'](_0x5da89a,_0x586771),_0x586771['content']['add'](_0x117b1e),this['listenTo'](_0x5da89a['view'],'change:targetRect',(_0x472746,_0xa501a3,_0x28b839)=>{const _0x3932e1=this['_getTargetTop'](_0x5da89a,_0x28b839);_0x586771['_targetTop']!=_0x3932e1&&(_0x586771['_targetTop']=_0x3932e1,this['_setItemTop'](_0x586771,_0x3932e1));}),this['listenTo'](_0x586771,'change:top',()=>{this['_recalculate'](_0x586771,'top');}),this['listenTo'](_0x586771,'change:bottom',()=>{this['_recalculate'](_0x586771,'bottom');}),this['_alignToTargetRect'](_0x586771);const _0x570db8=this['_getItemBefore'](_0x586771);return _0x570db8&&this['_alignAfterItem'](_0x570db8,_0x586771)||this['_alignToTargetRect'](_0x586771),this['_updateLastItem'](),this['view']['list']['add'](_0x586771),_0x586771;}['_alignForTopChange'](_0x31d15e){if(!_0x31d15e['content']['length'])return;const _0x15e9c4=this['_getItemBefore'](_0x31d15e);if(!_0x15e9c4)return;const _0x29433d=this['_sidebarItemViewToAnnotation']['get'](_0x15e9c4),_0x33c98a=this['_activeAnnotation'];_0x33c98a&&_0x33c98a===_0x29433d?this['_alignAfterItem'](_0x15e9c4,_0x31d15e):this['_alignBeforeItem'](_0x31d15e,_0x15e9c4);}_alignForBottomChange(_0x36ac8b){if(!_0x36ac8b['content']['length'])return;const _0x997320=this['_getItemAfter'](_0x36ac8b);if(!_0x997320)return;const _0x29c1cd=this['_sidebarItemViewToAnnotation']['get'](_0x997320),_0x49c008=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0x3e1dfc=this['_activeAnnotation'];_0x3e1dfc&&_0x3e1dfc===_0x29c1cd&&_0x49c008?(this['_alignBeforeItem'](_0x997320,_0x36ac8b),this['_alignAfterItem'](_0x36ac8b,_0x997320)):_0x3e1dfc&&_0x3e1dfc===_0x29c1cd?this['_alignBeforeItem'](_0x997320,_0x36ac8b):this['_alignAfterItem'](_0x36ac8b,_0x997320);}_recalculate(_0x25489e,_0x19820d){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x5a69ff,changedProp:_0x545424}of this['_recalculateBuffer'])'top'===_0x545424?this['_alignForTopChange'](_0x5a69ff):this['_alignForBottomChange'](_0x5a69ff);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0x25489e,'changedProp':_0x19820d});}getSidebarItemView(_0x327b3e){return this['_annotationToSidebarItemView']['get'](_0x327b3e);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0x468d18){const _0x5d68b7=this['getSidebarItemView'](_0x468d18);this['stopListening'](_0x5d68b7),this['stopListening'](_0x468d18['view']),_0x5d68b7['destroy'](),this['_annotationToSidebarItemView']['delete'](_0x468d18),this['_sidebarItemViewToAnnotation']['delete'](_0x5d68b7);}_createSidebarView(){const _0x675f3=new Ii(this['context']['locale']);return _0x675f3['render'](),this['on']('change:_lastItem',(_0x546586,_0x2a5c9e,_0x128f24,_0x472c6a)=>{_0x472c6a&&_0x675f3['unbind']('minHeight'),_0x128f24?_0x675f3['bind']('minHeight')['to'](_0x128f24,'bottom'):_0x675f3['minHeight']=null;}),_0x675f3;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0x931a64){const _0x1bb667=this['_sidebarItemViewToAnnotation']['get'](_0x931a64),_0x24372c=_0x1bb667&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x1bb667)-0x1);return _0x24372c&&this['getSidebarItemView'](_0x24372c)||null;}_getItemAfter(_0xab1db5){const _0x297469=this['_sidebarItemViewToAnnotation']['get'](_0xab1db5),_0x3c6339=_0x297469&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x297469)+0x1);return _0x3c6339&&this['getSidebarItemView'](_0x3c6339)||null;}_alignBeforeItem(_0x4fbabf,_0x3f3618){_0x4fbabf['updateHeight']();const _0x1ef233=Ni(_0x3f3618['bottom']+this['_spaceBetweenItems'],_0x4fbabf['top']);return!!_0x1ef233&&(this['_setItemTop'](_0x3f3618,_0x3f3618['top']-_0x1ef233),!0x0);}_alignAfterItem(_0x50b942,_0x3c71e9){_0x50b942['updateHeight']();const _0x22f7c1=Ni(_0x50b942['bottom']+this['_spaceBetweenItems'],_0x3c71e9['top']);return!!_0x22f7c1&&(this['_setItemTop'](_0x3c71e9,_0x3c71e9['top']+_0x22f7c1,!0x1),!0x0);}_alignToTargetRect(_0x538a50){const _0x461852=this['_sidebarItemViewToAnnotation']['get'](_0x538a50);if(!_0x461852||!_0x461852['target']||!_0x461852['targetRect'])return;const _0x43e3f3=this['_getTargetTop'](_0x461852,_0x461852['targetRect']);this['_setItemTop'](_0x538a50,_0x43e3f3);}_getTargetTop(_0x1238e8,_0x4f7b77){if(null===_0x4f7b77)return 0x0;if(_0x1238e8['target']instanceof _0x132048)return _0x4f7b77['top'];{const _0x6fefef=new _0x132048(this['view']['element'])['top'];return _0x4f7b77['top']-_0x6fefef;}}_setItemTop(_0x580dff,_0x174dbd,_0x14a450=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x14a450&&(_0x174dbd=Math['max'](_0x174dbd,this['_getMaxAvailableTop'](_0x580dff))),_0x580dff['top']=_0x174dbd;}_getMaxAvailableTop(_0x19ee0d){let _0x2f54d7=this['_getItemBefore'](_0x19ee0d),_0x52af91=0x0;for(;_0x2f54d7;)_0x2f54d7['updateHeight'](),_0x52af91+=this['_spaceBetweenItems']+_0x2f54d7['height'],_0x2f54d7=this['_getItemBefore'](_0x2f54d7);return _0x52af91;}};function Ni(_0xf448f9,_0x56f914){return Math['max'](_0xf448f9-_0x56f914,0x0);}function Oi(_0x49eda3){return null!==_0x49eda3&&'object'==typeof _0x49eda3&&0x1===_0x49eda3['nodeType'];}var Mi=class extends _0x2886e3{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x387d41){super(_0x387d41),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x43adb0(),this['_refreshPositioningDebounced']=_0xbc46bc(()=>{_0x387d41['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0x3b2f56=this['context']['plugins']['get'](Ti),_0x46cbe2=this['context']['plugins']['get'](ki);_0x3b2f56['register']('wideSidebar',this),_0x46cbe2['container']&&_0x3b2f56['switchTo']('wideSidebar');}setActiveAnnotation(_0x4b5c0c){if(_0x4b5c0c===this['activeAnnotation'])return;const _0x38df2d=this['context']['plugins']['get'](ki);_0x38df2d['_activeAnnotation']=_0x4b5c0c;const _0x442b4b=this['activeAnnotation'];_0x38df2d['refresh']({'blurredAnnotation':_0x442b4b,'activatedAnnotation':_0x4b5c0c}),this['activeAnnotation']=_0x4b5c0c;}attach(_0x443f4d){this['annotations']=_0x443f4d;const _0x49bb1b=this['context']['plugins']['get'](ki);if(_0x49bb1b['_annotations']=_0x443f4d,this['isAttached'])throw new _0x587c70('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x49bb1b,'set:container',()=>{this['detach'](),this['listenTo'](_0x49bb1b,'change:container',_0x246452=>{_0x246452['off'](),this['attach'](_0x443f4d);});}),_0x49bb1b['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x507934=_0x550c45=>{_0x550c45['updateTargetRect'](),_0x49bb1b['addAnnotation'](_0x550c45);};for(const _0x2d1ab6 of _0x443f4d)_0x507934(_0x2d1ab6);this['listenTo'](_0x443f4d,'add',(_0xe8a7b5,_0x388a31)=>{_0x507934(_0x388a31);}),this['listenTo'](_0x443f4d,'remove',(_0x5a3194,_0xe364d4,_0x4a20f8)=>{_0x49bb1b['rearrange']({'removedAnnotation':_0xe364d4,'previousAnnotation':_0x443f4d['get'](_0x4a20f8-0x1),'nextAnnotation':_0x443f4d['get'](_0x4a20f8+0x1)}),_0xe364d4===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x443f4d,'focus',(_0x1c22c3,_0x5100e9)=>{this['setActiveAnnotation'](_0x5100e9);}),this['listenTo'](_0x443f4d,'blur',()=>{this['setActiveAnnotation'](null);});const _0x19b814=this['context']instanceof _0x345ccf?this['context']['editors']:new _0x43adb0([this['context']]);for(const _0x3a7e7d of _0x19b814)this['_integrateWithEditorAnnotations'](_0x3a7e7d);this['listenTo'](_0x19b814,'add',(_0x3cc7f9,_0x4bab00)=>{this['listenTo'](_0x4bab00,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x4bab00);});}),this['listenTo'](_0x19b814,'remove',(_0x18ba6e,_0x449df3)=>{_0x449df3['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x449df3['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x587c70('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x7e19=this['context']['plugins']['get'](ki);_0x7e19['_detachFromContainer'](this['annotations']),this['stopListening'](_0x7e19),this['stopListening'](this['annotations']),this['context']instanceof _0x345ccf&&this['stopListening'](this['context']['editors']);for(const _0x464d24 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x464d24);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0x5c404a){if(!_0x5c404a['plugins']['has']('EditorAnnotations'))return;const _0x2db7e7=_0x5c404a['plugins']['get']('EditorAnnotations'),_0x2633e9=()=>{const _0x44646c=_0x2db7e7['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0x44646c[0x0]||null);};this['listenTo'](_0x2db7e7,'refresh',_0x2633e9),this['listenTo'](_0x2db7e7,'blur',(_0x4de151,{isAnnotationTracked:_0x350ff6})=>{this['activeAnnotation']&&_0x350ff6(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x2db7e7,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0x4b6d0d=>{_0x2db7e7['hasDomSelection']()&&(_0x2633e9(),_0x4b6d0d['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x2db7e7);}_destroyEditorAnnotationsIntegration(_0x45ddd1){this['stopListening'](_0x45ddd1),this['_editorAnnotations']['remove'](_0x45ddd1);}},Ri=class extends _0x44164c{counterView;constructor(_0xa5c28f){super(_0xa5c28f);const _0x47dfec=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0x4ad9a9,_0xc4e386)=>_0x4ad9a9?'...':_0xc4e386['toString']()),this['set']('annotationType',''),this['icon']=_0x4f7611,this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new ht(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0x47dfec['to']('annotationType',_0xe40485=>'ck-annotation-counter__badge--'+_0xe40485),_0x47dfec['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x47dfec['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Si=class extends _0x2886e3{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x41e8ea){super(_0x41e8ea),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0x341190())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x43adb0(),this['_refreshPositioningDebounced']=_0xbc46bc(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Ti)['register']('narrowSidebar',this),this['bodyCollection']=new _0x47ef85(this['context']['locale']),this['balloonPanelView']=new _0xce8472(this['context']['locale']),this['bodyCollection']['attachToDom'](),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0xf57ce0){this['annotations']=_0xf57ce0;const _0x3d7b64=this['context']['plugins']['get'](ki),_0x591f3e=this['balloonPanelView'];if(_0x3d7b64['_annotations']=_0xf57ce0,this['isAttached'])throw new _0x587c70('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x3d7b64,'set:container',()=>{this['detach'](),this['listenTo'](_0x3d7b64,'change:container',_0x466f1b=>{_0x466f1b['off'](),this['attach'](_0xf57ce0);});}),_0x3d7b64['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x502650=_0x9d4bd7=>{const _0x2a81b3=new Ri(this['context']['locale']);_0x3d7b64['addAnnotation'](_0x9d4bd7,_0x2a81b3),this['_annotationToNarrowView']['set'](_0x9d4bd7,_0x2a81b3),_0x2a81b3['bind']('isDirty','annotationType','number')['to'](_0x9d4bd7['view'],'isDirty','type','length'),_0x2a81b3['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0x591f3e['content']['first']!==_0x9d4bd7['view']?(this['_showBalloon'](_0x9d4bd7),_0x9d4bd7['view']['element']['focus'](),this['setActiveAnnotation'](_0x9d4bd7)):this['setActiveAnnotation'](null);});};for(const _0xd39d32 of _0xf57ce0)_0x502650(_0xd39d32);this['listenTo'](_0xf57ce0,'add',(_0x434369,_0x54c906)=>{_0x502650(_0x54c906);}),this['listenTo'](_0xf57ce0,'remove',(_0x59d9e0,_0x2b595e,_0x24fa94)=>{this['_annotationToNarrowView']['get'](_0x2b595e)['destroy'](),this['_annotationToNarrowView']['delete'](_0x2b595e),_0x3d7b64['rearrange']({'removedAnnotation':_0x2b595e,'previousAnnotation':_0xf57ce0['get'](_0x24fa94-0x1),'nextAnnotation':_0xf57ce0['get'](_0x24fa94+0x1)}),_0x2b595e===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0xf57ce0,'focus',(_0x4c46f7,_0x55fe65)=>{this['setActiveAnnotation'](_0x55fe65);}),this['listenTo'](_0xf57ce0,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0x48926c,_0x14d6f6)=>{_0x14d6f6['keyCode']===_0x42efc2['esc']&&_0x591f3e['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0x591f3e['content']['first']),this['_hideBalloon'](),_0x14d6f6['stopPropagation'](),_0x14d6f6['preventDefault']());}),this['_domEmitter']['listenTo'](document,'mousedown',(_0x472dec,_0x516aa1)=>{const _0x28c1a0=_0x516aa1['target'];_0x591f3e['isVisible']&&_0x591f3e['element']['contains'](_0x28c1a0)||_0x3d7b64['view']['element']['contains'](_0x28c1a0)||_0x472dec['preventClosingBalloon']||this['activeAnnotation']&&this['activeAnnotation']['focusableElements']['find'](_0x399e54=>_0x399e54['contains'](_0x28c1a0))||(this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null));});const _0x5f53a2=this['context']instanceof _0x345ccf?this['context']['editors']:new _0x43adb0([this['context']]);for(const _0x2fb66c of _0x5f53a2)this['_integrateWithEditorAnnotations'](_0x2fb66c);this['listenTo'](_0x5f53a2,'add',(_0x3ad95c,_0x287141)=>{this['listenTo'](_0x287141,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x287141);});}),this['listenTo'](_0x5f53a2,'remove',(_0x51f562,_0x479afa)=>{_0x479afa['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x479afa['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x2a1e94){if(_0x2a1e94===this['activeAnnotation'])return;const _0x536dc5=this['context']['plugins']['get'](ki);_0x536dc5['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x2a1e94,'disableAnimationOnActivatedAnnotation':!0x0}),_0x2a1e94&&_0x536dc5['getSidebarItemView'](_0x2a1e94)?this['_showBalloon'](_0x2a1e94):this['_hideBalloon'](),this['activeAnnotation']=_0x2a1e94;}detach(){if(!this['isAttached'])throw new _0x587c70('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0xf5972a=this['context']['plugins']['get'](ki);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x33e363=>_0x33e363['destroy']()),this['_annotationToNarrowView']['clear'](),_0xf5972a['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x345ccf&&this['stopListening'](this['context']['editors']);for(const _0x2046e4 of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x2046e4);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['bodyCollection']['detachFromDom']();}_integrateWithEditorAnnotations(_0x1eba8c){if(!_0x1eba8c['plugins']['has']('EditorAnnotations'))return;const _0x47f9f6=_0x1eba8c['plugins']['get']('EditorAnnotations'),_0x3647f8=this['context']['plugins']['get'](ki),_0x167a8b=this['annotations'],_0x39fdc3=this['balloonPanelView'],_0x1a8bf7=()=>{const _0x5d338c=_0x47f9f6['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x5d338c),this['setActiveAnnotation'](_0x5d338c[0x0]||null);};this['listenTo'](_0x47f9f6,'refresh',_0x1a8bf7),this['listenTo'](_0x47f9f6,'blur',(_0xb61dc0,{isAnnotationTracked:_0x2bdd91})=>{this['activeAnnotation']&&_0x2bdd91(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x47f9f6,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x167a8b,'blur',_0x5d559d=>{_0x47f9f6['hasDomSelection']()&&_0x5d559d['stop']();},{'priority':'high'}),this['listenTo'](this['_domEmitter'],'mousedown',(_0x425c7f,_0x3e2340)=>{const _0xc1a22f=_0x3e2340['target'];_0x39fdc3['isVisible']&&_0x39fdc3['element']['contains'](_0xc1a22f)||_0x3647f8['view']['element']['contains'](_0xc1a22f)||this['activeAnnotation']&&_0x47f9f6['hasDomSelection']()&&(_0x1a8bf7(),_0x425c7f['preventClosingBalloon']=!0x0);},{'priority':'high'}),this['_editorAnnotations']['add'](_0x47f9f6);}_destroyEditorAnnotationsIntegration(_0x47e68c){_0x47e68c&&(this['stopListening'](_0x47e68c),this['_editorAnnotations']['remove'](_0x47e68c));}_setSelectedAnnotations(_0x4b091e){for(const _0xeb2514 of this['_selectedAnnotations'])_0x4b091e['includes'](_0xeb2514)||this['_manuallyClosedAnnotationViews']['delete'](_0xeb2514['view']);this['_selectedAnnotations']=_0x4b091e;}_refreshPositioning(){const _0x58a60d=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0x58a60d['isVisible']&&this['_updateBalloonPosition']();}['_showBalloon'](_0xac7e3a){if(this['_manuallyClosedAnnotationViews']['has'](_0xac7e3a['view']))return;const _0x2d96d1=this['balloonPanelView']['content']['first'];_0x2d96d1!==_0xac7e3a['view']?(_0x2d96d1&&this['_detachListeners'](_0x2d96d1),this['_attachListeners'](_0xac7e3a['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0xac7e3a['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0x1feb11=this['balloonPanelView']['content']['first'],_0x244e56=_0x1feb11&&this['annotations']['getByView'](_0x1feb11);if(!_0x244e56||!this['_annotationToNarrowView']['has'](_0x244e56))return;const _0x4fb433=this['_annotationToNarrowView']['get'](_0x244e56)['element'],_0x1fce1b=(function(){const _0x4ad0b9=_0xce8472['defaultPositions'];return[_0x4ad0b9['southArrowNorthEast'],_0x4ad0b9['northArrowSouthEast'],_0x4ad0b9['southArrowNorth'],_0x4ad0b9['northArrowSouth'],_0x4ad0b9['southArrowNorthWest'],_0x4ad0b9['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x4fb433,'positions':_0x1fce1b});}['_hideBalloon'](){const _0x1e5619=this['balloonPanelView'],_0x4247fa=_0x1e5619['content']['first'];_0x4247fa&&(this['_detachListeners'](_0x4247fa),_0x1e5619['unpin'](),_0x1e5619['content']['clear']());}_attachListeners(_0x88f78b){this['listenTo'](_0x88f78b,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0x88f78b,'Esc',(_0x5ef3e3,_0x51981e)=>{this['_manuallyClosedAnnotationViews']['add'](_0x88f78b),this['_hideBalloon'](),_0x51981e();});}_detachListeners(_0x2f4a5c){this['stopListening'](_0x2f4a5c);}},xi=class extends _0x3831f5{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[di,_0x24ce3a,Ti];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x84e21f){super(_0x84e21f),_0x84e21f['editing']['view']['addObserver'](lt),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x84e21f['plugins']['get'](_0x24ce3a),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0xbc46bc(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x576f1c=this['editor']['plugins']['get'](Ti);_0x576f1c['context']===this['editor']&&(_0x576f1c['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x95a75f,_0x1753e6)=>{const _0x18edfa=this['_balloon'];if(this['isAttached']&&_0x18edfa['visibleView']){const _0x20b472=this['annotations']['getByView'](_0x18edfa['visibleView']);_0x20b472&&this['_closeAnnotation'](_0x20b472),_0x1753e6();}}));}afterInit(){const _0x21cd8d=this['editor']['plugins']['get'](Ti);_0x21cd8d['context']===this['editor']&&(_0x21cd8d['hasActive']()||_0x21cd8d['switchTo']('inline'));}setActiveAnnotation(_0x15db18){_0x15db18!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x15db18&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x15db18)&&this['_addAnnotationToBalloon'](_0x15db18,!0x0),_0x15db18['isActive']=!0x0),_0x15db18||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x15db18);}attach(_0x508aec){this['annotations']=_0x508aec;const _0x501d3a=this['editor']['plugins']['get'](Ti),_0x494533=this['_balloon'];if(this['isAttached'])throw new _0x587c70('inlineannotations-attach-already-attached',this);if(_0x501d3a['context']!==this['editor'])throw new _0x587c70('inlineannotations-not-allowed-with-context',this);const _0x58659f=this['editor']['plugins']['get'](di);this['listenTo'](_0x58659f,'refresh',()=>{const _0xefb60=_0x58659f['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0x142391,_0x1cdc20;!this['_forceRefresh']&&(_0x142391=_0xefb60,_0x1cdc20=this['_selectedAnnotations'],_0x142391['length']===_0x1cdc20['length']&&_0x142391['every'](_0x2734a8=>_0x1cdc20['includes'](_0x2734a8)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0xefb60),this['setActiveAnnotation'](_0xefb60[0x0]||null));}),this['listenTo'](_0x58659f,'blur',(_0x18986b,{isAnnotationTracked:_0x191d76})=>{this['activeAnnotation']&&_0x191d76(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0x58659f,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x233604,_0x208770,_0x3f9590)=>{_0x3f9590||this['setActiveAnnotation'](null);}),this['listenTo'](_0x508aec,'remove',(_0x4a2012,_0x4a0b0e)=>{this['_removeAnnotationFromBalloon'](_0x4a0b0e),_0x4a0b0e===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x494533,'change:visibleView',(_0x32d53d,_0x27be4a,_0x6f3985,_0x2c64cd)=>{_0x2c64cd&&this['stopListening'](_0x2c64cd);const _0x1cfdb7=_0x508aec['getByView'](_0x6f3985);_0x6f3985&&_0x1cfdb7&&(this['listenTo'](_0x6f3985,'change:height',()=>{_0x494533['updatePosition']();}),this['listenTo'](_0x6f3985,'Esc',()=>{this['_closeAnnotation'](_0x1cfdb7),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x1cfdb7&&this['setActiveAnnotation'](_0x1cfdb7));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0x494533['visibleView']&&_0x508aec['getByView'](_0x494533['visibleView'])&&_0x494533['updatePosition']();}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',()=>{this['_forceRefresh']=!0x0,this['_manuallyClosed']['clear']();}),this['editor']['editing']['view']['document']['selection']['editableElement']&&this['editor']['editing']['view']['focus'](),this['isAttached']=!0x0;}detach(){if(!this['isAttached'])throw new _0x587c70('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0x2304f2 of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0x2304f2);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0x45a372){for(const _0x5d6fcb of this['_selectedAnnotations'])_0x45a372['includes'](_0x5d6fcb)||this['_manuallyClosed']['delete'](_0x5d6fcb);for(const _0x5ff07 of this['annotations'])_0x45a372['includes'](_0x5ff07)||this['_removeAnnotationFromBalloon'](_0x5ff07);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0x5b4ca8 of _0x45a372)this['_addAnnotationToBalloon'](_0x5b4ca8);}this['_selectedAnnotations']=_0x45a372;}_addAnnotationToBalloon(_0x347d55,_0x78b0a3=!0x1){this['_manuallyClosed']['has'](_0x347d55)||(this['_addedAnnotations']['has'](_0x347d55)||this['_balloon']['hasView'](_0x347d55['view'])||(this['_addedAnnotations']['add'](_0x347d55),this['_balloon']['add']({'stackId':_0x347d55['view']['id'],'view':_0x347d55['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x347d55)}})),_0x78b0a3&&this['_balloon']['showStack'](_0x347d55['view']['id']));}_getBalloonTargetForAnnotation(_0x55e039){const _0x492f6d=_0x55e039['target'],_0x461fe2=this['editor']['editing']['view'],_0x12d186=_0x461fe2['document']['selection']['getFirstRange'](),_0x186e2b=_0x461fe2['domConverter']['viewRangeToDom'](_0x12d186);if(_0x186e2b['collapse'](!0x0),_0x492f6d){if(_0x492f6d instanceof _0x132048)return _0x492f6d;let _0x1f3384=[];for(const _0x4ea8e9 of _0x492f6d)_0x1f3384['push'](..._0x132048['getDomElementRects'](_0x4ea8e9));_0x1f3384=function(_0x2e940d){const _0x3247c4=[];let _0x5ed7d5=_0x2e940d[0x0];for(let _0x3abf07=0x1;_0x3abf07<_0x2e940d['length'];_0x3abf07++)if(Pi(_0x5ed7d5,_0x2e940d[_0x3abf07])){const _0x49899d=_0x2e940d[_0x3abf07]['width'];_0x5ed7d5['width']+=_0x49899d,_0x5ed7d5['right']+=_0x49899d;}else _0x3247c4['push'](_0x5ed7d5),_0x5ed7d5=_0x2e940d[_0x3abf07];return _0x3247c4['push'](_0x5ed7d5),_0x3247c4;}(_0x1f3384);const _0x126003=_0x186e2b['getBoundingClientRect']();return _0x1f3384['find'](_0x1f3f4f=>_0x1f3f4f['top']<=_0x126003['top']&&_0x1f3f4f['bottom']>=_0x126003['bottom']&&_0x1f3f4f['left']<=_0x126003['left']&&_0x1f3f4f['right']>=_0x126003['right'])||_0x1f3384[0x0];}return _0x55e039['targetRect']||_0x186e2b;}_removeAnnotationFromBalloon(_0x1a9852){this['_addedAnnotations']['has'](_0x1a9852)&&this['_balloon']['hasView'](_0x1a9852['view'])&&(this['_addedAnnotations']['delete'](_0x1a9852),this['_balloon']['remove'](_0x1a9852['view']));}_closeAnnotation(_0x302c24){this['_manuallyClosed']['add'](_0x302c24),this['_removeAnnotationFromBalloon'](_0x302c24);}};function Pi(_0x1c9812,_0x37d8f9){return _0x1c9812['top']===_0x37d8f9['top']&&_0x1c9812['bottom']===_0x37d8f9['bottom']&&_0x1c9812['right']===_0x37d8f9['left'];}var Li=class extends ht{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0x508b37,_0xa6ac7){super(_0x508b37),this['set']('isEmpty',!_0xa6ac7['length']),this['focusTracker']=new _0x52e6a6(),this['_annotationViews']=_0xa6ac7,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new et({'focusables':_0xa6ac7,'focusTracker':this['focusTracker']}),this['listenTo'](_0xa6ac7,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0xa6ac7,'remove',(_0x1be2f1,_0x419384)=>{_0x419384['isActive']&&this['focus'](),_0xa6ac7['length']||(this['isEmpty']=!0x0);});const _0x46779a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Et(_0x508b37,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0xa6ac7},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x46779a['if']('isEmpty','ck-hidden',_0x44dce9=>!_0x44dce9)]},'children':[{'text':Et(_0x508b37,'EMPTY_COMMENTS_ARCHIVE')}]}]}]});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}destroy(){super['destroy'](),this['focusTracker']['destroy']();}['focus'](){this['focusCycler']['first']?this['focusCycler']['focusFirst']():this['element']['focus']();}_setupKeyboardNavigation(){for(const _0xca973f of this['_annotationViews'])this['focusTracker']['add'](_0xca973f['element']);this['_annotationViews']['on']('change',(_0xc529da,{added:_0x1a2a50,removed:_0xfe9ba3})=>{for(const _0x2969cb of _0x1a2a50)this['focusTracker']['add'](_0x2969cb['element']);for(const _0x5681c9 of _0xfe9ba3)this['focusTracker']['remove'](_0x5681c9['element']);});}},Di=class extends _0x2886e3{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,ti];}constructor(_0x45dcdd){super(_0x45dcdd),this['archivedThreads']=new _0x43adb0();}init(){const _0x468330=this['context'],_0xeefe4a=_0x468330['plugins']['get'](oi),_0x21a964=_0x468330['plugins']['get'](ti);this['listenTo'](_0xeefe4a,'addCommentThread',(_0x3a982c,{threadId:_0x54e68c})=>{const _0x16ac01=_0xeefe4a['getCommentThread'](_0x54e68c);_0x16ac01['archivedAt']&&this['archivedThreads']['add'](_0x16ac01,this['_calculatePosition'](_0x16ac01['archivedAt'])),this['listenTo'](_0x16ac01,'change:archivedAt',(_0x3909d5,_0x1ae503,_0x1fd71f)=>{_0x1fd71f?this['archivedThreads']['has'](_0x16ac01)||this['archivedThreads']['add'](_0x16ac01,this['_calculatePosition'](_0x16ac01['archivedAt'])):this['archivedThreads']['has'](_0x16ac01)&&this['archivedThreads']['remove'](_0x16ac01);});}),this['listenTo'](_0xeefe4a,'removeCommentThread',(_0x17bddd,{threadId:_0xf585d1})=>{const _0x16da10=_0xeefe4a['getCommentThread'](_0xf585d1);this['stopListening'](_0x16da10),this['archivedThreads']['has'](_0x16da10)&&this['archivedThreads']['remove'](_0x16da10);},{'priority':'highest'}),this['listenTo'](_0x21a964['collection'],'focus',(_0x442deb,_0x1dc9a5)=>{_0x1dc9a5['isVisible']||(_0x1dc9a5['isActive']=!0x0,_0x21a964['activate'](_0x1dc9a5));});}_calculatePosition(_0x298a4c){const _0x20b8e5=[...this['archivedThreads']]['findIndex'](_0x5e6bd0=>_0x5e6bd0['archivedAt']<_0x298a4c);return _0x20b8e5>-0x1?_0x20b8e5:this['archivedThreads']['length'];}},Vi=class extends _0x3831f5{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Di,_0x28d408];}constructor(_0x4b0203){super(_0x4b0203),this['annotationViews']=new at(),this['_pendingThreads']=[];}init(){const _0x28d5e1=this['editor'],_0x4b2785=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x28d5e1['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](_0x44164c,!0x0)),_0x28d5e1['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0x1ffad6=this['_createCommentsArchiveButton'](rt);return _0x1ffad6['set']({'role':'menuitemcheckbox'}),_0x1ffad6;});const _0x230790=_0x28d5e1['plugins']['get'](Di),_0x4c64d2=_0x28d5e1['plugins']['get']('Annotations'),_0x509c39=_0x28d5e1['plugins']['get']('CommentsRepository');_0x230790['archivedThreads']['forEach'](_0x5bea11=>{this['_handleNewThread'](_0x5bea11);}),this['listenTo'](_0x230790['archivedThreads'],'add',(_0x2f3c06,_0x15af32)=>{this['_handleNewThread'](_0x15af32);}),this['listenTo'](_0x4c64d2['collection'],'add',(_0x111aca,_0x1af175)=>{const _0x2f5ee5=this['_pendingThreads']['find'](_0x18a7c4=>{const _0x186417=_0x509c39['_threadToController']['get'](_0x18a7c4);return _0x186417&&_0x1af175['innerView']===_0x186417['view'];});if(_0x2f5ee5){const _0x3f08c7=this['_calculatePosition'](_0x2f5ee5['archivedAt']);this['_addAnnotationToArchive'](_0x1af175,_0x3f08c7),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x2f5ee5),0x1);}}),this['listenTo'](_0x230790['archivedThreads'],'remove',(_0x29442e,_0x2ec7e2)=>{const _0x2c59a8=_0x28d5e1['config']['get']('collaboration.channelId');if(!_0x2c59a8||_0x2ec7e2['channelId']===_0x2c59a8){if(this['_pendingThreads']['includes'](_0x2ec7e2))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x2ec7e2),0x1);else{const _0x243e1d=_0x509c39['_threadToController']['get'](_0x2ec7e2),_0x5a74d4=_0x4c64d2['getByInnerView'](_0x243e1d['view']);this['annotationViews']['remove'](_0x5a74d4['view']),this['stopListening'](_0x5a74d4),this['stopListening'](_0x5a74d4['focusableElements']);}}}),this['listenTo'](_0x4c64d2['collection'],'add',(_0x313629,_0x337326)=>{this['listenTo'](_0x337326,'escape',_0x4b2785);}),this['listenTo'](_0x4c64d2['collection'],'remove',(_0x2830ca,_0x9249fb)=>{this['stopListening'](_0x9249fb,'escape',_0x4b2785);});}_addAnnotationToArchive(_0x515e43,_0x119ca6){this['listenTo'](_0x515e43,'set:isVisible',_0xd67a15=>{_0xd67a15['return']=!0x1,_0xd67a15['stop']();}),this['annotationViews']['add'](_0x515e43['view'],_0x119ca6);}['_handleNewThread'](_0x48408a){const _0x381d1e=this['editor']['plugins']['get']('CommentsRepository'),_0x296cf9=this['editor']['plugins']['get']('Annotations'),_0x461907=this['editor']['config']['get']('collaboration.channelId');if(!_0x461907||_0x48408a['channelId']===_0x461907){const _0x318f94=_0x381d1e['_threadToController']['get'](_0x48408a);if(!_0x318f94)return void this['_pendingThreads']['push'](_0x48408a);const _0x4aeebd=this['_calculatePosition'](_0x48408a['archivedAt']),_0x53d12f=_0x296cf9['getByInnerView'](_0x318f94['view']);_0x53d12f['isVisible']&&_0x296cf9['_visibleAnnotations']['remove'](_0x53d12f),this['_addAnnotationToArchive'](_0x53d12f,_0x4aeebd);}}_calculatePosition(_0x37a0f0){const _0x129bb0=this['editor']['config']['get']('collaboration.channelId'),_0xff8ef4=[...this['editor']['plugins']['get'](Di)['archivedThreads']]['filter'](_0xeedbc8=>_0xeedbc8['channelId']===_0x129bb0)['findIndex'](_0x3ff3b1=>_0x3ff3b1['archivedAt']<_0x37a0f0);return _0xff8ef4<0x0||_0xff8ef4>this['annotationViews']['length']?this['annotationViews']['length']:_0xff8ef4-0x1;}_toggleDialog(){const _0x5d55b9=this['editor'],_0x4a72b1=_0x5d55b9['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new Li(_0x5d55b9['locale'],this['annotationViews'])),'commentsArchive'===_0x4a72b1['id']?_0x4a72b1['hide']():_0x4a72b1['show']({'id':'commentsArchive','title':Et(_0x5d55b9['locale'],'COMMENTS_ARCHIVE'),'icon':_0x188b5f,'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':_0x14f9e6['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x47753e,_0x10bd7a=!0x1){const _0x2e8de6=this['editor']['locale'],_0x43cd48=this['editor']['plugins']['get']('Dialog'),_0x25d5bd=new _0x47753e(_0x2e8de6);return _0x25d5bd['bind']('isEnabled')['to'](this,'isEnabled'),_0x25d5bd['bind']('isOn')['to'](_0x43cd48,'id',_0x408c9a=>'commentsArchive'===_0x408c9a),_0x25d5bd['set']({'label':Et(_0x2e8de6,'COMMENTS_ARCHIVE'),'icon':_0x188b5f,'isToggleable':!0x0}),_0x10bd7a&&(_0x25d5bd['tooltip']=!0x0),this['listenTo'](_0x25d5bd,'execute',()=>this['_toggleDialog']()),_0x25d5bd;}_hideDialogOnAnnotationEscape=_0x5b21aa=>{const _0x205dd8=_0x5b21aa['source'];if(!this['annotationViews']['has'](_0x205dd8['view']))return;const _0x3e79bf=this['editor']['plugins']['get']('Dialog');_0x3e79bf['isOpen']&&'commentsArchive'===_0x3e79bf['id']&&(_0x3e79bf['hide'](),_0x5b21aa['stop']());};},Bi=class extends _0x3831f5{static get requires(){return[oi,wi,vi,Di,Vi,yi,Mi,Si,xi];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ci as AddCommentThreadCommand,$t as Annotation,Jt as AnnotationCollection,Ri as AnnotationCounterButtonView,qt as AnnotationView,ti as Annotations,Ei as AnnotationsSidebarItemView,Ii as AnnotationsSidebarView,Ti as AnnotationsUIs,Ht as BaseCommentThreadView,Kt as BaseCommentView,hi as Comment,ri as CommentThread,bt as CommentThreadController,xt as CommentThreadInputView,Ut as CommentThreadView,Yt as CommentView,Bi as Comments,Di as CommentsArchive,Vi as CommentsArchiveUI,wi as CommentsEditing,Lt as CommentsListView,yi as CommentsOnly,oi as CommentsRepository,vi as CommentsUI,di as EditorAnnotations,xi as InlineAnnotations,Si as NarrowSidebar,ki as Sidebar,Mi as WideSidebar,Qt as bindAnnotationCollections};
|
|
23
|
+
import{Command as _0x56f817,Context as _0x9685b6,ContextPlugin as _0x2bb426,Editor as _0x2e081e,PendingActions as _0x478212,Plugin as _0x2bcbce}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x402d5c,Collection as _0x33b802,DomEmitterMixin as _0x408eb5,FocusTracker as _0x198c81,KeystrokeHandler as _0x2f2b28,ObservableMixin as _0x3d5e80,Rect as _0x23f3bc,diff as _0x3d2856,first as _0x3468db,getEnvKeystrokeText as _0x4c72e9,keyCodes as _0x319fd4,priorities as _0x31e8a7,scrollViewportToShowTarget as _0x5de251,toUnit as _0x205aa8,uid as _0x295c58}from'@ckeditor/ckeditor5-utils';import{AriaDescriptionView as _0x557fb6,ConfirmMixin as _0xee9bc5,FOCUS_ANNOTATION_KEYSTROKE as _0x5baba3,LateFocusButtonView as _0x88d78e,LateFocusDropdownButtonView as _0x1ad89c,UserView as _0x1f130d,Users as _0x552e83,getAllMarkersDomElementsSorted as _0x1461bc,getDateTimeFormatter as _0x337b38,hashObject as _0x1480b3,setupThreadKeyboardNavigation as _0x262b7e,surroundingMarkersDetector as _0x4fc4eb,trimHtml as _0x301d12}from'@ckeditor/ckeditor5-collaboration-core';import{cloneDeep as _0x2feb7e,debounce as _0x420187,isEqual as _0x4472b0,set as _0x3f4a33,throttle as _0x4f66b2,unset as _0x3ab25c}from'es-toolkit/compat';import{IconAddComment as _0x110cf9,IconCheck as _0xf1cd2,IconCommentsArchive as _0xa8fd73,IconPencil as _0x53f900,IconRemoveComment as _0x3e28e7,IconThreeVerticalDots as _0x553988,IconUndo as _0x2b133d}from'@ckeditor/ckeditor5-icons';import{BalloonPanelView as _0x48bc2e,BodyCollection as _0x286678,ButtonView as _0x151ed2,ContextualBalloon as _0x5d1799,Dialog as _0x4580c1,DialogViewPosition as _0x43beb4,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 */
|
|
24
|
+
_0x3d5e80();var bt=class extends It{['model'];['view'];constructor(_0x3bf253,_0x53f2a1){super(),this['model']=_0x3bf253,this['model']['_isAttached']=!0x0,this['view']=_0x53f2a1,this['listenTo'](_0x53f2a1,'submitCommentThread',()=>this['submit']()),this['listenTo'](_0x53f2a1,'removeCommentThread',()=>this['remove']()),this['listenTo'](_0x53f2a1,'resolveCommentThread',()=>this['resolve']()),this['listenTo'](_0x53f2a1,'reopenCommentThread',()=>this['reopen']()),this['listenTo'](_0x53f2a1,'addComment',(_0x19350a,_0x274823)=>this['addComment'](_0x274823)),this['listenTo'](_0x53f2a1,'updateComment',(_0x1c71e0,_0x3bb073,_0xea98d3)=>this['updateComment'](_0x3bb073,_0xea98d3)),this['listenTo'](_0x53f2a1,'removeComment',(_0x289aa2,_0x2c1de3)=>this['removeComment'](_0x2c1de3));}submit(){this['model']['submit']();}['remove'](){this['model']['remove']();}['resolve'](){this['model']['isResolved']||this['model']['resolve']();}['reopen'](){this['model']['isResolved']&&this['model']['reopen']();}addComment(_0x5e7a40){this['model']['addComment']({'content':_0x5e7a40,'authorId':this['view']['_localUser']['id']});}updateComment(_0x48ed50,_0x4f5d59){this['model']['getComment'](_0x48ed50)['update']({'content':_0x4f5d59});}removeComment(_0x1322c1){this['model']['getComment'](_0x1322c1)['remove']();}destroy(){this['stopListening'](),this['model']['_isAttached']=!0x1;}};function Et(_0x2d5f28,_0x3d235f,_0x3b04f9){const t=_0x2d5f28['t'];switch(_0x3d235f){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'},_0x3b04f9);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'},_0x3b04f9);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'},_0x3b04f9);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'},_0x3b04f9);case'NUMBER_OF_COMMENTS':return t({'string':'%0\x20Comment','plural':'%0\x20Comments','id':'NUMBER_OF_COMMENTS'},_0x3b04f9);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'},_0x3b04f9);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'},_0x3b04f9);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'},_0x3b04f9);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(_0x251712,_0x166124){super(_0x251712);const _0x577e85=_0x295c58();this['main']=this['createCollection'](),this['editable']=new st(_0x251712,_0x166124,void 0x0,{'label':()=>Et(_0x251712,'Comment\x20editor')}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-editor','ck-rounded-corners','ck-comment__input'],'dir':_0x251712['uiLanguageDirection'],'lang':_0x251712['uiLanguage'],'aria-labelledby':'cke-editor__aria-label_'+_0x577e85},'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(_0x599bad){super(_0x599bad),this['view']=new kt(_0x599bad['locale'],_0x599bad['editing']['view']);}get element(){return this['view']['element'];}init(){const _0x390ead=this['editor']['editing']['view'],_0x19b351=this['view']['editable'];_0x19b351['name']=_0x390ead['document']['getRoot']()['rootName'],this['view']['render']();const _0x35672e=_0x19b351['element'];this['setEditableElement'](_0x19b351['name'],_0x35672e),this['view']['editable']['bind']('isFocused')['to'](this['focusTracker']),_0x390ead['attachDomRoot'](_0x35672e),this['fire']('ready');}destroy(){super['destroy'](),this['view']['destroy']();}};const Ot=[ft,gt,_t,At,vt,yt,Tt],Mt=/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x3d5e80(_0x2e081e);var Rt=class CommentEditor extends Mt{static defaultPlugins=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>Ot)());constructor(_0x4f86e5={}){(_0x4f86e5=Object['assign']({},_0x4f86e5))['plugins']||(_0x4f86e5['plugins']=CommentEditor['defaultPlugins']),super(_0x4f86e5),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 _0x9c0f2=this['config']['get']('initialData')||'';return this['initPlugins']()['then'](()=>this['ui']['init']())['then'](()=>this['data']['init'](_0x9c0f2))['then'](()=>this['fire']('ready'));}destroy(){return super['destroy']()['then'](()=>this['ui']['destroy']());}['focus'](){this['model']['change'](_0xa57270=>{const _0x20e187=this['model']['document']['getRoot'](),_0x141765=_0x20e187&&_0x20e187['getChild'](_0x20e187['childCount']-0x1);_0xa57270['setSelection'](_0x141765,'end'),this['editing']['view']['focus']();});}_updatePlaceholder(){const _0xc42d90=this['editing']['view'],_0x2e54a4=_0xc42d90['document']['getRoot'](),_0x13d75e=_0x2e54a4['getChild'](0x0);_0x2e54a4['childCount']>0x1||!_0x13d75e||'p'!=_0x13d75e['name']?this['placeholderElement']&&this['placeholderElement']['placeholder']&&(mt(_0xc42d90,this['placeholderElement']),this['placeholderElement']=void 0x0):(this['placeholder']&&(_0x13d75e['placeholder']=this['placeholder']),ut({'view':_0xc42d90,'element':_0x13d75e,'keepOnFocus':!0x0}),this['placeholderElement']=_0x13d75e);}},St=class extends ht{keystrokes;['focusTracker'];['focusables'];['focusCycler'];submitButtonView;cancelButtonView;_editorConfig;constructor(_0x267dfa,_0x20aeba={}){super(_0x267dfa),this['editor']=null,this['_editorConfig']=_0x20aeba,this['set']('value',_0x20aeba['initialData']||''),this['set']('disabledSubmit',!0x1),this['set']('showButtons',!0x0),this['set']('placeholder',Et(_0x267dfa,'Reply...')),this['set']('submitLabel',Et(_0x267dfa,'Reply')),this['submitButtonView']=this['_createSubmitButton'](),this['cancelButtonView']=this['_createCancelButton'](),this['focusables']=this['createCollection']([this['submitButtonView'],this['cancelButtonView']]),this['keystrokes']=new _0x2f2b28(),this['focusTracker']=new _0x198c81(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x1baba4=>!_0x1baba4['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',(_0x107c97,_0x20ecfd)=>{this['cancelButtonView']['fire']('execute'),_0x20ecfd();}),this['keystrokes']['set']('Ctrl+Enter',(_0x2f3f96,_0x39c63c)=>{this['submitButtonView']['isEnabled']&&(this['submitButtonView']['fire']('execute'),_0x39c63c());}),this['on']('submit',(_0x5dc2d7,_0xc67159)=>{_0xc67159['length']>0xfde8?(alert(Et(_0x267dfa,'TOO_LONG_COMMENT_ALERT',[_0xc67159['length'],0xfde8])),_0x5dc2d7['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 _0x2dab16=this['editor'];this['element']['insertBefore'](_0x2dab16['ui']['element'],this['element']['firstChild']),_0x2dab16['model']['document']['on']('change',()=>this['value']=_0x2dab16['getData']()),_0x2dab16['bind']('placeholder')['to'](this),this['focusables']['add'](_0x2dab16['ui']['view'],0x0),this['fire']('editorReady',this['editor']);})),this['_editorCreationPromise'];}['focus'](_0x2106e1){-0x1===_0x2106e1?(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:_0x162c4a}=this,_0x26f874=new _0x151ed2(_0x162c4a);return _0x26f874['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--submit']}}),_0x26f874['withText']=!0x0,_0x26f874['bind']('label')['to'](this,'submitLabel'),_0x26f874['on']('execute',()=>{this['fire']('submit',this['value']);}),_0x26f874['bind']('isEnabled')['to'](this,'value',this,'disabledSubmit',(_0x36851f,_0x15ad61)=>!_0x15ad61&&!!_0x36851f['trim']()),_0x26f874;}_createCancelButton(){const {locale:_0x48cf10}=this,_0x521723=new _0x151ed2(_0x48cf10);return _0x521723['extendTemplate']({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x521723['label']=Et(_0x48cf10,'Cancel'),_0x521723['withText']=!0x0,_0x521723['on']('execute',()=>{this['editor']['setData'](''),this['fire']('cancel');}),_0x521723;}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']),this['focusables']['forEach'](_0x457566=>{this['focusTracker']['add'](_0x457566['element']);}),this['focusables']['on']('change',(_0x55053d,_0x771710)=>{for(const _0x1cea7c of Array['from'](_0x771710['added'])['reverse']())this['focusTracker']['add'](_0x1cea7c['element']);});}},xt=class extends ht{constructor(_0x2855e2,_0x3b9bf3,_0x845aef){super(_0x2855e2),this['commentInputView']=new St(_0x2855e2,_0x845aef),this['focusCycler']=this['commentInputView']['focusCycler'],this['commentInputView']['bind']('showButtons')['to'](this['commentInputView']['focusTracker'],'isFocused',this['commentInputView'],'value',(_0x10ee72,_0x231280)=>_0x10ee72||!!_0x231280),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 _0x1f130d(_0x2855e2,_0x3b9bf3),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'](_0xcbedce){this['commentInputView']['focus'](_0xcbedce);}_focusOnNonInteractiveMouseDown(){this['listenTo'](this['element'],'mousedown',(_0x8bcdca,_0x274822)=>{const {submitButtonView:_0x3640e5,cancelButtonView:_0xe0e8dd,editor:_0x4ed326}=this['commentInputView'];[_0x3640e5['element'],_0xe0e8dd['element'],_0x4ed326?_0x4ed326['editing']['view']['getDomRoot']():null]['filter'](_0x4a84df=>_0x4a84df)['some'](_0x1737e9=>_0x1737e9['contains'](_0x274822['target']))||(this['focus'](),_0x274822['preventDefault']());});}},Pt=class extends ht{constructor(_0x47128f){super(_0x47128f);const _0x343d37=this['bindTemplate'];this['set']('count',void 0x0),this['setTemplate']({'tag':'li','attributes':{'class':'ck-thread__comment-count'},'children':[{'text':_0x343d37['to']('count',_0x5494a5=>Et(_0x47128f,'NUMBER_OF_COMMENTS',_0x5494a5))}]});}},Lt=class extends ht{commentViews;resolvedCommentView;['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];_collapsedCommentsView;constructor(_0x35af61,_0x4135c7,_0x509e0b){super(_0x35af61);const _0x4c4cbc=this['bindTemplate'];this['set']('hasDirtyComment',!0x1),this['set']('length',_0x4135c7['comments']['length']),this['set']('isActive',!0x1),this['_model']=_0x4135c7,this['_config']=_0x509e0b,this['commentViews']=this['createCollection'](),this['visibleViews']=this['createCollection'](),this['resolvedCommentView']=null,this['focusTracker']=new _0x198c81(),this['keystrokes']=new _0x2f2b28(),this['focusCycler']=new et({'focusables':this['commentViews'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x20d70f=>this['commentViews']['map'](_0x13aeee=>_0x13aeee['element'])['includes'](_0x20d70f['target'])},'actions':{'focusPrevious':'arrowup','focusNext':'arrowdown'}}),this['_collapsedCommentsView']=new Pt(_0x35af61),this['_collapsedCommentsView']['bind']('count')['to'](this,'length',_0x13c2d9=>_0x13c2d9-this['_config']['maxCommentsWhenCollapsed']);for(const _0x42d055 of _0x4135c7['comments'])this['_handleNewCommentModel'](_0x42d055);this['_handleInfoComment'](),this['listenTo'](_0x4135c7['comments'],'add',(_0x4225b4,_0x159d1b)=>{const _0x58d924=this['_calculatePosition'](_0x159d1b);this['length']++,this['_handleNewCommentModel'](_0x159d1b,_0x58d924),this['refreshVisibleViews']();}),this['listenTo'](_0x4135c7['comments'],'remove',(_0x329f67,_0x139423)=>{this['length']--,this['_handleRemoveCommentModel'](_0x139423),this['refreshVisibleViews']();}),this['listenTo'](_0x4135c7,'commentUpdated',()=>this['refreshVisibleViews']()),this['listenTo'](_0x4135c7,'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',_0x4c4cbc['if']('length','ck-hidden',_0x252a7f=>!_0x252a7f)],'aria-label':Et(_0x35af61,'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'](_0x2e336d){-0x1===_0x2e336d?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}destroy(){this['_collapsedCommentsView']['destroy']();for(const _0x58df28 of this['commentViews'])_0x58df28['destroy']();super['destroy']();}['refreshVisibleViews'](){this['_shouldCollapse']?this['_rearrangeCollapse']():this['_rearrangeExpand']();}_handleNewCommentModel(_0x1e9a94,_0x12ef73){const _0x2edf9e=new this['_config']['CommentView'](this['locale'],_0x1e9a94,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig']});_0x2edf9e['viewUid']=_0x1e9a94['id'],_0x2edf9e['delegate']('removeComment')['to'](this),_0x2edf9e['delegate']('updateComment')['to'](this),_0x2edf9e['delegate']('resolveCommentThread')['to'](this),_0x2edf9e['delegate']('editorReady')['to'](this),_0x2edf9e['delegate']('editorDestroyed')['to'](this),this['listenTo'](_0x2edf9e,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this['commentViews']['add'](_0x2edf9e,_0x12ef73);}_calculatePosition(_0x247772){const _0x5a4348=this['_model']['_findOptimalIndex'](_0x247772);return this['resolvedCommentView']?this['resolvedCommentView']['authoredAt']>_0x247772['authoredAt']?_0x5a4348-0x1:_0x5a4348:_0x5a4348-0x1;}_handleInfoComment(){if(this['_model']['resolvedBy']&&this['_model']['resolvedAt']){const _0x352cce={'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'],_0x352cce,{'maxCommentCharsWhenCollapsed':this['_config']['maxCommentCharsWhenCollapsed'],'formatDateTime':this['_config']['formatDateTime'],'editorConfig':this['_config']['editorConfig'],'isSystemComment':!0x0}),this['commentViews']['add'](this['resolvedCommentView'],this['_model']['_findOptimalIndex'](_0x352cce));}else this['resolvedCommentView']&&(this['commentViews']['remove'](this['resolvedCommentView']),this['resolvedCommentView']['destroy'](),this['resolvedCommentView']=null);this['refreshVisibleViews']();}_handleRemoveCommentModel(_0x1c87e9){const _0x28fe2f=this['commentViews']['remove'](_0x1c87e9['id']);this['stopListening'](_0x28fe2f),_0x28fe2f['isEditMode']&&this['_updateHasDirtyComment'](),_0x28fe2f['destroy']();}_updateHasDirtyComment(){this['hasDirtyComment']=Array['from'](this['commentViews'])['some'](_0x54364b=>_0x54364b['isEditMode']);}['_rearrangeCollapse'](){const _0x24816d=function(_0x298b94){const _0x14383d=new _0x33b802();for(const _0x14a131 of _0x298b94)_0x14383d['add'](_0x14a131);return _0x14383d;}(this['commentViews']),_0x2cd37a=this['_collapsedCommentsView']['count'];for(let _0xd73e23=0x1;_0xd73e23<=_0x2cd37a;_0xd73e23++)_0x24816d['remove'](0x1);for(const _0x1bfe57 of _0x24816d)_0x1bfe57['collapse']();_0x2cd37a>0x0&&_0x24816d['add'](this['_collapsedCommentsView'],0x1),Dt(_0x3d2856(Array['from'](this['visibleViews']),Array['from'](_0x24816d)),this['visibleViews'],_0x24816d);}['_rearrangeExpand'](){Dt(_0x3d2856(Array['from'](this['visibleViews']),Array['from'](this['commentViews'])),this['visibleViews'],this['commentViews']);for(const _0x2bdbf7 of this['visibleViews'])_0x2bdbf7['expand']();}_setupKeyboardNavigation(){this['commentViews']['forEach'](_0x4cea8f=>{this['focusTracker']['add'](_0x4cea8f['element']),this['keystrokes']['listenTo'](_0x4cea8f['element']);}),this['commentViews']['on']('change',(_0x5d37f3,_0x538e5e)=>{for(const _0xdadb99 of _0x538e5e['removed'])this['focusTracker']['remove'](_0xdadb99['element']),this['keystrokes']['stopListening'](_0xdadb99['element']);for(const _0x34d547 of Array['from'](_0x538e5e['added'])['reverse']())this['focusTracker']['add'](_0x34d547['element']),this['keystrokes']['listenTo'](_0x34d547['element']);});}};function Dt(_0x569040,_0x20f19b,_0x3705e0){let _0x1f23f2=0x0;for(const _0x20158b of _0x569040)switch(_0x20158b){case'insert':_0x20f19b['add'](_0x3705e0['get'](_0x1f23f2),_0x1f23f2),_0x1f23f2++;break;case'delete':_0x20f19b['remove'](_0x1f23f2);break;case'equal':_0x1f23f2++;}}var Vt=class extends ht{constructor(_0xe62c16){super(_0xe62c16);const _0x487cbf=this['bindTemplate'];this['set']('contextValue',''),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-context__value'],'aria-label':_0x487cbf['to']('contextValue',_0x53324a=>Et(_0xe62c16,'THREAD_CONTEXT_LABEL',_0x53324a)),'tabindex':-0x1},'children':[{'text':_0x487cbf['to']('contextValue')}]});}['focus'](){this['element']['focus']();}},Bt=class extends ht{['_model'];reopenButtonView;contextView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x16da22,_0x2fe32f){super(_0x16da22);const _0x49f721=this['bindTemplate'];this['_model']=_0x2fe32f,this['reopenButtonView']=this['_createReopenButton'](),this['contextView']=this['_createContextView'](),this['focusables']=this['createCollection']([this['contextView'],this['reopenButtonView']]),this['focusTracker']=new _0x198c81(),this['keystrokes']=new _0x2f2b28(),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',_0x536dad=>!!_0x536dad),this['bind']('contextValue')['to'](this['_model'],'context',_0x3c9bd3=>_0x3c9bd3&&_0x3c9bd3['value']?this['_trimContextValue'](_0x3c9bd3['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',_0x49f721['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 _0xbe9b17=new _0x151ed2(this['locale']);return _0xbe9b17['label']=Et(this['locale'],'Reopen'),_0xbe9b17['tooltip']=Et(this['locale'],'Reopen'),_0xbe9b17['icon']=_0x2b133d,_0xbe9b17['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x1337c0=>!_0x1337c0),_0xbe9b17['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x3ba781,_0x26feb6)=>_0x3ba781&&_0x26feb6),_0xbe9b17['on']('execute',()=>{this['fire']('reopenCommentThread',this['_model']['id']);}),_0xbe9b17;}_trimContextValue(_0xcd2b82){if(_0xcd2b82['length']<0x96)return _0xcd2b82;const _0xbde25d=_0xcd2b82['lastIndexOf']('\x20',0x93);return _0xcd2b82['substring'](0x0,_0xbde25d>-0x1?_0xbde25d:0x93)+'...';}_attachContextActions(){const _0x50ea3c=this['element']['querySelector']('.ck-context'),_0x132eb7=_0x50ea3c['querySelector']('.ck-context__value');this['listenTo'](_0x50ea3c,'mouseenter',()=>{_0x132eb7['offsetWidth']<_0x132eb7['scrollWidth']&&_0x50ea3c['classList']['add']('overlay');}),this['listenTo'](_0x50ea3c,'mouseleave',()=>{_0x50ea3c['classList']['remove']('overlay');});}_setupKeyboardNavigation(){this['keystrokes']['listenTo'](this['element']);for(const _0x5ce4ff of this['focusables'])this['focusTracker']['add'](_0x5ce4ff['element']),this['keystrokes']['listenTo'](_0x5ce4ff['element']);}_createContextView(){const _0x3b3eca=new Vt(this['locale']);return _0x3b3eca['bind']('contextValue')['to'](this),_0x3b3eca;}},Ht=class extends ht{['_model'];['_config'];commentThreadHeaderView;commentThreadInputView;ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];constructor(_0x23fa18,_0x350053,_0x40d5ab,_0x32ca7a){super(_0x23fa18),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['_model']=_0x350053,this['_localUser']=_0x40d5ab,this['_config']=_0x32ca7a,this['commentThreadHeaderView']=new Bt(_0x23fa18,_0x350053),this['commentThreadHeaderView']['delegate']('reopenCommentThread')['to'](this),this['ariaDescriptionView']=new _0x557fb6(_0x23fa18,Et(_0x23fa18,'COMMENT_THREAD_DESCRIPTION')),this['listenTo'](this,'reopenCommentThread',()=>{this['focus']();}),this['commentsListView']=new Lt(_0x23fa18,_0x350053,Object['assign']({'CommentView':this['_config']['CommentView']},_0x32ca7a)),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',(_0x2b4f22,_0x41bd13)=>_0x2b4f22||!!_0x41bd13),this['bind']('isUnlinked')['to'](_0x350053,'unlinkedAt',_0x485746=>!!_0x485746);let _0x32bb04=null;const _0x4db901=()=>{const _0x39a4e8=this['_model']['comments']['first']||null;_0x39a4e8!==_0x32bb04&&(_0x32bb04&&this['stopListening'](_0x32bb04,'change:content'),_0x32bb04=_0x39a4e8,_0x39a4e8&&this['listenTo'](_0x39a4e8,'change:content',_0x4db901));const _0x3c0071=_0x39a4e8?_0x39a4e8['author']['name']:this['_localUser']['name'],_0x33ba05=_0x39a4e8?new DOMParser()['parseFromString'](_0x301d12(_0x39a4e8['content'],{'limit':this['_config']['maxCommentCharsWhenCollapsed']}),'text/html')['body']['textContent']:'',_0x372cb4=Et(this['locale'],'COMMENT_THREAD_LABEL',[this['length'],_0x3c0071]);this['set']('ariaLabel',_0x33ba05?_0x372cb4+'\x20'+_0x33ba05:_0x372cb4);};this['listenTo'](this['_model']['comments'],'change',_0x4db901),_0x4db901(),this['focusables']=this['createCollection']([this['commentsListView'],this['commentThreadInputView']]),this['focusTracker']=new _0x198c81(),this['keystrokes']=new _0x2f2b28(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0xd530e1=>_0xd530e1['target']!==this['element']},'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}});}['focus'](){this['element']['focus']();}['render'](){super['render'](),_0x262b7e(this,this['focusables']);}async destroy(){this['isDirty']=!0x1,this['commentsListView']['destroy'](),await this['commentThreadInputView']['destroy'](),super['destroy']();}_createCommentThreadInputView(){const _0x163b2b=new xt(this['locale'],this['_localUser'],this['_config']['editorConfig']),_0x54b303=_0x163b2b['commentInputView'];return _0x163b2b['bind']('showInput')['to'](this,'isActive',this['_model'],'isReadOnly',this['_model'],'canComment',this['_model'],'archivedAt',_0x54b303,'value',(_0x225820,_0x1141e3,_0x5e8f6c,_0x2cb199,_0x524ab1)=>!!_0x524ab1||!!_0x2cb199&&_0x5e8f6c&&!_0x1141e3||_0x225820&&_0x5e8f6c&&!_0x1141e3),_0x54b303['bind']('placeholder')['to'](this,'length',this['_model'],'isResolvable',this['_model'],'isResolved',(_0x459de1,_0x599462,_0x148d0c)=>{let _0x10d7e0;return _0x10d7e0=_0x148d0c&&_0x599462?'Reply\x20to\x20reopen\x20discussion...':_0x459de1?'Reply...':'Write\x20a\x20comment...',Et(this['locale'],_0x10d7e0);}),_0x54b303['bind']('submitLabel')['to'](this,'length',_0x53b0ac=>Et(this['locale'],_0x53b0ac?'Reply':'Comment')),_0x54b303['on']('submit',(_0x5f2598,_0x25ec52)=>{this['fire']('addComment',_0x25ec52),this['_model']['isResolved']&&this['_model']['isResolvable']&&this['fire']('reopenCommentThread',this['_model']['id']),this['_model']['isSubmitted']||this['fire']('submitCommentThread');}),_0x54b303['on']('cancel',()=>{this['focus']();}),_0x54b303['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x54b303['on']('cancel',_0x325bcf=>{0x0==this['length']&&(this['fire']('removeCommentThread'),_0x325bcf['stop']());}),this['on']('change:isActive',(_0x261156,_0x54e211,_0x2afc33)=>{_0x2afc33||this['length']||_0x54b303['value']||this['fire']('removeCommentThread');}),_0x163b2b;}};const Ft=/* #__PURE__ -- @preserve */
|
|
27
|
+
_0xee9bc5(Ht);var Ut=class extends Ft{commentThreadChildren;containerElement;resolveButton;_boundFirstCommentView;constructor(_0x4eae06,_0x320bbb,_0x1fde94,_0x44ca30){super(_0x4eae06,_0x320bbb,_0x1fde94,_0x44ca30),this['commentThreadChildren']=this['createCollection']([this['commentsListView'],this['commentThreadInputView'],this['ariaDescriptionView']]),this['set']('actionIndicator',null),this['containerElement']=null,this['_boundFirstCommentView']=null,this['locale']=_0x4eae06,this['resolveButton']=this['_createResolveButton'](),this['setTemplate'](this['getTemplate']()),this['on']('change:isActive',(_0x1c76a3,_0x3ae93e,_0x5d503a)=>{_0x5d503a||this['_cancelAllConfirms']();}),this['listenTo'](this['_model'],'change:isReadOnly',(_0x9a014a,_0x1f808a,_0x50903b)=>{_0x50903b&&this['_cancelAllConfirms']();}),this['length']>0x0&&this['_bindFirstCommentView'](),this['listenTo'](this['commentsListView']['commentViews'],'add',()=>{this['_bindFirstCommentView']();});}getTemplate(){const _0x64c219=this['bindTemplate'];return{'tag':'div','attributes':{'class':['ck','ck-thread','ck-reset_all-excluded','ck-rounded-corners',_0x64c219['if']('isActive','ck-thread--active'),_0x64c219['if']('isUnlinked','ck-thread--unlinked'),_0x64c219['to']('actionIndicator',_0x1ad97e=>_0x1ad97e?'ck-thread--'+_0x1ad97e:'')],'data-thread-id':this['_model']['id'],'tabindex':0x0,'role':'listitem','aria-label':_0x64c219['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 _0x50492d of this['commentsListView']['commentViews'])_0x50492d['cancelConfirm']();}_bindFirstCommentView(){const {locale:_0xd4a0f9}=this,_0x300e2f=this['commentsListView']['commentViews']['get'](0x0);_0x300e2f===this['_boundFirstCommentView']||_0x300e2f['isSystemComment']||(this['_boundFirstCommentView']=_0x300e2f,this['unbind']('actionIndicator'),this['bind']('actionIndicator')['to'](_0x300e2f,'actionIndicator',_0x584b14=>'remove'===_0x584b14?'remove':null),_0x300e2f['placeholder']=Et(_0xd4a0f9,'Write\x20a\x20comment...'),_0x300e2f['removeButton']['on']('execute',_0x1259b7=>{_0x1259b7['stop'](),this['showConfirm'](Et(_0xd4a0f9,'Delete\x20comment\x20thread?'),this['containerElement'])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),this['on']('removeConfirm',()=>{_0x300e2f['focus']();}),_0x300e2f['actionBar']['add'](this['resolveButton'],0x0),_0x300e2f['focusables']['add'](this['resolveButton'],0x0));}_createResolveButton(){const _0x3aceef=new _0x88d78e(this['locale']);return _0x3aceef['label']=Et(this['locale'],'Resolve'),_0x3aceef['tooltip']=Et(this['locale'],'Resolve'),_0x3aceef['icon']=_0xf1cd2,_0x3aceef['extendTemplate']({'attributes':{'class':'ck-comment--resolve'}}),_0x3aceef['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x24ac01=>!_0x24ac01),_0x3aceef['bind']('isVisible')['to'](this['_model'],'isResolvable',this['_model'],'isResolved',(_0x896bc8,_0x4061dd)=>_0x896bc8&&!_0x4061dd),_0x3aceef['on']('execute',()=>{this['fire']('resolveCommentThread',this['_model']['id']);}),_0x3aceef;}_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(_0x233de2){super(_0x233de2),this['set']('content',''),this['setTemplate']({'tag':'div','attributes':{'class':['ck-content','ck-comment__content','ck-annotation__content']}});}['render'](){super['render'](),this['on']('change:content',(_0xe460c,_0xa301d1,_0x5a8f27)=>{this['element']['innerHTML']=_0x5a8f27;}),this['element']['innerHTML']=this['content'];}},Kt=class extends ht{['visibleView'];ariaDescriptionView;['focusables'];['focusTracker'];keystrokes;['focusCycler'];['_model'];['_config'];constructor(_0x131bc7,_0x24c0be,_0x4efe5d){super(_0x131bc7),this['_model']=_0x24c0be,this['_config']=_0x4efe5d,this['isSystemComment']=!!this['_config']['isSystemComment'],this['set']('isEditMode',!0x1),this['set']('isCollapsed',!0x0),this['bind']('ariaLabel')['to'](_0x24c0be,'content',_0x24c0be,'authoredAt',(_0x209168,_0x2bfb85)=>Et(_0x131bc7,'COMMENT_ARIA_LABEL',[_0x24c0be['author']['name'],_0x4efe5d['formatDateTime'](_0x2bfb85),new DOMParser()['parseFromString'](_0x209168,'text/html')['body']['textContent'],_0x24c0be['isExternal']?this['getExternalCommentNote']():''])),this['ariaDescriptionView']=new _0x557fb6(_0x131bc7,Et(_0x131bc7,'COMMENT_THREAD_DESCRIPTION')),this['visibleView']=this['createCollection'](),this['visibleView']['add'](this['_createCommentContentView']()),this['focusables']=new at(),this['focusTracker']=new _0x198c81(),this['keystrokes']=new _0x2f2b28(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'keystrokeHandlerOptions':{'filter':_0x2dc668=>_0x2dc668['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 _0x1d4cb8=new Wt(this['locale']);return _0x1d4cb8['bind']('content')['to'](this['_model'],'content',this,'isCollapsed',(_0x5377ea,_0xe25248)=>_0xe25248?_0x301d12(_0x5377ea,{'limit':this['_config']['maxCommentCharsWhenCollapsed']}):_0x5377ea),_0x1d4cb8;}_createCommentInputView(){this['_config']['editorConfig']||(this['_config']['editorConfig']={}),this['_config']['editorConfig']['initialData']=this['_model']['content'];const _0x469a67=new St(this['locale'],this['_config']['editorConfig']);return _0x469a67['value']=this['_model']['content'],_0x469a67['bind']('disabledSubmit')['to'](this['_model'],'isReadOnly'),_0x469a67['submitLabel']=Et(this['locale'],'Save'),_0x469a67['on']('submit',(_0x23131e,_0x590648)=>{this['fire']('updateComment',this['_model']['id'],_0x590648),this['switchToDisplayMode'](),this['focus']();}),_0x469a67['on']('cancel',()=>{this['switchToDisplayMode'](),this['focus']();}),_0x469a67['once']('editorReady',()=>{_0x469a67['focus']();}),_0x469a67['createEditor'](),_0x469a67['delegate']('editorReady')['to'](this),_0x469a67['delegate']('editorDestroyed')['to'](this),_0x469a67;}_setupKeyboardNavigation(){const _0x1c906e=this['element'];this['keystrokes']['listenTo'](_0x1c906e);for(const _0x5d16f2 of this['focusables'])this['focusTracker']['add'](_0x5d16f2['element']),this['keystrokes']['listenTo'](_0x5d16f2['element']);this['focusables']['on']('change',(_0x4633c7,_0x1c7418)=>{for(const _0x4ad2f0 of _0x1c7418['removed'])this['focusTracker']['remove'](_0x4ad2f0['element']),this['keystrokes']['stopListening'](_0x4ad2f0['element']);for(const _0x33c9e1 of _0x1c7418['added'])this['focusTracker']['add'](_0x33c9e1['element']),this['keystrokes']['listenTo'](_0x33c9e1['element']);}),this['keystrokes']['set']('enter',(_0x9321b8,_0x5d5297)=>{_0x1c906e===_0x9321b8['target']&&(this['focusCycler']['focusFirst'](),_0x5d5297());}),this['keystrokes']['set']('esc',(_0x30b9ef,_0x464b2b)=>{_0x1c906e!==_0x30b9ef['target']&&(this['focus'](),_0x464b2b());});}};const Gt=/* #__PURE__ -- @preserve */
|
|
28
|
+
_0xee9bc5(Kt);var Yt=class extends Gt{actionBar;['userView'];constructor(_0x3a5beb,_0x50d099,_0x28910e){super(_0x3a5beb,_0x50d099,_0x28910e),this['set']('actionIndicator',null),this['set']('placeholder',Et(_0x3a5beb,'Reply...')),this['bind']('authoredAt')['to'](_0x50d099),this['bind']('resolvedAt')['to'](_0x50d099),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 _0x1f130d(_0x3a5beb,_0x50d099['author'],this['getUserViewNotificationText']()),this['userView']['extendTemplate']({'attributes':{'class':['ck-comment__user','ck-annotation__user'],'aria-hidden':!0x0}}),this['listenTo'](_0x50d099,'change:isRemovable',()=>this['cancelConfirm']()),this['setTemplate'](this['getTemplate']());}getTemplate(){const _0x4ae066=this['bindTemplate'],_0x542d76=[{'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':_0x4ae066['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x4ae066['to']('authoredAt',_0x5eec08=>this['_config']['formatDateTime'](_0x5eec08))}]}]},{'tag':'div','attributes':{'class':['ck-comment__actions','ck-annotation__actions',_0x4ae066['if']('isEditMode','ck-comment__actions--hidden'),_0x4ae066['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']&&_0x542d76['push']({'tag':'div','attributes':{'class':['ck-comment__external']},'children':[{'text':this['getExternalCommentNote']()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper'],'tabindex':-0x1,'aria-label':_0x4ae066['to']('ariaLabel'),'aria-describedby':this['ariaDescriptionView']['id'],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck-comment','ck-annotation',_0x4ae066['if']('isEditMode','ck-comment--edit'),_0x4ae066['if']('isSystemComment','ck-comment--info'),_0x4ae066['to']('actionIndicator',_0x4687aa=>_0x4687aa?'ck-comment--'+_0x4687aa:'')],'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':_0x542d76}]}]};}_createEditButton(){const _0x535631=new _0x151ed2(this['locale']);return _0x535631['label']=Et(this['locale'],'Edit'),_0x535631['icon']=_0x53f900,_0x535631['withText']=!0x0,_0x535631['extendTemplate']({'attributes':{'class':'ck-comment--edit'}}),_0x535631['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x390057=>!_0x390057),_0x535631['bind']('isVisible')['to'](this['_model'],'isEditable'),_0x535631['on']('execute',()=>this['switchToEditMode']()),_0x535631;}_createRemoveButton(){const _0xf2b576=new _0x151ed2(this['locale']);return _0xf2b576['label']=Et(this['locale'],'Remove'),_0xf2b576['icon']=_0x3e28e7,_0xf2b576['withText']=!0x0,_0xf2b576['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0xf2b576['bind']('isEnabled')['to'](this['_model'],'isReadOnly',_0x41ef5c=>!_0x41ef5c),_0xf2b576['bind']('isVisible')['to'](this['_model'],'isRemovable'),_0xf2b576['on']('execute',()=>{this['showConfirm'](Et(this['locale'],'Delete\x20comment?'),this['element'])['then'](()=>{this['fire']('removeComment',this['_model']['id']);});}),_0xf2b576;}_createDropdown(){const _0x38f2fe=ct(this['locale'],_0x1ad89c),_0x5c6292=_0x38f2fe['panelView']['children'],_0x3d0dc2=new ot(this['locale']),_0x194f9f=_0x38f2fe['bindTemplate'];dt(_0x38f2fe,()=>this['items']['find'](_0x41c41c=>_0x41c41c['isVisible'])),_0x38f2fe['extendTemplate']({'attributes':{'class':[_0x194f9f['if']('isVisible','ck-hidden',_0x37fdc8=>!_0x37fdc8)]}});const _0x30bdca=(_0x3fdb52,_0x2dcbdc=-0x1)=>{const _0x556984=new nt(this['locale']);_0x556984['children']['add'](_0x3fdb52);const _0x76365e=_0x2dcbdc>-0x1?_0x2dcbdc:_0x3d0dc2['items']['length'];_0x3d0dc2['items']['add'](_0x556984,_0x76365e);const _0x23f31e=Array['from'](this['items']);_0x38f2fe['unbind']('isEnabled','isVisible'),_0x38f2fe['bind']('isEnabled')['toMany'](_0x23f31e,'isEnabled',(..._0x38c0ee)=>_0x38c0ee['some'](_0x58a6ab=>_0x58a6ab)),_0x38f2fe['bind']('isVisible')['toMany'](_0x23f31e,'isVisible',(..._0x51085d)=>_0x51085d['some'](_0x256952=>_0x256952));};_0x38f2fe['panelPosition']='sw',_0x38f2fe['buttonView']['set']({'label':Et(this['locale'],'Show\x20more\x20items'),'icon':_0x553988});for(const _0x461c21 of this['items'])_0x30bdca(_0x461c21);return _0x5c6292['add'](_0x3d0dc2),_0x38f2fe['listenTo'](this['items'],'add',(_0x28d4dc,_0x4eb090,_0x5f0cfc)=>{_0x30bdca(_0x4eb090,_0x5f0cfc);}),_0x38f2fe['listenTo'](this['items'],'remove',(_0x4396e5,_0x18dae7,_0x3ac97c)=>{_0x3d0dc2['items']['remove'](_0x3ac97c);}),_0x38f2fe;}_attachActions(_0x3a5ee3,_0x33218d){const _0x8c4757=_0x3a5ee3&&_0x3a5ee3['element'];_0x8c4757&&(this['listenTo'](_0x8c4757,'mouseenter',()=>this['actionIndicator']=_0x33218d),this['listenTo'](_0x8c4757,'focus',()=>this['actionIndicator']=_0x33218d),this['listenTo'](_0x8c4757,'mouseleave',()=>this['actionIndicator']=null),this['listenTo'](_0x8c4757,'blur',()=>this['actionIndicator']=null));}_createCommentInputView(){const _0x3bbe02=super['_createCommentInputView']();return _0x3bbe02['bind']('placeholder')['to'](this),_0x3bbe02;}['render'](){super['render'](),this['_attachActions'](this['editButton'],'edit'),this['_attachActions'](this['removeButton'],'remove');}};function Xt(_0x38e1f2){const _0x2e4884=_0x4f66b2(_0x38e1f2,0x1e),_0x378161=new MutationObserver(_0x46a011=>{for(const _0x4faec2 of _0x46a011)('attributes'==_0x4faec2['type']&&'class'==_0x4faec2['attributeName']||'childList'==_0x4faec2['type']||'characterData'==_0x4faec2['type'])&&_0x2e4884();});return{'attach'(_0x59ecb0){_0x378161['observe'](_0x59ecb0,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterData':!0x0});},'detach'(){_0x378161['disconnect'](),_0x2e4884['cancel']();}};}var qt=class extends ht{['focusTracker'];['id'];keystrokes;content;['mainView'];_mutationObserver;constructor(_0x37d949,_0x2f1fed){super(_0x37d949),this['id']=_0x295c58(),this['focusTracker']=new _0x198c81(),this['keystrokes']=new _0x2f2b28(),this['keystrokes']['set']('Esc',(_0x4f402,_0x529bbb)=>this['fire']('Esc',_0x529bbb)),this['set']('targetRect',{'top':0x0,'right':0x0,'bottom':0x0,'left':0x0}),this['set']('height',0x0),this['set']('isActive',!0x1),this['set']('isDirty',!0x1),this['set']('length',0x0),this['set']('type',''),this['_mutationObserver']=Xt(()=>this['_updateHeight']()),this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this),this['content']['add'](_0x2f1fed),this['mainView']=_0x2f1fed;const _0x1bfcae=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-annotation-wrapper','ck-rounded-corners',_0x1bfcae['if']('isActive','ck-annotation-wrapper--active')],'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['focusTracker']['add'](this['element']),this['keystrokes']['listenTo'](this['element']),this['_mutationObserver']['attach'](this['element']);}destroy(){this['content']['clear'](),this['keystrokes']['destroy'](),this['focusTracker']['destroy'](),this['_mutationObserver']['detach'](),super['destroy']();}['focus'](){this['content']['first']&&this['content']['first']['focus']();}_updateHeight(){const _0x51f120=this['element']['clientHeight'];_0x51f120&&(this['height']=_0x51f120);}};const jt=/* #__PURE__ -- @preserve */
|
|
29
|
+
_0x3d5e80();var $t=class Annotation extends jt{['view'];focusableElements;_type;_target;constructor({view:_0x338c70,target:_0x3e4616,type:_0x53d277,isVisible:_0xda2077=!0x0}){super(),this['view']=_0x338c70,this['view']['element']||this['view']['render'](),this['_type']=_0x53d277,this['_target']=_0x3e4616,Annotation['_assertCorrectTarget'](this['_getNormalizedTarget']()),this['focusableElements']=new _0x33b802([this['view']['element']],{'idProperty':'_id'}),this['focusableElements']['on']('add',(_0x508f66,_0x4d38ad)=>{this['view']['focusTracker']['add'](_0x4d38ad);}),this['focusableElements']['on']('remove',(_0x1f64e9,_0x2a572c)=>{this['view']['focusTracker']['remove'](_0x2a572c);}),this['set']('isVisible',_0xda2077);}get type(){return'function'==typeof this['_type']?this['_type']():this['_type'];}get['innerView'](){return this['view']['mainView'];}get target(){const _0x5daea3=this['_getNormalizedTarget']();return Annotation['_assertCorrectTarget'](_0x5daea3),_0x5daea3;}get targetRect(){const _0x51adf3=this['target'];if(null===_0x51adf3)return null;if(_0x51adf3 instanceof _0x23f3bc)return _0x51adf3;const _0x5e6b7d=_0x51adf3['filter'](_0x225424=>function(_0x3f7470){return!!_0x3f7470['offsetParent']||!!_0x3f7470['getClientRects']()['item'](0x0);}(_0x225424));return 0x0===_0x5e6b7d['length']?null:_0x23f3bc['getDomElementRects'](_0x5e6b7d[0x0])[0x0];}get isActive(){return this['view']['isActive'];}set isActive(_0x50278d){this['view']['isActive']=_0x50278d,this['view']['mainView']['isActive']=_0x50278d;}updateTargetRect(){this['view']['targetRect']=this['targetRect'];}destroy(){this['focusableElements']['stopListening'](),this['focusableElements']['clear'](),this['stopListening']();}refreshVisibility(){this['isVisible']=!!this['targetRect'];}static _assertCorrectTarget(_0x971d4b){if(!(null===_0x971d4b||_0x971d4b instanceof _0x23f3bc||Array['isArray'](_0x971d4b)&&_0x971d4b['every'](_0x44d1d5=>zt(_0x44d1d5))))throw new _0x402d5c('annotation-invalid-target',null,{'target':_0x971d4b});}_getNormalizedTarget(){const _0x11e1e6='function'==typeof this['_target']?this['_target']():this['_target'];return zt(_0x11e1e6)?[_0x11e1e6]:_0x11e1e6;}};function zt(_0x308eea){return null!==_0x308eea&&'object'==typeof _0x308eea&&'nodeType'in _0x308eea&&0x1===_0x308eea['nodeType'];}var Jt=class extends _0x33b802{_innerViewToAnnotation;_viewToAnnotation;['_focusTracker'];constructor(_0x2239b4=[]){super(),this['_innerViewToAnnotation']=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x198c81(),this['_focusTracker']['on']('change:isFocused',(_0x303a73,_0x1d0816,_0x5bd92b)=>{_0x5bd92b||this['fire']('blur');});for(const _0x2a1b48 of _0x2239b4)this['add'](_0x2a1b48);}get['isFocused'](){return this['_focusTracker']['isFocused'];}['add'](_0xf9186f){if(this['has'](_0xf9186f))throw new _0x402d5c('annotationcollection-duplicated-item',null);this['_innerViewToAnnotation']['set'](_0xf9186f['innerView'],_0xf9186f),this['_viewToAnnotation']['set'](_0xf9186f['view'],_0xf9186f);for(const _0x353c91 of _0xf9186f['focusableElements'])this['_focusTracker']['add'](_0x353c91);if(this['listenTo'](_0xf9186f['focusableElements'],'add',(_0x249c0e,_0x21d6a4)=>{this['_focusTracker']['add'](_0x21d6a4);}),this['listenTo'](_0xf9186f['focusableElements'],'remove',(_0x18083b,_0x5e87ca)=>{this['_focusTracker']['remove'](_0x5e87ca);}),this['listenTo'](_0xf9186f['view']['focusTracker'],'change:isFocused',(_0x2a74eb,_0x36286c,_0xbaf597)=>{_0xbaf597&&this['fire']('focus',_0xf9186f);}),_0xf9186f['updateTargetRect'](),this['_areCachedRectsStale']()){for(const _0x5d2173 of this)_0x5d2173['updateTargetRect']();}const _0x4d553d=this['_getOrderInContent'](_0xf9186f['view']['targetRect']);return super['add'](_0xf9186f,_0x4d553d);}['remove'](_0x3771bd){if(!this['has'](_0x3771bd))throw new _0x402d5c('annotationcollection-not-existing-item',null);this['stopListening'](_0x3771bd['view']['focusTracker']),this['stopListening'](_0x3771bd['focusableElements']);for(const _0x4aa819 of _0x3771bd['focusableElements'])this['_focusTracker']['remove'](_0x4aa819);return this['_viewToAnnotation']['delete'](_0x3771bd['view']),this['_innerViewToAnnotation']['delete'](_0x3771bd['innerView']),super['remove'](_0x3771bd);}getByInnerView(_0x581780){return this['_innerViewToAnnotation']['get'](_0x581780);}getByView(_0x140711){return this['_viewToAnnotation']['get'](_0x140711);}destroy(){super['clear'](),this['stopListening'](),this['_innerViewToAnnotation']['clear'](),this['_viewToAnnotation']['clear'](),this['_focusTracker']['destroy']();}refreshPositioning(){for(const _0x2db1a0 of this)_0x2db1a0['updateTargetRect']();this['_sort']();}_sort(){const _0x214967=Array['from'](this)['sort']((_0x2a6fff,_0x1cb1f4)=>Zt(_0x2a6fff['view']['targetRect'],_0x1cb1f4['view']['targetRect']));for(let _0x315e93=_0x214967['length']-0x1;_0x315e93>0x0;_0x315e93--){const _0x48a87a=_0x214967[_0x315e93];_0x315e93!==this['getIndex'](_0x48a87a)&&(this['remove'](_0x48a87a),this['add'](_0x48a87a));}}_getOrderInContent(_0x2b78f6){let _0x4f61f2=0x0;if(!_0x2b78f6)return this['length'];for(const _0x5b6f08 of this){const _0x19b6b6=_0x5b6f08['view']['targetRect'];if(_0x19b6b6){if(Zt(_0x2b78f6,_0x19b6b6)<0x0)return _0x4f61f2;_0x4f61f2++;}}return _0x4f61f2;}_areCachedRectsStale(){const _0x1afff6=this['get'](0x0);if(!_0x1afff6)return!0x1;const _0x1b97dd=_0x1afff6['view']['targetRect'],_0x51d1ba=_0x1afff6['targetRect'];return!(!_0x1b97dd||!_0x51d1ba)&&(_0x1b97dd['top']!==_0x51d1ba['top']||_0x1b97dd['left']!==_0x51d1ba['left']);}};function Qt({source:_0x465cd3,target:_0xa5ff5c,filter:_0xcbc169}){for(const _0x1bd8ef of _0x465cd3)_0xcbc169(_0x1bd8ef)&&_0xa5ff5c['add'](_0x1bd8ef);_0xa5ff5c['listenTo'](_0x465cd3,'add',(_0x44f16b,_0x60df42)=>{_0xcbc169(_0x60df42)&&_0xa5ff5c['add'](_0x60df42);}),_0xa5ff5c['listenTo'](_0x465cd3,'remove',(_0x1811e0,_0x350103)=>{_0xa5ff5c['has'](_0x350103)&&_0xa5ff5c['remove'](_0x350103);});}function Zt(_0x3dfa83,_0x110c4d){if(null===_0x3dfa83&&null===_0x110c4d)return 0x0;if(null===_0x3dfa83)return-0x1;if(null===_0x110c4d)return 0x1;const _0x26ac50=_0x3dfa83['top']-_0x110c4d['top'];return 0x0==_0x26ac50?_0x3dfa83['left']-_0x110c4d['left']:_0x26ac50;}var ti=class extends _0x2bb426{collection;_visibleAnnotations;static get['pluginName'](){return'Annotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x27bfab){if(super(_0x27bfab),this['collection']=new Jt(),this['_visibleAnnotations']=new Jt(),this['set']('activeAnnotations',new Set()),this['_bindAnnotationsToVisibleAnnotations'](),_0x27bfab instanceof _0x2e081e){const _0x19bb16=_0x27bfab['locale'];_0x27bfab['accessibility']['addKeystrokeInfoGroup']({'id':'annotations','label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_GROUP'),'keystrokes':[{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_MOVE_TO'),'keystroke':'Ctrl+Shift+E'},{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_EXIT'),'keystroke':'Esc'},{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_ENTER'),'keystroke':'Enter'},{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_BROWSE_GROUPS'),'keystroke':[['Tab'],['Shift+Tab']]},{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_SUBMIT_COMMENT'),'keystroke':['Ctrl+Enter']},{'label':Et(_0x19bb16,'ACCESSIBILITY_HELP_ANNOTATIONS_NAVIGATE_THREADS'),'keystroke':[['Arrowup'],['Arrowdown']]}]});}this['_setupEnterAnnotationKeystroke'](),this['_setupEscapeAnnotationHandling']();}['add'](_0x415feb){this['collection']['add'](_0x415feb);}['remove'](_0x5899a4){this['collection']['remove'](_0x5899a4),_0x5899a4['destroy']();}refreshVisibility(){for(const _0x216601 of this['collection'])_0x216601['refreshVisibility']();}refreshPositioning(){this['_visibleAnnotations']['refreshPositioning']();}getByInnerView(_0x45ea74){return this['collection']['getByInnerView'](_0x45ea74);}deactivateAll(){this['fire']('_deactivateAllAnnotations');}destroy(){for(const _0x1f54ab of this['collection'])_0x1f54ab['destroy']();this['_visibleAnnotations']['destroy'](),this['collection']['destroy'](),super['destroy']();}activate(_0x4f6673){this['fire']('_activateAnnotation',_0x4f6673);}createAnnotation(_0x116884){return new $t(_0x116884);}createAnnotationView(_0x33a1d2,_0x5f0728){return new qt(_0x33a1d2,_0x5f0728);}_addActiveAnnotation(_0xf14e53){const _0x59a226=new Set(this['activeAnnotations']);_0x59a226['add'](_0xf14e53),this['activeAnnotations']=_0x59a226;}_removeActiveAnnotation(_0x55a040){const _0x454e03=new Set(this['activeAnnotations']);_0x454e03['delete'](_0x55a040),this['activeAnnotations']=_0x454e03;}_bindAnnotationsToVisibleAnnotations(){const _0x4d8051=this['collection'],_0x51d019=this['_visibleAnnotations'];function _0xf14909(_0x329241){const _0x47a703=_0x329241['source'];_0x47a703['isVisible']&&!_0x51d019['has'](_0x47a703)?_0x51d019['add'](_0x47a703):!_0x47a703['isVisible']&&_0x51d019['has'](_0x47a703)&&_0x51d019['remove'](_0x47a703),_0x47a703['view']['focusTracker']['remove'](_0x47a703['view']['element']),_0x47a703['view']['focusTracker']['add'](_0x47a703['view']['element']);}this['listenTo'](_0x4d8051,'add',(_0x24d205,_0x54ed6a)=>{_0x54ed6a['isVisible']&&_0x51d019['add'](_0x54ed6a),this['listenTo'](_0x54ed6a,'change:isVisible',_0xf14909);}),this['listenTo'](_0x4d8051,'remove',(_0x56df00,_0x3de9b0)=>{_0x51d019['has'](_0x3de9b0)&&_0x51d019['remove'](_0x3de9b0),this['stopListening'](_0x3de9b0,'change:isVisible',_0xf14909);});}_setupEnterAnnotationKeystroke(){const _0x53907f=_0x528669=>{_0x528669['on']('ready',()=>{_0x528669['keystrokes']['set'](_0x5baba3,(_0x40401b,_0x415daf)=>{const _0x353d0d=_0x3468db(this['activeAnnotations']['values']());_0x353d0d&&(_0x353d0d['view']['focus'](),_0x415daf());});});};this['context']instanceof _0x2e081e?_0x53907f(this['context']):this['context']['editors']&&this['context']['editors']['on']('add',(_0x11bff3,_0xc10e8a)=>{_0x53907f(_0xc10e8a);});}_setupEscapeAnnotationHandling(){const _0x1628c7=_0x16eedf=>{const _0x3c9ab4=_0x16eedf['source'],_0x4803de=[];let _0x59903f;if(Array['isArray'](_0x3c9ab4['target'])){_0x59903f=_0x3c9ab4['target'][0x0],this['context']instanceof _0x2e081e?_0x4803de['push'](this['context']):this['context']['editors']&&_0x4803de['push'](...this['context']['editors']);for(const _0x44410d of _0x4803de)for(const _0x1e3712 of _0x44410d['editing']['view']['domRoots']['values']())if(_0x1e3712['contains'](_0x59903f))return void _0x44410d['editing']['view']['focus']();_0x59903f['focus']();}};this['listenTo'](this['collection'],'add',(_0x25ae04,_0x250b6d)=>{this['listenTo'](_0x250b6d,'escape',_0x1628c7,{'priority':'low'});}),this['listenTo'](this['collection'],'remove',(_0x149821,_0x16ff81)=>{this['stopListening'](_0x16ff81,'escape',_0x1628c7);});}};const ii=Symbol('noChannel'),ei={'admin':!0x0,'modifyAll':!0x1,'write':!0x0,'resolve':!0x0},si=/* #__PURE__ -- @preserve */
|
|
30
|
+
_0x3d5e80(),ni=/* #__PURE__ -- @preserve */
|
|
31
|
+
_0x3d5e80();var oi=class extends _0x2bb426{_threads;_threadToController;_viewToController;static get requires(){return[ti,_0x478212,_0x552e83];}static get['pluginName'](){return'CommentsRepository';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa60533){super(_0xa60533),this['_threads']=new Map(),this['_threadToController']=new Map(),this['_viewToController']=new Map(),this['set']('_readOnlyChannels',new Set()),this['set']('_permissions',new Map());const _0x234e6f=this['context']['config'];_0x234e6f['define']('comments.maxCommentsWhenCollapsed',0x2),_0x234e6f['define']('comments.maxThreadTotalWeight',0x1f4),_0x234e6f['define']('comments.maxCommentCharsWhenCollapsed',0x8c),_0x234e6f['define']('comments.CommentThreadView',Ut),_0x234e6f['define']('comments.CommentView',Yt),_0x234e6f['get']('comments.editorConfig')||console['warn']('Missing\x20comments\x20editor\x20configuration\x20(`comments.editorConfig`).\x20Default\x20configuration\x20will\x20be\x20used\x20instead.');}init(){const _0x36cee7=this['context']['plugins']['get'](ti);this['set']('activeCommentThread',null),this['on']('addCommentThread',(_0x2041d4,_0x152c8a)=>this['_addCommentThread'](_0x152c8a)),this['on']('submitCommentThread',(_0x51591f,_0x1ab9f3)=>this['_submitCommentThread'](_0x1ab9f3)),this['on']('resolveCommentThread',(_0x372d88,_0x202bd0)=>this['_resolveCommentThread'](_0x202bd0)),this['on']('resolveCommentThread',(_0x21aa62,_0x1ba181)=>this['_updateActiveAnnotation'](_0x1ba181),{'priority':'lowest'}),this['on']('reopenCommentThread',(_0x39e97b,_0x1d4631)=>this['_reopenCommentThread'](_0x1d4631)),this['on']('reopenCommentThread',(_0x26e868,_0x534b95)=>this['_updateActiveAnnotation'](_0x534b95),{'priority':'lowest'}),this['on']('removeCommentThread',(_0x296700,_0x2a43ef)=>this['_removeCommentThread'](_0x2a43ef)),this['on']('updateCommentThread',(_0x519a7a,_0x557534)=>this['_updateCommentThread'](_0x557534)),this['on']('updateCommentThread',(_0x1460b2,_0x1c8cb0)=>this['_updateActiveAnnotation'](_0x1c8cb0),{'priority':'lowest'}),this['on']('addComment',(_0x5d5054,_0x3236df)=>this['_addComment'](_0x3236df)),this['on']('updateComment',(_0x21d694,_0xfbc507)=>this['_updateComment'](_0xfbc507)),this['on']('removeComment',(_0x15a9a9,_0x2ae804)=>this['_removeComment'](_0x2ae804)),this['on']('addComment',(_0x5be0f1,{threadId:_0x2e9e84,isFromAdapter:_0x232571})=>{if(_0x232571)return;const _0x5054d0=this['getCommentThread'](_0x2e9e84),_0xdcb89f=_0x5054d0&&this['_threadToController']['get'](_0x5054d0);_0xdcb89f&&_0xdcb89f['view']['commentsListView']['focus'](-0x1);},{'priority':'lowest'}),this['listenTo'](_0x36cee7,'change:activeAnnotations',(_0x1ef0e4,_0x5004d1,_0x2f6290)=>{const _0x255677=Array['from'](_0x2f6290)['map'](_0x3daf73=>this['_viewToController']['get'](_0x3daf73['innerView']))['filter'](Boolean)[0x0];this['activeCommentThread']=_0x255677?_0x255677['model']:null;});}set adapter(_0x14d5ad){if(this['_adapter'])throw new _0x402d5c('commentsrepository-adapter-already-set');this['_adapter']=_0x14d5ad;}get adapter(){return this['_adapter'];}addCommentThread({channelId:_0x4b281e=ii,threadId:_0x38235e=_0x295c58(),comments:_0x3c763b=[],unlinkedAt:_0x2a52c6=null,resolvedAt:_0x5e1fda=null,resolvedBy:_0x33b664=null,target:_0x51ae32=null,context:_0x3e2163=null,attributes:_0x3e996e={},isResolvable:_0x2328c2=!0x0,isSubmitted:_0x223df2=!0x1,isFromAdapter:_0x255feb=!0x1}={}){return this['fire'](ai('addCommentThread',_0x4b281e),{'channelId':_0x4b281e,'threadId':_0x38235e,'comments':_0x3c763b,'unlinkedAt':_0x2a52c6,'resolvedAt':_0x5e1fda,'resolvedBy':_0x33b664,'target':_0x51ae32,'context':_0x3e2163,'attributes':_0x3e996e,'isFromAdapter':_0x255feb,'isResolvable':_0x2328c2,'isSubmitted':_0x223df2}),this['getCommentThread'](_0x38235e);}openNewCommentThread({channelId:_0x392b38=ii,threadId:_0x36f0f0=_0x295c58(),target:_0x5e3f07,context:_0x206ddb=null,isResolvable:_0x1d3e5a=!0x0}){if(this['_readOnlyChannels']['has'](_0x392b38)||this['_readOnlyChannels']['has'](void 0x0))return null;if(!_0x5e3f07)throw new _0x402d5c('commentsrepository-missing-target');const _0x2fc5f6=this['addCommentThread']({'channelId':_0x392b38,'threadId':_0x36f0f0,'target':_0x5e3f07,'context':_0x206ddb,'isResolvable':_0x1d3e5a});if(!_0x2fc5f6)return null;const _0xc25db5=this['_threadToController']['get'](_0x2fc5f6),_0x20251a=_0xc25db5['view']['commentThreadInputView']['commentInputView'],_0x1d49e7=this['context']['plugins']['get'](ti),_0x5aa45b=_0x1d49e7['getByInnerView'](_0xc25db5['view']);return _0x1d49e7['activate'](_0x5aa45b),_0x20251a['once']('editorReady',()=>_0x20251a['focus']()),_0x2fc5f6;}hasCommentThread(_0x41c8da){if('string'!=typeof _0x41c8da)throw new _0x402d5c('commentsrepository-invalid-comment-thread-id');return this['_threads']['has'](_0x41c8da);}updateCommentThread({channelId:_0x2ff0bd=ii,threadId:_0x49b944,context:_0x14450e,unlinkedAt:_0x54e408,attributes:_0x588281,isFromAdapter:_0x35e891=!0x1}){return this['fire'](ai('updateCommentThread',_0x2ff0bd),{'channelId':_0x2ff0bd,'threadId':_0x49b944,'context':_0x14450e,'unlinkedAt':_0x54e408,'attributes':_0x588281,'isFromAdapter':_0x35e891}),this['getCommentThread'](_0x49b944);}getCommentThread(_0x58e4d4){if('string'!=typeof _0x58e4d4)throw new _0x402d5c('commentsrepository-invalid-comment-thread-id');return this['_threads']['get'](_0x58e4d4);}fetchCommentThread({channelId:_0x5b2d04,threadId:_0x3aa73a}={}){const _0x6efc8=this['getCommentThread'](_0x3aa73a);if(_0x6efc8)return Promise['resolve'](_0x6efc8);if(!this['adapter'])return Promise['resolve'](void 0x0);if('function'!=typeof this['adapter']['getCommentThread'])throw new _0x402d5c('commentsrepository-missing-thread-and-adapter-method',this['context']);return this['adapter']['getCommentThread']({'channelId':_0x5b2d04,'threadId':_0x3aa73a})['then'](_0x37ea08=>this['hasCommentThread'](_0x3aa73a)?this['getCommentThread'](_0x3aa73a):_0x37ea08?this['addCommentThread'](Object['assign']({'isFromAdapter':!0x0,'channelId':_0x5b2d04},_0x37ea08)):void 0x0)['catch'](_0x32c507=>{throw console['error'](_0x32c507),new _0x402d5c('commentsrepository-fetch-comment-thread',this['context']);});}getCommentThreads({channelId:_0xa5a376,skipNotAttached:_0xb61149=!0x1,skipEmpty:_0x57e0df=!0x1,toJSON:_0x3351a2=!0x1}={}){const _0x13f9e5=[];for(const _0x20880d of this['_threads']['values']())_0xa5a376&&_0x20880d['channelId']!==_0xa5a376||_0xb61149&&!_0x20880d['isAttached']||_0x57e0df&&0x0===_0x20880d['length']||_0x13f9e5['push'](_0x20880d);return _0x3351a2?_0x13f9e5['map'](_0x5e8fee=>_0x5e8fee['toJSON']()):_0x13f9e5;}getAnnotationForCommentThread(_0x318099){const _0xd26155=this['_threadToController']['get'](_0x318099);return _0xd26155&&this['context']['plugins']['get'](ti)['getByInnerView'](_0xd26155['view'])||null;}getCommentThreadForAnnotation(_0x1def06){const _0x711a48=this['_viewToController']['get'](_0x1def06['innerView']);return _0x711a48?_0x711a48['model']:null;}setActiveCommentThread(_0x51ca54){const _0x80a66f=this['context']['plugins']['get'](ti);if(!_0x51ca54)return void(this['activeCommentThread']&&_0x80a66f['deactivateAll']());const _0x326e03=this['getCommentThread'](_0x51ca54);if(!_0x326e03)throw new _0x402d5c('commentsrepository-active-missing-comment-thread',null,{'threadId':_0x51ca54});if(!this['_threadToController']['has'](_0x326e03))throw new _0x402d5c('commentsrepository-active-not-attached',null,{'threadId':_0x51ca54});const _0x32cf18=_0x80a66f['getByInnerView'](this['_threadToController']['get'](_0x326e03)['view']);_0x80a66f['activate'](_0x32cf18);}switchReadOnly(_0x5acc1a,_0x483305){_0x5acc1a?this['_readOnlyChannels']['add'](_0x483305):this['_readOnlyChannels']['delete'](_0x483305),this['fire']('change:_readOnlyChannels','_readOnlyChannels',this['_readOnlyChannels'],this['_readOnlyChannels']);}['isReadOnly'](_0x33b4b2){return this['_readOnlyChannels']['has'](_0x33b4b2)||this['_readOnlyChannels']['has'](void 0x0);}createCommentThreadController(_0x2cda7c,_0x1e6437){return new bt(_0x2cda7c,_0x1e6437);}setPermissions(_0x4d764b,_0x1f5ce9=ii){this['_permissions']['set'](_0x1f5ce9,_0x4d764b),this['fire']('change:_permissions','_permissions',this['_permissions'],this['_permissions']);}getPermissions(_0x546f46=ii){return this['_permissions']['has'](_0x546f46)?this['_permissions']['get'](_0x546f46):ei;}_addCommentThread({channelId:_0x42fe58,threadId:_0x594572,comments:_0x17c009,unlinkedAt:_0x1f0135,resolvedAt:_0x54b367,resolvedBy:_0x5e3e4b,target:_0x50e1fd,context:_0xe12e,attributes:_0xb5da84,isFromAdapter:_0x71a937,isResolvable:_0x2f6d8f,isSubmitted:_0x21eb63}){if('string'!=typeof _0x594572)throw new _0x402d5c('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x594572});if(this['hasCommentThread'](_0x594572))throw new _0x402d5c('commentsrepository-duplicated-comment-thread-id',null,{'threadId':_0x594572});const _0x53bd59=new ri(this,{'channelId':_0x42fe58,'id':_0x594572,'context':_0xe12e,'attributes':_0xb5da84,'unlinkedAt':_0x1f0135,'resolvedAt':_0x54b367,'resolvedBy':_0x5e3e4b?this['context']['plugins']['get'](_0x552e83)['getUser'](_0x5e3e4b):null,'isResolvable':_0x2f6d8f,'isSubmitted':_0x21eb63||_0x71a937});this['_threads']['set'](_0x594572,_0x53bd59);for(const _0x491278 of _0x17c009)_0x53bd59['_add'](this['_createNewComment']({'threadId':_0x594572,..._0x491278}));return _0x50e1fd&&_0x53bd59['attachTo'](_0x50e1fd),_0x71a937||!_0x53bd59['length']?Promise['resolve']():this['_submitCommentThread']({'channelId':_0x42fe58,'threadId':_0x594572});}_submitCommentThread({channelId:_0x41ba18,threadId:_0x3f39f3}){if(!this['hasCommentThread'](_0x3f39f3))throw new _0x402d5c('commentsrepository-missing-comment-thread',this);const _0x146fcd=this['getCommentThread'](_0x3f39f3);if(_0x146fcd['_isSubmitted']=!0x0,!this['adapter']||'function'!=typeof this['adapter']['addCommentThread'])return Promise['resolve']();const {id:_0x8be069,comments:_0x447afe,resolvedAt:_0x5c72eb,resolvedBy:_0x4b5fba,context:_0x41f0b8,attributes:_0x32ce98}=_0x146fcd,_0x17d8ae=this['context']['plugins']['get']('PendingActions'),_0x5db6a9=_0x17d8ae['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['addCommentThread']({'channelId':_0x41ba18,'threadId':_0x8be069,'comments':_0x447afe['map'](_0xc437b5=>_0xc437b5['toJSON']()),'resolvedAt':_0x5c72eb,'resolvedBy':_0x4b5fba?_0x4b5fba['id']:_0x4b5fba,'context':_0x41f0b8,'attributes':_0x32ce98})['then'](({comments:_0x4250b3})=>{_0x17d8ae['remove'](_0x5db6a9);for(const _0x131377 of _0x4250b3)this['_updateComment']({'channelId':_0x41ba18,'threadId':_0x3f39f3,'commentId':_0x131377['commentId'],'createdAt':_0x131377['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x521367=>{throw console['error'](_0x521367),new _0x402d5c('commentsrepository-add-comment-thread-internal-error',this);});}_attachCommentThread({threadId:_0xda8ae2,target:_0x2ce2ec}){const _0x2fbd74=this['getCommentThread'](_0xda8ae2);if(!_0x2fbd74)throw new _0x402d5c('commentsrepository-attach-missing-comment-thread',this);const _0x5d4c55=this['context']['plugins']['get']('PendingActions'),_0x4f59a4=this['context']['plugins']['get'](ti),_0x506c53=this['_createCommentThreadView'](_0x2fbd74),_0x17b176=new bt(_0x2fbd74,_0x506c53);let _0x3a880b=null;_0x506c53['on']('change:isDirty',(_0x48d05f,_0x221ca7,_0x72226a)=>{_0x72226a?_0x3a880b=_0x5d4c55['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD')):_0x3a880b&&(_0x5d4c55['remove'](_0x3a880b),_0x3a880b=null);}),this['_threadToController']['set'](_0x2fbd74,_0x17b176),this['_viewToController']['set'](_0x506c53,_0x17b176);const _0x2fb726=new qt(this['context']['locale'],_0x506c53);_0x2fb726['bind']('length')['to'](_0x506c53),_0x2fb726['bind']('isDirty')['to'](_0x506c53,'isDirty',_0x506c53,'length',(_0x1cac49,_0x4ef6c2)=>_0x1cac49||!_0x4ef6c2),_0x2fb726['bind']('isActive')['to'](_0x506c53),_0x2fb726['type']='comment';const _0x5c97da=new $t({'view':_0x2fb726,'target':_0x2ce2ec,'type':'comment','isVisible':!_0x2fbd74['archivedAt']&&!!('function'==typeof _0x2ce2ec?_0x2ce2ec():_0x2ce2ec)});return _0x506c53['on']('escape',()=>{_0x5c97da['fire']('escape');}),this['_bindAnnotationToEditors'](_0x506c53,_0x5c97da),_0x4f59a4['add'](_0x5c97da),_0x5c97da;}_bindAnnotationToEditors(_0xf14bfe,_0x260e52){this['listenTo'](_0xf14bfe,'editorReady',(_0x5559c5,_0x300ee8)=>{const _0x26628f=_0x300ee8['ui']['view']['body']['bodyCollectionContainer'];_0x260e52['focusableElements']['add'](_0x26628f),this['context']instanceof _0x2e081e&&this['context']['ui']['focusTracker']['add'](_0x26628f);},{'priority':'highest'}),this['listenTo'](_0xf14bfe,'editorDestroyed',(_0x587bf9,_0x44067d)=>{const _0x46597d=_0x44067d['ui']['view']['body']['bodyCollectionContainer'];_0x260e52['focusableElements']['has'](_0x46597d)&&_0x260e52['focusableElements']['remove'](_0x46597d),this['context']instanceof _0x2e081e&&this['context']['ui']['focusTracker']['remove'](_0x46597d);});}_unbindEditors(_0x42eadc){this['stopListening'](_0x42eadc,'editorReady'),this['stopListening'](_0x42eadc,'editorDestroyed');}_createCommentThreadView(_0x489c05){const _0x41e205=this['context']['plugins']['get'](_0x552e83),{config:_0x38b79b,locale:_0x3cd74d}=this['context'],_0x2d5464=_0x337b38(_0x38b79b['get']('locale'),_0x3cd74d);return new(0x0,(_0x38b79b['get']('comments'))['CommentThreadView'])(_0x3cd74d,_0x489c05,_0x41e205['me'],{'editorConfig':{..._0x38b79b['get']('comments.editorConfig'),'licenseKey':this['context']['config']['get']('licenseKey')},'copyMarkers':_0x38b79b['get']('comments.copyMarkers'),'maxCommentsWhenCollapsed':_0x38b79b['get']('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x38b79b['get']('comments.maxThreadTotalWeight'),'maxCommentCharsWhenCollapsed':_0x38b79b['get']('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x2d5464,'CommentView':_0x38b79b['get']('comments')['CommentView']});}_resolveCommentThread({threadId:_0x4cd2aa,channelId:_0x5a893e,resolvedAt:_0x391e66,resolvedBy:_0x1f04eb,isFromAdapter:_0x1c7a50}){if(!this['hasCommentThread'](_0x4cd2aa))throw new _0x402d5c('commentsrepository-missing-comment-thread',null,{'threadId':_0x4cd2aa});const _0x1b4099=this['getCommentThread'](_0x4cd2aa);if(_0x1b4099['isResolved'])throw new _0x402d5c('commentsrepository-resolved-comment-thread',null,{'threadId':_0x4cd2aa});const _0x2ed79a=this['context']['plugins']['get'](_0x552e83);if(_0x1b4099['resolvedBy']=_0x2ed79a['getUser'](_0x1f04eb),_0x1b4099['resolvedAt']=_0x391e66,_0x1c7a50||!this['adapter']||'function'!=typeof this['adapter']['resolveCommentThread'])return Promise['resolve']();const _0x4c4b5d=this['context']['plugins']['get']('PendingActions'),_0x29ec2d=_0x4c4b5d['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['resolveCommentThread']({'channelId':_0x5a893e,'threadId':_0x4cd2aa})['then'](({resolvedAt:_0x3e0aa9,resolvedBy:_0x2a0a9c})=>{_0x4c4b5d['remove'](_0x29ec2d),_0x1b4099['resolvedBy']['id']!==_0x2a0a9c&&(_0x1b4099['resolvedBy']=_0x2ed79a['getUser'](_0x2a0a9c)),_0x1b4099['resolvedAt']=_0x3e0aa9;})['catch'](_0x4e9502=>{throw console['error'](_0x4e9502),new _0x402d5c('commentsrepository-resolve-comment-thread-internal-error',this);});}_reopenCommentThread({threadId:_0x265a5f,channelId:_0x177417,isFromAdapter:_0x56bae3}){if(!this['hasCommentThread'](_0x265a5f))throw new _0x402d5c('commentsrepository-missing-comment-thread',null,{'threadId':_0x265a5f});const _0x4d8150=this['getCommentThread'](_0x265a5f);if(!_0x4d8150['isResolved'])throw new _0x402d5c('commentsrepository-reopen-comment-thread',null,{'threadId':_0x265a5f});if(_0x4d8150['resolvedBy']=null,_0x4d8150['resolvedAt']=null,_0x56bae3||!this['adapter']||'function'!=typeof this['adapter']['reopenCommentThread'])return Promise['resolve']();const _0x638fe7=this['context']['plugins']['get']('PendingActions'),_0x51278c=_0x638fe7['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['reopenCommentThread']({'channelId':_0x177417,'threadId':_0x265a5f})['then'](()=>_0x638fe7['remove'](_0x51278c))['catch'](_0x31430d=>{throw console['error'](_0x31430d),new _0x402d5c('commentsrepository-reopen-comment-thread-internal-error',this);});}_removeCommentThread({threadId:_0x1c1c56,isFromAdapter:_0x5e17c7}){const _0x2d8b6b=this['getCommentThread'](_0x1c1c56);if(!_0x2d8b6b)throw new _0x402d5c('commentsrepository-remove-missing-comment-thread',this);if(this['_detachCommentThread'](_0x1c1c56),this['_threads']['delete'](_0x1c1c56),!_0x2d8b6b['isSubmitted']||_0x5e17c7||!this['adapter']||'function'!=typeof this['adapter']['removeCommentThread'])return Promise['resolve']();const _0x5e5547=this['context']['plugins']['get']('PendingActions'),{channelId:_0x3f2b5b}=_0x2d8b6b,_0x12dc89=_0x5e5547['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeCommentThread']({'channelId':_0x3f2b5b,'threadId':_0x1c1c56})['then'](()=>_0x5e5547['remove'](_0x12dc89))['catch'](_0x10d7cd=>{throw console['error'](_0x10d7cd),new _0x402d5c('commentsrepository-remove-comment-thread-internal-error',this);});}_updateCommentThread({threadId:_0x34c8bc,unlinkedAt:_0x2b1fb1,context:_0xe25cf0,attributes:_0x3237e7,isFromAdapter:_0x4e9dd9}){if('string'!=typeof _0x34c8bc)throw new _0x402d5c('commentsrepository-invalid-comment-thread-id',null,{'threadId':_0x34c8bc});if(!this['hasCommentThread'](_0x34c8bc))throw new _0x402d5c('commentsrepository-missing-comment-thread',null,{'threadId':_0x34c8bc});const _0x39ddf9=this['getCommentThread'](_0x34c8bc);let _0x1a1814=!0x1;if(void 0x0!==_0xe25cf0&&_0x39ddf9['context']!==_0xe25cf0&&(_0x39ddf9['context']=_0xe25cf0,_0x1a1814=!0x0),void 0x0!==_0x2b1fb1&&_0x39ddf9['unlinkedAt']!==_0x2b1fb1&&(_0x39ddf9['unlinkedAt']=_0x2b1fb1,_0x1a1814=!0x0),_0x3237e7&&!_0x4472b0(_0x3237e7,_0x39ddf9['attributes'])&&(_0x39ddf9['attributes']=_0x3237e7,_0x1a1814=!0x0),!_0x1a1814)return Promise['resolve']();if(!_0x39ddf9['isSubmitted']||_0x4e9dd9||!this['adapter']||'function'!=typeof this['adapter']['updateCommentThread'])return Promise['resolve']();const _0xc60cb4=this['context']['plugins']['get']('PendingActions'),{channelId:_0x5685ab}=_0x39ddf9,_0x525909=_0xc60cb4['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateCommentThread']({'channelId':_0x5685ab,'threadId':_0x34c8bc,'context':_0xe25cf0,'unlinkedAt':_0x2b1fb1,'attributes':_0x3237e7})['then'](()=>_0xc60cb4['remove'](_0x525909))['catch'](_0x43185a=>{throw console['error'](_0x43185a),new _0x402d5c('commentsrepository-update-comment-thread-internal-error',this);});}_detachCommentThread(_0x56d5ce){const _0x4a3b37=this['context']['plugins']['get'](ti),_0x4511d7=this['getCommentThread'](_0x56d5ce);if(_0x4511d7['_isAttached']=!0x1,this['_threadToController']['has'](_0x4511d7)){const _0x456c87=this['_threadToController']['get'](_0x4511d7),_0x4eafa3=_0x456c87['view'],_0x2e1eaa=_0x4a3b37['getByInnerView'](_0x4eafa3);this['_threadToController']['delete'](_0x4511d7),this['_viewToController']['delete'](_0x4eafa3),_0x2e1eaa&&_0x4a3b37['remove'](_0x2e1eaa),_0x456c87['destroy'](),_0x4eafa3['destroy']()['then'](()=>{this['_unbindEditors'](_0x4eafa3);});}}_updateActiveAnnotation({threadId:_0x3a311c,resolvedAt:_0x3c1839,unlinkedAt:_0x2b7646}){const _0x7164ed=!!_0x3c1839,_0x33ca4b=this['context']['plugins']['get'](ti),_0x590819=this['getCommentThread'](_0x3a311c);if(this['_threadToController']['has'](_0x590819)){const _0x5d3bad=this['_threadToController']['get'](_0x590819)['view'],_0x6b667c=_0x33ca4b['getByInnerView'](_0x5d3bad);_0x6b667c&&(_0x7164ed&&_0x33ca4b['_removeActiveAnnotation'](_0x6b667c),_0x2b7646?_0x6b667c['isVisible']=!0x1:_0x6b667c['refreshVisibility']());}}_getExternalAuthor(_0x250c9f){const _0x5b5227=this['context']['plugins']['get'](_0x552e83),_0x106bee=_0x1480b3('external:'+_0x250c9f),_0x122919=_0x5b5227['getUser'](_0x106bee);return _0x122919||_0x5b5227['addUser']({'id':_0x106bee,'name':_0x250c9f});}_createNewComment({threadId:_0x2fb172,commentId:_0x2e936f=_0x295c58(),content:_0x2fcdd3,authorId:_0x50ef6e,createdAt:_0x86d955,attributes:_0x5ebb26}){if('string'!=typeof _0x2e936f)throw new _0x402d5c('commentsrepository-invalid-commentid');if('string'!=typeof _0x50ef6e)throw new _0x402d5c('commentsrepository-invalid-comment-authorid');if('string'!=typeof _0x2fcdd3||!_0x2fcdd3['trim']())throw new _0x402d5c('commentsrepository-invalid-comment-content');const _0xd0b00a=this['context']['plugins']['get'](_0x552e83)['getUser'](_0x50ef6e);if(!_0xd0b00a)throw new _0x402d5c('commentsrepository-add-comment-user-not-exists',null,{'authorId':_0x50ef6e});let _0x268c19=null,_0x5b3c68=_0x86d955;return _0x5ebb26?.['@external']&&(_0x268c19=this['_getExternalAuthor'](_0x5ebb26['@external']['authorName']),_0x5b3c68=new Date(_0x5ebb26['@external']['createdAt'])),new hi(this,{'threadId':_0x2fb172,'id':_0x2e936f,'author':_0x268c19||_0xd0b00a,'creator':_0xd0b00a,'content':_0x2fcdd3,'createdAt':_0x86d955,'authoredAt':_0x5b3c68,'attributes':_0x5ebb26});}_addComment(_0xb398e1){let {threadId:_0x4d5cd4,content:_0x195e78,attributes:_0x4baf02,isFromAdapter:_0xb9d9dc}=_0xb398e1;const _0x18c955=this['getCommentThread'](_0xb398e1['threadId']);if(!_0x18c955)throw new _0x402d5c('commentsrepository-add-comment-to-missing-comment-thread',this);const _0xdd5691=this['_createNewComment'](_0xb398e1),{id:_0x2ee4d9}=_0xdd5691;if(_0x18c955['_add'](_0xdd5691),_0xb9d9dc||!this['adapter']||'function'!=typeof this['adapter']['addComment']||!_0x18c955['isSubmitted'])return Promise['resolve']();const _0x1d2642=this['context']['plugins']['get']('PendingActions'),{channelId:_0x32c234}=_0x18c955,_0x28065d=_0x1d2642['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return _0x4baf02||(_0x4baf02={}),this['adapter']['addComment']({'channelId':_0x32c234,'threadId':_0x4d5cd4,'commentId':_0x2ee4d9,'content':_0x195e78,'attributes':_0x4baf02})['then'](_0x3a2a46=>{_0x1d2642['remove'](_0x28065d),_0x3a2a46&&this['_updateComment']({'channelId':_0x32c234,'threadId':_0x4d5cd4,'commentId':_0x2ee4d9,'createdAt':_0x3a2a46['createdAt'],'isFromAdapter':!0x0});})['catch'](_0x3af585=>{throw console['error'](_0x3af585),new _0x402d5c('commentsrepository-add-comment-internal-error',this);});}_updateComment({threadId:_0x5e501a,commentId:_0x3fef77,content:_0x5ef6df,createdAt:_0x373378,attributes:_0x30c574,isFromAdapter:_0x54966b}){if(void 0x0!==_0x5ef6df&&('string'!=typeof _0x5ef6df||!_0x5ef6df['trim']()['length']))throw new _0x402d5c('commentsrepository-update-comment-invalid-content');const _0x4d0c20=this['getCommentThread'](_0x5e501a),_0x5db073=_0x4d0c20['getComment'](_0x3fef77);if(!_0x5db073)throw new _0x402d5c('commentsrepository-update-missing-comment',this);let _0x1640bf=!0x1;if(_0x5ef6df&&_0x5ef6df!==_0x5db073['content']&&(_0x5db073['isEditable']||_0x54966b)&&(_0x5db073['content']=_0x5ef6df,_0x1640bf=!0x0),_0x373378&&_0x373378!==_0x5db073['createdAt']&&(_0x5db073['createdAt']=_0x373378,_0x5db073['isExternal']||(_0x5db073['authoredAt']=_0x373378),_0x1640bf=!0x0),_0x30c574&&!_0x4472b0(_0x30c574,_0x5db073['attributes'])&&(_0x5db073['attributes']=_0x30c574,_0x1640bf=!0x0),!_0x1640bf)return Promise['resolve']();if(_0x4d0c20['fire']('commentUpdated'),_0x54966b||!this['adapter']||'function'!=typeof this['adapter']['updateComment'])return Promise['resolve']();const _0xb7a487=this['context']['plugins']['get']('PendingActions'),{channelId:_0x31f9e6}=this['getCommentThread'](_0x5db073['threadId']),_0x3964ab=_0xb7a487['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['updateComment']({'channelId':_0x31f9e6,'threadId':_0x5e501a,'commentId':_0x3fef77,'content':_0x5ef6df,'attributes':_0x30c574})['then'](()=>_0xb7a487['remove'](_0x3964ab))['catch'](_0x399407=>{throw console['error'](_0x399407),new _0x402d5c('commentsrepository-update-comment-internal-error',this);});}_removeComment({threadId:_0x35b12e,commentId:_0xe0c2af,isFromAdapter:_0x292f65}){const _0xce0fdb=this['getCommentThread'](_0x35b12e),_0x3a96f7=_0xce0fdb['getComment'](_0xe0c2af);if(!_0x3a96f7)throw new _0x402d5c('commentsrepository-remove-missing-comment',this);if(_0xce0fdb['_remove'](_0x3a96f7),_0x292f65||!this['adapter']||'function'!=typeof this['adapter']['removeComment'])return Promise['resolve']();const _0x1556bc=this['context']['plugins']['get']('PendingActions'),{channelId:_0x4d1794}=_0xce0fdb,_0x42a79b=_0x1556bc['add'](Et(this['context']['locale'],'PENDING_ACTION_COMMENT_THREAD'));return this['adapter']['removeComment']({'channelId':_0x4d1794,'threadId':_0x35b12e,'commentId':_0xe0c2af})['then'](()=>_0x1556bc['remove'](_0x42a79b))['catch'](_0x5b6f7a=>{throw console['error'](_0x5b6f7a),new _0x402d5c('commentsrepository-remove-comment-internal-error',this);});}},ri=class extends si{['channelId'];['id'];_isAttached;_isSubmitted;comments;_repository;constructor(_0x1be7fd,_0x49c010){super();const _0x5c745a=_0x49c010['isResolvable'];this['channelId']=_0x49c010['channelId'],this['id']=_0x49c010['id'],this['comments']=new _0x33b802(),this['_repository']=_0x1be7fd,this['_isAttached']=!0x1,this['_isSubmitted']=_0x49c010['isSubmitted'],this['set']('_hasTargetInContent',!0x0),this['bind']('isReadOnly')['to'](_0x1be7fd,'_permissions',_0x1be7fd,'_readOnlyChannels',()=>_0x1be7fd['isReadOnly'](this['channelId'])),this['bind']('isRemovable')['to'](_0x1be7fd,'_permissions',()=>_0x1be7fd['getPermissions'](this['channelId'])['admin']),this['bind']('canComment')['to'](_0x1be7fd,'_permissions',()=>{const _0x58371f=_0x1be7fd['getPermissions'](this['channelId']);return _0x58371f['write']||_0x58371f['admin'];}),this['bind']('isResolvable')['to'](_0x1be7fd,'_permissions',()=>_0x5c745a&&_0x1be7fd['getPermissions'](this['channelId'])['resolve']),this['set']('context',_0x49c010['context']),this['bind']('archivedAt')['to'](this,'resolvedAt',this,'unlinkedAt',(_0xaf1ad2,_0x30be7b)=>_0xaf1ad2?_0x30be7b?_0xaf1ad2<_0x30be7b?_0xaf1ad2:_0x30be7b:_0xaf1ad2:_0x30be7b),this['set']('unlinkedAt',_0x49c010['unlinkedAt']||null),this['set']('resolvedAt',_0x49c010['resolvedAt']||null),this['set']('resolvedBy',_0x49c010['resolvedBy']||null),this['bind']('isResolved')['to'](this,'resolvedAt',_0x5250b0=>!!_0x5250b0),this['set']('attributes',_0x49c010['attributes']||{});}get weight(){return Array['from'](this['comments'])['reduce']((_0x3a51f6,_0x59efa4)=>_0x3a51f6+_0x59efa4['weight'],0x0);}get length(){return this['comments']['length'];}get isAttached(){return this['_isAttached'];}get isSubmitted(){return this['_isSubmitted'];}submit(){const {channelId:_0x4c94a,id:_0x5c7f3e}=this;this['_repository']['fire'](ai('submitCommentThread',_0x4c94a),{'channelId':_0x4c94a,'threadId':_0x5c7f3e});}setUnlinkedAt(_0x5e5d4f){this['_update']({'unlinkedAt':_0x5e5d4f});}['resolve']({resolvedAt:_0x4db6c2=new Date(),resolvedBy:_0x49e10b='',isFromAdapter:_0x574fc6=!0x1}={}){const _0x100ec7=this['_repository']['context']['plugins']['get'](_0x552e83)['me'],{channelId:_0x4fbc44,id:_0x3ba2a3}=this;this['_repository']['fire'](ai('resolveCommentThread',_0x4fbc44),{'channelId':_0x4fbc44,'threadId':_0x3ba2a3,'resolvedAt':_0x4db6c2,'resolvedBy':_0x49e10b||_0x100ec7['id'],'isFromAdapter':_0x574fc6});}['reopen']({isFromAdapter:_0x463800=!0x1}={}){const {channelId:_0x39f078,id:_0x5ed5a9}=this;this['_repository']['fire'](ai('reopenCommentThread',_0x39f078),{'channelId':_0x39f078,'threadId':_0x5ed5a9,'isFromAdapter':_0x463800});}setContext(_0x130fcf){this['context']||this['_update']({'context':_0x130fcf});}setAttribute(_0x318aa8,_0x421581){const _0x5b907e=_0x2feb7e(this['attributes']);_0x3f4a33(_0x5b907e,_0x318aa8,_0x421581),this['_update']({'attributes':_0x5b907e});}removeAttribute(_0xc0d4f6){const _0x49ca80=_0x2feb7e(this['attributes']);_0x3ab25c(_0x49ca80,_0xc0d4f6),this['_update']({'attributes':_0x49ca80});}['remove']({isFromAdapter:_0x1018fb=!0x1}={}){const {channelId:_0x163d52,id:_0x52df8b}=this;this['_repository']['fire'](ai('removeCommentThread',_0x163d52),{'channelId':_0x163d52,'threadId':_0x52df8b,'isFromAdapter':_0x1018fb});}attachTo(_0x174052){return this['_repository']['_attachCommentThread']({'threadId':this['id'],'target':_0x174052});}addComment(_0x270de0){const {channelId:_0x254e89,id:_0x2b65b8}=this;this['_repository']['fire'](ai('addComment',_0x254e89,_0x2b65b8),Object['assign']({'channelId':_0x254e89,'threadId':_0x2b65b8},_0x270de0));}getComment(_0x276896){if('string'!=typeof _0x276896)throw new _0x402d5c('commentsrepository-get-comment-invalid-id',null,{'commentId':_0x276896});return this['comments']['get'](_0x276896);}toJSON(){return{'threadId':this['id'],'context':this['context'],'unlinkedAt':this['unlinkedAt'],'resolvedAt':this['resolvedAt'],'resolvedBy':this['resolvedBy']?this['resolvedBy']['id']:null,'archivedAt':this['archivedAt'],'comments':this['comments']['map'](_0x4c8a01=>_0x4c8a01['toJSON']()),'attributes':this['attributes']};}['_add'](_0x1d3f81){return this['listenTo'](_0x1d3f81,'change:authoredAt',()=>{const _0x4ba2fe=this['_findOptimalIndex'](_0x1d3f81),_0x19c229=this['comments'];_0x4ba2fe-0x1!=_0x19c229['getIndex'](_0x1d3f81)&&_0x4ba2fe+0x1!=_0x19c229['getIndex'](_0x1d3f81)&&(this['_remove'](_0x1d3f81),this['_add'](_0x1d3f81));}),this['comments']['add'](_0x1d3f81,this['_findOptimalIndex'](_0x1d3f81));}_update(_0x59a765){const {channelId:_0x3cce4b,id:_0x28562f}=this;this['_repository']['fire'](ai('updateCommentThread',_0x3cce4b),{..._0x59a765,'channelId':_0x3cce4b,'threadId':_0x28562f});}['_remove'](_0xdd45cb){return this['stopListening'](_0xdd45cb),_0xdd45cb['destroy'](),this['comments']['remove'](_0xdd45cb);}_findOptimalIndex(_0x141529){const _0x36027c=this['comments']['find'](_0xceb362=>new Date(_0xceb362['authoredAt'])['getTime']()>new Date(_0x141529['authoredAt'])['getTime']());return _0x36027c?this['comments']['getIndex'](_0x36027c):this['length'];}},hi=class extends ni{['id'];threadId;author;creator;createdAt;_repository;constructor(_0x3a66e2,_0x2a1c50){super();const _0x236779=_0x3a66e2['context']['plugins']['get'](_0x552e83)['me'],_0x97d71f=_0x3a66e2['getCommentThread'](_0x2a1c50['threadId']),_0xb57cee=0x0===_0x97d71f['comments']['length'],_0x29b7f6=_0x236779===_0x2a1c50['author'];this['id']=_0x2a1c50['id'],this['threadId']=_0x2a1c50['threadId'],this['author']=_0x2a1c50['author'],this['creator']=_0x2a1c50['creator'],this['set']('content',_0x2a1c50['content']),this['createdAt']=_0x2a1c50['createdAt']||new Date(),this['set']('authoredAt',_0x2a1c50['authoredAt']||new Date()),this['bind']('resolvedAt')['to'](_0x97d71f,'resolvedAt'),this['set']('attributes',_0x2a1c50['attributes']||{}),this['bind']('isEditable')['to'](_0x3a66e2,'_permissions',()=>{const _0x377844=_0x3a66e2['getPermissions'](_0x97d71f['channelId'])['write'],_0x514e65=_0x3a66e2['getPermissions'](_0x97d71f['channelId'])['modifyAll'];return _0x29b7f6&&_0x377844||!_0x29b7f6&&_0x514e65;}),this['bind']('isRemovable')['to'](_0x97d71f,'isRemovable',_0x3a66e2,'_permissions',_0x47d875=>{const _0x3035fb=_0x3a66e2['getPermissions'](_0x97d71f['channelId'])['write'],_0x475a64=_0x3a66e2['getPermissions'](_0x97d71f['channelId'])['modifyAll'];return _0x29b7f6&&_0x3035fb||_0x47d875&&_0xb57cee||!_0x29b7f6&&_0x475a64&&!_0xb57cee;}),this['bind']('isReadOnly')['to'](_0x97d71f,'isReadOnly'),this['_repository']=_0x3a66e2;}get isExternal(){return Boolean(this['attributes']&&this['attributes']['@external']);}get weight(){return Math['max'](function(_0x3d23aa){const _0x4ccbe1=document['createElement']('div');return _0x4ccbe1['innerHTML']=_0x3d23aa,_0x4ccbe1['textContent']['length'];}(this['content']),0xc8);}update(_0x3478ae){const {threadId:_0xdb5b66,id:_0x359207}=this;if(!this['_repository']['hasCommentThread'](_0xdb5b66))throw new _0x402d5c('commentsrepository-update-comment-missing-comment-thread',this);const {channelId:_0x4ddc9f}=this['_repository']['getCommentThread'](_0xdb5b66);this['_repository']['fire'](ai('updateComment',_0x4ddc9f,_0xdb5b66),{'channelId':_0x4ddc9f,'threadId':_0xdb5b66,'commentId':_0x359207,..._0x3478ae});}setAttribute(_0x55e5ff,_0x50407b){const _0x7b53d1=_0x2feb7e(this['attributes']);_0x3f4a33(_0x7b53d1,_0x55e5ff,_0x50407b),this['update']({'attributes':_0x7b53d1});}removeAttribute(_0x2dd9c2){const _0xd60a12=_0x2feb7e(this['attributes']);_0x3ab25c(_0xd60a12,_0x2dd9c2),this['update']({'attributes':_0xd60a12});}['remove'](_0x28bcba={}){if(!_0x28bcba['isFromAdapter']&&!this['isRemovable'])return;const {threadId:_0x2a3508,id:_0x5dace1}=this;if(!this['_repository']['hasCommentThread'](_0x2a3508))throw new _0x402d5c('commentsrepository-remove-comment-missing-comment-thread',this);const {channelId:_0x350a84}=this['_repository']['getCommentThread'](_0x2a3508);this['_repository']['fire'](ai('removeComment',_0x350a84,_0x2a3508),{'channelId':_0x350a84,'threadId':_0x2a3508,'commentId':_0x5dace1,..._0x28bcba});}toJSON(){return{'commentId':this['id'],'content':this['content'],'createdAt':this['createdAt'],'authorId':this['creator']['id'],'attributes':this['attributes']};}destroy(){this['stopListening']();}};function ai(_0x4efb5e,..._0x110824){for(const _0x621ad1 of _0x110824)void 0x0!==_0x621ad1&&(_0x4efb5e+=':'+String(_0x621ad1));return _0x4efb5e;}var ci=class extends _0x56f817{constructor(_0x28ac24){super(_0x28ac24),this['set']('hasContent',!0x1);}['refresh'](){const _0x499b25=this['editor']['model']['document']['selection'];this['isEnabled']=!0x0,this['hasContent']=!0x1;for(const _0x34a997 of _0x499b25['getRanges']())if(this['_hasContent'](_0x34a997))return void(this['hasContent']=!0x0);}execute({threadId:_0x3abbd5=_0x295c58(),ranges:_0x282dd5,comment:_0x3aa62a}={}){const _0x13137f=this['editor']['model'],_0x1dea56=_0x282dd5??Array['from'](_0x13137f['document']['selection']['getRanges']()),_0xa4d9d4=[];for(const _0x43e999 of _0x1dea56)this['_hasContent'](_0x43e999)&&_0xa4d9d4['push'](this['_trimToContent'](_0x43e999));if(!_0xa4d9d4['length'])throw new _0x402d5c('addcommentthreadcommand-incorrect-ranges',null);_0x3aa62a&&this['_createCommentThread'](_0x3abbd5,_0x3aa62a),this['_createMarkersFromRanges'](_0x3abbd5,_0xa4d9d4,!!_0x3aa62a);}_createMarkersFromRanges(_0x6ecf67,_0xdd7798,_0x57c99c){this['editor']['model']['change'](_0x8aedcd=>{for(const _0xdeecbb of _0xdd7798){const _0x420f0c='comment:'+_0x6ecf67+':'+_0x295c58()['substr'](0x1,0x5);_0x8aedcd['addMarker'](_0x420f0c,{'range':_0xdeecbb,'usingOperation':_0x57c99c,'affectsData':_0x57c99c});}});}_createCommentThread(_0x207a8f,_0x39892c){const _0x3b47cd=this['editor']['plugins']['get']('CommentsRepository'),_0x380051=this['editor']['config']['get']('collaboration.channelId'),_0x5c903d=this['editor']['plugins']['get']('Users')['me'];if(!_0x5c903d)throw new _0x402d5c('addcommentthreadcommand-user-not-found',null);_0x3b47cd['addCommentThread']({'threadId':_0x207a8f,'channelId':_0x380051,'comments':[{'authorId':_0x5c903d['id'],'content':_0x39892c,'createdAt':new Date(),'attributes':{}}]});}_hasContent(_0xe5b7e3){for(const _0x4c66b8 of _0xe5b7e3['getItems']())if(this['_itemIsContent'](_0x4c66b8))return!0x0;return!0x1;}_itemIsContent(_0x332be4){return _0x332be4['is']('$textProxy')||this['editor']['model']['schema']['isObject'](_0x332be4)&&!_0x332be4['is']('element','tableCell');}_trimToContent(_0x175dd2){const _0x16a92b=_0x535937=>!this['_itemIsContent'](_0x535937['item']),_0x8971d7=_0x175dd2['start']['getLastMatchingPosition'](_0x16a92b),_0x437122=_0x175dd2['end']['getLastMatchingPosition'](_0x16a92b,{'direction':'backward'});return this['editor']['model']['createRange'](_0x8971d7,_0x437122);}},di=class extends _0x2bcbce{_dataCollectors;_editorAnnotations;static get requires(){return[ti];}static get['pluginName'](){return'EditorAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5d5ef0){super(_0x5d5ef0),this['_dataCollectors']=new Set(),this['_editorAnnotations']=new Set();}init(){const _0x668bb0=this['editor'],_0x460f7f=_0x668bb0['model']['document']['selection'],_0x577fd0=_0x420187(()=>this['refreshSelectedViews'](),0xa);_0x460f7f['on']('change:range',(_0x46267a,_0x197054)=>{_0x197054['directChange']&&(_0x577fd0['cancel'](),this['refreshSelectedViews']());}),this['listenTo'](_0x668bb0['editing']['view']['document'],'change:isFocused',(_0x260795,_0x38b873,_0x2588f8)=>{_0x2588f8&&_0x577fd0();}),this['listenTo'](_0x668bb0['ui']['focusTracker'],'change:isFocused',(_0x1d54b9,_0x3396c9,_0x366a04)=>{_0x366a04||this['fire']('blur',{'isAnnotationTracked':_0x2b889e=>this['_editorAnnotationsData']['has'](_0x2b889e['innerView'])});}),this['listenTo'](this['editor']['ui'],'update',()=>this['fire']('uiUpdate'));}registerAnnotation(_0x543574){if(this['_editorAnnotations']['has'](_0x543574['view']))return;this['_editorAnnotations']['add'](_0x543574['view']),this['editor']['ui']['focusTracker']['add'](_0x543574['view']['element']);const _0x3755a9=this['editor']['plugins']['get'](ti);this['listenTo'](_0x3755a9['collection'],'remove',(_0x339243,_0x34dfc3)=>{this['editor']['ui']['focusTracker']['remove'](_0x34dfc3['view']['element']),this['_editorAnnotations']['delete'](_0x34dfc3['view']);});}hasDomSelection(){return this['editor']['editing']['view']['hasDomSelection'];}addSourceCollector(_0x16ddb8){if('function'!=typeof _0x16ddb8)throw new _0x402d5c('editorannotations-invalid-source-callback');this['_dataCollectors']['add'](_0x16ddb8);}refreshSelectedViews(){this['fire']('refresh');}getOrderedSelectedAnnotations({activeAnnotation:_0x2475ce,annotations:_0x288f2b}){const _0x29960d=[],_0x57eb66=this['editor']['model']['document']['selection'],_0x4039a8=Array['from'](_0x57eb66['getRanges']());for(const [_0x3698d9,_0x3a5a08]of this['_editorAnnotationsData']){const _0x2503e1=_0x4b558f(_0x3a5a08),_0x3da9dc=_0x288f2b['getByInnerView'](_0x3698d9);_0x2503e1&&_0x3da9dc&&_0x29960d['push']({'annotation':_0x3da9dc,'range':_0x2503e1});}function _0x4b558f(_0x1c149d){for(const _0x59e049 of _0x1c149d)for(const _0x5a1246 of _0x4039a8)if(_0x59e049['containsRange'](_0x5a1246,!_0x57eb66['isCollapsed']))return _0x59e049;return null;}const _0x15b8ed=new Map(Array['from'](_0x288f2b,(_0x1e7029,_0x529a59)=>[_0x1e7029,_0x529a59]));return _0x29960d['sort']((_0x58241d,_0x4646d5)=>{const _0x422314=_0x58241d['range'],_0x15a056=_0x4646d5['range'];if(!_0x422314['isEqual'](_0x15a056)){if(_0x422314['containsRange'](_0x15a056,!0x0))return 0x1;if(_0x15a056['containsRange'](_0x422314,!0x0))return-0x1;}return _0x58241d['annotation']==_0x2475ce?-0x1:_0x4646d5['annotation']==_0x2475ce?0x1:(_0x15b8ed['get'](_0x58241d['annotation'])??0x0)-(_0x15b8ed['get'](_0x4646d5['annotation'])??0x0);})['map'](_0x1c2ebe=>_0x1c2ebe['annotation']);}get _editorAnnotationsData(){const _0x1724de=new Map();for(const _0x4f8e64 of Array['from'](this['_dataCollectors']))for(const [_0x5b1812,_0x5a607f]of _0x4f8e64())_0x1724de['set'](_0x5b1812,_0x5a607f);return _0x1724de;}},li=class extends _0x2bcbce{afterInit(){const _0x21efce=this['editor'];_0x21efce['plugins']['has']('RestrictedEditingModeEditing')&&_0x21efce['plugins']['get']('RestrictedEditingModeEditing')['enableCommand']('addCommentThread');}},mi=class extends _0x2bcbce{constructor(_0x1f3714){super(_0x1f3714),this['editor']['config']['define']('importWord.formatting.comments','basic');}afterInit(){const _0x388c07=this['editor'],_0x78ef2d=_0x388c07['commands']['get']('importWord'),_0x15797d=_0x388c07['plugins']['get'](_0x552e83);_0x78ef2d&&(_0x78ef2d['on']('execute',(_0x4714b1,[,_0x1dba2c])=>{_0x1dba2c['collaboration_features']={'comments':!0x0,'user_id':_0x15797d['me']['id']};},{'priority':_0x31e8a7['high']+0xa}),this['listenTo'](_0x78ef2d,'dataInsert',this['_handleImportedData']));}_handleImportedData(_0x1aa1b1,_0x4d363a){const {comment_threads:_0x1b9a83}=_0x4d363a;_0x1b9a83&&_0x1b9a83['forEach'](({thread_id:_0x2a8637,comments:_0x1fd376,is_resolved:_0x1a4fb0})=>{const _0x2c7f8f=new Date(),_0x26af33=_0x1fd376['map'](({author:_0x4a430e,content:_0xf8d7f6,created_at:_0x3f973a})=>({'content':_0xf8d7f6,'authorId':this['editor']['plugins']['get'](_0x552e83)['me']['id'],'createdAt':_0x2c7f8f,'attributes':{'@external':{'authorName':_0x4a430e,'createdAt':_0x3f973a?new Date(_0x3f973a):new Date(),'source':'importWord'}}})),_0x73c4d=this['editor']['config']['get']('collaboration.channelId');this['editor']['plugins']['get'](oi)['addCommentThread']({'channelId':_0x73c4d,'threadId':_0x2a8637,'comments':_0x26af33,'resolvedAt':_0x1a4fb0?_0x2c7f8f:null});});}},ui=class extends _0x2bcbce{constructor(_0x1ad5e3){super(_0x1ad5e3),this['editor']['config']['define']('comments.copyMarkers','default');}static get requires(){return[pt,wt];}afterInit(){const _0x217432=this['editor']['plugins']['get']('ClipboardPipeline');this['_registerMarkerInClipboardPipeline'](),this['listenTo'](_0x217432,'contentInsertion',(_0x445332,_0x902d73)=>this['_removeMarkersWithoutThreads'](_0x902d73['content']['markers']),{'priority':'highest'});}_removeMarkersWithoutThreads(_0x324f88){if(!this['editor']['plugins']['has']('CommentsRepository'))return _0x324f88;const _0x52bb86=this['editor']['plugins']['get']('CommentsRepository');for(const _0x572838 of _0x324f88['keys']()){const [_0x3f817c,_0x2bef17]=_0x572838['split'](':');'comment'!=_0x3f817c||_0x52bb86['hasCommentThread'](_0x2bef17)||_0x324f88['delete'](_0x572838);}return _0x324f88;}_registerMarkerInClipboardPipeline(){const _0x4fde18=this['editor']['plugins']['get']('ClipboardMarkersUtils'),_0xe8b9db=this['_mapCommentsCopyConfigToRegisterConfiguration'](this['editor']['config']['get']('comments.copyMarkers'));_0xe8b9db&&_0x4fde18['_registerMarkerToCopy']('comment',_0xe8b9db);}_mapCommentsCopyConfigToRegisterConfiguration(_0x10f239){switch(_0x10f239){case'always':return{'allowedActions':'all','copyPartiallySelected':!0x1,'duplicateOnPaste':!0x0};case'default':return{'allowedActions':['cut','dragstart'],'copyPartiallySelected':!0x1,'duplicateOnPaste':!0x1};default:return null;}}};function fi(_0x4e2950){const _0x300b53=_0x4e2950['split'](':');return{'group':_0x300b53[0x0],'id':_0x300b53[0x1],'part':_0x300b53[0x2]};}var pi=class extends _0x2bcbce{init(){this['overrideMarkerConverters'](),this['overrideHorizontalRuleConverter'](),this['overrideImageInlineConverter'](),this['overrideMediaEmbedConverter']();}overrideMarkerConverters(){this['editor']['conversion']['for']('dataDowncast')['markerToHighlight']({'model':'comment','view':(_0x12a500,_0x4de831)=>{if(!_0x4de831['options']['showCommentHighlights'])return null;if(_0x4de831['options']['ignoreResolvedComments']){const {id:_0x4990bd}=fi(_0x12a500['markerName']);if(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x4990bd)?.['isResolved']&&_0x12a500['item'])return _0x4de831['consumable']['consume'](_0x12a500['item'],'addMarker:'+_0x12a500['markerName']),_0x4de831['consumable']['consume'](_0x12a500['item'],'removeMarker:'+_0x12a500['markerName']),null;}return{'classes':['ck-comment-marker']};}}),this['editor']['conversion']['for']('dataDowncast')['add'](_0x4cc66f=>{_0x4cc66f['on']('addMarker:comment',(_0x11defc,_0x1e1fd2,_0x1c3365)=>{if(!_0x1c3365['options']['showCommentHighlights'])return;const _0x11cf61=_0x1e1fd2['item'];if(!_0x11cf61)return;const _0x3ff7e3=_0x1c3365['mapper']['toViewElement'](_0x11cf61);this['editor']['model']['schema']['isObject'](_0x11cf61)&&_0x3ff7e3&&!_0x3ff7e3['getCustomProperty']('widget')&&_0x3ff7e3['is']('containerElement')&&Ct(_0x3ff7e3,_0x1c3365['writer']);},{'priority':'high'});});}overrideHorizontalRuleConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'horizontalLine','view':(_0x5a88c4,{writer:_0xd81b47,options:_0x5a8b34})=>{if(!_0x5a8b34['showCommentHighlights'])return null;const _0x173b6b=_0xd81b47['createContainerElement']('div'),_0x40965e=_0xd81b47['createEmptyElement']('hr');return _0xd81b47['addClass']('ck-horizontal-line',_0x173b6b),_0xd81b47['insert'](_0xd81b47['createPositionAt'](_0x173b6b,0x0),_0x40965e),_0x173b6b;},'converterPriority':'high'});}overrideImageInlineConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToStructure']({'model':'imageInline','view':(_0x466884,{writer:_0x130aaf,options:_0x2a1e8e})=>{if(!_0x2a1e8e['showCommentHighlights'])return null;const _0xef4706=_0x130aaf['createContainerElement']('span'),_0x4936d8=_0x130aaf['createEmptyElement']('img');return _0x130aaf['addClass']('image-inline',_0xef4706),_0x130aaf['insert'](_0x130aaf['createPositionAt'](_0xef4706,0x0),_0x4936d8),_0xef4706;},'converterPriority':'high'});}overrideMediaEmbedConverter(){this['editor']['conversion']['for']('dataDowncast')['elementToElement']({'model':'media','view':(_0x5bf843,{writer:_0x5c8fae,options:_0x63f842})=>{if(_0x63f842['showCommentHighlights'])return _0x5c8fae['createEmptyElement']('div');},'converterPriority':'high'}),this['editor']['data']['downcastDispatcher']['on']('attribute:url:media',(_0xbe12f,_0x58d88c,_0x4e8e98)=>{_0x4e8e98['options']['showCommentHighlights']&&_0xbe12f['stop']();},{'priority':'high'});}},wi=class extends _0x2bcbce{static get requires(){return[oi,di,_0x552e83,li,mi,ui,pi];}static get['pluginName'](){return'CommentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1869c4){super(_0x1869c4),this['set']('isThreadsLoadingPaused',!0x0),_0x1869c4['data']['once']('ready',()=>this['isThreadsLoadingPaused']=!0x1),this['set']('activeMarker',null),this['on']('change:activeMarker',(_0x2a3e88,_0x212b2a,_0x1c5da9,_0x1e7023)=>{const _0x5ce96d=_0x1869c4['plugins']['get'](oi),_0x4e086c=_0x1c5da9?fi(_0x1c5da9)['id']:null;_0x1869c4['model']['change'](()=>{if(_0x4e086c){const _0x4026a4=this['getAllMarkersForId'](_0x4e086c);for(const _0x4778d5 of _0x4026a4)_0x1869c4['editing']['reconvertMarker'](_0x4778d5);}if(_0x1e7023){const {id:_0x177e03}=fi(_0x1e7023),_0x434219=_0x5ce96d['getCommentThread'](_0x177e03);if(_0x434219&&_0x434219['unlinkedAt'])return;if(_0x434219&&!_0x434219['isAttached'])return;const _0x19d570=this['getAllMarkersForId'](_0x177e03);for(const _0x399af1 of _0x19d570)_0x1869c4['editing']['reconvertMarker'](_0x399af1);}}),_0x4e086c&&this['scrollToThreadMarker'](_0x4e086c);}),this['_initAriaMarkerChangeAnnouncements']();}init(){const _0xb731f5=this['editor'],_0xad497c=_0xb731f5['plugins']['get'](oi),_0x3aa8ab=_0xb731f5['config']['get']('collaboration.channelId'),_0x4fe99e=_0xad497c['getCommentThreads']()['filter'](_0x2b702f=>_0x2b702f['channelId']!==_0x3aa8ab);_0xb731f5['commands']['add']('addCommentThread',new ci(_0xb731f5)),this['listenTo'](_0xb731f5,'change:isReadOnly',(_0x4d274c,_0x232b5b,_0xfd3509)=>{_0xad497c['switchReadOnly'](_0xfd3509,_0xb731f5['config']['get']('collaboration.channelId'));}),this['listenTo'](_0xad497c,gi('addCommentThread',_0x3aa8ab),(_0x292b61,{threadId:_0xeb2b5e})=>{this['editor']['plugins']['get'](oi)['getCommentThread'](_0xeb2b5e)?.['unlinkedAt']&&this['_attachArchivedThread'](_0xeb2b5e);}),this['listenTo'](_0xad497c,gi('removeCommentThread',_0x3aa8ab),(_0x4da734,{threadId:_0x13dc67})=>{_0xb731f5['model']['enqueueChange']({'isUndoable':!0x1},_0x40d355=>{const _0xb3615f=this['getAllMarkersForId'](_0x13dc67);for(const _0x2b10dd of _0xb3615f)_0x40d355['removeMarker'](_0x2b10dd);});}),this['listenTo'](_0xad497c,gi('resolveCommentThread',_0x3aa8ab),(_0xf5a47b,{threadId:_0x26dbdf})=>{this['_reconvertMarkers'](_0x26dbdf);const _0x4b7354=this['editor']['plugins']['get'](ti);(this['editor']['editing']['view']['hasDomSelection']||_0x4b7354['collection']['isFocused'])&&(this['editor']['plugins']['get'](oi)['getCommentThread'](_0x26dbdf)['unlinkedAt']||this['editor']['editing']['view']['focus']());},{'priority':'low'}),this['listenTo'](_0xad497c,gi('reopenCommentThread',_0x3aa8ab),(_0x4b1d2e,{threadId:_0x817571})=>{this['_reconvertMarkers'](_0x817571);},{'priority':'low'}),this['listenTo'](_0xad497c,gi('addComment',_0x3aa8ab),(_0x6d6c69,{threadId:_0x12a261,isFromAdapter:_0x297bad})=>{const _0x2e7276=this['getAllMarkersForId'](_0x12a261);!_0x297bad&&0x0!=_0x2e7276['length']&&_0xad497c['hasCommentThread'](_0x12a261)&&0x1===_0xad497c['getCommentThread'](_0x12a261)['length']&&_0xb731f5['model']['enqueueChange']({'isUndoable':!0x1},_0x3e06e6=>{for(const _0x3986d7 of _0x2e7276)_0x3e06e6['updateMarker'](_0x3986d7,{'usingOperation':!0x0,'affectsData':!0x0});});},{'priority':'low'}),this['_initializeMarkerConverters'](),this['_handleMarkerAddAndRemove'](),this['_handleInitialThreads'](_0x4fe99e);}afterInit(){!async function(_0x19bec1){const _0x79cc07='mr4z2yakM3x0phtD7jBw1T6qRfeUuZcOLNKVgQSPE9iGIHoXlJW8YsCb5AndFv',_0x2ea6dc=0x79410,_0x306707={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x326680(_0x95676a){const _0x4bb334=new window['Promise'](_0x20c7df=>{_0x95676a['once']('ready',_0x20c7df);}),_0x3a3b4f=window['Date']['now'](),_0x528102=_0x95676a['config']['get']('licenseKey');async function _0x2eaa04(){let _0x2f4d2e,_0x5223a9=null,_0x427823=null;try{return'GPL'==_0x528102?'NotAllowed':(_0x2f4d2e=_0x7a769f(),_0x2f4d2e?(_0x2f4d2e['usageEndpoint']&&(_0x427823=_0x6d9c8b(_0x2f4d2e['usageEndpoint'],_0x2f4d2e['jti'])),await _0x5f2d06()?_0x372ac3()?_0x1ebad1()?'Expired':_0x447f0c()?('evaluation'==_0x2f4d2e['licenseType']&&(_0x5223a9=_0x3f2c50('EvaluationLimit')),await _0x49229c()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x1ebad1(){const _0x55c568=['evaluation','trial']['includes'](_0x2f4d2e['licenseType'])?_0x3a3b4f/0x3e8:0xe10*_0x2ea6dc;return _0x2f4d2e['exp']<_0x55c568;}function _0x372ac3(){const _0x5e7deb=_0x2f4d2e['features'];if(!_0x5e7deb)return!0x1;if(_0x5e7deb['includes']('*'))return!0x0;if(_0x5e7deb['includes']('CMT'))return!0x0;if(_0x5e7deb['includes']('TRILIUM')&&_0x2b215d())return!0x0;if(_0x5e7deb['includes']('RCMT')){if(_0x58fb36())return!0x0;if(_0x355856()||_0x48e52a())return!0x0;}return!0x1;}function _0x447f0c(){const _0x23ca3c=_0x2f4d2e['licensedHosts'];if(!_0x23ca3c||0x0==_0x23ca3c['length'])return!0x0;const {hostname:_0xb8e42b}=new URL(window['location']['href']);if(_0x23ca3c['includes'](_0xb8e42b))return!0x0;const _0x5b0229=_0xb8e42b['split']('.');return _0x23ca3c['filter'](_0x3e7e29=>_0x3e7e29['includes']('*'))['map'](_0x4f13e8=>_0x4f13e8['split']('.'))['filter'](_0x157232=>_0x157232['length']<=_0x5b0229['length'])['map'](_0x2c32f8=>Array(_0x5b0229['length']-_0x2c32f8['length'])['fill']('*'===_0x2c32f8[0x0]?'*':'')['concat'](_0x2c32f8))['some'](_0x4cd2e2=>_0x5b0229['every']((_0x3b28da,_0x2e2462)=>_0x4cd2e2[_0x2e2462]===_0x3b28da||'*'===_0x4cd2e2[_0x2e2462]));}function _0x49229c(){return _0x5223a9&&_0x427823?new window['Promise']((_0xfa2747,_0x4bb85a)=>{_0x5223a9['then'](_0xfa2747,_0x4bb85a),_0x427823['then'](_0xa99f48=>{'Valid'!=_0xa99f48&&_0xfa2747(_0xa99f48);},_0x4bb85a);}):_0x5223a9||_0x427823||'Valid';}}function _0x6d9c8b(_0x54e7be,_0x40cb7d){return new window['Promise'](_0x17de72=>{if(_0x321d64())return _0x17de72('Valid');_0x53d650(),_0x95676a['decorate']('_sendUsageRequest');let _0xc9d7c7=!0x1;const _0x241b75=_0x295c58();function _0x59a0a3(_0x34548f){return!!_0x34548f&&('object'==typeof _0x34548f||'function'==typeof _0x34548f)&&'function'==typeof _0x34548f['then']&&'function'==typeof _0x34548f['catch'];}function _0x82c8e1(_0x3f179b){_0x9fb176(_0x3f179b)['then'](_0x44226b=>_0x44226b&&'ok'==_0x44226b['status']?_0x54d7ab(_0x328a6c(_0x241b75+_0x40cb7d))!=_0x44226b['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x111055=>(_0x418f53(),_0x111055),()=>{const _0x41fc81=_0x2eec6e();return null==_0x41fc81?(_0x418f53(),'Valid'):_0x3a3b4f-_0x41fc81>0x240c8400?'UsageLimit':'Valid';})['then'](_0x17de72)['catch'](()=>{_0x17de72('UsageLimit');});const _0x3f42bc=0x36ee80;function _0x418f53(){const _0x3e82b5='llct-'+_0x54d7ab(_0x328a6c(_0x54e7be)),_0x3c04ee=_0x326476(_0x54d7ab(window['Math']['ceil'](_0x3a3b4f/_0x3f42bc)));window['localStorage']['setItem'](_0x3e82b5,_0x3c04ee);}function _0x2eec6e(){const _0x36d238='llct-'+_0x54d7ab(_0x328a6c(_0x54e7be)),_0x5ee301=window['localStorage']['getItem'](_0x36d238);return _0x5ee301?window['parseInt'](_0x326476(_0x5ee301),0x10)*_0x3f42bc:null;}function _0x9fb176(_0x5090fc){return new window['Promise']((_0x23e65b,_0x200bcd)=>{_0x5090fc['then'](_0x23e65b,_0x200bcd),window['setTimeout'](_0x200bcd,0x1d4c0);});}}_0x95676a['on']('_sendUsageRequest',(_0x2cd320,_0x4d3863)=>{if(_0x4d3863[0x0]!=_0x54e7be)return _0x17de72('UsageLimit');_0x4d3863[0x1]={..._0x4d3863[0x1],'requestId':_0x241b75};},{'priority':'high'}),_0x95676a['on']('_sendUsageRequest',_0x11469c=>{_0x59a0a3(_0x11469c['return'])&&(_0xc9d7c7=!0x0,_0x82c8e1(_0x11469c['return']));},{'priority':'low'}),_0x4bb334['then'](()=>{_0xc9d7c7||_0x17de72('UsageLimit');});});function _0x321d64(){return'auto'==_0x95676a['editing']['view']['_overlayModeHint'];}function _0x53d650(){_0x95676a['editing']['view']['_overlayModeHint']='auto';}}function _0x3f2c50(_0x445fc7){const _0x416576=[new window['Promise'](_0x4c85da=>setTimeout(_0x4c85da,0x93ecc)),_0x4bb334['then'](()=>new window['Promise'](_0x54b302=>{let _0x176610=0x0;_0x95676a['model']['on']('applyOperation',(_0x3d4b77,_0x463350)=>{_0x463350[0x0]['isDocumentOperation']&&_0x176610++,0x5e8==_0x176610&&(_0x54b302(),_0x3d4b77['off']());});}))];return window['Promise']['race'](_0x416576)['then'](()=>_0x445fc7);}async function _0x145eb4(){await _0x4bb334,_0x95676a['model']['change']=_0x1f3206,_0x95676a['model']['enqueueChange']=_0x1f3206,_0x95676a['enableReadOnlyMode']('model');}function _0x2b215d(){return window['glob']&&window['glob']['triliumVersion'];}function _0x58fb36(){return _0xc1a568('WebSocketGateway')&&'connected'==_0x4a20c5('WebSocketGateway')['state'];}function _0x355856(){return _0xc1a568('RevisionViewerIntegration');}function _0x48e52a(){return _0xc1a568('TrackChangesDataGetter');}function _0x8d23d8(_0x1c681c){const _0x27059a=_0x2f9851();_0x95676a[_0x27059a]='commentsLicenseKey'+_0x1c681c,'Valid'!=_0x1c681c&&_0x145eb4();}function _0x2f9851(){const _0x35c4c0=window['String'](window['performance']['now']())['replace']('.','');let _0x379326='m';for(let _0x30779e=0x0;_0x30779e<_0x35c4c0['length'];_0x30779e+=0x2){let _0x33c94f=window['parseInt'](_0x35c4c0['substring'](_0x30779e,_0x30779e+0x2));_0x33c94f>=0x3e&&(_0x33c94f-=0x3e),_0x379326+=_0x79cc07[_0x33c94f];}return _0x379326;}function _0x7a769f(){const _0xb1de1a=_0x528102['split']('.');if(0x3!=_0xb1de1a['length'])return null;return _0x480293(_0xb1de1a[0x1]);function _0x480293(_0x3760f3){const _0x297378=_0x259846(_0x3760f3);return _0x297378&&_0x269489()?_0x297378:null;function _0x269489(){const _0x141c9b=_0x297378['jti'],_0xbb4604=window['parseInt'](_0x141c9b['substring'](_0x141c9b['length']-0x8),0x10),_0x1db625={..._0x297378,'jti':_0x141c9b['substring'](0x0,_0x141c9b['length']-0x8)};return delete _0x1db625['vc'],_0x328a6c(_0x1db625)==_0xbb4604;}}}async function _0x5f2d06(){let _0x451e6d=!0x0;try{const [_0x3f6481,_0xcff8b9,_0xddc4ff]=_0x528102['split']('.');return _0x1dea80(_0x3f6481),await _0x5759d6(_0x3f6481,_0xcff8b9,_0xddc4ff),_0x451e6d;}catch{return!0x1;}function _0x1dea80(_0x197bd8){const _0x574123=_0x259846(_0x197bd8);_0x574123&&'ES256'==_0x574123['alg']||(_0x451e6d=!0x1);}async function _0x5759d6(_0xd2b575,_0x2b0cfa,_0x5b9f8f){const _0x34aad3=window['Uint8Array']['from'](_0x1f2f30(_0x5b9f8f),_0x284c60=>_0x284c60['charCodeAt'](0x0)),_0x4025f5=new window['TextEncoder']()['encode'](_0xd2b575+'.'+_0x2b0cfa),_0x147fb1=window['crypto']['subtle'];if(!_0x147fb1)return;const _0x4e3523=await _0x147fb1['importKey']('jwk',_0x306707,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x147fb1['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4e3523,_0x34aad3,_0x4025f5)||(_0x451e6d=!0x1);}}function _0x259846(_0x35c37a){return _0x35c37a['startsWith']('ey')?JSON['parse'](_0x1f2f30(_0x35c37a)):null;}function _0x1f2f30(_0x1b3a8f){return window['atob'](_0x1b3a8f['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x328a6c(_0x579d60){let _0x356997=0x1505;function _0x30a8b8(_0x7d653a){for(let _0x62165b=0x0;_0x62165b<_0x7d653a['length'];_0x62165b++){const _0x4b6d32=_0x7d653a['charCodeAt'](_0x62165b);_0x356997=(_0x356997<<0x5)+_0x356997+_0x4b6d32,_0x356997&=_0x356997;}}function _0x2136f9(_0x261601){Array['isArray'](_0x261601)?_0x261601['forEach'](_0x2136f9):_0x261601&&'object'==typeof _0x261601?Object['entries'](_0x261601)['sort']()['forEach'](([_0xa4cd26,_0x28ce61])=>{_0x30a8b8(_0xa4cd26),_0x2136f9(_0x28ce61);}):_0x30a8b8(window['String'](_0x261601));}return _0x2136f9(_0x579d60),_0x356997>>>0x0;}function _0x54d7ab(_0x7fc3db){return _0x7fc3db['toString'](0x10)['padStart'](0x8,'0');}function _0x326476(_0x1e24fc){return _0x1e24fc['split']('')['reverse']()['join']('');}function _0xc1a568(_0x13cc73){return _0x95676a['plugins']['has'](_0x13cc73);}function _0x4a20c5(_0xdebc0f){return _0x95676a['plugins']['get'](_0xdebc0f);}function _0x1f3206(){}_0x8d23d8(await _0x2eaa04());}_0x326680(_0x19bec1['editor']);}(this);}destroy(){const _0x463873=this['editor']['plugins']['get'](oi),_0x19818d=this['editor']['config']['get']('collaboration.channelId');for(const _0x17a9bb of _0x463873['getCommentThreads']({'channelId':_0x19818d}))_0x463873['_detachCommentThread'](_0x17a9bb['id']),_0x463873['_threads']['delete'](_0x17a9bb['id']);super['destroy']();}['hasMarkerForId'](_0x183ebd){return this['getAllMarkersForId'](_0x183ebd)['length']>0x0;}getAllMarkersForId(_0x4ae5f2){const _0x464c99=[];for(const _0x4fccf8 of this['editor']['model']['markers'])_0x4fccf8['name']['startsWith']('comment:'+_0x4ae5f2)&&_0x464c99['push'](_0x4fccf8);return _0x464c99;}['scrollToThreadMarker'](_0x167018){setTimeout(()=>{const _0x154d21=this['_getTargetForId'](_0x167018);_0x154d21&&this['activeMarker']&&fi(this['activeMarker'])['id']===_0x167018&&_0x5de251({'target':_0x154d21[0x0],'viewportOffset':0x64,'alignToTop':!0x0});},0x32);}_reconvertMarkers(_0x13a652){this['editor']['model']['change'](()=>{for(const _0x20888a of this['getAllMarkersForId'](_0x13a652))this['editor']['editing']['reconvertMarker'](_0x20888a);});}_attachArchivedThread(_0x38d1eb){const _0x3ea14f=this['editor']['plugins']['get'](oi),_0xf53602=this['editor']['plugins']['get'](di),_0x1573a7=_0x3ea14f['getCommentThread'](_0x38d1eb);if(!_0x1573a7['isAttached']){const _0x5c13af=_0x1573a7['attachTo'](()=>this['_getTargetForId'](_0x1573a7['id']));_0xf53602['registerAnnotation'](_0x5c13af),_0x1573a7['_hasTargetInContent']=!0x1;}}_initializeMarkerConverters(){const _0x584a29=this['editor'],_0x363c35=_0x584a29['plugins']['get'](_0x552e83);_0x584a29['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'comment','view':(_0x4bb011,_0x34b566)=>{const {id:_0x339791}=fi(_0x4bb011['markerName']),_0x28e89b=_0x584a29['plugins']['get'](oi)['getCommentThread'](_0x339791),_0x24e4a1=this['activeMarker']&&fi(this['activeMarker'])['id']===_0x339791;let _0x3e8596;if(_0x28e89b&&_0x28e89b['isResolved']&&!_0x24e4a1&&_0x4bb011['item'])return _0x34b566['consumable']['consume'](_0x4bb011['item'],'addMarker:'+_0x4bb011['markerName']),_0x34b566['consumable']['consume'](_0x4bb011['item'],'removeMarker:'+_0x4bb011['markerName']),null;const _0x3d0cbf=['ck-comment-marker'];return _0x24e4a1&&_0x3d0cbf['push']('ck-comment-marker--active'),_0x3e8596=_0x28e89b?.['length']?_0x28e89b['comments']['first']['author']['id']:_0x363c35['me']['id'],{'classes':_0x3d0cbf,'attributes':{'data-comment':_0x339791,'data-author-id':_0x3e8596}};}}),_0x584a29['conversion']['for']('dataDowncast')['markerToData']({'model':'comment','view':(_0x10e86a,{options:_0x1f37d4})=>{if(_0x1f37d4['showCommentHighlights'])return null;const _0x61a8e2=_0x584a29['plugins']['get'](oi),_0x42b80e=_0x584a29['model']['markers']['get'](_0x10e86a),{id:_0x56d529,part:_0xcb2cc0}=fi(_0x10e86a);return _0x42b80e&&!_0x42b80e['affectsData']||_0x1f37d4['ignoreResolvedComments']&&_0x61a8e2['getCommentThread'](_0x56d529)?.['isResolved']?null:{'group':'comment','name':_0xcb2cc0?_0x56d529+':'+_0xcb2cc0:_0x56d529};}}),_0x584a29['conversion']['for']('upcast')['elementToElement']({'view':{'name':'comment','attributes':{'id':/^\w/}},'model':(_0x4835b7,{writer:_0x429d9e})=>_0x429d9e['createElement']('$marker',{'data-name':'comment:'+_0x4835b7['getAttribute']('id')})}),_0x584a29['conversion']['for']('upcast')['dataToMarker']({'view':'comment'});}['_handleMarkerAddAndRemove'](){const _0x2d6a7e=this['editor'],_0x245b60=_0x2d6a7e['plugins']['get'](oi),_0x3b6f30=new Set(),_0x5273ae=new Set();_0x2d6a7e['model']['document']['registerPostFixer'](_0x54cf8c=>{let _0x1db58c=!0x1;for(const {name:_0x5b1de9,data:_0x50d543}of _0x2d6a7e['model']['document']['differ']['getChangedMarkers']()){const {group:_0x1c6a71,id:_0x4457d0}=fi(_0x5b1de9);let _0x2809db=_0x50d543['newRange'];if('comment'!==_0x1c6a71||!_0x2809db)continue;const _0x33e066='$graveyard'===_0x2809db['root']['rootName'];_0x33e066||(_0x2809db=_i(_0x2809db,_0x2d6a7e['model']),!_0x2809db||_0x2809db['isCollapsed']||!_0x50d543['newRange']||_0x2809db['isEqual'](_0x50d543['newRange']))?_0x2d6a7e['model']['hasContent'](_0x2809db)&&!_0x33e066?this['isThreadsLoadingPaused']?_0x3b6f30['add'](_0x5b1de9):this['_handleThreadMarker'](_0x5b1de9,_0x4457d0):(_0x5273ae['add'](_0x5b1de9),_0x3b6f30['delete'](_0x5b1de9),_0x54cf8c['removeMarker'](_0x5b1de9),_0x1db58c=!0x0):(_0x54cf8c['updateMarker'](_0x5b1de9,{'range':_0x2809db}),_0x1db58c=!0x0);}return _0x1db58c;}),this['on']('change:isThreadsLoadingPaused',(_0x519848,_0x5c3901,_0x44a25c)=>{if(!_0x44a25c&&_0x3b6f30['size'])for(const _0x3b91cb of _0x3b6f30){const {id:_0x12f8ed}=fi(_0x3b91cb);_0x3b6f30['delete'](_0x3b91cb),_0x2d6a7e['model']['markers']['get'](_0x3b91cb)&&this['_handleThreadMarker'](_0x3b91cb,_0x12f8ed);}}),this['listenTo'](_0x2d6a7e['model']['document'],'change',()=>{for(const {name:_0xb253c5,data:{newRange:_0x114f38}}of _0x2d6a7e['model']['document']['differ']['getChangedMarkers']()){const {group:_0x5a9ee2,id:_0x6fee26}=fi(_0xb253c5);if('comment'!==_0x5a9ee2)continue;const _0x106900=_0x245b60['getCommentThread'](_0x6fee26),_0x5a7828=this['hasMarkerForId'](_0x6fee26);_0x106900&&(!_0x106900['_hasTargetInContent']&&_0x114f38&&_0x2d6a7e['editing']['view']['once']('render',()=>{const _0x191e33=_0x2d6a7e['plugins']['get'](ti),_0x5a3c99=_0x245b60['_threadToController']['get'](_0x106900)['view'];_0x191e33['getByInnerView'](_0x5a3c99)['refreshVisibility']();},{'priority':'low'}),_0x106900['_hasTargetInContent']=_0x5a7828||!!_0x114f38),_0x114f38||(_0x5273ae['add'](_0xb253c5),_0x3b6f30['delete'](_0xb253c5));}for(const _0x3a7094 of _0x5273ae){const {id:_0x33682d}=fi(_0x3a7094),_0x4a0dc6=_0x245b60['getCommentThread'](_0x33682d);if(_0x3b6f30['delete'](_0x3a7094),!_0x4a0dc6)continue;const _0x9f3682=this['hasMarkerForId'](_0x33682d);_0x9f3682||_0x4a0dc6['isSubmitted']?_0x9f3682||_0x4a0dc6['unlinkedAt']||_0x4a0dc6['setUnlinkedAt'](new Date()):_0x4a0dc6['remove']();}_0x5273ae['clear']();});}_handleInitialThreads(_0x310cf5){_0x310cf5['forEach'](_0x59e7ed=>{_0x59e7ed['unlinkedAt']&&this['_attachArchivedThread'](_0x59e7ed['id']);});}_getTargetForId(_0x1dbedf){const _0x17eff8=this['editor'],_0x59a1df=this['getAllMarkersForId'](_0x1dbedf);return _0x1461bc(_0x17eff8['editing'],_0x59a1df);}_getTextContext(_0x310e95){const _0xcfe960=this['getAllMarkersForId'](_0x310e95);let _0x5ca322='',_0x475fda=!0x1;for(const _0x3c3fea of _0xcfe960){const _0x3ddc14=_0x3c3fea['getRange']();for(const _0x2b6544 of Array['from'](_0x3ddc14['getItems']()))_0x2b6544['is']('$textProxy')?(_0x5ca322&&_0x475fda&&(_0x5ca322+='\x20',_0x475fda=!0x1),_0x5ca322+=_0x2b6544['data']):_0x475fda=!0x0;_0x475fda=!0x0;}return _0x5ca322['substring'](0x0,0x96);}_attachMarkerToThread(_0x2b7e44,_0x26304c){const _0x323f87=this['editor'],_0x2be420=_0x323f87['plugins']['get'](oi);let _0x4cf4d2=_0x2be420['getCommentThread'](_0x26304c);const _0x4d05c0=_0x323f87['config']['get']('collaboration.channelId'),_0xb2ac3a=_0x323f87['plugins']['get'](di);return _0x4cf4d2&&(_0x4cf4d2['unlinkedAt']&&_0x4cf4d2['setUnlinkedAt'](null),_0x4cf4d2['isAttached'])||(this['getAllMarkersForId'](_0x26304c)[0x0]['managedUsingOperations']?_0x2be420['fetchCommentThread']({'channelId':_0x4d05c0,'threadId':_0x26304c})['then'](_0x54f2ba=>{if('destroyed'!==_0x323f87['state']){if(_0x4cf4d2=_0x54f2ba,_0x4cf4d2&&!_0x4cf4d2['isAttached']){const _0x41be80=_0x4cf4d2['attachTo'](()=>this['_getTargetForId'](_0x26304c));_0xb2ac3a['registerAnnotation'](_0x41be80),_0x4cf4d2['isResolved']&&this['_reconvertMarkers'](_0x26304c);}else{if(!_0x4cf4d2){const _0xeba97a=this['getAllMarkersForId'](_0x26304c);_0x323f87['model']['change'](_0x3636f2=>{for(const _0x1d0628 of _0xeba97a)_0x3636f2['removeMarker'](_0x1d0628);});}}}}):_0x323f87['editing']['view']['once']('render',()=>{if(_0x2be420['getCommentThread'](_0x26304c))return;const _0x1cb082=_0x323f87['plugins']['get'](ti);_0x4cf4d2=_0x2be420['openNewCommentThread']({'channelId':_0x4d05c0,'threadId':_0x26304c,'target':()=>this['_getTargetForId'](_0x26304c),'context':{'type':'text','value':this['_getTextContext'](_0x26304c)}});const _0x4a1393=_0x2be420['_threadToController']['get'](_0x4cf4d2)['view'],_0x2b28ec=_0x1cb082['getByInnerView'](_0x4a1393);_0x2b28ec&&_0xb2ac3a['registerAnnotation'](_0x2b28ec);},{'priority':'low'})),_0x4cf4d2;}['_handleThreadMarker'](_0x45ed3a,_0x21b9c9){const _0x345623=this['_attachMarkerToThread'](_0x45ed3a,_0x21b9c9);_0x345623&&!_0x345623['context']&&_0x345623['setContext']({'type':'text','value':this['_getTextContext'](_0x21b9c9)});}_initAriaMarkerChangeAnnouncements(){const _0x4771d9=this['editor'];_0x4fc4eb(_0x4771d9['model'],({left:_0x54f442,entered:_0x359771})=>{for(const _0x3b82e3 of _0x54f442)if(Ai(_0x3b82e3)){_0x4771d9['ui']['ariaLiveAnnouncer']['announce'](Et(_0x4771d9['locale'],'LEAVE_COMMENT_ANNOUNCEMENT'));break;}for(const _0x2e740f of _0x359771)if(Ai(_0x2e740f)){_0x4771d9['ui']['ariaLiveAnnouncer']['announce'](Et(_0x4771d9['locale'],'ENTER_COMMENT_ANNOUNCEMENT',_0x4c72e9(_0x5baba3)));break;}});}};function gi(_0x57aa7c,_0x2eadea){return _0x2eadea?_0x57aa7c+':'+_0x2eadea:_0x57aa7c;}function _i(_0x33a386,_0x548da1){const _0x48b3bf=_0x548da1['schema'],_0x4551a5=_0x548da1['createRange'](_0x33a386['start']);for(const _0x2375d1 of _0x33a386['getWalker']()){const {type:_0x2b7c2c,item:_0x2cab4d,nextPosition:_0x2b4fd4}=_0x2375d1;if('text'===_0x2b7c2c||_0x48b3bf['isObject'](_0x2cab4d)){const _0x51ff8b=_0x548da1['createPositionBefore'](_0x2cab4d);_0x4551a5['isCollapsed']&&(_0x4551a5['start']=_0x51ff8b),_0x4551a5['end']=_0x2b4fd4;}}return _0x4551a5;}function Ai(_0x476c40){return'comment'===fi(_0x476c40['name'])['group'];}var vi=class extends _0x2bcbce{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'CommentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,wi,di,ti];}get CommentsListView(){return Lt;}get CommentThreadInputView(){return xt;}init(){const _0x4e099d=this['editor'],_0x4e10bf=_0x4e099d['plugins']['get'](oi),_0x35e5a9=_0x4e099d['plugins']['get'](wi),_0x30cd2f=_0x4e099d['plugins']['get'](ti),_0x2eb743=_0x4e099d['plugins']['get'](di);_0x4e099d['ui']['componentFactory']['add']('comment',()=>{const _0x5d06c0=this['_createUIButton'](_0x151ed2);return _0x5d06c0['tooltip']=!0x0,_0x5d06c0;}),_0x4e099d['ui']['componentFactory']['add']('menuBar:comment',()=>this['_createUIButton'](rt)),_0x2eb743['addSourceCollector'](()=>{const _0x362f49=[];for(const [_0x3e4a5b,_0x1ec426]of _0x4e10bf['_threadToController']){const _0x4ffebc=_0x35e5a9['getAllMarkersForId'](_0x3e4a5b['id']),_0x2d8238=_0x4ffebc['map'](_0x234d7e=>_0x234d7e['getRange']());_0x4ffebc['length']>0x0&&_0x362f49['push']([_0x1ec426['view'],_0x2d8238]);}return _0x362f49;}),this['listenTo'](_0x30cd2f,'change:activeAnnotations',(_0x38aae1,_0x4f327f,_0x558237)=>{const _0x468330=Array['from'](_0x558237)['map'](_0x18760f=>_0x18760f['innerView'])['find'](_0x465ef2=>_0x4e10bf['_viewToController']['has'](_0x465ef2));if(!_0x468330)return void(_0x35e5a9['activeMarker']=null);const _0x400af7=_0x4e10bf['_viewToController']['get'](_0x468330)['model']['id'],_0x2be180='comment:'+_0x400af7;_0x400af7&&_0x35e5a9['hasMarkerForId'](_0x400af7)?_0x35e5a9['activeMarker']=_0x2be180:_0x35e5a9['activeMarker']&&(_0x35e5a9['activeMarker']=null);}),this['listenTo'](_0x4e10bf,'removeCommentThread',(_0x10bca4,{threadId:_0x394563,isFromAdapter:_0x307c75})=>{!_0x307c75&&_0x4e099d['ui']['focusTracker']['isFocused']&&_0x35e5a9['hasMarkerForId'](_0x394563)&&_0x4e099d['editing']['view']['focus']();},{'priority':'highest'}),this['listenTo'](_0x4e10bf,'addComment',(_0x3f3ad9,{threadId:_0x418796,isFromAdapter:_0x5e3d76})=>{!_0x5e3d76&&_0x35e5a9['hasMarkerForId'](_0x418796)&&_0x4e10bf['hasCommentThread'](_0x418796)&&0x1===_0x4e10bf['getCommentThread'](_0x418796)['length']&&(_0x4e099d['editing']['view']['focus'](),_0x3f3ad9['stop']());},{'priority':'low'}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x4b9f7e=[this['editor']];for(const _0xd1d3bb of _0x4b9f7e){let _0x5aacae;for(const _0x638212 in _0xd1d3bb){const _0x3d3aa9=_0x638212,_0x2d925e=_0xd1d3bb[_0x3d3aa9];if('commentsLicenseKeyValid'==_0x2d925e||'commentsLicenseKeyInvalid'==_0x2d925e||'commentsLicenseKeyExpired'==_0x2d925e||'commentsLicenseKeyDomainLimit'==_0x2d925e||'commentsLicenseKeyNotAllowed'==_0x2d925e||'commentsLicenseKeyEvaluationLimit'==_0x2d925e||'commentsLicenseKeyUsageLimit'==_0x2d925e){delete _0xd1d3bb[_0x3d3aa9],_0x5aacae=_0x2d925e,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'commentsLicenseKeyInvalid'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('invalid'),'commentsLicenseKeyExpired'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('expired'),'commentsLicenseKeyDomainLimit'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('domainLimit'),'commentsLicenseKeyNotAllowed'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('featureNotAllowed','Comments'),'commentsLicenseKeyEvaluationLimit'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('evaluationLimit'),'commentsLicenseKeyUsageLimit'==_0x5aacae&&_0xd1d3bb['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_createUIButton(_0x413c7b){const _0xf61667=this['editor'],_0x3edaa2=new _0x413c7b(_0xf61667['locale']),_0x558f3d=_0xf61667['commands']['get']('addCommentThread');return _0x3edaa2['set']({'label':Et(_0xf61667['locale'],'Comment'),'icon':_0x110cf9}),_0x3edaa2['bind']('isEnabled')['to'](_0x558f3d,'isEnabled',_0x558f3d,'hasContent',(_0x16cf97,_0x44b646)=>_0x16cf97&&_0x44b646),this['listenTo'](_0x3edaa2,'execute',()=>{_0x558f3d['execute']();}),_0x3edaa2;}},yi=class extends _0x2bcbce{static get['pluginName'](){return'CommentsOnly';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[wi];}constructor(_0x1fc53a){super(_0x1fc53a),this['set']('isEnabled',!0x1),this['on']('change:isEnabled',(_0x5199cd,_0x222f4c,_0x4909dc)=>{_0x4909dc?this['_enableCommentsOnlyMode']():this['_disableCommentsOnlyMode']();});}afterInit(){!this['isEnabled']&&this['editor']['config']['get']('commentsOnly')&&(this['isEnabled']=!0x0);}_enableCommentsOnlyMode(){for(const [_0x5abd5f,_0x5bf0a4]of this['editor']['commands'])_0x5bf0a4['affectsData']&&'addCommentThread'!==_0x5abd5f&&_0x5bf0a4['forceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('DragDrop')&&this['editor']['plugins']['get']('DragDrop')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['forceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['forceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['forceDisabled']('commentsOnlyMode');const _0x5dc60f=this['editor']['editing']['view']['document'];this['listenTo'](_0x5dc60f,'cut',_0x1056d1=>_0x1056d1['stop'](),{'priority':'highest'}),this['listenTo'](_0x5dc60f,'clipboardInput',_0x4c1022=>_0x4c1022['stop'](),{'priority':'highest'}),this['listenTo'](_0x5dc60f,'delete',_0x226ef0=>_0x226ef0['stop'](),{'priority':'highest'});}_disableCommentsOnlyMode(){for(const [_0x56fe7d,_0x46eead]of this['editor']['commands'])_0x46eead['affectsData']&&'addCommentThread'!==_0x56fe7d&&_0x46eead['clearForceDisabled']('commentsOnlyMode');this['editor']['plugins']['has']('RevisionTracker')&&this['editor']['plugins']['get']('RevisionTracker')['clearForceDisabled']('commentsOnlyMode'),this['editor']['plugins']['has']('SourceEditing')&&this['editor']['plugins']['get']('SourceEditing')['clearForceDisabled']('commentsOnlyMode'),this['editor']['commands']['get']('editSource')?.['clearForceDisabled']('commentsOnlyMode'),this['stopListening'](this['editor']['editing']['view']['document']);}},Ti=class extends _0x2bb426{activeUIs;uisData;['_uis'];static get requires(){return[ti];}static get['pluginName'](){return'AnnotationsUIs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x7fb487){super(_0x7fb487),this['activeUIs']=new Set(),this['_uis']=new Map(),this['uisData']=new Map();}init(){const _0x1a489d=this['context']['plugins']['get'](ti);this['listenTo'](_0x1a489d,'_activateAnnotation',(_0x495722,_0x3913f8)=>{for(const _0x10647e of this['activeUIs']){const _0x56fb8a=this['_uis']['get'](_0x10647e);(0x0,this['uisData']['get'](_0x10647e)['filter'])(_0x3913f8)&&_0x56fb8a['setActiveAnnotation'](_0x3913f8);}}),this['listenTo'](_0x1a489d,'_deactivateAllAnnotations',()=>{for(const _0x32398a of this['activeUIs'])this['_uis']['get'](_0x32398a)['setActiveAnnotation'](null);}),this['listenTo'](_0x1a489d['_visibleAnnotations'],'add',(_0x311f87,_0x3d179f)=>{this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x3d179f);});}hasActive(){return this['activeUIs']['size']>0x0;}isActive(_0x47597c){return this['activeUIs']['has'](_0x47597c);}activate(_0x1d8802,_0x5ebce9=this['defaultFilter']){const _0x4bea9d=this['context']['plugins']['get'](ti);if(!this['_uis']['has'](_0x1d8802))throw new _0x402d5c('annotationsuis-missing-ui',this,{'uiName':_0x1d8802});this['isActive'](_0x1d8802)&&this['deactivate'](_0x1d8802),this['activeUIs']['add'](_0x1d8802);const _0x3050af=new Jt();Qt({'source':_0x4bea9d['_visibleAnnotations'],'target':_0x3050af,'filter':_0x5ebce9}),this['uisData']['set'](_0x1d8802,{'collection':_0x3050af,'filter':_0x5ebce9});const _0x363e24=this['_uis']['get'](_0x1d8802);_0x363e24['attach'](_0x3050af),this['listenTo'](_0x363e24,'change:activeAnnotation',(_0x29d42e,_0x27c535,_0x32799b,_0x154e20)=>{_0x154e20&&_0x4bea9d['_removeActiveAnnotation'](_0x154e20),_0x32799b&&_0x4bea9d['_addActiveAnnotation'](_0x32799b);});}deactivate(_0x57537e){if(this['activeUIs']['delete'](_0x57537e),!this['_uis']['has'](_0x57537e))throw new _0x402d5c('annotationsuis-missing-ui',this,{'uiName':_0x57537e});const _0x270417=this['_uis']['get'](_0x57537e);_0x270417['detach'](),this['stopListening'](_0x270417),this['uisData']['get'](_0x57537e)['collection']['destroy'](),this['uisData']['delete'](_0x57537e);}switchTo(_0x27ceb2){if(!this['_uis']['has'](_0x27ceb2))throw new _0x402d5c('annotationsuis-missing-ui',this,{'uiName':_0x27ceb2});const _0x3dcc31=this['context']['plugins']['get'](ti),_0x4d0f80=Array['from'](_0x3dcc31['activeAnnotations'])[0x0]||null;this['deactivateAll'](),this['activate'](_0x27ceb2);const _0xf35187=this['_uis']['get'](_0x27ceb2);_0xf35187['setActiveAnnotation'](_0x4d0f80),_0xf35187['_setSelectedAnnotations']&&_0x4d0f80&&_0xf35187['_setSelectedAnnotations']([_0x4d0f80]);}deactivateAll(){for(const _0x36ad98 of this['activeUIs'])this['deactivate'](_0x36ad98);}register(_0x5477ca,_0x387820){if(this['_uis']['has'](_0x5477ca))throw new _0x402d5c('annotationsuis-register-already-registered');if('function'!=typeof _0x387820['attach']||'function'!=typeof _0x387820['detach']||'function'!=typeof _0x387820['setActiveAnnotation'])throw new _0x402d5c('annotationsuis-register-invalid-interface',null);this['_uis']['set'](_0x5477ca,_0x387820);}refilterAnnotations(){const _0x16051e=this['context']['plugins']['get'](ti)['collection'],_0x55fe87=new Map(),_0x319fdf=Array['from'](this['activeUIs']);for(const _0x49aa63 of this['activeUIs']){const _0x5e4398=this['uisData']['get'](_0x49aa63)['collection'];for(const _0x2e7750 of _0x5e4398)_0x55fe87['set'](_0x2e7750,_0x49aa63);}for(const _0x14ebbf of _0x16051e){const _0x3a5108=_0x55fe87['get'](_0x14ebbf);this['_assertAnnotationDoesNotBelongToMultipleUIs'](_0x14ebbf);const _0x2f639d=_0x319fdf['find'](_0x56bbd1=>this['uisData']['get'](_0x56bbd1)['filter'](_0x14ebbf));_0x3a5108!==_0x2f639d&&(_0x3a5108&&this['uisData']['get'](_0x3a5108)['collection']['remove'](_0x14ebbf),_0x2f639d&&this['uisData']['get'](_0x2f639d)['collection']['add'](_0x14ebbf));}}destroy(){this['deactivateAll'](),super['destroy']();}defaultFilter(){return!0x0;}_assertAnnotationDoesNotBelongToMultipleUIs(_0x3e917c){const _0x5ca731=[];for(const _0x10e3c8 of this['activeUIs']){(0x0,this['uisData']['get'](_0x10e3c8)['filter'])(_0x3e917c)&&_0x5ca731['push'](_0x10e3c8);}if(_0x5ca731['length']>0x1)throw new _0x402d5c('annotationsuis-annotation-mismatch',null,{'matchedUIs':_0x5ca731,'annotationType':_0x3e917c['type']});}};const Ci=/* #__PURE__ -- @preserve */
|
|
32
|
+
_0x205aa8('px');var Ii=class extends ht{list;['focusables'];['focusTracker'];['focusCycler'];constructor(_0x3e58e9){super(_0x3e58e9);const _0x2cc3ea=this['bindTemplate'];this['set']('minHeight',0x0),this['set']('class',''),this['list']=this['createCollection'](),this['focusables']=this['createCollection'](),this['list']['delegate']('arrowup','arrowdown')['to'](this),this['focusTracker']=new _0x198c81(),this['focusCycler']=new et({'focusables':this['focusables'],'focusTracker':this['focusTracker']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-sidebar','ck-reset',_0x2cc3ea['to']('class')],'style':{'minHeight':_0x2cc3ea['to']('minHeight',_0x3dbf2a=>'number'==typeof _0x3dbf2a?Ci(_0x3dbf2a+0xa):null)},'dir':_0x3e58e9['uiLanguageDirection'],'role':'application','aria-label':Et(_0x3e58e9,'Annotations\x20sidebar'),'tabindex':0x0},'children':[{'tag':'div','attributes':{'role':'list','aria-label':Et(_0x3e58e9,'Annotations\x20list')},'children':this['list']}]});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}['focus'](){this['focusCycler']['focusFirst']();}_setupKeyboardNavigation(){this['list']['delegate']('change:top')['to'](this),this['on']('change:top',_0x439f1c=>{this['_updateItemPositionInFocusables'](_0x439f1c['source']);}),this['list']['forEach'](_0xadcfc0=>{this['focusTracker']['add'](_0xadcfc0['element']),this['_updateItemPositionInFocusables'](_0xadcfc0);}),this['list']['on']('change',(_0x52be0e,_0x1bc643)=>{for(const _0x29a1fa of _0x1bc643['removed'])this['focusTracker']['remove'](_0x29a1fa['element']),this['focusables']['remove'](_0x29a1fa);for(const _0x28690d of _0x1bc643['added'])this['focusTracker']['add'](_0x28690d['element']),this['_updateItemPositionInFocusables'](_0x28690d);}),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['listenTo'](this['element'],'focus',()=>{this['focus']();});}_updateItemPositionInFocusables(_0x19fc66){const _0x3bbfdf=this['focusables']['getIndex'](_0x19fc66);let _0x32e770,_0x30812d;for(const _0x132aa6 of this['focusables'])if(_0x19fc66['top']<_0x132aa6['top']){_0x32e770=_0x132aa6;break;}if(_0x30812d=_0x32e770?this['focusables']['getIndex'](_0x32e770):this['focusables']['length'],-0x1!==_0x3bbfdf){if(_0x3bbfdf===_0x30812d-0x1)return;this['focusables']['remove'](_0x19fc66),_0x30812d=_0x32e770?this['focusables']['getIndex'](_0x32e770):this['focusables']['length'];}this['focusables']['add'](_0x19fc66,_0x30812d);}};const bi=/* #__PURE__ -- @preserve */
|
|
33
|
+
_0x205aa8('px');var Ei=class extends ht{content;_targetTop;_mutationObserver;constructor(_0x4880ea){super(_0x4880ea),this['set']('top',0x0),this['set']('height',0x0),this['bind']('bottom')['to'](this,'top',this,'height',(_0x255808,_0x449015)=>_0x255808+_0x449015),this['set']('isAnimationDisabled',!0x1),this['_mutationObserver']=Xt(()=>this['updateHeight']()),this['_targetTop']=null,this['content']=this['createCollection'](),this['content']['delegate']('arrowup','arrowdown')['to'](this);const _0x4e3226=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-sidebar-item',_0x4e3226['to']('isAnimationDisabled',_0x4cd762=>_0x4cd762?'ck-sidebar-item--no-animation':'')],'style':{'top':_0x4e3226['to']('top',_0x4a7696=>bi(_0x4a7696))},'role':'presentation'},'children':this['content']});}['render'](){super['render'](),this['_mutationObserver']['attach'](this['element']);}['focus'](){this['content']['first']&&this['content']['first']['focus']();}updateHeight(){const _0x1414f3=this['element']['clientHeight'];_0x1414f3&&(this['height']=_0x1414f3);}destroy(){this['content']['clear'](),this['_mutationObserver']['detach'](),super['destroy']();}},ki=class extends _0x2bb426{['view'];_activeAnnotation;_annotations;_spaceBetweenItems;_sidebarItemViewToAnnotation;_annotationToSidebarItemView;_recalculateBuffer;static get['pluginName'](){return'Sidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x505c3a){super(_0x505c3a),this['set']('_lastItem',void 0x0),this['view']=this['_createSidebarView'](),this['set']('container',null),this['_spaceBetweenItems']=0x19,this['_sidebarItemViewToAnnotation']=new Map(),this['_annotationToSidebarItemView']=new Map(),this['context']['config']['define']('sidebar.preventScrollOutOfView',!0x1),this['_annotations']=null,this['_activeAnnotation']=null,this['_recalculateBuffer']=[];}init(){const _0x1ae60a=this['context']['config']['get']('sidebar.container');_0x1ae60a&&this['setContainer'](_0x1ae60a);}setContainer(_0x3b2c5f){if(!Oi(_0x3b2c5f))throw new _0x402d5c('sidebar-setcontainer-invalid-element');this['container']=_0x3b2c5f;}_attachToContainer({viewClass:_0xce2ad5='',spaceBetweenItems:_0x336844=0x19}={}){if(!Oi(this['container']))throw new _0x402d5c('sidebar-attachtocontainer-missing-container',this);this['container']['appendChild'](this['view']['element']),this['view']['class']=_0xce2ad5,this['_spaceBetweenItems']=_0x336844;}['rearrange']({removedAnnotation:_0x36763f,previousAnnotation:_0x33a24a,nextAnnotation:_0x282b97}){const _0x1ddbc0=this['getSidebarItemView'](_0x36763f);this['view']['list']['remove'](_0x1ddbc0),this['_destroySidebarItemView'](_0x36763f),_0x33a24a&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x33a24a)),_0x282b97&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x282b97)),this['_updateLastItem']();}['refresh']({blurredAnnotation:_0x5271ec,activatedAnnotation:_0x68c678,disableAnimationOnActivatedAnnotation:_0x5850cb}){if(this['_activeAnnotation']=_0x68c678,_0x5271ec){_0x5271ec['isActive']=!0x1;const _0x20aa44=this['getSidebarItemView'](_0x5271ec);_0x20aa44&&_0x5850cb&&(_0x20aa44['isAnimationDisabled']=!0x1);}if(_0x68c678){const _0x45610a=this['getSidebarItemView'](_0x68c678);_0x45610a&&(_0x68c678['isActive']=!0x0,_0x5850cb&&(_0x45610a['isAnimationDisabled']=!0x0,_0x45610a['top']+=0x1),this['_alignToTargetRect'](_0x45610a));}}_detachFromContainer(_0x465c64){if(this['view']['element']['remove'](),_0x465c64){for(const _0x41021a of _0x465c64)this['_destroySidebarItemView'](_0x41021a);}this['view']['list']['clear'](),this['view']['class']='',this['_lastItem']=null;}addAnnotation(_0x467e2e,_0x756b7b){_0x756b7b||(_0x756b7b=_0x467e2e['view']);const _0x5e2820=new Ei(this['context']['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x5e2820,_0x467e2e),this['_annotationToSidebarItemView']['set'](_0x467e2e,_0x5e2820),_0x5e2820['content']['add'](_0x756b7b),this['listenTo'](_0x467e2e['view'],'change:targetRect',(_0x3413e2,_0x111efb,_0x2f9919)=>{const _0x5aab09=this['_getTargetTop'](_0x467e2e,_0x2f9919);_0x5e2820['_targetTop']!=_0x5aab09&&(_0x5e2820['_targetTop']=_0x5aab09,this['_setItemTop'](_0x5e2820,_0x5aab09));}),this['listenTo'](_0x5e2820,'change:top',()=>{this['_recalculate'](_0x5e2820,'top');}),this['listenTo'](_0x5e2820,'change:bottom',()=>{this['_recalculate'](_0x5e2820,'bottom');}),this['_alignToTargetRect'](_0x5e2820);const _0x7282da=this['_getItemBefore'](_0x5e2820);return _0x7282da&&this['_alignAfterItem'](_0x7282da,_0x5e2820)||this['_alignToTargetRect'](_0x5e2820),this['_updateLastItem'](),this['view']['list']['add'](_0x5e2820),_0x5e2820;}['_alignForTopChange'](_0x4ec616){if(!_0x4ec616['content']['length'])return;const _0x9e1327=this['_getItemBefore'](_0x4ec616);if(!_0x9e1327)return;const _0x1a7b90=this['_sidebarItemViewToAnnotation']['get'](_0x9e1327),_0x5ae7d1=this['_activeAnnotation'];_0x5ae7d1&&_0x5ae7d1===_0x1a7b90?this['_alignAfterItem'](_0x9e1327,_0x4ec616):this['_alignBeforeItem'](_0x4ec616,_0x9e1327);}_alignForBottomChange(_0x14cd0b){if(!_0x14cd0b['content']['length'])return;const _0x126466=this['_getItemAfter'](_0x14cd0b);if(!_0x126466)return;const _0xd8d7e8=this['_sidebarItemViewToAnnotation']['get'](_0x126466),_0x56fdd9=this['context']['config']['get']('sidebar.preventScrollOutOfView'),_0x505fbd=this['_activeAnnotation'];_0x505fbd&&_0x505fbd===_0xd8d7e8&&_0x56fdd9?(this['_alignBeforeItem'](_0x126466,_0x14cd0b),this['_alignAfterItem'](_0x14cd0b,_0x126466)):_0x505fbd&&_0x505fbd===_0xd8d7e8?this['_alignBeforeItem'](_0x126466,_0x14cd0b):this['_alignAfterItem'](_0x14cd0b,_0x126466);}_recalculate(_0x76477b,_0x5b739b){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x29c204,changedProp:_0x2d9db2}of this['_recalculateBuffer'])'top'===_0x2d9db2?this['_alignForTopChange'](_0x29c204):this['_alignForBottomChange'](_0x29c204);this['_recalculateBuffer']=[];},0xa),this['_recalculateBuffer']['push']({'sidebarItemView':_0x76477b,'changedProp':_0x5b739b});}getSidebarItemView(_0x2816f0){return this['_annotationToSidebarItemView']['get'](_0x2816f0);}destroy(){this['stopListening'](),this['view']['destroy']();}_destroySidebarItemView(_0x49afc4){const _0xd71e33=this['getSidebarItemView'](_0x49afc4);this['stopListening'](_0xd71e33),this['stopListening'](_0x49afc4['view']),_0xd71e33['destroy'](),this['_annotationToSidebarItemView']['delete'](_0x49afc4),this['_sidebarItemViewToAnnotation']['delete'](_0xd71e33);}_createSidebarView(){const _0x4ff2ee=new Ii(this['context']['locale']);return _0x4ff2ee['render'](),this['on']('change:_lastItem',(_0x3760ab,_0x3aae02,_0x57156c,_0x36dcf9)=>{_0x36dcf9&&_0x4ff2ee['unbind']('minHeight'),_0x57156c?_0x4ff2ee['bind']('minHeight')['to'](_0x57156c,'bottom'):_0x4ff2ee['minHeight']=null;}),_0x4ff2ee;}_updateLastItem(){this['_lastItem']=this['_annotations']?.['last']?this['getSidebarItemView'](this['_annotations']['last']):null;}_getItemBefore(_0xc9f996){const _0x5517b8=this['_sidebarItemViewToAnnotation']['get'](_0xc9f996),_0x501850=_0x5517b8&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x5517b8)-0x1);return _0x501850&&this['getSidebarItemView'](_0x501850)||null;}_getItemAfter(_0xc8d3c8){const _0x4a01e6=this['_sidebarItemViewToAnnotation']['get'](_0xc8d3c8),_0x16199e=_0x4a01e6&&this['_annotations']?.['get'](this['_annotations']['getIndex'](_0x4a01e6)+0x1);return _0x16199e&&this['getSidebarItemView'](_0x16199e)||null;}_alignBeforeItem(_0x3a85bf,_0x40af47){_0x3a85bf['updateHeight']();const _0x33670b=Ni(_0x40af47['bottom']+this['_spaceBetweenItems'],_0x3a85bf['top']);return!!_0x33670b&&(this['_setItemTop'](_0x40af47,_0x40af47['top']-_0x33670b),!0x0);}_alignAfterItem(_0x3ac380,_0x1e78c9){_0x3ac380['updateHeight']();const _0x5b750d=Ni(_0x3ac380['bottom']+this['_spaceBetweenItems'],_0x1e78c9['top']);return!!_0x5b750d&&(this['_setItemTop'](_0x1e78c9,_0x1e78c9['top']+_0x5b750d,!0x1),!0x0);}_alignToTargetRect(_0x237635){const _0x4e45c0=this['_sidebarItemViewToAnnotation']['get'](_0x237635);if(!_0x4e45c0||!_0x4e45c0['target']||!_0x4e45c0['targetRect'])return;const _0x2411fb=this['_getTargetTop'](_0x4e45c0,_0x4e45c0['targetRect']);this['_setItemTop'](_0x237635,_0x2411fb);}_getTargetTop(_0x28a7a9,_0x504626){if(null===_0x504626)return 0x0;if(_0x28a7a9['target']instanceof _0x23f3bc)return _0x504626['top'];{const _0x56dc12=new _0x23f3bc(this['view']['element'])['top'];return _0x504626['top']-_0x56dc12;}}_setItemTop(_0x2d49e0,_0x594c85,_0x25db16=this['context']['config']['get']('sidebar.preventScrollOutOfView')){_0x25db16&&(_0x594c85=Math['max'](_0x594c85,this['_getMaxAvailableTop'](_0x2d49e0))),_0x2d49e0['top']=_0x594c85;}_getMaxAvailableTop(_0x630987){let _0x27f66=this['_getItemBefore'](_0x630987),_0x3c9b15=0x0;for(;_0x27f66;)_0x27f66['updateHeight'](),_0x3c9b15+=this['_spaceBetweenItems']+_0x27f66['height'],_0x27f66=this['_getItemBefore'](_0x27f66);return _0x3c9b15;}};function Ni(_0x3738fd,_0x53a480){return Math['max'](_0x3738fd-_0x53a480,0x0);}function Oi(_0xf4b272){return null!==_0xf4b272&&'object'==typeof _0xf4b272&&0x1===_0xf4b272['nodeType'];}var Mi=class extends _0x2bb426{isAttached;annotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'WideSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1211be){super(_0x1211be),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_editorAnnotations']=new _0x33b802(),this['_refreshPositioningDebounced']=_0x420187(()=>{_0x1211be['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();},0xfa,{'leading':!0x1});}init(){const _0x240994=this['context']['plugins']['get'](Ti),_0x114690=this['context']['plugins']['get'](ki);_0x240994['register']('wideSidebar',this),_0x114690['container']&&_0x240994['switchTo']('wideSidebar');}setActiveAnnotation(_0x2c5c0e){if(_0x2c5c0e===this['activeAnnotation'])return;const _0x43e068=this['context']['plugins']['get'](ki);_0x43e068['_activeAnnotation']=_0x2c5c0e;const _0x203361=this['activeAnnotation'];_0x43e068['refresh']({'blurredAnnotation':_0x203361,'activatedAnnotation':_0x2c5c0e}),this['activeAnnotation']=_0x2c5c0e;}attach(_0x4efd0a){this['annotations']=_0x4efd0a;const _0x50a24c=this['context']['plugins']['get'](ki);if(_0x50a24c['_annotations']=_0x4efd0a,this['isAttached'])throw new _0x402d5c('widesidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0x50a24c,'set:container',()=>{this['detach'](),this['listenTo'](_0x50a24c,'change:container',_0x1e73be=>{_0x1e73be['off'](),this['attach'](_0x4efd0a);});}),_0x50a24c['_attachToContainer']({'viewClass':'ck-sidebar--wide'});const _0x2c0046=_0x284639=>{_0x284639['updateTargetRect'](),_0x50a24c['addAnnotation'](_0x284639);};for(const _0x17288e of _0x4efd0a)_0x2c0046(_0x17288e);this['listenTo'](_0x4efd0a,'add',(_0x1b4f0d,_0x50aeea)=>{_0x2c0046(_0x50aeea);}),this['listenTo'](_0x4efd0a,'remove',(_0x18bde3,_0xc519b9,_0x427693)=>{_0x50a24c['rearrange']({'removedAnnotation':_0xc519b9,'previousAnnotation':_0x4efd0a['get'](_0x427693-0x1),'nextAnnotation':_0x4efd0a['get'](_0x427693+0x1)}),_0xc519b9===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'high'}),this['listenTo'](_0x4efd0a,'focus',(_0x32c0e1,_0x286276)=>{this['setActiveAnnotation'](_0x286276);}),this['listenTo'](_0x4efd0a,'blur',()=>{this['setActiveAnnotation'](null);});const _0x3bf71c=this['context']instanceof _0x9685b6?this['context']['editors']:new _0x33b802([this['context']]);for(const _0x408695 of _0x3bf71c)this['_integrateWithEditorAnnotations'](_0x408695);this['listenTo'](_0x3bf71c,'add',(_0xcfcb57,_0x431e5f)=>{this['listenTo'](_0x431e5f,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x431e5f);});}),this['listenTo'](_0x3bf71c,'remove',(_0x1a0245,_0x330847)=>{_0x330847['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x330847['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning']();}detach(){if(!this['isAttached'])throw new _0x402d5c('widesidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x312597=this['context']['plugins']['get'](ki);_0x312597['_detachFromContainer'](this['annotations']),this['stopListening'](_0x312597),this['stopListening'](this['annotations']),this['context']instanceof _0x9685b6&&this['stopListening'](this['context']['editors']);for(const _0x29fbeb of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x29fbeb);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['activeAnnotation']=null,this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach']();}_integrateWithEditorAnnotations(_0x1d0568){if(!_0x1d0568['plugins']['has']('EditorAnnotations'))return;const _0x5dc980=_0x1d0568['plugins']['get']('EditorAnnotations'),_0x4846f1=()=>{const _0x479007=_0x5dc980['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['setActiveAnnotation'](_0x479007[0x0]||null);};this['listenTo'](_0x5dc980,'refresh',_0x4846f1),this['listenTo'](_0x5dc980,'blur',(_0xc6a769,{isAnnotationTracked:_0x51864e})=>{this['activeAnnotation']&&_0x51864e(this['activeAnnotation'])&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x5dc980,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](this['annotations'],'blur',_0x28d8f3=>{_0x5dc980['hasDomSelection']()&&(_0x4846f1(),_0x28d8f3['stop']());},{'priority':'high'}),this['_editorAnnotations']['add'](_0x5dc980);}_destroyEditorAnnotationsIntegration(_0x2074a0){this['stopListening'](_0x2074a0),this['_editorAnnotations']['remove'](_0x2074a0);}},Ri=class extends _0x151ed2{counterView;constructor(_0x1b6118){super(_0x1b6118);const _0x5c32bf=this['bindTemplate'];this['set']('isDirty',!0x1),this['set']('number',0x0),this['bind']('_badge')['to'](this,'isDirty',this,'number',(_0x588ca1,_0x436465)=>_0x588ca1?'...':_0x436465['toString']()),this['set']('annotationType',''),this['icon']=_0x110cf9,this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this['counterView']=new ht(),this['counterView']['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0x5c32bf['to']('annotationType',_0x1bc626=>'ck-annotation-counter__badge--'+_0x1bc626),_0x5c32bf['if']('isDirty','ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x5c32bf['to']('_badge')}]}),this['children']['add'](this['counterView']);}},Si=class extends _0x2bb426{isAttached;annotations;_manuallyClosedAnnotationViews;_domEmitter;_annotationToNarrowView;_selectedAnnotations;_editorAnnotations;_refreshPositioningDebounced;static get requires(){return[ki,Ti];}static get['pluginName'](){return'NarrowSidebar';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4b53e0){super(_0x4b53e0),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this['_domEmitter']=new(_0x408eb5())(),this['_annotationToNarrowView']=new Map(),this['set']('activeAnnotation',null),this['annotations']=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x33b802(),this['_refreshPositioningDebounced']=_0x420187(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}init(){this['context']['plugins']['get'](Ti)['register']('narrowSidebar',this),this['bodyCollection']=new _0x286678(this['context']['locale']),this['balloonPanelView']=new _0x48bc2e(this['context']['locale']),this['bodyCollection']['attachToDom'](),this['bodyCollection']['add'](this['balloonPanelView']);}attach(_0x3ff09c){this['annotations']=_0x3ff09c;const _0xce311b=this['context']['plugins']['get'](ki),_0x3a0b6c=this['balloonPanelView'];if(_0xce311b['_annotations']=_0x3ff09c,this['isAttached'])throw new _0x402d5c('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this['listenTo'](_0xce311b,'set:container',()=>{this['detach'](),this['listenTo'](_0xce311b,'change:container',_0x3b0f19=>{_0x3b0f19['off'](),this['attach'](_0x3ff09c);});}),_0xce311b['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x178c80=_0x2736e4=>{const _0x2738eb=new Ri(this['context']['locale']);_0xce311b['addAnnotation'](_0x2736e4,_0x2738eb),this['_annotationToNarrowView']['set'](_0x2736e4,_0x2738eb),_0x2738eb['bind']('isDirty','annotationType','number')['to'](_0x2736e4['view'],'isDirty','type','length'),_0x2738eb['on']('execute',()=>{this['_manuallyClosedAnnotationViews']['clear'](),_0x3a0b6c['content']['first']!==_0x2736e4['view']?(this['_showBalloon'](_0x2736e4),_0x2736e4['view']['element']['focus'](),this['setActiveAnnotation'](_0x2736e4)):this['setActiveAnnotation'](null);});};for(const _0x4dc430 of _0x3ff09c)_0x178c80(_0x4dc430);this['listenTo'](_0x3ff09c,'add',(_0x40b466,_0x29030c)=>{_0x178c80(_0x29030c);}),this['listenTo'](_0x3ff09c,'remove',(_0x1c22b8,_0x384ce0,_0x1ef917)=>{this['_annotationToNarrowView']['get'](_0x384ce0)['destroy'](),this['_annotationToNarrowView']['delete'](_0x384ce0),_0xce311b['rearrange']({'removedAnnotation':_0x384ce0,'previousAnnotation':_0x3ff09c['get'](_0x1ef917-0x1),'nextAnnotation':_0x3ff09c['get'](_0x1ef917+0x1)}),_0x384ce0===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':'low'}),this['listenTo'](_0x3ff09c,'focus',(_0x5dd3e5,_0x45fba0)=>{this['setActiveAnnotation'](_0x45fba0);}),this['listenTo'](_0x3ff09c,'blur',()=>{this['setActiveAnnotation'](null);}),this['_domEmitter']['listenTo'](document,'keydown',(_0x1c7e2b,_0x22dc1f)=>{_0x22dc1f['keyCode']===_0x319fd4['esc']&&_0x3a0b6c['isVisible']&&(this['_manuallyClosedAnnotationViews']['add'](_0x3a0b6c['content']['first']),this['_hideBalloon'](),_0x22dc1f['stopPropagation'](),_0x22dc1f['preventDefault']());}),this['_domEmitter']['listenTo'](document,'mousedown',(_0x4d9ca1,_0x1c97d6)=>{const _0x12dff9=_0x1c97d6['target'];_0x3a0b6c['isVisible']&&_0x3a0b6c['element']['contains'](_0x12dff9)||_0xce311b['view']['element']['contains'](_0x12dff9)||_0x4d9ca1['preventClosingBalloon']||this['activeAnnotation']&&this['activeAnnotation']['focusableElements']['find'](_0x5806a7=>_0x5806a7['contains'](_0x12dff9))||(this['_manuallyClosedAnnotationViews']['clear'](),this['_hideBalloon'](),this['setActiveAnnotation'](null));});const _0x104030=this['context']instanceof _0x9685b6?this['context']['editors']:new _0x33b802([this['context']]);for(const _0x6b0d7f of _0x104030)this['_integrateWithEditorAnnotations'](_0x6b0d7f);this['listenTo'](_0x104030,'add',(_0x3c3588,_0x11f57a)=>{this['listenTo'](_0x11f57a,'ready',()=>{this['_integrateWithEditorAnnotations'](_0x11f57a);});}),this['listenTo'](_0x104030,'remove',(_0x1f042a,_0x5e1f8b)=>{_0x5e1f8b['plugins']['has']('EditorAnnotations')&&this['_destroyEditorAnnotationsIntegration'](_0x5e1f8b['plugins']['get']('EditorAnnotations'));}),window['addEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioning']();}setActiveAnnotation(_0x337c3f){if(_0x337c3f===this['activeAnnotation'])return;const _0x3bf4c6=this['context']['plugins']['get'](ki);_0x3bf4c6['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x337c3f,'disableAnimationOnActivatedAnnotation':!0x0}),_0x337c3f&&_0x3bf4c6['getSidebarItemView'](_0x337c3f)?this['_showBalloon'](_0x337c3f):this['_hideBalloon'](),this['activeAnnotation']=_0x337c3f;}detach(){if(!this['isAttached'])throw new _0x402d5c('narrowsidebar-detach-not-attached',this);this['setActiveAnnotation'](null);const _0x3dede9=this['context']['plugins']['get'](ki);this['_hideBalloon'](),Array['from'](this['_annotationToNarrowView']['values'](),_0x45a929=>_0x45a929['destroy']()),this['_annotationToNarrowView']['clear'](),_0x3dede9['_detachFromContainer'](this['annotations']),this['stopListening'](),this['_domEmitter']['stopListening'](),this['context']instanceof _0x9685b6&&this['stopListening'](this['context']['editors']);for(const _0x27feea of Array['from'](this['_editorAnnotations']))this['_destroyEditorAnnotationsIntegration'](_0x27feea);window['removeEventListener']('resize',this['_refreshPositioningDebounced']),this['_refreshPositioningDebounced']['cancel'](),this['_selectedAnnotations']=[],this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['bodyCollection']['detachFromDom']();}_integrateWithEditorAnnotations(_0x289bdb){if(!_0x289bdb['plugins']['has']('EditorAnnotations'))return;const _0xa3f8b3=_0x289bdb['plugins']['get']('EditorAnnotations'),_0x58e090=this['context']['plugins']['get'](ki),_0x3f6116=this['annotations'],_0x4fd26e=this['balloonPanelView'],_0x3b491f=()=>{const _0x5f5afc=_0xa3f8b3['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this['_setSelectedAnnotations'](_0x5f5afc),this['setActiveAnnotation'](_0x5f5afc[0x0]||null);};this['listenTo'](_0xa3f8b3,'refresh',_0x3b491f),this['listenTo'](_0xa3f8b3,'blur',(_0x2f7f87,{isAnnotationTracked:_0x1ea46})=>{this['activeAnnotation']&&_0x1ea46(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0xa3f8b3,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x3f6116,'blur',_0x2f6c63=>{_0xa3f8b3['hasDomSelection']()&&_0x2f6c63['stop']();},{'priority':'high'}),this['listenTo'](this['_domEmitter'],'mousedown',(_0x3cb681,_0x463e2a)=>{const _0x1beb96=_0x463e2a['target'];_0x4fd26e['isVisible']&&_0x4fd26e['element']['contains'](_0x1beb96)||_0x58e090['view']['element']['contains'](_0x1beb96)||this['activeAnnotation']&&_0xa3f8b3['hasDomSelection']()&&(_0x3b491f(),_0x3cb681['preventClosingBalloon']=!0x0);},{'priority':'high'}),this['_editorAnnotations']['add'](_0xa3f8b3);}_destroyEditorAnnotationsIntegration(_0x56e145){_0x56e145&&(this['stopListening'](_0x56e145),this['_editorAnnotations']['remove'](_0x56e145));}_setSelectedAnnotations(_0x125e6e){for(const _0x5ae9d7 of this['_selectedAnnotations'])_0x125e6e['includes'](_0x5ae9d7)||this['_manuallyClosedAnnotationViews']['delete'](_0x5ae9d7['view']);this['_selectedAnnotations']=_0x125e6e;}_refreshPositioning(){const _0x11fcc1=this['balloonPanelView'];this['context']['plugins']['get']('Annotations')['refreshVisibility'](),this['annotations']['refreshPositioning'](),_0x11fcc1['isVisible']&&this['_updateBalloonPosition']();}['_showBalloon'](_0x3e11a3){if(this['_manuallyClosedAnnotationViews']['has'](_0x3e11a3['view']))return;const _0x4c8541=this['balloonPanelView']['content']['first'];_0x4c8541!==_0x3e11a3['view']?(_0x4c8541&&this['_detachListeners'](_0x4c8541),this['_attachListeners'](_0x3e11a3['view']),this['balloonPanelView']['content']['clear'](),this['balloonPanelView']['content']['add'](_0x3e11a3['view']),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}_updateBalloonPosition(){const _0x2c855f=this['balloonPanelView']['content']['first'],_0x54f27e=_0x2c855f&&this['annotations']['getByView'](_0x2c855f);if(!_0x54f27e||!this['_annotationToNarrowView']['has'](_0x54f27e))return;const _0x208c94=this['_annotationToNarrowView']['get'](_0x54f27e)['element'],_0x31ce86=(function(){const _0x3293ed=_0x48bc2e['defaultPositions'];return[_0x3293ed['southArrowNorthEast'],_0x3293ed['northArrowSouthEast'],_0x3293ed['southArrowNorth'],_0x3293ed['northArrowSouth'],_0x3293ed['southArrowNorthWest'],_0x3293ed['northArrowSouthWest']];}());this['balloonPanelView']['pin']({'target':_0x208c94,'positions':_0x31ce86});}['_hideBalloon'](){const _0x132af9=this['balloonPanelView'],_0x5876fd=_0x132af9['content']['first'];_0x5876fd&&(this['_detachListeners'](_0x5876fd),_0x132af9['unpin'](),_0x132af9['content']['clear']());}_attachListeners(_0x32f7d5){this['listenTo'](_0x32f7d5,'change:height',()=>this['_updateBalloonPosition']()),this['listenTo'](_0x32f7d5,'Esc',(_0x132dd1,_0x37256f)=>{this['_manuallyClosedAnnotationViews']['add'](_0x32f7d5),this['_hideBalloon'](),_0x37256f();});}_detachListeners(_0x2323f3){this['stopListening'](_0x2323f3);}},xi=class extends _0x2bcbce{isAttached;annotations;['_manuallyClosed'];['_balloon'];_addedAnnotations;_selectedAnnotations;['_forceRefresh'];_refreshVisibilityDebounced;static get requires(){return[di,_0x5d1799,Ti];}static get['pluginName'](){return'InlineAnnotations';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1db32){super(_0x1db32),_0x1db32['editing']['view']['addObserver'](lt),this['isAttached']=!0x1,this['set']('activeAnnotation',null),this['annotations']=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x1db32['plugins']['get'](_0x5d1799),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1,this['_refreshVisibilityDebounced']=_0x420187(()=>{this['editor']['plugins']['get']('Annotations')['refreshVisibility']();},0xfa,{'leading':!0x1});}init(){const _0x42512e=this['editor']['plugins']['get'](Ti);_0x42512e['context']===this['editor']&&(_0x42512e['register']('inline',this),this['editor']['keystrokes']['set']('Esc',(_0x325926,_0x152af0)=>{const _0x277335=this['_balloon'];if(this['isAttached']&&_0x277335['visibleView']){const _0x10df75=this['annotations']['getByView'](_0x277335['visibleView']);_0x10df75&&this['_closeAnnotation'](_0x10df75),_0x152af0();}}));}afterInit(){const _0x1d6021=this['editor']['plugins']['get'](Ti);_0x1d6021['context']===this['editor']&&(_0x1d6021['hasActive']()||_0x1d6021['switchTo']('inline'));}setActiveAnnotation(_0x2920fa){_0x2920fa!==this['activeAnnotation']&&(this['activeAnnotation']&&(this['activeAnnotation']['isActive']=!0x1),_0x2920fa&&this['editor']['ui']['focusTracker']['isFocused']&&(this['annotations']['has'](_0x2920fa)&&this['_addAnnotationToBalloon'](_0x2920fa,!0x0),_0x2920fa['isActive']=!0x0),_0x2920fa||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x2920fa);}attach(_0x3abf9c){this['annotations']=_0x3abf9c;const _0x4bb6b0=this['editor']['plugins']['get'](Ti),_0x4b68ce=this['_balloon'];if(this['isAttached'])throw new _0x402d5c('inlineannotations-attach-already-attached',this);if(_0x4bb6b0['context']!==this['editor'])throw new _0x402d5c('inlineannotations-not-allowed-with-context',this);const _0xac39fb=this['editor']['plugins']['get'](di);this['listenTo'](_0xac39fb,'refresh',()=>{const _0x3ade63=_0xac39fb['getOrderedSelectedAnnotations']({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});var _0x6d916f,_0x914360;!this['_forceRefresh']&&(_0x6d916f=_0x3ade63,_0x914360=this['_selectedAnnotations'],_0x6d916f['length']===_0x914360['length']&&_0x6d916f['every'](_0x570361=>_0x914360['includes'](_0x570361)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x3ade63),this['setActiveAnnotation'](_0x3ade63[0x0]||null));}),this['listenTo'](_0xac39fb,'blur',(_0x50d3ee,{isAnnotationTracked:_0x2aca1b})=>{this['activeAnnotation']&&_0x2aca1b(this['activeAnnotation'])&&(this['_setSelectedAnnotations']([]),this['setActiveAnnotation'](null));}),this['listenTo'](_0xac39fb,'uiUpdate',()=>{this['_refreshVisibilityDebounced']();}),this['listenTo'](this['editor']['ui']['focusTracker'],'change:isFocused',(_0x276c15,_0xa92280,_0x34d575)=>{_0x34d575||this['setActiveAnnotation'](null);}),this['listenTo'](_0x3abf9c,'remove',(_0xce54fe,_0x1fd8d2)=>{this['_removeAnnotationFromBalloon'](_0x1fd8d2),_0x1fd8d2===this['activeAnnotation']&&this['setActiveAnnotation'](null);}),this['listenTo'](_0x4b68ce,'change:visibleView',(_0x537937,_0x4ab511,_0x279b41,_0x54ef90)=>{_0x54ef90&&this['stopListening'](_0x54ef90);const _0x52eda0=_0x3abf9c['getByView'](_0x279b41);_0x279b41&&_0x52eda0&&(this['listenTo'](_0x279b41,'change:height',()=>{_0x4b68ce['updatePosition']();}),this['listenTo'](_0x279b41,'Esc',()=>{this['_closeAnnotation'](_0x52eda0),this['editor']['editing']['view']['focus']();}),this['activeAnnotation']!==_0x52eda0&&this['setActiveAnnotation'](_0x52eda0));}),this['listenTo'](this['editor']['ui'],'update',()=>{_0x4b68ce['visibleView']&&_0x3abf9c['getByView'](_0x4b68ce['visibleView'])&&_0x4b68ce['updatePosition']();}),this['listenTo'](this['editor']['editing']['view']['document'],'mousedown',()=>{this['_forceRefresh']=!0x0,this['_manuallyClosed']['clear']();}),this['editor']['editing']['view']['document']['selection']['editableElement']&&this['editor']['editing']['view']['focus'](),this['isAttached']=!0x0;}detach(){if(!this['isAttached'])throw new _0x402d5c('inlineannotations-detach-not-attached',this);this['setActiveAnnotation'](null);for(const _0x1215a3 of this['_addedAnnotations'])this['_removeAnnotationFromBalloon'](_0x1215a3);this['_refreshVisibilityDebounced']['cancel'](),this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}destroy(){this['isAttached']&&this['detach'](),this['_refreshVisibilityDebounced']['cancel']();}_setSelectedAnnotations(_0x3c05e0){for(const _0x1a5888 of this['_selectedAnnotations'])_0x3c05e0['includes'](_0x1a5888)||this['_manuallyClosed']['delete'](_0x1a5888);for(const _0x13c106 of this['annotations'])_0x3c05e0['includes'](_0x13c106)||this['_removeAnnotationFromBalloon'](_0x13c106);if(this['editor']['ui']['focusTracker']['isFocused']){for(const _0x23dc42 of _0x3c05e0)this['_addAnnotationToBalloon'](_0x23dc42);}this['_selectedAnnotations']=_0x3c05e0;}_addAnnotationToBalloon(_0x5e0284,_0x35b3df=!0x1){this['_manuallyClosed']['has'](_0x5e0284)||(this['_addedAnnotations']['has'](_0x5e0284)||this['_balloon']['hasView'](_0x5e0284['view'])||(this['_addedAnnotations']['add'](_0x5e0284),this['_balloon']['add']({'stackId':_0x5e0284['view']['id'],'view':_0x5e0284['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x5e0284)}})),_0x35b3df&&this['_balloon']['showStack'](_0x5e0284['view']['id']));}_getBalloonTargetForAnnotation(_0x329343){const _0x4622b8=_0x329343['target'],_0x9dffde=this['editor']['editing']['view'],_0x5ddce5=_0x9dffde['document']['selection']['getFirstRange'](),_0x2a9842=_0x9dffde['domConverter']['viewRangeToDom'](_0x5ddce5);if(_0x2a9842['collapse'](!0x0),_0x4622b8){if(_0x4622b8 instanceof _0x23f3bc)return _0x4622b8;let _0x507ffb=[];for(const _0x47d2bd of _0x4622b8)_0x507ffb['push'](..._0x23f3bc['getDomElementRects'](_0x47d2bd));_0x507ffb=function(_0x41ed95){const _0x46a3fc=[];let _0x59300d=_0x41ed95[0x0];for(let _0x4c626a=0x1;_0x4c626a<_0x41ed95['length'];_0x4c626a++)if(Pi(_0x59300d,_0x41ed95[_0x4c626a])){const _0x28d883=_0x41ed95[_0x4c626a]['width'];_0x59300d['width']+=_0x28d883,_0x59300d['right']+=_0x28d883;}else _0x46a3fc['push'](_0x59300d),_0x59300d=_0x41ed95[_0x4c626a];return _0x46a3fc['push'](_0x59300d),_0x46a3fc;}(_0x507ffb);const _0x2fc6e5=_0x2a9842['getBoundingClientRect']();return _0x507ffb['find'](_0x1ab7b0=>_0x1ab7b0['top']<=_0x2fc6e5['top']&&_0x1ab7b0['bottom']>=_0x2fc6e5['bottom']&&_0x1ab7b0['left']<=_0x2fc6e5['left']&&_0x1ab7b0['right']>=_0x2fc6e5['right'])||_0x507ffb[0x0];}return _0x329343['targetRect']||_0x2a9842;}_removeAnnotationFromBalloon(_0x485a9f){this['_addedAnnotations']['has'](_0x485a9f)&&this['_balloon']['hasView'](_0x485a9f['view'])&&(this['_addedAnnotations']['delete'](_0x485a9f),this['_balloon']['remove'](_0x485a9f['view']));}_closeAnnotation(_0x8fd592){this['_manuallyClosed']['add'](_0x8fd592),this['_removeAnnotationFromBalloon'](_0x8fd592);}};function Pi(_0x1fae96,_0x5607a1){return _0x1fae96['top']===_0x5607a1['top']&&_0x1fae96['bottom']===_0x5607a1['bottom']&&_0x1fae96['right']===_0x5607a1['left'];}var Li=class extends ht{['focusTracker'];['focusCycler'];_annotationViews;constructor(_0xf510fb,_0x1faf3b){super(_0xf510fb),this['set']('isEmpty',!_0x1faf3b['length']),this['focusTracker']=new _0x198c81(),this['_annotationViews']=_0x1faf3b,this['_annotationViews']['delegate']('arrowup','arrowdown')['to'](this),this['on']('arrowup',()=>{this['focusCycler']['focusPrevious']();}),this['on']('arrowdown',()=>{this['focusCycler']['focusNext']();}),this['focusCycler']=new et({'focusables':_0x1faf3b,'focusTracker':this['focusTracker']}),this['listenTo'](_0x1faf3b,'add',()=>{this['isEmpty']=!0x1;}),this['listenTo'](_0x1faf3b,'remove',(_0x5e0cb1,_0x5b3e47)=>{_0x5b3e47['isActive']&&this['focus'](),_0x1faf3b['length']||(this['isEmpty']=!0x0);});const _0x3c7ddd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'dir':'auto','class':['ck','ck-comments-archive'],'tabindex':-0x1,'role':'list','aria-label':Et(_0xf510fb,'COMMENTS_ARCHIVE_LIST_LABEL')},'children':[{'tag':'div','attributes':{'class':['ck-comments-archive__content'],'role':'presentation'},'children':[{'tag':'div','attributes':{'role':'presentation'},'children':_0x1faf3b},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x3c7ddd['if']('isEmpty','ck-hidden',_0x5a9b4f=>!_0x5a9b4f)]},'children':[{'text':Et(_0xf510fb,'EMPTY_COMMENTS_ARCHIVE')}]}]}]});}['render'](){super['render'](),this['_setupKeyboardNavigation']();}destroy(){super['destroy'](),this['focusTracker']['destroy']();}['focus'](){this['focusCycler']['first']?this['focusCycler']['focusFirst']():this['element']['focus']();}_setupKeyboardNavigation(){for(const _0x24152b of this['_annotationViews'])this['focusTracker']['add'](_0x24152b['element']);this['_annotationViews']['on']('change',(_0x2a39d0,{added:_0x5a3e62,removed:_0x681e3})=>{for(const _0x5e7bc1 of _0x5a3e62)this['focusTracker']['add'](_0x5e7bc1['element']);for(const _0x4a44f3 of _0x681e3)this['focusTracker']['remove'](_0x4a44f3['element']);});}},Di=class extends _0x2bb426{static get['pluginName'](){return'CommentsArchive';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[oi,ti];}constructor(_0x2bcaf1){super(_0x2bcaf1),this['archivedThreads']=new _0x33b802();}init(){const _0xff5bf7=this['context'],_0x129db5=_0xff5bf7['plugins']['get'](oi),_0x27da42=_0xff5bf7['plugins']['get'](ti);this['listenTo'](_0x129db5,'addCommentThread',(_0xc6bdd3,{threadId:_0x1459a1})=>{const _0x3992bf=_0x129db5['getCommentThread'](_0x1459a1);_0x3992bf['archivedAt']&&this['archivedThreads']['add'](_0x3992bf,this['_calculatePosition'](_0x3992bf['archivedAt'])),this['listenTo'](_0x3992bf,'change:archivedAt',(_0x58cf86,_0x32ebf6,_0x37934c)=>{_0x37934c?this['archivedThreads']['has'](_0x3992bf)||this['archivedThreads']['add'](_0x3992bf,this['_calculatePosition'](_0x3992bf['archivedAt'])):this['archivedThreads']['has'](_0x3992bf)&&this['archivedThreads']['remove'](_0x3992bf);});}),this['listenTo'](_0x129db5,'removeCommentThread',(_0x59770e,{threadId:_0x5b473d})=>{const _0x2dd139=_0x129db5['getCommentThread'](_0x5b473d);this['stopListening'](_0x2dd139),this['archivedThreads']['has'](_0x2dd139)&&this['archivedThreads']['remove'](_0x2dd139);},{'priority':'highest'}),this['listenTo'](_0x27da42['collection'],'focus',(_0xa5200d,_0x30e8e3)=>{_0x30e8e3['isVisible']||(_0x30e8e3['isActive']=!0x0,_0x27da42['activate'](_0x30e8e3));});}_calculatePosition(_0x5911b4){const _0x96c2a8=[...this['archivedThreads']]['findIndex'](_0x2bd9f1=>_0x2bd9f1['archivedAt']<_0x5911b4);return _0x96c2a8>-0x1?_0x96c2a8:this['archivedThreads']['length'];}},Vi=class extends _0x2bcbce{commentsArchiveView;annotationViews;['_pendingThreads'];static get['pluginName'](){return'CommentsArchiveUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Di,_0x4580c1];}constructor(_0x228e8e){super(_0x228e8e),this['annotationViews']=new at(),this['_pendingThreads']=[];}init(){const _0x3c6cee=this['editor'],_0x137e14=this['_hideDialogOnAnnotationEscape']['bind'](this);_0x3c6cee['ui']['componentFactory']['add']('commentsArchive',()=>this['_createCommentsArchiveButton'](_0x151ed2,!0x0)),_0x3c6cee['ui']['componentFactory']['add']('menuBar:commentsArchive',()=>{const _0x7e93a3=this['_createCommentsArchiveButton'](rt);return _0x7e93a3['set']({'role':'menuitemcheckbox'}),_0x7e93a3;});const _0x706d44=_0x3c6cee['plugins']['get'](Di),_0x5b25a9=_0x3c6cee['plugins']['get']('Annotations'),_0x19409e=_0x3c6cee['plugins']['get']('CommentsRepository');_0x706d44['archivedThreads']['forEach'](_0x29fcda=>{this['_handleNewThread'](_0x29fcda);}),this['listenTo'](_0x706d44['archivedThreads'],'add',(_0x548f69,_0x191e4a)=>{this['_handleNewThread'](_0x191e4a);}),this['listenTo'](_0x5b25a9['collection'],'add',(_0x373684,_0x31a6a0)=>{const _0x591d6b=this['_pendingThreads']['find'](_0x1c76b2=>{const _0x1f7e6f=_0x19409e['_threadToController']['get'](_0x1c76b2);return _0x1f7e6f&&_0x31a6a0['innerView']===_0x1f7e6f['view'];});if(_0x591d6b){const _0x22a581=this['_calculatePosition'](_0x591d6b['archivedAt']);this['_addAnnotationToArchive'](_0x31a6a0,_0x22a581),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x591d6b),0x1);}}),this['listenTo'](_0x706d44['archivedThreads'],'remove',(_0x5ebbc0,_0x7ddda5)=>{const _0x30f7f2=_0x3c6cee['config']['get']('collaboration.channelId');if(!_0x30f7f2||_0x7ddda5['channelId']===_0x30f7f2){if(this['_pendingThreads']['includes'](_0x7ddda5))this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x7ddda5),0x1);else{const _0x2d8ac0=_0x19409e['_threadToController']['get'](_0x7ddda5),_0x5190ca=_0x5b25a9['getByInnerView'](_0x2d8ac0['view']);this['annotationViews']['remove'](_0x5190ca['view']),this['stopListening'](_0x5190ca),this['stopListening'](_0x5190ca['focusableElements']);}}}),this['listenTo'](_0x5b25a9['collection'],'add',(_0x27a8ba,_0x571575)=>{this['listenTo'](_0x571575,'escape',_0x137e14);}),this['listenTo'](_0x5b25a9['collection'],'remove',(_0x339ede,_0x4cfc2a)=>{this['stopListening'](_0x4cfc2a,'escape',_0x137e14);});}_addAnnotationToArchive(_0x1040c1,_0x1ef5a9){this['listenTo'](_0x1040c1,'set:isVisible',_0x760ddb=>{_0x760ddb['return']=!0x1,_0x760ddb['stop']();}),this['annotationViews']['add'](_0x1040c1['view'],_0x1ef5a9);}['_handleNewThread'](_0x182b2c){const _0x58fdd2=this['editor']['plugins']['get']('CommentsRepository'),_0x4baeb5=this['editor']['plugins']['get']('Annotations'),_0x418df0=this['editor']['config']['get']('collaboration.channelId');if(!_0x418df0||_0x182b2c['channelId']===_0x418df0){const _0x209507=_0x58fdd2['_threadToController']['get'](_0x182b2c);if(!_0x209507)return void this['_pendingThreads']['push'](_0x182b2c);const _0x13e9a2=this['_calculatePosition'](_0x182b2c['archivedAt']),_0xee5513=_0x4baeb5['getByInnerView'](_0x209507['view']);_0xee5513['isVisible']&&_0x4baeb5['_visibleAnnotations']['remove'](_0xee5513),this['_addAnnotationToArchive'](_0xee5513,_0x13e9a2);}}_calculatePosition(_0x41e3bf){const _0x2d393a=this['editor']['config']['get']('collaboration.channelId'),_0x54a183=[...this['editor']['plugins']['get'](Di)['archivedThreads']]['filter'](_0x1f316a=>_0x1f316a['channelId']===_0x2d393a)['findIndex'](_0x2d11f3=>_0x2d11f3['archivedAt']<_0x41e3bf);return _0x54a183<0x0||_0x54a183>this['annotationViews']['length']?this['annotationViews']['length']:_0x54a183-0x1;}_toggleDialog(){const _0x524f90=this['editor'],_0x1f3a9e=_0x524f90['plugins']['get']('Dialog');this['commentsArchiveView']||(this['commentsArchiveView']=new Li(_0x524f90['locale'],this['annotationViews'])),'commentsArchive'===_0x1f3a9e['id']?_0x1f3a9e['hide']():_0x1f3a9e['show']({'id':'commentsArchive','title':Et(_0x524f90['locale'],'COMMENTS_ARCHIVE'),'icon':_0xa8fd73,'hasCloseButton':!0x0,'content':this['commentsArchiveView'],'position':_0x43beb4['EDITOR_TOP_SIDE']});}_createCommentsArchiveButton(_0x47622f,_0x501cdf=!0x1){const _0x433103=this['editor']['locale'],_0x4de6d1=this['editor']['plugins']['get']('Dialog'),_0x1eb846=new _0x47622f(_0x433103);return _0x1eb846['bind']('isEnabled')['to'](this,'isEnabled'),_0x1eb846['bind']('isOn')['to'](_0x4de6d1,'id',_0x1854e8=>'commentsArchive'===_0x1854e8),_0x1eb846['set']({'label':Et(_0x433103,'COMMENTS_ARCHIVE'),'icon':_0xa8fd73,'isToggleable':!0x0}),_0x501cdf&&(_0x1eb846['tooltip']=!0x0),this['listenTo'](_0x1eb846,'execute',()=>this['_toggleDialog']()),_0x1eb846;}_hideDialogOnAnnotationEscape=_0x3104fb=>{const _0x4fbb42=_0x3104fb['source'];if(!this['annotationViews']['has'](_0x4fbb42['view']))return;const _0x366bd4=this['editor']['plugins']['get']('Dialog');_0x366bd4['isOpen']&&'commentsArchive'===_0x366bd4['id']&&(_0x366bd4['hide'](),_0x3104fb['stop']());};},Bi=class extends _0x2bcbce{static get requires(){return[oi,wi,vi,Di,Vi,yi,Mi,Si,xi];}static get['pluginName'](){return'Comments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{ci as AddCommentThreadCommand,$t as Annotation,Jt as AnnotationCollection,Ri as AnnotationCounterButtonView,qt as AnnotationView,ti as Annotations,Ei as AnnotationsSidebarItemView,Ii as AnnotationsSidebarView,Ti as AnnotationsUIs,Ht as BaseCommentThreadView,Kt as BaseCommentView,hi as Comment,ri as CommentThread,bt as CommentThreadController,xt as CommentThreadInputView,Ut as CommentThreadView,Yt as CommentView,Bi as Comments,Di as CommentsArchive,Vi as CommentsArchiveUI,wi as CommentsEditing,Lt as CommentsListView,yi as CommentsOnly,oi as CommentsRepository,vi as CommentsUI,di as EditorAnnotations,xi as InlineAnnotations,Si as NarrowSidebar,ki as Sidebar,Mi as WideSidebar,Qt as bindAnnotationCollections};
|