@ckeditor/ckeditor5-ai 48.2.0-alpha.2 → 48.2.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/aichat/model/aichatconversation.d.ts +4 -0
- package/dist/index-editor.css +2 -1
- package/dist/index.css +2 -1
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x364f72,Command as _0x350c41,ContextPlugin as _0x5df7d5,Editor as _0x2b21e9}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5279a3,IconCheck as _0x6eb847,IconError as _0x480c2f,IconSubmit as _0x411441,IconAIHistory as _0x203cca,IconMagicWand as _0x55be79,IconRobotPencil as _0x4757a0,IconMaximize as _0x5b4b01,IconMinimize as _0x4d92ae,IconShowChangesOn as _0x48f0d9,IconShowChangesOff as _0x1fd0e8,IconDocument as _0x1c3a81,IconBoxWithCross as _0x255b66,IconBoxWithCheck as _0x52abd9,IconBoxWithMarker as _0x127ad4,IconInfo as _0x4d1218,IconWeb as _0x530bbb,IconCancel as _0x5e45e9,IconSelection as _0x868145,IconFileUpload as _0x2c0e59,IconLink as _0x223d3d,IconImage as _0x463f2e,IconBulb as _0xd802ee,IconAI as _0x4ff59c,IconPreviousArrow as _0x326f31,IconDocumentOutline as _0x30356d,IconLoupe as _0x272085,IconPaperClip as _0x3253fd,IconBrowseFiles as _0x529d0f,IconDropdownArrow as _0x18437f,IconStop as _0x31e237,IconPlus as _0x1124a6,IconAIChat as _0x30386c,IconPin as _0x446b2f,IconThreeHorizontalDots as _0x3e0877,IconAIReview as _0x46396f,IconAITranslate as _0x5a7bff,IconAIAskAI as _0x28a9e0,IconThumbUp as _0x58e688,IconThumbDown as _0xe618d1,IconChevronDown as _0x474e6a,IconChevronUp as _0x4c28c4,IconAIQuickActions as _0x353ca0,IconAIChatCommands as _0x174229,IconAIImproveWriting as _0x597f0c,IconAIContinueWriting as _0x3c445a,IconAIGrammarCheck as _0x434b1e,IconAIAdjustLength as _0x3fc7e4,IconAIChangeTone as _0x1d9d2b,IconAIOther as tt,IconRefresh as et,IconNextArrow as it,IconOutdated as st,IconEye as nt,IconEyeCrossedOut as rt,IconChevronRight as ot}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as at,CKEditorError as ht,ObservableMixin as ct,global as lt,isVisible as ut,Rect as dt,Collection as _t,FocusTracker as It,KeystrokeHandler as At,first as gt,logWarning as wt,logError as Ct,toArray as mt,version as pt,EmitterMixin as Et,scrollViewportToShowTarget as Tt,insertToPriorityArray as ft,scrollAncestorsToShowTarget as Rt,ResizeObserver as bt,_isMotionReduced as St,getConstrainedViewportRect as Ot,DomEmitterMixin as vt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as kt,ButtonView as yt,View as Nt,SpinnerView as xt,IconView as Lt,AutocompleteView as Pt,ListView as Dt,ListItemGroupView as Vt,ListItemView as Ht,ButtonLabelView as Mt,FocusCycler as Ut,createLabeledTextarea as Bt,Dialog as Gt,createDropdown as Ft,addMenuToDropdown as Wt,MenuBarMenuView as Kt,MenuBarMenuListItemButtonView as Yt,DialogViewPosition as $t,MenuBarMenuListView as qt,MenuBarMenuListItemView as Qt,BodyCollection as Xt,BalloonPanelView as zt,clickOutsideHandler as jt,addListToDropdown as Jt,UIModel as Zt,submitHandler as te,LabeledFieldView as _0x535e0b,createLabeledInputText as _0x485a30,FormHeaderView as _0x4b60f6,HighlightedTextView as _0x4a420c,ViewCollection as _0x461da8,FileDialogButtonView as _0x5c7aea,InputTextView as _0x33d8c7,SearchTextView as _0x58cc04,ListItemButtonView as _0x5395ce,ButtonLabelWithHighlightView as _0x11fa77,DropdownMenuPanelPositioningFunctions as _0x253202,BalloonToolbar as _0x209441,FormRowView as _0x3efa29,TextareaView as _0x24a1b9}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0xfde80c,ClipboardMarkersUtils as _0x155a4b}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x427107,ViewDataTransfer as _0x50ae46,ViewUpcastWriter as _0x4b1d54,Matcher as _0x5e996c,_DetachOperation as _0x1f8438,_insertIntoModelNodeList as _0x14d380,_removeFromModelNodeList as _0xb17e42,ModelRange as _0x14d15a,transformOperationSets as _0x4779ab,ViewDowncastWriter as _0x265725,ModelDocumentFragment as _0x415042,ModelPosition as _0x590920,ModelTreeWalker as _0x3403b6,MarkerOperation as _0x4b10e1,InsertOperation as _0x1d1cfc}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x2d155e,escape as _0xe3e6fb,cloneDeep as _0x2dd6a9,throttle as _0x1da276,debounce as _0x1b20e1,escapeRegExp as _0x3d3c69}from'es-toolkit/compat';import{createParser as _0x4ef989}from'eventsource-parser';import{CloudServices as _0x5ed7c8}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x4d8bd5}from'htmlparser2';import{isTag as _0x137115,findOne as _0x4d97a4,getParent as _0x28f883,findAll as _0x3f0d08,removeElement as _0x383ffd,prepend as _0x5358b1,prependChild as _0x5a0b86,appendChild as _0x37a484,append as _0x48c134,find as _0x193756,isComment as _0x340786,replaceElement as _0x5727b7,getChildren as _0x5127d8,textContent as ti}from'domutils';import _0x1084a7 from'dom-serializer';import{cloneNode as _0x1ba81c,Document as _0x9b5ced,Element as _0xace074,Text as _0x41c341,isDocument as _0x1e81fa,isText as _0x43676a,NodeWithChildren as _0xee50a1}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x4937ae,MarkdownGfmMdToHtml as _0x5103f0}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x5ddd4f from'rehype-sanitize';import{fixElementSuggestionRange as _0x21ec1a,DocumentCompare as _0x4d0fee,DATA_ID_MODEL_ATTRIBUTE as _0xbb716,ConfirmMixin as _0x33a8bd,getAllMarkersDomElementsSorted as _0x2968b2,SuggestionsConversion as _0x100f2e,DATA_ID_VIEW_ATTRIBUTE as _0x188ac1,getMarkerDomElement as _0x3e2279}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x17aec7 from'morphdom';import{diffArrays as _0x1c510d}from'diff';const Ti='_ungrouppedCommands';function fi(_0x21621d,_0x169217){const _0x160d9e=(0x0,_0x169217['t'])('Other');return _0x21621d['length']?'groupId'in _0x21621d[0x0]?_0x21621d:[{'groupId':Ti,'groupLabel':_0x160d9e,'order':0x1/0x0,'commands':_0x21621d}]:[{'groupId':Ti,'groupLabel':_0x160d9e,'order':0x1/0x0,'commands':[]}];}const Ri=globalThis['DataTransfer'],bi='ai-ui';class AIAssistantEditing extends _0x364f72{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x27d6ad}=this,_0x17b59c=['ck-fake-ai-selection'];_0x27d6ad['config']['get']('ai.assistant.useTheme')&&_0x17b59c['push']('ck-ai-assistant-ui_theme'),_0x27d6ad['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x17b59c,'priority':0xc}}),_0x27d6ad['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x39b8bb,{writer:_0x2ab791})=>{if(!_0x39b8bb['markerRange']['isCollapsed'])return null;const _0x5ca69a=_0x2ab791['createUIElement']('span');return _0x2ab791['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5ca69a),_0x5ca69a;}});}['afterInit'](){!async function(_0x2fbd1c){const _0x136618=_0x50902c([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x5ea6d9=0x3dffc4e1,_0x2a6715=0x3df84f91^_0x5ea6d9,_0x117600=window[_0x50902c([0x44,0x61,0x74,0x65])][_0x50902c([0x6e,0x6f,0x77])](),_0x341ab6=_0x2fbd1c[_0x50902c([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x52acba=new window[(_0x50902c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x547fc7=>{_0x341ab6[_0x50902c([0x6f,0x6e,0x63,0x65])](_0x50902c([0x72,0x65,0x61,0x64,0x79]),_0x547fc7);}),_0x2cbf3c={[_0x50902c([0x6b,0x74,0x79])]:_0x50902c([0x45,0x43]),[_0x50902c([0x75,0x73,0x65])]:_0x50902c([0x73,0x69,0x67]),[_0x50902c([0x63,0x72,0x76])]:_0x50902c([0x50,0x2d,0x32,0x35,0x36]),[_0x50902c([0x78])]:_0x50902c([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x50902c([0x79])]:_0x50902c([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x50902c([0x61,0x6c,0x67])]:_0x50902c([0x45,0x53,0x32,0x35,0x36])},_0x2c375e=_0x341ab6[_0x50902c([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x50902c([0x67,0x65,0x74])](_0x50902c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xfcf07f(){let _0xcfa9be,_0x24d0f4=null,_0x2fde55=null;try{if(_0x2c375e==_0x50902c([0x47,0x50,0x4c]))return _0x50902c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0xcfa9be=_0x56db26(),!_0xcfa9be)return _0x50902c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0xcfa9be[_0x50902c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2fde55=_0x21cf2f(_0xcfa9be[_0x50902c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0xcfa9be[_0x50902c([0x6a,0x74,0x69])])),await _0x1ab625()?_0x124256()?_0x3677b7()?_0x50902c([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3f9f57()?(_0xcfa9be[_0x50902c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x50902c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x24d0f4=_0xe2fc0f(_0x50902c([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1a36be()):_0x50902c([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x50902c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x50902c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x50902c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3677b7(){const _0x225526=[_0x50902c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x50902c([0x74,0x72,0x69,0x61,0x6c])][_0x50902c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xcfa9be[_0x50902c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x117600/0x3e8:0xe10*_0x2a6715;return _0xcfa9be[_0x50902c([0x65,0x78,0x70])]<_0x225526;}function _0x124256(){const _0x283496=_0xcfa9be[_0x50902c([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x283496&&(!!_0x283496[_0x50902c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x50902c([0x2a]))||!!_0x283496[_0x50902c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x50902c([0x41,0x49])));}function _0x3f9f57(){const _0x5a09c9=_0xcfa9be[_0x50902c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5a09c9||0x0==_0x5a09c9[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x35d7ce}=new URL(window[_0x50902c([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5a09c9[_0x50902c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x35d7ce))return!0x0;const _0x1af814=_0x35d7ce[_0x50902c([0x73,0x70,0x6c,0x69,0x74])](_0x50902c([0x2e]));return _0x5a09c9[_0x50902c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x11b25a=>_0x11b25a[_0x50902c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x50902c([0x2a])))[_0x50902c([0x6d,0x61,0x70])](_0x3e1120=>_0x3e1120[_0x50902c([0x73,0x70,0x6c,0x69,0x74])](_0x50902c([0x2e])))[_0x50902c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x69b948=>_0x69b948[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x1af814[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x50902c([0x6d,0x61,0x70])](_0x3991b0=>Array(_0x1af814[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x3991b0[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x50902c([0x66,0x69,0x6c,0x6c])](_0x3991b0[0x0]===_0x50902c([0x2a])?_0x50902c([0x2a]):'')[_0x50902c([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x3991b0))[_0x50902c([0x73,0x6f,0x6d,0x65])](_0x5d0f1f=>_0x1af814[_0x50902c([0x65,0x76,0x65,0x72,0x79])]((_0x1b211b,_0x2f3688)=>_0x5d0f1f[_0x2f3688]===_0x1b211b||_0x5d0f1f[_0x2f3688]===_0x50902c([0x2a])));}function _0x1a36be(){return _0x24d0f4&&_0x2fde55?new window[(_0x50902c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x598148,_0x353e76)=>{_0x24d0f4[_0x50902c([0x74,0x68,0x65,0x6e])](_0x598148,_0x353e76),_0x2fde55[_0x50902c([0x74,0x68,0x65,0x6e])](_0x41af84=>{_0x41af84!=_0x50902c([0x56,0x61,0x6c,0x69,0x64])&&_0x598148(_0x41af84);},_0x353e76);}):_0x24d0f4||_0x2fde55||_0x50902c([0x56,0x61,0x6c,0x69,0x64]);}}function _0x21cf2f(_0x560bda,_0x24909a){return new window[(_0x50902c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x36a0a6=>{if(_0x77ac8a())return _0x36a0a6(_0x50902c([0x56,0x61,0x6c,0x69,0x64]));_0x195d97(),_0x341ab6[_0x50902c([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x50902c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3ac124=!0x1;const _0x51e461=at();function _0x5b71e3(_0x270891){return!!_0x270891&&(typeof _0x270891===_0x50902c([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x270891===_0x50902c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x270891[_0x50902c([0x74,0x68,0x65,0x6e])]===_0x50902c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x270891[_0x50902c([0x63,0x61,0x74,0x63,0x68])]===_0x50902c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x535275(_0x42b6ae){_0x2aefa7(_0x42b6ae)[_0x50902c([0x74,0x68,0x65,0x6e])](_0x5668a3=>{if(!_0x5668a3||_0x5668a3[_0x50902c([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x50902c([0x6f,0x6b]))return _0x50902c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x12bd71(_0x4c4ae9(_0x51e461+_0x24909a))!=_0x5668a3[_0x50902c([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x50902c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x50902c([0x56,0x61,0x6c,0x69,0x64]);})[_0x50902c([0x74,0x68,0x65,0x6e])](_0x5bbb84=>(_0x54e406(),_0x5bbb84),()=>{const _0x1edc9f=_0x33cf75();return null==_0x1edc9f?(_0x54e406(),_0x50902c([0x56,0x61,0x6c,0x69,0x64])):_0x50902c(_0x117600-_0x1edc9f>(0x19f340e1^_0x5ea6d9)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x50902c([0x74,0x68,0x65,0x6e])](_0x36a0a6)[_0x50902c([0x63,0x61,0x74,0x63,0x68])](()=>{_0x36a0a6(_0x50902c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x39d89a=0x3dc92a61^_0x5ea6d9;function _0x54e406(){const _0x1b5a67=_0x50902c([0x6c,0x6c,0x63,0x74,0x2d])+_0x12bd71(_0x4c4ae9(_0x560bda)),_0x311146=_0x1d65ac(_0x12bd71(window[_0x50902c([0x4d,0x61,0x74,0x68])][_0x50902c([0x63,0x65,0x69,0x6c])](_0x117600/_0x39d89a)));window[_0x50902c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x50902c([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1b5a67,_0x311146);}function _0x33cf75(){const _0xd2b5c8=_0x50902c([0x6c,0x6c,0x63,0x74,0x2d])+_0x12bd71(_0x4c4ae9(_0x560bda)),_0x3f887b=window[_0x50902c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x50902c([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xd2b5c8);return _0x3f887b?window[_0x50902c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1d65ac(_0x3f887b),0x10)*_0x39d89a:null;}function _0x2aefa7(_0x60eb9e){return new window[(_0x50902c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3a13af,_0xfd7a5c)=>{_0x60eb9e[_0x50902c([0x74,0x68,0x65,0x6e])](_0x3a13af,_0xfd7a5c),window[_0x50902c([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0xfd7a5c,0x3dfe1021^_0x5ea6d9);});}}_0x341ab6[_0x50902c([0x6f,0x6e])](_0x50902c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x161c2e,_0xb8f6ba)=>{if(_0xb8f6ba[0x0]!=_0x560bda)return _0x36a0a6(_0x50902c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xb8f6ba[0x1]={..._0xb8f6ba[0x1],[_0x50902c([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x51e461};},{[_0x50902c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x50902c([0x68,0x69,0x67,0x68])}),_0x341ab6[_0x50902c([0x6f,0x6e])](_0x50902c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x125729=>{_0x5b71e3(_0x125729[_0x50902c([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3ac124=!0x0,_0x535275(_0x125729[_0x50902c([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x50902c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x50902c([0x6c,0x6f,0x77])}),_0x52acba[_0x50902c([0x74,0x68,0x65,0x6e])](()=>{_0x3ac124||_0x36a0a6(_0x50902c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x77ac8a(){return _0x341ab6[_0x50902c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x50902c([0x76,0x69,0x65,0x77])][_0x50902c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x50902c([0x61,0x75,0x74,0x6f]);}function _0x195d97(){_0x341ab6[_0x50902c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x50902c([0x76,0x69,0x65,0x77])][_0x50902c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x50902c([0x61,0x75,0x74,0x6f]);}}function _0xe2fc0f(_0x53fe83){const _0x10709a=[new window[(_0x50902c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x6826b4=>setTimeout(_0x6826b4,0x3df6fa2d^_0x5ea6d9)),_0x52acba[_0x50902c([0x74,0x68,0x65,0x6e])](()=>new window[(_0x50902c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1cb6c8=>{let _0xcf17f8=0x0;_0x341ab6[_0x50902c([0x6d,0x6f,0x64,0x65,0x6c])][_0x50902c([0x6f,0x6e])](_0x50902c([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xe854fd,_0x4e9ee5)=>{_0x4e9ee5[0x0][_0x50902c([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0xcf17f8++,_0xcf17f8==(0x3dffc109^_0x5ea6d9)&&(_0x1cb6c8(),_0xe854fd[_0x50902c([0x6f,0x66,0x66])]());});}))];return window[_0x50902c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x50902c([0x72,0x61,0x63,0x65])](_0x10709a)[_0x50902c([0x74,0x68,0x65,0x6e])](()=>_0x53fe83);}async function _0x274346(){await _0x52acba,_0x341ab6[_0x50902c([0x6d,0x6f,0x64,0x65,0x6c])][_0x50902c([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1f85e4,_0x341ab6[_0x50902c([0x6d,0x6f,0x64,0x65,0x6c])][_0x50902c([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1f85e4,_0x341ab6[_0x50902c([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x50902c([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x388a4c(_0x324913){const _0x4adca9=_0x208296();_0x341ab6[_0x4adca9]=_0x50902c([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x324913,_0x324913!=_0x50902c([0x56,0x61,0x6c,0x69,0x64])&&_0x274346();}function _0x208296(){const _0x19f36b=window[_0x50902c([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x50902c([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x50902c([0x6e,0x6f,0x77])]())[_0x50902c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x50902c([0x2e]),'');let _0x9e8ed7=_0x50902c([0x6e]);for(let _0x5bb7b4=0x0;_0x5bb7b4<_0x19f36b[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5bb7b4+=0x2){let _0x3ed10d=window[_0x50902c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x19f36b[_0x50902c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5bb7b4,_0x5bb7b4+0x2));_0x3ed10d>=_0x136618[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3ed10d-=_0x136618[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x9e8ed7+=_0x136618[_0x3ed10d];}return _0x9e8ed7;}function _0x56db26(){const _0x3cce8f=_0x2c375e[_0x50902c([0x73,0x70,0x6c,0x69,0x74])](_0x50902c([0x2e]));if(0x3!=_0x3cce8f[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x5c65e0(_0x3cce8f[0x1]);function _0x5c65e0(_0x25576b){const _0x94e9b4=_0x3b2436(_0x25576b);return _0x94e9b4&&_0x4f0fc2()?_0x94e9b4:null;function _0x4f0fc2(){const _0x2c1b98=_0x94e9b4[_0x50902c([0x6a,0x74,0x69])],_0x3b2258=window[_0x50902c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2c1b98[_0x50902c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2c1b98[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x46618e={..._0x94e9b4,[_0x50902c([0x6a,0x74,0x69])]:_0x2c1b98[_0x50902c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2c1b98[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x46618e[_0x50902c([0x76,0x63])],_0x4c4ae9(_0x46618e)==_0x3b2258;}}}async function _0x1ab625(){let _0x2a408d=!0x0;try{const _0x34fc8f=_0x2c375e[_0x50902c([0x73,0x70,0x6c,0x69,0x74])](_0x50902c([0x2e])),[_0x3eb384,_0x46134d,_0x216229]=_0x34fc8f;return _0x13d265(_0x3eb384),await _0x43be0b(_0x3eb384,_0x46134d,_0x216229),_0x2a408d;}catch{return!0x1;}function _0x13d265(_0x13b8ae){const _0x14e694=_0x3b2436(_0x13b8ae);_0x14e694&&_0x14e694[_0x50902c([0x61,0x6c,0x67])]==_0x50902c([0x45,0x53,0x32,0x35,0x36])||(_0x2a408d=!0x1);}async function _0x43be0b(_0x31e81e,_0x3d6f9e,_0x1e12af){const _0x5d496d=window[_0x50902c([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x50902c([0x66,0x72,0x6f,0x6d])](_0x210070(_0x1e12af),_0x281ee7=>_0x281ee7[_0x50902c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4dca36=new window[(_0x50902c([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x50902c([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x31e81e+_0x50902c([0x2e])+_0x3d6f9e),_0x5ca929=window[_0x50902c([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x50902c([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5ca929)return;const _0x3516f5=await _0x5ca929[_0x50902c([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x50902c([0x6a,0x77,0x6b]),_0x2cbf3c,{[_0x50902c([0x6e,0x61,0x6d,0x65])]:_0x50902c([0x45,0x43,0x44,0x53,0x41]),[_0x50902c([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x50902c([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x50902c([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5ca929[_0x50902c([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x50902c([0x6e,0x61,0x6d,0x65])]:_0x50902c([0x45,0x43,0x44,0x53,0x41]),[_0x50902c([0x68,0x61,0x73,0x68])]:{[_0x50902c([0x6e,0x61,0x6d,0x65])]:_0x50902c([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x3516f5,_0x5d496d,_0x4dca36)||(_0x2a408d=!0x1);}}function _0x3b2436(_0x59e550){return _0x59e550[_0x50902c([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x50902c([0x65,0x79]))?JSON[_0x50902c([0x70,0x61,0x72,0x73,0x65])](_0x210070(_0x59e550)):null;}function _0x210070(_0xb0e752){return window[_0x50902c([0x61,0x74,0x6f,0x62])](_0xb0e752[_0x50902c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x50902c([0x2b]))[_0x50902c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x50902c([0x2f])));}function _0x4c4ae9(_0x388e98){let _0x5e4d5c=0x1505;function _0x3f76f7(_0x1c3159){for(let _0x4b04af=0x0;_0x4b04af<_0x1c3159[_0x50902c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4b04af++){const _0xc5b12c=_0x1c3159[_0x50902c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4b04af);_0x5e4d5c=(_0x5e4d5c<<0x5)+_0x5e4d5c+_0xc5b12c,_0x5e4d5c&=_0x5e4d5c;}}function _0x57ca79(_0x563056){Array[_0x50902c([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x563056)?_0x563056[_0x50902c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x57ca79):_0x563056&&typeof _0x563056==_0x50902c([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x50902c([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x563056)[_0x50902c([0x73,0x6f,0x72,0x74])]()[_0x50902c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x253b9d,_0x4e6b63])=>{_0x3f76f7(_0x253b9d),_0x57ca79(_0x4e6b63);}):_0x3f76f7(window[_0x50902c([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x563056));}return _0x57ca79(_0x388e98),_0x5e4d5c>>>0x0;}function _0x12bd71(_0x117512){return _0x117512[_0x50902c([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x50902c([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x50902c([0x30]));}function _0x1d65ac(_0x11da49){return _0x11da49[_0x50902c([0x73,0x70,0x6c,0x69,0x74])]('')[_0x50902c([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x50902c([0x6a,0x6f,0x69,0x6e])]('');}function _0x1f85e4(){}function _0x50902c(_0x2ca060){return _0x2ca060['map'](_0xc8899c=>String['fromCharCode'](_0xc8899c))['join']('');}_0x388a4c(await _0xfcf07f());}(this);}['showFakeVisualSelection'](){const _0x3f34ef=this['editor']['model'];_0x3f34ef['change'](_0x2b6ad2=>{const _0x2b5c96=_0x3f34ef['document']['selection']['getRanges']();let _0x34fd4c=0x0;for(const _0x45035a of _0x2b5c96){const _0x59fcde=bi+':'+_0x34fd4c;if(_0x3f34ef['markers']['has'](_0x59fcde))_0x2b6ad2['updateMarker'](_0x59fcde,{'range':_0x45035a});else{if(_0x45035a['start']['isAtEnd']){const _0x3fce94=_0x45035a['start']['getLastMatchingPosition'](({item:_0x3b5cf5})=>!_0x3f34ef['schema']['isContent'](_0x3b5cf5),{'boundaries':_0x45035a});_0x2b6ad2['addMarker'](_0x59fcde,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2b6ad2['createRange'](_0x3fce94,_0x45035a['end'])});}else _0x2b6ad2['addMarker'](_0x59fcde,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x45035a});}_0x34fd4c++;}});}['hideFakeVisualSelection'](){const _0x531e03=this['editor']['model'],_0x561674=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x561674['length']&&_0x531e03['change'](_0x5b0a82=>{_0x561674['forEach'](_0x3ee842=>{_0x5b0a82['removeMarker'](_0x3ee842);});});}['insertContent'](_0xac26c6,_0x488794){const _0x25ff87=this['_getAISelection'](),_0x13445f=_0x488794||_0x25ff87['getFirstRange']();this['editor']['model']['canEditAt'](_0x13445f)&&this['editor']['model']['change'](_0x564535=>{this['hideFakeVisualSelection'](),_0x488794||this['_resetContentOfSelectedTableCells'](_0x564535,_0x25ff87),this['_pasteHTMLUsingClipboard']({'insertAt':_0x13445f,'writer':_0x564535,'html':_0xac26c6});});}['insertContentBelow'](_0x49878e){const {model:_0x5e5c41}=this['editor'],_0x58e82b=this['_getAISelection']();_0x5e5c41['change'](()=>{const _0x708431=this['_prepareTableInsertBelowPosition'](_0x49878e,_0x58e82b)||this['_getDefaultInsertBelowPosition'](_0x58e82b);this['insertContent'](_0x49878e,_0x708431);});}['_getAISelection'](){const _0x283917=this['editor']['model'],_0x27db40=Array['from'](_0x283917['markers']['getMarkersGroup'](bi))['map'](_0x57a4b5=>_0x57a4b5['getRange']());return _0x283917['createSelection'](_0x27db40);}['_pasteHTMLUsingClipboard']({writer:_0xf02e95,html:_0x252147,insertAt:_0x85c762}){const {view:_0x57f2f0}=this['editor']['editing'],_0x418960=this['editor']['plugins']['get'](_0xfde80c),_0x53ffeb=new Ri();_0x53ffeb['setData']('text/html',_0x252147);const _0x3d7935=new ClipboardEvent('paste',{'clipboardData':_0x53ffeb}),_0x51e2a9=new _0x427107(_0x57f2f0,_0x3d7935,{'dataTransfer':new _0x50ae46(_0x53ffeb)});_0xf02e95['setSelection'](_0x85c762);const _0x387560=(_0x3d5587,_0x56e33d)=>{_0x56e33d['resultRange']&&_0xf02e95['setSelection'](_0x56e33d['resultRange']);};_0x418960['once']('contentInsertion',_0x387560,{'priority':'lowest'}),_0x57f2f0['document']['fire']('paste',_0x51e2a9),_0x418960['off']('contentInsertion',_0x387560);}['_getDefaultInsertBelowPosition'](_0x2f0588){const {model:_0x2f9a72}=this['editor'],_0x31da9e=Array['from'](_0x2f0588['getSelectedBlocks']());return _0x31da9e['length']?_0x2f9a72['createPositionAfter'](_0x31da9e['pop']()):_0x2f0588['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x2aac99,_0x4644ba){const {model:_0x5ec6ac,plugins:_0x4ddeff}=this['editor'];if(_0x4ddeff['has']('TableUtils')){const _0x80259=_0x4ddeff['get']('TableUtils')['getSelectedTableCells'](_0x4644ba);if(_0x80259['length']){const _0x3a9750=this['_getTableRowCountFromContent'](_0x2aac99),_0x186372=this['_createEmptyTableRows'](_0x80259,_0x3a9750);return _0x5ec6ac['createPositionAt'](_0x186372,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3436c5){const _0x4b0e91=this['editor']['plugins']['get']('TableUtils'),_0x384ae3=this['editor']['data']['parse'](_0x3436c5,'$documentFragment'),_0x292bf2=Array['from'](_0x384ae3['getChildren']())['filter'](_0x30fea3=>_0x30fea3['is']('element','table'));let _0x577b8a=0x0;return _0x292bf2['forEach'](_0x2db2be=>{_0x577b8a+=_0x4b0e91['getRows'](_0x2db2be);}),_0x577b8a;}['_createEmptyTableRows'](_0x43e97e,_0x1b8127){const _0x447603=this['editor']['plugins']['get']('TableUtils'),_0x30a71=_0x447603['getRowIndexes'](_0x43e97e),_0x4ee345=_0x447603['getColumnIndexes'](_0x43e97e),_0x4b6f21=_0x30a71['last']+0x1,_0x2f9d38=_0x4ee345['first'],_0xab4cae=_0x43e97e[0x0]['findAncestor']('table');for(let _0xf6a040=0x0;_0xf6a040<_0x1b8127;_0xf6a040++)_0x447603['insertRows'](_0xab4cae,{'at':_0x4b6f21});return _0xab4cae['getChild'](_0x4b6f21)['getChild'](_0x2f9d38);}['_resetContentOfSelectedTableCells'](_0x210ca8,_0x3d5e2f){const {plugins:_0xcf45a8}=this['editor'],{model:_0x20cc97}=_0x210ca8;if(!_0xcf45a8['has']('TableUtils'))return;_0xcf45a8['get']('TableUtils')['getSelectedTableCells'](_0x3d5e2f)['length']&&_0x20cc97['deleteContent'](_0x3d5e2f);}}class AIAdapter extends _0x364f72{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ht('aiadapter-text-adapter-not-set',null);}}class AIRequestError extends Error{constructor(_0x20a193){super(_0x20a193),this['name']='AIRequestError';}}function Si(_0x53fb96,_0x1fc310,_0x2dab9d){const t=_0x53fb96['t'];switch(_0x1fc310){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x2dab9d);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2dab9d);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x2dab9d);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x1fc310;}}class ShowAIAssistantCommand extends _0x350c41{['_commandDefinitions'];constructor(_0x1673a4,_0x1a4c35){super(_0x1673a4),this['_commandDefinitions']=_0x1a4c35,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x37bea3,_0x53d9d4,_0xc75a9)=>{this['isEnabled']&&(this['enabledCommandsIds']=Oi(this['_commandDefinitions'],_0xc75a9));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1fc9eb,_0x33e134,_0x26a5e1)=>{this['enabledCommandsIds']=_0x26a5e1?Oi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x5714f7=this['editor']['model'];this['_hasContext']=function(_0x3723b7){const _0x287752=_0x3723b7['document']['selection'];return _0x287752['isCollapsed']?0x0!==[..._0x287752['getSelectedBlocks']()]['length']&&![..._0x287752['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x3723b7['hasContent'](_0x287752['getFirstRange']());}(_0x5714f7);const _0x4393bf=_0x5714f7['document']['selection'],_0xae1f15=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x5aa584 of _0x4393bf['getRanges']())for(const _0x52a57d of _0x5aa584['getItems']())if(_0x52a57d['is']('element')&&_0xae1f15['includes'](_0x52a57d['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x442e20='',_0x3daa8d='',_0x100e8e='custom'){this['editor']['plugins']['get'](AIAssistantUI)['showUI'](_0x442e20,_0x3daa8d,_0x100e8e);}}function Oi(_0x7fe168,_0x5c4a44){const _0x499093=new Set();for(const _0x23dc29 of _0x7fe168['values']())(_0x5c4a44||!0x1===_0x23dc29['requiresContent'])&&_0x499093['add'](_0x23dc29['id']);return Array['from'](_0x499093);}const vi=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class AIAssistantController extends/* #__PURE__ -- @preserve */
|
|
24
|
-
ct(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3355f6,_0x32187a,_0x2f2e33){super(),this['editor']=_0x3355f6,this['textAdapter']=_0x32187a,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x2f2e33,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x502c1e,_0x1a4369,_0x4a6776)=>{this['view']['value']=this['_sanitizeHTML'](_0x4a6776);}),this['listenTo'](this['view'],'submitPrompt',(_0x27a3d7,_0x24ecbe)=>{const _0x5c984b=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x24ecbe,_0x5c984b,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x3ce1f6,query:_0x12d723,htmlContent:_0x4ac9bb,label:_0x50dd4a,mainActionLabel:_0x57e8a8}){this['view']['prompt']=_0x50dd4a,this['view']['mainAction']=_0x57e8a8,this['initialContext']=_0x4ac9bb,_0x12d723&&(this['view']['isRendered']?this['_handleQuery'](_0x12d723,_0x4ac9bb,_0x3ce1f6,_0x50dd4a):this['view']['once']('render',()=>{this['_handleQuery'](_0x12d723,_0x4ac9bb,_0x3ce1f6,_0x50dd4a);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x5b4b14,_0x472515,_0x35ff30,_0x36316d){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x472515,this['previousQuery']=_0x5b4b14,this['previousLabel']=_0x36316d||_0x5b4b14,this['previousActionId']=_0x35ff30,new Promise(_0x5f1955=>{this['textAdapter']['makeRequest']({'query':_0x5b4b14,'context':_0x472515,'onData':_0x75d40b=>{this['currentResponse']=_0x75d40b,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x35ff30})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1300b8=>{_0x1300b8 instanceof AIRequestError?this['view']['handleError'](_0x1300b8['message']):this['view']['handleError'](),_0x5f1955();})['finally'](()=>{this['stopProcessing'](),_0x5f1955();});});}['_parseAndNormalizeContent'](_0x3516d9,_0x5aa774=!0x1){const _0xaa4a89=vi['exec'](_0x3516d9);_0x3516d9=_0xaa4a89?_0x3516d9['substring'](_0xaa4a89[0x1]['length']):_0x3516d9['length']<0x64&&!_0x5aa774?'':this['_stripMarkdownSyntax'](_0x3516d9);const _0xc18a5a=this['_domParser']['parseFromString'](_0x3516d9,'text/html');if(_0xaa4a89){const _0x472221=Array['from'](_0xc18a5a['body']['childNodes']);_0x472221['reverse']();for(const _0x16c87a of _0x472221){if(_0x16c87a['nodeType']==Node['ELEMENT_NODE'])break;_0x16c87a['remove']();}}const _0x25c619=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xc18a5a['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x25c619);const _0x1f579a=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x220108=this['editor']['data']['toModel'](_0x25c619);return _0x1f579a||_0x220108['markers']['clear'](),this['editor']['data']['stringify'](_0x220108);}['_normalizeResponseHeadings'](_0xbd4bc1){const _0x1aa8a2=new _0x4b1d54(this['editor']['editing']['view']['document']),_0x472258=new _0x5e996c({'name':/^h[1-5]$/}),_0x229eac=[];let _0x311a2e=!0x1;for(const _0x43487e of _0xbd4bc1)_0x43487e['is']('element')&&_0x472258['match'](_0x43487e)&&(_0x229eac['push'](_0x43487e),'h1'==_0x43487e['name']&&(_0x311a2e=!0x0));if(_0x311a2e){for(const _0x1610f2 of _0x229eac)_0x1aa8a2['rename']('h'+(parseInt(_0x1610f2['name'][0x1])+0x1),_0x1610f2);}}['_isH1TagSupportEnabled'](){const {data:_0x2a6b41,editing:_0x43a3e5}=this['editor'],_0x1d45ea=_0x2a6b41['htmlProcessor']['toView']('<h1></h1>'),_0x508b11=_0x2a6b41['toView'](_0x2a6b41['toModel'](_0x1d45ea));return!!_0x43a3e5['view']['domConverter']['viewToDom'](_0x508b11)['querySelector']('h1');}['_sanitizeHTML'](_0x1490b0){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1490b0),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x176124){const _0x563613=_0x176124['trim']();return _0x563613['startsWith']('```html')?_0x563613['endsWith']('```')?_0x563613['substring'](0x7,_0x563613['length']-0x3):_0x563613['substring'](0x7):_0x176124;}}const ki={'REPLACE':'replace','INSERT':'insert'};class AIFormToolbarView extends kt{constructor(_0x506492){super(_0x506492),this['set']('isVisible',!0x1),this['set']('mainAction',ki['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3a9717=>Si(_0x506492,'AI_'+_0x3a9717['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Si(_0x506492,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Si(_0x506492,'Try\x20again')),this['stopButton']=this['_createButton'](Si(_0x506492,'Stop'));const _0x2d2c9d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2d2c9d['if']('isVisible','ck-hidden',_0x1b622b=>!_0x1b622b)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x105111,_0x1cdbc3){const _0x335df7=new yt(this['locale']);return _0x335df7['set']({'label':_0x105111,'class':_0x1cdbc3||'','isVisible':!0x0,'withText':!0x0}),_0x335df7;}}class AIFormContentArea extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x53e687,_0x1cd0ec=''){super(_0x53e687),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1f057d=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0x53e687,_0x1cd0ec),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1f057d['if']('isVisible','ck-hidden',_0x420a19=>!_0x420a19)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1f057d['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x383fee=!0x1;this['on']('change:value',(_0x17d736,_0x3f10de,_0x2a555b)=>{const _0x58172f=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2a555b),this['isProcessing']&&_0x58172f&&!_0x383fee&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x2ca6e8,_0x1c1dd6,_0x5f1de9)=>{_0x383fee=!0x1,_0x5f1de9?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x383fee=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x383fee=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x17d5c6=this['locale'],_0xeef8e5=new yt(this['locale']),_0x1692e3='ck-ai-form__copy-button';return _0xeef8e5['set']({'label':Si(_0x17d5c6,'Copy'),'icon':_0x5279a3,'class':_0x1692e3,'tooltip':!0x0}),_0xeef8e5['bind']('isVisible')['to'](this,'value',_0x62b586=>!!_0x62b586),_0xeef8e5['bind']('isEnabled')['to'](this,'isProcessing',_0x1e077e=>!_0x1e077e),_0xeef8e5['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xeef8e5['icon']=_0x6eb847,_0xeef8e5['class']=_0x1692e3+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xeef8e5['icon']=_0x5279a3,_0xeef8e5['class']=_0x1692e3;},0x3e8);}),_0xeef8e5;}['_copyHTMLToClipboard'](_0x35699e){const {window:_0x3e61fc,document:_0x5f00fc}=lt;if(_0x3e61fc['ClipboardItem']){const {Blob:_0x332474,ClipboardItem:_0x29f2e1}=_0x3e61fc,_0x3d5d51=[new _0x29f2e1({'text/html':new _0x332474([_0x35699e['innerHTML']],{'type':'text/html'}),'text/plain':new _0x332474([_0x35699e['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3d5d51);}else{const _0x4301aa=_0x5f00fc['createElement']('div');_0x4301aa['style']['position']='absolute',_0x4301aa['style']['left']='-9999px',_0x4301aa['innerHTML']='<span>[</span>'+_0x35699e['innerHTML']+'<span>]</span>',_0x5f00fc['body']['appendChild'](_0x4301aa);const _0x3cdf6f=_0x5f00fc['createRange']();_0x3cdf6f['setStartAfter'](_0x4301aa['firstElementChild']),_0x3cdf6f['setEndBefore'](_0x4301aa['lastElementChild']);const _0x412d9c=_0x3e61fc['getSelection']();_0x412d9c['removeAllRanges'](),_0x412d9c['addRange'](_0x3cdf6f),_0x5f00fc['execCommand']('copy'),_0x4301aa['remove']();}}}class ContentFieldView extends Nt{constructor(_0x39cdb6,_0x1b9d6=''){super(_0x39cdb6),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1b9d6,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x6877be){this['element']['innerHTML']=_0x6877be;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x36f00f=new Nt(),_0x599e14=this['locale'],_0x564578=new xt();return _0x564578['isVisible']=!0x0,_0x36f00f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x564578,{'text':Si(_0x599e14,'AI\x20is\x20writing...')}]}),_0x36f00f['render'](),_0x36f00f;}}class AIFormErrorView extends Nt{constructor(_0x41099a,_0x768eed=''){super(_0x41099a);const _0x4e549d=new Lt(),_0x54fad5=this['bindTemplate'];this['set']('text',_0x768eed),_0x4e549d['content']=_0x480c2f,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4e549d,{'text':_0x54fad5['to']('text')}]});}}class AIFormPromptView extends Pt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x28d805,_0x3e31e3){super(_0x28d805,_0x3e31e3),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x1c8b59,_0x684251)=>{_0x1c8b59['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x684251());});}['_createSubmitButton'](){const _0x577883=new yt(this['locale']),_0xc14b48=this['locale'];return _0x577883['set']({'icon':_0x411441,'label':Si(_0xc14b48,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x577883['on']('execute',()=>{this['submit']();}),_0x577883['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x324fad,_0x433157)=>!_0x324fad&&_0x433157),_0x577883;}['_createShowHistoryButton'](){const _0xc9d507=new yt(this['locale']),_0x1f6389=this['resultsView'],_0x4fc0cc=this['locale'];_0xc9d507['set']({'label':Si(_0x4fc0cc,'History'),'withText':!0x1,'icon':_0x203cca,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xc9d507['bind']('isOn')['to'](_0x1f6389,'isVisible'),_0xc9d507['bind']('isEnabled')['to'](this,'isEnabled'),_0xc9d507['on']('execute',()=>{_0x1f6389['isVisible']=!_0x1f6389['isVisible'],_0x1f6389['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3ea6b8=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x456801=new dt(this['queryView']['fieldView']['element']),_0x32f5a1=_0x456801['width'],_0x5c530d='rtl'===_0x4fc0cc['uiLanguageDirection']?'left':'right';_0x456801['excludeScrollbarsAndBorders'](),_0xc9d507['element']['style'][_0x5c530d]=_0x32f5a1-_0x456801['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3ea6b8),this['on']('render',_0x3ea6b8),_0xc9d507;}['submit'](){const _0x24c594=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x24c594);}['focus'](_0x181dc1){-0x1===_0x181dc1?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class AIHistoryListView extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2d02cd){super(_0x2d02cd),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Vt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Si(_0x2d02cd,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2607c3=0x0;for(const _0x94f6c3 of this['items'])_0x2607c3+=_0x94f6c3['items']['length'];return{'resultsCount':_0x2607c3,'totalItemsCount':_0x2607c3};}['_createClearHistoryButton'](){const _0x182073=this['locale'],_0x3a4195=new yt(this['locale']);return _0x3a4195['set']({'label':'('+Si(_0x182073,'Clear')+')','withText':!0x0}),_0x3a4195['on']('execute',()=>this['fire']('clearHistory')),_0x3a4195;}}class AIHistoryListItemView extends Ht{constructor(_0x31416c){super();const _0x380964=new Mt(),_0x26ea1e=new yt(this['locale'],_0x380964);this['children']['add'](_0x26ea1e),_0x26ea1e['set']({'label':_0x31416c['prompt'],'withText':!0x0}),_0x26ea1e['on']('execute',()=>{this['fire']('execute',{'value':_0x2d155e(_0x31416c['prompt'])});});}}const yi='CKEditor/AIFormView/PromptHistory';class PromptHistory extends _t{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x6ca9ce,_0x9d79f)=>{const _0x41011e=Ni(_0x9d79f['prompt']);for(const _0x1fd583 of this)if(_0x1fd583!=_0x9d79f&&Ni(_0x1fd583['prompt'])===_0x41011e){this['remove'](_0x1fd583);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x3e79a4=sessionStorage['getItem'](yi)||'[]';this['addMany'](JSON['parse'](_0x3e79a4));}['_saveToSessionStorage'](){sessionStorage['setItem'](yi,JSON['stringify'](this['map'](_0xc78b45=>_0xc78b45)));}}function Ni(_0x57ee9b){return _0x57ee9b['toLowerCase']()['trim']();}class AIFormView extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1ea5db,_0x441edb,_0x452d42=''){super(_0x1ea5db),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ki['REPLACE']),this['_promptHistory']=new PromptHistory(),this['errorView']=new AIFormErrorView(_0x1ea5db),this['contentArea']=new AIFormContentArea(_0x1ea5db,_0x452d42),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new It(),this['keystrokes']=new At(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x43e380=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x441edb],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x43e380['if']('isError','ck-hidden',_0x48d34b=>!_0x48d34b)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x2c821a=0x1){-0x1===_0x2c821a?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x3db7d9=this['locale'],_0x18e9c3=new AIFormPromptView(_0x3db7d9,{'queryView':{'label':Si(_0x3db7d9,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Bt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Si(_0x3db7d9,'Empty\x20history'),'secondary':Si(_0x3db7d9,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x18e9c3['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x54c0d4,_0x425578)=>_0x54c0d4&&!_0x425578),this['listenTo'](_0x18e9c3,'submit',(_0x42c2ab,_0x2b1376)=>{this['prompt']=_0x2b1376;const _0x1d4d3a=_0xe3e6fb(_0x2b1376);this['fire']('submitPrompt',_0x1d4d3a),_0x2b1376['trim']()&&this['_promptHistory']['add']({'prompt':_0x1d4d3a},0x0);},{'priority':'high'}),_0x18e9c3;}['_createHistoryView'](){const _0x3acaa2=new AIHistoryListView(this['locale']);return _0x3acaa2['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](AIHistoryListItemView),_0x3acaa2['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3acaa2;}['_createToolbar'](){const _0x4c7947=new AIFormToolbarView(this['locale']);return _0x4c7947['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xf6ff6b,_0x2565a2,_0x188fc2)=>_0xf6ff6b&&!_0x2565a2&&!!_0x188fc2),_0x4c7947['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4c7947['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x126efe,_0x21b149,_0x3fedce)=>_0x126efe&&!_0x21b149&&!!_0x3fedce),_0x4c7947['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4c7947['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x111d84,_0x383175)=>_0x111d84&&!_0x383175),_0x4c7947['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4c7947['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4c7947['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4c7947;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x49e5a7=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Si(_0x49e5a7,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x48e9a0){const _0x1c2348=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x48e9a0||Si(_0x1c2348,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const xi=globalThis['DataTransfer'];class AIAssistantUI extends _0x364f72{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x155a4b,AIAssistantEditing,AIAdapter,Gt];}constructor(_0x300e1c){super(_0x300e1c),_0x300e1c['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x300e1c['config']['define']('ai.assistant.contentAreaCssClass',''),_0x300e1c['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x300e1c['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x237564}=this;this['_aiAdapter']=_0x237564['plugins']['get'](AIAdapter),this['_dialog']=_0x237564['plugins']['get'](Gt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x31f391=new ShowAIAssistantCommand(_0x237564,Array['from'](this['_commandDefinitions']['values']()));_0x237564['commands']['add']('showAIAssistant',_0x31f391),_0x237564['ui']['componentFactory']['add']('aiCommands',_0x39789d=>{const _0xdc95d4=Ft(_0x39789d);return _0xdc95d4['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0xdc95d4['buttonView']['set']({'label':Si(_0x39789d,'AI\x20Commands'),'icon':_0x55be79,'tooltip':!0x0}),_0xdc95d4['on']('execute',_0x4d6bf2=>this['_onExecute'](_0x4d6bf2['source']['id'])),Wt(_0xdc95d4,_0x237564['ui']['view']['body'],function(_0x268d5d){const _0xc9b118=fi(_0x268d5d['config']['get']('ai.assistant.commands'),_0x268d5d['locale']),_0x122cfe=Pi(_0x268d5d,_0xc9b118)['filter'](_0x371ee8=>_0x371ee8['commands']['length']);if(0x1===_0x122cfe['length'])return Pi(_0x268d5d,_0x122cfe[0x0]['commands'])['map'](_0x693cd1=>({'id':_0x693cd1['id'],'label':_0x693cd1['label']}));return _0x122cfe['map'](_0x21117d=>{const {groupId:_0x3a63ee,groupLabel:_0x2b7803,commands:_0x338a29}=_0x21117d,_0x312093=Pi(_0x268d5d,_0x338a29)['map'](_0x505f10=>({'id':_0x505f10['id'],'label':_0x505f10['label']}));return{'id':_0x3a63ee,'menu':_0x2b7803||_0x3a63ee,'children':_0x312093};});}(_0x237564),{'ariaLabel':Si(_0x39789d,'AI\x20Commands')}),_0xdc95d4['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x31f391['on']('change:enabledCommandsIds',_0x3f19a8),_0xdc95d4['menuView']['once']('render',_0x3f19a8),_0xdc95d4;function _0x3f19a8(){_0xdc95d4['isEnabled']=_0x31f391['enabledCommandsIds']['length']>0x0;for(const _0x51329c of _0xdc95d4['menuView']['buttons'])_0x51329c['isEnabled']=_0x31f391['enabledCommandsIds']['includes'](_0x51329c['id']);}}),_0x237564['ui']['componentFactory']['add']('menuBar:aiCommands',_0x298944=>{const _0xf824cc=new Kt(_0x298944);_0xf824cc['buttonView']['set']({'label':Si(_0x298944,'AI\x20Commands'),'icon':_0x55be79}),_0xf824cc['bind']('isEnabled')['to'](_0x31f391,'enabledCommandsIds',_0xae8c0f=>_0xae8c0f['length']>0x0);const _0x5c4518=fi(_0x237564['config']['get']('ai.assistant.commands'),_0x298944);return this['_populateMenuBarMenu'](_0x31f391,_0xf824cc,_0x5c4518,_0x2df329=>this['_onExecute'](_0x2df329)),_0xf824cc;}),_0x237564['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x32eeb5=this['_createAIAssistantUIButton'](yt);return _0x32eeb5['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x32eeb5;}),_0x237564['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4e0039=this['_createAIAssistantUIButton'](Yt);return _0x4e0039['set']({'role':'menuitemcheckbox'}),_0x4e0039;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2d8c84=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x51acdf;for(const _0x517153 in _0x2d8c84){const _0x1f5d85=_0x517153,_0x2a002d=_0x2d8c84[_0x1f5d85];if('aiLicenseKeyValid'==_0x2a002d||'aiLicenseKeyInvalid'==_0x2a002d||'aiLicenseKeyExpired'==_0x2a002d||'aiLicenseKeyDomainLimit'==_0x2a002d||'aiLicenseKeyNotAllowed'==_0x2a002d||'aiLicenseKeyEvaluationLimit'==_0x2a002d||'aiLicenseKeyUsageLimit'==_0x2a002d){delete _0x2d8c84[_0x1f5d85],_0x51acdf=_0x2a002d,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x51acdf&&_0x2d8c84['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x51acdf&&_0x2d8c84['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x51acdf&&_0x2d8c84['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x51acdf&&_0x2d8c84['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x51acdf&&_0x2d8c84['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x51acdf&&_0x2d8c84['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x19f3d3='',_0x45f3fa='',_0x4d453a='custom'){const _0x4ee1a4=this['editor'],_0x4c9274=_0x4ee1a4['editing']['view'],_0x422c3b=_0x4ee1a4['plugins']['get'](AIAssistantEditing),_0xc656b4=_0x4ee1a4['plugins']['get'](_0x155a4b);_0x422c3b['showFakeVisualSelection']();const _0x406a9a=new xi(),_0xfa70ed=new ClipboardEvent('copy',{'clipboardData':_0x406a9a}),_0x382343=new _0x50ae46(_0x406a9a),_0x4b8775=new _0x427107(_0x4c9274,_0xfa70ed,{'dataTransfer':_0x382343});_0xc656b4['_forceMarkersCopy']('comment',()=>{_0x4c9274['document']['fire']('copy',_0x4b8775);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new AIAssistantController(_0x4ee1a4,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x481270=_0x382343['getData']('text/html');const _0x52b831=_0x4ee1a4['model']['document']['selection'],_0x5808a7=Array['from'](_0x52b831['getRanges']());0x1===_0x5808a7['length']&&_0x5808a7[0x0]['isFlat']&&!_0x52b831['getSelectedElement']()&&''!==_0x481270['replace'](/ /g,'')['trim']()&&(_0x481270='<p>'+_0x481270+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4d453a,'query':_0x19f3d3,'htmlContent':_0x481270,'label':_0x45f3fa,'mainActionLabel':ki[_0x4ee1a4['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4757a0,'title':Si(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':$t['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x422c3b['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x139a99=new Map(),_0x4b146e=fi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x331177 of _0x4b146e)for(const _0x1e0de8 of _0x331177['commands'])_0x139a99['set'](_0x1e0de8['id'],{..._0x1e0de8,'groupId':_0x331177['groupId'],'groupLabel':_0x331177['groupLabel']||_0x331177['groupId']});return _0x139a99;}['_createAIAssistantUIButton'](_0xbf7ea8){const _0x269672=this['editor'],_0x416497=_0x269672['commands']['get']('showAIAssistant'),_0x5824d6=new _0xbf7ea8(_0x269672['locale']);return _0x5824d6['set']({'label':Si(_0x269672['locale'],'AI\x20Assistant'),'icon':_0x4757a0,'isToggleable':!0x0}),_0x5824d6['bind']('isEnabled')['to'](_0x416497),_0x5824d6['bind']('isOn')['to'](this['_dialog'],'id',_0x3fecd9=>'aiAssistant'===_0x3fecd9),this['listenTo'](_0x5824d6,'execute',()=>{_0x5824d6['isOn']?this['hideUI']():_0x416497['execute']();}),_0x5824d6;}['_initView'](){const _0x52a6c8=this['editor']['plugins']['get'](AIAssistantEditing);this['_formView']=new AIFormView(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x52a6c8['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x52a6c8['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4e7d7d,ui:{ariaLiveAnnouncer:_0x2a3e35}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x30dfdd,_0x2a6262,_0x1aab65)=>{const _0x565370=this['_aiAssistantController']['currentContext'];_0x1aab65?_0x2a3e35['announce'](Si(_0x4e7d7d,'AI\x20is\x20writing')):_0x565370&&_0x2a3e35['announce'](Si(_0x4e7d7d,'Generated\x20content:\x20%0',_0x565370),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3f9160,_0x5c9cb8,_0x2376ae)=>{if(_0x2376ae){const _0x2dc7e4=this['_formView']['errorView']['text'];_0x2a3e35['announce'](Si(_0x4e7d7d,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2dc7e4));}});}['_onExecute'](_0x284207){const _0x4f4aed=this['_commandDefinitions']['get'](_0x284207),_0x476202=this['editor'],_0x59f500=_0x476202['model']['document']['selection'],_0x4764dc=_0x476202['commands']['get']('showAIAssistant'),_0x195c4f=_0x476202['plugins']['get'](AIAssistantEditing),_0x305862=''+(_0x4f4aed['groupId']!==Ti?_0x4f4aed['groupLabel']+':\x20':'')+_0x4f4aed['label'];if(!0x1!==_0x4f4aed['requiresContent']&&_0x59f500['isCollapsed']){const _0x5a9576=gt(_0x59f500['getSelectedBlocks']())||_0x476202['model']['schema']['getLimitElement'](_0x59f500);_0x476202['model']['change'](_0x2a2bb3=>{_0x2a2bb3['setSelection'](_0x5a9576,'in');});}_0x195c4f['showFakeVisualSelection'](),_0x4764dc['execute'](_0x4f4aed['prompt'],_0x305862,'command:'+_0x284207);}['_populateMenuBarMenu'](_0x559bb4,_0x21ce94,_0x475dfe,_0x1d2051){const _0x3584a5=this['editor'],_0x5b268b=_0x3584a5['locale'],_0x387e2e=new qt(_0x5b268b),_0xdee689=Pi(_0x3584a5,_0x475dfe)['filter'](_0x4f95bd=>_0x4f95bd['commands']['length']);0x1===_0xdee689['length']?this['_getMenuBarGroupButtons']({'command':_0x559bb4,'commands':_0xdee689[0x0]['commands'],'parentMenuView':_0x21ce94,'onExecute':_0x1d2051})['forEach'](_0xcf6db4=>_0x387e2e['items']['add'](_0xcf6db4)):_0xdee689['forEach'](({groupId:_0x52222f,groupLabel:_0x3ebcdc,commands:_0x19e200})=>{const _0x5b2cd0=new Qt(_0x5b268b,_0x21ce94),_0x3d1ad1=new Kt(_0x5b268b),_0x518b1e=new qt(_0x5b268b),_0x430f3a=this['_getMenuBarGroupButtons']({'command':_0x559bb4,'commands':_0x19e200,'parentMenuView':_0x3d1ad1,'onExecute':_0x1d2051});_0x3d1ad1['buttonView']['set']({'label':_0x3ebcdc||_0x52222f}),_0x3d1ad1['delegate']('execute')['to'](_0x21ce94),_0x518b1e['items']['addMany'](_0x430f3a),_0x3d1ad1['panelView']['children']['add'](_0x518b1e),_0x5b2cd0['children']['add'](_0x3d1ad1),_0x387e2e['items']['add'](_0x5b2cd0);}),_0x21ce94['panelView']['children']['add'](_0x387e2e);}['_getMenuBarGroupButtons']({command:_0x33ec94,commands:_0x239a76,parentMenuView:_0x16288c,onExecute:_0x136849}){const _0x4607ea=this['editor'],_0x44aa20=_0x4607ea['locale'];return Pi(_0x4607ea,_0x239a76)['map'](_0x2868eb=>{const _0x49e7b1=new Qt(_0x44aa20,_0x16288c),_0x349880=new Yt(_0x44aa20);return _0x349880['set']({'label':_0x2868eb['label']}),_0x349880['delegate']('execute')['to'](_0x16288c),_0x349880['on']('execute',()=>_0x136849(_0x2868eb['id'])),_0x349880['bind']('isEnabled')['to'](_0x33ec94,'enabledCommandsIds',_0x1a1412=>_0x1a1412['includes'](_0x2868eb['id'])),_0x49e7b1['children']['add'](_0x349880),_0x49e7b1;});}}function Li(_0x312ee7,_0x1adb39){return void 0x0!==_0x312ee7['order']&&void 0x0===_0x1adb39['order']?0x1:void 0x0===_0x312ee7['order']&&void 0x0!==_0x1adb39['order']?-0x1:void 0x0!==_0x312ee7['order']&&void 0x0!==_0x1adb39['order']?_0x312ee7['order']-_0x1adb39['order']:0x0;}function Pi(_0x538b98,_0x54a06a){_0x54a06a['sort'](Li);const _0x6e8477={},_0x3e88cb=[];for(const _0x4e8439 of _0x54a06a)if(void 0x0!==_0x4e8439['order']){if(_0x4e8439['order']in _0x6e8477)throw new ht('ai-commands-config-order-collision',_0x538b98,{'conflictingDefinitions':[_0x4e8439,_0x6e8477[_0x4e8439['order']]]});_0x6e8477[_0x4e8439['order']]=_0x4e8439,_0x3e88cb['splice'](_0x4e8439['order'],0x0,_0x4e8439);}else _0x3e88cb['push'](_0x4e8439);return _0x3e88cb;}class AIAssistant extends _0x364f72{static get['requires'](){return[AIAssistantUI,AIAssistantEditing];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1afdf5){super(_0x1afdf5);const _0x2d38a2=_0x1afdf5['config'],_0x140aac=_0x1afdf5['locale'];_0x2d38a2['define']('ai.assistant.preserveComments',!0x0),_0x2d38a2['define']('ai.assistant.commands',Di(_0x140aac)),_0x2d38a2['define']('ai.assistant.extraCommandGroups',[]),_0x2d38a2['define']('ai.assistant.removeCommands',[]);let _0xe0e77e=fi(_0x2d38a2['get']('ai.assistant.commands'),_0x140aac);const _0x10b21b=_0x2d38a2['get']('ai.assistant.extraCommandGroups'),_0x465b70=_0x2d38a2['get']('ai.assistant.removeCommands');_0x10b21b['forEach'](_0x4e5731=>{const _0x1680c3=_0xe0e77e['find'](_0x232ad9=>_0x232ad9['groupId']===_0x4e5731['groupId']);_0x1680c3?_0x1680c3['commands']=_0x1680c3['commands']['concat'](_0x4e5731['commands']):_0xe0e77e['push'](_0x4e5731);}),_0xe0e77e=_0xe0e77e['filter'](_0x1f5add=>!_0x465b70['includes'](_0x1f5add['groupId'])),_0xe0e77e['forEach'](_0x5d340e=>{_0x5d340e['commands']=_0x5d340e['commands']['filter'](_0x486bf3=>!_0x465b70['includes'](_0x486bf3['id']));}),_0x2d38a2['set']('ai.assistant.commands',_0xe0e77e);}}function Di(_0x1d3f5e){return[{'groupId':'editOrReview','groupLabel':Si(_0x1d3f5e,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Si(_0x1d3f5e,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Si(_0x1d3f5e,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Si(_0x1d3f5e,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Si(_0x1d3f5e,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Si(_0x1d3f5e,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Si(_0x1d3f5e,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Si(_0x1d3f5e,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Si(_0x1d3f5e,'Change\x20tone'),'commands':[{'id':'professional','label':Si(_0x1d3f5e,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Si(_0x1d3f5e,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Si(_0x1d3f5e,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Si(_0x1d3f5e,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Si(_0x1d3f5e,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Si(_0x1d3f5e,'Change\x20style'),'commands':[{'id':'business','label':Si(_0x1d3f5e,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Si(_0x1d3f5e,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Si(_0x1d3f5e,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Si(_0x1d3f5e,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Si(_0x1d3f5e,'Translate'),'commands':[{'id':'translateEnglish','label':Si(_0x1d3f5e,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Si(_0x1d3f5e,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Si(_0x1d3f5e,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Si(_0x1d3f5e,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Si(_0x1d3f5e,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Si(_0x1d3f5e,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Si(_0x1d3f5e,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Si(_0x1d3f5e,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class AITextAdapter extends _0x364f72{['abortController'];static get['requires'](){return[AIAdapter];}constructor(_0x3503cf){super(_0x3503cf),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](AIAdapter)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x2660ac){return this['sendRequest'](_0x2660ac)['catch'](_0x59fcef=>{if(_0x59fcef instanceof AIRequestError)return Promise['reject'](_0x59fcef);if('AbortError'==_0x59fcef['name'])return Promise['resolve']();throw console['error'](_0x59fcef),new ht('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x7ba8c7,_0x54f57c){const _0x100ef9=this['editor']['locale'],_0x3c1bb5={'Content-Type':'application/json'};if('object'==typeof _0x7ba8c7)Object['assign'](_0x3c1bb5,_0x7ba8c7);else{if(_0x7ba8c7)try{const _0x46f13d=await _0x7ba8c7(_0x54f57c);Object['assign'](_0x3c1bb5,_0x46f13d);}catch{return Promise['reject'](new AIRequestError(Si(_0x100ef9,'AI_ERROR_GET_HEADERS')));}}return _0x3c1bb5;}async['_prepareRequestParameters'](_0x4da6be,_0x48da72){const _0x30020b=this['editor']['locale'];if('object'==typeof _0x4da6be)return _0x4da6be;try{return await _0x4da6be(_0x48da72);}catch{return Promise['reject'](new AIRequestError(Si(_0x30020b,'AI_ERROR_GET_PARAMETERS')));}}}class OpenAITextAdapter extends AITextAdapter{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4fa363){super(_0x4fa363),_0x4fa363['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4fa363['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4fa363['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4fa363['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4fa363['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4fa363['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x30f028,context:_0x1800dc,onData:_0x11d21d,actionId:_0x14fd73}){const _0x315ba4=this['editor']['locale'],_0x9a1c9b=await this['prepareMessages'](_0x30f028,_0x1800dc,_0x14fd73),_0x1b7c70=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x14fd73),_0xe7481c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x14fd73),_0x1bbfe8={'messages':_0x9a1c9b,..._0xe7481c},_0xc14099={'method':'POST','headers':_0x1b7c70,'body':JSON['stringify'](_0x1bbfe8),'signal':this['abortController']['signal']},_0x3c00e8=await fetch(this['_apiUrl'],_0xc14099);if(_0x3c00e8['ok'])return _0xe7481c['stream']?await this['_readStreamableResponse'](_0x3c00e8,_0x11d21d):await this['_readStaticResponse'](_0x3c00e8,_0x11d21d),Promise['resolve']();{const _0x40e065=await _0x3c00e8['text']();return _0x40e065['includes']('context_length_exceeded')?Promise['reject'](new AIRequestError(Si(_0x315ba4,'AI_ERROR_CONTEXT_LENGTH'))):_0x40e065['includes']('Moderation')?Promise['reject'](new AIRequestError(Si(_0x315ba4,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x40e065));}}async['prepareMessages'](_0x538fbf,_0x353615,_0x5e34d8){let _0x1059ac,_0x8ce968;return _0x353615?(_0x1059ac='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x8ce968='Instruction:\x0a'+_0x538fbf+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x353615):(_0x1059ac='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x8ce968=_0x538fbf),[{'role':'system','content':_0x1059ac},{'role':'user','content':_0x8ce968}];}async['_readStreamableResponse'](_0x39f248,_0x5cdf6a){const _0xf1d474=_0x39f248['body']['getReader'](),_0x1efa93=new TextDecoder();let _0x55ed12='',_0x191ffa='',_0xd45be4='',_0x25ef35=!0x1;for(;!_0x25ef35;){const {done:_0x2158c6,value:_0x40b0db}=await _0xf1d474['read'](),_0x14c1c4=_0x55ed12+_0x1efa93['decode'](_0x40b0db);let _0x519e5f='';_0x25ef35=_0x2158c6;try{_0x519e5f=this['_cleanUpData'](_0x14c1c4),_0x55ed12='';}catch{_0x55ed12=_0x14c1c4;continue;}_0x191ffa+=_0x519e5f,!_0x25ef35&&this['_isBufferIncomplete'](_0x191ffa)||_0x191ffa&&(_0xd45be4+=_0x191ffa,_0x191ffa='',_0x5cdf6a(_0xd45be4));}return Promise['resolve']();}async['_readStaticResponse'](_0x443186,_0x397dab){return _0x397dab((await _0x443186['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4740b3){const _0x2be5b7=_0x4740b3['split']('<')['length']!==_0x4740b3['split']('>')['length'],_0x1c26ee=_0x4740b3['length']<0x1e;return _0x2be5b7&&_0x1c26ee;}['_cleanUpData'](_0x21a54e){return _0x21a54e['split'](/\n(?![^{]*\})/g)['map'](_0x5976b3=>_0x5976b3['replace']('data:\x20',''))['filter'](_0x4b134f=>_0x4b134f&&_0x4b134f['length']>0x0&&'[DONE]'!==_0x4b134f)['map'](_0x21c27d=>{const {choices:_0x16f5f5}=JSON['parse'](_0x21c27d);if(_0x16f5f5[0x0]?.['delta']?.['content'])return _0x16f5f5[0x0]['delta']['content'];})['filter'](_0x9ec11=>_0x9ec11)['join']('');}}class AWSTextAdapter extends AITextAdapter{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),wt('ai-aws-adapter-not-supported');}async['sendRequest'](_0x3aef29){throw Ct('ai-aws-adapter-not-supported'),new AIRequestError(Si(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class TabButtonView extends yt{constructor(_0x54818f,_0x4ae97f={}){super(_0x54818f),this['isToggleable']=!0x0,this['set']('side',_0x4ae97f['side']||'top');const _0x5550be=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...mt(_0x4ae97f['class']||[]),_0x5550be['to']('side',_0x22ed36=>'ck-tab-button_'+_0x22ed36),_0x5550be['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class TabPanelView extends Nt{['children'];constructor(_0x51a363,_0x30fb74={}){super(_0x51a363);const _0x39c4d7=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...mt(_0x30fb74['class']||[]),_0x39c4d7['to']('class'),_0x39c4d7['if']('isVisible','ck-hidden',_0x2ff2f6=>!_0x2ff2f6)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class AITabsView extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x3fbee6,_0x12ca4f={}){super(_0x3fbee6),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x12ca4f['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x12ca4f['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x3910de,_0x384882)=>_0x3910de&&null!==_0x384882);const _0x1c4492=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...mt(_0x12ca4f['class']||[]),_0x1c4492['to']('side',_0x3ff618=>'ck-tabs_'+_0x3ff618),_0x1c4492['to']('class'),_0x1c4492['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x1c4492['to']('activeTab',_0x8d630a=>null===_0x8d630a?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x1c4492['to']('side',_0x3f8a51=>'ck-tabs__buttons-container_'+_0x3f8a51)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x1c4492['to']('side',_0x5913c6=>'ck-tabs__panels-container_'+_0x5913c6)]},'children':this['panelViews']},...mt(_0x12ca4f['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x203fb8){const _0x5db03f=this['_tabs']['get'](_0x203fb8);return _0x5db03f||null;}['addTab'](_0x30a373){const _0x18ce00=this['_setupButton']({'id':_0x30a373['id'],'label':_0x30a373['buttonLabel'],'icon':_0x30a373['buttonIcon'],'order':_0x30a373['order']}),_0x1df7cc=new TabPanelView(this['locale']);return _0x1df7cc['render'](),_0x30a373['content']&&_0x1df7cc['children']['add'](_0x30a373['content']),this['panelViews']['add'](_0x1df7cc),this['_tabs']['set'](_0x30a373['id'],{'button':_0x18ce00,'panel':_0x1df7cc,'order':void 0x0!==_0x30a373['order']?_0x30a373['order']:null}),this['fire']('addTab:'+_0x30a373['id'],{'id':_0x30a373['id'],'button':_0x18ce00,'panel':_0x1df7cc}),null===this['activeTab']?this['activateTab'](_0x30a373['id']):this['_hidePanel'](_0x30a373['id']),{'button':_0x18ce00,'panel':_0x1df7cc};}['activateTab'](_0x82798c){if(null!==_0x82798c&&!this['getTab'](_0x82798c))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x82798c});if(this['activeTab']===_0x82798c)return;const _0xfaf374=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x82798c,_0x82798c&&this['_showPanel'](_0x82798c),this['fire']('activateTab:'+_0x82798c,{'newTab':_0x82798c,'oldTab':_0xfaf374});}['toggleTabPanel'](_0x3243f4){if(!this['getTab'](_0x3243f4))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3243f4});this['activeTab']===_0x3243f4?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x3243f4);}['showTab'](_0x537fbd){if(!this['getTab'](_0x537fbd))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x537fbd});this['_showPanel'](_0x537fbd),this['_showButton'](_0x537fbd),this['fire']('show:'+_0x537fbd,_0x537fbd);}['hideTab'](_0x55bf93){if(!this['getTab'](_0x55bf93))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x55bf93});const _0x3b5009=this['activeTab'];this['_hidePanel'](_0x55bf93),this['_hideButton'](_0x55bf93);const _0x57a931=this['getTabIds']();_0x3b5009===_0x55bf93&&_0x57a931['length']>0x1&&this['activateTab'](_0x57a931['find'](_0x35075a=>_0x35075a!==_0x55bf93)),this['fire']('hide:'+_0x55bf93,_0x55bf93);}['_getPanel'](_0x58dd35){const _0x367996=this['_tabs']['get'](_0x58dd35);return _0x367996?_0x367996['panel']:null;}['_showPanel'](_0xde991e){null!==this['activeTab']&&this['activeTab']!==_0xde991e||this['_getPanel'](_0xde991e)['show']();}['_hidePanel'](_0x3b3ee7){const _0xdd8f12=this['_getPanel'](_0x3b3ee7);_0xdd8f12['isVisible']&&(this['activeTab']===_0x3b3ee7&&(this['activeTab']=null),_0xdd8f12['hide']());}['_getButton'](_0x45d7fb){const _0x20218c=this['_tabs']['get'](_0x45d7fb);return _0x20218c?_0x20218c['button']:null;}['_showButton'](_0x379667){this['_getButton'](_0x379667)['show']();}['_hideButton'](_0x5e8654){this['_getButton'](_0x5e8654)['hide']();}['_setupButton'](_0x1b66c4){const _0x339fb5=new TabButtonView(this['locale'],{'side':this['side']}),_0x373aa4=this['buttonViews'];if(_0x339fb5['set']({'label':_0x1b66c4['label'],'icon':_0x1b66c4['icon'],'tooltip':!0x0,'withText':!0x0}),_0x339fb5['bind']('isOn')['to'](this,'activeTab',_0xa8ed5b=>_0xa8ed5b===_0x1b66c4['id']),_0x339fb5['bind']('side')['to'](this,'side'),_0x1b66c4['order']){const _0x230245=[...this['_tabs']]['reduce']((_0xbf9ddb,_0x19c230)=>{const _0x44d49b=_0x19c230[0x0],{order:_0xda23b5}=_0x19c230[0x1];return!_0xda23b5||_0xda23b5>_0x1b66c4['order']?_0xbf9ddb:_0xda23b5>=_0xbf9ddb['order']?{'id':_0x44d49b,'order':_0xda23b5}:_0xbf9ddb;},{'id':'','order':0x0}),_0x5c5da8=_0x373aa4['getIndex'](this['_getButton'](_0x230245['id']));_0x373aa4['add'](_0x339fb5,_0x5c5da8+0x1);}else _0x373aa4['add'](_0x339fb5);return _0x339fb5['on']('execute',()=>{this['toggleTabPanel'](_0x1b66c4['id']);}),_0x339fb5;}}const Vi=['overlay','sidebar','custom'],Hi=['left','right'];class AITabsMainView extends AITabsView{constructor(_0x4e7e8d,_0x2c8235={}){super(_0x4e7e8d,_0x2c8235),this['set']('type',_0x2c8235['type']||'sidebar'),this['set']('side',_0x2c8235['side']||'right'),this['set']('isVisible',_0x2c8235['visibleByDefault']??!0x0);const _0x38c297=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x38c297['if']('type','ck-ai-tabs__overlay',_0x5a3e18=>'overlay'===_0x5a3e18),_0x38c297['if']('type','ck-ai-tabs__sidebar',_0x50cf18=>'sidebar'===_0x50cf18),_0x38c297['if']('isVisible','ck-hidden',_0x1419a3=>!_0x1419a3)]}}),this['buttonViews']['on']('add',(_0x571ad6,_0x42edc2)=>{_0x42edc2['set']('withText',!0x1);});}}class AITabs extends _0x5df7d5{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x176c56){if(super(_0x176c56),!this['context']['config']['get']('ai.container'))throw new ht('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x3beb86=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x3beb86['showResizeButton']&&(this['showResizeButton']=_0x3beb86['showResizeButton']),'sidebar'!==_0x3beb86['type']&&'overlay'!==_0x3beb86['type']||_0x3beb86['side']&&(this['side']=_0x3beb86['side']),'sidebar'===_0x3beb86['type']){if(this['container']=_0x3beb86['element'],this['set']('type','sidebar'),!this['container'])throw new ht('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x3beb86['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new AITabsMainView(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x3beb86['visibleByDefault'],'collapsible':_0x3beb86['collapsible']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof _0x2b21e9&&this['context']['ui']['focusTracker']['add'](this['view']['element']),this['listenTo'](this,'resizeTabs',()=>{this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);});}['switchType'](_0x37421b){if(_0x37421b&&this['type']!==_0x37421b){if(!Vi['includes'](_0x37421b))throw new ht('ai-tabs-unsupported-ui-type');this['type']=_0x37421b;}}['switchSide'](_0xeb652c){if(_0xeb652c&&this['side']!==_0xeb652c){if(!Hi['includes'](_0xeb652c))throw new ht('ai-tabs-unsupported-ui-side');this['side']=_0xeb652c;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class AIConnector extends _0x5df7d5{['_apiUrl'];get['_apiUrlV11'](){return this['_apiUrl']['replace'](/\/v1$/,'/v1.1');}['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x5ed7c8];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x58831b){if(super(_0x58831b),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl')['replace'](/\/+$/,''),!this['_apiUrl']['endsWith']('/v1'))throw new ht('ai-service-url-invalid-version',this,{'serviceUrl':this['_apiUrl']});this['_token']=null,this['_decoder']=new TextDecoder(),this['_responseCache']=new Map();}['init'](){const _0x2f0149=this['context']['plugins']['get'](_0x5ed7c8);if(!_0x2f0149['token'])throw new ht('ai-missing-token',this);this['_token']=_0x2f0149['token'];}['startConversation'](_0x19992e,_0x2d8cbf){const _0x3cdbf4=this['_sendApiRequest']('/conversations','POST',{'id':_0x19992e,'group':_0x2d8cbf});return{'getConversation':async()=>(await _0x3cdbf4['request'])['json'](),'abortController':_0x3cdbf4['abortController']};}['queryAssistant']({message:_0x31836b,conversationId:_0x1cbe42,parts:_0x499ef7,capabilities:_0x38eeb6,model:_0x598fc4,attributes:_0x359098}){const _0x23f2d8={'prompt':_0x31836b,'content':_0x499ef7,'model':_0x598fc4,..._0x38eeb6&&{'capabilities':_0x38eeb6},..._0x359098&&{'attributes':_0x359098}},_0x232303=this['_sendApiRequest']('/conversations/'+_0x1cbe42+'/messages','POST',_0x23f2d8,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x45791f=(await _0x232303['request'])['body'];return this['_getStreamReader'](_0x45791f);},'abortController':_0x232303['abortController']};}['executeCustomAction']({content:_0x41d2ef,message:_0x5b42c8,model:_0xd4325f,outputFormat:_0x2aaf5c}){const _0x220231={'content':[{'type':'text','content':_0x41d2ef}],'prompt':_0x5b42c8,'model':_0xd4325f,'outputFormat':_0x2aaf5c},_0x50ec85=this['_sendApiRequest']('/actions/custom/calls','POST',_0x220231);return{'getStream':async()=>{const _0x5aadce=(await _0x50ec85['request'])['body'];return this['_getStreamReader'](_0x5aadce);},'abortController':_0x50ec85['abortController']};}['executeAction']({actionName:_0x309b41,content:_0x26fe38,args:_0x365882}){const _0x241c7a={'content':[{'type':'text','content':_0x26fe38}],'args':_0x365882},_0x2ec95a=this['_sendApiRequest']('/actions/system/'+_0x309b41+'/calls','POST',_0x241c7a);return{'getStream':async()=>{const _0x28e76e=(await _0x2ec95a['request'])['body'];return this['_getStreamReader'](_0x28e76e);},'abortController':_0x2ec95a['abortController']};}['uploadFile'](_0x22faa4,_0x1512eb,_0x4c293f){const _0x711734=new FormData();_0x711734['append']('file',_0x1512eb,_0x1512eb['name']),_0x4c293f&&_0x711734['append']('attributes',JSON['stringify'](_0x4c293f));const _0x483b79=this['_sendApiRequest']('/conversations/'+_0x22faa4+'/files','POST',_0x711734);return{'getId':async()=>(await _0x483b79['request'])['json'](),'abortController':_0x483b79['abortController']};}['fetchDocument'](_0x28edaf,_0x5991c7){const _0x3b7a58=this['_sendApiRequest']('/conversations/'+_0x28edaf+'/documents/'+_0x5991c7,'GET');return{'getDocument':async()=>(await _0x3b7a58['request'])['json'](),'abortController':_0x3b7a58['abortController']};}['uploadDocument'](_0x538ce7,_0x43c4af,_0x4e0736){const _0x5012e={'content':_0x43c4af};_0x4e0736&&(_0x5012e['attributes']=_0x4e0736);const _0x2e8aa2=this['_sendApiRequest']('/conversations/'+_0x538ce7+'/documents','POST',_0x5012e);return{'getId':async()=>(await _0x2e8aa2['request'])['json'](),'abortController':_0x2e8aa2['abortController']};}['uploadDocuments'](_0x38d6bb,_0x59f9a8){const _0x163c8e={'documents':_0x59f9a8['map'](_0x26f398=>({'content':_0x26f398['content'],'attributes':{'version':_0x26f398['version'],'sessionId':_0x26f398['sessionId'],'channelId':_0x26f398['channelId'],'rootName':_0x26f398['rootName'],'selections':_0x26f398['selections']},...void 0x0!==_0x26f398['name']?{'name':_0x26f398['name']}:{},...void 0x0!==_0x26f398['description']?{'description':_0x26f398['description']}:{}}))},_0x528209=this['_sendApiRequest']('/conversations/'+_0x38d6bb+'/documents/batch','POST',_0x163c8e);return{'getIds':async()=>(await _0x528209['request'])['json'](),'abortController':_0x528209['abortController']};}['fetchDocuments'](_0x5cda44,_0x2c4d77){const _0x397223=new URLSearchParams();_0x397223['append']('documentIds',_0x2c4d77['join'](','));const _0x2f2940=this['_sendApiRequest']('/conversations/'+_0x5cda44+'/documents/batch?'+_0x397223['toString'](),'GET');return{'getDocuments':async()=>(await _0x2f2940['request'])['json'](),'abortController':_0x2f2940['abortController']};}['fetchConversations'](_0x355d59,_0x26c0e6={}){const _0x3730ba=new URLSearchParams();_0x3730ba['append']('group',_0x355d59),_0x3730ba['append']('excludeEmpty',!0x1!==_0x26c0e6['excludeEmpty']?'true':'false'),_0x3730ba['append']('limit',_0x26c0e6['limit']?_0x26c0e6['limit']['toString']():'100'),_0x3730ba['append']('sortBy',_0x26c0e6['sortBy']?_0x26c0e6['sortBy']:'createdAt'),_0x3730ba['append']('order',_0x26c0e6['order']?_0x26c0e6['order']:'desc');const _0x36be67=this['_sendApiRequest']('/conversations?'+_0x3730ba['toString'](),'GET');return{'getConversations':async()=>{const _0x5e3385=await _0x36be67['request'];return(await _0x5e3385['json']())['items'];},'abortController':_0x36be67['abortController']};}['deleteConversation'](_0x4945ee){const _0x22812f=this['_sendApiRequest']('/conversations/'+_0x4945ee,'DELETE');return{'execute':async()=>{await _0x22812f['request'];},'abortController':_0x22812f['abortController']};}['updateConversation'](_0x582004,_0x596934){const _0x394a2b=this['_sendApiRequest']('/conversations/'+_0x582004,'PATCH',_0x596934);return{'getResult':async()=>(await _0x394a2b['request'],_0x596934),'abortController':_0x394a2b['abortController']};}['fetchConversation'](_0x316798){const _0x5dd4b3=this['_sendApiRequest']('/conversations/'+_0x316798,'GET');return{'getConversation':async()=>(await _0x5dd4b3['request'])['json'](),'abortController':_0x5dd4b3['abortController']};}['fetchConversationMessages'](_0x17eef7){const _0x55649b=this['_sendApiRequest']('/conversations/'+_0x17eef7+'/messages','GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getMessages':async()=>{const _0x41aadf=await _0x55649b['request'];return(await _0x41aadf['json']())['items'];},'abortController':_0x55649b['abortController']};}['uploadUrl'](_0x35ac00,_0x3e94e7,_0x5511d0){const _0x40667c=this['_sendApiRequest']('/conversations/'+_0x35ac00+'/web-resources','POST',{'url':_0x3e94e7,'attributes':_0x5511d0});return{'getId':async()=>(await _0x40667c['request'])['json'](),'abortController':_0x40667c['abortController']};}['getModels'](_0x525c38='en'){const _0x2b1215=new URLSearchParams();_0x2b1215['append']('language',_0x525c38);const _0x40c32e='/models/1?'+_0x2b1215['toString'](),_0x36e199=this['_sendApiRequest'](_0x40c32e,'GET',void 0x0,{'useCache':!0x0});return{'list':async()=>await(await _0x36e199['request'])['json'](),'abortController':_0x36e199['abortController']};}['deleteFile'](_0x2fe593,_0x259dc0){const _0x48b220=this['_sendApiRequest']('/conversations/'+_0x2fe593+'/files/'+_0x259dc0,'DELETE');return{'execute':async()=>{await _0x48b220['request'];},'abortController':_0x48b220['abortController']};}['deleteDocument'](_0x173fdd,_0x1f5ebc){const _0xb0df99=this['_sendApiRequest']('/conversations/'+_0x173fdd+'/documents/'+_0x1f5ebc,'DELETE');return{'execute':async()=>{await _0xb0df99['request'];},'abortController':_0xb0df99['abortController']};}['deleteWebResource'](_0x3a5fce,_0x2ed8a7){const _0x469d79=this['_sendApiRequest']('/conversations/'+_0x3a5fce+'/web-resources/'+_0x2ed8a7,'DELETE');return{'execute':async()=>{await _0x469d79['request'];},'abortController':_0x469d79['abortController']};}['cancelStream'](_0x59fced,_0x466378){const _0xf11384=this['_sendApiRequest']('/conversations/'+_0x59fced+'/messages/'+_0x466378+'/stream','DELETE',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'execute':async()=>{await _0xf11384['request'];},'abortController':_0xf11384['abortController']};}['resumeStream'](_0x56ed19,_0x15d9b8,_0x1a8dae='0-0'){const _0x4179ab=new URLSearchParams({'lastEventId':_0x1a8dae}),_0xf6ecc8=this['_sendApiRequest']('/conversations/'+_0x56ed19+'/messages/'+_0x15d9b8+'/stream?'+_0x4179ab['toString'](),'GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x20e10d=await _0xf6ecc8['request'];return this['_getStreamReader'](_0x20e10d['body']);},'abortController':_0xf6ecc8['abortController']};}['callSystemReview']({reviewName:_0x4aecf9,content:_0x33dab5,args:_0x18af83}){const _0x1f08e8=this['_sendApiRequest']('/reviews/system/'+_0x4aecf9+'/calls','POST',{'content':[{'type':'text','content':_0x33dab5}],'args':_0x18af83});return{'getStream':async()=>{const _0x2a6b57=(await _0x1f08e8['request'])['body'];return this['_getStreamReader'](_0x2a6b57);},'abortController':_0x1f08e8['abortController']};}['callCustomReview']({content:_0x5ec963,prompt:_0x1b28be,model:_0x39b7b2}){const _0x5739aa=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x5ec963}],'prompt':_0x1b28be,'model':_0x39b7b2});return{'getStream':async()=>{const _0x301c69=(await _0x5739aa['request'])['body'];return this['_getStreamReader'](_0x301c69);},'abortController':_0x5739aa['abortController']};}['upsertAIChatRating'](_0x4316f9,_0x4e3426,_0xa7a7cc){const _0x14820c=this['_sendApiRequest']('/conversations/'+_0x4316f9+'/messages/'+_0x4e3426+'/ratings','PUT',{'positiveCount':_0xa7a7cc['positiveCount'],'totalCount':_0xa7a7cc['totalCount'],'modificationId':_0xa7a7cc['modificationId']});return{'execute':async()=>{await _0x14820c['request'];},'abortController':_0x14820c['abortController']};}['upsertAIActionRating'](_0xe2f0c4,_0x365654,_0x5eaa32){const _0x7645ad=this['_sendApiRequest']('/actions/system/'+_0xe2f0c4+'/calls/'+_0x365654+'/ratings','PUT',{'positiveCount':_0x5eaa32['positiveCount'],'totalCount':_0x5eaa32['totalCount']});return{'execute':async()=>{await _0x7645ad['request'];},'abortController':_0x7645ad['abortController']};}['upsertCustomAIActionRating'](_0x2b443b,_0x7d437e){const _0x3cea76=this['_sendApiRequest']('/actions/custom/calls/'+_0x2b443b+'/ratings','PUT',{'positiveCount':_0x7d437e['positiveCount'],'totalCount':_0x7d437e['totalCount']});return{'execute':async()=>{await _0x3cea76['request'];},'abortController':_0x3cea76['abortController']};}['upsertAIReviewRating'](_0x3b86a8,_0x1ac2b1,_0x1b251f,_0x44b316){const _0x94eb40=this['_sendApiRequest']('/reviews/system/'+_0x3b86a8+'/calls/'+_0x1ac2b1+'/ratings','PUT',{'positiveCount':_0x1b251f['positiveCount'],'totalCount':_0x1b251f['totalCount'],'dataId':_0x44b316});return{'execute':async()=>{await _0x94eb40['request'];},'abortController':_0x94eb40['abortController']};}['upsertCustomAIReviewRating'](_0x3d2b98,_0x31413b,_0xc0b37c){const _0x1273a5=this['_sendApiRequest']('/reviews/custom/calls/'+_0x3d2b98+'/ratings','PUT',{'positiveCount':_0x31413b['positiveCount'],'totalCount':_0x31413b['totalCount'],'dataId':_0xc0b37c});return{'execute':async()=>{await _0x1273a5['request'];},'abortController':_0x1273a5['abortController']};}['_sendApiRequest'](_0x21c7e4,_0xa01752,_0x3357ac,_0x5314b0={}){const {useCache:_0x1d78db=!0x1,apiUrl:_0x521a2b=this['_apiUrl']}=_0x5314b0,_0x36e8a1=new AbortController(),_0x5d05d3=_0x1d78db?_0xa01752+':'+_0x21c7e4:null;if(_0x5d05d3){const _0x2db47e=this['_responseCache']['get'](_0x5d05d3);if(_0x2db47e)return{'request':_0x2db47e['then'](_0x1aa8ba=>_0x1aa8ba['clone']()),'abortController':_0x36e8a1};}const _0x1923fd=_0x3357ac instanceof FormData,_0x552222={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':pt};_0x3357ac&&!_0x1923fd&&(_0x552222['Content-Type']='application/json');const _0x282654={'method':_0xa01752,'headers':_0x552222,'signal':_0x36e8a1['signal']};_0x3357ac&&(_0x282654['body']=_0x1923fd?_0x3357ac:JSON['stringify'](_0x3357ac));const _0x95d875=fetch(''+_0x521a2b+_0x21c7e4,_0x282654)['catch'](_0x2f56f6=>{_0x5d05d3&&this['_responseCache']['delete'](_0x5d05d3),this['_handleError'](_0x2f56f6);})['then'](_0x161ea5=>_0x161ea5['ok']?_0x161ea5:_0x161ea5['json']()['then'](_0x3884f7=>{throw _0x5d05d3&&this['_responseCache']['delete'](_0x5d05d3),{'url':_0x521a2b,'path':_0x21c7e4,'method':_0xa01752,'body':_0x3357ac,'status':(_0x161ea5||{})['status'],'statusText':(_0x161ea5||{})['statusText'],'code':_0x3884f7['code'],'message':_0x3884f7['message'],'traceId':_0x3884f7['traceId']};}));return _0x5d05d3&&this['_responseCache']['set'](_0x5d05d3,_0x95d875['then'](_0x304148=>_0x304148['clone']())),{'request':_0x95d875,'abortController':_0x36e8a1};}async*['_getStreamReader'](_0x2dd4f2){const _0x1c51e1=[],_0x20213f=_0x2dd4f2['getReader'](),_0x12b80c=_0x4ef989({'onError':_0x3ab3d8=>{this['_handleError'](_0x3ab3d8);},'onEvent':_0x4d560d=>{_0x4d560d['data']=JSON['parse'](_0x4d560d['data']),_0x1c51e1['push'](_0x4d560d);}});try{let _0x58d78b=!0x1;for(;!_0x58d78b;){const {done:_0x1da4b0,value:_0x21a60f}=await _0x20213f['read']();_0x1da4b0&&(_0x58d78b=!0x0),_0x12b80c['feed'](this['_decoder']['decode'](_0x21a60f,{'stream':!0x0})),yield*_0x1c51e1,_0x1c51e1['length']=0x0;}}catch(_0x2f2150){this['_handleError'](_0x2f2150);}finally{_0x20213f['releaseLock'](),_0x12b80c['reset']();}}['_handleError'](_0x48f100){if(_0x48f100 instanceof ht)throw _0x48f100;if(_0x48f100 instanceof Error&&'AbortError'===_0x48f100['name'])throw new ht('ai-request-aborted',this,{'originalError':_0x48f100});throw new ht('ai-request-failed',this,{'originalError':_0x48f100});}}function Mi(_0x3a7061,_0x254933,_0x27778d){const t=_0x3a7061['t'];switch(_0x254933){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Proposed\x20changes'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20details'});case'AI_MINI_TOOLBAR_LIKE':return t({'id':'AI_MINI_TOOLBAR_LIKE','string':'I\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_DISLIKE':return t({'id':'AI_MINI_TOOLBAR_DISLIKE','string':'I\x20don\x27t\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_COPY':return t({'id':'AI_MINI_TOOLBAR_COPY','string':'Copy\x20to\x20clipboard'});case'AI_SUGGESTION_CONTENT_PART_TITLE':return t({'id':'AI_SUGGESTION_CONTENT_PART_TITLE','string':'Change\x20%0'},_0x27778d);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'Response\x20stopped.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x27778d);case'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED':return t({'id':'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED','string':'Folders\x20cannot\x20be\x20added\x20to\x20the\x20chat.\x20Try\x20adding\x20individual\x20files\x20instead.'});case'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES','string':'Unable\x20to\x20load\x20resources\x20from\x20%0.\x20Please\x20try\x20again.'},_0x27778d);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_PASTED_TEXT_NAME':return t({'id':'AI_CHAT_CONTEXT_PASTED_TEXT_NAME','string':'Pasted\x20Text'});case'AI_CHAT_DROP_ZONE_HINT':return t({'id':'AI_CHAT_DROP_ZONE_HINT','string':'Drop\x20files\x20here\x20to\x20add\x20to\x20the\x20chat'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x27778d);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x27778d);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x27778d);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x27778d);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x27778d);case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY','string':'Please\x20try\x20a\x20different\x20phrase\x20or\x20check\x20the\x20spelling.'});case'AI_CHAT_HISTORY_EMPTY_MESSAGE':return t({'id':'AI_CHAT_HISTORY_EMPTY_MESSAGE','string':'Your\x20chat\x20history\x20for\x20current\x20document\x20will\x20appear\x20here.'});case'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON':return t({'id':'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON','string':'Go\x20to\x20chat'});case'AI_CHAT_HISTORY_PIN_BUTTON':return t({'id':'AI_CHAT_HISTORY_PIN_BUTTON','string':'Pin'});case'AI_CHAT_HISTORY_SHOW_MORE_ITEMS':return t({'id':'AI_CHAT_HISTORY_SHOW_MORE_ITEMS','string':'Show\x20more\x20items'});case'AI_CHAT_HISTORY_EDIT_NAME':return t({'id':'AI_CHAT_HISTORY_EDIT_NAME','string':'Edit\x20name'});case'AI_CHAT_HISTORY_REMOVE':return t({'id':'AI_CHAT_HISTORY_REMOVE','string':'Remove'});case'AI_CHAT_HISTORY_REMOVE_CONFIRM':return t({'id':'AI_CHAT_HISTORY_REMOVE_CONFIRM','string':'Do\x20you\x20want\x20to\x20remove\x20this\x20chat?'});case'AI_CHAT_HISTORY_ACCEPT':return t({'id':'AI_CHAT_HISTORY_ACCEPT','string':'Accept'});case'AI_CHAT_HISTORY_CANCEL':return t({'id':'AI_CHAT_HISTORY_CANCEL','string':'Cancel'});case'AI_CHAT_HISTORY_LOADING_REMOVING':return t({'id':'AI_CHAT_HISTORY_LOADING_REMOVING','string':'Removing\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_RENAMING':return t({'id':'AI_CHAT_HISTORY_LOADING_RENAMING','string':'Renaming\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_PINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_PINNING','string':'Pinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_UNPINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_UNPINNING','string':'Unpinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_CATEGORY_PINNED':return t({'id':'AI_CHAT_HISTORY_CATEGORY_PINNED','string':'Pinned'});case'AI_CHAT_HISTORY_CATEGORY_TODAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_TODAY','string':'Today'});case'AI_CHAT_HISTORY_CATEGORY_YESTERDAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_YESTERDAY','string':'Yesterday'});case'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS','string':'Last\x2014\x20days'});case'AI_CHAT_HISTORY_CATEGORY_LATER':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LATER','string':'Later'});case'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE','string':'Failed\x20to\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20later.'},_0x27778d);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Failed\x20to\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x27778d);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Failed\x20to\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x27778d);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Failed\x20to\x20load\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_PIN_ACTION':return t({'id':'AI_CHAT_HISTORY_PIN_ACTION','string':'pin'});case'AI_CHAT_HISTORY_UNPIN_ACTION':return t({'id':'AI_CHAT_HISTORY_UNPIN_ACTION','string':'unpin'});case'AI_BALLOON_HEADER_TITLE':return t({'id':'AI_BALLOON_HEADER_TITLE','string':'Change\x20%0'},_0x27778d);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x27778d);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x254933;}}const Ui='ck-ai-button-primary',Bi='ck-ai-button-secondary',Gi='ck-ai-button-tertiary';function Fi(_0x3be3ec,_0x3fa743){const _0x1ed68e=new yt(_0x3be3ec),_0x56b4ad=Mi(_0x3be3ec,'AI_TABS_LABEL_MINIMIZE'),_0x268947=Mi(_0x3be3ec,'AI_TABS_LABEL_MAXIMIZE');return _0x1ed68e['set']({'withText':!0x1,'icon':_0x5b4b01,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+Gi}),_0x1ed68e['bind']('label')['to'](_0x3fa743,'isMaximized',_0x339547=>_0x339547?_0x56b4ad:_0x268947),_0x1ed68e['bind']('icon')['to'](_0x3fa743,'isMaximized',_0x423b09=>_0x423b09?_0x4d92ae:_0x5b4b01),_0x1ed68e['bind']('isOn')['to'](_0x3fa743,'isMaximized'),_0x1ed68e['on']('execute',()=>{_0x3fa743['fire']('resizeTabs');}),_0x1ed68e;}function Wi(_0xc6720a,_0x3f2d4d){return _0x4d8bd5(_0xc6720a,_0x3f2d4d);}function Ki(_0x47298c,_0x165ee9){return _0x1084a7(_0x47298c,_0x165ee9);}function Yi(_0x307bc0,_0x527bba,_0x8fe09b){const _0x212ba8=null!==_0x527bba?_0x1c814c=>_0x1c814c['attribs'][_0x307bc0]===_0x527bba:_0x30ddb1=>Boolean(_0x30ddb1['attribs'][_0x307bc0]);return _0x4d97a4(_0x2043ef=>_0x137115(_0x2043ef)&&_0x212ba8(_0x2043ef),_0x8fe09b);}function $i(_0x52b173,_0x47b155,_0x30c014){const _0x376813=null!==_0x47b155?_0x3dbff7=>_0x3dbff7['attribs'][_0x52b173]===_0x47b155:_0x193ad8=>Boolean(_0x193ad8['attribs'][_0x52b173]);return _0x3f0d08(_0xad7fe1=>_0x137115(_0xad7fe1)&&_0x376813(_0xad7fe1),_0x30c014);}function qi(_0x5e186b){return _0x3f0d08(_0x4c587c=>_0x137115(_0x4c587c)&&function(_0x5735be){const _0x59c207=_0x5735be['toLowerCase']();return'script'===_0x59c207||'style'===_0x59c207||_0x59c207['includes']('-');}(_0x4c587c['name']),_0x5e186b);}function Qi(_0x3c3395){return _0x193756(_0x1d759f=>_0x340786(_0x1d759f),_0x3c3395,!0x0,0x1/0x0);}function Xi(_0x16768b,_0x39bd37){return _0x16768b&&_0x137115(_0x16768b)?_0x16768b['attribs'][_0x39bd37]:null;}function zi(_0x4ed6b8,_0x2708d7,_0x293d72){_0x137115(_0x4ed6b8)&&(null===_0x293d72?delete _0x4ed6b8['attribs'][_0x2708d7]:_0x4ed6b8['attribs'][_0x2708d7]=_0x293d72);}function ji(_0x141fec,_0x124423,_0x1201f9){const _0x35865a=_0x124423['cloneNode'](!0x0);'beforebegin'===_0x1201f9?_0x5358b1(_0x141fec,_0x35865a):'afterbegin'===_0x1201f9?_0x5a0b86(_0x141fec,_0x35865a):'beforeend'===_0x1201f9?_0x37a484(_0x141fec,_0x35865a):'afterend'===_0x1201f9&&_0x48c134(_0x141fec,_0x35865a);}function Ji(_0x51a152){const _0x20242f=[];let _0x42a10f=_0x51a152;for(;_0x42a10f;)_0x42a10f=_0x28f883(_0x42a10f),_0x42a10f&&_0x20242f['push'](_0x42a10f);return _0x20242f;}function Zi(_0x498eba){return _0x498eba['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ts(_0x30793d){let _0x18617e=0x0;for(;_0x30793d['parentNode'];)_0x30793d=_0x30793d['parentNode'],_0x18617e++;return _0x18617e;}function es(_0xd835f9){const _0x2b349e=[];let _0x628016=_0xd835f9['nextSibling'];for(;_0x628016;)_0x2b349e['push'](_0x628016),_0x628016=_0x628016['nextSibling'];_0x2b349e['forEach'](_0x5074e6=>{_0x383ffd(_0x5074e6);});}class AIResponseParser extends/* #__PURE__ -- @preserve */
|
|
25
|
-
ct(){['_m2html'];constructor(){super();const
|
|
26
|
-
ct(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null,'rescuedNewIds':new Set()};['_existingDataIds']=new Set();['_referencedExistingIds']=new Set();constructor(_0x43c842){super(),this['_generateUid']=_0x43c842||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x2bfb95,_0x25dec2,_0x39d9f4){this['_uidCounter']=0x0;const _0x225a01=_0x2bfb95['cloneNode'](!0x0);ns(_0x25dec2,_0x225a01);const _0x51d3f0=_0x225a01['childNodes'],_0x551f43=Array['from'](_0x51d3f0)['filter'](_0x4227aa=>!(0x3===_0x4227aa['nodeType']&&''===Ki(_0x4227aa)['trim']())),_0x545056=_0x551f43['length'];for(const _0x145b05 of _0x551f43)_0x145b05&&_0x137115(_0x145b05)&&void 0x0===_0x145b05['attribs']['data-id']&&zi(_0x145b05,'data-id','new-element');if(0x0===_0x25dec2['childNodes']['length']){const _0x461e3d=[];return $i('data-id','new-element',_0x225a01)['forEach'](_0x5428b5=>{const _0x2970a7=this['_generateUid']();zi(_0x5428b5,'data-id',_0x2970a7),_0x461e3d['push'](_0x2970a7);}),this['_removeSpecialComments'](_0x225a01),{'parsedContent':_0x225a01,'newNodeIds':_0x461e3d,'modifiedNodeIds':[],'removedNodeIds':[]};}this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_touchedNodesState']['rescuedNewIds']=new Set(),this['_referencedExistingIds']=new Set(),this['_existingDataIds']=new Set($i('data-id',null,_0x25dec2)['map'](_0x4df24e=>Xi(_0x4df24e,'data-id'))['filter'](_0x19090d=>!!_0x19090d));let _0x53f28a=-0x1,_0x30d953=!0x1;for(let _0x4705ea=0x0;_0x4705ea<_0x545056;_0x4705ea++){const _0x14fc13=_0x551f43[_0x4705ea],_0x240015=_0x551f43[_0x4705ea+0x1];if(this['_isNewNode'](_0x14fc13)){if(-0x1===_0x53f28a&&(_0x53f28a=_0x4705ea),this['_markWrappedElements'](_0x14fc13),!this['_isNewNode'](_0x240015)){const [_0xab7fb4,_0x20b32c]=this['_findReferenceNode'](_0x14fc13,_0x30d953,_0x25dec2);if(_0xab7fb4){const _0x279de2=Array['from'](_0x551f43)['slice'](_0x53f28a,_0x4705ea+0x1);this['_insertNodes'](_0xab7fb4,_0x279de2,_0x20b32c),_0x53f28a=-0x1;}}}else{if(this['_isExistingContentComment'](_0x14fc13))_0x30d953=!0x0;else{if(this['_isExistingNode'](_0x14fc13)){const _0x263c8a=Xi(_0x14fc13,'data-id');if(_0x263c8a&&this['_existingDataIds']['has'](_0x263c8a)){this['_referencedExistingIds']['add'](_0x263c8a);const _0x6fa9ee=Yi('data-id',_0x263c8a,_0x25dec2);this['_replaceNode'](_0x6fa9ee,_0x14fc13);}}else{if(is(_0x14fc13)){const _0x344a02=ss(_0x14fc13);!!Yi('data-id',_0x344a02,_0x225a01)||this['_touchedNodesState']['removedIds']['push'](_0x344a02);}}}}}for(const _0x5a21c0 of this['_touchedNodesState']['removedIds']){const _0x5b8344=Yi('data-id',_0x5a21c0,_0x25dec2);_0x5b8344&&(this['_rescueUnwrappedElements'](_0x5b8344),this['_removeNode'](_0x5b8344,_0x5a21c0,_0x39d9f4));}if($i('data-id','new-element',_0x25dec2)['forEach'](_0x594ec7=>{const _0x453761=this['_getUid'](_0x594ec7);zi(_0x594ec7,'data-id',_0x453761),this['_touchedNodesState']['newIds']['push'](_0x453761);}),this['_removeSpecialComments'](_0x25dec2),_0x39d9f4&&_0x39d9f4['cutAfterUnstable']){const _0x539103=this['_findLastConfirmationPoint'](_0x551f43),_0x577a28=this['_getLastStableElement'](_0x25dec2,_0x539103);this['_markUnstableElements'](_0x25dec2,_0x577a28);}if(this['_processWrappedElements'](_0x25dec2,_0x39d9f4),_0x39d9f4&&_0x39d9f4['cutAfterUnstable']&&this['_touchedNodesState']['lastTouchedId']){const _0x1f2407=$i('data-id',this['_touchedNodesState']['lastTouchedId'],_0x25dec2);let _0x5df630=_0x1f2407[_0x1f2407['length']-0x1];for(;_0x5df630;)es(_0x5df630),_0x5df630=_0x5df630['parentNode'];}return{'parsedContent':_0x25dec2,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x38b088,_0x154166,_0x59c909){for(const _0x1a4b14 of _0x154166){const _0x55b65e=this['_getUid'](_0x1a4b14);zi(_0x1a4b14,'data-id',_0x55b65e),this['_touchedNodesState']['newIds']['push'](_0x55b65e),this['_touchedNodesState']['lastTouchedId']=_0x55b65e;}const _0x2f28be='afterbegin'===_0x59c909||'afterend'===_0x59c909?_0x154166['reverse']():_0x154166;for(const _0x2ec5b0 of _0x2f28be)ji(_0x38b088,_0x2ec5b0,_0x59c909);}['_replaceNode'](_0x4f539a,_0x2a2361){if(!_0x4f539a)return;if(_0x1f85a9=_0x2a2361,Zi(Ki(_0x4f539a))===Zi(Ki(_0x1f85a9)))return;var _0x1f85a9;const _0x25fe0b=Xi(_0x4f539a,'data-id');this['_touchedNodesState']['modifiedIds']['push'](_0x25fe0b),this['_touchedNodesState']['lastTouchedId']=_0x25fe0b,_0x5727b7(_0x4f539a,_0x2a2361['cloneNode'](!0x0));}['_removeNode'](_0x5abe16,_0x3d2cab,_0x1680f3){if(_0x1680f3&&_0x1680f3['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x3d2cab;const _0x4d79a8=_0x1680f3['replaceRemovedWith']['cloneNode'](!0x0);zi(_0x4d79a8,'data-id',_0x3d2cab),zi(_0x4d79a8,'data-removed','true'),_0x5727b7(_0x5abe16,_0x4d79a8);}else _0x383ffd(_0x5abe16);}['_findReferenceNode'](_0xb8e33a,_0x58b84c,_0x41185b){const _0x4d48f2=this['_findPrevElementWithDataId'](_0xb8e33a,!0x1);if(_0x4d48f2){const _0x2a28eb=ss(_0x4d48f2),_0x2bd080=Yi('data-id',_0x2a28eb,_0x41185b);if(_0x2bd080)return[_0x2bd080,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x2a28eb);}const _0x559a2a=this['_findNextElementWithDataId'](_0xb8e33a,!0x1);if(_0x559a2a){const _0x4231ee=ss(_0x559a2a),_0xca6aee=Yi('data-id',_0x4231ee,_0x41185b);if(_0xca6aee)return[_0xca6aee,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x4231ee);}return _0x58b84c?_0xb8e33a['nextSibling']?this['_findFallbackReferenceNode'](_0xb8e33a,_0x41185b):[_0x41185b['childNodes'][_0x41185b['childNodes']['length']-0x1],'afterend']:[_0x41185b['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x16d50f,_0x321513){const _0x5ac02a=[],_0x26dcfc=this['_findPrevElementWithDataId'](_0x16d50f,!0x0);if(_0x26dcfc){const _0x2dafe8=Yi('data-id',ss(_0x26dcfc),_0x321513);_0x2dafe8&&_0x5ac02a['push']([_0x2dafe8,'afterend']);}const _0x1332c4=this['_findNextElementWithDataId'](_0x16d50f,!0x0);if(_0x1332c4){const _0x2cd955=Yi('data-id',ss(_0x1332c4),_0x321513);_0x2cd955&&_0x5ac02a['push']([_0x2cd955,'beforebegin']);}if(_0x5ac02a['length']>0x1)return ts(_0x5ac02a[0x0][0x0])<=ts(_0x5ac02a[0x1][0x0])?_0x5ac02a[0x0]:_0x5ac02a[0x1];return 0x1===_0x5ac02a['length']?_0x5ac02a[0x0]:[_0x321513['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x45d3f1,_0x480cdc){let _0x14a2c7=_0x45d3f1['nextSibling'],_0x115100=null,_0x59c83d=!0x1;for(;_0x14a2c7;){if(_0x340786(_0x14a2c7)){if(is(_0x14a2c7)&&(_0x115100=_0x14a2c7),this['_isExistingContentComment'](_0x14a2c7)&&_0x480cdc&&!_0x59c83d){_0x59c83d=!0x0,_0x14a2c7=_0x14a2c7['nextSibling'];continue;}break;}const _0x4dc63b=Xi(_0x14a2c7,'data-id');if(_0x4dc63b&&'new-element'!==_0x4dc63b&&this['_existingDataIds']['has'](_0x4dc63b)){_0x115100=_0x14a2c7;break;}_0x14a2c7=_0x14a2c7['nextSibling'];}return _0x115100;}['_findPrevElementWithDataId'](_0xdd0490,_0x2feacf){let _0x3425e5=_0xdd0490['previousSibling'],_0x44fd7d=null,_0xc08b38=!0x1;for(;_0x3425e5;){if(_0x340786(_0x3425e5)){if(is(_0x3425e5)&&(_0x44fd7d=_0x3425e5),this['_isExistingContentComment'](_0x3425e5)&&_0x2feacf&&!_0xc08b38){_0xc08b38=!0x0,_0x3425e5=_0x3425e5['previousSibling'];continue;}break;}const _0x88f769=Xi(_0x3425e5,'data-id');if(_0x88f769&&'new-element'!==_0x88f769&&this['_existingDataIds']['has'](_0x88f769)){_0x44fd7d=_0x3425e5;break;}_0x3425e5=_0x3425e5['previousSibling'];}return _0x44fd7d;}['_markWrappedElements'](_0x3748db){_0x137115(_0x3748db)&&$i('data-id',null,_0x3748db)['forEach'](_0x7b91fb=>{this['_isExistingNode'](_0x7b91fb)&&(zi(_0x7b91fb,'data-wrapped-id',Xi(_0x7b91fb,'data-id')),zi(_0x7b91fb,'data-id',null));});}['_processWrappedElements'](_0x2ed117,_0x48c6ed){$i('data-wrapped-id',null,_0x2ed117)['forEach'](_0xcdc34e=>{const _0x225eaf=Xi(_0xcdc34e,'data-wrapped-id');if(this['_hasUnstableParent'](_0xcdc34e))return;const _0xb8ca61=Yi('data-id',_0x225eaf,_0x2ed117);zi(_0xcdc34e,'data-id',_0x225eaf),_0xb8ca61&&(this['_removeNode'](_0xb8ca61,_0x225eaf,_0x48c6ed),this['_touchedNodesState']['removedIds']['push'](_0x225eaf),this['_touchedNodesState']['lastTouchedId']=_0x225eaf);});}['_hasUnstableParent'](_0x42a12c){let _0x2e331f=_0x42a12c['parentNode'];for(;_0x2e331f;){if(Xi(_0x2e331f,'data-unstable'))return!0x0;_0x2e331f=_0x2e331f['parentNode'];}return!0x1;}['_rescueUnwrappedElements'](_0x391142){const _0x3071ae=new Set(this['_touchedNodesState']['removedIds']),_0x2d66a6=new Set(this['_touchedNodesState']['newIds']);$i('data-id',null,_0x391142)['forEach'](_0x169807=>{const _0x2c7055=Xi(_0x169807,'data-id'),_0x1d802e=!!_0x2c7055&&this['_referencedExistingIds']['has'](_0x2c7055),_0x4be0d4=!!_0x2c7055&&_0x2d66a6['has'](_0x2c7055);if(!_0x2c7055||!_0x1d802e&&!_0x4be0d4)return;if(_0x3071ae['has'](_0x2c7055))return;let _0x12eed0=_0x169807['parentNode'],_0x34ed29=!0x1;for(;_0x12eed0;){if(_0x12eed0===_0x391142){_0x34ed29=!0x0;break;}const _0x579093=Xi(_0x12eed0,'data-id');if(_0x579093&&(this['_referencedExistingIds']['has'](_0x579093)||_0x2d66a6['has'](_0x579093)))return;_0x12eed0=_0x12eed0['parentNode'];}if(_0x34ed29){if(_0x5358b1(_0x391142,_0x169807),_0x1d802e){const _0x64fdd5=this['_generateUid'](),_0x35fe04=this['_touchedNodesState']['modifiedIds']['indexOf'](_0x2c7055);-0x1!==_0x35fe04&&this['_touchedNodesState']['modifiedIds']['splice'](_0x35fe04,0x1),zi(_0x169807,'data-unwrapped-id',_0x2c7055),zi(_0x169807,'data-id',_0x64fdd5),this['_touchedNodesState']['newIds']['push'](_0x64fdd5),this['_touchedNodesState']['rescuedNewIds']['add'](_0x64fdd5),this['_touchedNodesState']['lastTouchedId']=_0x64fdd5;}else this['_touchedNodesState']['rescuedNewIds']['add'](_0x2c7055),this['_touchedNodesState']['lastTouchedId']=_0x2c7055;}});}['_getUid'](_0x36e371){return this['_isExistingNode'](_0x36e371)?Xi(_0x36e371,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x54258a){Qi(_0x54258a)['filter'](_0x567bf7=>is(_0x567bf7)||this['_isExistingContentComment'](_0x567bf7))['forEach'](_0x4ebb37=>{_0x383ffd(_0x4ebb37);});}['_findLastConfirmationPoint'](_0x2462c6){let _0x58be5c=null,_0x5b0d9d=null,_0x1671b4=null,_0x3ac5cb=null;const _0x41d728=_0xb011d9=>{_0xb011d9&&(_0x58be5c=_0xb011d9),_0x1671b4=null,_0x3ac5cb=null;};for(let _0x2f7574=0x0;_0x2f7574<_0x2462c6['length'];_0x2f7574++){const _0x154f72=_0x2462c6[_0x2f7574];if(this['_isExistingContentComment'](_0x154f72)){_0x41d728(_0x5b0d9d);continue;}if(_0x137115(_0x154f72)){const _0x563a71=Xi(_0x154f72,'data-id'),_0x52e68a=_0x2f7574===_0x2462c6['length']-0x1;if(_0x563a71&&'new-element'!==_0x563a71&&this['_touchedNodesState']['modifiedIds']['includes'](_0x563a71)&&!_0x52e68a){_0x41d728(_0x563a71),_0x5b0d9d=_0x563a71;continue;}}let _0x4cff52=null;const _0x1fb4f1=ss(_0x154f72);if(_0x1fb4f1&&this['_touchedNodesState']['rescuedNewIds']['has'](_0x1fb4f1))_0x5b0d9d=_0x1fb4f1;else{if(_0x1fb4f1&&this['_touchedNodesState']['newIds']['includes'](_0x1fb4f1))_0x4cff52='N';else{if(!is(_0x154f72))continue;_0x4cff52='R';}_0x4cff52===_0x3ac5cb||null===_0x3ac5cb?_0x3ac5cb=_0x4cff52:null!==_0x1671b4?(_0x41d728(_0x5b0d9d),_0x3ac5cb=_0x4cff52):(_0x1671b4=_0x3ac5cb,_0x3ac5cb=_0x4cff52),_0x5b0d9d=_0x1fb4f1;}}const _0x417ce7=_0x2462c6[_0x2462c6['length']-0x1];return _0x417ce7&&!_0x137115(_0x417ce7)&&!is(_0x417ce7)&&_0x5b0d9d&&_0x41d728(_0x5b0d9d),_0x58be5c;}['_getLastStableElement'](_0x2bc294,_0x4a9aea){if(!_0x4a9aea)return null;const _0x353f58=Yi('data-id',_0x4a9aea,_0x2bc294);if(!_0x353f58)return null;const _0x2e5847=[_0x353f58,...Ji(_0x353f58)]['at'](-0x2);if(_0x2e5847===_0x353f58)return _0x353f58;let _0x449ea3=_0x2e5847['previousSibling'];for(;_0x449ea3&&!_0x137115(_0x449ea3);)_0x449ea3=_0x449ea3['previousSibling'];return _0x449ea3;}['_markUnstableElements'](_0x27c350,_0xad884c){const _0xda3b3b=new Set([...this['_touchedNodesState']['newIds'],...this['_touchedNodesState']['modifiedIds'],...this['_touchedNodesState']['removedIds']]);let _0x23baf7=_0xad884c?_0xad884c['nextSibling']:_0x27c350['firstChild'];for(;_0x23baf7;){_0x137115(_0x23baf7)&&((_0xda3b3b['has'](Xi(_0x23baf7,'data-id'))||$i('data-id',null,_0x23baf7)['some'](_0x2a77e3=>_0xda3b3b['has'](Xi(_0x2a77e3,'data-id'))))&&zi(_0x23baf7,'data-unstable','true')),_0x23baf7=_0x23baf7['nextSibling'];}}['_isNewNode'](_0x512758){return Boolean('new-element'===Xi(_0x512758,'data-id'));}['_isExistingNode'](_0x288cc6){return Boolean((Xi(_0x288cc6,'data-id')||'')['length']>0x0&&'new-element'!==Xi(_0x288cc6,'data-id'));}['_isExistingContentComment'](_0x4b2ffd){return Boolean(_0x340786(_0x4b2ffd)&&Ki(_0x4b2ffd)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function is(_0x259371){return!!_0x259371&&Boolean(_0x340786(_0x259371)&&Ki(_0x259371)['match'](/removed[\s*-]data-id="[^"]+"/));}function ss(_0x4b6fe7){if(!_0x4b6fe7)return null;if(_0x137115(_0x4b6fe7))return Xi(_0x4b6fe7,'data-id')??null;if(_0x340786(_0x4b6fe7)){const _0x1ae3fe=Ki(_0x4b6fe7)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x1ae3fe&&_0x1ae3fe[0x1])return _0x1ae3fe[0x1];}return null;}function ns(_0x837f0,_0xde2043){const _0x4eafc3=new Map();for(const _0x196658 of qi(_0x837f0))_0x4eafc3['set'](Xi(_0x196658,'data-id'),_0x196658);const _0x467a61=new Set();for(const _0x5404c3 of qi(_0xde2043)){const _0x541cbc=Xi(_0x5404c3,'data-id'),_0x26d855=_0x541cbc?_0x4eafc3['get'](_0x541cbc):void 0x0;_0x26d855?(_0x5727b7(_0x5404c3,_0x1ba81c(_0x26d855,!0x0)),_0x467a61['add'](_0x541cbc)):_0x383ffd(_0x5404c3);}for(const _0x1c1a44 of Qi(_0xde2043))is(_0x1c1a44)&&_0x4eafc3['has'](ss(_0x1c1a44))&&_0x383ffd(_0x1c1a44);const _0x4f66e3=new Set($i('data-id',null,_0xde2043)['map'](_0x5b92f8=>Xi(_0x5b92f8,'data-id')));for(const [_0x1cd6de,_0x225932]of _0x4eafc3){if(_0x467a61['has'](_0x1cd6de))continue;let _0x20c4e7=_0x225932['parent'],_0xdead30=null;for(;_0x20c4e7&&_0x137115(_0x20c4e7);){const _0x519708=Xi(_0x20c4e7,'data-id');if(_0x519708&&_0x4f66e3['has'](_0x519708)){_0xdead30=_0x519708;break;}_0x20c4e7=_0x20c4e7['parent'];}if(!_0xdead30)continue;const _0x4434cf=Yi('data-id',_0xdead30,_0xde2043);_0x4434cf&&_0x37a484(_0x4434cf,_0x1ba81c(_0x225932,!0x0));}}function rs({changeGroups:_0x214249,documentContextContent:_0x37d252,showDiff:_0x127857,trimUnchanged:_0x4ac64d=!0x0}){return _0x214249['map'](_0x9960e8=>{if('destroyed'===_0x9960e8['editor']['state'])return null;const _0x3ce2d1=new _0x9b5ced([]),_0x199fb8=new _0x9b5ced([]),_0x57157c=new Set();for(const _0x34caee of _0x9960e8['changes'])'new'==_0x34caee['type']&&$i('data-id',null,_0x34caee['node'])['forEach'](_0x4fcc8e=>{_0x57157c['add'](Xi(_0x4fcc8e,'data-id'));});for(const _0x301390 of _0x9960e8['changes'])if('removed'!=_0x301390['type']?_0x199fb8['children']['push'](_0x301390['node']['cloneNode'](!0x0)):_0x127857||_0x57157c['has'](_0x301390['id'])||_0x199fb8['children']['push'](_0x301390['node']['cloneNode'](!0x0)),'new'!=_0x301390['type']&&(_0x127857||'removed'!=_0x301390['type'])){const _0x2c9c6e=_0x4d97a4(_0x1af64c=>Xi(_0x1af64c,'data-id')==_0x301390['id'],_0x37d252['get'](_0x9960e8['documentId']),!0x0);_0x2c9c6e&&_0x3ce2d1['children']['push'](_0x2c9c6e['cloneNode'](!0x0));}const {content:_0x4d65e7,hasChanges:_0x2c9946}=os(_0x9960e8['editor'],_0x3ce2d1,_0x199fb8,_0x127857,_0x4ac64d);return{'type':_0x9960e8['changes'][0x0]['type'],'index':_0x9960e8['index'],'content':_0x4d65e7,'hasChanges':_0x2c9946};})['filter'](_0x164a7d=>null!==_0x164a7d);}function os(_0x2c426c,_0x473f5c,_0xcbc985,_0x346d4c,_0x2f6c3d=!0x0){const _0x9e83b8=_0x2c426c['plugins']['get']('DocumentCompare'),_0x463337=Ki(_0x473f5c),_0x2e8ffe=Ki(_0xcbc985),_0x4766c2=_0x2c426c['data']['parse'](_0x463337,'$root'),_0x4bd22a=_0x2c426c['model']['createPositionAt'](_0x4766c2,0x0),_0x21daba=_0x9e83b8['getDiff'](_0x463337,_0x2e8ffe,{'anchor':_0x4bd22a,'markDeletions':_0x346d4c,'targetEditor':_0x2c426c})['getOperations']();if(0x0==_0x21daba['length'])return{'content':_0x473f5c['cloneNode'](!0x0),'hasChanges':!0x1};if(_0x346d4c?function(_0x548ee9,_0xdce3f7,_0x174d14){if(0x0==_0x548ee9['length'])return;const _0x1dbb3d=_0x174d14['plugins']['get']('DocumentCompare'),_0x3729dd=_0x174d14['plugins']['get']('SuggestionsConversion');_0x174d14['model']['change'](_0x560aed=>{const _0x257184=new Set();for(let _0x1d97bd=0x0;_0x1d97bd<_0x548ee9['length'];_0x1d97bd++){const _0x3c5a61=_0x548ee9[_0x1d97bd];if(_0x3c5a61['baseVersion']=null,_0x3c5a61['isDocumentOperation']=!0x1,_0x1dbb3d['isMarkedRemoveOperation'](_0x3c5a61)){const _0x22e06d=_0x21ec1a(_0x3c5a61['newRange'],_0x174d14['model']),_0x35d9b2='suggestion:deletion:'+at()+':$aiSuggestion';_0xdce3f7['markers']['set'](_0x35d9b2,_0x22e06d);}else switch(_0x3c5a61['type']){case'rename':{if(_0x3c5a61['oldName']==_0x3c5a61['newName'])break;_0x560aed['batch']['addOperation'](_0x3c5a61),_0x174d14['model']['applyOperation'](_0x3c5a61);const _0x17769c='$elementName',_0x27c035=_0x3c5a61['position'],_0x5237f0=_0x174d14['model']['createRange'](_0x27c035,_0x174d14['model']['createPositionAt'](_0x27c035['nodeAfter'],'end')),_0xb1f9eb='suggestion:attribute:'+_0x17769c+':'+at()+':$aiSuggestion';_0xdce3f7['markers']['set'](_0xb1f9eb,_0x5237f0);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3c5a61['oldValue']==_0x3c5a61['newValue'])break;_0x560aed['batch']['addOperation'](_0x3c5a61),_0x174d14['model']['applyOperation'](_0x3c5a61);const _0xb3cc39=_0x3c5a61['key'];if(!_0x3729dd['isRegisteredAttribute'](_0xb3cc39))break;const _0x1732cb=_0x21ec1a(_0x3c5a61['range'],_0x174d14['model']),_0x4b11eb='suggestion:attribute:'+_0xb3cc39+':'+at()+':$aiSuggestion';_0xdce3f7['markers']['set'](_0x4b11eb,_0x1732cb);break;}case'insert':{_0x560aed['batch']['addOperation'](_0x3c5a61),_0x174d14['model']['applyOperation'](_0x3c5a61);if(_0x548ee9[_0x1d97bd+0x1]&&'move'==_0x548ee9[_0x1d97bd+0x1]['type']){as(_0xdce3f7,_0x3c5a61);break;}const _0x5e1e77=_0x3c5a61['position'],_0x173ab1=_0x3c5a61['howMany'],_0x459b7b=_0x21ec1a(_0x174d14['model']['createRange'](_0x5e1e77,_0x5e1e77['getShiftedBy'](_0x173ab1)),_0x174d14['model']),_0x206c23='suggestion:insertion:'+at()+':$aiSuggestion';_0xdce3f7['markers']['set'](_0x206c23,_0x459b7b);break;}case'split':{_0x560aed['batch']['addOperation'](_0x3c5a61),_0x174d14['model']['applyOperation'](_0x3c5a61);const _0x3d3aed=_0x3c5a61['splitPosition'],_0x101145=_0x3c5a61['moveTargetPosition'],_0x170983=_0x174d14['model']['createRange'](_0x3d3aed,_0x101145),_0x5ba5f0='suggestion:insertion:'+at()+':$aiSuggestion';_0xdce3f7['markers']['set'](_0x5ba5f0,_0x170983);break;}case'move':{_0x560aed['batch']['addOperation'](_0x3c5a61),_0x174d14['model']['applyOperation'](_0x3c5a61),_0x548ee9[_0x1d97bd-0x1]&&'insert'==_0x548ee9[_0x1d97bd-0x1]['type']&&as(_0xdce3f7,_0x3c5a61);const _0x20697b=_0x3c5a61['getMovedRangeStart'](),_0x5cd016=_0x3c5a61['howMany'];for(let _0x4cfe91=0x0;_0x4cfe91<_0x5cd016;_0x4cfe91++){const _0x55b354=_0x20697b['getShiftedBy'](_0x4cfe91)['nodeAfter'];_0x257184['add'](_0x55b354);}break;}case'remove':{const _0x5e71ae=_0x3c5a61['sourcePosition'],_0x2b71dd=_0x3c5a61['howMany'],_0x56125b=new _0x1f8438(_0x5e71ae,_0x2b71dd);_0x560aed['batch']['addOperation'](_0x56125b),_0x174d14['model']['applyOperation'](_0x56125b);break;}}}for(const _0x1f9077 of _0x257184){const _0x5207b5=_0x174d14['model']['createRangeOn'](_0x1f9077),_0x4b083d='suggestion:formatBlock:$fakeWrap:'+at()+':$aiSuggestion';_0xdce3f7['markers']['set'](_0x4b083d,_0x21ec1a(_0x5207b5,_0x174d14['model']));}});}(_0x21daba,_0x4766c2,_0x2c426c):_0x2c426c['model']['change'](_0x60cd7=>{for(const _0x4b6fe2 of _0x21daba)if('remove'==_0x4b6fe2['type']){const _0x2d4fd9=_0x4b6fe2['sourcePosition'],_0x291caf=_0x4b6fe2['howMany'],_0x3c245b=new _0x1f8438(_0x2d4fd9,_0x291caf);_0x60cd7['batch']['addOperation'](_0x3c245b),_0x2c426c['model']['applyOperation'](_0x3c245b);}else{if('marker'==_0x4b6fe2['type']){const _0x381fa5=_0x4b6fe2['name'],_0xe23a7d=_0x4b6fe2['newRange'];null!==_0xe23a7d?_0x4766c2['markers']['set'](_0x381fa5,_0xe23a7d):_0x4766c2['markers']['delete'](_0x381fa5);}else _0x4b6fe2['baseVersion']=null,_0x4b6fe2['isDocumentOperation']=!0x1,_0x60cd7['batch']['addOperation'](_0x4b6fe2),_0x2c426c['model']['applyOperation'](_0x4b6fe2);}}),_0x2f6c3d){const _0x1b8b5a=hs(_0x2c426c,_0x21daba,_0x4766c2);ls(_0x2c426c['model'],_0x1b8b5a),function(_0x500229,_0x39a5b0){const _0x4a85b2=_0x39a5b0['getFirstRange']()['start'];let _0x27c3fa=_0x39a5b0['getFirstRange']()['end'];const _0x4f5870=_0x4a85b2['root'];(_0x27c3fa['textNode']||_0x27c3fa['nodeAfter']&&_0x27c3fa['nodeAfter']['is']('$text'))&&(_0x14d380(_0x27c3fa,'...'),_0x27c3fa=_0x27c3fa['getShiftedBy'](0x3)),(_0x4a85b2['textNode']||_0x4a85b2['nodeBefore']&&_0x4a85b2['nodeBefore']['is']('$text'))&&(_0x14d380(_0x4a85b2,'...'),function(_0x28e14c,_0x2ff20b,_0x528b58){for(let [_0x3a84e4,_0x5165c2]of _0x28e14c['markers']){const _0x42e321=_0x5165c2['_getTransformedByInsertion'](_0x2ff20b,_0x528b58,!0x1);_0x5165c2=_0x42e321[0x0],_0x28e14c['markers']['set'](_0x3a84e4,_0x5165c2);}}(_0x4f5870,_0x4a85b2,0x3),_0x4a85b2['parent']==_0x27c3fa['parent']&&(_0x27c3fa=_0x27c3fa['getShiftedBy'](0x3)));const _0x4e97a6=_0x500229['createRange'](_0x500229['createPositionAt'](_0x4f5870,0x0),_0x4a85b2),_0x3924e2=_0x500229['createRange'](_0x27c3fa,_0x500229['createPositionAt'](_0x4f5870,'end')),_0x5e3d23=[..._0x4e97a6['getMinimalFlatRanges'](),..._0x3924e2['getMinimalFlatRanges']()];_0x5e3d23['reverse']();for(const _0x4045d8 of _0x5e3d23)_0xb17e42(_0x4045d8),ds(_0x4f5870,_0x4045d8);}(_0x2c426c['model'],_0x1b8b5a);}return{'content':Wi(_0x2c426c['data']['stringify'](_0x4766c2,{'showSuggestionHighlights':!0x0})),'hasChanges':!0x0};}function as(_0xa398c5,_0x57e69d){for(const [_0x54490b,_0x47d2d4]of _0xa398c5['markers']){const _0x3561c4=_0x14d15a['_createFromRanges'](_0x47d2d4['getTransformedByOperation'](_0x57e69d));_0xa398c5['markers']['set'](_0x54490b,_0x3561c4);}}function hs(_0x5d0508,_0x121607,_0x720c11){const _0x5e295c=_0x5d0508['plugins']['get']('DocumentCompare');let _0x5d4bef=_0x5d0508['model']['createPositionAt'](_0x720c11,Number['POSITIVE_INFINITY']),_0x32ad37=_0x5d0508['model']['createPositionAt'](_0x720c11,0x0);for(const _0x235171 of _0x121607){let _0x1966ef,_0x1ca7cf;if(_0x5e295c['isMarkedRemoveOperation'](_0x235171))_0x1966ef=_0x235171['newRange']['start'],_0x1ca7cf=_0x235171['newRange']['end'];else switch(_0x5d4bef=cs(_0x5d4bef,_0x235171),_0x32ad37=cs(_0x32ad37,_0x235171),_0x235171['type']){case'rename':_0x1966ef=_0x235171['position'],_0x1ca7cf=_0x1966ef['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x1966ef=_0x235171['range']['start'],_0x1ca7cf=_0x235171['range']['end'];break;case'insert':_0x1966ef=_0x235171['position'],_0x1ca7cf=_0x1966ef['getShiftedBy'](_0x235171['howMany']);break;case'split':_0x1966ef=_0x235171['splitPosition'],_0x1ca7cf=_0x235171['moveTargetPosition'];break;case'merge':{const _0x480b21=_0x235171['targetPosition']['path']['slice'](0x0,-0x1);_0x1966ef=_0x5d0508['model']['createPositionFromPath'](_0x720c11,_0x480b21),_0x1ca7cf=_0x1966ef['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x23e199=_0x235171['howMany'],_0x3182c2=_0x235171['sourcePosition']['_getTransformedByInsertion'](_0x235171['targetPosition'],_0x23e199),_0x39d157=_0x235171['getMovedRangeStart']();'remove'==_0x235171['type']?(_0x1966ef=_0x3182c2,_0x1ca7cf=_0x3182c2):(_0x1966ef=_0x39d157,_0x1ca7cf=_0x39d157['getShiftedBy'](_0x23e199));break;}}_0x1966ef&&_0x1966ef['isBefore'](_0x5d4bef)&&(_0x5d4bef=_0x1966ef['clone'](),_0x5d4bef['stickiness']='toNone'),_0x1ca7cf&&_0x1ca7cf['isAfter'](_0x32ad37)&&(_0x32ad37=_0x1ca7cf['clone'](),_0x32ad37['stickiness']='toNone');}return _0x5d0508['model']['createSelection'](_0x5d0508['model']['createRange'](_0x5d4bef,_0x32ad37));}function cs(_0x274c8f,_0x3b53df){return'move'!=_0x3b53df['type']&&'remove'!=_0x3b53df['type']||_0x3b53df['sourceRange']['containsPosition'](_0x274c8f)&&((_0x274c8f=_0x3b53df['sourcePosition']['clone']())['stickiness']='toNone'),_0x274c8f['getTransformedByOperation'](_0x3b53df);}function ls(_0x4e90f1,_0x47b371){us(_0x4e90f1,_0x47b371,'forward');const _0x298ecc=_0x47b371['getFirstRange']();_0x47b371['setTo']([]),_0x47b371['setTo'](_0x298ecc,{'backward':!0x0}),us(_0x4e90f1,_0x47b371,'backward');}function us(_0x3ad795,_0x5a099e,_0x1dcb24){let _0x16ff64=0x14;for(;_0x16ff64;){_0x3ad795['modifySelection'](_0x5a099e,{'unit':'word','direction':_0x1dcb24}),_0x16ff64--;const _0x55ea03=_0x5a099e['focus']['forward'==_0x1dcb24?'nodeBefore':'nodeAfter'];if(_0x55ea03&&_0x55ea03['is']('element')&&_0x3ad795['schema']['isBlock'](_0x55ea03)&&_0x3ad795['schema']['isObject'](_0x55ea03))break;}}function ds(_0x372a29,_0x4fd248){for(const [_0x11893c,_0x5b0e63]of _0x372a29['markers']){const _0x524448=_0x5b0e63['_getTransformedByDeletion'](_0x4fd248['start'],_0x4fd248['end']['offset']-_0x4fd248['start']['offset']);null!=_0x524448?_0x372a29['markers']['set'](_0x11893c,_0x524448):_0x372a29['markers']['delete'](_0x11893c);}}class AIReply extends ct(){['id'];['interactionId'];['type'];['content']=new Map();['sources']=[];['parsedContent']=new Map();['parsedMergedContent']=new Map();['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['_documentIdToSource']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x199e44,isDone:_0x1677cb=!0x1,isComplete:_0xcbe9b0,interactionId:_0x1033c8,areActionsDisabled:_0x370374,isFromHistory:_0x4ea960=!0x1,documentContextContent:_0xe5f9a9,locale:_0xaa493e,id:_0x29e461,channelsToEditors:_0x5dbf1d}){super(),this['id']=_0x29e461||at(),this['interactionId']=_0x1033c8,this['type']=_0x199e44,this['areActionsDisabled']=!!_0x370374,this['isFromHistory']=_0x4ea960,this['locale']=_0xaa493e,this['aiResponseParser']=new AIResponseParser(),this['aiResponseApplier']=new AIResponseApplier(),this['documentContextContent']=new Map(_0xe5f9a9?.['map'](_0x585c04=>[_0x585c04['id'],Wi(_0x585c04['content'])])||[]),this['_documentIdToSource']=new Map(_0xe5f9a9?.['map'](_0x192b95=>[_0x192b95['id'],{'editor':_0x5dbf1d['get'](_0x192b95['channelId']),'rootName':_0x192b95['rootName']}])||[]),this['set']('isDone',_0x1677cb),this['set']('isComplete',_0xcbe9b0??_0x1677cb),'text'===this['type']&&this['content']['set']('text','');}['appendContent'](_0x549067,_0x32e7d1){const _0x35a9bd='text'===this['type']?'text':_0x32e7d1;this['content']['has'](_0x35a9bd)||this['content']['set'](_0x35a9bd,''),this['content']['set'](_0x35a9bd,this['content']['get'](_0x35a9bd)+_0x549067),this['onContentChange'](_0x35a9bd);}['done'](_0x36b33c=!0x0){this['isComplete']=_0x36b33c,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x268a14,_0x15364a){this['changeGroups'][_0x268a14]['state']=_0x15364a,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x268a14,'state':_0x15364a});}['getContentParts']({showDiff:_0x180bc6,groupIndex:_0x3ea655}){const _0x1959ed=this['_getCachedContentParts'](_0x180bc6,_0x3ea655);if(_0x1959ed)return _0x1959ed;let _0x8b952b=[];if(void 0x0===_0x3ea655)_0x8b952b=this['changeGroups'];else{const _0x3215ce=this['changeGroups']['find'](({index:_0x10b80e})=>_0x10b80e===_0x3ea655);if(!_0x3215ce)throw new ht('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x3ea655});_0x8b952b=[_0x3215ce];}const _0x4f7a1e=rs({'showDiff':_0x180bc6,'changeGroups':_0x8b952b,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x180bc6,_0x4f7a1e),_0x4f7a1e;}['_getCachedContentParts'](_0x1c6873,_0x107a01){const _0xa79ab6=_0x1c6873?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0xa79ab6]['length'])return null;const _0x230bc2=this['cachedSuggestionContentParts'][_0xa79ab6];if(void 0x0===_0x107a01)return _0x230bc2['length']>0x0&&_0x230bc2['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x1c6873,null),null):_0x2dd6a9(_0x230bc2);{const _0x498dfe=_0x230bc2['find'](({index:_0x5575c0})=>_0x5575c0===_0x107a01);if(_0x498dfe)return[_0x2dd6a9(_0x498dfe)];}return null;}['_setCachedContentParts'](_0x49ba19,_0x4a787b){const _0x2db803=_0x49ba19?'withDiff':'withoutDiff';_0x4a787b?_0x4a787b['forEach'](_0x2e1c12=>{const _0x596703=this['cachedSuggestionContentParts'][_0x2db803],_0x800df6=_0x596703['find'](({index:_0x5504a9})=>_0x5504a9===_0x2e1c12['index']);if(_0x800df6){const _0x348a5c=_0x596703['indexOf'](_0x800df6);_0x596703['splice'](_0x348a5c,0x1,_0x2e1c12);}else _0x596703['push'](_0x2e1c12);}):this['cachedSuggestionContentParts'][_0x2db803]['length']=0x0;}['onContentChange'](_0x188374){if('modification'===this['type']){if(_0x188374)this['parsedContent']['set'](_0x188374,this['aiResponseParser']['parseAndNormalizeHTML'](this['content']['get'](_0x188374)));else{for(const [_0x358e23,_0x539157]of this['content'])this['parsedContent']['set'](_0x358e23,this['aiResponseParser']['parseAndNormalizeHTML'](_0x539157));}const _0x2a4054=this['changeGroups'];for(const _0x3b0ff6 of this['content']['keys']())this['updateChangeGroups'](_0x3b0ff6);const _0x1b95f5=this['_getDifferentChangeGroups'](_0x2a4054,this['changeGroups']);(_0x1b95f5['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x1b95f5),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']['set']('text',this['aiResponseParser']['convertMarkdownToHTML'](this['content']['get']('text'))),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x5c9528,_0x4a0110){const _0x2b3a17=[];for(const _0x3cbbed of _0x4a0110){const _0xbc779b=_0x5c9528[_0x3cbbed['index']];_0xbc779b?_0xbc779b['changes']['length']!==_0x3cbbed['changes']['length']?_0x2b3a17['push'](_0x3cbbed):_0xbc779b['changes']['forEach']((_0x2003be,_0x48a7ec)=>{const _0x5eb7af=_0x3cbbed['changes'][_0x48a7ec];_0x2003be['id']!==_0x5eb7af['id']&&_0x2b3a17['push'](_0x3cbbed);}):_0x2b3a17['push'](_0x3cbbed);}return _0x2b3a17;}['updateChangeGroups'](_0x55aaf8){const _0x5557e6=this['documentContextContent']['get'](_0x55aaf8),_0x22b188=this['parsedContent']['get'](_0x55aaf8);if(!_0x5557e6||!_0x22b188)return;const _0x204033=new _0xace074('p',{},[new _0xace074('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x41c341(Mi(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x327db7=this['aiResponseApplier']['merge'](_0x22b188,_0x5557e6['cloneNode'](!0x0),{'cutAfterUnstable':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x204033});this['parsedMergedContent']['set'](_0x55aaf8,_0x327db7['parsedContent']);let _0x25ac04=[];if(_0x3f0d08(_0x485bbb=>{const _0x2759a9=Xi(_0x485bbb,'data-id');if(!_0x2759a9||!_0x3db973(_0x2759a9))return!0x1;const _0xae3b4c=[_0x485bbb,...Ji(_0x485bbb)]['at'](-0x2);if(_0x485bbb!=_0xae3b4c){const _0x5a01dd=Xi(_0xae3b4c,'data-id');_0x3db973(_0x5a01dd)||(_0x25ac04['push']({'node':_0xae3b4c,'id':_0x5a01dd,'type':'modified'}),_0x327db7['modifiedNodeIds']['push'](_0x5a01dd));}else _0x327db7['modifiedNodeIds']['includes'](_0x2759a9)?_0x25ac04['push']({'node':_0x485bbb,'type':'modified','id':_0x2759a9}):_0x327db7['newNodeIds']['includes'](_0x2759a9)?_0x25ac04['push']({'node':_0x485bbb,'type':'new','id':_0x2759a9,'anchorId':Xi(_0x485bbb['previousSibling'],'data-id')}):_0x25ac04['push']({'node':_0x485bbb,'type':'removed','id':_0x2759a9});return!0x0;},this['parsedMergedContent']['get'](_0x55aaf8)),_0x25ac04=_0x25ac04['filter'](({node:_0x25729e})=>[...Ji(_0x25729e),_0x25729e]['every'](_0x15d618=>!Xi(_0x15d618,'data-unstable'))),this['changeGroups']=this['changeGroups']['filter'](_0xc14542=>_0xc14542['documentId']!==_0x55aaf8),0x0==_0x25ac04['length'])return;const _0x3feee5=[[_0x25ac04[0x0]]];for(let _0x23e654=0x1;_0x23e654<_0x25ac04['length'];_0x23e654++){const _0x829b2b=_0x3feee5[_0x3feee5['length']-0x1],_0x10b299=_0x829b2b[_0x829b2b['length']-0x1];_0x25ac04[_0x23e654]['node']['previousSibling']==_0x10b299['node']&&'modified'!=_0x25ac04[_0x23e654]['type']&&'modified'!=_0x10b299['type']?_0x829b2b['push'](_0x25ac04[_0x23e654]):_0x3feee5['push']([_0x25ac04[_0x23e654]]);}for(const _0x1c829b of _0x3feee5){const _0x2c4a0c=_0x1c829b[0x0],_0x4baa01=_0x1c829b[_0x1c829b['length']-0x1],_0x326b08=_0xd3142a(_0x2c4a0c['node']['previousSibling']);_0x326b08&&_0x1c829b['unshift'](_0x326b08);const _0x184a57=_0xd3142a(_0x4baa01['node']['nextSibling']);_0x184a57&&_0x1c829b['push'](_0x184a57);}$i('data-wrapped-id',null,this['parsedMergedContent']['get'](_0x55aaf8))['forEach'](_0x2b6034=>{zi(_0x2b6034,'data-wrapped-id',null);});const _0x3c137e=new Map();$i('data-unwrapped-id',null,this['parsedMergedContent']['get'](_0x55aaf8))['forEach'](_0x2313bb=>{const _0x585471=Xi(_0x2313bb,'data-unwrapped-id'),_0x51bd0d=Xi(_0x2313bb,'data-id');_0x3c137e['set'](_0x51bd0d,_0x585471),zi(_0x2313bb,'data-id',_0x585471),zi(_0x2313bb,'data-unwrapped-id',null);});for(const _0x460942 of _0x25ac04){const _0x215b4e=_0x3c137e['get'](_0x460942['id']);_0x215b4e&&(_0x460942['id']=_0x215b4e);}this['changeGroups']['push'](..._0x3feee5['map']((_0x362790,_0xf5e0b3)=>({'changes':_0x362790,'state':'pending','index':_0xf5e0b3,'editor':this['_documentIdToSource']['get'](_0x55aaf8)['editor'],'rootName':this['_documentIdToSource']['get'](_0x55aaf8)['rootName'],'documentId':_0x55aaf8})));const _0x416359=Array['from'](this['documentContextContent']['keys']());function _0x3db973(_0x387a3d){return _0x327db7['modifiedNodeIds']['includes'](_0x387a3d)||_0x327db7['newNodeIds']['includes'](_0x387a3d)||_0x327db7['removedNodeIds']['includes'](_0x387a3d);}function _0xd3142a(_0x296cc6){if(_0x296cc6&&Xi(_0x296cc6,'data-id')&&!Xi(_0x296cc6,'data-unstable')){const _0x2a9e18=Xi(_0x296cc6,'data-id');if(!_0x3db973(_0x2a9e18))return{'node':_0x296cc6,'type':'context','id':_0x2a9e18};}return null;}this['changeGroups']['sort']((_0x4f52a1,_0x27ca42)=>_0x416359['indexOf'](_0x4f52a1['documentId'])-_0x416359['indexOf'](_0x27ca42['documentId'])),this['changeGroups']['forEach']((_0x43b494,_0x11d33d)=>{_0x43b494['index']=_0x11d33d;});}}const _s=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class AIInteraction extends Et(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;['_channelsToEditors'];constructor({connector:_0xe62147,locale:_0xffbd0d,channelsToEditors:_0x11ba36}){super(),this['id']=at(),this['connector']=_0xe62147,this['isStopped']=!0x0,this['locale']=_0xffbd0d,this['_channelsToEditors']=_0x11ba36||new Map();}async['start'](){await this['_run']();}async['resume'](_0x82d892){await this['_run'](_0x82d892);}async['_run'](_0x1ad34b){const _0x753232=[];let _0x37c8ed,_0x49a4f4,_0x272179,_0x1bb15e=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=_0x1ad34b||await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x479d7d=await this['currentRequest']['getStream']();for await(const _0x3a21f9 of _0x479d7d){if(this['isStopped'])return;if('error'==_0x3a21f9['event'])return void this['fire']('error',{'error':new ht('ai-chat-interaction-error',this)});switch(_0x3a21f9['event']){case'message-metadata':this['messageId']=_0x3a21f9['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x3a21f9['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x3a21f9['data']['conversationTitle'],!0x0);break;case'source':_0x753232['push'](_0x3a21f9['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x37c8ed='modification-delta'==_0x3a21f9['event']?'modification':'text',_0x49a4f4='modification-delta'==_0x3a21f9['event']?_0x3a21f9['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x37c8ed&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x37c8ed,'interactionId':this['id'],'id':_0x49a4f4,'channelsToEditors':this['_channelsToEditors'],...'modification-delta'==_0x3a21f9['event']&&{'documentId':_0x3a21f9['data']['documentId']}}),'modification'==_0x37c8ed&&(this['currentReply']['sources']=_0x753232['splice'](0x0))),this['currentReply']['appendContent'](_0x3a21f9['data']['textDelta'],_0x3a21f9['data']['documentId']);break;case'mcp-tool-result':_0x272179=JSON['parse'](_0x3a21f9['data']['result']),this['_handleToolResultData']({'toolName':_0x3a21f9['data']['toolName'],'data':_0x272179['data'],'attributes':_0x272179['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x3a21f9['data']['toolName'],'data':_0x3a21f9['data']['data']});}}_0x1bb15e=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x753232['length']>0x0&&(this['currentReply']['sources']=_0x753232['splice'](0x0)),this['_finalizeInteraction'](_0x1bb15e),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x342957){return this['replies']['find'](_0xbf74e8=>_0xbf74e8['id']===_0x342957);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x2c90cf=>_0x2c90cf['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x3f63cf){const _0x583656=this['getDocumentContext'](),_0x17cf34=new AIReply({'locale':this['locale'],'documentContextContent':_0x583656?.['documents'],..._0x3f63cf});return this['replies']['push'](_0x17cf34),_0x17cf34['delegate'](..._s)['to'](this),this['fire']('replyCreated',_0x17cf34),_0x17cf34;}['setConversationTitle'](_0xb9a462,_0x765bd0=!0x1){this['fire']('setConversationTitle',_0xb9a462,_0x765bd0);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x55cf18){this['fire']('toolDataReceived',{'type':'result','toolName':_0x55cf18['toolName'],'data':structuredClone(_0x55cf18['data']||{}),'attributes':structuredClone(_0x55cf18['attributes']||{})},this);}['_handleToolNotificationData'](_0x2d51dd){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x2d51dd['toolName'],'data':structuredClone(_0x2d51dd['data'])},this);}['_finalizeInteraction'](_0x538566=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x538566),this['currentRequest']=this['currentReply']=void 0x0;}}const Is=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),As=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class AIChatContext extends ct(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x97353d,config:_0x336378,ownerId:_0x60af1a}){super(),this['_connector']=_0x97353d,this['_config']=_0x336378,this['_ownerId']=_0x60af1a;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x125e84){const _0x4dfbdb=await this['_createContextItemFromContent'](_0x125e84);return this['_addToConversationContextItem'](_0x4dfbdb),'current-document'===_0x4dfbdb['uiId']&&this['toggleAddCurrentDocumentOptionVisibility'](),_0x4dfbdb;}async['populateDocumentsFromMessage'](_0x2a066d,_0x111bc5){const _0x1b5809=_0x2a066d['filter'](_0x211162=>'document'===_0x211162['type']);if(0x0===_0x1b5809['length'])return{'hasUnmatched':!0x1};const _0x3793c7=_0x1b5809['map'](_0x4b9457=>_0x4b9457['id']),_0x3bb691=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x3793c7)['getDocuments'](),_0x40bb34=new Map(_0x3bb691['map'](_0x3271b2=>[_0x3271b2['id'],_0x3271b2])),_0x34bb44=[];let _0x274c5b=!0x1;for(const _0x346b57 of _0x1b5809){const _0x4e33c1=_0x40bb34['get'](_0x346b57['id']);_0x4e33c1&&(this['_matchDocumentToRoot'](_0x4e33c1,_0x111bc5)||(_0x274c5b=!0x0),_0x34bb44['push']({'id':_0x4e33c1['id'],'content':_0x4e33c1['content'],'version':_0x4e33c1['attributes']?.['version']??0x0,'sessionId':_0x4e33c1['attributes']?.['sessionId']??null,'selection':[],'channelId':_0x4e33c1['attributes']?.['channelId']??_0x111bc5[0x0]?.['config']['get']('collaboration.channelId')??'','rootName':_0x4e33c1['attributes']?.['rootName']??_0x111bc5[0x0]?.['model']['document']['getRoots']()[0x0]['rootName']??''}));}const _0x34935c={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x34bb44};return this['_addToConversationContextItem'](_0x34935c),this['toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x34935c,'hasUnmatched':_0x274c5b};}['_matchDocumentToRoot'](_0x1ee1e8,_0x19f331){const _0x9f0c2e=_0x1ee1e8['attributes']?.['channelId'],_0x131471=_0x1ee1e8['attributes']?.['rootName'];if(_0x9f0c2e&&_0x131471){for(const _0x54e409 of _0x19f331)if(_0x54e409['config']['get']('collaboration.channelId')===_0x9f0c2e){for(const _0x334ea6 of _0x54e409['model']['document']['getRoots']())if('$graveyard'!==_0x334ea6['rootName']&&_0x334ea6['rootName']===_0x131471)return{'editor':_0x54e409,'rootName':_0x334ea6['rootName']};}}}async['_createContextItemFromContent'](_0x413788){if('document'===_0x413788['type']){const _0x5cf4a6=await this['_connector']['fetchDocument'](this['_ownerId'],_0x413788['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x413788['type'],'content':_0x5cf4a6['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x5cf4a6['attributes']?.['version'],'sessionId':_0x5cf4a6['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x413788['type'])return{'id':_0x413788['id'],'uiId':_0x413788['id'],'label':_0x413788['data']?.['label']||_0x413788['id'],'type':'mcp-tool-context','mcpServerName':_0x413788['mcpServerName'],'toolName':_0x413788['toolName'],'data':_0x413788['data']||{}};return{'id':_0x413788['id'],'uiId':_0x413788['id'],'label':_0x413788['attributes']?.['label']||_0x413788['name']||_0x413788['url']||_0x413788['id'],'type':_0x413788['type'],..._0x413788?.['attributes']?.['resourceId']?{'resourceId':_0x413788['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x5e6bdd){const _0x776b52=this['_pendingContextItems']['get'](_0x5e6bdd);_0x776b52?.['isReadOnly']||this['_removeContextItem'](_0x5e6bdd);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x4ec7e8 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x4ec7e8['uiId']);const _0x54fa5b=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x54fa5b&&this['_addContextItem']({..._0x54fa5b,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x298431){for(const _0x315248 of _0x298431['values']())this['_addToConversationContextItem'](_0x315248);this['clearPendingContextItems'](),this['fire']('contextSent',{'contextItems':Array['from'](this['getSentContextItems']()['values']())});}['isCurrentDocumentInContext'](){return this['_pendingContextItems']['has']('current-document');}['isSelectionInContext'](){return this['_pendingContextItems']['has']('selection');}['isCurrentDocumentInConversation'](){return this['_conversationContextItems']['has']('current-document');}static['mapContextItemsToRequestData'](_0x4eb9dc){return Array['from'](_0x4eb9dc['values']())['flatMap'](_0x590a32=>this['_mapContextItemToRequestData'](_0x590a32));}async['addFilesToContext'](_0x2dad39,_0x18be85,_0x3185b6='file'){const _0x5972bc='files-'+at();this['_startUploadOperation'](_0x5972bc);try{await Promise['all'](_0x2dad39['map'](async _0x4014e0=>{const _0x513ecf='file-'+at(),_0x313346=_0xe3e6fb(_0x4014e0['name']),_0x3834df='file'===_0x3185b6&&_0x4014e0['type']['startsWith']('image/')?'image':_0x3185b6;try{this['_addContextItem']({'type':_0x3834df,'label':_0x18be85?.['label']||_0x313346,'uiId':_0x513ecf,'resourceId':_0x18be85?.['resourceId']},!0x0);const _0x29acb5=this['_connector']['uploadFile'](this['_ownerId'],_0x4014e0,_0x18be85);this['_ongoingUploads']['set'](_0x513ecf,_0x29acb5['abortController']);const {id:_0x39b45a}=await _0x29acb5['getId']();this['_ongoingUploads']['delete'](_0x513ecf),this['_finishContextItemLoading']({'type':_0x3834df,'id':_0x39b45a,'label':_0x18be85?.['label']||_0x313346,'uiId':_0x513ecf,'resourceId':_0x18be85?.['resourceId']},!0x1);}catch(_0x2843a0){this['_ongoingUploads']['delete'](_0x513ecf);if(!(_0x2843a0 instanceof ht&&_0x2843a0['message']['startsWith']('ai-request-aborted'))){const _0x49f926=Is['get'](_0x2843a0['code'])||'ai-chat-file-upload-failed',_0x266032=new ht(_0x49f926,null,{'fileName':_0x313346,..._0x2843a0});_0x266032['stack']=_0x2843a0['stack'],this['fire']('error',{'error':_0x266032});}this['_removeContextItem'](_0x513ecf);}}));}finally{this['_finishUploadOperation'](_0x5972bc);}}['addCurrentDocumentToContext'](_0x49b76f){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x307f78={'type':'document','uiId':'current-document','label':_0x49b76f,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x307f78);}async['updateCurrentDocuments'](_0x41308a){const _0x3bfc97=this['_pendingContextItems']['get']('current-document');if(!_0x3bfc97||!_0x41308a['length']||_0x41308a['every'](_0x4e3ab1=>!_0x4e3ab1['content']))return;_0x41308a['length']>0x1&&_0x41308a['some'](_0x85103b=>!_0x85103b['description'])&&wt('ai-chat-documents-missing-description');try{const _0x2e1949=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x41308a)['getIds']();if(_0x2e1949['length']!==_0x41308a['length']||_0x2e1949['some'](_0x294dc3=>!_0x294dc3?.['id'])){const _0x10877d=new ht('ai-chat-document-upload-reply-mismatch',null);return void this['fire']('error',{'error':_0x10877d});}_0x3bfc97['documents']=_0x41308a['map']((_0x2ccc2c,_0x43a30)=>{return{'id':_0x2e1949[_0x43a30]['id'],'content':_0x2ccc2c['content'],'version':_0x2ccc2c['version'],'sessionId':_0x2ccc2c['sessionId'],'selection':(_0x457af6=_0x2ccc2c['selections'],_0x457af6?_0x457af6['map'](_0x1e4909=>({'start':_0x1e4909['start'],'end':_0x1e4909['end']})):[]),'channelId':_0x2ccc2c['channelId'],'rootName':_0x2ccc2c['rootName']};var _0x457af6;});}catch(_0x39654e){const _0x3af2ba=new ht('ai-chat-document-upload-failed',null);_0x3af2ba['stack']=_0x39654e['stack'],this['fire']('error',{'error':_0x3af2ba});}}['addSelectionToContext'](_0xfa3f10){this['_addContextItem']({'type':'selection','label':_0xfa3f10,'uiId':'selection','content':_0xfa3f10});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x3889b7,_0x10f03a){const _0x2462b2='url-'+at();this['_startUploadOperation'](_0x2462b2);const _0x38be72='url-'+at();try{this['_addContextItem']({'type':'web-resource','label':_0x10f03a?.['label']||_0x3889b7,'uiId':_0x38be72,'resourceId':_0x10f03a?.['resourceId']},!0x0);const _0x5c7139=this['_connector']['uploadUrl'](this['_ownerId'],_0x3889b7,_0x10f03a);this['_ongoingUploads']['set'](_0x38be72,_0x5c7139['abortController']);const {id:_0x1158ca}=await _0x5c7139['getId']();this['_ongoingUploads']['delete'](_0x38be72),this['_finishContextItemLoading']({'type':'web-resource','id':_0x1158ca,'label':_0x10f03a?.['label']||_0x3889b7,'uiId':_0x38be72,'resourceId':_0x10f03a?.['resourceId']},!0x1);}catch(_0x23f9bb){this['_ongoingUploads']['delete'](_0x38be72),(_0x23f9bb['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ht('ai-chat-url-upload-failed',this,{'url':_0x3889b7,'originalError':_0x23f9bb}),'url':_0x3889b7}),this['_removeContextItem'](_0x38be72));}finally{this['_finishUploadOperation'](_0x2462b2);}}['addToolItemToContext'](_0x22f24a){_0x22f24a['id']=_0x22f24a['id']??at()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x22f24a['uiId'],_0x22f24a),this['fire']('contextItemAdded',{'contextItem':_0x22f24a,'isLoading':!0x1});}async['loadSourceResources'](_0x4c2798,_0x524f22,_0x90cc4a){const _0x566f41=this['_addContextOptionsState']['sources']['find'](_0x238918=>_0x238918['id']===_0x4c2798);if(!_0x566f41)return this['fire']('error',{'error':new ht('ai-chat-source-not-found',this,{'sourceId':_0x4c2798}),'sourceId':_0x4c2798}),[];try{const _0x1d3ecb=(await _0x566f41['getResources'](_0x524f22))['map'](_0x18c7a7=>{const _0x31ebaa=this['_isResourceInContext'](_0x18c7a7['id']);return{..._0x18c7a7,'isInContext':_0x31ebaa};});return _0x566f41['resources']=_0x1d3ecb,this['fire']('sourceResourcesLoaded',{'sourceId':_0x4c2798,'source':_0x566f41,'resources':_0x1d3ecb,'uid':_0x90cc4a}),_0x1d3ecb;}catch(_0x3938af){return this['fire']('error',{'error':new ht('ai-chat-source-resources-load-failed',this,{'sourceId':_0x4c2798,'originalError':_0x3938af}),'sourceId':_0x4c2798,'sourceLabel':_0x566f41['label']}),[];}}async['addResourceToContext'](_0x50f2d9,_0x4817cc){if(this['_isResourceInContext'](_0x4817cc['id']))return;let _0x1296d7=_0x4817cc['data'];if(!_0x1296d7&&_0x50f2d9['getData'])try{_0x1296d7=await _0x50f2d9['getData'](_0x4817cc['id']);}catch(_0x134cb0){return void this['fire']('error',{'error':new ht('ai-chat-resource-load-failed',this,{'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id'],'originalError':_0x134cb0}),'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id']});}if(_0x1296d7)switch(_0x4817cc['type']){case'web-resource':if('string'!=typeof _0x1296d7)return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id'],'expectedType':'string','actualType':typeof _0x1296d7}),'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id']});await this['addUrlToContext'](_0x1296d7,{'label':_0x4817cc['label'],'resourceId':_0x4817cc['id']});break;case'file':if(!(_0x1296d7 instanceof File))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id'],'expectedType':'File','actualType':typeof _0x1296d7}),'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id']});await this['addFilesToContext']([_0x1296d7],{'label':_0x4817cc['label'],'resourceId':_0x4817cc['id']});break;case'text':if('object'!=typeof _0x1296d7||!('content'in _0x1296d7)||!('type'in _0x1296d7))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x1296d7}),'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id']});_0x1296d7=AIChatContext['_convertTextResourceToFile'](_0x1296d7,_0x4817cc['label']),await this['addFilesToContext']([_0x1296d7],{'label':_0x4817cc['label'],'resourceId':_0x4817cc['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ht('ai-chat-context-unsupported-type',this,{'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id'],'resourceType':_0x4817cc['type']}),'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id']});}else this['fire']('error',{'error':new ht('ai-chat-resource-no-data',this,{'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id']}),'resourceId':_0x4817cc['id'],'sourceId':_0x50f2d9['id']});}['toggleAddCurrentDocumentOptionVisibility'](_0x1b07ee){if(void 0x0!==_0x1b07ee)this['_addContextOptionsState']['document']['isHidden']=!_0x1b07ee;else{const _0x10d5c1=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x10d5c1;}this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}static['_convertTextResourceToFile'](_0x27de15,_0x769ff8){switch(_0x27de15['type']){case'markdown':return new File([_0x27de15['content']],_0x769ff8,{'type':'text/markdown'});case'html':return new File([_0x27de15['content']],_0x769ff8,{'type':'text/html'});default:return new File([_0x27de15['content']],_0x769ff8,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x40d54d){switch(_0x40d54d['type']){case'file':case'image':case'text':return[{'type':'file','id':_0x40d54d['id']}];case'web-resource':return[{'type':'web-resource','id':_0x40d54d['id']}];case'document':return _0x40d54d['documents']?.['length']?_0x40d54d['documents']['map'](_0x198ada=>({'type':'document','id':_0x198ada['id'],..._0x198ada['selection']?.['length']&&{'selection':_0x198ada['selection']}})):[{'type':'document','id':_0x40d54d['id'],..._0x40d54d['selection']?.['length']&&{'selection':_0x40d54d['selection']}}];case'mcp-tool-context':{const _0x3606ed=_0x40d54d;return[{'type':'mcp-tool-context','mcpServerName':_0x3606ed['mcpServerName'],'toolName':_0x3606ed['toolName'],'data':{..._0x3606ed['data'],'label':_0x3606ed['label']||_0x3606ed['data']?.['label']||_0x3606ed['id']},'id':_0x3606ed['id']}];}default:return[];}}['_addContextItem'](_0x5a9922,_0x181f37=!0x1){if(this['_pendingContextItems']['set'](_0x5a9922['uiId'],_0x5a9922),_0x5a9922['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x5a9922,'isLoading':_0x181f37}),'current-document'===_0x5a9922['uiId']&&this['toggleAddCurrentDocumentOptionVisibility'](),_0x5a9922['resourceId']){const _0x5dd698=this['_findSourceIdsByResourceId'](_0x5a9922['resourceId']);_0x5dd698&&_0x5dd698['forEach'](_0x501162=>{this['_updateResourceInContextState'](_0x501162,_0x5a9922['resourceId'],!0x0);});}}['_removeContextItem'](_0x4517e9){const _0x584d81=this['_pendingContextItems']['get'](_0x4517e9),_0x3921af=this['_ongoingUploads']['get'](_0x4517e9);if(_0x3921af&&(_0x3921af['abort'](),this['_ongoingUploads']['delete'](_0x4517e9)),_0x584d81?.['resourceId']){const _0x5b0dd7=this['_findSourceIdsByResourceId'](_0x584d81['resourceId']);_0x5b0dd7&&_0x5b0dd7['forEach'](_0x49a252=>{this['_updateResourceInContextState'](_0x49a252,_0x584d81['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x4517e9),this['fire']('contextItemRemoved',{'uiId':_0x4517e9,'type':_0x584d81?.['type']}),'current-document'===_0x4517e9&&this['toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x2cf296,_0x5ebedb){if(this['_pendingContextItems']['has'](_0x2cf296['uiId'])&&(this['_pendingContextItems']['set'](_0x2cf296['uiId'],_0x2cf296),this['fire']('contextItemLoadingEnded',{'contextItem':_0x2cf296,'isLoading':_0x5ebedb}),_0x2cf296['resourceId'])){const _0x53a0e2=this['_findSourceIdsByResourceId'](_0x2cf296['resourceId']);_0x53a0e2&&_0x53a0e2['forEach'](_0x37a3d9=>{this['_updateResourceInContextState'](_0x37a3d9,_0x2cf296['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x4d6854){this['_conversationContextItems']['set'](_0x4d6854['uiId'],_0x4d6854);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x57e927=>({..._0x57e927,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x5c97f2=>({..._0x5c97f2,'resources':[]}))??[];}['_isResourceInContext'](_0x5e3a8e){for(const _0x4ccac0 of this['_pendingContextItems']['values']())if(_0x4ccac0['resourceId']===_0x5e3a8e)return!0x0;for(const _0x44deec of this['_conversationContextItems']['values']())if(_0x44deec['resourceId']===_0x5e3a8e)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x243703){const _0x18ab7a=[];for(const _0x4ba8c5 of this['_addContextOptionsState']['sources']){_0x4ba8c5['resources']['find'](_0x400ee1=>_0x400ee1['id']===_0x243703)&&_0x18ab7a['push'](_0x4ba8c5['id']);}return 0x0===_0x18ab7a['length']?null:_0x18ab7a;}['_updateResourceInContextState'](_0x31658e,_0xe06c1,_0x59e223){const _0x4eb2c7=this['_addContextOptionsState']['sources']['find'](_0x9f38e=>_0x9f38e['id']===_0x31658e);if(!_0x4eb2c7)return;const _0x11b21d=_0x4eb2c7['resources']['find'](_0x247876=>_0x247876['id']===_0xe06c1);_0x11b21d&&(_0x11b21d['isInContext']=_0x59e223,this['fire']('resourceStateChanged',{'sourceId':_0x31658e,'resourceId':_0xe06c1,'isInContext':_0x59e223}));}['_startUploadOperation'](_0x533ab9){this['_ongoingUploadOperations']['set'](_0x533ab9,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x3ccc12){this['_ongoingUploadOperations']['delete'](_0x3ccc12),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const gs=['capabilitiesUpdated'];class AICapabilities extends Et(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x380c1a){const _0x3f1d38={};return _0x380c1a&&_0x380c1a['isWebSearchEnabled']&&(_0x3f1d38['webSearch']={}),_0x380c1a&&_0x380c1a['isReasoningEnabled']&&(_0x3f1d38['reasoning']={}),_0x3f1d38;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x35cf5e){_0x35cf5e!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x35cf5e,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x2274e9){_0x2274e9!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x2274e9,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class AIChatInteraction extends AIInteraction{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x2773ea){super(_0x2773ea),this['conversationId']=_0x2773ea['conversationId'],this['contextItems']=_0x2773ea['contextItems'],this['capabilities']=_0x2773ea['capabilities'],this['userMessage']=_0x2773ea['userMessage'],this['model']=_0x2773ea['model'],this['attributes']=_0x2773ea['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':AIChatContext['mapContextItemsToRequestData'](this['contextItems']),'capabilities':AICapabilities['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class AIChatConversation extends Et(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];['_channelsToEditors'];['_getSessionId'];constructor(_0x1b2ac3){super(),this['options']=_0x1b2ac3,this['connector']=_0x1b2ac3['connector'],this['chatModels']=_0x1b2ac3['chatModels'],this['id']=_0x1b2ac3['conversationId'],this['isFromHistory']=_0x1b2ac3['isFromHistory'],this['_channelsToEditors']=_0x1b2ac3['channelsToEditors'],this['_getSessionId']=_0x1b2ac3['getSessionId'];}async['init'](_0x4313b4){try{this['chatContext']=new AIChatContext({'connector':this['connector'],'config':_0x4313b4,'ownerId':this['id']}),this['chatContext']['delegate'](...As)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new AICapabilities(),this['chatCapabilities']['delegate'](...gs)['to'](this),this['chatCapabilities']['init']();const _0x1f53f3=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x1f53f3});const _0x43ef67=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x43ef67&&await this['setModel'](_0x43ef67);}catch(_0xed257){const _0x58e5fa=new ht('ai-chat-conversation-init-failed',null,{'message':_0xed257['message']||_0xed257});_0x58e5fa['stack']=_0xed257['stack'],this['fire']('error',{'error':_0x58e5fa});}}async['start'](){if(this['isStarted'])throw new ht('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ht('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x5afec3}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x5afec3,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x4afeed){const _0x25404b=new ht('ai-chat-conversation-start-failed',null,{'message':_0x4afeed['message'],'conversationId':this['id']});throw _0x25404b['stack']=_0x4afeed['stack'],this['fire']('error',{'error':_0x25404b}),_0x25404b;}}async['load'](_0x4f00cf){try{const _0x3e75a7=await this['connector']['fetchConversation'](_0x4f00cf)['getConversation'](),_0x1a1c3b=await this['connector']['fetchConversationMessages'](_0x4f00cf)['getMessages'](),_0x1aca04=_0x1a1c3b[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x3e75a7['id'],'title'in _0x3e75a7?this['fire']('setConversationTitle',_0x3e75a7['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x1c21ed=(await this['chatModels']['getAll']())['find'](_0x195518=>_0x195518['id']['toLowerCase']()===_0x1aca04['toLowerCase']());this['selectedModel']=_0x1c21ed,this['fire']('modelSelected',{'selectedModel':_0x1c21ed,'isDisabled':!0x0});const {streamingMessageId:_0x45dbd3}=await this['_processMessagesToInteractions'](_0x1a1c3b,_0x1aca04);return _0x45dbd3&&this['currentInteraction']?this['_resumeStream'](_0x45dbd3):this['currentInteraction']=void 0x0,this;}catch(_0x339184){const _0x2e7152=new ht('ai-chat-conversation-init-from-id-failed',null,{'message':_0x339184['message'],'conversationId':_0x4f00cf});throw _0x2e7152['stack']=_0x339184['stack'],this['fire']('error',{'error':_0x2e7152}),_0x2e7152;}}async['_processMessagesToInteractions'](_0x57fbc0,_0x54d929){let _0x536fc7,_0x5f1bba,_0x18996d=!0x1;for(const _0x475a2b of _0x57fbc0)if('user'===_0x475a2b['role']){const {contextItems:_0xea9d6a,hasUnmatched:_0x43404b}=await this['_extractContextItems'](_0x475a2b);_0x18996d=_0x43404b;const _0x28d13a={'isReasoningEnabled':Object['hasOwn'](_0x475a2b['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x475a2b['capabilities'],'webSearch')};_0x536fc7=this['createInteraction']({'userMessage':_0x475a2b['prompt'],'contextItems':_0xea9d6a,'capabilities':_0x28d13a,'modelId':_0x54d929,'attributes':_0x475a2b['attributes'],'channelsToEditors':this['_channelsToEditors']}),this['currentInteraction']=_0x536fc7,_0x5f1bba=void 0x0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x475a2b['role']&&_0x536fc7){if('streaming'===_0x475a2b['status']){_0x5f1bba=_0x475a2b['id'];continue;}if('error'===_0x475a2b['status'])continue;const _0x31797a=[];for(const _0x490d8f of _0x475a2b['content'])switch(_0x490d8f['type']){case'text':case'modification':{const _0x2ca798=_0x536fc7['getDocumentContext'](),_0x30fb1b=this['_hasSessionMismatch'](_0x2ca798)||_0x18996d;_0x536fc7['currentReply']?.['type']!==_0x490d8f['type']&&(_0x536fc7['currentReply']=_0x536fc7['createReply']({'type':_0x490d8f['type'],'isDone':!0x0,'interactionId':_0x536fc7['id'],'areActionsDisabled':_0x30fb1b,'isFromHistory':!0x0,'channelsToEditors':this['_channelsToEditors']}),_0x31797a['length']>0x0&&(_0x536fc7['currentReply']['sources']=_0x31797a['splice'](0x0))),_0x536fc7['currentReply']['appendContent'](_0x490d8f['content'],_0x490d8f['documentId']);break;}case'url':_0x31797a['push'](_0x490d8f);break;case'mcp-tool-result':{const {data:_0x3b2835,attributes:_0x305f1c}=JSON['parse'](_0x490d8f['content']);_0x536fc7['_handleToolResultData']({'toolName':_0x490d8f['toolName'],'data':_0x3b2835,'attributes':_0x305f1c});break;}}'cancelled'===_0x475a2b['status']&&this['fire']('error',{'interactionId':_0x536fc7['id'],'error':new ht('ai-request-aborted',this)});}}return{'streamingMessageId':_0x5f1bba};}async['_resumeStream'](_0x4070d7){if(this['currentInteraction'])try{const _0xf083d2=this['connector']['resumeStream'](this['id'],_0x4070d7);await this['currentInteraction']['resume'](_0xf083d2);}catch(_0x4237bc){_0x4237bc instanceof ht&&this['fire']('error',{'interactionId':this['currentInteraction']?.['id'],'error':_0x4237bc});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}async['_extractContextItems'](_0x1b0391){const _0x2f2bfb=new Map();if(!_0x1b0391['content'])return{'contextItems':_0x2f2bfb,'hasUnmatched':!0x1};const {contextItem:_0x64ca7c,hasUnmatched:_0x298c0c}=await this['chatContext']['populateDocumentsFromMessage'](_0x1b0391['content'],Array['from'](this['_channelsToEditors']['values']()));_0x64ca7c&&_0x2f2bfb['set'](_0x64ca7c['id'],_0x64ca7c);for(const _0x49bfaa of _0x1b0391['content']){if('document'===_0x49bfaa['type'])continue;const _0x1de432=await this['chatContext']['populateFromMessage'](_0x49bfaa);_0x1de432&&_0x2f2bfb['set'](_0x1de432['id'],_0x1de432);}return{'contextItems':_0x2f2bfb,'hasUnmatched':_0x298c0c};}async['handleUserInteraction']({userMessage:_0x150af6,attributes:_0x13c8ce}){if(!this['isStarted'])throw new ht('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ht('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x2db30b=this['chatContext']['getPendingContextItems'](),_0x1f265d=this['chatCapabilities']['getCapabilitiesConfig'](),_0x23f32c=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x150af6,'contextItems':_0x2db30b,'capabilities':_0x1f265d,'modelId':_0x23f32c,'attributes':_0x13c8ce,'channelsToEditors':this['_channelsToEditors']}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x1481aa){if(_0x1481aa instanceof ht)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x1481aa});else{const _0x1552db=Is['get'](_0x1481aa['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ht(_0x1552db,null,{'error':_0x1481aa})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x3b73da,contextItems:_0x39a34c,capabilities:_0x2d86a5,modelId:_0x115acb,attributes:_0x251cca,channelsToEditors:_0x479c86}){const _0x1d7ae2=new AIChatInteraction({'userMessage':_0x3b73da,'contextItems':_0x39a34c,'capabilities':_0x2d86a5,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x115acb,'attributes':_0x251cca,'channelsToEditors':_0x479c86});return _0x1d7ae2['delegate'](..._s)['to'](this),this['interactions']['push'](_0x1d7ae2),this['fire']('interactionCreated',_0x1d7ae2),_0x1d7ae2;}['getInteraction'](_0x2e98e3){return this['interactions']['find'](_0x17def8=>_0x17def8['id']===_0x2e98e3);}['removeInteraction'](_0x2ee84f){const _0x4a8474=this['getInteraction'](_0x2ee84f);_0x4a8474&&(_0x4a8474['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4a8474),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['cancelLastInteractionStream'](){const _0x430ae0=this['lastInteraction'];_0x430ae0?.['conversationId']&&_0x430ae0['messageId']&&this['connector']['cancelStream'](_0x430ae0['conversationId'],_0x430ae0['messageId'])['execute']()['catch'](()=>{});}['addCurrentDocumentToContext'](_0x2806b2){this['chatContext']['addCurrentDocumentToContext'](_0x2806b2);}async['updateCurrentDocumentsInContext'](_0x2f87ee){await this['chatContext']['updateCurrentDocuments'](_0x2f87ee);}['toggleAddCurrentDocumentOptionVisibility'](_0x3baf37){this['chatContext']['toggleAddCurrentDocumentOptionVisibility'](_0x3baf37);}['_hasSessionMismatch'](_0xb3babe){return!!_0xb3babe&&_0xb3babe['documents']['some'](_0x541a61=>{const _0xae6db0=this['_channelsToEditors']['get'](_0x541a61['channelId']);return!_0xae6db0||_0x541a61['sessionId']!==this['_getSessionId'](_0xae6db0);});}['addSelectionToContext'](_0x36ceb7){this['chatContext']['addSelectionToContext'](_0x36ceb7);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x4f377a){this['chatContext']['addFilesToContext'](_0x4f377a);}['addUrlToContext'](_0x97054c){this['chatContext']['addUrlToContext'](_0x97054c);}['addToolItemToContext'](_0x191860){this['chatContext']['addToolItemToContext'](_0x191860);}['addResourceToContext'](_0x46c946,_0x8b972c){this['chatContext']['addResourceToContext'](_0x46c946,_0x8b972c);}['loadSourceResources'](_0x476193,_0x3bb79e,_0x386595){return this['chatContext']['loadSourceResources'](_0x476193,_0x3bb79e,_0x386595);}['removeFromContext'](_0x16faf6){this['chatContext']['removeFromContext'](_0x16faf6);}['setWebSearch'](_0x37d50b){this['chatCapabilities']['setWebSearch'](_0x37d50b);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x130cb4){this['chatCapabilities']['setReasoning'](_0x130cb4);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x5cbadd){_0x5cbadd?!0x1===await this['chatModels']['isAvailable'](_0x5cbadd)&&(wt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x5cbadd}),_0x5cbadd=(await this['chatModels']['getAvailableModels']())[0x0]):(wt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x5cbadd=(await this['chatModels']['getAvailableModels']())[0x0]),_0x5cbadd['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x5cbadd,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x5cbadd}));}}class AIModels extends Et(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3e8264,config:_0x39bdb8,locale:_0x225fa2}){super(),this['_connector']=_0x3e8264,this['_config']=_0x39bdb8,this['_locale']=_0x225fa2;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x3df932=await this['getAll']();let _0x1517b4;return _0x1517b4=this['_availableModels']?this['_filterModels'](_0x3df932,this['_availableModels']):_0x3df932['filter'](_0x4970d3=>_0x4970d3['recommended']),_0x1517b4;}async['getModel'](_0x664734){const _0x98d14a=await this['getAll']();if(!_0x98d14a['length'])return null;if(_0x664734){const _0x6d6c5f=this['_getModelById'](_0x98d14a,_0x664734);if(_0x6d6c5f)return _0x6d6c5f;wt('ai-chat-model-id-unrecognized',{'modelId':_0x664734,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x4ce15f=await this['getAvailableModels']();if(!_0x4ce15f['length'])return null;if(this['_defaultModelId']){const _0xd59291=this['_getModelById'](_0x4ce15f,this['_defaultModelId']);if(_0xd59291)return _0xd59291;wt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x4ce15f[0x0]['id']});}return _0x4ce15f[0x0];}async['isAvailable'](_0x31b91d){return(await this['getAvailableModels']())['some'](_0x21fa69=>_0x21fa69['name']===_0x31b91d['name']&&_0x21fa69['provider']===_0x31b91d['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x17f262=this['_locale']['uiLanguage']||'en',_0x21fd94=this['_connector']['getModels'](_0x17f262),_0x235474=await _0x21fd94['list']();this['_modelList']=_0x235474['items']['map'](_0x5f0009=>ws(_0x5f0009)?{..._0x5f0009,'name':Mi(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x5f0009);}catch(_0xd18aed){throw Ct('ai-models-unable-to-retrieve',{'error':_0xd18aed}),_0xd18aed;}return[...this['_modelList']];}['_filterModels'](_0x566c7a,_0x45e639){let _0x11698a;if(_0x45e639){_0x11698a=[];const _0x1319e8=new Set(),_0x2b75a9='string'==typeof _0x45e639?[_0x45e639['toLocaleLowerCase']()]:_0x45e639['map'](_0x5ef50a=>_0x5ef50a['toLocaleLowerCase']());for(const _0x249c17 of _0x2b75a9)for(const _0x4eab13 of _0x566c7a)!_0x1319e8['has'](_0x4eab13['id'])&&this['_isMatchingFilter'](_0x4eab13,_0x249c17)&&(_0x11698a['push'](_0x4eab13),_0x1319e8['add'](_0x4eab13['id']));}else _0x11698a=_0x566c7a;return _0x11698a;}['_isMatchingFilter'](_0x47322b,_0x3b8dde){const _0x218839=_0x47322b['id']['toLocaleLowerCase'](),_0x36f7b0=_0x47322b['name']['toLocaleLowerCase'](),_0x26dd91=_0x47322b['provider']['toLocaleLowerCase']();return _0x218839===_0x3b8dde||_0x36f7b0===_0x3b8dde||ws(_0x47322b)&&'auto'===_0x3b8dde||_0x26dd91===_0x3b8dde||_0x218839['startsWith'](_0x3b8dde);}['_getModelById'](_0x4d8999,_0x24acd7){return _0x4d8999['find'](_0x11abea=>ws(_0x11abea)&&'auto'===_0x24acd7?_0x11abea:_0x11abea['id']===_0x24acd7)||null;}}function ws(_0x41e839){return _0x41e839['id']['startsWith']('agent');}function Cs(_0x568f0b){return _0x568f0b?_0x568f0b instanceof _0x2b21e9?[_0x568f0b]:_0x568f0b['editors']&&0x0!==_0x568f0b['editors']['length']?Array['from'](_0x568f0b['editors']):[]:[];}function ms(_0x125503){const _0x18e77e=Cs(_0x125503);if(!_0x18e77e['length'])throw new ht('ai-get-editor-from-context-no-editor');if(0x1===_0x18e77e['length'])return _0x18e77e[0x0];const _0x4736ce=_0x18e77e['find'](_0x379394=>_0x379394['ui']?.['focusTracker']?.['isFocused']);if(_0x4736ce)return _0x4736ce;const _0x23e8b0=function(_0x5ae499){if(_0x5ae499 instanceof _0x2b21e9)return;const _0x1a9fe2=_0x5ae499;if(!_0x1a9fe2['plugins']||!_0x1a9fe2['plugins']['has']('AIEditing'))return;const _0x3ec4f2=_0x1a9fe2['plugins']['get']('AIEditing');return _0x3ec4f2['getLastContentFocusedEditor']?.();}(_0x125503);return _0x23e8b0&&_0x18e77e['includes'](_0x23e8b0)?_0x23e8b0:_0x18e77e[0x0];}function ps({interaction:_0xf88751,reply:_0x511248,groups:_0x41386f,transform:_0x592d02,documentCompare:_0x2f5dc6,documentCompareOptions:_0x54de5b}){const _0x1fa4b1=_0xf88751['getDocumentContext']()['documents']['find'](_0x108a2a=>_0x108a2a['id']==_0x41386f[0x0]['documentId']),_0x59d026=_0x41386f[0x0]['editor'];if(!_0x1fa4b1)return[];const _0x18e33c=_0x1fa4b1['content'],_0x36f58f=_0x1fa4b1['version'],_0x1c9aba=_0x511248['documentContextContent']['get'](_0x41386f[0x0]['documentId'])['cloneNode'](!0x0);for(const {changes:_0x31a182}of _0x41386f){const _0x133149=_0x31a182['filter'](_0x17f885=>'new'!=_0x17f885['type'])['map'](_0x16748f=>Yi('data-id',_0x16748f['id'],_0x1c9aba)),_0x36372b=_0x31a182['filter'](_0x32ca8a=>'removed'!=_0x32ca8a['type'])['map'](_0x4bc199=>_0x4bc199['node']['cloneNode'](!0x0));let _0x2722a1=null;if(_0x133149['length']){_0x2722a1=_0x133149[0x0]['previousSibling'];for(let _0x4e5c5e=0x0;_0x4e5c5e<_0x133149['length'];_0x4e5c5e++)_0x383ffd(_0x133149[_0x4e5c5e]);}if(_0x36372b['length']){_0x2722a1||(_0x31a182[0x0]['anchorId']?_0x2722a1=Yi('data-id',_0x31a182[0x0]['anchorId'],_0x1c9aba):(_0x2722a1=_0x36372b['shift'](),_0x5a0b86(_0x1c9aba,_0x2722a1)));for(let _0x4a84c9=0x0;_0x4a84c9<_0x36372b['length'];_0x4a84c9++)_0x48c134(_0x2722a1,_0x36372b[_0x4a84c9]),_0x2722a1=_0x36372b[_0x4a84c9];}}const _0x526304=Ki(_0x1c9aba),_0x5342ee=_0x2f5dc6['getDiff'](_0x18e33c,_0x526304,{'targetEditor':_0x59d026,..._0x54de5b})['getOperations']();if(_0x592d02){const _0x40c8dc=_0x59d026['model']['document']['history']['getOperations'](_0x36f58f),_0x4d0406={'document':_0x59d026['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x4779ab(_0x5342ee,_0x40c8dc,_0x4d0406)['operationsA'];}return _0x5342ee;}function Es(_0x1e381d,_0x2c0b29){if('marker'!=_0x2c0b29['type'])return;const _0x3b8c42=_0x1e381d['model']['markers']['get'](_0x2c0b29['name']);_0x3b8c42&&(_0x2c0b29['oldRange']=_0x3b8c42['getRange']());}function Ts(_0x596abb,_0x296786){if(_0x596abb['files']['length']>0x0&&_0x296786['filesEnabled']){const _0x1e3733=_0x596abb['files']['filter'](_0x380021=>_0x380021['name']);return _0x1e3733['length']>0x0?{'type':'file','files':_0x1e3733}:null;}if(_0x296786['urlsEnabled']){const _0x163394=function(_0x5d97d4){const _0x4abf1e=_0x5d97d4['trim']();if(/\s/['test'](_0x4abf1e))return null;try{const _0x3364c4=new URL(_0x4abf1e);return'http:'!==_0x3364c4['protocol']&&'https:'!==_0x3364c4['protocol']?null:_0x3364c4['toString']();}catch{return null;}}(_0x596abb['plainText']);if(_0x163394)return{'type':'url','url':_0x163394};}const _0x336e6c=_0x596abb['forceTextAttachment']?0x1:_0x296786['longTextThreshold']??0x1/0x0;if(_0x596abb['plainText']['length']>=Math['max'](_0x336e6c,0x1)&&_0x296786['filesEnabled']){const _0x21ee4c=_0x296786['pastedTextLabel']+'.txt';return{'type':'text','files':[new File([_0x596abb['plainText']],_0x21ee4c,{'type':'text/plain'})]};}return null;}class AIChatController extends _0x5df7d5{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_hasAIChatBalloon']=!0x1;['_activeBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];['_channelsToEditors']=new Map();static get['requires'](){return[AIConnector,_0x4d0fee];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['set']('isConversationReady',!0x1),this['_bodyCollection']=new Xt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new AIModels({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x4c5a30=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x454799,_0x49034b)=>{this['_handleUIUserMessage']({'message':_0x49034b});}),this['listenTo'](_0x4c5a30['view'],'change:activeTab',(_0x36d906,_0x23f1dc,_0x1cd4a0)=>{'chat'!==_0x1cd4a0&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext'](),this['activeConversation']?.['cancelLastInteractionStream']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x41064d,_0x8bfc5a)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x8bfc5a));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x141a77,_0x2326e8)=>{this['activeConversation']?.['addUrlToContext'](_0x2326e8);}),this['listenTo'](this['_aiChatUi'],'promptInputPaste',(_0x10c3b1,_0x2755a4)=>{const _0x46a9b4=this['activeConversation'];if(!_0x46a9b4)return;_0x2755a4['hasDirectory']&&(_0x2755a4['preventDefault'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED'),'id':'folder-error-'+at()}));const _0x511db1=Ts(_0x2755a4,{'pastedTextLabel':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_PASTED_TEXT_NAME'),'longTextThreshold':this['context']['config']['get']('ai.chat.context.paste.textThreshold'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled'),'urlsEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.urls.enabled')});_0x511db1&&(_0x2755a4['preventDefault'](),'url'===_0x511db1['type']?_0x46a9b4['addUrlToContext'](_0x511db1['url']):_0x46a9b4['chatContext']['addFilesToContext'](_0x511db1['files'],void 0x0,_0x511db1['type']));}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x5dde4d,_0xd0bc78)=>{_0xd0bc78['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x54c9b2,_0x1741c1)=>{this['activeConversation']?.['addResourceToContext'](_0x1741c1['source'],_0x1741c1['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2bd56d,_0x3bed83)=>{this['_removeFromContext'](_0x3bed83);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x2d40ab,_0x3227aa)=>{this['activeConversation']?.['loadSourceResources'](_0x3227aa['sourceId'],_0x3227aa['query'],_0x3227aa['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x501b5b,_0x590e0c)=>{this['activeConversation']?.['setModel'](_0x590e0c);}),this['listenTo'](this['_aiChatUi'],'like',(_0x44f5bd,{replyId:_0x213465})=>{console['log']('Liked\x20response',_0x213465);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x53d693,{replyId:_0x4a7d26})=>{console['log']('Disliked\x20response',_0x4a7d26);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x107c9f,_0x680e6b)=>{this['_insertSuggestion'](_0x680e6b);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0xaaef64,{replyId:_0xd587fd,partIndex:_0x57aed7})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0xd587fd,_0x57aed7);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x1bbe21,{replyId:_0x12298b,partIndex:_0x26460e})=>{const _0x26d357=this['_getDocumentRangeForReplyChanges'](_0x12298b,_0x26460e);if(!_0x26d357)return;const {reply:_0x289cf3}=this['getInteractionAndReplyById'](_0x12298b);'$graveyard'!=_0x26d357['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'editor':_0x289cf3['changeGroups'][_0x26460e]['editor'],'ranges':[_0x26d357['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x2d3c57,_0x3044cc)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x3044cc);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x47cd63,{replyId:_0x591775,showDiff:_0x54ae2f})=>{const {interaction:_0x2b8a6d,reply:_0x409ba4}=this['getInteractionAndReplyById'](_0x591775),_0x2baeae=_0x409ba4['getContentParts']({'showDiff':_0x54ae2f});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x2b8a6d['id']+':'+_0x409ba4['id'],'parts':_0x2baeae});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x1773e1,{replyId:_0x3bf982,partIndex:_0x2cc494})=>{this['_rejectSuggestion']({'replyId':_0x3bf982,'partIndex':_0x2cc494}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['on']('interactionCreated',(_0xa50cfc,_0x164aec)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x164aec);}),this['on']('replyCreated',(_0x14dd4d,_0x4d991b)=>{this['_addFeedItemReply'](_0x4d991b);});}['afterInit'](){this['context']instanceof _0x2b21e9?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x576dc7,_0x29f94a)=>{_0x29f94a['on']('ready',()=>{this['_integrateEditor'](_0x29f94a);});}),this['_initConversation']();}async['_initConversation'](){const _0x26c698=this['context']['config']['get']('ai.chat.initialConversation');let _0x5f2073=_0x26c698;('lastCreated'!=_0x26c698||(_0x5f2073=await this['_getLastCreatedConversationId'](),_0x5f2073))&&('new'==_0x5f2073?await this['_startConversationSafely']():await this['loadConversation'](_0x5f2073));}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x751ccd){this['_closeActiveBalloon'](),(this['context']['plugins']['get'](AITabs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),this['activeConversation']&&this['stopListening'](this['activeConversation']),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x751ccd)['getConversation'](),await this['_startConversationSafely']({'id':_0x751ccd}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x751ccd),this['_aiChatUi']['enableControls'](),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x1dc3b5){this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x751ccd}),this['_logError'](new ht('ai-chat-conversation-not-found',this,{'error':_0x1dc3b5}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x29346c){let _0x346df5=null,_0x13c502=null;this['on']('toolDataReceived',(_0x3d3623,_0x636c0c,_0x2cf171)=>{_0x2cf171['id']!==_0x346df5&&(_0x346df5=_0x2cf171['id'],_0x13c502=this['_getAIChatFeedAPI'](_0x2cf171)),_0x29346c(_0x636c0c,_0x13c502);});}['addCurrentDocumentToChatContext'](){Cs(this['context'])['length']&&this['activeConversation']?.['addCurrentDocumentToContext'](Mi(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](_0x4f6044){const _0x9b3653=this['_aiEditing']['getSelectionText'](_0x4f6044);this['activeConversation']?.['addSelectionToContext'](_0x9b3653),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x4d3ed1){await this['_startConversationSafely']({'modelId':_0x4d3ed1?.['modelId']});}async['sendMessage'](_0x1dcb07){await this['_handleUIUserMessage'](_0x1dcb07);}['getGroupId'](){const _0x228bb0=this['context']['config']['get']('collaboration.channelId');if(!_0x228bb0)throw new ht('ai-missing-channel-id',this);return _0x228bb0;}['_handleRemovedConversation'](_0xcc0034){this['activeConversation']['id']===_0xcc0034&&this['_startConversationSafely']();}['_insertSuggestion'](_0x41d670){const _0x1e8ff8=this['context']['plugins']['get'](_0x4d0fee),{reply:_0x10e745,interaction:_0x189a93}=this['getInteractionAndReplyById'](_0x41d670['replyId']),_0x27ffe0=void 0x0!==_0x41d670['partIndex']?[_0x10e745['changeGroups'][_0x41d670['partIndex']]]:_0x10e745['changeGroups']['filter'](_0x27b2e4=>'pending'==_0x27b2e4['state']);_0x27ffe0['map'](_0x444391=>_0x10e745['changeGroups']['indexOf'](_0x444391))['forEach'](_0x55ddd2=>{const _0x252c97=this['_getDocumentRangeForReplyChanges'](_0x41d670['replyId'],_0x55ddd2);_0x252c97&&'$graveyard'!=_0x252c97['range']['root']['rootName']?(_0x10e745['setChangeGroupState'](_0x55ddd2,'accepted'),void 0x0!==_0x41d670['partIndex']&&this['_scrollToSuggestionRange'](_0x252c97['range'],!0x1,_0x252c97['targetEditor'])):_0x10e745['setChangeGroupState'](_0x55ddd2,'outdated');});const _0xe8ad2d={},_0x40390d=_0x27ffe0['reduce']((_0x6e4e8a,_0x35b795)=>('outdated'===_0x35b795['state']||(_0x6e4e8a[_0x35b795['documentId']]=[..._0x6e4e8a[_0x35b795['documentId']]||[],_0x35b795],_0xe8ad2d[_0x35b795['documentId']]=[..._0xe8ad2d[_0x35b795['documentId']]||[],_0x10e745['changeGroups']['indexOf'](_0x35b795)]),_0x6e4e8a),{});for(const [_0x24046f,_0x4d7780]of Object['entries'](_0x40390d)){const _0xe250cb=_0x4d7780[0x0]['editor'];if(!_0xe250cb['plugins']['has']('TrackChanges')){wt('ai-no-track-changes',{'editor':_0xe250cb});continue;}const _0x445301=ps({'reply':_0x10e745,'interaction':_0x189a93,'groups':_0x4d7780,'transform':!0x0,'documentCompare':_0x1e8ff8,'documentCompareOptions':{'anchor':_0x4d7780[0x0]['rootName'],'markDeletions':!0x0}});let _0x2c682c;_0xe250cb['model']['change'](_0x4843ee=>{_0x2c682c=_0x4843ee['batch'],_0xe250cb['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x445301),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x2c682c,{'interactionId':_0x189a93['id'],'replyId':_0x10e745['id'],'indexes':_0xe8ad2d[_0x24046f]});}this['_updateRatings'](_0x10e745);}['_applySuggestion'](_0x348600){const _0x4451c5=this['context']['plugins']['get'](_0x4d0fee),{reply:_0x21b50b,interaction:_0x44a8ef}=this['getInteractionAndReplyById'](_0x348600['replyId']),_0x55c9ca=void 0x0!==_0x348600['partIndex']?[_0x21b50b['changeGroups'][_0x348600['partIndex']]]:_0x21b50b['changeGroups']['filter'](_0x5cfced=>'pending'==_0x5cfced['state']);_0x55c9ca['map'](_0x27d6ca=>_0x21b50b['changeGroups']['indexOf'](_0x27d6ca))['forEach'](_0x5aec53=>{const _0x3cc2e0=this['_getDocumentRangeForReplyChanges'](_0x348600['replyId'],_0x5aec53);_0x3cc2e0&&'$graveyard'!=_0x3cc2e0['range']['root']['rootName']?(_0x21b50b['setChangeGroupState'](_0x5aec53,'accepted'),void 0x0!==_0x348600['partIndex']&&this['_scrollToSuggestionRange'](_0x3cc2e0['range'],!0x1,_0x3cc2e0['targetEditor'])):_0x21b50b['setChangeGroupState'](_0x5aec53,'outdated');});const _0x2eb6ab={},_0x2f0c55=_0x55c9ca['reduce']((_0x2f0d42,_0x21b5f2)=>('outdated'===_0x21b5f2['state']||(_0x2f0d42[_0x21b5f2['documentId']]=[..._0x2f0d42[_0x21b5f2['documentId']]||[],_0x21b5f2],_0x2eb6ab[_0x21b5f2['documentId']]=[..._0x2eb6ab[_0x21b5f2['documentId']]||[],_0x21b50b['changeGroups']['indexOf'](_0x21b5f2)]),_0x2f0d42),{});for(const [_0x204910,_0x30aa6d]of Object['entries'](_0x2f0c55)){const _0x4f206e=ps({'reply':_0x21b50b,'interaction':_0x44a8ef,'groups':_0x30aa6d,'transform':!0x0,'documentCompare':_0x4451c5,'documentCompareOptions':{'anchor':_0x30aa6d[0x0]['rootName'],'markDeletions':!0x1}});let _0x53e380;const _0x4597e9=_0x30aa6d[0x0]['editor'];_0x4597e9['model']['change'](_0x355509=>{_0x53e380=_0x355509['batch'];for(const _0x488578 of _0x4f206e)_0x488578['baseVersion']=_0x4597e9['model']['document']['version'],Es(_0x4597e9,_0x488578),_0x355509['batch']['addOperation'](_0x488578),_0x4597e9['model']['applyOperation'](_0x488578);}),this['_batchToChanges']['set'](_0x53e380,{'interactionId':_0x44a8ef['id'],'replyId':_0x21b50b['id'],'indexes':_0x2eb6ab[_0x204910]});}this['_updateRatings'](_0x21b50b);}['_rejectSuggestion'](_0x4dd0d0){const {reply:_0x5666d9}=this['getInteractionAndReplyById'](_0x4dd0d0['replyId']);_0x5666d9['setChangeGroupState'](_0x4dd0d0['partIndex'],'rejected');}['_openBalloonFor'](_0x17f0e9,_0x480476){if(!this['_hasAIChatBalloon'])return;const {reply:_0x359da2}=this['getInteractionAndReplyById'](_0x17f0e9),_0x4b18b1=_0x359da2['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(!_0x4b18b1['length'])return;let _0xdd8aad,_0x45fccc;if(void 0x0!==_0x480476?(_0x45fccc=_0x4b18b1['find'](_0x58ad76=>_0x58ad76['index']==_0x480476),_0xdd8aad=_0x45fccc?.['index']):(_0x45fccc=_0x4b18b1[0x0],_0xdd8aad=_0x45fccc['index']),!_0x45fccc)return void _0x359da2['setChangeGroupState'](_0x480476??0x0,'outdated');if(this['_currentPreviewedChangeGroup']?.['replyId']==_0x17f0e9&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xdd8aad)return;const _0x411f8e=this['_getUserPresentableContentPartDocumentRange'](_0x17f0e9,_0x359da2,_0x45fccc),_0x542e0d=_0x359da2['changeGroups']['find'](_0x15a787=>_0x15a787['index']==_0xdd8aad)['editor'],_0x248265=_0x542e0d['plugins']['get']('AIChatBalloon');if(this['_activeBalloon']&&this['_activeBalloon']!==_0x248265&&this['_activeBalloon']['close'](),!_0x411f8e)return _0x248265['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x248265,this['_currentPreviewedChangeGroup']={'replyId':_0x17f0e9,'partIndex':_0xdd8aad},this['_scrollToSuggestionRange'](_0x411f8e,!0x0,_0x542e0d);const _0x5e600d=this['_getPresentableSiblingContentPartIndex'](_0x17f0e9,_0xdd8aad,'next');_0x248265['clearContent'](),_0x248265['updateContent']({'part':_0x45fccc,'renderingStrategy':'static'}),_0x248265['open']({'index':_0xdd8aad,'title':Mi(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0xdd8aad+0x1)['toString']()),'showRotator':null!==_0x5e600d,'ranges':[_0x411f8e],'areActionsDisabled':_0x359da2['areActionsDisabled'],'targetEditor':_0x542e0d}),_0x248265['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x17f0e9,_0xdd8aad),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x17f0e9,'index':_0xdd8aad,'isActive':!0x0});}['_closeActiveBalloon'](){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;}['_getPresentableSiblingContentPartIndex'](_0x51ab44,_0x1771e4,_0x2c4b95){const {reply:_0xf07540}=this['getInteractionAndReplyById'](_0x51ab44),_0x379100=_0xf07540['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x379100['length'])return null;const _0x27d8bb='next'==_0x2c4b95?0x1:-0x1;function _0x5ea9e1(_0x3ed7a5){const _0x143109=(_0x3ed7a5+_0x27d8bb+_0x379100['length'])%_0x379100['length'];return{'siblingIndex':_0x143109,'siblingPart':_0x379100[_0x143109]};}const _0x260d95=_0x379100['findIndex'](_0x5f3143=>_0x5f3143['index']==_0x1771e4);let {siblingIndex:_0x47aa9e,siblingPart:_0x36a28c}=_0x5ea9e1(_0x260d95);for(;!this['_getUserPresentableContentPartDocumentRange'](_0x51ab44,_0xf07540,_0x36a28c);)if({siblingIndex:_0x47aa9e,siblingPart:_0x36a28c}=_0x5ea9e1(_0x47aa9e),_0x47aa9e===_0x260d95)return null;return _0x36a28c['index'];}['_getUserPresentableContentPartDocumentRange'](_0x5cdb0b,_0x3c6932,_0x9afe86){const _0x58b690=_0x3c6932['changeGroups'];if(!_0x9afe86['hasChanges'])return null;const _0xaaa57c=_0x58b690['find'](_0x4e798b=>_0x4e798b['index']==_0x9afe86['index']);if('pending'!==_0xaaa57c?.['state'])return null;if('destroyed'===_0xaaa57c?.['editor']['state'])return _0x3c6932['setChangeGroupState'](_0x9afe86['index'],'outdated'),null;const _0x1f94cc=this['_getDocumentRangeForReplyChanges'](_0x5cdb0b,_0x9afe86['index']);if(!_0x1f94cc)return _0x3c6932['setChangeGroupState'](_0x9afe86['index'],'outdated'),null;const {range:_0x34661f,currentIndex:_0x1ea2ef}=_0x1f94cc;return'$graveyard'==_0x34661f['root']['rootName']?(_0x3c6932['setChangeGroupState'](_0x1ea2ef,'outdated'),null):_0x1f94cc['range'];}['_getDocumentRangeForReplyChanges'](_0x369fc4,_0x47e463){const {reply:_0x34a587,interaction:_0x2a8e1a}=this['getInteractionAndReplyById'](_0x369fc4),_0x477500=_0x34a587['changeGroups']['filter'](_0x29e5e7=>'pending'==_0x29e5e7['state']),_0x4924c2=_0x477500['map'](_0x20ea72=>_0x34a587['changeGroups']['indexOf'](_0x20ea72));void 0x0===_0x47e463&&(_0x47e463=_0x4924c2[0x0]);const _0x5b1b7e=_0x4924c2['indexOf'](_0x47e463);if(-0x1==_0x5b1b7e)return null;const _0x99770=_0x477500[_0x5b1b7e],_0x1fae7a=_0x99770['editor'];if('destroyed'===_0x1fae7a['state'])return null;const _0x3705ac=_0x34a587['documentContextContent']['get'](_0x99770['documentId']),_0x339422=new _0x9b5ced([]),_0x5d0947=new _0x9b5ced([]);for(const _0x1bd7a5 of _0x99770['changes'])if('removed'!=_0x1bd7a5['type']&&_0x5d0947['children']['push'](_0x1bd7a5['node']['cloneNode'](!0x0)),'new'!=_0x1bd7a5['type']){const _0x1f6687=_0x4d97a4(_0x1f7aa1=>Xi(_0x1f7aa1,'data-id')==_0x1bd7a5['id'],_0x3705ac,!0x0);_0x339422['children']['push'](_0x1f6687['cloneNode'](!0x0));}if(0x0==_0x339422['children']['length']){if(_0x99770['changes'][0x0]['anchorId']){const _0xf3707b=Yi('data-id',_0x99770['changes'][0x0]['anchorId'],_0x3705ac);_0x339422['children']['unshift'](_0xf3707b['cloneNode'](!0x0)),_0x5d0947['children']['unshift'](_0xf3707b['cloneNode'](!0x0)),_0xf3707b['nextSibling']&&(_0x339422['children']['push'](_0xf3707b['nextSibling']['cloneNode'](!0x0)),_0x5d0947['children']['push'](_0xf3707b['nextSibling']['cloneNode'](!0x0)));}else{const _0x32cf42=_0x3705ac['children'][0x0];if(!_0x32cf42)return null;_0x339422['children']['push'](_0x32cf42['cloneNode'](!0x0)),_0x5d0947['children']['push'](_0x32cf42['cloneNode'](!0x0));}}const _0x2d6bbe=_0x2a8e1a['getDocumentContext'](),_0x31ab00=_0x2d6bbe['content']||_0x2d6bbe['documents']['find'](_0x8b0876=>_0x8b0876['id']==_0x99770['documentId'])['content'],_0xb29795=_0x1fae7a['model']['document']['getRoot'](_0x99770['rootName']),_0x5efe3d=_0x1fae7a['data']['parse'](_0x31ab00,_0xb29795),_0x1017cd=Ki(_0x339422),_0x305bb8=_0x1fae7a['data']['parse'](_0x1017cd,_0xb29795),_0x157d2c=_0x1fae7a['data']['parse'](_0x1017cd,_0xb29795),_0x20f92a=_0x1fae7a['model']['createPositionAt'](_0x305bb8,0x0),_0x221c09=Ki(_0x5d0947),_0x259050={'targetEditor':_0x1fae7a,'anchor':_0x20f92a,'markDeletions':!0x1},_0x2e65c4=_0x1fae7a['plugins']['get'](_0x4d0fee)['getDiff'](_0x1017cd,_0x221c09,_0x259050)['getOperations']();if(!_0x2e65c4['length'])return null;_0x1fae7a['model']['change'](_0x261b1f=>{for(const _0x3b8d05 of _0x2e65c4)if('remove'==_0x3b8d05['type']){const _0x2b9029=_0x3b8d05['sourcePosition'],_0x4418b4=_0x3b8d05['howMany'],_0x2587a6=new _0x1f8438(_0x2b9029,_0x4418b4);_0x261b1f['batch']['addOperation'](_0x2587a6),_0x1fae7a['model']['applyOperation'](_0x2587a6);}else'marker'!==_0x3b8d05['type']&&(_0x3b8d05['baseVersion']=null,_0x3b8d05['isDocumentOperation']=!0x1,_0x261b1f['batch']['addOperation'](_0x3b8d05),_0x1fae7a['model']['applyOperation'](_0x3b8d05));});const _0x38981f=hs(_0x1fae7a,_0x2e65c4,_0x305bb8);ls(_0x1fae7a['model'],_0x38981f);const _0x3064fd=_0x38981f['getFirstRange']()['start']['path']['slice'](),_0x5a6656=_0x38981f['getFirstRange']()['end']['path']['slice'](),_0x2b2a9b=[];let _0x4b6380=_0x305bb8,_0x6092a0=_0x157d2c;for(let _0x1c432a=0x0;_0x1c432a<_0x5a6656['length'];_0x1c432a++){const _0x7de0c3=_0x4b6380['maxOffset']-_0x5a6656[_0x1c432a];_0x2b2a9b[_0x1c432a]=_0x6092a0['maxOffset']-_0x7de0c3,_0x4b6380=_0x4b6380['getChildAtOffset'](_0x5a6656[_0x1c432a]),_0x6092a0=_0x6092a0['getChildAtOffset'](_0x2b2a9b[_0x1c432a]);}const _0x18669f=_0x1fae7a['model']['createRange'](_0x1fae7a['model']['createPositionFromPath'](_0x157d2c,_0x3064fd),_0x1fae7a['model']['createPositionFromPath'](_0x157d2c,_0x2b2a9b)),_0x462728=_0x157d2c['getChild'](0x0)['getAttribute'](_0xbb716),_0xd942d=Array['from'](_0x5efe3d['getChildren']())['find'](_0x2342da=>_0x2342da['getAttribute'](_0xbb716)==_0x462728)['getPath'](),_0x4dea2c=_0x18669f['start']['path']['slice'](),_0x398e8f=_0x18669f['end']['path']['slice']();_0x4dea2c[0x0]=_0xd942d[0x0]+_0x4dea2c[0x0],_0x398e8f[0x0]=_0xd942d[0x0]+_0x398e8f[0x0];let _0x2555de=_0x1fae7a['model']['createRange'](_0x1fae7a['model']['createPositionFromPath'](_0x1fae7a['model']['document']['getRoot'](_0x99770['rootName']),_0x4dea2c),_0x1fae7a['model']['createPositionFromPath'](_0x1fae7a['model']['document']['getRoot'](_0x99770['rootName']),_0x398e8f));const _0x41610f=_0x2d6bbe['documents']['find'](_0x5c38e7=>_0x5c38e7['id']==_0x99770['documentId'])['version'],_0x5a8e79=_0x1fae7a['model']['document']['history']['getOperations'](_0x41610f);for(const _0x19380c of _0x5a8e79)_0x2555de=_0x14d15a['_createFromRanges'](_0x2555de['getTransformedByOperation'](_0x19380c));return{'range':_0x2555de,'currentIndex':_0x47e463,'targetEditor':_0x1fae7a};}['_integrateEditorBalloon'](_0x3202d7){if(!_0x3202d7['plugins']['has']('AIChatBalloon'))return;const _0x240fff=_0x3202d7['plugins']['get']('AIChatBalloon');this['_hasAIChatBalloon']=!0x0,_0x240fff['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x240fff,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x7a51bb,partIndex:_0x393502}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x535ff4}=this['getInteractionAndReplyById'](_0x7a51bb),_0x9c332e=_0x535ff4['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x393502});_0x240fff['updateContent']({'part':_0x9c332e[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x240fff,'applySuggestion',()=>{const {replyId:_0x25e555,partIndex:_0x299b86}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x25e555,'partIndex':_0x299b86}),_0x240fff['setState']('accepted');}),this['listenTo'](_0x240fff,'insertSuggestion',()=>{const {replyId:_0x3f8e28,partIndex:_0x43b626}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x3f8e28,'partIndex':_0x43b626}),_0x240fff['setState']('accepted');}),this['listenTo'](_0x240fff,'rejectSuggestion',()=>{const {replyId:_0x3f2373,partIndex:_0x10d4d0}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x3f2373,'partIndex':_0x10d4d0}),_0x240fff['setState']('rejected');}),this['listenTo'](_0x240fff,'showNext',()=>{const {replyId:_0x425389,partIndex:_0x3bf21c}=this['_currentPreviewedChangeGroup'],_0x5373f3=this['_getPresentableSiblingContentPartIndex'](_0x425389,_0x3bf21c,'next');null!==_0x5373f3&&this['_openBalloonFor'](_0x425389,_0x5373f3);}),this['listenTo'](_0x240fff,'showPrevious',()=>{const {replyId:_0x4baa91,partIndex:_0x1066ca}=this['_currentPreviewedChangeGroup'],_0x4f00c2=this['_getPresentableSiblingContentPartIndex'](_0x4baa91,_0x1066ca,'previous');null!==_0x4f00c2&&this['_openBalloonFor'](_0x4baa91,_0x4f00c2);}),this['listenTo'](_0x240fff,'dialogClosed',(_0x4212b8,{id:_0x591945})=>{if('aiChatBalloon'!==_0x591945)return;const {replyId:_0x16925a,partIndex:_0x5c12e5}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x16925a,'index':_0x5c12e5,'isActive':!0x1}),this['_activeBalloon']===_0x240fff&&(this['_activeBalloon']=void 0x0);});}['_integrateEditor'](_0x52b993){if(this['_channelsToEditors']['set'](_0x52b993['config']['get']('collaboration.channelId'),_0x52b993),this['_integrateEditorBalloon'](_0x52b993),this['addCurrentDocumentToChatContext'](),_0x52b993['once']('destroy',()=>{this['_checkRemoveCurrentDocumentFromChatContext']();}),_0x52b993['plugins']['has']('Undo')){const _0xdb4a84=_0x52b993['commands']['get']('undo'),_0xefc7e5=_0x52b993['commands']['get']('redo');this['listenTo'](_0xdb4a84,'revert',(_0x2bbae6,_0x33e2d0,_0x276873)=>{const _0x203112=this['_batchToChanges']['get'](_0x33e2d0);if(!_0x203112)return;const _0x1e2181=this['activeConversation']['getInteraction'](_0x203112['interactionId']),_0x3d11be=_0x1e2181?.['getReply'](_0x203112['replyId']);this['_batchToChanges']['delete'](_0x33e2d0),_0x1e2181&&_0x3d11be&&(_0x203112['indexes']['forEach'](_0x2f7f8e=>_0x3d11be['setChangeGroupState'](_0x2f7f8e,'pending')),this['_batchToChanges']['set'](_0x276873,_0x203112));}),this['listenTo'](_0xefc7e5,'revert',(_0x180e20,_0x248f39,_0xb12acc)=>{const _0x365944=this['_batchToChanges']['get'](_0x248f39);if(!_0x365944)return;const _0x1cdb83=this['activeConversation']['getInteraction'](_0x365944['interactionId']),_0x10d3b9=_0x1cdb83?.['getReply'](_0x365944['replyId']);this['_batchToChanges']['delete'](_0x248f39),_0x1cdb83&&_0x10d3b9&&(_0x365944['indexes']['forEach'](_0xdec8d7=>_0x10d3b9['setChangeGroupState'](_0xdec8d7,'accepted')),this['_batchToChanges']['set'](_0xb12acc,_0x365944));});}const _0x27620b=_0x52b993['config']['get']('ai.chat.context');_0x27620b['alwaysAddSelection']&&_0x27620b['document']['enabled']&&this['listenTo'](_0x52b993['model']['document']['selection'],'change:range',(_0x4f87a6,_0x569f08)=>{if(!_0x569f08['directChange'])return;'chat'===_0x52b993['plugins']['get']('AITabs')['view']['activeTab']&&(_0x52b993['model']['hasContent'](_0x52b993['model']['document']['selection'])?this['addSelectionToChatContext'](_0x52b993):this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x173ef8=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x3e5b5d=await _0x173ef8['getConversations']();return _0x3e5b5d['length']?_0x3e5b5d[0x0]['id']:'new';}catch(_0x5665d1){return this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':at()}),this['_logError'](new ht('ai-chat-conversation-init-failed',this,{'error':_0x5665d1})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x275df5={}){this['set']('isConversationReady',!0x1);try{await this['_handleStartConversation'](_0x275df5);}catch(_0x2130e9){this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x275df5['id']||at()}),console['error'](_0x2130e9),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x5996e5,modelId:_0x19bb05}={}){this['_closeActiveBalloon']();let _0x386440=_0x19bb05;_0x386440||(_0x5996e5||!this['activeConversation']?_0x386440=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x386440=this['activeConversation']['selectedModel']['id'])),this['activeConversation']&&this['stopListening'](this['activeConversation']),await this['_stopLastInteraction']();const _0x259942=this['getGroupId'](),_0x2b41bb=_0x5996e5||at();let _0x328cf6;this['activeConversation']=new AIChatConversation({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x386440,'conversationId':_0x2b41bb,'group':_0x259942,'locale':this['context']['locale'],'isFromHistory':!!_0x5996e5,'channelsToEditors':this['_channelsToEditors'],'getSessionId':_0x3b1ae6=>this['_aiEditing']['getSessionId'](_0x3b1ae6)}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['listenTo'](this['activeConversation'],'conversationInitialized',(_0x18c35c,_0xea8891)=>{this['_aiChatUi']['createConversation'](_0xea8891),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x5996e5||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['listenTo'](this['activeConversation'],'uploadProgressChanged',(_0xd6113f,_0x70b997)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x70b997['isUploadInProgress']);}),this['listenTo'](this['activeConversation'],'webSearchStarted',()=>{const _0x596595=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x596595);}),this['listenTo'](this['activeConversation'],'reasoningStarted',()=>{const _0x1594d4=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x1594d4);}),this['listenTo'](this['activeConversation'],'webSearchFinished',(_0x23891b,_0x44baa0)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x44baa0,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['listenTo'](this['activeConversation'],'reasoningFinished',(_0x2c8037,_0x2f24aa)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2f24aa,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['listenTo'](this['activeConversation'],'interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['listenTo'](this['activeConversation'],'interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['listenTo'](this['activeConversation'],'interactionDestroyed',(_0x6ab5f,_0x10e58c)=>{this['_aiChatUi']['removeFeedInteraction'](_0x10e58c['id']);}),this['listenTo'](this['activeConversation'],'setConversationTitle',(_0x3ea006,_0x5df09e,_0x31fdf0)=>{this['_updateConversationTitle'](_0x5df09e,_0x31fdf0);}),this['listenTo'](this['activeConversation'],'replyContentUpdated',async(_0x4dd18c,_0x33de26)=>{void 0x0!==_0x328cf6&&_0x328cf6!==_0x33de26['id']&&this['_updateReplyContentThrottled']['flush'](),_0x328cf6=_0x33de26['id'],_0x33de26['isFromHistory']?await this['_updateReplyContent']({'reply':_0x33de26}):await this['_updateReplyContentThrottled']({'reply':_0x33de26});}),this['listenTo'](this['activeConversation'],'replyChangeGroupStateUpdated',(_0x35e35d,{reply:_0x5b68bb,index:_0x14292c,state:_0x1ac82e})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x5b68bb['id'],'index':_0x14292c,'state':_0x1ac82e}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x5b68bb['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x14292c&&this['_activeBalloon']?.['setState'](_0x1ac82e);}),this['listenTo'](this['activeConversation'],'contextItemAdded',(_0x1a4f3d,_0x3e7bb1)=>{if(this['_aiChatUi']['addContextItem'](_0x3e7bb1['contextItem'],_0x3e7bb1['isLoading']),'selection'===_0x3e7bb1['contextItem']['type']){const _0x5da1fd=ms(this['context']),_0x33115f=[..._0x5da1fd['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'editor':_0x5da1fd,'ranges':_0x33115f,'id':'context','priority':0x1});}}),this['listenTo'](this['activeConversation'],'contextItemRemoved',(_0x4f8f66,_0x45e814)=>{this['_aiChatUi']['removeContextItem'](_0x45e814['uiId']),'current-document'==_0x45e814['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x45e814['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['listenTo'](this['activeConversation'],'contextItemLoadingEnded',(_0x57c3a1,_0x5beb11)=>{this['_aiChatUi']['setContextItemLoading'](_0x5beb11['contextItem']['uiId'],_0x5beb11['isLoading']);}),this['listenTo'](this['activeConversation'],'contextSent',(_0x5e1796,_0x1b295c)=>{this['_aiChatUi']['setConversationContext'](_0x1b295c['contextItems']);}),this['listenTo'](this['activeConversation'],'addContextOptionsChanged',(_0x4058b5,_0xe939dc)=>{this['_aiChatUi']['setAddContextOptions'](_0xe939dc['options']);}),this['listenTo'](this['activeConversation'],'sourceResourcesLoaded',(_0x1255ed,_0x18957d)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x18957d['sourceId'],_0x18957d['source'],_0x18957d['resources'],_0x18957d['uid']);}),this['listenTo'](this['activeConversation'],'resourceStateChanged',(_0x1e0a61,_0x1d422b)=>{this['_aiChatUi']['updateResourceState'](_0x1d422b['sourceId'],_0x1d422b['resourceId'],_0x1d422b['isInContext']);}),this['listenTo'](this['activeConversation'],'capabilitiesUpdated',(_0x530148,_0x393313)=>{this['_aiChatUi']['updateCapabilities'](_0x393313);}),this['listenTo'](this['activeConversation'],'modelSelected',async(_0x4046db,_0x21617f)=>{const _0x417b3b=(await this['_aiChatModels']['getAll']())['find'](_0x5d0471=>_0x5d0471['id']===_0x21617f['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x417b3b,_0x21617f['isDisabled']);}),this['listenTo'](this['activeConversation'],'error',(_0x3d9387,{error:_0x9efd5f,interactionId:_0x14e762,fileName:_0x3cbab0,url:_0x4c9c22,sourceId:_0x49a43c,sourceLabel:_0x541aa9})=>{const _0x45121e=_0x14e762?_0x14e762+':'+at():at();_0x9efd5f['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Mi(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x45121e}):_0x9efd5f['message']['startsWith']('ai-chat-conversation-init-failed')||_0x9efd5f['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x45121e}),this['_logError'](_0x9efd5f)):_0x9efd5f['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x3cbab0),'id':_0x45121e}):_0x9efd5f['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x4c9c22),'id':_0x45121e}):_0x9efd5f['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x45121e}):_0x9efd5f['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x45121e}):_0x9efd5f['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x49a43c&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x49a43c),this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x541aa9||'source'),'id':_0x45121e}),this['_logError'](_0x9efd5f)):_0x9efd5f['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x45121e}),this['_logError'](_0x9efd5f)):_0x9efd5f['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x45121e}),this['_logError'](_0x9efd5f)):_0x9efd5f['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x45121e}),this['_logError'](_0x9efd5f)):_0x9efd5f['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x45121e}),this['_logError'](_0x9efd5f)):_0x9efd5f['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x45121e}),this['_logError'](_0x9efd5f)):_0x9efd5f['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x45121e}),this['_logError'](_0x9efd5f)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x45121e}),this['_logError'](_0x9efd5f));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x5996e5||(await this['activeConversation']['start'](),this['_aiChatUi']['enableControls']()),this['set']('isConversationReady',!0x0);}async['_handleUIUserMessage']({message:_0x55b2e7,attributes:_0x1643de}){if(!this['activeConversation'])throw new ht('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x5ce700=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentsInContext'](_0x5ce700);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x55b2e7,'attributes':_0x1643de});}['_logError'](_0x22a727){Ct(_0x22a727['message'],_0x22a727['data']);}['_removeFromContext'](_0x59d692){this['activeConversation']?.['removeFromContext'](_0x59d692);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0xbabbc9){const [_0x3760fd,_0x2f69b6]=_0xbabbc9['split'](':'),_0x122143=this['activeConversation']['getInteraction'](_0x3760fd),_0x1afae7=_0x122143['getReply'](_0x2f69b6);return{'interaction':_0x122143,'reply':_0x1afae7};}['_scrollToSuggestionRange'](_0x163029,_0x370a9f=!0x1,_0x3bcf96){const _0x2b6546={'target':_0x3bcf96['editing']['view']['domConverter']['viewRangeToDom'](_0x3bcf96['editing']['mapper']['toViewRange'](_0x163029)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x370a9f};_0x370a9f&&(_0x2b6546['alignToTop']=!0x0),Tt(_0x2b6546);}['_updateConversationTitle'](_0x1aeebc,_0x1a8d9c=!0x1){this['_aiChatUi']['setConversationTitle'](_0x1aeebc||Mi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x1a8d9c);}['_addFeedItemReply'](_0x55ab91){'text'===_0x55ab91['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x55ab91):this['_aiChatUi']['addFeedItemAISuggestion'](_0x55ab91);}async['_updateReplyContent']({reply:_0x141933,renderingStrategy:_0x19cae8}){const {id:_0x59eed6,interactionId:_0x21b3ef,isDone:_0x4f8b08,type:_0x4bc946,parsedContent:_0x2d8a16}=_0x141933,_0x154fed=_0x21b3ef+':'+_0x59eed6;if('modification'===_0x4bc946){const _0x494d47=_0x141933['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x154fed,'parts':_0x494d47,'isDone':_0x4f8b08,'skipLoadingEffects':_0x141933['isFromHistory']});}else'text'===_0x4bc946&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x154fed,'parsedContent':_0x2d8a16['get']('text'),'renderingStrategy':_0x19cae8,'isDone':_0x4f8b08});_0x4f8b08&&_0x141933['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x154fed,_0x141933['sources']);}['_updateReplyContentThrottled']=_0x1da276(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x49ff7f=this['activeConversation']?.['lastInteraction'];_0x49ff7f&&(_0x49ff7f['stop'](),this['_aiChatUi']['stopInteraction'](_0x49ff7f)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x435371=this['activeConversation']?.['lastInteraction'];if(_0x435371){for await(const _0x4d7411 of _0x435371['replies'])this['_aiChatUi']['hasFeedItem'](_0x4d7411['id'])||this['_addFeedItemReply'](_0x4d7411),await this['_updateReplyContent']({'reply':_0x4d7411,'renderingStrategy':'static'});}}['_updateRatings'](_0x1588a4){const _0x4692e9={'positiveCount':_0x1588a4['changeGroups']['filter'](_0x1ef257=>'accepted'===_0x1ef257['state'])['length'],'totalCount':_0x1588a4['changeGroups']['length'],'modificationId':_0x1588a4['id']},_0x35af12=this['activeConversation']['getInteraction'](_0x1588a4['interactionId'])['messageId'];_0x35af12&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x35af12,_0x4692e9);}['_getAIChatFeedAPI'](_0x45f1d6){const _0x637ce1=this['_aiChatUi'],_0x4755e2=()=>{_0x45f1d6['resetWebSearchState'](),_0x45f1d6['resetReasoningState'](),_0x637ce1['clearLoadingMessage']();},_0x4bf638=()=>{_0x45f1d6['currentReply']&&(_0x45f1d6['currentReply']['done'](),_0x45f1d6['currentReply']=void 0x0);};return{'insertTextReply':(_0x4866c9,_0x336bfd)=>{_0x4bf638(),_0x4755e2();const _0x3dcd27=_0x45f1d6['currentReply']=_0x45f1d6['createReply']({'type':'text','interactionId':_0x45f1d6['id'],'id':_0x336bfd||at(),'channelsToEditors':this['_channelsToEditors']});return _0x3dcd27['appendContent'](_0x4866c9),_0x4bf638(),_0x3dcd27;},'insertCustomElement':async(_0xfcb961,_0x23c04b)=>(_0x4bf638(),_0x4755e2(),_0x637ce1['addFeedItemCustomElement'](_0xfcb961,_0x23c04b||at())),'setLoadingMessage':_0x23d71b=>{_0x637ce1['setLoadingMessage'](_0x23d71b);},'clearLoadingMessage':()=>{_0x637ce1['clearLoadingMessage']();}};}['_checkRemoveCurrentDocumentFromChatContext'](){Cs(this['context'])['find'](_0xdaea7f=>'destroyed'!==_0xdaea7f['state'])||(this['activeConversation']?.['removeFromContext']('current-document'),this['activeConversation']?.['toggleAddCurrentDocumentOptionVisibility'](!0x1));}}const fs='ai-selection',Rs=['br'];class AIEditing extends _0x5df7d5{constructor(_0x1f2de3){super(_0x1f2de3),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionIdByEditor']=new WeakMap();['_lastContentFocusedEditor'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['getLastContentFocusedEditor'](){return this['_lastContentFocusedEditor'];}['getSessionId'](_0x56e764){let _0x250a7c=this['_sessionIdByEditor']['get'](_0x56e764);return!_0x250a7c&&(_0x250a7c=_0x56e764['plugins']['has']('RealTimeCollaborationClient')&&_0x56e764['plugins']['get']('RealTimeCollaborationClient')['sessionId']||at(),this['_sessionIdByEditor']['set'](_0x56e764,_0x250a7c)),_0x250a7c;}async['getDocumentData'](){const _0x388a27=Cs(this['context']);if(!_0x388a27['length'])throw new ht('ai-get-editor-from-context-no-editor');const _0x2a0dff=[],_0x498bd7=new Set();for(const _0x1ad43f of _0x388a27){const _0x264b77=_0x1ad43f['config']['get']('roots')||{};for(const _0x1bfc9d of _0x1ad43f['model']['document']['getRoots']()){if('$graveyard'===_0x1bfc9d['rootName'])continue;const _0x13bfd0=await this['_getDocumentDataForEditorRoot'](_0x1ad43f,_0x1bfc9d,_0x498bd7),_0x3be119=_0x264b77[_0x1bfc9d['rootName']];let _0x53ce9f;_0x3be119?.['label']?_0x53ce9f=_0x3be119['label']:(wt('ai-document-root-missing-label',{'editor':_0x1ad43f,'rootConfig':_0x3be119}),_0x53ce9f=_0x1bfc9d['rootName']),_0x2a0dff['push']({'editor':_0x1ad43f,'rootName':_0x1bfc9d['rootName'],'content':_0x13bfd0['content'],'version':_0x13bfd0['version'],'sessionId':this['getSessionId'](_0x1ad43f),'channelId':_0x1ad43f['config']['get']('collaboration.channelId'),'selections':_0x13bfd0['selections'],'name':_0x53ce9f,'description':_0x3be119?.['description']});}}return _0x2a0dff;}async['_getDocumentDataForEditorRoot'](_0x161cf9,_0x4a2b92,_0x4f18d6){const _0x188439=_0x161cf9['data']['toView'](_0x4a2b92,{'convertAiChatSelectionMarker':!0x0}),_0x2bb104=new _0x265725(_0x161cf9['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x188439,_0x2bb104,_0x4f18d6);let _0x132394=await this['_getDocumentDataStringFromView'](_0x188439,_0x161cf9);const _0x3838ab=this['_getMarkersInDocumentOrder'](_0x161cf9,_0x4a2b92),_0x4fcd74=[];for(const _0x511cb5 of _0x3838ab){const _0x271ad7='<'+_0x511cb5['name']+':start></'+_0x511cb5['name']+':start>',_0x1c2f22=_0x132394['indexOf'](_0x271ad7);_0x132394=_0x132394['substring'](0x0,_0x1c2f22)+_0x132394['substring'](_0x1c2f22+_0x271ad7['length']);const _0x262682='<'+_0x511cb5['name']+':end></'+_0x511cb5['name']+':end>',_0x2794f3=_0x132394['indexOf'](_0x262682);_0x132394=_0x132394['substring'](0x0,_0x2794f3)+_0x132394['substring'](_0x2794f3+_0x262682['length']),_0x4fcd74['push']({'markerName':_0x511cb5['name'],'start':_0x1c2f22,'end':_0x2794f3,'htmlFragment':_0x132394['substring'](_0x1c2f22,_0x2794f3)});}return{'content':_0x132394,'version':_0x161cf9['model']['document']['version'],'selections':_0x4fcd74};}['afterInit'](){this['context']instanceof _0x2b21e9?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x34ddbf,_0x2c47ef)=>{_0x2c47ef['on']('ready',()=>{this['_integrateEditor'](_0x2c47ef);});});}['_setOutputDataProcessor'](_0x46e925){this['_outputDataProcessor']=_0x46e925;}async['_getDocumentDataStringFromView'](_0x2b39db,_0x575ad9){let _0x38517b;if(this['_outputDataProcessor']){const _0x10eb8b=_0x575ad9['data']['processor']['domConverter']['viewToDom'](_0x2b39db),_0x180f9f=await this['_outputDataProcessor'](_0x10eb8b);_0x38517b=_0x575ad9['data']['processor']['htmlWriter']['getHtml'](_0x180f9f);}else _0x38517b=_0x575ad9['data']['processor']['toData'](_0x2b39db);return _0x38517b;}['_integrateEditor'](_0x4e5b18){if(!_0x4e5b18['config']['get']('collaboration.channelId'))throw new ht('ai-missing-channel-id',_0x4e5b18);_0x4e5b18['ui']['focusTracker']['on']('change:isFocused',(_0xcfd3d9,_0x539ffa,_0x1c2ac3)=>{_0x1c2ac3&&(this['_lastContentFocusedEditor']=_0x4e5b18);}),_0x4e5b18['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x4e5b18&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x4e5b18['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fs,'view':({markerName:_0x3e09f3})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x3e09f3['split'](':')[0x1]],'priority':0xc})}),_0x4e5b18['conversion']['for']('dataDowncast')['markerToElement']({'model':fs+':context','view':(_0x4e243c,{writer:_0x319526,options:_0x14e285})=>_0x14e285['convertAiChatSelectionMarker']?_0x319526['createUIElement'](_0x4e243c['markerName']+':'+(_0x4e243c['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x195e41){const _0x506840=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x195e41);const _0x4c81ab=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x506840,_0x4c81ab);}['hideFakeVisualSelection'](_0x578740){const _0x17edfc=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x578740);const _0x53fc1c=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x17edfc,_0x53fc1c);}async['modelToDataWithIds'](_0x3a9dac,_0xbd46bd){const _0xa863c1=_0xbd46bd['data']['toView'](_0x3a9dac),_0x551ff6=new _0x265725(_0xbd46bd['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0xa863c1,_0x551ff6),this['_getDocumentDataStringFromView'](_0xa863c1,_0xbd46bd);}['_setDataIdsOnChildren'](_0x928a7b,_0x30ba8b,_0x1fff41=new Set()){let _0xcbac8c=!0x1;for(const _0x2f26da of _0x928a7b['getChildren']()){if(!_0x2f26da['is']('view:element')||Rs['includes'](_0x2f26da['name']))continue;const _0x19dbce=_0x2f26da['is']('view:containerElement'),_0x57f087=_0x2f26da['is']('view:emptyElement'),_0x582894=_0x2f26da['is']('view:rawElement'),_0x3c14fe=this['_setDataIdsOnChildren'](_0x2f26da,_0x30ba8b,_0x1fff41);if(_0x2f26da['hasAttribute']('data-id')){_0xcbac8c=!0x0,_0x1fff41['add'](_0x2f26da['getAttribute']('data-id'));continue;}(_0x19dbce||_0x57f087||_0x582894||_0x3c14fe)&&(_0x30ba8b['setAttribute']('data-id',this['_nextDataId'](_0x1fff41),_0x2f26da),_0xcbac8c=!0x0);}return _0xcbac8c;}['_nextDataId'](_0x3a1d77){let _0x24252a;do{_0x24252a='';for(let _0xb2e717=0x0;_0xb2e717<0x4;_0xb2e717++)_0x24252a+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x3a1d77['has'](_0x24252a));return _0x3a1d77['add'](_0x24252a),_0x24252a;}['getSelectionText'](_0xa06e2e){const _0x497e51=(_0xa06e2e?_0xa06e2e['model']:ms(this['context'])['model'])['document']['selection'],_0x255aa7=[],_0x2977cb=Array['from'](_0x497e51['getRanges']());_0x2977cb['sort']((_0x302101,_0x3a4e03)=>_0x302101['start']['isBefore'](_0x3a4e03['start'])?-0x1:0x1);for(const _0x271092 of _0x2977cb)for(const _0x390957 of _0x271092['getItems']())_0x390957['is']('$textProxy')?_0x255aa7['push'](_0x390957['data']):_0x390957['is']('element')&&_0x255aa7['length']>0x0&&'\x20'!==_0x255aa7[_0x255aa7['length']-0x1]&&_0x255aa7['push']('\x20');return _0x255aa7['length']?'\x22'+_0x255aa7['join']('')['trim']()+'\x22':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x347358){for(let _0x1394c5=0x0;_0x1394c5<this['_fakeSelections']['length'];_0x1394c5++)if(this['_fakeSelections'][_0x1394c5]['id']==_0x347358)return void this['_fakeSelections']['splice'](_0x1394c5,0x1);}['_addFakeSelection'](_0x4e9ea2){this['_removeFakeSelectionById'](_0x4e9ea2['id']),ft(this['_fakeSelections'],_0x4e9ea2);}['_refreshFakeSelection'](_0xfdbe40,_0x361f64){if(_0xfdbe40==_0x361f64)return;const _0x3147ef=_0xfdbe40?_0xfdbe40['editor']:null,_0x14e3b8=_0x361f64?_0x361f64['editor']:null,_0x17777a=(_0x577858,_0x4f5cd7)=>{const _0x1fbca0=_0x4f5cd7['model']['markers']['getMarkersGroup'](fs);for(const _0x7c6ed8 of _0x1fbca0)_0x577858['removeMarker'](_0x7c6ed8);},_0x4ddcb3=(_0x4bcb74,_0x4e3eeb,_0x1d5748)=>{const _0xc49237=_0x4e3eeb['model'];for(let _0x566ce9=0x0;_0x566ce9<_0x1d5748['ranges']['length'];_0x566ce9++){let _0x3f3110=_0x1d5748['ranges'][_0x566ce9];const _0x429642=fs+':'+_0x1d5748['id']+':'+_0x566ce9;if(_0x3f3110['start']['isAtEnd']){const _0x1525b1=_0x3f3110['start']['getLastMatchingPosition'](({item:_0x8a4ad1})=>!_0xc49237['schema']['isContent'](_0x8a4ad1),{'boundaries':_0x3f3110});_0x3f3110=_0x4bcb74['createRange'](_0x1525b1,_0x3f3110['end']);}_0x4bcb74['addMarker'](_0x429642,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3f3110});}};_0x3147ef&&_0x14e3b8&&_0x3147ef===_0x14e3b8&&_0x361f64?_0x3147ef['model']['change'](_0x23cb24=>{_0x17777a(_0x23cb24,_0x3147ef),_0x4ddcb3(_0x23cb24,_0x14e3b8,_0x361f64);}):(_0x3147ef&&_0x3147ef['model']['change'](_0x5e5ccf=>_0x17777a(_0x5e5ccf,_0x3147ef)),_0x14e3b8&&_0x361f64&&_0x14e3b8['model']['change'](_0x3e06dc=>_0x4ddcb3(_0x3e06dc,_0x14e3b8,_0x361f64)));}['_getMarkersInDocumentOrder'](_0x4ac8bf,_0x50c71d){const _0x3e0f5d=Array['from'](_0x4ac8bf['model']['markers']['getMarkersGroup'](fs+':context'));return(_0x50c71d?_0x3e0f5d['filter'](_0x437d0a=>{const _0x2d465b=_0x437d0a['getRange']();return _0x2d465b&&_0x2d465b['root']['rootName']===_0x50c71d['rootName'];}):_0x3e0f5d)['sort']((_0x48cfb1,_0x4ed916)=>_0x48cfb1['getStart']()['isBefore'](_0x4ed916['getStart']())?-0x1:_0x48cfb1['getStart']()['isAfter'](_0x4ed916['getStart']())?0x1:0x0);}}const bs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Ss=[...bs,'startConversation','sendUserMessage','promptInputPaste','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function Os(_0x3e9366){const _0x5cfefa=new AbortController();return{'promise':new Promise((_0x14149d,_0x5535c8)=>{const _0x345632=setTimeout(_0x14149d,_0x3e9366);_0x5cfefa['signal']['addEventListener']('abort',()=>{clearTimeout(_0x345632),_0x5535c8();});}),'abortController':_0x5cfefa};}class HTMLStreamer{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x517eec){this['options']={'delay':_0x517eec?.['delay']??0xa,'textNodeStyle':_0x517eec?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x3d08fd,targetElement:_0x5a21b9,abortSignal:_0x4dcb70}){this['isStreaming']&&this['stop'](),_0x4dcb70?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x1ba81c(_0x3d08fd,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x28d5c6=0x0;_0x28d5c6<this['currentIndex'];_0x28d5c6++)this['nodesList'][_0x28d5c6]['shouldBeStreamed']=!0x0;do{const _0x15ad72=Date['now'](),_0x57ea6f=this['nodesList'][this['currentIndex']],_0x1b7f55=_0x15ad72-this['lastUpdateTime'];if(_0x57ea6f){_0x57ea6f['shouldBeStreamed']=!0x0;let _0x47da09=_0x57ea6f['parent'];for(;_0x47da09;)_0x47da09['shouldBeStreamed']=!0x0,_0x47da09=_0x47da09['parent'];}if(_0x1b7f55<this['options']['delay'])try{const {promise:_0x376a86,abortController:_0x2beafd}=Os(this['options']['delay']-_0x1b7f55);this['timeoutAbortController']=_0x2beafd,await _0x376a86;}catch(_0xd1091a){return;}_0x17aec7(_0x5a21b9,'<'+_0x5a21b9['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x5a21b9['tagName']+'>',{'childrenOnly':!0x0}),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x240269}){Array['from'](_0x240269['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x22789b=>{_0x22789b['replaceWith'](_0x22789b['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x550afb){let _0x2f88ee='';if(function(_0x42094a){return _0x1e81fa(_0x42094a);}(_0x550afb)){for(const _0x34da93 of _0x550afb['children'])_0x2f88ee+=this['renderNode'](_0x34da93);}else{if(ys(_0x550afb)){if(!_0x550afb['shouldBeStreamed'])return'';const _0x104da5=_0x550afb,_0x1dc018=Object['entries'](_0x104da5['attribs'])['map'](([_0x33f8b1,_0x38a86d])=>_0x33f8b1+'=\x22'+_0x38a86d+'\x22')['join']('\x20');_0x2f88ee+='<'+_0x104da5['tagName']+(_0x1dc018?'\x20'+_0x1dc018:'')+'>';for(const _0x3b754e of _0x5127d8(_0x104da5))_0x2f88ee+=this['renderNode'](_0x3b754e);_0x2f88ee+='</'+_0x104da5['tagName']+'>';}else{if(!ks(_0x550afb))return'';if(!_0x550afb['shouldBeStreamed'])return'';!function(_0x33543c){if(!_0x33543c['parent']||!ys(_0x33543c['parent']))return!0x1;if(!vs['includes'](_0x33543c['parent']['tagName']))return!0x1;return!ti(_0x33543c)['match'](/^\s*[<>]\s*$/);}(_0x550afb)?_0x2f88ee+=_0x1084a7(_0x550afb):_0x2f88ee+=_0x1084a7(new _0xace074('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x550afb]));}}return _0x2f88ee;}['getParsedDocumentNodeList'](){const _0x754a83=[];return function(_0x535a53,_0x3f7bca){const _0x490384=_0x559efa=>{if(_0x3f7bca(_0x559efa),_0x559efa instanceof _0xee50a1)for(let _0x452d77=0x0;_0x452d77<_0x559efa['children']['length'];_0x452d77++){const _0x1b2635=_0x559efa['children'][_0x452d77];_0x490384(_0x1b2635);}};for(let _0x5479fb=0x0;_0x5479fb<_0x535a53['children']['length'];_0x5479fb++)_0x490384(_0x535a53['children'][_0x5479fb]);}(this['document'],_0x3e7fdc=>{if(ks(_0x3e7fdc)){const _0x248928=this['splitTextNodeIntoWordNodes'](_0x3e7fdc);_0x248928['length']&&_0x754a83['push'](..._0x248928);}_0x3e7fdc['isWordSplitSource']||_0x3e7fdc['isWordSplitResult']||_0x754a83['push'](_0x3e7fdc);}),_0x754a83;}['splitTextNodeIntoWordNodes'](_0x2d49a6){if(_0x2d49a6['isWordSplitSource']||_0x2d49a6['isWordSplitResult'])return[];const _0xb53011=ti(_0x2d49a6)['match'](/(?:\s*\S+\s*)/g),_0x10d05c=[];if(_0xb53011&&_0xb53011['length']>0x1){for(const _0x1be727 of _0xb53011){const _0x422533=new _0x41c341(_0x1be727);_0x422533['isWordSplitResult']=!0x0,_0x5358b1(_0x2d49a6,_0x422533),_0x10d05c['push'](_0x422533);}_0x2d49a6['isWordSplitSource']=!0x0,_0x383ffd(_0x2d49a6);}return _0x10d05c;}}const vs=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ks(_0x1fb9f5){return _0x43676a(_0x1fb9f5);}function ys(_0x590086){return _0x137115(_0x590086);}class AIChatFeedItemView extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x39857e){super();const _0x53748f=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new HTMLStreamer(),this['options']=_0x39857e,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x53748f['if']('isDone','ck-ai-chat__feed__item_done'),_0x53748f['if']('isVisible','ck-hidden',_0x4774cc=>!_0x4774cc),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){this['htmlStreamer']['cleanUpAnimations']({'targetElement':this['element']}),this['element']['querySelectorAll']('[data-id]')['forEach'](_0x584ac3=>{_0x584ac3['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2e197e,_0x4611aa,_0x23076f){await this['htmlStreamer']['stream']({'document':_0x2e197e,'targetElement':_0x4611aa,'abortSignal':_0x23076f});}}class AISuggestionHeaderView extends Nt{['showChangesToggleView'];constructor(_0x2724f5,_0x158402){super(_0x2724f5),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ShowChangesToggleView(_0x2724f5),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+Gi,'label':Mi(_0x2724f5,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x158402['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0xbf44b0=>_0xbf44b0?_0x48f0d9:_0x1fd0e8),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x1bc266=new Lt();_0x1bc266['content']=_0x1c3a81,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x158402['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x1bc266,{'tag':'span','children':[Mi(_0x2724f5,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ShowChangesToggleView extends yt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Ns={'accepted':_0x52abd9,'rejected':_0x255b66,'outdated':_0x255b66};class AISuggestionContentPartStateView extends Nt{['stateIconView'];constructor(_0x3fff60){super(_0x3fff60);const _0x333ca5=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new StateIconView(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x333ca5['to']('state',_0x48606d=>'ck-ai-suggestion__content-part-state_'+_0x48606d),_0x333ca5['if']('isVisible','ck-hidden',_0x145486=>!_0x145486)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x333ca5['to']('state',_0x90e36b=>{switch(_0x90e36b){case'accepted':return Mi(_0x3fff60,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return Mi(_0x3fff60,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return Mi(_0x3fff60,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x12e63f){this['state']=_0x12e63f;}}class StateIconView extends Lt{constructor(){super(),this['set']('state','accepted'),this['content']=Ns[this['state']],this['on']('change:state',()=>{this['content']=Ns[this['state']];});}}class AISuggestionContentPartToolbarView extends kt{['_applyButton'];['_suggestButton'];constructor(_0x5c08eb,_0x4e8f20,_0x73a576){super(_0x5c08eb);const _0x34cb75=Boolean(_0x73a576);this['set']('isEnabled',!_0x34cb75),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['class']='ck-ai-suggestion-content-part-toolbar';const _0xf82832=[];if(_0x34cb75){const _0x409637=new yt(_0x5c08eb);_0x409637['set']({'label':Mi(_0x5c08eb,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4d1218}),_0x409637['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0xf82832['push'](_0x409637);}else{_0x4e8f20['includes']('applySuggestion')&&(this['_applyButton']=new yt(_0x5c08eb),this['_applyButton']['set']({'label':Mi(_0x5c08eb,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x52abd9}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['bind']('isVisible')['to'](this,'isTrackChangesOn',_0x19b46a=>!_0x19b46a),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0xf82832['push'](this['_applyButton'])),_0x4e8f20['includes']('insertSuggestion')&&(this['_suggestButton']=new yt(_0x5c08eb),this['_suggestButton']['set']({'label':Mi(_0x5c08eb,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x127ad4}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0xf82832['push'](this['_suggestButton']));const _0x160871=new yt(_0x5c08eb);_0x160871['set']({'label':Mi(_0x5c08eb,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x255b66}),_0x160871['bind']('isEnabled')['to'](this),_0x160871['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0xf82832['push'](_0x160871);}this['items']['addMany'](_0xf82832);const _0x1d809a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x1d809a['if']('isVisible','ck-hidden',_0x54ec0c=>!_0x54ec0c)]}});}['setButtonsVisibility']({showApplyButton:_0x2c89b2,showSuggestButton:_0x160824}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x2c89b2),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x160824);}}class AISuggestionContentPartHeaderView extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x3939e2,{part:_0x146835,uiIndex:_0x213db6,availableActions:_0x27b02a,areActionsDisabled:_0x4ba373}){super(_0x3939e2),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['set']('isTrackChangesOn',!0x1),this['toolbarView']=new AISuggestionContentPartToolbarView(_0x3939e2,_0x27b02a,_0x4ba373),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x146835['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x146835['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x146835['index']});}),this['toolbarView']['bind']('isEnabled','isTrackChangesOn')['to'](this),this['stateView']=new AISuggestionContentPartStateView(_0x3939e2),this['titleLabelView']=new AISuggestionBodyContentPartTitleLabelView(_0x3939e2,_0x213db6),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x54419f,_0x1037e6,_0x19282b,_0x370f99)=>{'pending'===_0x370f99?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x19282b?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x19282b),this['children']['add'](this['stateView']));});}}class AISuggestionBodyContentPartTitleLabelView extends Nt{constructor(_0x32588b,_0x469915){super(_0x32588b),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Mi(_0x32588b,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x469915['toString']())]});}}class AISuggestionStreamableContentView extends Nt{['htmlStreamer'];constructor(_0x3aeb7e){super(_0x3aeb7e),this['htmlStreamer']=new HTMLStreamer(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0xb95809,renderingStrategy:_0x364116,abortSignal:_0x57dad4}){const _0x2de1fd=_0x1ba81c(_0xb95809['content'],!0x0);for(const _0x58243c of qi(_0x2de1fd))_0x383ffd(_0x58243c);'streaming'===_0x364116?await this['htmlStreamer']['stream']({'document':_0x2de1fd,'targetElement':this['element'],'abortSignal':_0x57dad4}):_0x17aec7(this['element'],'<'+this['element']['tagName']+'>'+Ki(_0x2de1fd)+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='',this['element']['scrollTop']=0x0;}}class AISuggestionBodyViewContentPartView extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x8a5bee,{part:_0x414326,uiIndex:_0x5376c9,areActionsDisabled:_0x3b3d4b,availableActions:_0x148d0c}){super(_0x8a5bee);const _0x375947=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1),this['set']('isTrackChangesOn',!0x1);const _0x5c4d9d=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x3b3d4b;};this['on']('change:state',_0x5c4d9d),this['on']('change:isDone',_0x5c4d9d),_0x5c4d9d(),this['_children']=this['createCollection'](),this['_headerView']=new AISuggestionContentPartHeaderView(_0x8a5bee,{'part':_0x414326,'uiIndex':_0x5376c9,'availableActions':_0x148d0c,'areActionsDisabled':_0x3b3d4b}),this['_headerView']['bind']('isEnabled','state','isTrackChangesOn')['to'](this),this['_headerView']['delegate'](...bs)['to'](this),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x8a5bee),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x375947['to']('state',_0x3d2123=>'ck-ai-suggestion__body__content-part_'+_0x3d2123),_0x375947['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x375947['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x375947['if']('isVisible','ck-hidden',_0x1d8164=>!_0x1d8164)]},'children':this['_children'],'on':{'mouseenter':_0x375947['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x414326['index']});}),'mouseleave':_0x375947['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x414326['index']});}),'click':_0x375947['to'](_0xdf72b1=>{const _0x4ca942=_0xdf72b1['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x4ca942)&&this['fire']('showChangeInText',{'index':_0x414326['index']});})}});}async['updateContent']({part:_0x1f709a,showUnchangedParts:_0x7d0ffb=!0x1,abortSignal:_0x5b753a}){this['partDefinition']=_0x1f709a,this['isVisible']=this['partDefinition']['hasChanges']||_0x7d0ffb,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x1f709a,'renderingStrategy':'static','abortSignal':_0x5b753a});}['markAsDone'](){this['isDone']=!0x0;}}class AISkeletonView extends Nt{constructor(_0x6ae201,_0x48ed97){super(_0x6ae201),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x517adf=>!_0x517adf)]},'children':this['_createSkeletonItems'](_0x48ed97)});}['_createSkeletonItems'](_0x241f6f){const _0x22150a=['ck','ck-ai-skeleton__item'];return _0x241f6f['map'](_0x346b5c=>{let _0x20a960='';switch(_0x346b5c['attributes']['align']){case'right':_0x20a960='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x20a960='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x20a960='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x346b5c['tag'],'attributes':{'class':[..._0x22150a,_0x346b5c['attributes']['class']?_0x346b5c['attributes']['class']:''],'style':'width:\x20'+_0x346b5c['attributes']['width']+';\x20height:\x20'+_0x346b5c['attributes']['height']+';'+_0x20a960}};});}}const xs={'aiSuggestionBody':[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}}],'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':Ls(0x5,'100%','44px','right'),'aiChatResources':Ls(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function Ls(_0x31f80d,_0x5936f3,_0x31abe8,_0x46cc06){return new Array(_0x31f80d)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x5936f3,'height':_0x31abe8,'align':_0x46cc06}}));}class PromiseQueue extends Et(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x5c56e7){const _0x3db2e6=this['createTask'](_0x5c56e7);return this['queue']['push'](_0x3db2e6),this['_processQueue'](),_0x3db2e6['completePromise'];}['abort'](){this['isProcessing']&&(this['_abortController']['abort'](),this['_abortController']=void 0x0,this['queue']=[],this['fire']('_queueEmpty'),this['isProcessing']=!0x1);}get['queueEmptyPromise'](){return this['queue']['length']||this['isProcessing']?new Promise(_0x5f235c=>{this['once']('_queueEmpty',()=>{_0x5f235c();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0xfd1220=this['queue']['shift']();try{await _0xfd1220['callback'](this['_abortController']['signal']),_0xfd1220['resolve']();}catch(_0x4b43b2){_0xfd1220['reject'](_0x4b43b2);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x501e95){let _0x113b98,_0x155b9c;const _0x13a079=new Promise((_0x9d3665,_0x1cb6a3)=>{_0x113b98=_0x9d3665,_0x155b9c=_0x1cb6a3;});return{'callback':_0x501e95,'resolve':_0x113b98,'reject':_0x155b9c,'completePromise':_0x13a079};}}class AIChatFeedErrorItemView extends AIChatFeedItemView{constructor(_0x48b980){super(_0x48b980),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x48b980['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x491449){this['element']['innerHTML']=_0x491449;}}const Ps=['applySuggestion','insertSuggestion'];class AIChatFeedSuggestionItemActionsView extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x30b374,_0x28017b=[...Ps],_0x27f751){super(_0x30b374);const _0x171af4=this['bindTemplate'],_0x2471fd=Boolean(_0x27f751);if(this['set']('isEnabled',!_0x2471fd),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x2471fd){const _0x34c9a5=new yt(_0x30b374);_0x34c9a5['set']({'label':Mi(_0x30b374,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4d1218}),_0x34c9a5['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x227d83=new Nt(_0x30b374);_0x227d83['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[Mi(_0x30b374,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x34c9a5]}]}),this['children']['add'](_0x227d83);}else this['_applyChangesButton']=new yt(_0x30b374),this['_applyChangesButton']['set']({'label':Mi(_0x30b374,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x28017b['includes']('applySuggestion'),'class':Ui}),this['_insertSuggestionsButton']=new yt(_0x30b374),this['_insertSuggestionsButton']['set']({'label':Mi(_0x30b374,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x28017b['includes']('insertSuggestion'),'class':Bi}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x529fe1=>{_0x529fe1['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x171af4['if']('isVisible','ck-hidden',_0x24cff1=>!_0x24cff1)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x4f9a83){this['isVisible']=_0x4f9a83;}['_switchButtonLabelsPlurality'](_0x1a185c){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x1a185c?(this['_applyChangesButton']['label']=Mi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=Mi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=Mi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=Mi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class AIWebSourcesView extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x40649e,_0x2dcb46){super(_0x40649e),this['bodyCollection']=_0x2dcb46,this['children']=this['createCollection'](),this['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources',this['bindTemplate']['if']('isVisible','ck-hidden',_0x17a6b6=>!_0x17a6b6)]},'children':this['children']});const _0x256f67=new Nt(this['locale']),_0x272d4b=new Lt();_0x272d4b['content']=_0x530bbb,_0x256f67['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x272d4b,{'tag':'span','children':[{'text':Mi(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x256f67),this['_setupBalloonPanel'](_0x40649e);}['addSource'](_0x5de127){this['children']['add'](new AIWebSourceView(this['locale'],_0x5de127,this['balloonPanelView']));}['_setupBalloonPanel'](_0x120bc0){this['balloonPanelView']=new zt(_0x120bc0),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class AIWebSourceView extends yt{['balloonPanelView'];['source'];constructor(_0x50c37a,_0x164ee7,_0x3b657d){super(_0x50c37a),this['source']=_0x164ee7,this['balloonPanelView']=_0x3b657d,this['set']({'label':_0x164ee7['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x42bc86=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x42bc86['to'](()=>{window['open'](_0x164ee7['url'],'_blank');}),'mouseenter':_0x42bc86['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x42bc86['to'](()=>{this['_hideTooltip']();})}}),_0x164ee7['favicon']){const _0x3cf77a=new Nt(_0x50c37a);_0x3cf77a['setTemplate']({'tag':'img','attributes':{'src':_0x164ee7['favicon']||_0x530bbb,'alt':_0x164ee7['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x3cf77a);}else this['set']('icon',_0x530bbb);}['_createTooltipContentView'](_0x59b50a,_0x283683){const _0x160cad=new Nt(_0x59b50a),_0x3966b4=[];let _0x34001d;_0x283683?.['favicon']?(_0x34001d=new Nt(_0x59b50a),_0x34001d['setTemplate']({'tag':'img','attributes':{'src':_0x283683['favicon'],'alt':_0x283683['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x34001d=new Lt(),_0x34001d['content']=_0x530bbb,_0x34001d['extendTemplate']({'attributes':{'alt':_0x283683['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x3966b4['push'](_0x34001d);const _0x5a8314=new Nt(_0x59b50a);_0x5a8314['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x283683['url']},'children':[{'text':new URL(_0x283683['url'])?.['hostname']}]}),_0x3966b4['push'](_0x5a8314);const _0x542c8f=new Nt(_0x59b50a);_0x542c8f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x3966b4});const _0xa4b4f4=new Nt(_0x59b50a);return _0xa4b4f4['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x283683['title']['length']>0x190?_0x283683['title']['substring'](0x0,0x190)+'...':_0x283683['title']}]}),_0x160cad['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x542c8f,_0xa4b4f4]}),_0x160cad;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[zt['defaultPositions']['northArrowSouth'],zt['defaultPositions']['northArrowSouthWest'],zt['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x55868b=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x55868b);}}class AISuggestionBodyView extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x1b20e1(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x89ed67,_0x2bf710){super(_0x89ed67);const {areActionsDisabled:_0x433f52,showUnchangedParts:_0x24955e,availableActions:_0x220d7b}=_0x2bf710;this['_areActionsDisabled']=_0x433f52,this['_showUnchangedParts']=_0x24955e,this['_availableActions']=_0x220d7b,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new AISkeletonView(_0x89ed67,xs['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new PromiseQueue(),this['_emptyPartsWarningView']=new AIChatFeedErrorItemView({'id':'empty-parts-warning','initialContent':Mi(_0x89ed67,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new AIChatFeedSuggestionItemActionsView(_0x89ed67,_0x2bf710['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new AIWebSourcesView(this['locale'],_0x2bf710['bodyCollection']),_0x2bf710['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...bs)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}['destroy'](){this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),super['destroy']();}get['partsCount'](){return this['_contentPartViews']['length'];}get['_contentPartViews'](){return Array['from'](this['_children'])['filter'](_0xda752a=>_0xda752a instanceof AISuggestionBodyViewContentPartView);}async['updateContentParts']({parts:_0x396a38,abortSignal:_0x23f4f5,skipLoadingEffects:_0x57505a}){this['_cachedContentParts']['length']?_0x396a38['forEach'](_0x437773=>{const _0x12ed47=this['_cachedContentParts']['findIndex'](_0x42db7c=>_0x42db7c['index']==_0x437773['index']);-0x1===_0x12ed47?this['_cachedContentParts']['push'](_0x437773):this['_cachedContentParts'][_0x12ed47]=_0x437773;}):this['_cachedContentParts']=_0x396a38;const _0x3f0e2b=this['_showUnchangedParts']?_0x396a38:_0x396a38['filter'](_0x58f906=>_0x58f906['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x3f0e2b['length']>0x1),_0x57505a&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x1166dc of _0x3f0e2b)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x3d2a53=>{let _0x32bb33=this['getPartView'](_0x1166dc['index']);if(!_0x32bb33){if(_0x32bb33=new AISuggestionBodyViewContentPartView(this['locale'],{'part':_0x1166dc,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x32bb33['delegate'](...bs)['to'](this),_0x32bb33['bind']('isTrackChangesOn')['to'](this),!_0x57505a&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x3d2a53),_0x3d2a53['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x32bb33,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x57505a||this['_showSkeletonDebounced']();}await _0x32bb33['updateContent']({'part':_0x1166dc,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x3d2a53}),_0x32bb33['markAsDone']();});return _0x23f4f5?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x4ad8d6,_0x148534){const _0x4e49e5=this['getPartView'](_0x4ad8d6);_0x4e49e5&&(_0x4e49e5['state']=_0x148534),this['hasPendingParts']='pending'==_0x148534||this['_contentPartViews']['some'](_0x76cfe1=>'pending'==_0x76cfe1['state']);}['setPartActive'](_0x1c516c,_0x50ad9d){if(!0x1===_0x1c516c){for(const _0x1a8c44 of this['_contentPartViews'])_0x1a8c44['isActive']=!0x1;}else{const _0x2a5b35=this['getPartView'](_0x1c516c);_0x2a5b35&&(_0x2a5b35['isActive']=_0x50ad9d);}}['updateSources'](_0x1c0b16){_0x1c0b16['forEach'](_0x18dadd=>this['_sourcesView']['addSource'](_0x18dadd)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x297111){return this['_contentPartViews']['find'](_0x5846ad=>_0x5846ad['partDefinition']['index']==_0x297111)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x3bbbb8=!this['_cachedContentParts']['find'](({hasChanges:_0x50971e})=>_0x50971e),_0x484b1e=!!this['_cachedContentParts']['find'](({hasChanges:_0x227f17})=>!_0x227f17);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x484b1e,_0x3bbbb8?this['_emptyPartsWarningView']['setContent'](Mi(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Mi(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x59c557=>_0x59c557['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x20c9a9){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x4ac9b5=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x4ac9b5>0x0){const {promise:_0x41a53c,abortController:_0x44cb81}=Os(_0x4ac9b5);_0x20c9a9?.['addEventListener']('abort',()=>_0x44cb81['abort']()),await _0x41a53c['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x5af0b4=>_0x5af0b4['partDefinition']['hasChanges'])['length']>0x0;}}class AISuggestionContainerView extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x4e8d7f,_0x56c466,_0x257eee){super(_0x4e8d7f);const {showDiff:_0x47e794,areActionsDisabled:_0x5058a9,showUnchangedParts:_0x517c54,availableActions:_0x5c0e9a}=_0x56c466;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new AISuggestionHeaderView(_0x4e8d7f,{'showDiff':_0x47e794}),this['headerView']['on']('toggleShowChanges',(_0x10f64d,_0x54a169)=>{this['areChangesVisible']=_0x54a169['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x54a169['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new AISuggestionBodyView(_0x4e8d7f,{'areActionsDisabled':_0x5058a9,'showUnchangedParts':!!_0x517c54,'availableActions':_0x5c0e9a,'bodyCollection':_0x257eee}),this['bodyView']['delegate'](...bs)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x4af3ed){await this['bodyView']['updateContentParts'](_0x4af3ed);}['updateSources'](_0x214545){this['bodyView']['updateSources'](_0x214545);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class AIChatFeedSuggestionItemView extends AIChatFeedItemView{['containerView'];constructor(_0x44b808,_0x280eae,_0x1e6f93){super(_0x280eae),this['set']('isTrackChangesOn',!0x1),this['containerView']=new AISuggestionContainerView(_0x44b808,{'showDiff':_0x280eae['showDiff'],'areActionsDisabled':_0x280eae['areActionsDisabled'],'availableActions':_0x280eae['availableActions']},_0x1e6f93),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x52ccd1,_0x2ef22e)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x2ef22e['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x58b496,{index:_0x44a0ec})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x44a0ec});}),this['containerView']['on']('applySuggestion',(_0x480d3d,{index:_0x127695}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x127695});}),this['containerView']['on']('insertSuggestion',(_0x2e81ac,{index:_0x405839}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x405839});}),this['containerView']['on']('rejectSuggestion',(_0x5e5ced,{index:_0x54700e})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x54700e});}),this['containerView']['on']('mouseOverSuggestion',(_0x451686,{index:_0x4af18b})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4af18b});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2dbc3b,{index:_0x3fdd2a})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3fdd2a});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x556659){await this['containerView']['updateContent'](_0x556659);}['updatePartState'](_0x18ee1b,_0x3e8b59){this['containerView']['bodyView']['updatePartState'](_0x18ee1b,_0x3e8b59);}['setPartActive'](_0x4268f6,_0x1a8389){!0x1===_0x4268f6?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x4268f6,_0x1a8389);}['updateSources'](_0x2de6d5){this['containerView']['updateSources'](_0x2de6d5);}['getPartView'](_0x3df674){return this['containerView']['bodyView']['getPartView'](_0x3df674);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class AIChatFeedReplyItemView extends AIChatFeedItemView{['replyContainer'];['_bodyCollection'];constructor(_0x3424a7,_0x2b95af,_0x397edc){super(_0x2b95af),this['_bodyCollection']=_0x397edc,this['locale']=_0x3424a7,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container','ck-ai-chat-content']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Wi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x4ea536,renderingStrategy:_0x242c23,abortSignal:_0x561fd3}){'streaming'===_0x242c23?await this['streamIntoElement'](_0x4ea536,this['replyContainer']['element'],_0x561fd3):this['replyContainer']['element']['innerHTML']=_0x1084a7(_0x4ea536);}['updateSources'](_0x3ec030){const _0x217ad1=new AIWebSourcesView(this['locale'],this['_bodyCollection']);_0x217ad1['children']['addMany'](_0x3ec030['map'](_0x48a130=>new AIWebSourceView(this['locale'],_0x48a130,_0x217ad1['balloonPanelView']))),_0x217ad1['isVisible']=!0x0,this['children']['add'](_0x217ad1);}}class AISpinnerView extends xt{constructor(_0x3935a7=void 0x0){super();const _0x19076f=_0x3935a7?'ck-ai-spinner_'+_0x3935a7:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x19076f]}});}}const Ds={'file':_0x2c0e59,'image':_0x463f2e,'document':_0x1c3a81,'web-resource':_0x223d3d,'text':_0x2c0e59,'selection':_0x868145,'mcp-tool-context':_0x1c3a81},Vs='ck-ai-chat-context-chip',Hs='ck-ai-chat-context-chip_wide',Ms='ck-ai-chat-context-chip_document',Us='ck-ai-chat-context-chip__label',Bs='ck-ai-chat-context-chip__type-icon',Gs='ck-ai-chat-context-controls__chip-tooltip',Fs='n';class AIChatContextItemButtonView extends yt{constructor(_0x27ec42,_0x15efb0,_0x3e8177,_0x1fa5ca,_0x4d5492=!0x1){super(_0x27ec42),this['_isAnimationOnEnterEnabled']=_0x1fa5ca,this['_initializeProperties'](_0x15efb0,_0x3e8177,_0x4d5492),this['_setupTemplate']();}['render'](){super['render'](),this['_isAnimationOnEnterEnabled']&&this['element']&&(this['element']['classList']['add']('ck-ai-chat-context-chip_new-chip'),this['_handleAnimationEndOnce'](this['element'],()=>{this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}));}['disableAnimationOnEnter'](){this['_isAnimationOnEnterEnabled']=!0x1,this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}['_initializeProperties'](_0x428d3f,_0x25cbbd,_0x5ee743){this['set']('label',_0x428d3f['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x428d3f['type']),this['set']('id',_0x428d3f['uiId']),this['set']('readonly',_0x25cbbd),this['set']('isLoading',_0x5ee743);}['_setupTemplate'](){const _0xa91d93=this['_createIconView'](),_0x7b2a5a=this['_createRemoveButton'](),_0x28f57f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x28f57f),'children':this['_createTemplateChildren'](_0xa91d93,_0x7b2a5a,_0x28f57f)});}['_createTemplateAttributes'](_0x97bf53){return{'class':[Vs,_0x97bf53['if']('itemType',Ms,_0x3ae56f=>'document'==_0x3ae56f),_0x97bf53['if']('itemType',Hs,_0x3c5f9c=>'selection'==_0x3c5f9c)],'data-cke-tooltip-text':_0x97bf53['to']('label',Ws),'data-cke-tooltip-position':Fs,'data-cke-tooltip-class':Gs};}['_createTemplateChildren'](_0x320eba,_0x21738a,_0x306e46){const _0xf7cb6a=this['_createLabelElement'](_0x306e46),_0x412ae4=this['_createLoaderIcon']();return this['readonly']?[_0x320eba,_0xf7cb6a]:[_0x320eba,_0x412ae4,_0xf7cb6a,_0x21738a];}['_createLabelElement'](_0x3bfa08){return{'tag':'span','attributes':{'class':Us},'children':[{'text':_0x3bfa08['to']('label')}]};}['_createRemoveButton'](){const _0x202d05=new yt(this['locale']);return _0x202d05['set']({'label':Mi(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x5e45e9}),this['_setupRemoveButtonEvent'](_0x202d05),_0x202d05;}['_setupRemoveButtonEvent'](_0x4f20eb){_0x4f20eb['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x45f47e=this['bindTemplate'],_0x2bfebe=new Lt();return _0x2bfebe['content']=Ds[this['itemType']],_0x2bfebe['extendTemplate']({'attributes':{'class':[Bs,_0x45f47e['if']('isLoading','ck-hidden',_0x5d1dfa=>_0x5d1dfa)]}}),_0x2bfebe;}['_handleAnimationEndOnce'](_0x3c33a0,_0x294a51){if(!_0x3c33a0)return;const _0x5889eb=()=>{_0x294a51(),_0x3c33a0['removeEventListener']('animationend',_0x5889eb),_0x3c33a0['removeEventListener']('webkitAnimationEnd',_0x5889eb);};_0x3c33a0['addEventListener']('animationend',_0x5889eb),_0x3c33a0['addEventListener']('webkitAnimationEnd',_0x5889eb);}['_createLoaderIcon'](){const _0x5390c2=new AISpinnerView('small');return _0x5390c2['bind']('isVisible')['to'](this,'isLoading',_0xb84fde=>_0xb84fde),_0x5390c2;}}function Ws(_0x57a843){if(!_0x57a843)return _0x57a843;if(_0x57a843['length']<=0x78)return _0x57a843;const _0x59b07d=_0x57a843['slice'](0x0,0x78),_0x493603=_0x59b07d['lastIndexOf']('\x20');return(_0x493603>0x0?_0x59b07d['slice'](0x0,_0x493603):_0x59b07d)+'…';}const Ks={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Ys='300px';class AIChatChipsOverflowManager{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x314541,_0x5669cc,_0x341b5f,_0x1fdf91,_0x31c346){this['_locale']=_0x314541,this['_visibleChips']=_0x5669cc,this['_config']={...Ks,..._0x341b5f,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x341b5f['cssClasses']}},this['_overflowChips']=new _t(),this['_bodyCollection']=_0x1fdf91,this['_parentView']=_0x31c346||null;}['setContainerElement'](_0x4e1f7d){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x4e1f7d,this['_setupVisibilityObserver']();}get['showMoreButtonView'](){return this['_showMoreButtonView'];}get['overflowChips'](){return this['_overflowChips'];}['reorganizeChips'](){requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});}['showBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_updateBalloonContent'](),this['_showMoreButtonView']['isOn']=!0x0,this['_showMoreBalloonPanelView']['show'](),this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')}));}['hideBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_showMoreButtonView']['isOn']=!0x1,this['_showMoreBalloonPanelView']['hide']());}['clear'](){this['_overflowChips']['clear'](),this['hideBalloonPanel'](),this['_updateShowMoreButtonVisibility'](),this['_showMoreButtonView']&&(this['_showMoreButtonView']['label']=''),this['_showMoreBalloonPanelView']&&this['_showMoreBalloonPanelView']['content']['clear']();}['destroy'](){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_showMoreButtonView']&&(this['_showMoreButtonView']['destroy'](),this['_showMoreButtonView']=null),this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['destroy'](),this['_showMoreBalloonPanelView']=null);}['_checkAndHandleOverflow'](){if(!this['_containerElement'])return;if(!this['_isContainerVisible']())return void(this['_pendingCalculation']=!0x0);this['_pendingCalculation']=!0x1;const _0x7dd318=[...this['_visibleChips'],...this['_overflowChips']],_0x1ce279=this['_createCalculationContainer'](),_0x11908c=this['_calculateOverflowInContainer'](_0x1ce279,_0x7dd318),_0x134f05=_0x1ce279['_ancestorsToRestore'];_0x134f05&&this['_restoreAncestorVisibility'](_0x134f05),_0x1ce279['remove'](),this['_applyOverflowResults'](_0x7dd318,_0x11908c);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),jt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x435468=new yt(this['_locale']);_0x435468['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x418719=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x418719['push'](this['_config']['cssClasses']['controlsButton']),_0x435468['extendTemplate']({'attributes':{'class':_0x418719}}),_0x435468;}['_createShowMoreBalloonPanelView'](){const _0x409bc3=new zt(this['_locale']);return _0x409bc3['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x409bc3),_0x409bc3;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x2c9319=>{_0x2c9319['disableAnimationOnEnter']();});const _0x1c408a=new Nt(this['_locale']);_0x1c408a['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x1c408a);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x330dd0=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x330dd0?'':'none');}['_repinBalloonPanel'](){this['_showMoreButtonView']?.['isOn']&&this['_showMoreBalloonPanelView']?.['isVisible']&&this['_showMoreButtonView']['element']&&this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')});}['_findTargetContainer'](_0x40ddb5){const _0x34b6e6=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x517f94=this['_containerElement']?.['classList'];if(_0x517f94){const _0x1248c0=_0x517f94[0x0]||'',_0x183c11=_0x40ddb5['querySelector']('.'+_0x1248c0),_0x4b2493=_0x40ddb5['querySelector'](_0x34b6e6);return _0x183c11||_0x4b2493||_0x40ddb5;}return _0x40ddb5['querySelector'](_0x34b6e6)||_0x40ddb5;}['_calculateContainerWidth'](){const _0x5d4d68=this['_parentView']?.['element']||this['_containerElement'];if(!_0x5d4d68)return Ys;const _0x3c2b05=window['getComputedStyle'](_0x5d4d68)['width'];if('auto'===_0x3c2b05||'0px'===_0x3c2b05||!_0x3c2b05){const _0x43d3af=_0x5d4d68['parentElement'];if(_0x43d3af){const _0x503d9a=window['getComputedStyle'](_0x43d3af);return'auto'!==_0x503d9a['width']?_0x503d9a['width']:Ys;}return Ys;}return _0x3c2b05;}['_applyCalculationStyles'](_0x9c2047,_0x1d7a75){this['_config']['cssClasses']['calculationContainer']&&_0x9c2047['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x9c2047['style']['width']=_0x1d7a75,_0x9c2047['style']['position']='absolute',_0x9c2047['style']['top']='-9999px',_0x9c2047['style']['left']='-9999px',_0x9c2047['style']['opacity']='0',_0x9c2047['style']['pointerEvents']='none',_0x9c2047['style']['zIndex']='-1',_0x9c2047['style']['visibility']='visible\x20!important',_0x9c2047['style']['display']='block\x20!important',_0x9c2047['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x306a00){_0x306a00['forEach'](({element:_0x3b90a4,originalDisplay:_0x2e3ba6,originalVisibility:_0x4ef750})=>{_0x3b90a4['style']['display']=_0x2e3ba6,_0x3b90a4['style']['visibility']=_0x4ef750;});}['_makeAncestorsVisible'](_0x10b4ad){const _0x5a232e=[];let _0x414981=_0x10b4ad;for(;_0x414981&&_0x414981!==document['body'];){const _0x5c5fc1=window['getComputedStyle'](_0x414981);'none'!==_0x5c5fc1['display']&&'hidden'!==_0x5c5fc1['visibility']||(_0x5a232e['push']({'element':_0x414981,'originalDisplay':_0x414981['style']['display'],'originalVisibility':_0x414981['style']['visibility']}),_0x414981['style']['display']='block',_0x414981['style']['visibility']='visible'),_0x414981=_0x414981['parentElement'];}return _0x5a232e;}['_createContainerElements'](){let _0x47d405,_0x42768d;return this['_parentView']?.['element']?(_0x47d405=this['_parentView']['element']['cloneNode'](!0x0),_0x42768d=this['_findTargetContainer'](_0x47d405)):(_0x47d405=document['createElement']('div'),_0x42768d=_0x47d405),{'calculationContainer':_0x47d405,'targetContainer':_0x42768d};}['_createCalculationContainer'](){const {calculationContainer:_0x2196bb,targetContainer:_0x61b891}=this['_createContainerElements'](),_0x5a915c=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x2196bb,_0x5a915c);const _0x580ad5=this['_parentView']?.['element']||this['_containerElement'],_0x4c7aac=_0x580ad5?.['parentElement'];_0x4c7aac?_0x4c7aac['appendChild'](_0x2196bb):document['body']['appendChild'](_0x2196bb),_0x2196bb['_targetContainer']=_0x61b891;const _0x475e8d=this['_makeAncestorsVisible'](_0x4c7aac||null);return _0x2196bb['offsetWidth'],_0x2196bb['_ancestorsToRestore']=_0x475e8d,_0x2196bb;}['_calculateOverflowInContainer'](_0x19010d,_0x4c6c61){const _0x1ce7e4=_0x19010d['_targetContainer']||_0x19010d,_0x9d2930=[],{rowCount:_0x520718}=this['_renderChipsAndCountRows'](_0x1ce7e4,_0x4c6c61);if(_0x520718<=this['_config']['maxVisibleRows'])return _0x9d2930;const _0x3685d3=_0x4c6c61['slice']();for(;_0x3685d3['length']>0x0;){if(this['_testButtonFit'](_0x19010d,_0x1ce7e4,_0x3685d3)){const _0x393a26=_0x4c6c61['filter'](_0x257c2f=>!_0x3685d3['includes'](_0x257c2f));_0x9d2930['push'](..._0x393a26);break;}if(!_0x3685d3['pop']())break;}return _0x9d2930;}['_renderChipsAndCountRows'](_0x2dd432,_0x29bd33){_0x2dd432['innerHTML']='',_0x29bd33['forEach'](_0x59327e=>{if(_0x59327e['element']){const _0x5d8133=_0x59327e['element']['cloneNode'](!0x0);_0x2dd432['appendChild'](_0x5d8133);}}),_0x2dd432['offsetWidth'];const _0x13aa72=_0x2dd432['children'],_0x9a73e2=[];return Array['from'](_0x13aa72)['forEach'](_0x1a0541=>{const _0x89f270=_0x1a0541['getBoundingClientRect']()['top'];_0x9a73e2['some'](_0xa7775d=>Math['abs'](_0xa7775d-_0x89f270)<this['_config']['rowDetectionTolerance'])||_0x9a73e2['push'](_0x89f270);}),{'rowCount':_0x9a73e2['length']};}['_createMockButton'](){const _0x5990e7=document['createElement']('button');return _0x5990e7['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x5990e7['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x5990e7['textContent']='+\x201',_0x5990e7;}['_testButtonFit'](_0x54ce21,_0x55ec92,_0x6ae11c){this['_renderChipsAndCountRows'](_0x55ec92,_0x6ae11c);const _0x515d2c=this['_createMockButton']();_0x54ce21['appendChild'](_0x515d2c),_0x54ce21['offsetWidth'];const _0x320443=[..._0x55ec92['children'],_0x515d2c],_0x8a8804=[];_0x320443['forEach'](_0x324074=>{const _0x3c67c7=_0x324074['getBoundingClientRect']()['top'];_0x8a8804['some'](_0x278570=>Math['abs'](_0x278570-_0x3c67c7)<this['_config']['rowDetectionTolerance'])||_0x8a8804['push'](_0x3c67c7);});const _0x4ec314=_0x8a8804['length'];return _0x515d2c['remove'](),_0x4ec314<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0xf0c7c3,_0x20cc02){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0xf0c7c3['forEach'](_0x550d27=>{_0x20cc02['includes'](_0x550d27)?this['_overflowChips']['add'](_0x550d27):this['_visibleChips']['add'](_0x550d27);});}['_updateOverflowUI'](_0x279fcb){if(_0x279fcb>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x279fcb>0x0&&this['_showMoreButtonView']){const _0x3cf10d=''+this['_config']['showMoreLabelPrefix']+(_0x279fcb<0x63?_0x279fcb:'99');this['_showMoreButtonView']['label']=_0x3cf10d;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x43c247,_0x20dff4){this['_distributeChips'](_0x43c247,_0x20dff4),this['_updateOverflowUI'](_0x20dff4['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x52784d=>{_0x52784d[0x0]['isIntersecting']&&this['_pendingCalculation']&&requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});},{'threshold':0.01,'rootMargin':'50px'}),this['_intersectionObserver']['observe'](this['_containerElement']));}['_isContainerVisible'](){if(!this['_containerElement'])return!0x1;if(!this['_containerElement']['isConnected'])return!0x1;const _0x141518=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x141518['width']||0x0===_0x141518['height'])return!0x1;const _0x289fa1=window['innerHeight']||document['documentElement']['clientHeight'],_0x2913d0=window['innerWidth']||document['documentElement']['clientWidth'],_0xcf9bb1=0xc8;return _0x141518['bottom']>=-0xc8&&_0x141518['top']<=_0x289fa1+_0xcf9bb1&&_0x141518['right']>=-0xc8&&_0x141518['left']<=_0x2913d0+_0xcf9bb1;}}const $s='ck-ai-chat__feed__context-chips',qs='ck-ai-chat-context-chips-wrapper',Qs='ck-ai-chat-context-chips-wrapper-balloon',Xs='ck-ai-chat-controls-button',zs='ck-ai-chat-controls_context_show-more-button',js='ck-ai-chat-context-controls__show-more-balloon-panel';class AIChatFeedContextChipsView extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x1bb064,_0x122c3b,_0x2ac84a){super(_0x1bb064),this['_bodyCollection']=_0x2ac84a,this['_createContextChips'](_0x122c3b);const _0x4790f5={'cssClasses':{'showMoreButton':zs+'\x20'+Gi,'showMoreBalloon':js,'overflowContainer':Qs,'controlsButton':Xs}};this['_overflowManager']=new AIChatChipsOverflowManager(_0x1bb064,this['_contextChips'],_0x4790f5,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[$s,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':qs},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x5b13e4=this['element']['querySelector']('.'+qs);_0x5b13e4&&(this['_overflowManager']['setContainerElement'](_0x5b13e4),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x10d4c6){for(const _0x5eff36 of _0x10d4c6){const _0x24b553=new AIChatContextItemButtonView(this['locale'],_0x5eff36,!0x0,!0x1);this['_contextChips']['add'](_0x24b553);}}}class AIChatFeedUserMessageItemView extends AIChatFeedItemView{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x4b640c,_0xaf1df1,_0x3ac3bf){super(_0xaf1df1),this['_locale']=_0x4b640c,this['_bodyCollection']=_0x3ac3bf,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new AIChatFeedContextChipsView(this['_locale'],this['options']['contextItems']['filter'](_0x565efc=>!_0x565efc['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':['ck-reset_all-excluded','ck-ai-chat__feed__message-content','ck-ai-chat-content']}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class AIChatFeedInteractionHeaderView extends AIChatFeedItemView{['capabilities'];constructor(_0x17954b,_0x374ce6){super(_0x374ce6);const {isWebSearchEnabled:_0x3c7cd1,isReasoningEnabled:_0x2ebddf}=_0x374ce6['capabilities'],_0x465b4a=[];let _0x1f9170='';_0x3c7cd1&&_0x2ebddf?(_0x1f9170=Mi(_0x17954b,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x465b4a['push'](Js(_0x530bbb)),_0x465b4a['push'](Js(_0xd802ee))):_0x3c7cd1?(_0x1f9170=Mi(_0x17954b,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x465b4a['push'](Js(_0x530bbb))):_0x2ebddf&&(_0x1f9170=Mi(_0x17954b,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x465b4a['push'](Js(_0xd802ee))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x1f9170?'':'ck-hidden']}});const _0x35b41f=new Nt();_0x35b41f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x465b4a,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x1f9170]}]}),this['children']['add'](_0x35b41f),this['capabilities']=_0x374ce6['capabilities'];}}function Js(_0x48ea24){const _0x177a50=new Lt();return _0x177a50['content']=_0x48ea24,_0x177a50;}const Zs=['wheel','touchstart','pointerdown','keydown'],tn=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ScrollManager{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x3a0460){this['element']=_0x3a0460,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x1a4726 of Zs){const _0x37ba28='keydown'!==_0x1a4726;this['element']['addEventListener'](_0x1a4726,this['_onUserEvent']['bind'](this),{'passive':_0x37ba28,'signal':this['abortController']['signal']});}}['start']({smooth:_0x4d3cdd=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x4d3cdd?'smooth':'auto',this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}['stop'](){requestAnimationFrame(()=>{this['_stop']();});}['destroy'](){this['_stop'](),this['abortController']['abort']();}['_stop'](){null!==this['animationFrameId']&&(cancelAnimationFrame(this['animationFrameId']),this['animationFrameId']=null),this['isRunning']&&(this['isRunning']=!0x1),this['isUserPaused']=!0x1;}['_onUserEvent'](_0x18b480){if(this['isRunning']){if('keydown'===_0x18b480['type']){const _0x48ec78=_0x18b480['key'];if(!tn['includes'](_0x48ec78))return;}_0x18b480 instanceof WheelEvent?_0x18b480['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x55f148,scrollHeight:_0x286c20,clientHeight:_0x2962d1}=this['element'];return _0x286c20-_0x55f148-_0x2962d1<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class AIChatFeedCustomElementView extends AIChatFeedItemView{constructor(_0x27a5e5){super(_0x27a5e5),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class AIChatFeedView extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x106d15,_0x145d04){super(_0x106d15),this['_bodyCollection']=_0x145d04,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Ss)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ScrollManager(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x383d1e,_0x3a7a05){let _0x15992d;return'ai-reply'===_0x383d1e?_0x15992d=new AIChatFeedReplyItemView(this['locale'],_0x3a7a05,this['_bodyCollection']):'ai-suggestion-reply'===_0x383d1e?(_0x15992d=new AIChatFeedSuggestionItemView(this['locale'],_0x3a7a05,this['_bodyCollection']),_0x15992d['bind']('isTrackChangesOn')['to'](this)):_0x15992d='user-message'===_0x383d1e?new AIChatFeedUserMessageItemView(this['locale'],_0x3a7a05,this['_bodyCollection']):'interaction-header'===_0x383d1e?new AIChatFeedInteractionHeaderView(this['locale'],_0x3a7a05):'custom-element'===_0x383d1e?new AIChatFeedCustomElementView(_0x3a7a05):new AIChatFeedErrorItemView(_0x3a7a05),this['children']['add'](_0x15992d),_0x15992d;}async['updateReplyItem']({id:_0x3225ab,parsedContent:_0x5d7577,renderingStrategy:_0xff2f9d,abortSignal:_0x5526f0}){const _0x39c874=this['getItemById'](_0x3225ab);if(!(_0x39c874 instanceof AIChatFeedReplyItemView))throw new ht('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x39c874,'id':_0x3225ab,'parsedContent':_0x5d7577});await _0x39c874['updateContent']({'parsedContent':_0x5d7577,'renderingStrategy':_0xff2f9d,'abortSignal':_0x5526f0});}async['updateWebSources'](_0x279cf5,_0xe04c16){const _0x3c2126=this['getItemById'](_0x279cf5);if(_0x3c2126 instanceof AIChatFeedSuggestionItemView)_0x3c2126['updateSources'](_0xe04c16);else{if(!(_0x3c2126 instanceof AIChatFeedReplyItemView))throw new ht('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x3c2126,'id':_0x279cf5,'sources':_0xe04c16});_0x3c2126['updateSources'](_0xe04c16);}}async['updateSuggestionItem']({id:_0x106773,parts:_0x91c308,abortSignal:_0xc83ca6,skipLoadingEffects:_0x103d9d}){const _0x3b776c=this['getItemById'](_0x106773);if(!(_0x3b776c instanceof AIChatFeedSuggestionItemView))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x3b776c,'id':_0x106773,'parts':_0x91c308});await _0x3b776c['updateContent']({'parts':_0x91c308,'abortSignal':_0xc83ca6,'skipLoadingEffects':_0x103d9d});}['updateSuggestionPartState']({id:_0x54421e,index:_0x1d788c,state:_0x4d7bf3}){const _0x54dd05=this['getItemById'](_0x54421e);if(!(_0x54dd05 instanceof AIChatFeedSuggestionItemView))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x54421e});_0x54dd05['updatePartState'](_0x1d788c,_0x4d7bf3);}['setSuggestionPartActive']({id:_0x49a27d,index:_0x11b59c,isActive:_0x412194}){const _0x236364=this['getItemById'](_0x49a27d);if(!(_0x236364 instanceof AIChatFeedSuggestionItemView))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x49a27d});this['children']['filter'](_0x14fd8b=>_0x14fd8b instanceof AIChatFeedSuggestionItemView)['forEach'](_0x5ed3a0=>{_0x5ed3a0['setPartActive'](!0x1);}),_0x236364['setPartActive'](_0x11b59c,_0x412194);}['markItemAsDone'](_0x222c8a){this['getItemById'](_0x222c8a)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x314cc0=>_0x314cc0['options']['id']);}['removeItem'](_0x469d2a){this['children']['remove'](this['getItemById'](_0x469d2a));}['hasItem'](_0xbfd21b){return!!this['children']['find'](_0x28fc1a=>_0x28fc1a['options']['id']['includes'](_0xbfd21b));}['scrollToSuggestion'](_0x127a01,_0x34b08f){const _0x2e3bd4=this['getItemById'](_0x127a01);if(!(_0x2e3bd4 instanceof AIChatFeedSuggestionItemView))return void wt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x127a01,'partIndex':_0x34b08f});const _0x380603=_0x2e3bd4['getPartView'](_0x34b08f);_0x380603?Rt(_0x380603['element'],0x14,this['element']['parentElement'],!0x0,!0x0):wt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x127a01,'partIndex':_0x34b08f});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x9ef100=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x9ef100,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x32e58a=new AISkeletonView(this['locale'],xs['aiFeed']);return _0x32e58a['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x32e58a;}['_createFeedItems'](){const _0x14666c=new Nt(this['locale']);return _0x14666c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x14666c;}['_createFeedLoader'](){const _0x202834=new Nt(this['locale']);return _0x202834['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x99ce38=>!_0x99ce38)]},'children':this['_createLoaderChildren']()}),_0x202834;}['_createLoaderChildren'](){const _0x63b817=new AISpinnerView();return _0x63b817['isVisible']=!0x0,[_0x63b817,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x1421ec){const _0x30a305=this['children']['find'](_0x43648f=>_0x43648f['options']['id']['includes'](_0x1421ec));if(!_0x30a305)throw new ht('ai-chat-feed-view-item-not-found',this,{'id':_0x1421ec});return _0x30a305;}['setLoadingMessage'](_0x1afc04){this['set']('loadingMessage',_0x1afc04);}['toggleLoadingSkeleton'](_0x29dc59){this['set']('isLoadingSkeletonVisible',_0x29dc59);}['startAutoScroll'](_0x344d0f={}){this['scrollManager']['start'](_0x344d0f);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class AIChatPromptSuggestionsListView extends Dt{['filter'](){let _0x22a1f0=0x0;for(const _0x25ee6d of this['items'])_0x22a1f0+=_0x25ee6d['items']['length'];return{'resultsCount':_0x22a1f0,'totalItemsCount':_0x22a1f0};}}function en(_0x567600){const _0x157b7b=[];let _0x422d96=!0x1;for(const _0x27f1d4 of Array['from'](_0x567600['items'])){if('file'!==_0x27f1d4['kind'])continue;const _0x4aae2d=_0x27f1d4['webkitGetAsEntry']();if(_0x4aae2d?.['isDirectory']){_0x422d96=!0x0;continue;}const _0x1b695c=_0x27f1d4['getAsFile']();_0x1b695c&&_0x157b7b['push'](_0x1b695c);}return{'files':_0x157b7b,'hasDirectory':_0x422d96};}const sn='ck-ai-chat__prompt-input_highlighted';class AIChatPromptInputView extends Pt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x134ccf,_0x1dbcde){super(_0x134ccf,{'queryView':{'label':'','creator':Bt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new AIChatPromptSuggestionsListView(_0x134ccf),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x1dbcde,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=AIChatPromptInputView['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=AIChatPromptInputView['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x123985,_0x9a3f92)=>!_0x123985&&!_0x9a3f92),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x20be87,_0x41c02f)=>{this['isUploadInProgress']||this['isEmpty']||_0x20be87['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x41c02f());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();}),this['queryView']['fieldView']['element']['addEventListener']('paste',_0x3178dc=>this['_handlePaste'](_0x3178dc)),this['element']['addEventListener']('drop',_0x7ccf8=>this['_handleDrop'](_0x7ccf8));}['_handlePaste'](_0x504281){const _0x2b1a7e=_0x504281['clipboardData'];if(!_0x2b1a7e)return;const {files:_0x53acf4,hasDirectory:_0x373a6b}=en(_0x2b1a7e),_0x4898c2={'files':_0x53acf4,'plainText':_0x2b1a7e['getData']('text/plain'),'hasDirectory':_0x373a6b,'forceTextAttachment':!0x1,'preventDefault':()=>_0x504281['preventDefault']()};this['fire']('promptInputPaste',_0x4898c2);}['_handleDrop'](_0x1c184c){const _0x3cb59d=_0x1c184c['dataTransfer'];if(!_0x3cb59d)return;const _0x35b57f={'files':[],'plainText':_0x3cb59d['getData']('text/uri-list')||_0x3cb59d['getData']('text/plain'),'hasDirectory':!0x1,'forceTextAttachment':!0x1,'preventDefault':()=>_0x1c184c['preventDefault']()};this['fire']('promptInputPaste',_0x35b57f);}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x3ae9b5=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x3ae9b5)return this['queryView']['errorText']=Mi(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x2c11f9=_0xe3e6fb(_0x3ae9b5);this['fire']('sendUserMessage',_0x2c11f9),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x446639){this['queryView']['fieldView']['set']('placeholder',_0x446639);}['focus'](_0x57ab26=!0x1){super['focus'](),_0x57ab26&&(this['element']['classList']['contains'](sn)||(this['element']['classList']['add'](sn),setTimeout(()=>{this['element']['classList']['remove'](sn);},0x320)));}['_createSubmitButton'](){const _0x2de5b3=new yt(this['locale']);return _0x2de5b3['set']({'icon':_0x411441,'label':Mi(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+Ui,'isEnabled':!0x1}),_0x2de5b3['on']('execute',()=>{this['submit']();}),_0x2de5b3;}['setIsUploadInProgress'](_0x4b16f8){this['isUploadInProgress']=_0x4b16f8;}['_setUpAddContextButtonPositioning'](){const _0x5c12be=this['locale'],_0x55366a=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x2ad54d=new dt(this['queryView']['fieldView']['element']),_0x43d3e6=new dt(this['_addContextButtonView']['element']),_0x327603=_0x2ad54d['width'],_0x408cfd='rtl'===_0x5c12be['uiLanguageDirection']?'right':'left';_0x2ad54d['excludeScrollbarsAndBorders']();const _0x5e8baa=_0x327603-_0x2ad54d['width']+0x1;this['_addContextButtonView']['element']['style'][_0x408cfd]='calc('+(_0x327603-_0x43d3e6['width']-_0x5e8baa)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x55366a),this['on']('render',()=>{_0x55366a(),this['_queryViewResizeObserver']=new bt(this['queryView']['fieldView']['element'],()=>{_0x55366a();});});}}class AIChatDropZoneView extends Nt{constructor(_0x35fd41){super(_0x35fd41);const _0x1bec29=new Lt();_0x1bec29['content']=_0x2c0e59,this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls__drop-overlay']},'children':[_0x1bec29,{'tag':'span','attributes':{'class':['ck-ai-chat-controls__drop-overlay__label']},'children':[{'text':Mi(_0x35fd41,'AI_CHAT_DROP_ZONE_HINT')}]}]});}['attach'](_0x498b95){let _0x3e16a7=0x0;_0x498b95['addEventListener']('dragenter',_0x5c272c=>{_0x5c272c['dataTransfer']&&(_0x3e16a7++,0x1===_0x3e16a7&&this['fire']('dragEnter'),_0x498b95['classList']['add']('ck-ai-chat-controls_drag-over'));}),_0x498b95['addEventListener']('dragover',_0x26e316=>{_0x26e316['dataTransfer']&&_0x26e316['preventDefault']();}),_0x498b95['addEventListener']('dragleave',()=>{--_0x3e16a7<=0x0&&(_0x3e16a7=0x0,_0x498b95['classList']['remove']('ck-ai-chat-controls_drag-over'));}),_0x498b95['addEventListener']('drop',_0x1510f2=>{_0x1510f2['preventDefault'](),_0x3e16a7=0x0,_0x498b95['classList']['remove']('ck-ai-chat-controls_drag-over'),this['_handleDrop'](_0x1510f2);});}['_handleDrop'](_0x377b82){const _0x1a9147=_0x377b82['dataTransfer'];if(!_0x1a9147)return;const {files:_0x6e109,hasDirectory:_0x320dbf}=en(_0x1a9147),_0xa3aac2={'files':_0x6e109,'plainText':_0x1a9147['getData']('text/uri-list')||_0x1a9147['getData']('text/plain'),'hasDirectory':_0x320dbf,'forceTextAttachment':!0x0,'preventDefault':()=>{}};this['fire']('promptInputPaste',_0xa3aac2);}}const nn='ck-ai-chat__prompt-capabilities',rn='ck-ai-chat-controls-button',on='ck-ai-chat-controls-button--commands',an='ck-ai-chat-controls__model-selection',hn='ck-ai-chat-controls__model-selection__item-name',cn='ck-ai-chat-controls__model-selection__item-description',ln='ck-ai-chat-controls__model-selection__item-capabilities',un='n';class AIChatPromptCapabilitiesView extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x483b3d){super(_0x483b3d),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x46cef4=>'selector'===_0x46cef4),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x2bc38a=>_0x2bc38a?this['_modelSelectionDropdown']['buttonView']['label']:Mi(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x3ef759=>_0x3ef759),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x1c7fee=>_0x1c7fee),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x1b93e9=>Mi(this['locale'],_0x1b93e9?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x115d68=>_0x115d68),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x55ec3b=>Mi(this['locale'],_0x55ec3b?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[nn]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _t(),Jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x4b9362,_0x5f5630){if(_0x5f5630)this['set']('modelDisplayMode','hidden');else{const _0x435d76=0x1===_0x4b9362['length'];this['set']('modelDisplayMode',_0x435d76?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x4b9362?.['length'])for(const _0x253f66 of _0x4b9362){const _0x7cd8b=new Zt({'label':_0x253f66['name'],'withText':!0x0,'role':'menuitemradio','id':_0x253f66['id'],'model':_0x253f66});_0x7cd8b['bind']('isOn')['to'](this,'activeModelId',_0x1bf9f2=>_0x1bf9f2===_0x253f66['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x7cd8b,'labelView':new dn(this['locale'],_0x253f66)});}}['setWebSearch'](_0x40d8ae){this['set']('webSearchActive',_0x40d8ae);}['setReasoning'](_0x19eb87){this['set']('reasoningActive',_0x19eb87);}['setModel'](_0x449ed2){if(!_0x449ed2)return;this['activeModelId']=_0x449ed2['id'],this['activeModelName']=_0x449ed2['name']||_0x449ed2['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x449ed2['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x449ed2['name']);const _0x2815e2=_0x449ed2['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x2815e2),this['_webSearchButton']['set']('isVisible',_0x2815e2);const _0x2e3b41=_0x449ed2['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x2e3b41),this['_reasoningButton']['set']('isVisible',_0x2e3b41);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0xd9c91b){this['set']('modelSelectorEnabled',!0x1),_0xd9c91b&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x844e0b=new yt();return _0x844e0b['set']({'label':Mi(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x530bbb,'class':rn+'\x20'+Gi,'isToggleable':!0x0,'tooltipPosition':un}),_0x844e0b['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x844e0b;}['_createReasoningButton'](){const _0x1fa2f1=new yt();return _0x1fa2f1['set']({'label':Mi(this['locale'],'AI_CHAT_REASONING'),'icon':_0xd802ee,'class':rn+'\x20'+Gi,'isToggleable':!0x0,'tooltipPosition':un}),_0x1fa2f1['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x1fa2f1;}['_createCommandsButton'](){const _0x2020c3=new yt();return _0x2020c3['set']({'label':Mi(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x4ff59c,'withText':!0x0,'class':rn+'\x20'+Gi,'isToggleable':!0x0,'tooltip':Mi(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':un}),_0x2020c3['extendTemplate']({'attributes':{'class':[on]}}),_0x2020c3['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x2020c3;}['_createModelSelectionDropdown'](){const _0x28025e=Ft(this['locale']);return _0x28025e['set']({'panelPosition':'ne','class':[an]}),_0x28025e['buttonView']['set']({'label':Mi(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':un,'class':Gi}),this['listenTo'](_0x28025e,'execute',_0x299435=>{this['fire']('selectModel',_0x299435['source']['model']);}),_0x28025e;}['_createModelNameView'](){const _0x2e2958=new _n(this['locale']);return _0x2e2958['bind']('text')['to'](this,'activeModelName',_0x467b0d=>_0x467b0d??''),_0x2e2958['bind']('isVisible')['to'](this,'modelDisplayMode',_0x12b128=>'name'===_0x12b128),_0x2e2958;}}let dn=class ModelButtonLabelView extends Mt{constructor(_0x5ce38b,_0x582827){super();const _0x2cde42=this['bindTemplate'],_0x46edc6=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2cde42['to']('style'),'id':_0x2cde42['to']('id')},'children':[{'tag':'div','attributes':{'class':[hn]},'children':[{'text':_0x2cde42['to']('text')}]},{'tag':'div','attributes':{'class':[cn]},'children':[{'tag':'span','children':[{'text':_0x582827['description']}]}]},{'tag':'div','attributes':{'class':[ln]},'children':_0x46edc6}]}),_0x46edc6['addMany'](this['_getCapabilityParts'](_0x5ce38b,_0x530bbb,'AI_CHAT_SEARCH_WEB',_0x582827['capabilities']['webSearch']?.['enabled']??!0x1)),_0x46edc6['addMany'](this['_getCapabilityParts'](_0x5ce38b,_0xd802ee,'AI_CHAT_REASONING',_0x582827['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x16fc41,_0x21313c,_0x4bf3f2,_0x3dfea7){const _0x2dce2f=new Lt();_0x2dce2f['content']=_0x21313c;const _0xbb6fe8=new Nt(_0x16fc41);_0xbb6fe8['setTemplate']({'tag':'span','children':[{'text':Mi(_0x16fc41,_0x4bf3f2)+':\x20'}]});const _0x1e9030=new Nt(_0x16fc41);return _0x1e9030['setTemplate']({'tag':'span','children':[{'text':Mi(_0x16fc41,_0x3dfea7?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x2dce2f,_0xbb6fe8,_0x1e9030];}},_n=class ModelNameView extends Nt{constructor(_0x381f84){super(_0x381f84),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x5eae00=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x5eae00['if']('isVisible','ck-hidden',_0x21ea28=>!_0x21ea28)]},'children':[{'text':_0x5eae00['to']('text')}]});}};const In='ck-ai-chat-context-controls__url-form',An='ck-ai-chat-context-controls__url-input-section';class AIChatContextPanelUrlInputView extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x1cc52b){super(_0x1cc52b),this['focusTracker']=new It(),this['keystrokes']=new At(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x587ef0=>{this['focusTracker']['add'](_0x587ef0['element']),this['keystrokes']['listenTo'](_0x587ef0['element']);}),te({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x1d91dc){this['urlInputField']['errorText']=_0x1d91dc,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x243c6c=new yt(this['locale']);return _0x243c6c['set']({'icon':_0x326f31,'tooltip':Mi(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x10860a,_0x1a8383,_0x41c674)=>{_0x243c6c['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x41c674?'':'\x20ck-hidden')]});}),_0x243c6c;}['_createUrlInputField'](){const _0x5508dd=new _0x535e0b(this['locale'],_0x485a30);return _0x5508dd['set']({'label':Mi(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x5508dd['fieldView']['set']({'placeholder':Mi(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x5508dd;}['_createConfirmButton'](){const _0x23b60b=new yt(this['locale']);return _0x23b60b['set']({'icon':_0x6eb847,'tooltip':Mi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x23b60b;}['_setupTemplate'](){const _0x5eef55=new _0x4b60f6(this['locale'],{'label':Mi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x5eef55['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':In,'tabindex':'-1'},'children':[_0x5eef55,{'tag':'div','attributes':{'class':An},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x1d6272=>{_0x1d6272['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x17e6d6,_0x5b2857)=>{this['clear'](),this['fire']('cancel'),_0x5b2857();});}['_handleSubmit'](){const _0x48987e=this['getValue']()['trim']();_0x48987e?this['_isValidUrl'](_0x48987e)?(this['clearError'](),this['fire']('submitUrl',_0x48987e)):this['setError'](Mi(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Mi(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x22d705=this['getValue']()['trim'](),_0x1c5025=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x22d705['length']>0x0&&!_0x1c5025;}['_isValidUrl'](_0x1a39f0){try{return!!new URL(_0x1a39f0);}catch{return!0x1;}}}const gn='ck-ai-chat-resources__item',wn='ck-ai-chat-resources__item--in-context',Cn='ck-ai-chat-resources__item-title',mn='ck-ai-chat-resources__item__icon';class AIChatResourceListItemView extends Ht{['resource'];['_titleView'];['_iconView'];constructor(_0x45374f,_0x12b478){super(_0x45374f),this['resource']=_0x12b478,this['set']('isInContext',!!_0x12b478['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x5ef379){if(_0x5ef379['isInContext'])return _0x6eb847;switch(_0x5ef379['type']){case'document':return _0x1c3a81;case'web-resource':return _0x223d3d;case'file':case'text':return _0x2c0e59;default:return _0x30356d;}}['highlightText'](_0x1e9161){if(!_0x1e9161||''===_0x1e9161['trim']())return void this['_titleView']['highlightText'](null);const _0xb681ff=new RegExp(_0x3d3c69(_0x1e9161),'gi');this['_titleView']['highlightText'](_0xb681ff);}['updateResourceState'](_0x2e2ac9){this['resource']['isInContext']=_0x2e2ac9,this['isInContext']=_0x2e2ac9,this['_updateIcon']();}['_createTitleView'](){const _0x25776c=new _0x4a420c();return _0x25776c['text']=this['resource']['label'],_0x25776c['extendTemplate']({'tag':'span','attributes':{'class':[Cn]}}),_0x25776c;}['_createIconView'](){const _0x28826c=new Lt();return _0x28826c['content']=this['getResourceIcon'](this['resource']),_0x28826c;}['_setupTemplate'](){const _0x344ecc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[gn,_0x344ecc['if']('isVisible','ck-hidden',_0x29ca2b=>!_0x29ca2b),_0x344ecc['if']('isInContext',wn)]},'children':[{'tag':'div','attributes':{'class':[mn]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x344ecc['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const pn='ck-ai-chat-resources__list';class AIChatContextResourcesListView extends Dt{['_source'];constructor(_0x925e82,_0x53ff91){super(_0x925e82),this['_source']=_0x53ff91,this['extendTemplate']({'attributes':{'class':[pn]}});}['setResources'](_0x34963c,_0x4879b5){this['items']['clear']();let _0x2cb7fb=_0x34963c;if(this['_source']['useDefaultFiltering']&&_0x4879b5&&''!==_0x4879b5['trim']()){const _0x4ce593=new RegExp(_0x4879b5['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x2cb7fb=_0x34963c['filter'](_0x1ee18c=>_0x4ce593['test'](_0x1ee18c['label']));}for(const _0x3004e2 of _0x2cb7fb){const _0x1dcbf6=new AIChatResourceListItemView(this['locale'],_0x3004e2);_0x1dcbf6['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x3004e2);}),this['items']['add'](_0x1dcbf6);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x4879b5);}['highlightText'](_0x44dd4c){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x34bbf4=>{_0x34bbf4['highlightText'](_0x44dd4c);});}['updateResourceState'](_0x27f826,_0x509c69){for(const _0x54f69d of this['items']){const _0x5578c6=_0x54f69d;_0x5578c6['resource']['id']===_0x27f826&&_0x5578c6['updateResourceState'](_0x509c69);}}['_handleResourceSelection'](_0x56eed1,_0x66ea6d){this['fire']('addResourceToContext',{'source':_0x56eed1,'resource':_0x66ea6d});}}class AIChatContextResourcesSearchInputView extends _0x535e0b{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x319eda){const t=_0x319eda['t'],_0x3aee8b={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x485a30,'label':Mi(_0x319eda,'AI_CHAT_SEARCH_RESOURCES')};super(_0x319eda,_0x3aee8b['creator']),this['label']=_0x3aee8b['label'],this['_viewConfig']=_0x3aee8b,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x319eda,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x37f480){this['fire']('search',_0x37f480);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new Lt(),this['iconView']['content']=_0x272085,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x1873ed,t){this['resetButtonView']=new yt(_0x1873ed),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x5e45e9,'class':'ck-search__reset','isVisible':!0x1,'tooltip':!0x0}),this['resetButtonView']['on']('execute',()=>{this['reset'](),this['focus'](),this['fire']('reset');}),this['resetButtonView']['bind']('isVisible')['to'](this['fieldView'],'isEmpty',_0x44a164=>!_0x44a164),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class AIChatContextResourcesView extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0xb14ba9,_0x4e89d7){super(_0xb14ba9),this['_source']=_0x4e89d7['source'],this['_searchInputVisibleFrom']=_0x4e89d7['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x461da8([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new AIChatContextResourcesSearchInputView(this['locale']);}['_createSearchSection'](){const _0x1971d4=new Nt(this['locale']);return _0x1971d4['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x231aec,_0x38d81e)=>{this['loadResources'](_0x38d81e),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x38d81e);}),_0x1971d4;}['_createResourcesListView'](){const _0x24346c=new AIChatContextResourcesListView(this['locale'],this['_source']);return _0x24346c['delegate']('addResourceToContext')['to'](this),_0x24346c['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x24346c;}['_createSkeletonView'](){const _0x48a4cc=new AISkeletonView(this['locale'],xs['aiChatResources']);return _0x48a4cc['bind']('isVisible')['to'](this,'isLoading'),_0x48a4cc;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x5a002c){const _0x3b143b=at();this['_latestLoadResourcesUid']=_0x3b143b,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x5a002c,'uid':_0x3b143b}),this['isLoading']=!0x0;}['setResources'](_0x105222,_0x92a723){if(_0x92a723&&_0x92a723!==this['_latestLoadResourcesUid'])return;const _0x1582cd=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x105222,_0x1582cd),_0x105222['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x651c6d,_0x20ec16){this['_resourcesListView']['updateResourceState'](_0x651c6d,_0x20ec16);}}const En='ck-ai-chat-context-controls__source-balloon-panel',Tn='ck-button-icon\x20ck-button-back',fn='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class AIChatResourcesBalloonView{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x575521,_0x4eb6b6,_0x1e2321){this['_locale']=_0x575521,this['_bodyCollection']=_0x4eb6b6,this['_config']=_0x1e2321;}['showSourceResourcesBalloon']({source:_0x412316,withBackButton:_0x255ffe}){let _0x3f1c39=this['_sourceResourceBalloons']['get'](_0x412316['id']);_0x3f1c39||(_0x3f1c39=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x412316['id'],_0x3f1c39),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x3f1c39)),this['_addSourceResourceContent']({'balloonPanel':_0x3f1c39,'source':_0x412316,'withBackButton':_0x255ffe}),_0x3f1c39['show']();const _0x607a4f=this['_config']['getTargetElement']();_0x607a4f&&_0x3f1c39['pin']({'target':_0x607a4f,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x338b61,_0x31486d,_0x47b5e6){const _0x1a26c5=this['_sourceResourceBalloons']['get'](_0x338b61);if(!_0x1a26c5)return;const _0x4ce946=this['_getResourcesViewFromBalloon'](_0x1a26c5);_0x4ce946&&(_0x4ce946['setResources'](_0x31486d,_0x47b5e6),_0x4ce946['once']('change:isLoading',()=>{_0x1a26c5['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x264965){const _0x179cf6=this['_sourceResourceBalloons']['get'](_0x264965);_0x179cf6&&requestAnimationFrame(()=>{_0x179cf6['hide'](),this['_sourceResourceBalloons']['delete'](_0x264965),this['_config']['onBalloonClosed']();});}['closeAll'](){for(const _0x6740ca of Array['from'](this['_sourceResourceBalloons']['keys']()))this['closeSourceResourceBalloon'](_0x6740ca);}['isAnyResourceBalloonVisible'](){for(const _0x2c0aa0 of this['_sourceResourceBalloons']['values']())if(_0x2c0aa0['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x53bffa,_0x3ba016,_0x2c307d){const _0x59ca6b=this['_sourceResourceBalloons']['get'](_0x53bffa);if(!_0x59ca6b||!_0x59ca6b['isVisible'])return;const _0x17b83c=this['_config']['getTargetElement']();if(!_0x17b83c)return;_0x59ca6b['pin']({'target':_0x17b83c,'limiter':this['_config']['getLimiterElement']()});const _0x31f42b=this['_getResourcesViewFromBalloon'](_0x59ca6b);_0x31f42b&&_0x31f42b['updateResourceState'](_0x3ba016,_0x2c307d);}['destroy'](){for(const _0x110af2 of this['_sourceResourceBalloons']['values']())_0x110af2['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x114f3d=new zt(this['_locale']);return _0x114f3d['extendTemplate']({'attributes':{'class':En}}),this['_bodyCollection']['add'](_0x114f3d),_0x114f3d;}['_addSourceResourceContent']({balloonPanel:_0x9d6ede,source:_0x50811e,withBackButton:_0x34aa5d}){_0x9d6ede['content']['clear']();const _0x2fb933=this['_createBalloonHeader']({'balloonPanel':_0x9d6ede,'source':_0x50811e,'withBackButton':_0x34aa5d});_0x9d6ede['content']['add'](_0x2fb933);const _0x327134=this['_createBalloonResourcesView'](_0x50811e);_0x9d6ede['content']['add'](_0x327134);}['_createBalloonHeader']({balloonPanel:_0x3de7c8,source:_0x30a5f0,withBackButton:_0x219590}){const _0x2a88d4=new _0x4b60f6(this['_locale'],{'label':_0x30a5f0['label'],'class':fn});return _0x219590&&_0x2a88d4['children']['add'](this['_createBackButton'](_0x3de7c8),0x0),_0x2a88d4;}['_createBackButton'](_0x1c1757){const _0x426746=new yt(this['_locale']);return _0x426746['set']({'icon':_0x326f31,'tooltip':Mi(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Tn}),_0x426746['on']('execute',()=>{_0x1c1757['hide'](),this['_config']['onBackToContext']();}),_0x426746;}['_createBalloonResourcesView'](_0x529b74){const _0x29218b=new AIChatContextResourcesView(this['_locale'],{'source':_0x529b74,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x29218b['on']('loadSourceResources',(_0x186316,_0x309128)=>{this['_config']['onLoadSourceResources'](_0x309128);}),_0x29218b['on']('addResourceToContext',(_0x19ba62,_0x23717a)=>{this['_config']['onResourceSelected'](_0x23717a['source'],_0x23717a['resource']),this['closeSourceResourceBalloon'](_0x529b74['id']);}),_0x29218b;}['_getResourcesViewFromBalloon'](_0x338e39){const _0x4c934e=_0x338e39['content']['get'](0x1);return _0x4c934e instanceof AIChatContextResourcesView?_0x4c934e:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x68f7f8){jt({'emitter':_0x68f7f8,'contextElements':[_0x68f7f8['element']],'callback':()=>{_0x68f7f8['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x68f7f8['isVisible']});}}const Rn=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],bn='ck-ai-chat-context-controls',Sn='ck-ai-chat-context-controls__pending-contexts',On='ck-ai-chat-context-controls__add-context-balloon-panel',vn='ck-ai-chat-context-controls__add-context-button',kn='ck-ai-chat-context-controls__url-balloon-panel',yn='ck-ai-chat-context-controls__balloon-button',Nn='ck-ai-chat-context-controls__balloon-button-source',xn='ck-ai-chat-controls-button',Ln='ck-ai-chat-context-chips-wrapper-balloon',Pn='ck-ai-chat-controls_context_show-more-button',Dn='ck-ai-chat-context-controls__show-more-balloon-panel',Vn='ck-ai-chat',Hn=[zt['defaultPositions']['northArrowSouthWest'],zt['defaultPositions']['northArrowSouth'],zt['defaultPositions']['northArrowSouthEast'],zt['defaultPositions']['southArrowNorthWest'],zt['defaultPositions']['southArrowNorth'],zt['defaultPositions']['southArrowNorthEast']];class AIChatContextPanelView extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x2d23b2,_0x3d9e85){super(_0x2d23b2),this['bodyCollection']=_0x3d9e85['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x2d23b2),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x2d23b2),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x2d23b2),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x2d23b2,_0x3d9e85);const _0x59f364={'cssClasses':{'showMoreButton':Pn+'\x20'+Gi,'showMoreBalloon':Dn,'overflowContainer':Ln,'controlsButton':xn}};this['_overflowManager']=new AIChatChipsOverflowManager(_0x2d23b2,this['_currentContextsChips'],_0x59f364,this['bodyCollection'],this),this['_addContextBalloonConfig']={'buttonView':this['addContextButtonView'],'balloonView':this['_addContextBalloonPanelView'],'hideMethod':this['hideAddContextBalloonPanel']['bind'](this),'showMethod':this['showAddContextBalloonPanel']['bind'](this)},this['_setupTemplate'](),this['_bindEventHandlers']();}['render'](){super['render'](),this['_setupAllBalloonClickOutsideHandlers'](),this['_overflowManager']['setContainerElement'](this['element']),this['_overflowManager']['reorganizeChips']();}['destroy'](){super['destroy'](),this['_overflowManager']['destroy'](),this['_resourcesBalloonView']['destroy']();}['addContextItem'](_0x164598,_0x542905){const _0x536a6f=this['_createContextButton'](_0x164598,'current',!0x0,_0x542905);this['_addContextToCollection'](_0x536a6f,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x185a26){this['_removeContextFromCollection'](_0x185a26,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x185a26,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x198059,_0x496050){let _0xc6297=this['_currentContextsChips']['find'](_0xf101ad=>_0xf101ad['id']===_0x198059);_0xc6297||(_0xc6297=this['_overflowManager']['overflowChips']['find'](_0x2935ad=>_0x2935ad['id']===_0x198059)),_0xc6297&&(_0xc6297['isLoading']=_0x496050);}['setConversationContext'](_0x13fc85){this['_conversationContextsChips']['clear']();for(const _0x5e9b6e of _0x13fc85){const _0x4ee434=this['_createContextButton'](_0x5e9b6e,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x4ee434,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x47df76,_0x538967,_0x416c16){this['_resourcesBalloonView']['updateResourceState'](_0x47df76,_0x538967,_0x416c16);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['hideAllBalloons'](){this['hideAddContextBalloonPanel'](),this['hideUrlBalloonPanel'](),this['_resourcesBalloonView']['closeAll']();}['_showSourceResourcesBalloon']({source:_0x13e9a2,withBackButton:_0x4ab59f}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x13e9a2,'withBackButton':_0x4ab59f}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x1fc15d,_0x11d2f8,_0x485c07,_0x92a174){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x1fc15d,_0x485c07,_0x92a174);}['closeSourceResourceBalloon'](_0x5f34c3){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x5f34c3),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x2dab3d){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x2dab3d),this['_setAddContextButtonEnabled'](_0x2dab3d);}['_setAddContextButtonEnabled'](_0x56fad2){const _0x3af187=!_0x56fad2['document']['isHidden']&&_0x56fad2['document']['enabled'],_0x1b934a=_0x56fad2['urls']['enabled'],_0x21e477=_0x56fad2['files']['enabled'],_0x559165=_0x56fad2['sources']['length']>0x0,_0x1e7d5b=_0x56fad2['customItems']&&_0x56fad2['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x3af187||_0x1b934a||_0x21e477||_0x559165||_0x1e7d5b;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[bn,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Sn},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x339b91){const _0x14252d=new yt(_0x339b91);return _0x14252d['set']({'label':Mi(_0x339b91,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':xn+'\x20'+vn+'\x20'+Gi,'icon':_0x3253fd,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x14252d;}['_createAddContextBalloonPanelView'](_0x4f2588){return this['_createBaseBalloonPanel'](_0x4f2588,On);}['_createUrlBalloonPanelView'](_0x4827e7){const _0x16989d=this['_createBaseBalloonPanel'](_0x4827e7,kn);return this['_addUrlContent'](_0x16989d,_0x4827e7),_0x16989d;}['_createResourcesBalloonView'](_0x8e7453,_0x3eeb50){const _0x3b232d={'searchInputVisibleFrom':_0x3eeb50['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Hn});},'onResourceSelected':(_0x2c2ad7,_0x392ebf)=>{this['fire']('addResourceToContext',{'source':_0x2c2ad7,'resource':_0x392ebf});},'onLoadSourceResources':_0x13f39e=>{this['fire']('loadSourceResources',_0x13f39e);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new AIChatResourcesBalloonView(_0x8e7453,_0x3eeb50['bodyCollection'],_0x3b232d);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Vn)||document['body'];}['_createBaseBalloonPanel'](_0x39739c,_0x37e977){const _0x2b48fb=new zt(_0x39739c);return _0x2b48fb['extendTemplate']({'attributes':{'class':_0x37e977}}),this['bodyCollection']['add'](_0x2b48fb),_0x2b48fb;}['_setBalloonPanelContent'](_0x555839,_0xa099db,_0x1f82c8){if(_0x555839['content']['clear'](),!_0x1f82c8['document']['isHidden']&&_0x1f82c8['document']['enabled']){const _0x2f12b9=this['_createBalloonButton'](_0xa099db,{'label':Mi(_0xa099db,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x1c3a81});_0x2f12b9['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x555839['content']['add'](_0x2f12b9);}if(_0x1f82c8['urls']['enabled']){const _0x14a7c9=this['_createBalloonButton'](_0xa099db,{'label':Mi(_0xa099db,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x223d3d});_0x14a7c9['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Hn}),this['_urlInputView']['focus']();}),_0x555839['content']['add'](_0x14a7c9);}if(_0x1f82c8['files']['enabled']){const _0x731c4f=new _0x5c7aea(_0xa099db);_0x731c4f['set']({'label':Mi(_0xa099db,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x529d0f,'withText':!0x0,'tooltip':!0x0,'class':yn,'allowMultipleFiles':!0x0}),_0x731c4f['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x731c4f['on']('done',(_0x13ae8c,_0x2109ff)=>{this['fire']('addFileToContext',_0x2109ff);}),_0x731c4f['tooltip']=!0x0,_0x555839['content']['add'](_0x731c4f);}for(const _0xe9f273 of _0x1f82c8['sources']){const _0x287526=this['_createBalloonButton'](_0xa099db,{'label':_0xe9f273['label'],'icon':_0xe9f273['icon']||_0x30356d,'type':'source'});_0x555839['content']['add'](_0x287526),_0x287526['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0xe9f273,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x3711af of _0x1f82c8['customItems']||[]){const _0x5b4158=this['_createBalloonButton'](_0xa099db,{'label':_0x3711af['label'],'icon':_0x3711af['icon']||_0x30356d,'type':'customItem'});_0x555839['content']['add'](_0x5b4158),_0x5b4158['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x3711af);});}this['_hasExactlyOneSource']=0x1===_0x555839['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x2f0f6c,_0x5b53d8){this['_urlInputView']=new AIChatContextPanelUrlInputView(_0x5b53d8),this['_urlInputView']['on']('submitUrl',(_0xf225c1,_0x10c9e0)=>{this['_handleUrlSubmit'](_0x10c9e0);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Hn}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Hn});}),_0x2f0f6c['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x309db5,_0x1d231b){const _0x3b108e='source'===_0x1d231b['type']?new SourcesBalloonButtonView(_0x309db5):new yt(_0x309db5);return _0x3b108e['set']({'label':_0x1d231b['label'],'icon':_0x1d231b['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':yn}),_0x3b108e;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){jt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x1d38e2){const _0x3a2982=this['_addContextBalloonConfig'];_0x3a2982['buttonView']['isOn']=_0x1d38e2,_0x1d38e2?_0x3a2982['balloonView']['show']():_0x3a2982['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x1e0ee5,buttonView:_0x3386f6,hideMethod:_0x4df288}=this['_addContextBalloonConfig'];jt({'emitter':_0x1e0ee5,'contextElements':[_0x1e0ee5['element'],_0x3386f6['element']],'callback':()=>{_0x4df288();},'activator':()=>_0x3386f6['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x5a3148,_0x1fc110,_0xd7f35b=!0x1,_0x2af6a4=!0x1){const _0x21bb2f='conversation'===_0x1fc110||!0x0===_0x5a3148['isReadOnly'],_0x4ea59e=new AIChatContextItemButtonView(this['locale'],_0x5a3148,_0x21bb2f,_0xd7f35b,_0x2af6a4);return _0x21bb2f||_0x4ea59e['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x4ea59e['id']);}),_0x4ea59e;}['_addContextToCollection'](_0x408220,_0x12c3d6){_0x12c3d6['add'](_0x408220,0x0);}['_removeContextFromCollection'](_0x21940d,_0x156441){const _0x5c11b5=_0x156441['find'](_0x33fd49=>_0x33fd49['id']===_0x21940d);_0x5c11b5&&_0x156441['remove'](_0x5c11b5);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Hn}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x10d44a){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x10d44a);}}class SourcesBalloonButtonView extends yt{['arrowView'];constructor(_0x23191a){super(_0x23191a),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Nn]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x464d61=new Lt();return _0x464d61['content']=_0x18437f,_0x464d61['extendTemplate']({'attributes':{'class':Nn+'__arrow'}}),_0x464d61;}}class AIChatControlsLoaderView extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x2ee8c9){super(_0x2ee8c9),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_loaderView']=this['_createLoaderView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-loader-wrapper','ck-reset_all']},'children':[this['_loaderView'],this['_cancelButtonView']]});}['_createCancelButtonView'](){const _0x14d7b5=new yt(this['locale']);return _0x14d7b5['set']({'label':Mi(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':Bi+'\x20ck-ai-button-stop-generating','icon':_0x31e237}),_0x14d7b5['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x14d7b5;}['_createLoaderView'](){const _0x1ee3ec=new Nt(this['locale']);return _0x1ee3ec['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':Mi(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x1ee3ec;}}class AIChatControlsView extends Nt{['_contextPanelView'];['_promptInputView'];['_dropZoneView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];['_filesEnabled'];constructor(_0x51909b,_0x4adfea){super(_0x51909b),this['_filesEnabled']=_0x4adfea['filesEnabled'],this['_contextPanelView']=this['_createContextPanelView'](_0x51909b,{'bodyCollection':_0x4adfea['bodyCollection'],'searchInputVisibleFrom':_0x4adfea['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x51909b),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x51909b),this['_loaderView']=this['_createLoaderView'](_0x51909b),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x51909b),this['_dropZoneView']=new AIChatDropZoneView(_0x51909b),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage','promptInputPaste')['to'](this),this['_dropZoneView']['delegate']('promptInputPaste')['to'](this),this['_dropZoneView']['on']('dragEnter',()=>this['_contextPanelView']['hideAllBalloons']()),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...Rn)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x2ed019=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x2ed019['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x2ed019['if']('isLoading','ck-hidden',_0x23a5b3=>_0x23a5b3||!this['isModelAvailable']),_0x2ed019['if']('isModelAvailable','ck-hidden',_0x2a9e7e=>!_0x2a9e7e||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x2ed019['if']('isLoading','ck-hidden',_0x1e2a4e=>!_0x1e2a4e)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x2ed019['if']('isModelAvailable','ck-hidden',_0x4c32dc=>_0x4c32dc)]},'children':[this['_modelUnavailableMessageView']]},this['_dropZoneView']]}),jt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['render'](){super['render'](),this['_filesEnabled']&&this['_dropZoneView']['attach'](this['element']);}['_createContextPanelView'](_0xf955f4,_0x5739ee){return new AIChatContextPanelView(_0xf955f4,_0x5739ee);}['_createPromptInputView'](_0x3fd952){return new AIChatPromptInputView(_0x3fd952,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x271e70){return new AIChatPromptCapabilitiesView(_0x271e70);}['_createLoaderView'](_0x311da5){return new AIChatControlsLoaderView(_0x311da5);}['_createModelUnavailableMessageView'](_0x20a1b7){const _0x2e4c30=new AIChatModelUnavailableMessageView(_0x20a1b7);return _0x2e4c30['delegate']('startConversation')['to'](this),_0x2e4c30;}['_handlePromptInputFocus'](_0x136f64,_0x5b24c2,_0x3ac2cf){_0x3ac2cf?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1fc54e,_0x3523e4){this['_contextPanelView']['addContextItem'](_0x1fc54e,_0x3523e4);}['removeContextItem'](_0x9889b2){this['_contextPanelView']['removeContextItem'](_0x9889b2);}['setContextItemLoading'](_0x4e49c3,_0x3db288){this['_contextPanelView']['setContextItemLoading'](_0x4e49c3,_0x3db288);}['setIsUploadInProgress'](_0x14b96c){this['_promptInputView']['setIsUploadInProgress'](_0x14b96c);}['setConversationContext'](_0x529dcf){this['_contextPanelView']['setConversationContext'](_0x529dcf);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x780dde,_0x50edc1,_0x3992e6){this['_contextPanelView']['updateResourceState'](_0x780dde,_0x50edc1,_0x3992e6);}['setWebSearch'](_0x5b1422){this['_promptCapabilitiesView']['setWebSearch'](_0x5b1422);}['setReasoning'](_0x1bca94){this['_promptCapabilitiesView']['setReasoning'](_0x1bca94);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x46f8f7){this['_contextPanelView']['setAddContextOptions'](_0x46f8f7);}['setInputPlaceholder'](_0x39545e){this['_promptInputView']['setPlaceholderText'](_0x39545e);}['setModelList'](_0x1fb2b6,_0x45c530){this['_promptCapabilitiesView']['setModelList'](_0x1fb2b6,_0x45c530);}['setModel'](_0x585745){_0x585745?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x585745)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x590677){this['_promptCapabilitiesView']['disableModelSelector'](_0x590677);}['populateSourceResourceBalloon'](_0x1a57e0,_0x2f1da9,_0x5ce0e7,_0x17a8b9){this['_contextPanelView']['populateSourceResourceBalloon'](_0x1a57e0,_0x2f1da9,_0x5ce0e7,_0x17a8b9);}['closeSourceResourceBalloon'](_0x346abd){this['_contextPanelView']['closeSourceResourceBalloon'](_0x346abd);}['focusPromptInput'](_0x5272fc=!0x1){this['_promptInputView']['focus'](_0x5272fc);}['setPromptInputValue'](_0x1a3710){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x1a3710;}}class AIChatModelUnavailableMessageView extends Nt{constructor(_0x5a4569){super(_0x5a4569);const _0x44b6dc=new yt(_0x5a4569);_0x44b6dc['set']({'label':Mi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x44b6dc['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':Mi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x44b6dc]}]});}}class AIHeaderView extends _0x4b60f6{['resizeButton'];constructor(_0xb7b5b4,_0x17a72a){super(_0xb7b5b4,{'label':_0x17a72a['label'],'class':'ck-ai-header\x20'+_0x17a72a['class'],'icon':_0x17a72a['icon']}),this['set']('isMaximized',!0x1),_0x17a72a['content']&&this['children']['add'](_0x17a72a['content']),_0x17a72a['showResizeButton']&&(this['resizeButton']=Fi(_0xb7b5b4,this),this['children']['add'](this['resizeButton']));}}class AIDisclaimerView extends Nt{constructor(_0x2df072){super(_0x2df072),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Mi(_0x2df072,'AI_DISCLAIMER_TEXT')}]}]});}}function Mn(_0x4056a6,_0x3782e6){const _0x2dd5f8=new yt(_0x4056a6);return _0x2dd5f8['set']({'label':Mi(_0x4056a6,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1124a6,'class':'ck-ai-chat__start-conversation\x20'+Bi}),_0x2dd5f8['on']('execute',()=>{_0x3782e6['fire']('startConversation');}),_0x2dd5f8;}class AIChatView extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x497187,_0x4fc3f7){super(_0x497187),this['_bodyCollection']=new Xt(_0x497187),this['_bodyCollection']['attachToDom']();const _0x2fa30e=Mn(_0x497187,this);this['chatHeader']=new AIHeaderView(_0x497187,{'label':Mi(_0x497187,'AI_CHAT_HEADING'),'icon':_0x30386c,'class':'ck-ai-header_chat','content':_0x2fa30e,'showResizeButton':_0x4fc3f7['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new AIChatFeedView(_0x497187,this['_bodyCollection']),this['chatFeed']['delegate'](...Ss)['to'](this),this['chatControls']=new AIChatControlsView(_0x497187,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x4fc3f7['contextResourcesSearchInputVisibleFrom'],'filesEnabled':_0x4fc3f7['filesEnabled']}),this['chatControls']['delegate'](...Ss)['to'](this),this['chatDisclaimer']=new AIDisclaimerView(_0x497187),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x497187['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x1f597d,_0x167732,_0x26c1e8,_0x656f9d){this['chatControls']['populateSourceResourceBalloon'](_0x1f597d,_0x167732,_0x26c1e8,_0x656f9d);}['closeSourceResourceBalloon'](_0x20fdf6){this['chatControls']['closeSourceResourceBalloon'](_0x20fdf6);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class AIChatUI extends _0x5df7d5{static get['requires'](){return[AITabs];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x40d7c6){super(_0x40d7c6);const _0x5417bc=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue(),this['_view']=new AIChatView(this['context']['locale'],{'showResizeButton':_0x5417bc['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled')}),this['_view']['delegate']('resizeTabs')['to'](_0x5417bc),this['_view']['delegate'](...Ss)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x1e1db0,{showDiff:_0x322bf2})=>{this['showDiff']=_0x322bf2;}),this['disableControls'](),_0x5417bc['view']['addTab']({'id':'chat','buttonLabel':Mi(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x30386c,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x5417bc['view'],'isMaximized',_0x52f4b3=>_0x52f4b3),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x41a6b5=>_0x41a6b5),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x3f2663){const _0x50f520=this['context']['config']['get']('ai.chat.welcomeMessage')??Mi(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x3f2663['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x50f520}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x1a49db,staticMessage:_0x26f547}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1a49db,'initialContent':'<p>'+_0x26f547+'</p>'});});}async['addFeedItemUserMessage'](_0x327e55){const _0x4fc772=_0x327e55['attributes']?.['displayedPrompt']||_0x327e55['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x327e55['contextItems']['values']()),'initialContent':'<p>'+_0x4fc772+'</p>','id':_0x327e55['id']});});}async['addFeedItemError']({errorMessage:_0x5c27ba,id:_0x13c2a9}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x5c27ba+'</p>','id':_0x13c2a9});});}async['addFeedItemAIReply'](_0x100364){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x100364['interactionId']+':'+_0x100364['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x3efa42){const _0x1f1c4c=Cs(this['context']),_0x1190d4=_0x1f1c4c['map'](_0x13f36c=>_0x13f36c['config']['get']('ai.availableReplyActions')||[...Ps]);let _0x3cbf29=_0x1190d4['reduce']((_0x29f8c0,_0x2cb08b)=>_0x29f8c0['filter'](_0x250ec8=>_0x2cb08b['includes'](_0x250ec8)),_0x1190d4[0x0]||[...Ps]);const _0xda959=_0x1f1c4c['every'](_0x301e4c=>_0x301e4c['plugins']['has']('TrackChanges')),_0x4ad9e8=_0x1f1c4c['map'](_0x13c1a8=>_0x13c1a8['commands']['get']('trackChanges'));return _0xda959?this['_isTrackChangesCommandValueBound']||(this['_isTrackChangesCommandValueBound']=!0x0,this['_view']['chatFeed']['bind']('isTrackChangesOn')['toMany'](_0x4ad9e8,'value',(..._0x3dc647)=>_0x3dc647['some'](_0x103821=>_0x103821))):_0x3cbf29=_0x3cbf29['filter'](_0x2bf9e6=>'insertSuggestion'!=_0x2bf9e6),this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x3efa42['interactionId']+':'+_0x3efa42['id'],'areActionsDisabled':_0x3efa42['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x3cbf29}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x56e8cc,_0xff1eda){return this['_promiseQueue']['enqueue'](async()=>{const _0x4c78c6=this['_view']['chatFeed']['children']['last'];if(_0x4c78c6 instanceof AIChatFeedInteractionHeaderView)return this['_view']['chatFeed']['children']['remove'](_0x4c78c6),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x56e8cc['id'],'capabilities':{'isWebSearchEnabled':_0x4c78c6['capabilities']['isWebSearchEnabled']||_0xff1eda['isWebSearchEnabled'],'isReasoningEnabled':_0x4c78c6['capabilities']['isReasoningEnabled']||_0xff1eda['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x56e8cc['id'],'capabilities':_0xff1eda});});}async['addFeedItemCustomElement'](_0x45e9c7,_0x24988f){let _0x509461;return await this['_promiseQueue']['enqueue'](async()=>{_0x509461=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x45e9c7,'id':_0x24988f});}),_0x509461;}['removeFeedItem'](_0x2c677e){this['_view']['chatFeed']['removeItem'](_0x2c677e);}['hasFeedItem'](_0x131fdf){return this['_view']['chatFeed']['hasItem'](_0x131fdf);}['updateFeedInteractionHeader'](_0x113922){const _0x356a6d=this['_view']['chatFeed']['children']['find'](_0x3e0f17=>_0x3e0f17['options']['id']==_0x113922['id']&&_0x3e0f17 instanceof AIChatFeedInteractionHeaderView);_0x356a6d&&_0x356a6d['set']('isVisible',_0x113922['isVisible']);}async['updateFeedItemAIReplyContent'](_0x5e0f27){const _0x18461e=_0x5e0f27['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x284bcf=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x5e0f27,'abortSignal':_0x284bcf,'renderingStrategy':_0x18461e}),_0x5e0f27['isDone']&&this['markFeedItemAsDone'](_0x5e0f27['id']);});}['updateFeedItemAIReplySources'](_0x5a5d3c,_0x52992d){this['_view']['chatFeed']['updateWebSources'](_0x5a5d3c,_0x52992d);}async['updateFeedItemAIReplySuggestionContent'](_0xcfd9bf){return this['_promiseQueue']['enqueue'](async _0x32fb01=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0xcfd9bf,'abortSignal':_0x32fb01}),_0xcfd9bf['isDone']&&this['markFeedItemAsDone'](_0xcfd9bf['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x55025b){this['_view']['chatFeed']['updateSuggestionPartState'](_0x55025b);}['setFeedItemAIReplySuggestionPartActive'](_0x444750){this['_view']['chatFeed']['setSuggestionPartActive'](_0x444750);}['markFeedItemAsDone'](_0x2dca){this['_view']['chatFeed']['markItemAsDone'](_0x2dca);}['removeFeedInteraction'](_0x4107ee){this['_view']['chatFeed']['getItemIds']()['filter'](_0x5bcebf=>_0x5bcebf['startsWith'](_0x4107ee))['forEach'](_0x293f7f=>this['_view']['chatFeed']['removeItem'](_0x293f7f));}['startInteraction'](){const _0x3ef58a=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x3ef58a),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x14181c){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x2bc5a9=>_0x2bc5a9['startsWith'](_0x14181c['id']))['forEach'](_0x136094=>this['markFeedItemAsDone'](_0x136094)),this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x16b37d,_0x480920){this['_view']['chatControls']['addContextItem'](_0x16b37d,_0x480920);}['removeContextItem'](_0x315577){this['_view']['chatControls']['removeContextItem'](_0x315577);}['setContextItemLoading'](_0xf57ec3,_0x3516d3){this['_view']['chatControls']['setContextItemLoading'](_0xf57ec3,_0x3516d3);}['setIsUploadInProgress'](_0x2339d8){this['_view']['chatControls']['setIsUploadInProgress'](_0x2339d8);}['setConversationContext'](_0x50787b){this['_view']['chatControls']['setConversationContext'](_0x50787b);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x12b3fc,_0x53815c,_0x590434){this['_view']['chatControls']['updateResourceState'](_0x12b3fc,_0x53815c,_0x590434);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x130bd1){this['_view']['chatControls']['setAddContextOptions'](_0x130bd1);}['updateCapabilities'](_0x1facd2){this['_view']['chatControls']['setWebSearch'](_0x1facd2['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x1facd2['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x1facd2));}['setSelectedModel'](_0x3e2984,_0x2a3f9b){this['_view']['chatControls']['setModel'](_0x3e2984),_0x2a3f9b&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x1c9121){this['feedItemRenderingStrategy']=_0x1c9121;}['toggleLoadingSkeleton'](_0x872c89){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x872c89);}['resetConversationTitle'](){this['setConversationTitle'](Mi(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0xae17dc,_0x1e90a8=!0x1){if(_0x1e90a8&&!St()&&_0xae17dc['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0xae17dc);this['_view']['chatHeader']['label']=_0xae17dc;}['setLoadingMessage'](_0x3b087b){this['_view']['chatFeed']['setLoadingMessage'](_0x3b087b);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x30ba6b){let _0x7d0855=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x30ba6b[_0x7d0855],_0x7d0855++,_0x7d0855===_0x30ba6b['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x5a40bf){return _0x5a40bf['isWebSearchEnabled']&&_0x5a40bf['isReasoningEnabled']?Mi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x5a40bf['isWebSearchEnabled']?Mi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x5a40bf['isReasoningEnabled']?Mi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Mi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x493a7a){return _0x493a7a?_0x493a7a['isWebSearchEnabled']&&_0x493a7a['isReasoningEnabled']?Mi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x493a7a['isWebSearchEnabled']?Mi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x493a7a['isReasoningEnabled']?Mi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Mi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Mi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x4a0892,_0xb536d1,_0x1103e6,_0xedfa5f){this['_view']['populateSourceResourceBalloon'](_0x4a0892,_0xb536d1,_0x1103e6,_0xedfa5f);}['closeSourceResourceBalloon'](_0x51685b){this['_view']['closeSourceResourceBalloon'](_0x51685b);}['setPromptInputValue'](_0x2a21e1){this['_view']['chatControls']['setPromptInputValue'](_0x2a21e1);}['focusPromptInput'](_0x719241=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x719241);}['scrollFeedToSuggestion'](_0x2709d9,_0x3beaf1){this['_view']['chatFeed']['scrollToSuggestion'](_0x2709d9,_0x3beaf1);}['startAutoScroll'](_0x1ee97a={}){this['_view']['chatFeed']['startAutoScroll'](_0x1ee97a);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class AIChatHistorySectionListView extends Dt{['sections'];constructor(_0x542771,_0x4582b7){super(_0x542771),this['sections']=_0x4582b7,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x453b32){let _0x4c9111=0x0,_0x5d9bf3=0x0;for(const _0x3b033f of this['sections']){const {resultsCount:_0x2e76a9,totalItemsCount:_0x294dff}=_0x3b033f['filter'](_0x453b32);_0x4c9111+=_0x2e76a9,_0x5d9bf3+=_0x294dff;}return{'resultsCount':_0x4c9111,'totalItemsCount':_0x5d9bf3};}}class AIChatHistoryListView extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x48eab0,{title:_0x7539f5,items:_0x54cb79}){super(_0x48eab0);const _0x175159=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x7539f5,this['itemsViews']=_0x54cb79;const _0x37140b=new Nt(_0x48eab0);_0x37140b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x48eab0),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x175159['if']('isVisible','ck-hidden',_0x349e8e=>!_0x349e8e)]},'children':[_0x37140b,this['_itemsListView']]});}['filter'](_0x14ba32){const _0x53817a=this['itemsViews']['length'];let _0x91b993=0x0;for(const _0x2ea0a6 of this['itemsViews']){if(_0x14ba32){const _0x2b7e60=_0x2ea0a6['isMatching'](_0x14ba32);_0x2ea0a6['isVisible']=!!_0x2b7e60,_0x2ea0a6['highlightText'](_0x14ba32);}else _0x2ea0a6['isVisible']=!0x0,_0x2ea0a6['highlightText'](null);_0x2ea0a6['isVisible']&&_0x91b993++;}return this['isVisible']=_0x91b993>0x0,{'resultsCount':_0x91b993,'totalItemsCount':_0x53817a};}['getItem'](_0x524684){return this['itemsViews']['find'](_0x533844=>_0x533844['id']===_0x524684);}['removeItem'](_0x31eb2f){const _0x28c4f7=this['itemsViews']['indexOf'](_0x31eb2f);-0x1!==_0x28c4f7&&(this['itemsViews']['splice'](_0x28c4f7,0x1),this['_itemsListView']['items']['remove'](_0x31eb2f));}}class AIChatHistoryListItemView extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x33a8bd(Ht){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x48fb65,_0x54d10b){super(_0x48fb65);const _0x1e1511=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x54d10b['pinned']),this['set']('loadingState',null),this['set']('title',_0x54d10b['title']),this['id']=_0x54d10b['id'];const {createdAt:_0x5e0229,active:_0x4153e9=!0x1}=_0x54d10b;this['_titleView']=new _0x4a420c(),this['_titleView']['bind']('text')['to'](this,'title'),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x49c321=this['_createCheckView'](),_0x22ec4e=this['_createPinButtonView'](_0x48fb65),_0x18f61c=this['_createMenuDropdownView'](),_0x57481b=this['_createEditInputView'](_0x48fb65),_0xf27e5=this['_createAcceptEditButtonView'](_0x48fb65,_0x57481b),_0x5bcfcd=this['_createCancelEditButtonView'](_0x48fb65);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x22ec4e),this['actions']['add'](_0x18f61c),this['on']('change:isEdit',(_0x365499,_0x47ada4,_0x49d4f2)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x49d4f2?(this['actions']['add'](_0xf27e5),this['actions']['add'](_0x5bcfcd),this['mainContent']['add'](_0x57481b),_0x57481b['element']['value']=this['title']||'',_0x57481b['element']['focus']()):(this['actions']['add'](_0x22ec4e),this['actions']['add'](_0x18f61c),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x4153e9?'ck-ai-chat-history__item--active':'',_0x1e1511['if']('isVisible','ck-hidden',_0x42a5c2=>!_0x42a5c2),_0x1e1511['if']('isEdit','ck-ai-chat-history__item--edit')],'role':'listitem'},'children':[{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-check-container']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-check',_0x1e1511['if']('loadingState','ck-hidden',_0x4cced1=>!!_0x4cced1)]},'children':_0x4153e9?[_0x49c321]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x1e1511['if']('loadingState','ck-hidden',_0xba582a=>!_0xba582a)]},'children':[this['_createSpinnerView']()]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-row']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-content']},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-title-container',_0x1e1511['if']('loadingState','ck-hidden',_0x3b2d1c=>!!_0x3b2d1c)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x1e1511['if']('loadingState','ck-hidden',_0x5080f9=>!_0x5080f9)]},'children':[{'text':_0x1e1511['to']('loadingState',_0x2610e1=>_0x2610e1?Mi(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x2610e1]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x5e0229]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-actions']},'children':this['actions']}]}]}),this['on']('click',()=>{this['isEdit']||this['fire']('selectConversation',{'id':this['id']});});}['updateTitle'](_0x4a9967){this['set']('title',_0x4a9967);}['updateLoadingState'](_0x3b11de,_0x1151fd){this['set']('loadingState',_0x1151fd?_0x3b11de:null);}['_createCheckView'](){const _0x119773=new Lt();return _0x119773['set']({'content':_0x6eb847}),_0x119773;}['_createPinButtonView'](_0x3b453c){const _0x2d1ffa=new yt(_0x3b453c);return _0x2d1ffa['set']({'label':Mi(_0x3b453c,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x446b2f,'withText':!0x1,'tooltip':!0x0}),_0x2d1ffa['bind']('isOn')['to'](this,'pinned'),_0x2d1ffa['on']('execute',()=>{const _0x31f7ad=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x31f7ad});}),_0x2d1ffa;}['_createMenuDropdownView'](){const _0x4bf17d=Ft(this['locale']),_0x1f0693=_0x4bf17d['panelView']['children'];_0x4bf17d['buttonView']['set']({'label':Mi(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x3e0877}),_0x4bf17d['panelPosition']='sw';const _0x4f4269=new yt(this['locale']);_0x4f4269['label']=Mi(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x4f4269['withText']=!0x0,_0x4f4269['on']('execute',()=>{this['isEdit']=!0x0;});const _0x2ff2e2=new yt(this['locale']);_0x2ff2e2['label']=Mi(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x2ff2e2['withText']=!0x0,_0x2ff2e2['on']('execute',()=>{this['showConfirm'](Mi(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x4d57cd=new Dt(this['locale']),_0x2a846d=new Ht(this['locale']);_0x2a846d['children']['add'](_0x4f4269);const _0xb088c0=new Ht(this['locale']);return _0xb088c0['children']['add'](_0x2ff2e2),_0x4d57cd['items']['addMany']([_0x2a846d,_0xb088c0]),_0x1f0693['add'](_0x4d57cd),_0x4bf17d;}['_createEditInputView'](_0x215eaf){const _0x5d1f21=new _0x33d8c7(_0x215eaf),_0x5702e0=_0x5d1f21['bindTemplate'];return _0x5d1f21['extendTemplate']({'on':{'keydown':_0x5702e0['to'](_0x38b968=>{'Enter'==_0x38b968['key']&&this['_commitEditInputValue'](_0x5d1f21);})}}),_0x5d1f21;}['_createAcceptEditButtonView'](_0x224fdd,_0x1c3f0c){const _0x500bf1=new yt(_0x224fdd);return _0x500bf1['set']({'icon':_0x6eb847,'withText':!0x1,'tooltip':Mi(_0x224fdd,'AI_CHAT_HISTORY_ACCEPT')}),_0x500bf1['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x500bf1['on']('execute',()=>{this['_commitEditInputValue'](_0x1c3f0c);}),_0x500bf1;}['_commitEditInputValue'](_0x103b2c){const _0x24610d=_0x103b2c['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x24610d});}['_createCancelEditButtonView'](_0x1560ba){const _0x9d8caa=new yt(_0x1560ba);return _0x9d8caa['set']({'icon':_0x5e45e9,'withText':!0x1,'tooltip':Mi(_0x1560ba,'AI_CHAT_HISTORY_CANCEL')}),_0x9d8caa['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x9d8caa['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x9d8caa;}['_createSpinnerView'](){const _0x4b9bb7=new AISpinnerView('tiny');return _0x4b9bb7['isVisible']=!0x0,_0x4b9bb7;}['isMatching'](_0x3f73cd){return'string'==typeof this['title']&&this['title']['match'](_0x3f73cd)?{'title':!0x0}:null;}['highlightText'](_0x1afdbf){this['_titleView']['highlightText'](_0x1afdbf);}}class AIChatHistoryView extends Nt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x564815,_0x292464){super(_0x564815),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x428a7c=Mn(_0x564815,this);this['headerView']=new AIHeaderView(_0x564815,{'label':Mi(_0x564815,'AI_CHAT_HISTORY_HEADING'),'icon':_0x203cca,'class':'ck-ai-header_history','content':_0x428a7c,'showResizeButton':_0x292464}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new AIChatHistorySectionListView(_0x564815,[]),this['sectionsView']['delegate'](...Un)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x29a14d=>!_0x29a14d)]}}),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[this['headerView'],{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x4229a8=new _0x58cc04(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Mi(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x4c85df=>Mi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x4c85df),'secondary':Mi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x190cba=this['_createErrorView']();return _0x190cba['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x314b25=>!_0x314b25)]}}),_0x4229a8['on']('render',()=>{_0x4229a8['children']['add'](_0x190cba,0x1);}),_0x4229a8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x365560=>!_0x365560)]}}),_0x4229a8;}['_createSkeletonView'](){const _0xc5ad59=new AISkeletonView(this['locale'],xs['aiHistory']);return _0xc5ad59['bind']('isVisible')['to'](this,'isLoading'),_0xc5ad59;}['_createErrorView'](){const _0x1719d9=new Nt(this['locale']),_0x53f2b3=new yt(this['locale']);_0x53f2b3['set']({'withText':!0x1,'icon':_0x5e45e9,'class':'ck-ai-notification_error__dismiss-button'}),_0x53f2b3['bind']('isVisible')['to'](this,'hasItems',_0x3e194c=>!!_0x3e194c),_0x53f2b3['on']('execute',()=>{this['errorMessage']='';});const _0x256628=this['bindTemplate'];return _0x1719d9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x256628['to']('errorMessage')}]},_0x53f2b3]}),_0x1719d9;}['_createEmptyStateView'](){const _0x439ae2=new Nt(this['locale']);return _0x439ae2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3bc7c4=>!_0x3bc7c4)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Mi(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x439ae2;}['_createListItemViews'](_0x1515c8,_0x490446){const _0xbde8e4=[];for(const _0x11f278 of _0x1515c8){const _0xd5d522=new AIChatHistoryListItemView(_0x490446,_0x11f278);_0xd5d522['delegate'](...Un)['to'](this),_0xbde8e4['push'](_0xd5d522);}return _0xbde8e4;}['updateHistoryItemsWithCategories'](_0x10b4a8){const _0x405052=this['locale']||'en',_0x438f5f=[];for(const _0x222950 of _0x10b4a8){const _0x5cb04d=this['_createListItemViews'](_0x222950['items'],_0x405052);_0x438f5f['push'](new AIChatHistoryListView(_0x405052,{'title':_0x222950['title'],'items':_0x5cb04d}));}this['sectionsView']['sections']=_0x438f5f,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x438f5f),this['hasItems']=_0x10b4a8['some'](_0x2905fd=>_0x2905fd['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x485159){for(const _0x43d4fb of this['sectionsView']['sections']){const _0x2c5f91=_0x43d4fb['getItem'](_0x485159);if(_0x2c5f91){if(_0x43d4fb['removeItem'](_0x2c5f91),0x0===_0x43d4fb['itemsViews']['length']){const _0x307b5f=this['sectionsView']['sections']['indexOf'](_0x43d4fb);-0x1!==_0x307b5f&&(this['sectionsView']['sections']['splice'](_0x307b5f,0x1),this['sectionsView']['items']['remove'](_0x43d4fb));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x15cb16,_0x1057f6){for(const _0x32ccf7 of this['sectionsView']['sections']){const _0x56bf90=_0x32ccf7['getItem'](_0x15cb16);if(_0x56bf90){_0x56bf90['updateTitle'](_0x1057f6);break;}}}['updateItemLoadingState'](_0x18e05d,_0xd15387,_0x5b6970){for(const _0xfcfafa of this['sectionsView']['sections']){const _0x374a87=_0xfcfafa['getItem'](_0x18e05d);if(_0x374a87){_0x374a87['updateLoadingState'](_0xd15387,_0x5b6970);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x523ee6=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x523ee6);}}}const Un=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class AIChatHistoryUI extends _0x5df7d5{static get['requires'](){return[AITabs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa5f029){super(_0xa5f029);const _0x1cb125=this['context']['plugins']['get']('AITabs');this['_historyView']=new AIChatHistoryView(this['context']['locale'],_0x1cb125['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x1cb125),this['_historyView']['delegate'](...Un)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x1cb125['view'],'isMaximized',_0x2abdfb=>_0x2abdfb),_0x1cb125['view']['addTab']({'id':'history','buttonLabel':Mi(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x203cca,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x1f3923){this['_historyView']['removeHistoryItem'](_0x1f3923);}['updateItems'](_0x485739){this['_historyView']['updateHistoryItemsWithCategories'](_0x485739);}['updateItemTitle'](_0x240f13,_0xbb90be){this['_historyView']['updateItemTitle'](_0x240f13,_0xbb90be);}['updateItemLoadingState'](_0x599959,_0x4b6296,_0x28a0aa){this['_historyView']['updateItemLoadingState'](_0x599959,_0x4b6296,_0x28a0aa);}['setLoadingSkeleton'](_0x400eb1){this['_historyView']['isLoading']=_0x400eb1;}['showError'](_0x8ea021){this['_historyView']['errorMessage']=_0x8ea021;}['hideError'](){this['_historyView']['errorMessage']='';}}class AIChatHistoryItem extends ct(){['id'];['createdAt'];constructor({id:_0x2a1f2c,title:_0x506a78,createdAt:_0x59d2d1,updatedAt:_0x4c59a0,pinned:_0x5096ed}){super(),this['id']=_0x2a1f2c,this['createdAt']=new Date(_0x59d2d1),this['set']('title',_0x506a78),this['set']('updatedAt',_0x4c59a0?new Date(_0x4c59a0):null),this['set']('pinned',_0x5096ed||!0x1);}['updateTitle'](_0x17a18a){this['set']('title',_0x17a18a),this['updatedAt']=new Date();}['updatePinned'](_0x2d1277){this['set']('pinned',_0x2d1277),this['updatedAt']=new Date();}}class AIChatHistoryConversations extends Et(){['items']=[];['connector'];['group'];constructor({connector:_0x40b246,group:_0xe4b296}){super(),this['connector']=_0x40b246,this['group']=_0xe4b296;}async['init'](){try{const _0x43b198=this['connector']['fetchConversations'](this['group']),_0x4503b8=await _0x43b198['getConversations']();this['loadItems'](_0x4503b8);}catch(_0x10e640){this['fire']('error',{'error':_0x10e640,'operation':'init'});}}['addItem'](_0x4ce5aa){this['items']['push'](_0x4ce5aa);}async['removeItem'](_0x5be720){const _0x11a5db=this['items']['findIndex'](_0x5d07de=>_0x5d07de['id']===_0x5be720);if(-0x1===_0x11a5db)return!0x1;try{return await this['connector']['deleteConversation'](_0x5be720)['execute'](),this['items']['splice'](_0x11a5db,0x1),this['fire']('itemRemoved',{'itemId':_0x5be720}),!0x0;}catch(_0x3b90d8){return this['fire']('error',{'error':_0x3b90d8,'operation':'removeItem','itemId':_0x5be720}),!0x1;}}['getItem'](_0x4bb579){return this['items']['find'](_0x196d47=>_0x196d47['id']===_0x4bb579);}async['updateItemTitle'](_0x51af05,_0x34d9f9){const _0x571d1a=this['getItem'](_0x51af05);if(!_0x571d1a)return!0x1;try{return await this['connector']['updateConversation'](_0x51af05,{'title':_0x34d9f9})['getResult'](),_0x571d1a['updateTitle'](_0x34d9f9),this['fire']('itemUpdated',{'itemId':_0x51af05,'updates':{'title':_0x34d9f9}}),!0x0;}catch(_0x5784fc){return this['fire']('error',{'error':_0x5784fc,'operation':'updateItemTitle','itemId':_0x51af05}),!0x1;}}async['updateItemPinned'](_0x3d0456,_0x466e49){const _0x51a07e=this['getItem'](_0x3d0456);if(!_0x51a07e)return!0x1;try{return await this['connector']['updateConversation'](_0x3d0456,{'pinned':_0x466e49})['getResult'](),_0x51a07e['updatePinned'](_0x466e49),this['fire']('itemUpdated',{'itemId':_0x3d0456,'updates':{'pinned':_0x466e49}}),!0x0;}catch(_0x20c5ee){return this['fire']('error',{'error':_0x20c5ee,'operation':'updateItemPinned','itemId':_0x3d0456}),!0x1;}}['loadItems'](_0x425ee4){try{this['items']=[],_0x425ee4['map'](_0x5eacdf=>{this['addItem'](new AIChatHistoryItem(_0x5eacdf));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x2beb51){this['fire']('error',{'error':_0x2beb51,'operation':'loadItems'});}}['getItems'](_0x4db2c5={}){const _0x23bf52=void 0x0!==_0x4db2c5['pinned']&&_0x4db2c5['pinned'],_0x58e0ab=_0x4db2c5['from']?new Date(_0x4db2c5['from']['getFullYear'](),_0x4db2c5['from']['getMonth'](),_0x4db2c5['from']['getDate']()):null,_0x1a81d8=_0x4db2c5['to']?new Date(_0x4db2c5['to']['getFullYear'](),_0x4db2c5['to']['getMonth'](),_0x4db2c5['to']['getDate']()):null;return this['items']['filter'](_0x2f24c8=>{if(_0x2f24c8['pinned']!==_0x23bf52)return!0x1;if(_0x1a81d8){const _0x47da13=new Date(_0x2f24c8['createdAt']['getFullYear'](),_0x2f24c8['createdAt']['getMonth'](),_0x2f24c8['createdAt']['getDate']());return _0x58e0ab?_0x58e0ab['getTime']()===_0x1a81d8['getTime']()?_0x47da13['getTime']()===_0x58e0ab['getTime']():_0x47da13<_0x1a81d8&&_0x47da13>=_0x58e0ab:_0x47da13<_0x1a81d8;}return!0x0;});}}class AIChatHistoryController extends _0x5df7d5{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[AIConnector,AIChatController,AIChatHistoryUI,AITabs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](AIConnector),this['_aiChatHistoryUi']=this['context']['plugins']['get'](AIChatHistoryUI),this['_aiChatController']=this['context']['plugins']['get'](AIChatController);const _0x3c8dd2=this['context']['plugins']['get'](AITabs);try{const _0x515a31=this['_aiChatController']['getGroupId']();this['history']=new AIChatHistoryConversations({'connector':this['_aiConnector'],'group':_0x515a31}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x3cda2a,_0x5a973b)=>{this['_setItemLoading'](_0x5a973b['id'],'remove'),this['_handleRemove'](_0x5a973b['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x432a2e,_0x562f1e)=>{this['_setItemLoading'](_0x562f1e['id'],'rename'),this['_handleEditTitle'](_0x562f1e['id'],_0x562f1e['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x1d32a3,_0xffab58)=>{void 0x0!==_0xffab58['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xffab58['itemId'],_0xffab58['updates']['title']),void 0x0!==_0xffab58['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xffab58['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x10505a,_0x3e7803)=>{this['_aiChatController']['_handleRemovedConversation'](_0x3e7803['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x3e7803['itemId']),this['_clearItemLoading'](_0x3e7803['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x23cc4b,_0x158c1b)=>{this['_handleHistoryErrorUI'](_0x158c1b['error'],_0x158c1b['operation'],_0x158c1b['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x1eb750,_0x45e5d0)=>{this['_handleSelectConversation'](_0x45e5d0['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x52276b,_0x257fff)=>{const _0x142686=_0x257fff['pinned']?'pin':'unpin';this['_setItemLoading'](_0x257fff['id'],_0x142686),this['_handleTogglePin'](_0x257fff['id'],_0x257fff['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x3c8dd2['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x3c8dd2['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x883108){this['_handleHistoryErrorUI'](_0x883108,'init');}}async['_handleEditTitle'](_0x104166,_0x3fc921){await this['history']['updateItemTitle'](_0x104166,_0x3fc921);}async['_handleTogglePin'](_0x18bdc0,_0x3c6e1c){await this['history']['updateItemPinned'](_0x18bdc0,_0x3c6e1c);}async['_handleRemove'](_0x1328df){await this['history']['removeItem'](_0x1328df);}async['_handleSelectConversation'](_0x53e2aa){await this['_aiChatController']['loadConversation'](_0x53e2aa);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0xebdee7=this['_aiChatController']['activeConversation']?.['id'],_0xe2c736=this['_getCategorizedItems']()['map'](_0x2b89b2=>({'title':_0x2b89b2['title'],'items':_0x2b89b2['items']['map'](_0x4ee5db=>({'id':_0x4ee5db['id'],'title':_0x4ee5db['title']||Mi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x4ee5db['createdAt'])['toLocaleDateString'](),'active':_0x4ee5db['id']===_0xebdee7,'pinned':_0x4ee5db['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0xe2c736);}['_setItemLoading'](_0x101af4,_0x10c108){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x101af4,_0x10c108,!0x0);}['_clearItemLoading'](_0x17684b){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x17684b,null,!0x1);}['_handleHistoryErrorUI'](_0x2e3c0b,_0x1b7db3,_0x28c2b2){const _0x30e475=this['_generateErrorMessage'](_0x1b7db3,_0x28c2b2);this['_aiChatHistoryUi']['showError'](_0x30e475),_0x28c2b2&&this['_clearItemLoading'](_0x28c2b2),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x13ec6b,_0x219881){const _0xed0eb2=_0x219881?this['history']['getItem'](_0x219881):null,_0x19b089=_0xed0eb2?.['title']||Mi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x13ec6b){case'updateItemTitle':return Mi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x19b089);case'updateItemPinned':{const _0x33b128=Mi(this['context']['locale'],_0xed0eb2?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Mi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x33b128,_0x19b089]);}case'removeItem':return Mi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x19b089);case'init':case'loadItems':return Mi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Mi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x1a72bf=new Date(),_0x1f1ccb=new Date(_0x1a72bf['getFullYear'](),_0x1a72bf['getMonth'](),_0x1a72bf['getDate']()),_0x583799=new Date(_0x1f1ccb);_0x583799['setDate'](_0x583799['getDate']()-0x1);const _0x1d8cd6=new Date(_0x1f1ccb);_0x1d8cd6['setDate'](_0x1d8cd6['getDate']()-0xe);const _0x484ed3=this['history']['getItems']({'pinned':!0x0}),_0x56998d=this['history']['getItems']({'from':_0x1f1ccb,'to':_0x1f1ccb}),_0x46e0e6=this['history']['getItems']({'from':_0x583799,'to':_0x583799}),_0x1588be=this['history']['getItems']({'from':_0x1d8cd6,'to':_0x583799}),_0x11ea5b=this['history']['getItems']({'to':_0x1d8cd6}),_0x63cb30=[];return _0x484ed3['length']>0x0&&_0x63cb30['push']({'title':Mi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x484ed3}),_0x56998d['length']>0x0&&_0x63cb30['push']({'title':Mi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x56998d}),_0x46e0e6['length']>0x0&&_0x63cb30['push']({'title':Mi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x46e0e6}),_0x1588be['length']>0x0&&_0x63cb30['push']({'title':Mi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1588be}),_0x11ea5b['length']>0x0&&_0x63cb30['push']({'title':Mi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x11ea5b}),_0x63cb30;}}class AIChatHistory extends _0x5df7d5{static get['requires'](){return[AIChatHistoryController,AIChatHistoryUI];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AIChat extends _0x5df7d5{static get['requires'](){return[AIChatController,AIEditing,AIChatUI,AIChatHistory];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3ce04a){super(_0x3ce04a),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1,'paste':{'textThreshold':0x5dc}}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class AIChatShortcutView extends yt{['id'];constructor(_0x2a25d2,_0xfb5a72){super(_0x2a25d2);const {id:_0x32dba9,type:_0x4796bb,icon:_0x8d1b29}=_0xfb5a72;this['id']=_0x32dba9,this['set']({'label':_0xfb5a72['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0xfb5a72['id']}}),_0x8d1b29?this['icon']=_0x8d1b29:'chat'===_0x4796bb?this['icon']=_0x30386c:'review'===_0x4796bb?this['icon']=_0x46396f:'translate'===_0x4796bb&&(this['icon']=_0x5a7bff);}}class AIChatShortcutsView extends Nt{['listView'];constructor(_0x511491,_0xa7e2dd){super(_0x511491),this['set']('isEnabled',!0x0);const _0x463a45=_0xa7e2dd['map'](_0x42cbc2=>{const _0x3fd535=new Ht(this['locale']),_0x4f7ba9=new AIChatShortcutView(this['locale'],_0x42cbc2);return _0x4f7ba9['bind']('isEnabled')['to'](this),_0x3fd535['children']['add'](_0x4f7ba9),_0x4f7ba9['delegate']('execute')['to'](this),_0x3fd535;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x463a45),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Bn='chat-shortcuts';class AIChatShortcuts extends _0x5df7d5{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];['_listenedConversation'];static get['requires'](){return[AIChatUI];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](AIChatUI),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0xc5d00c=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{const _0x1bc744=_0xc5d00c['activeConversation'];_0x1bc744['isFromHistory']||this['_injectShortcuts'](_0x1bc744);}),this['listenTo'](_0xc5d00c,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x43e172=['chat','review','translate'];this['_shortcuts']['forEach'](_0x3d6b24=>{let _0x52bb8d=!0x0;if(_0x3d6b24['id']&&_0x3d6b24['label']&&_0x43e172['includes'](_0x3d6b24['type'])?'chat'===_0x3d6b24['type']&&(_0x52bb8d='string'==typeof _0x3d6b24['prompt']):_0x52bb8d=!0x1,!_0x52bb8d)throw new ht('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x3d6b24});});}['_injectShortcuts'](_0x379e4e){this['_removeShortcuts'](),this['_shortcutsView']=new AIChatShortcutsView(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),this['_aiChatUI']['addFeedItemCustomElement'](this['_shortcutsView']['element'],Bn),this['_shortcutsView']['on']('execute',_0x10e193=>{const _0x3aa073=_0x10e193['source']['id'];this['_executeShortcut'](_0x3aa073);}),this['_listenedConversation']=_0x379e4e,this['listenTo'](_0x379e4e,'uploadProgressChanged',(_0xf065ea,_0x458534)=>{this['_shortcutsView']['isEnabled']=!_0x458534['isUploadInProgress'];});}['_removeShortcuts'](){const _0x443f4d=this['context']['plugins']['get'](AIChatUI);_0x443f4d['hasFeedItem'](Bn)&&_0x443f4d['removeFeedItem'](Bn),this['_listenedConversation']&&(this['stopListening'](this['_listenedConversation'],'uploadProgressChanged'),this['_listenedConversation']=void 0x0),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x69a67a){const _0x428177=this['_shortcuts']['find'](_0x3f0043=>_0x3f0043['id']===_0x69a67a),_0x697769=_0x428177['type'];'chat'===_0x697769?this['_runChatShortcut'](_0x428177):'review'===_0x697769?_0x428177['commandId']?this['_runReviewShortcut'](_0x428177):this['_switchTab']('reviewMode'):'translate'===_0x697769&&(_0x428177['language']?this['_runTranslateShortcut'](_0x428177):this['_switchTab']('translate'));}['_switchTab'](_0x18f086){if(!this['context']['plugins']['has']('AITabs'))throw new ht('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x18f086});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x18f086);}async['_runChatShortcut']({prompt:_0x1b4f01,draftMode:_0x3feba7,useWebSearch:_0x1cf326=!0x1,useReasoning:_0x191791=!0x1,model:_0x835e51}){const _0x41edfa=this['context']['plugins']['get']('AIChatController'),_0x38841c=_0x41edfa['activeConversation'];let _0x202c25;_0x202c25=_0x835e51?await _0x38841c['chatModels']['getModel'](_0x835e51):await _0x38841c['chatModels']['getDefault'](),_0x202c25&&await _0x38841c['setModel'](_0x202c25),_0x38841c['setWebSearch'](_0x1cf326),_0x38841c['setReasoning'](_0x191791),_0x41edfa['addCurrentDocumentToChatContext'](),_0x3feba7?(this['_aiChatUI']['setPromptInputValue'](_0x1b4f01),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x41edfa['sendMessage']({'message':_0x1b4f01});}['_runReviewShortcut']({commandId:_0x4f735e,model:_0x18ec2a,prompt:_0x1df2cc,params:_0xd3e74d}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ht('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x17c457={'id':_0x4f735e,'isCustom':'custom'===_0x4f735e};_0x18ec2a&&_0x1df2cc&&(_0x17c457['args']={'model':_0x18ec2a,'prompt':_0x1df2cc}),_0xd3e74d&&(_0x17c457['params']=_0xd3e74d),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x17c457);}['_runTranslateShortcut']({language:_0x1f5460}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ht('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x1f5460,'args':{'language':_0x1f5460}});}}class ToggleAICommand extends _0x350c41{constructor(_0x41c61e){super(_0x41c61e);const _0x5bf6d8=_0x41c61e['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x5bf6d8,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x5964c3=this['editor']['plugins']['get']('AITabs')['view'];_0x5964c3['isVisible']=!_0x5964c3['isVisible'];}}class AIToggleButtonUI extends _0x364f72{static get['requires'](){return[AITabs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x30f66a=this['editor'];_0x30f66a['commands']['add']('toggleAi',new ToggleAICommand(_0x30f66a)),_0x30f66a['ui']['componentFactory']['add']('toggleAi',()=>{const _0x29e2ca=this['_createAIUIButton'](yt);return _0x29e2ca['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x29e2ca;}),_0x30f66a['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x5d0968=this['_createAIUIButton'](Yt);return _0x5d0968['set']({'role':'menuitemcheckbox'}),_0x5d0968;});}['_createAIUIButton'](_0x172d1c){const _0x44a667=this['editor'],_0x29b110=_0x44a667['commands']['get']('toggleAi'),_0x28d860=new _0x172d1c(_0x44a667['locale']);return _0x28d860['set']({'label':Mi(_0x44a667['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x28a9e0,'isToggleable':!0x0}),_0x28d860['bind']('isEnabled')['to'](_0x29b110),_0x28d860['bind']('isOn')['to'](_0x29b110,'value',_0x194280=>!!_0x194280),this['listenTo'](_0x28d860,'execute',()=>{_0x29b110['execute']();}),_0x28d860;}}const Gn=['applySuggestion','insertSuggestion','showNext','showPrevious'];class AIBalloonView extends Nt{['_errorView'];constructor(_0x999510){super(_0x999510),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x58ce90){this['showError'](_0x58ce90);}['showError'](_0x227f1f){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x227f1f,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x54fbd2=new Nt(this['locale']),_0x21fe0e=new Nt(this['locale']);return _0x21fe0e['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x54fbd2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x18941c=>!_0x18941c)]},'children':[_0x21fe0e]}),_0x54fbd2;}}const Fn=0xa;class AIBalloon extends _0x5df7d5{static get['requires'](){return[AIEditing];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_editor'];['_isUpdatingMarkers']=!0x1;['open'](_0x43c998){const {id:_0x573e01}=this['_currentConfig']??{};this['_currentConfig']=_0x43c998,this['_editor']=_0x43c998['targetEditor'];const {id:_0x1e1264}=this['_currentConfig'];this['isOpen']&&_0x573e01===_0x1e1264?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x1180bc=this['_editor'];if(!_0x1180bc)return;const _0x10a8b9=_0x1180bc['plugins']['get']('Dialog');_0x10a8b9['isOpen']&&this['_currentConfig']&&_0x10a8b9['id']===this['_currentConfig']['id']&&_0x10a8b9['hide']();}['_updateDialog'](){const _0x1ee593=this['_editor']['plugins']['get']('Dialog'),{icon:_0xbabd50,title:_0x1c5570}=this['_currentConfig'];_0x1ee593['view']?.['headerView']&&(_0x1ee593['view']['headerView']['label']=_0x1c5570,_0x1ee593['view']['headerView']['iconView']&&_0xbabd50&&(_0x1ee593['view']['headerView']['iconView']['content']=_0xbabd50)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x1ee593['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['showFakeVisualSelection']({'editor':this['_editor'],'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x4a1774=this['_editor']['plugins']['get']('Dialog'),{id:_0x202afe,title:_0x1c4685,icon:_0x1d45d2,class:_0x2cdf2f,mainView:_0x507385}=this['_currentConfig'];_0x507385['delegate'](...Gn)['to'](this),_0x4a1774['show']({'title':_0x1c4685,'icon':_0x1d45d2,'hasCloseButton':!0x0,'id':_0x202afe,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x2cdf2f||''),'content':_0x507385,'onShow':_0x2e6072=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x2e6072['view']?.['updatePosition']();const _0x95b4c3=this['_getSelectionElements']();_0x95b4c3&&_0x95b4c3[0x0]&&Tt({'target':_0x95b4c3[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x2e6072['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x202afe});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x202afe}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x2c42b8,_0x23e83f){if(!_0x23e83f){const _0x38cde6=this['_getTargetRootDomRect']();if(!_0x38cde6)return null;_0x23e83f=_0x38cde6;}const _0x3de97a=this['_getSelectionElements']();if(!_0x3de97a||0x0===_0x3de97a['length'])return{'left':Math['round'](_0x23e83f['left']+_0x23e83f['width']/0x2-_0x2c42b8['width']/0x2),'top':Math['round'](_0x23e83f['top']+_0x23e83f['height']/0x2-_0x2c42b8['height']/0x2)};const _0x18e27a=Math['round'](_0x23e83f['left']+_0x23e83f['width']/0x2-_0x2c42b8['width']/0x2),_0x3fb598=_0x3de97a['map'](_0xef3ba8=>new dt(_0xef3ba8)),_0x1c1397=_0x2c42b8['height'];return{'left':_0x18e27a,'top':this['_calculateOptimalTopPosition'](_0x3fb598,_0x1c1397,_0x23e83f)};}['_calculateOptimalTopPosition'](_0x59c170,_0x4c5696,_0x2d5e6e){const _0x23441e=new dt(lt['window']),_0x478491=_0x59c170['map'](_0x250066=>_0x250066['getVisible']())['filter'](_0x53e05b=>_0x53e05b),_0x1a2f31=dt['getBoundingRect'](_0x478491);if(!_0x1a2f31)return Math['round'](_0x2d5e6e['top']+_0x2d5e6e['height']/0x2);const _0x14440e=_0x23441e['getIntersection'](_0x1a2f31);if(!_0x14440e)return Math['round'](_0x2d5e6e['top']+_0x2d5e6e['height']/0x2);const _0x18b299=_0x2d5e6e['getVisible'](),_0xf9eeb3=_0x18b299&&_0x1a2f31['height']>_0x18b299['height'],_0x50bfca=_0x14440e['top'],_0x1c789b=_0x14440e['bottom'];if(_0xf9eeb3){const _0x53a443=(_0x18b299||_0x23441e)['height']/0x2-_0x4c5696/0x2,_0x4757da=_0x50bfca-Fn-_0x2d5e6e['top'],_0xdae202=_0x2d5e6e['bottom']-_0x1c789b-Fn;return _0x4757da>=_0x4c5696?Math['max'](Fn,_0x50bfca-_0x4c5696-Fn):_0xdae202>=_0x4c5696?_0x1c789b+Fn:Math['max'](Fn,_0x53a443);}const _0x40a421=_0x50bfca-_0x4c5696,_0x317a10=_0x2d5e6e['bottom']-_0x1c789b-Fn,_0x505ba0=_0x50bfca-Fn-_0x2d5e6e['top'];let _0x122684;if(_0x317a10>=_0x4c5696)_0x122684=_0x1c789b+Fn;else{if(_0x505ba0>=_0x4c5696)_0x122684=_0x40a421-Fn;else _0x122684=_0x50bfca+_0x1a2f31['height']/0x2-_0x4c5696/0x2;}return _0x122684;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x423fb6=this['_editor'];this['listenTo'](_0x423fb6['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x52d50c,data:{newRange:_0x1659f5}}of _0x423fb6['model']['document']['differ']['getChangedMarkers']())if(_0x52d50c['startsWith'](fs+':')&&(_0x1659f5&&(_0x1659f5['start']['isEqual'](_0x1659f5['end'])||'$graveyard'==_0x1659f5['root']['rootName'])||null==_0x1659f5)){const _0x395882=Mi(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x395882),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x4c4821=this['_editor'];this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x4c4821['model']['document']);}['_getSelectionElements'](){const _0x2ddc6e=this['_editor'];return _0x2968b2(_0x2ddc6e['editing'],[..._0x2ddc6e['model']['markers']['getMarkersGroup']('ai-selection'),..._0x2ddc6e['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x46485a=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x46485a)return null;const _0x5d4401=this['_editor'],_0x1f1e05=_0x5d4401['editing']['view']['document']['getRoot'](_0x46485a['rootName']);if(!_0x1f1e05)return null;const _0x4dfb16=_0x5d4401['editing']['view']['domConverter']['mapViewToDom'](_0x1f1e05);return _0x4dfb16&&_0x4dfb16 instanceof HTMLElement?new dt(_0x4dfb16):null;}}class AIMiniToolbarView extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x427669,_0x2e7dd4={}){super(_0x427669),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x2e7dd4};const _0x53e689=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x53e689?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x3c1bac){this['showChangesButton']['isEnabled']=_0x3c1bac;}['_setupRatingButtons'](){this['likeButton']=new yt(this['locale']),this['likeButton']['set']({'icon':_0x58e688,'label':Mi(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':Gi,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new yt(this['locale']),this['dislikeButton']['set']({'icon':_0xe618d1,'label':Mi(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':Gi,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new yt(this['locale']),this['copyButton']['set']({'icon':_0x5279a3,'label':Mi(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+Gi,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x2fc4f3=new Lt();_0x2fc4f3['set']({'content':_0x6eb847}),_0x2fc4f3['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied\x20'+Gi,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+Gi;},0x7d0);}),this['copyButton']['children']['add'](_0x2fc4f3);}['_setupShowChangesButton'](){this['showChangesButton']=new yt(this['locale']),this['showChangesButton']['set']({'icon':_0x1fd0e8,'label':Mi(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':Gi}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x2b894d=>_0x2b894d?_0x48f0d9:_0x1fd0e8),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class AIChatBalloonView extends AIBalloonView{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x5e6241,_0x3891d5){super(_0x5e6241);const _0x263078=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new It(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x3891d5,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x5e6241),this['_partToolbarView']=new AISuggestionContentPartToolbarView(_0x5e6241,_0x3891d5['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x3891d5),this['_stateView']=new AISuggestionContentPartStateView(_0x5e6241),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new AIMiniToolbarView(_0x5e6241,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new AIChatBalloonToolbarContainerView(_0x5e6241,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x20efc9,_0x31ba1f,_0x413ff8,_0x14ab13)=>{let _0x4b4b70,_0x1ef500;'pending'===_0x14ab13?(_0x4b4b70=this['_partToolbarView'],_0x1ef500=this['_stateView']):(_0x4b4b70=this['_stateView'],_0x1ef500=this['_partToolbarView']),this['_stateView']['setState'](_0x413ff8),_0x4b4b70['isVisible']=!0x1,_0x1ef500['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x263078['to']('_state',_0x395377=>'ck-ai-chat-balloon-main_state_'+_0x395377)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x3891d5);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x3432df){_0x3432df?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x3432df);}['clearContent'](){this['_streamableContentView']['clear']();}['setState'](_0x333b17){this['_state']=_0x333b17;}['showError'](_0x5e3434){super['showError'](_0x5e3434),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x59ac77){super['showBlockingError'](_0x59ac77),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0xfec881){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0xfec881;}['togglePartToolbarEnabled'](_0x438458){this['_partToolbarView']['isEnabled']=_0x438458;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x14cc1a,showSuggestButton:_0xe9375b}){_0x14cc1a=_0x14cc1a&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0xe9375b=_0xe9375b&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x14cc1a,'showSuggestButton':_0xe9375b});}['_createNextButtonView'](){const _0x24f63d=new yt(this['locale']);return _0x24f63d['set']({'icon':_0x474e6a,'label':Mi(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x24f63d['on']('execute',()=>{this['fire']('showNext');}),_0x24f63d;}['_createPreviousButtonView'](){const _0x1303d4=new yt(this['locale']);return _0x1303d4['set']({'icon':_0x4c28c4,'label':Mi(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x1303d4['on']('execute',()=>{this['fire']('showPrevious');}),_0x1303d4;}}class AIChatBalloonToolbarContainerView extends Nt{constructor(_0x32f363,_0x2ee1cf){super(_0x32f363),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x2ee1cf});}}class AIChatBalloon extends _0x364f72{static get['requires'](){return[Gt,AIBalloon];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x599c9c){super(_0x599c9c),this['set']('showDiff',!0x1);}['open'](_0x5f4cd8){const _0x1424e7=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x1424e7['plugins']['get']('AIBalloon')['open']({..._0x5f4cd8,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x5f4cd8['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x5f4cd8['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x5097e7){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x5097e7);}['clearContent'](){this['_chatBalloonView']&&this['_chatBalloonView']['clearContent']();}['setState'](_0x503011){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x503011);}['_createChatBalloonView'](){const _0x312ac2=this['editor'],_0x2db4bc=_0x312ac2['plugins']['get']('AIBalloon'),_0x159ecc=_0x312ac2['commands']['get']('trackChanges');let _0x1cf6cf=_0x312ac2['config']['get']('ai.availableReplyActions')||[...Ps];_0x312ac2['plugins']['has']('TrackChanges')||(_0x1cf6cf=_0x1cf6cf['filter'](_0x5e3708=>'insertSuggestion'!=_0x5e3708));const _0x18284a=new AIChatBalloonView(_0x312ac2['locale'],{'availableActions':_0x1cf6cf,'showApplyButton':!0x0,'showSuggestButton':!!_0x159ecc});return _0x18284a['bind']('showDiff')['to'](this),_0x18284a['delegate'](...bs)['to'](this),_0x18284a['delegate']('showPrevious','showNext')['to'](this),_0x2db4bc['delegate']('dialogClosed')['to'](this),_0x18284a['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x18284a['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x18284a['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x159ecc&&_0x18284a['bind']('isTrackChangesOn')['to'](_0x159ecc,'value'),_0x18284a['render'](),_0x18284a;}['_toggleRotatorButtonsInDialogHeader'](_0x2deb66){const _0x2e620b=this['editor'],_0x10b937=_0x2e620b['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x2deb66),_0x10b937['has'](this['_chatBalloonView']['previousButtonView'])||(_0x10b937['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x2e620b['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x10b937['remove'](this['_chatBalloonView']['previousButtonView']),_0x10b937['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class AIEditorIntegration extends _0x364f72{static get['requires'](){return[AIToggleButtonUI,AIChatBalloon,_0x100f2e];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Wn(_0x2199df){const {editor:_0x203b4c,action:_0x404a2c,withText:_0x5a7eb6=!0x1,withIcon:_0x594c11=!0x0,isInDropdown:_0x42b871=!0x0,shouldPreventFocus:_0xe5b9a=!0x1,actionButtons:_0x5b43fe}=_0x2199df;return()=>{const _0x51229f=_0x203b4c['locale'],_0x50c40b=new yt(_0x51229f),_0x329fe6=_0x50c40b['bindTemplate'];_0x42b871&&_0x50c40b['extendTemplate']({'on':{'mouseenter':_0x329fe6['to'](()=>{_0xe5b9a&&_0xe5b9a()||_0x50c40b['focus']();})}}),_0x5b43fe['push']({'buttonView':_0x50c40b,'action':_0x404a2c});const _0xf0e888=_0x404a2c['icon']??_0x404a2c['parent']?.['icon'];return _0x50c40b['set']({'label':_0x404a2c['label'],'withText':_0x5a7eb6,'role':'menuitem','icon':_0x594c11?_0xf0e888??_0x353ca0:void 0x0,'tooltip':!_0x5a7eb6,'class':'ck-ai-quick-actions-button','isEnabled':_0x404a2c['isEnabled']}),_0x50c40b['on']('execute',()=>{_0x203b4c['editing']['view']['focus'](),_0x203b4c['commands']['execute']('aiQuickAction',_0x404a2c);}),_0x50c40b;};}class DropdownMenuButtonWithHighlightView extends _0x5395ce{['arrowView'];constructor(_0x10c4fa,_0x401ee5){super(_0x10c4fa,_0x401ee5);const _0x107329=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x32a5c9=>String(_0x32a5c9)),'data-cke-tooltip-disabled':_0x107329['to']('isOn')},'on':{'mouseenter':_0x107329['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x450e1d=new Lt();return _0x450e1d['content']=_0x18437f,_0x450e1d['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x450e1d;}}class AIQuickActionsFilteredListView extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0xdf7eb9,_0x330a46,_0x3e2f39){super(_0xdf7eb9),this['_allListItems']=_0x330a46,this['_allSearchableItems']=_0x3e2f39;}['filter'](_0x3f2315){if(!_0x3f2315)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x5ee689=_0x3f2315['source']['toLowerCase']()['trim'](),_0x5c7a6a=this['_allSearchableItems']['filter'](_0x2600bb=>(_0x2600bb['groupLabel']?_0x2600bb['label']+'\x20('+_0x2600bb['groupLabel']+')':_0x2600bb['label'])['toLowerCase']()['includes'](_0x5ee689));return this['items']['clear'](),this['items']['addMany'](_0x5c7a6a['sort']((_0x4f7f9e,_0x54bdc4)=>{const _0x309b06=_0x4f7f9e['groupLabel'],_0x227f9f=_0x54bdc4['groupLabel'];return _0x309b06||_0x227f9f?_0x309b06?0x1:-0x1:0x0;})['map'](_0x5f104e=>_0x5f104e['item'])),this['_highlightQuery'](_0x5ee689,_0x5c7a6a),{'resultsCount':_0x5c7a6a['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x5841f2,_0x17efb6){if(!_0x5841f2)return;const _0x1e59fc=new RegExp(_0x3d3c69(_0x5841f2),'gi');_0x17efb6['forEach'](_0xef8e8d=>{_0xef8e8d['highlightViews']&&_0xef8e8d['highlightViews']['forEach'](_0xbfee15=>{'function'==typeof _0xbfee15['highlightText']&&_0xbfee15['highlightText'](_0x1e59fc);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0xa778c4=>{_0xa778c4['highlightViews']&&_0xa778c4['highlightViews']['forEach'](_0x324233=>{'function'==typeof _0x324233['highlightText']&&_0x324233['highlightText'](null);});});}}const Kn='menu',Yn='menuitem';class AIQuickActionsDropdownContentView extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];['_actionButtons'];constructor(_0x11062a,_0x3796a8,_0x1b56a8,_0x4ed224,_0x188a37=!0x1,_0x472513=[]){const _0x49e661=_0x11062a['locale'];super(_0x49e661),this['_bodyCollection']=_0x4ed224,this['_hasSearch']=_0x188a37,this['_actionButtons']=_0x472513;const _0x4b7621=this['_createListItems'](_0x11062a,_0x3796a8,_0x1b56a8);this['optionsListView']=new AIQuickActionsFilteredListView(_0x49e661,_0x4b7621,this['_allSearchableItems']),this['optionsListView']['role']=Kn,this['optionsListView']['items']['addMany'](_0x4b7621),this['focusTracker']=new It(),this['keystrokes']=new At(),_0x188a37&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x4b7621,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x188a37&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x8c590=_0x188a37&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x461da8(_0x8c590),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x49e661['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x58cc04(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':Mi(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':Mi(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x1ef3d0=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x1ef3d0);}['_createListItems'](_0x238b8a,_0x48ac99,_0x2f5aeb){const _0x434143=new _0x461da8();return _0x48ac99['forEach'](_0x595928=>{if('actions'in _0x595928){const {listItem:_0x14eb37}=this['_createActionGroupButton'](_0x238b8a,_0x595928,_0x2f5aeb);_0x434143['add'](_0x14eb37),_0x595928['actions']['forEach'](_0xc110b4=>{const {listItem:_0x1c7346,highlightViews:_0x2e2cce}=this['_createSearchResultActionButton'](_0x238b8a,_0xc110b4,_0x595928['label'],_0x595928['icon']);this['_allSearchableItems']['push']({'item':_0x1c7346,'label':_0xc110b4['label'],'groupLabel':_0x595928['label'],'highlightViews':_0x2e2cce});});}else{const {listItem:_0x257746}=this['_createActionButton'](_0x238b8a,_0x595928);_0x434143['add'](_0x257746);const _0xa5f182=_0x257746['children']['first'];if(_0xa5f182){const {listItem:_0x2bb7a1,highlightViews:_0x1b106a}=this['_createSearchResultActionButton'](_0x238b8a,_0x595928);this['_allSearchableItems']['push']({'item':_0x2bb7a1,'label':_0xa5f182['label']||'','highlightViews':_0x1b106a});}}}),_0x434143;}['_createActionButton'](_0x2ebfeb,_0x1a4de6,_0x303a48,_0x1bce4b){const _0x35e752=new Ht(this['locale']);if(_0x303a48&&_0x1bce4b){const _0x28cd54=new yt(this['locale']),_0x33be4f=_0x28cd54['bindTemplate'],_0x3cdb45=new _0x4a420c();_0x3cdb45['text']=_0x1a4de6['label'];const _0x1b2fee=new _0x4a420c();_0x1b2fee['text']=_0x303a48;const _0x1db247=new Lt();_0x1db247['content']=_0x1bce4b,_0x1db247['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x251c7a=new Nt(this['locale']);_0x251c7a['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x47287e=new Nt(this['locale']);return _0x47287e['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x28cd54['set']({'label':_0x1a4de6['label']+'\x20('+_0x303a48+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1,'isEnabled':_0x1a4de6['isEnabled']}),_0x28cd54['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group',_0x33be4f['if']('isEnabled','ck-disabled',_0x54434a=>!_0x54434a)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x3cdb45,_0x251c7a,_0x1db247,_0x1b2fee,_0x47287e],'on':{'mouseenter':_0x33be4f['to'](()=>{this['_isSearchFocused']()||_0x28cd54['focus']();}),'click':_0x33be4f['to'](()=>{_0x28cd54['fire']('execute');})}}),_0x28cd54['on']('execute',()=>{_0x28cd54['isEnabled']&&(_0x2ebfeb['editing']['view']['focus'](),_0x2ebfeb['commands']['execute']('aiQuickAction',_0x1a4de6));}),_0x35e752['children']['add'](_0x28cd54),this['_actionButtons']['push']({'buttonView':_0x28cd54,'action':_0x1a4de6}),{'listItem':_0x35e752,'highlightViews':[_0x3cdb45,_0x1b2fee]};}{const _0x3c392c=new _0x11fa77(),_0x509608=new yt(this['locale'],_0x3c392c),_0x23e6c0=_0x509608['bindTemplate'],_0x797ca2=_0x1a4de6['icon']??_0x1a4de6['parent']?.['icon'],_0x50c7b1=void 0x0!==_0x1a4de6['icon'];return _0x509608['set']({'label':_0x1a4de6['label'],'withText':!0x0,'role':'menuitem','icon':_0x50c7b1?_0x797ca2??_0x353ca0:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button','isEnabled':_0x1a4de6['isEnabled']}),_0x509608['extendTemplate']({'on':{'mouseenter':_0x23e6c0['to'](()=>{this['_isSearchFocused']()||_0x509608['focus']();})}}),_0x509608['on']('execute',()=>{_0x2ebfeb['editing']['view']['focus'](),_0x2ebfeb['commands']['execute']('aiQuickAction',_0x1a4de6);}),_0x35e752['children']['add'](_0x509608),this['_actionButtons']['push']({'buttonView':_0x509608,'action':_0x1a4de6}),{'listItem':_0x35e752,'highlightViews':[_0x3c392c]};}}['_createSearchResultActionButton'](_0x513e81,_0x50a485,_0x55630e,_0x24e7df){return _0x55630e&&_0x24e7df?this['_createSearchResultGroupedActionButton'](_0x513e81,_0x50a485,_0x55630e,_0x24e7df):this['_createSearchResultIndividualActionButton'](_0x513e81,_0x50a485);}['_createSearchResultGroupedActionButton'](_0x742bff,_0x51ba43,_0x2de846,_0x44edc8){const _0x53ce8a=new Ht(this['locale']),_0x41a239=new yt(this['locale']),_0x22a020=_0x41a239['bindTemplate'],{view:_0x1c37e6,highlightView:_0x2f2b0f}=this['_createSearchResultGroupRow'](_0x2de846,_0x44edc8),{view:_0x7072e0,highlightView:_0x5d6518}=this['_createSearchResultActionRow'](_0x51ba43['label']),_0x54e5e0=this['_createSearchResultContentView'](_0x1c37e6,_0x7072e0);return _0x41a239['set']({'label':_0x51ba43['label'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1,'isEnabled':_0x51ba43['isEnabled']}),_0x41a239['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group',_0x22a020['if']('isEnabled','ck-disabled',_0x5e12c0=>!_0x5e12c0)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x54e5e0],'on':{'mouseenter':_0x22a020['to'](()=>{this['_isSearchFocused']()||_0x41a239['focus']();}),'click':_0x22a020['to'](()=>{this['_handleSearchResultButtonClick'](_0x41a239);})}}),this['_setupActionButtonExecution'](_0x41a239,_0x742bff,_0x51ba43),_0x53ce8a['children']['add'](_0x41a239),this['_actionButtons']['push']({'buttonView':_0x41a239,'action':_0x51ba43}),{'listItem':_0x53ce8a,'highlightViews':[_0x2f2b0f,_0x5d6518]};}['_createSearchResultIndividualActionButton'](_0x3f8848,_0xc10578){const _0x51afd1=new Ht(this['locale']),_0x28c332=new _0x11fa77(),_0x2bc169=new yt(this['locale'],_0x28c332),_0x374615=_0x2bc169['bindTemplate'];return _0x2bc169['set']({'label':_0xc10578['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button','isEnabled':_0xc10578['isEnabled']}),_0x2bc169['extendTemplate']({'on':{'mouseenter':_0x374615['to'](()=>{this['_isSearchFocused']()||_0x2bc169['focus']();})}}),this['_setupActionButtonExecution'](_0x2bc169,_0x3f8848,_0xc10578),_0x51afd1['children']['add'](_0x2bc169),this['_actionButtons']['push']({'buttonView':_0x2bc169,'action':_0xc10578}),{'listItem':_0x51afd1,'highlightViews':[_0x28c332]};}['_createSearchResultGroupRow'](_0x16755a,_0x33e749){const _0x2a7d2a=new Nt(this['locale']),_0xe89d1e=new Lt();_0xe89d1e['content']=_0x33e749,_0xe89d1e['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5038f5=new _0x4a420c();return _0x5038f5['text']=_0x16755a,_0x2a7d2a['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0xe89d1e,_0x5038f5]}),{'view':_0x2a7d2a,'highlightView':_0x5038f5};}['_createSearchResultActionRow'](_0x105e67){const _0xbeb248=new Nt(this['locale']),_0x26e308=new _0x4a420c();return _0x26e308['text']=_0x105e67,_0xbeb248['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x26e308]}),{'view':_0xbeb248,'highlightView':_0x26e308};}['_createSearchResultContentView'](_0xf95586,_0x4434c1){const _0x41a175=new Nt(this['locale']);return _0x41a175['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0xf95586,_0x4434c1]}),_0x41a175;}['_setupActionButtonExecution'](_0x106fb1,_0x3612d8,_0x46da51){_0x106fb1['on']('execute',()=>{_0x106fb1['isEnabled']&&(_0x3612d8['editing']['view']['focus'](),_0x3612d8['commands']['execute']('aiQuickAction',_0x46da51));});}['_createActionGroupButton'](_0xe89ce4,_0x1a93d8,_0x5a3d64){const _0x204552=new Ht(this['locale']),_0x3e5b84=new _0x11fa77(),_0x591cd2=new DropdownMenuButtonWithHighlightView(this['locale'],_0x3e5b84),_0x293792=_0x591cd2['bindTemplate'],_0x911fbc=this['_getPanelKeystroke'](_0x5a3d64),_0x20cf1a=this['_createGroupActionsList'](_0xe89ce4,_0x1a93d8['actions'],_0x5a3d64);_0x591cd2['set']({'label':_0x1a93d8['label'],'withText':!0x0,'role':Yn,'icon':_0x1a93d8['icon']??_0x353ca0,'isEnabled':_0x1a93d8['actions']['some'](_0x2c199f=>_0x2c199f['isEnabled'])}),_0x591cd2['extendTemplate']({'on':{'mouseenter':_0x293792['to'](()=>{this['_isSearchFocused']()||_0x591cd2['focus']();})}});const _0x59b1e2=new zt(this['locale']);return _0x59b1e2['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x293792['to'](_0x54bf97=>{this['_handlePanelKeydown'](_0x54bf97,_0x911fbc,_0x591cd2,_0x59b1e2);})}}),_0x591cd2['bind']('isOn')['to'](_0x59b1e2,'isVisible'),this['_bodyCollection']['add'](_0x59b1e2),_0x59b1e2['content']['add'](_0x20cf1a),this['_setupGroupMenuBehavior'](_0x591cd2,_0x59b1e2),_0x204552['children']['add'](_0x591cd2),this['_actionButtons']['push']({'buttonView':_0x591cd2,'action':_0x1a93d8}),{'listItem':_0x204552,'highlightView':_0x3e5b84};}['_createGroupActionsList'](_0x4b5352,_0x1f3934,_0x2acfbe){const _0x3cc6f1=new Dt(this['locale']);return _0x3cc6f1['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x1f3934['forEach'](_0x1959db=>{const _0x16ba16=new Ht(this['locale']),_0x2aaccd=Wn({'editor':_0x4b5352,'action':_0x1959db,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused'](),'actionButtons':this['_actionButtons']})();_0x16ba16['children']['add'](_0x2aaccd),_0x2acfbe['focusTracker']['add'](_0x2aaccd),_0x3cc6f1['items']['add'](_0x16ba16);}),_0x3cc6f1;}['_setupGroupMenuBehavior'](_0x3037cd,_0x15d120){const _0x1aa0f1=_0x3037cd['bindTemplate'],_0x12b26e=this['_getButtonKeystroke'](_0x3037cd);_0x3037cd['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x1aa0f1['to'](()=>{this['_showNestedPanel'](_0x15d120,_0x3037cd);}),'mouseleave':_0x1aa0f1['to'](_0x3f898d=>{const _0x210f75=_0x3f898d['relatedTarget'];this['_isMovingToNestedMenu'](_0x210f75,_0x15d120)||this['_hideNestedPanel'](_0x15d120);}),'keydown':_0x1aa0f1['to'](_0x2894ed=>{_0x2894ed['key']==_0x12b26e&&(this['_showNestedPanel'](_0x15d120,_0x3037cd),_0x15d120['content']['get'](0x0)['focus']());})}}),_0x15d120['on']('render',()=>{_0x15d120['element']?.['addEventListener']('mouseleave',_0x15505e=>{const _0x4107b1=_0x15505e['relatedTarget'];_0x3037cd['element']?.['contains'](_0x4107b1)||this['_isMovingToNestedMenu'](_0x4107b1,_0x15d120)||this['_hideNestedPanel'](_0x15d120);});});}['_showNestedPanel'](_0x179040,_0x37a861){this['_openNestedPanels']['forEach'](_0xb081b=>{_0xb081b!==_0x179040&&_0xb081b['isVisible']&&_0xb081b['hide']();}),_0x179040['show'](),_0x179040['pin']({'positions':[_0x253202['eastSouth']],'target':_0x37a861['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x179040);}['_hideNestedPanel'](_0x1f7c94){_0x1f7c94['hide'](),this['_openNestedPanels']['delete'](_0x1f7c94);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x48d061=>_0x48d061['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x55e34f,_0x1f2905){if(!_0x55e34f)return!0x1;if(_0x1f2905['element']?.['contains'](_0x55e34f))return!0x0;const _0x5cd350=_0x55e34f;return _0x5cd350['closest']&&(null!==_0x5cd350['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x5cd350['closest']('.ck-ai-quick-actions-group-list')||null!==_0x5cd350['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0xee1234){return'rtl'===_0xee1234['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x2436a9){return'rtl'===_0x2436a9['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0xe50c31,_0x2cd2f4,_0x48f638,_0x43b99d){_0xe50c31['key']==_0x2cd2f4&&(_0x48f638['focus'](),this['_hideNestedPanel'](_0x43b99d));}['_handleSearchResultButtonClick'](_0x34a3be){_0x34a3be['fire']('execute');}}function $n(_0x36430e){const {editor:_0x44384c,content:_0x198764,buttonDefinition:_0x141407,bodyCollection:_0x43c7bf,hasSearch:_0x49da93=!0x1,actionButtons:_0x4f8669}=_0x36430e;return()=>{const _0x3c2e68=_0x44384c['locale'],_0x13b823=_0x44384c['commands']['get']('aiQuickAction'),_0x4b328c=Ft(_0x3c2e68);_0x4b328c['bind']('isEnabled')['to'](_0x13b823),_0x4b328c['buttonView']['set']({'icon':_0x141407['icon']??_0x353ca0,'label':_0x141407['label'],'tooltip':!0x0}),_0x4b328c['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x566130=new AIQuickActionsDropdownContentView(_0x44384c,_0x198764,_0x4b328c,_0x43c7bf,_0x49da93,_0x4f8669);return _0x4b328c['panelView']['children']['add'](_0x566130),_0x49da93&&_0x4b328c['on']('change:isOpen',(_0x3771d3,_0x1fd0a7,_0x6b5ba1)=>{if(_0x6b5ba1){if(_0x44384c['plugins']['has']('AIEditing')){const _0x31136d=_0x44384c['plugins']['get'](AIEditing),_0x34f919=_0x44384c['model']['document']['selection'],_0x11c869=Array['from'](_0x34f919['getRanges']());_0x11c869['length']>0x0&&_0x31136d['showFakeVisualSelection']({'editor':_0x44384c,'ranges':_0x11c869,'id':'quick-action','priority':0x14});}}else _0x44384c['plugins']['has']('AIEditing')&&_0x44384c['plugins']['get'](AIEditing)['hideFakeVisualSelection']('quick-action'),_0x566130['resetSearch']();}),_0x4b328c;};}const qn='<task>Explain\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x20plain,\x20simple\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).-\x20Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20explanation,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant,\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Qn='<task>Summarize\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x202–4\x20clear\x20sentences,\x20capturing\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20summary,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Xn='<task>Extract\x20and\x20present\x20the\x20key\x20points\x20from\x20the\x20selected\x20part\x20of\x20the\x20document\x20as\x20a\x20concise\x20bulleted\x20list.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20key\x20points\x20list,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',zn=/* #__PURE__ -- @preserve */
|
|
28
|
-
((()=>({'chat':'AIChat','action':'AIActions'}))());class AIQuickActionsUI extends _0x364f72{['_actionButtons']=[];['_menuBarGroupViews']=[];static get['requires'](){return[_0x209441,AIConnector];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x34f9ec=this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x34f9ec),this['_initializeQuickActionsComponentsAndCommands'](),this['_initActionTypeQuickActions'](),this['_initChatTypeQuickActions']();}static['getDefaultQuickActions'](_0x4f58c5){return function(_0xd82545){const _0x3c3587=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0xd82545['uiLanguage']),_0x25e4d9=_0x3c3587||'English',_0x767680=[{'id':'ask-ai','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x174229},{'id':'chat-commands','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x174229,'actions':[{'id':'explain','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':Mi(_0xd82545,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':qn['replace']('%0',_0x25e4d9),'type':'chat'},{'id':'summarize','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':Mi(_0xd82545,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Qn['replace']('%0',_0x25e4d9),'type':'chat'},{'id':'highlight-key-points','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':Mi(_0xd82545,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Xn['replace']('%0',_0x25e4d9),'type':'chat'}]},{'id':'improve-writing','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x597f0c},{'id':'continue','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x3c445a},{'id':'fix-grammar','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x434b1e},{'id':'adjust-length','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x3fc7e4,'actions':[{'id':'make-shorter','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x1d9d2b,'actions':[{'id':'make-tone-casual','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x5a7bff,'actions':[{'id':'translate-to-english','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':Mi(_0xd82545,'AI_QUICK_ACTIONS_OTHER'),'icon':tt,'actions':[]}];return _0x767680;}(_0x4f58c5);}['_getDefaultAndCustomActions'](){const _0xe36837=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0x292f2=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x460f9c=>({..._0x460f9c,'type':'chat'===_0x460f9c['type']?'chat':'action','icon':void 0x0}));return _0xe36837['find'](_0x39d8ca=>'other'===_0x39d8ca['id'])['actions']['push'](..._0x292f2),_0xe36837;}async['_initActionTypeQuickActions'](){try{const _0x5b4ab1=new AIModels({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']}),_0x2c29c0=await _0x5b4ab1['getAll'](),_0x4d2357=(await _0x5b4ab1['getDefault']())?.['id'];this['_assignDefaultModelToCustomActions'](_0x4d2357),this['_enableButtonsByType']('action',_0x3fbbdd=>!!_0x2c29c0['find'](_0x50b3d3=>_0x50b3d3['id']===_0x3fbbdd['model'])||void 0x0===_0x3fbbdd['model']);}catch(_0x2b74da){const _0x327a33=new ht('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x2b74da});Ct(_0x327a33['message']);}}['_initChatTypeQuickActions'](){if(!this['editor']['plugins']['has']('AIChatController'))return;const _0x11b822=this['editor']['plugins']['get']('AIChatController');this['listenTo'](_0x11b822,'change:isConversationReady',(_0x15567d,_0x1c72ec,_0x31cc6b)=>{_0x31cc6b&&this['_enableButtonsByType']('chat',()=>!0x0);}),_0x11b822['isConversationReady']&&this['_enableButtonsByType']('chat',()=>!0x0);}['_enableButtonsByType'](_0x16bcf1,_0x56a836){this['_quickActionsDefinition']['forEach'](_0x1ca542=>{'actions'in _0x1ca542?_0x1ca542['actions']['forEach'](_0x1aaa03=>{_0x1aaa03['type']===_0x16bcf1&&(_0x1aaa03['isEnabled']=_0x56a836(_0x1aaa03));}):_0x1ca542['type']===_0x16bcf1&&(_0x1ca542['isEnabled']=_0x56a836(_0x1ca542));}),this['_actionButtons']['forEach'](_0x4df608=>{if(jn(_0x4df608['action']))return;if(_0x4df608['action']['type']!==_0x16bcf1)return;const _0x6f11ba=_0x56a836(_0x4df608['action']);if(_0x4df608['action']['isEnabled']=_0x6f11ba,_0x4df608['buttonView']['isEnabled']=_0x6f11ba,!_0x6f11ba&&_0x4df608['action']['model']){const _0x257541=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x4df608['action']['id'],'modelId':_0x4df608['action']['model']});Ct(_0x257541['message']);}}),this['_actionButtons']['filter'](_0x2f7dfb=>jn(_0x2f7dfb['action']))['forEach'](_0x3c29c5=>{_0x3c29c5['buttonView']['isEnabled']=_0x3c29c5['action']['actions']['some'](_0x600c3c=>_0x600c3c['isEnabled']);}),this['_menuBarGroupViews']['forEach'](({view:_0x26ed06,group:_0x5280fa})=>{_0x26ed06['isEnabled']=_0x5280fa['actions']['some'](_0x3a1a24=>_0x3a1a24['isEnabled']);});}['_assignDefaultModelToCustomActions'](_0x44bc2f){this['_actionButtons']['forEach'](_0x47ff64=>{jn(_0x47ff64['action'])||'action'===_0x47ff64['action']['type']&&(_0x47ff64['action']['model']||(_0x47ff64['action']['model']=_0x44bc2f));});}['_initializeQuickActionsComponentsAndCommands'](){const _0x13c03b=new Xt(this['editor']['locale']);_0x13c03b['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x13c03b),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x13c03b);}['_initializeQuickActionsDropdown'](_0xa9f5e8){const _0x5f2d60=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',$n({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x353ca0,'label':Mi(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0xa9f5e8,'hasSearch':_0x5f2d60,'actionButtons':this['_actionButtons']}));}['_prepareQuickActionsDefinition'](_0x3e9057){this['_quickActionsDefinition']=_0x3e9057['map'](_0xa612ed=>{if('actions'in _0xa612ed){const _0x5af598=_0xa612ed;return{..._0x5af598,'actions':_0x5af598['actions']['map'](_0x3ca759=>{const {actions:_0x4416d5,..._0x1bc36e}=_0x5af598;return{..._0x3ca759,'isEnabled':!0x1,'parent':_0x1bc36e};})['filter'](_0x154534=>this['_shouldIncludeAction'](_0x154534))};}return{..._0xa612ed,'isEnabled':!0x1};})['filter'](_0x5e8b90=>'actions'in _0x5e8b90?_0x5e8b90['actions']['length']>0x0:this['_shouldIncludeAction'](_0x5e8b90));}['_shouldIncludeAction'](_0x13a14c){const _0x514ba8=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](zn[_0x13a14c['type']])&&!_0x514ba8['includes'](_0x13a14c['id'])&&!('chat'===_0x13a14c['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0xbb4a64){this['_quickActionsDefinition']['forEach'](_0xc9a33a=>{if('actions'in _0xc9a33a){const _0x49c746=$n({'editor':this['editor'],'content':_0xc9a33a['actions'],'buttonDefinition':_0xc9a33a,'bodyCollection':_0xbb4a64,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0xc9a33a['id'],_0x49c746),_0xc9a33a['actions']['forEach'](_0x3497d6=>{const _0x2906f0=Wn({'editor':this['editor'],'action':_0x3497d6,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x3497d6['id'],_0x2906f0);});}else{const _0x4328d7=Wn({'editor':this['editor'],'action':_0xc9a33a,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0xc9a33a['id'],_0x4328d7);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x31296f=>{const _0x5d4c0e=this['editor']['commands']['get']('aiQuickAction'),_0x1b72e0=new Kt(_0x31296f),_0x4a44a5=Mi(_0x31296f,'AI_QUICK_ACTIONS_HEADING');_0x1b72e0['buttonView']['set']({'label':_0x4a44a5,'icon':_0x353ca0});const _0x12a22b=new qt(_0x31296f);return _0x12a22b['set']({'ariaLabel':_0x4a44a5,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x34d515=>{if('actions'in _0x34d515){const _0x205548=_0x34d515,_0x57709b=new Qt(_0x31296f,_0x1b72e0),_0xe8c0f4=new Kt(_0x31296f),_0x235560=new qt(_0x31296f);_0xe8c0f4['buttonView']['set']({'label':_0x205548['label'],'icon':_0x205548['icon']}),_0x205548['actions']['forEach'](_0x2040db=>{const _0x416a3f=new Qt(_0x31296f,_0xe8c0f4),_0x373679=new Yt(_0x31296f);_0x373679['set']({'label':_0x2040db['label'],'icon':_0x2040db['icon'],'role':'menuitem','isEnabled':_0x2040db['isEnabled']}),_0x373679['on']('execute',()=>{this['_executeQuickAction'](_0x2040db);}),this['_actionButtons']['push']({'buttonView':_0x373679,'action':_0x2040db}),_0x373679['delegate']('execute')['to'](_0xe8c0f4),_0x416a3f['children']['add'](_0x373679),_0x235560['items']['add'](_0x416a3f);}),_0xe8c0f4['isEnabled']=_0x205548['actions']['some'](_0x3842ca=>_0x3842ca['isEnabled']),this['_menuBarGroupViews']['push']({'view':_0xe8c0f4,'group':_0x205548}),_0xe8c0f4['panelView']['children']['add'](_0x235560),_0x57709b['children']['add'](_0xe8c0f4),_0x12a22b['items']['add'](_0x57709b);}else{const _0x397d49=_0x34d515,_0x57f3bd=new Qt(_0x31296f,_0x1b72e0),_0x1280ad=new Yt(_0x31296f);_0x1280ad['set']({'label':_0x397d49['label'],'icon':_0x397d49['icon'],'role':'menuitem','isEnabled':_0x397d49['isEnabled']}),this['_actionButtons']['push']({'buttonView':_0x1280ad,'action':_0x397d49}),_0x1280ad['on']('execute',()=>{this['_executeQuickAction'](_0x397d49);}),_0x1280ad['delegate']('execute')['to'](_0x1b72e0),_0x57f3bd['children']['add'](_0x1280ad),_0x12a22b['items']['add'](_0x57f3bd);}}),(Object['values'](zn)['some'](_0x1d2975=>this['editor']['plugins']['has'](_0x1d2975))?_0x1b72e0['bind']('isEnabled')['to'](_0x5d4c0e):_0x1b72e0['set']({'isEnabled':!0x1}),_0x1b72e0['panelView']['children']['add'](_0x12a22b),_0x1b72e0);});}['_executeQuickAction'](_0x19476f){const _0x30495d=this['editor'];_0x30495d['editing']['view']['focus'](),_0x30495d['commands']['execute']('aiQuickAction',_0x19476f);const _0x10e1f3=_0x30495d['ui']['view']['menuBarView'];_0x10e1f3&&_0x10e1f3['close']&&_0x10e1f3['close']();}}function jn(_0x4c214d){return'actions'in _0x4c214d;}class AIQuickActionsCommand extends _0x350c41{['execute'](_0x1ecb6a){switch(this['_expandSelectionIfCollapsed'](),_0x1ecb6a['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x435897=Mi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x435897});}this['_handleAIChatAction'](_0x1ecb6a);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x5516e1=Mi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5516e1});}this['_handleAIActionsAction'](_0x1ecb6a);}}async['_handleAIChatAction'](_0x3e7ade){const _0x506bab=this['editor']['plugins']['get']('AIChatController'),_0x24a366=this['editor']['plugins']['get']('AITabs')['view'];if(_0x24a366['isVisible']||(_0x24a366['isVisible']=!0x0),'chat'!==_0x24a366['activeTab']&&_0x24a366['activateTab']('chat'),'ask-ai'===_0x3e7ade['id'])_0x506bab['removeSelectionFromChatContext'](),_0x506bab['addSelectionToChatContext'](this['editor']),_0x506bab['focusPromptInput']();else await _0x506bab['startConversation']({'modelId':_0x3e7ade['model']}),_0x506bab['removeSelectionFromChatContext'](),_0x506bab['addSelectionToChatContext'](this['editor']),_0x506bab['focusPromptInput'](),await _0x506bab['sendMessage']({'message':_0x3e7ade['prompt']||_0x3e7ade['displayedPrompt']||_0x3e7ade['label'],'attributes':{'quickActionData':{'id':_0x3e7ade['id']},'displayedPrompt':_0x3e7ade['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x4bb5ec=this['editor'],_0x3d9fe2=_0x4bb5ec['model']['document']['selection'];if(!_0x3d9fe2['isCollapsed'])return;const _0x41777e=gt(_0x3d9fe2['getSelectedBlocks']())||_0x4bb5ec['model']['schema']['getLimitElement'](_0x3d9fe2);_0x4bb5ec['model']['change'](_0x213480=>{_0x213480['setSelection'](_0x41777e,'in');});}['_handleAIActionsActionLabel'](_0x2a09b9){return _0x2a09b9['parent']?.['label']&&'other'!==_0x2a09b9['parent']?.['id']?_0x2a09b9['parent']['label']+':\x20'+_0x2a09b9['label']:_0x2a09b9['label'];}async['_handleAIActionsAction'](_0x2799f9){const _0x14f63b=this['editor']['plugins']['get']('AIActions'),_0x4e0894=_0x2799f9['prompt']?{'userMessage':_0x2799f9['prompt'],'model':_0x2799f9['model']}:{'actionName':_0x2799f9['actionName']||_0x2799f9['id'],'args':_0x2799f9['args']},_0x936999=this['_handleAIActionsActionLabel'](_0x2799f9);await _0x14f63b['executeAction'](_0x4e0894,_0x936999,_0x2799f9['icon']);}}class AIQuickActionsEditing extends _0x364f72{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x231472=this['editor'],_0x1ab06d=new AIQuickActionsCommand(this['editor']);if(_0x231472['commands']['add']('aiQuickAction',_0x1ab06d),_0x231472['plugins']['has']('AIChat')){const _0x4600c8=this['editor']['plugins']['get']('AIChatController');_0x231472['model']['document']['selection']['on']('change:range',(_0x4b7cb2,_0x27d484)=>{_0x27d484['directChange']&&_0x4600c8['removeSelectionFromChatContext']();});}}}class AIActionsReply extends AIReply{['appendContent'](_0xf6c317,_0x4eafb3='text'){'modification'===this['type']&&'text'===_0x4eafb3&&(_0x4eafb3=this['documentContextContent']['keys']()['next']()['value']),super['appendContent'](_0xf6c317,_0x4eafb3);}['updateChangeGroups'](_0x1e4322){const _0x4a05a1=this['parsedContent']['get'](_0x1e4322)['cloneNode'](!0x0);if(this['parsedMergedContent']['set'](_0x1e4322,_0x4a05a1),this['changeGroups']=[],0x0==_0x4a05a1['childNodes']['length'])return;ns(this['documentContextContent']['get'](_0x1e4322),this['parsedMergedContent']['get'](_0x1e4322));const _0x3c884f=this['documentContextContent']['get'](_0x1e4322)['children']['map'](_0x1c62ae=>({'node':_0x1c62ae,'id':Xi(_0x1c62ae,'data-id')})),_0x3f8940=_0x4a05a1['children']['map'](_0xbe356a=>({'node':_0xbe356a,'id':Xi(_0xbe356a,'data-id')||at()})),_0x11b211=_0x1c510d(_0x3c884f,_0x3f8940,{'comparator':(_0x2684ff,_0x25d770)=>_0x2684ff['id']==_0x25d770['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x11b211['length']&&_0x11b211[_0x11b211['length']-0x1]['removed'];)_0x11b211['pop']();}const _0x568588=_0x11b211['map'](_0x4b2c8c=>{const _0x42f03b=_0x4b2c8c['added']?'new':_0x4b2c8c['removed']?'removed':'modified';return{'node':_0x4b2c8c['value'][0x0]['node'],'type':_0x42f03b,'id':_0x4b2c8c['value'][0x0]['id']};}),_0x2b8644=this['_documentIdToSource']['get'](_0x1e4322);this['changeGroups']['push']({'changes':_0x568588,'state':'pending','index':this['changeGroups']['length'],'editor':_0x2b8644['editor'],'rootName':_0x2b8644['rootName'],'documentId':_0x1e4322});}['_getDifferentChangeGroups'](_0x25b3dd,_0x356581){return _0x356581;}}class AIActionsInteraction extends AIInteraction{['content'];['version'];['editor'];['rootName'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x3c46e2){super(_0x3c46e2),this['content']=_0x3c46e2['content'],this['version']=_0x3c46e2['version'],this['editor']=_0x3c46e2['editor'],this['rootName']=_0x3c46e2['rootName'],this['actionName']=_0x3c46e2['actionName'],this['args']=_0x3c46e2['args'],this['userMessage']=_0x3c46e2['userMessage'],this['model']=_0x3c46e2['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':'document','documents':[{'id':this['id'],'content':this['content'],'version':this['version'],'rootName':this['rootName'],'sessionId':at(),'channelId':this['editor']['config']['get']('collaboration.channelId')}],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x184196){const _0x2eebb9=this['editor']['config']['get']('collaboration.channelId'),_0x3eab68=new AIActionsReply({..._0x184196,'locale':this['locale'],'documentContextContent':[{'id':this['id'],'content':this['content'],'channelId':_0x2eebb9,'rootName':this['rootName']}],'channelsToEditors':new Map([[_0x2eebb9,this['editor']]])});return this['replies']['push'](_0x3eab68),_0x3eab68['delegate'](..._s)['to'](this),this['fire']('replyCreated',_0x3eab68),_0x3eab68;}}class AIActionsBalloonToolbarView extends kt{constructor(_0x3cd3ad,_0x29c11a=!0x0,_0x31a4ad=!0x0){super(_0x3cd3ad),this['set']('isEnabled',!0x1),_0x29c11a&&(this['applyButton']=this['_createButton'](Mi(_0x3cd3ad,'AI_BALLOON_APPLY_BUTTON'),Ui),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x31a4ad&&(this['suggestButton']=this['_createButton'](Mi(_0x3cd3ad,'AI_BALLOON_SUGGEST_BUTTON'),_0x29c11a?Bi:Ui),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x29c11a,'showSuggestButton':_0x31a4ad}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x5425f7,showSuggestButton:_0xfd908b}){this['applyButton']&&(this['applyButton']['isVisible']=_0x5425f7),this['suggestButton']&&(this['suggestButton']['isVisible']=_0xfd908b);}['_createButton'](_0x4ac86b,_0x21537e){const _0x3d8508=new yt(this['locale']);return _0x3d8508['set']({'label':_0x4ac86b,'class':_0x21537e,'isVisible':!0x0,'withText':!0x0}),_0x3d8508;}}class AIActionsBalloonDisclaimerView extends Nt{constructor(_0x26f84e){super(_0x26f84e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Mi(_0x26f84e,'AI_DISCLAIMER_TEXT')}]}]});}}class AISuggestionLoaderView extends Nt{constructor(_0x1ba364){super(_0x1ba364),this['set']('isVisible',!0x0);const _0x3942e6=new AISpinnerView('small');_0x3942e6['isVisible']=!0x0;const _0x6b61de=new Nt(this['locale']);_0x6b61de['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Mi(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x534228=>!_0x534228)]},'children':[_0x3942e6,_0x6b61de]});}}class AIActionsBalloonView extends AIBalloonView{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x425dcd,_0x2d24b2){super(_0x425dcd),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x2d24b2,this['_focusTracker']=new It(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x461da8(),this['_addContentWrapper'](_0x2d24b2),this['_addDisclaimerView'](),this['_addToolbar'](_0x2d24b2),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x2d24b2);});}['render'](){super['render']();for(const _0x202448 of this['_focusables'])this['_focusTracker']['add'](_0x202448['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x382f6e){-0x1===_0x382f6e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x3c70e6){this['_isLoading']=_0x3c70e6;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x261ca4){super['showError'](_0x261ca4),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x4d7d5c){super['showBlockingError'](_0x4d7d5c),this['setErrorState']();}['addMiniToolbarItem'](_0x3984cb){this['_miniToolbarView']['items']['has'](_0x3984cb)||this['_miniToolbarView']['items']['add'](_0x3984cb);}['removeMiniToolbarItem'](_0x5a22b){this['_miniToolbarView']['items']['has'](_0x5a22b)&&this['_miniToolbarView']['items']['remove'](_0x5a22b);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x37f6b1,showSuggestButton:_0x1ae4f3}){_0x37f6b1=_0x37f6b1&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x1ae4f3=_0x1ae4f3&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x37f6b1,'showSuggestButton':_0x1ae4f3});}async['updateContent'](_0xa86702){await this['_streamableContentView']['update'](_0xa86702);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x4c5b3f){this['_contentWrapper']=new Nt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x4c5b3f['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new AIActionsBalloonDisclaimerView(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x316d3a,showSuggestButton:_0x1cac69}){this['_toolbarView']=new AIActionsBalloonToolbarView(this['locale'],_0x316d3a,_0x1cac69),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x498272,_0x52ea72,_0x45d4b4)=>!(_0x498272||_0x52ea72||_0x45d4b4)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x316d3a,'showSuggestButton':_0x1cac69}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x512866){return this['_miniToolbarView']=new AIMiniToolbarView(this['locale'],_0x512866),this['_miniToolbarView']['delegate'](...bs)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x2b40fe,_0x59d6bc)=>!(_0x2b40fe||_0x59d6bc)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new AISuggestionLoaderView(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new AISuggestionStreamableContentView(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x4ead7e=new yt(this['locale']),_0x35c140=new yt(this['locale']),_0x3c5d19=new AIActionsBalloonNavigationCounterView(this['locale']),_0x497cd1=new yt(this['locale']);_0x4ead7e['set']({'icon':et,'label':Mi(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+Gi}),_0x35c140['set']({'icon':_0x326f31,'tooltip':Mi(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+Gi}),_0x497cd1['set']({'icon':it,'tooltip':Mi(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+Gi}),_0x4ead7e['bind']('isEnabled')['to'](this,'isBusy',_0x241888=>!_0x241888),_0x4ead7e['on']('execute',()=>{this['fire']('tryAgain');}),_0x35c140['bind']('isEnabled')['to'](this,'isBusy',_0x48fea9=>!_0x48fea9),_0x35c140['on']('execute',()=>{this['fire']('showPrevious');}),_0x497cd1['bind']('isEnabled')['to'](this,'isBusy',_0x5a874e=>!_0x5a874e),_0x497cd1['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x35c140,this['_navigationCounter']=_0x3c5d19,this['_navigationNextButton']=_0x497cd1,this['_navigationTryAgainButton']=_0x4ead7e;}['updateMiniToolbarButtons'](_0x6656c1,_0x487bbf){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x20d8a6=_0x6656c1>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x20d8a6){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x12ac36=_0x6656c1-_0x487bbf;this['_navigationCounter']['setInteractionCount'](_0x12ac36+'/'+_0x6656c1),this['_navigationPreviousButton']['isEnabled']=_0x487bbf<_0x6656c1-0x1,this['_navigationNextButton']['isEnabled']=_0x487bbf>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x96dc98){this['_isLoading']=_0x96dc98;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x15d4e1=this['_getScrollableElement']();_0x15d4e1&&!this['_scrollManager']&&(this['_scrollManager']=new ScrollManager(_0x15d4e1));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class AIActionsBalloonNavigationCounterView extends Nt{constructor(_0x304a90){super(_0x304a90);const _0x13e5e8=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x13e5e8['to']('interactionCount')}]});}['setInteractionCount'](_0xb92431){this['set']('interactionCount',_0xb92431);}}class AIActions extends _0x364f72{static get['requires'](){return[AIConnector,Gt,AIEditing,AIBalloon,_0x4d0fee];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x20e220){super(_0x20e220),this['_bodyCollection']=new Xt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0xf57ee6,_0x5a79f2,_0x2f13a6){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x2b038b,anchorData:_0x14c1a2,root:_0x43b114}=this['_getExecuteDataInTable']();return this['_executeAction'](_0xf57ee6,_0x2b038b,_0x14c1a2,_0x43b114,_0x5a79f2,_0x2f13a6);}}const {modelFragment:_0x1d2622,anchorData:_0x1dafee,root:_0x5efed0}=this['_getExecuteDataRegular']();return this['_executeAction'](_0xf57ee6,_0x1d2622,_0x1dafee,_0x5efed0,_0x5a79f2,_0x2f13a6);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x4c0820=this['editor']['plugins']['has']('TrackChanges');let _0x181006=this['editor']['config']['get']('ai.availableReplyActions')||[...Ps];_0x4c0820||(_0x181006=_0x181006['filter'](_0xc16e35=>'insertSuggestion'!=_0xc16e35));const _0x2d0bd0=this['editor']['commands']['get']('trackChanges'),_0x1185d3=new AIActionsBalloonView(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x4c0820,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x181006});return _0x1185d3['bind']('isBusy')['to'](this),_0x2d0bd0&&_0x1185d3['bind']('isTrackChangesOn')['to'](_0x2d0bd0,'value'),_0x1185d3['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x1185d3['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x1185d3['on']('showNext',()=>{this['_navigateToNext']();}),_0x1185d3;}['_normalizeSelectionStart'](){const _0x5b033b=this['editor']['model'],_0xe667c2=_0x5b033b['document']['selection'],_0x24a4a8=_0xe667c2['getFirstRange']();if(!_0x24a4a8||_0x24a4a8['isCollapsed'])return;const _0x64dda6=gt(_0xe667c2['getSelectedBlocks']());if(!_0x64dda6)return;const _0x3b7b44=_0x5b033b['createPositionAt'](_0x64dda6,0x0);_0x3b7b44['isAfter'](_0x24a4a8['start'])&&_0x5b033b['change'](_0x404467=>{_0x404467['setSelection'](_0x404467['createRange'](_0x3b7b44,_0x24a4a8['end']));});}['_getExecuteDataRegular'](){const _0x5a083c=this['editor']['model']['document']['selection'],_0x4f5f03=_0x5a083c['getFirstRange']()['start']['root'];if(_0x5a083c['isCollapsed']){const _0x34cb85=gt(_0x5a083c['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x5a083c);this['editor']['model']['change'](_0x386469=>{_0x386469['setSelection'](_0x34cb85,'in');});}this['_normalizeSelectionStart']();const _0x2bdf07=_0x5a083c['getFirstRange'](),_0x4788c7=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x5a083c),_0x2bdf07['start'],_0x2bdf07['end']);this['_copyMarkersToFragment'](_0x4788c7,_0x5a083c,{'isTableSelection':!0x1});const _0x5e338d=_0x5a083c['getFirstRange']()['start'],_0x1de30d=new Map();let _0x5c7d3a=_0x4788c7;for(let _0x3f2066=0x0;_0x3f2066<_0x5e338d['path']['length'];_0x3f2066++)_0x1de30d['set'](_0x5c7d3a,_0x5e338d['path'][_0x3f2066]),_0x5c7d3a=_0x5c7d3a['getChild'](0x0);return{'modelFragment':_0x4788c7,'anchorData':_0x1de30d,'root':_0x4f5f03};}['_getExecuteDataInTable'](){const _0x1fb137=this['editor']['model']['document']['selection'],_0x469aa1=this['editor']['plugins']['get']('TableSelection'),_0x4b7756=_0x1fb137['getFirstRange']()['start']['root'],_0x857296=_0x469aa1['getSelectionAsFragment'](),_0x25d158=_0x1fb137['getFirstRange']()['start']['parent']['parent'],_0x5ac668=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x25d158),this['editor']['model']['createPositionAfter'](_0x25d158)),_0x3ed4cf=this['_wrapWithCommonAncestors'](_0x857296,_0x5ac668['start'],_0x5ac668['end']);this['_copyMarkersToFragment'](_0x3ed4cf,_0x1fb137,{'isTableSelection':!0x0});const _0x377f86=_0x1fb137['getFirstRange']()['start'],_0x5d568c=new Map();let _0x2fc212=_0x3ed4cf;for(let _0x139a37=0x0;_0x139a37<_0x377f86['path']['length'];_0x139a37++)if(_0x5d568c['set'](_0x2fc212,_0x377f86['path'][_0x139a37]),_0x139a37<_0x377f86['path']['length']-0x1)_0x2fc212=_0x2fc212['getChild'](0x0);else{let _0x117df3=_0x2fc212['nextSibling'];for(;_0x117df3;)_0x5d568c['set'](_0x117df3,_0x377f86['path'][_0x139a37]),_0x117df3=_0x117df3['nextSibling'];}return{'modelFragment':_0x3ed4cf,'anchorData':_0x5d568c,'root':_0x4b7756};}async['_executeAction'](_0x11ab7f,_0x122c95,_0x5a2b13,_0x39094c,_0xe4ba9d,_0x5daae4){const _0x40f126=this['editor']['plugins']['get'](AIEditing),_0x185ef2=this['editor']['plugins']['get'](AIBalloon),_0x162e46=this['editor']['model']['document']['selection'],_0x4fdb1c=await _0x40f126['modelToDataWithIds'](_0x122c95,this['editor']),_0x4e322e=this['editor']['model']['document']['version'],_0x344f7e=[..._0x162e46['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x185ef2['open']({'targetEditor':this['editor'],'index':0x3e8*Math['random']()%0x3e8,'title':_0xe4ba9d,'icon':_0x5daae4||_0x353ca0,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x344f7e,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x185ef2),this['_interactionParams']={'action':_0x11ab7f,'content':_0x4fdb1c,'version':_0x4e322e,'aiBalloon':_0x185ef2,'modelFragment':_0x122c95,'anchorData':_0x5a2b13,'root':_0x39094c},this['_setupApplyListeners'](),this['listenTo'](_0x185ef2,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x185ef2,'dialogClosed',(_0x311ead,{id:_0x16f4e5})=>{if('aiActionsBalloon'===_0x16f4e5){for(const _0x27243b of this['_interactions']){if(0x0===_0x27243b['replies']['length']||_0x27243b['stoppedExplicitly'])continue;const _0x12e3a4=_0x27243b['replies'][_0x27243b['replies']['length']-0x1],_0xe1cc99=_0x12e3a4['changeGroups'][0x0];_0xe1cc99&&'pending'===_0xe1cc99['state']&&_0x12e3a4['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x185ef2);}}),this['_createInteraction'](_0x4fdb1c,_0x4e322e,_0x185ef2,_0x11ab7f);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x553e02,anchorData:_0x4f1074,root:_0x3c1f83}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x553e02,_0x4f1074,_0x3c1f83,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x553e02,_0x4f1074,_0x3c1f83,!0x0);});}['_wrapWithCommonAncestors'](_0x580818,_0x10ca98,_0x115d6e){const _0x5344ba=this['editor']['model']['createRange'](_0x10ca98,_0x115d6e)['getCommonAncestor'](),_0xfe426f=_0x5344ba['is']('documentFragment')?[]:_0x5344ba['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0xfe426f['length']){const _0x1eaed1=_0xfe426f['map'](_0x2b1ccf=>_0x2b1ccf['_clone'](!0x1));for(let _0x2291ef=0x1;_0x2291ef<_0x1eaed1['length'];_0x2291ef++)_0x1eaed1[_0x2291ef-0x1]['_appendChild'](_0x1eaed1[_0x2291ef]);return _0x1eaed1[_0x1eaed1['length']-0x1]['_appendChild'](_0x580818),new _0x415042(_0x1eaed1[0x0]);}return _0x580818;}['_copyMarkersToFragment'](_0x439d2c,_0x5d4f7f,_0x2a1955={'isTableSelection':!0x1}){const _0x41621b=this['editor']['model'],_0x590a82=Array['from'](_0x5d4f7f['getRanges']()),_0x84ba52=_0x5d4f7f['getFirstRange']()['start'];for(const _0xf0c3d2 of _0x41621b['markers']){if(_0xf0c3d2['name']['startsWith'](fs)||!_0xf0c3d2['affectsData'])continue;const _0x4f0940=_0xf0c3d2['getRange']();if(!_0x590a82['some'](_0x1a700a=>_0x1a700a['containsRange'](_0x4f0940,!0x0)))continue;const _0x37f4d3=this['_regularCalculateMarkerPath'](_0x4f0940['start'],_0x84ba52,_0x2a1955['isTableSelection']),_0x56d3d3=this['_regularCalculateMarkerPath'](_0x4f0940['end'],_0x84ba52,_0x2a1955['isTableSelection']),_0x1a4aa3=_0x41621b['createPositionFromPath'](_0x439d2c,_0x37f4d3),_0xacc3c9=_0x41621b['createPositionFromPath'](_0x439d2c,_0x56d3d3);if(!_0x1a4aa3['isEqual'](_0xacc3c9)){const _0x21a3f2=_0x41621b['createRange'](_0x1a4aa3,_0xacc3c9);_0x439d2c['markers']['set'](_0xf0c3d2['name'],_0x21a3f2);}}}['_regularCalculateMarkerPath'](_0x6003ae,_0x45e0b6,_0x392db4=!0x1){const _0x1112a8=[..._0x6003ae['path']['slice']()];for(let _0xfe638e=0x0;_0xfe638e<Math['max'](_0x45e0b6['path']['length'],_0x6003ae['path']['length']);_0xfe638e++){const _0x1d8c68=_0x45e0b6['path'][_0xfe638e]||0x0,_0xcc9072=(_0x6003ae['path'][_0xfe638e]||0x0)-_0x1d8c68;if(_0x1112a8[_0xfe638e]=_0xcc9072,0x0!==_0xcc9072&&!_0x392db4)break;}return _0x1112a8;}async['_createInteraction'](_0x2143e6,_0x42f746,_0x7da4bb,_0x20ca8c){const _0x347a82=this['editor'],_0x4a65f4=_0x347a82['model']['document']['selection']['getFirstRange']()['start']['root'];this['_interactionParams']||(this['_interactionParams']={'action':_0x20ca8c,'content':_0x2143e6,'version':_0x42f746,'aiBalloon':_0x7da4bb,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':_0x4a65f4});const _0x33c6db=new AIActionsInteraction({'connector':this['_aiConnector'],'locale':_0x347a82['locale'],'content':_0x2143e6,'version':_0x42f746,'editor':_0x347a82,'rootName':_0x4a65f4['rootName'],..._0x20ca8c});this['_interactions']['push'](_0x33c6db);const _0x50866d=(_0x5adf3c,_0x4d3ca4=!0x1,_0xc86efe='streaming')=>this['_promiseQueue']['enqueue'](async _0x52ff98=>{try{const _0x974916=rs({'changeGroups':_0x5adf3c['changeGroups'],'documentContextContent':_0x5adf3c['documentContextContent'],'showDiff':_0x4d3ca4,'trimUnchanged':!0x1});_0x974916['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x974916[0x0],'renderingStrategy':_0xc86efe,'abortSignal':_0x52ff98});}catch(_0x45809f){if(this['_isAbortError'](_0x45809f))return;throw _0x45809f;}});_0x33c6db['on']('replyCreated',(_0x2402ce,_0x36acd3)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x50866d(_0x36acd3)['catch'](_0x799e3b=>{this['_isAbortError'](_0x799e3b)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x799e3b),this['_setErrorState'](_0x33c6db));});}),_0x33c6db['on']('replyContentUpdated',(_0x4d3c63,_0x385d45)=>{_0x50866d(_0x385d45)['catch'](_0x357084=>{this['_isAbortError'](_0x357084)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x357084),this['_setErrorState'](_0x33c6db));});}),_0x33c6db['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x44bb05){this['_isAbortError'](_0x44bb05)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x44bb05),this['_setErrorState'](_0x33c6db));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x40986e,{showDiff:_0x29e167})=>{try{this['_balloonShowDiff']=_0x29e167;const _0x3a3fa7=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x3a3fa7&&await _0x50866d(_0x3a3fa7,_0x29e167,'static');}catch(_0x1f7fa7){this['_isAbortError'](_0x1f7fa7)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x1f7fa7),this['_setErrorState'](_0x33c6db));}}),_0x33c6db['on']('replyChangeGroupStateUpdated',()=>{const _0x147529={'positiveCount':_0x33c6db['replies']['reduce']((_0x14902f,_0x35404f)=>_0x14902f+_0x35404f['changeGroups']['filter'](_0x5921a5=>'accepted'===_0x5921a5['state'])['length'],0x0),'totalCount':_0x33c6db['replies']['reduce']((_0x333592,_0x27ad7c)=>_0x333592+_0x27ad7c['changeGroups']['length'],0x0)},_0x29da5b=_0x33c6db['actionCallId'],_0x551ac5=_0x33c6db['actionName'];_0x551ac5?this['_aiConnector']['upsertAIActionRating'](_0x551ac5,_0x29da5b,_0x147529):this['_aiConnector']['upsertCustomAIActionRating'](_0x29da5b,_0x147529);}),this['_setLoadingState']();try{const _0x27921b=await _0x33c6db['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x27921b;}catch(_0x3a8eac){if(this['_isAbortError'](_0x3a8eac))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x33c6db);}}['_applyChanges'](_0x17ff0c,_0x4c88aa,_0x37b235,_0x1f633a){const _0x18288f=this['editor'];if(_0x1f633a&&!_0x18288f['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0xb364d0=this['editor']['plugins']['get'](_0x4d0fee),_0x12b8dc=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x12b8dc||!_0x12b8dc['replies']['length'])return;const _0x3bc191=_0x12b8dc['replies'][_0x12b8dc['replies']['length']-0x1],_0x31e777=_0x3bc191['changeGroups'];_0x3bc191['setChangeGroupState'](0x0,'accepted');let _0x3ea423=ps({'reply':_0x3bc191,'interaction':_0x12b8dc,'groups':_0x31e777,'transform':!0x1,'documentCompare':_0xb364d0,'documentCompareOptions':{'anchor':_0x18288f['model']['createPositionAt'](_0x17ff0c,0x0),'markDeletions':_0x1f633a}});_0x3ea423=this['_filterOperationsOutsideRange'](_0x3ea423,_0x4c88aa);for(const _0x3eb2eb of _0x3ea423)this['_anchorOperation'](_0x4c88aa,_0x3eb2eb,_0x37b235);const _0xab9b9b=_0x12b8dc['getDocumentContext']()['documents'][0x0]['version'],_0x26dd45=_0x18288f['model']['document']['history']['getOperations'](_0xab9b9b),_0x217aaa={'document':_0x18288f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0xf946d4=_0x4779ab(_0x3ea423,_0x26dd45,_0x217aaa)['operationsA'];_0x18288f['model']['change'](_0xa7f57b=>{if(_0xa7f57b['setSelection'](_0x18288f['model']['document']['selection']['focus']),_0x1f633a)_0x18288f['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xf946d4);else{for(const _0x2134a3 of _0xf946d4)_0x2134a3['baseVersion']=_0x18288f['model']['document']['version'],Es(_0x18288f,_0x2134a3),_0xa7f57b['batch']['addOperation'](_0x2134a3),_0x18288f['model']['applyOperation'](_0x2134a3);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x350cc2,_0x4c1f84){return _0x350cc2['filter'](_0x3080f6=>{if('rename'==_0x3080f6['type']){const _0x5d81ff=_0x3080f6['position']['nodeAfter'];return!_0x4c1f84['has'](_0x5d81ff);}if(_0x3080f6['type']['indexOf']('Attribute')>-0x1){const _0x2b7bf8=_0x3080f6['range']['start']['nodeAfter'];return!_0x4c1f84['has'](_0x2b7bf8);}return!0x0;});}['_anchorOperation'](_0x534d9a,_0x2777a4,_0x4b2bd3){const _0x405aef=_0x2777a4['clone']();for(const _0x574f31 in _0x2777a4){const _0x2297f6=_0x2777a4[_0x574f31];_0x2297f6 instanceof _0x14d15a?_0x2777a4[_0x574f31]=new _0x14d15a(_0x3fc077(_0x2297f6['start']),_0x3fc077(_0x2297f6['end'])):_0x2297f6 instanceof _0x590920&&(_0x2777a4[_0x574f31]=_0x3fc077(_0x2297f6));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x405aef['type'])){if(_0x405aef['isDocumentOperation']=!0x1,_0x405aef['baseVersion']=null,'remove'==_0x405aef['type']){const _0x2f9a6a=_0x405aef['sourcePosition'],_0x275f90=_0x405aef['howMany'];new _0x1f8438(_0x2f9a6a,_0x275f90)['_execute']();}else _0x405aef['_execute']();}function _0x3fc077(_0x4ca48d){if('$graveyard'==_0x4ca48d['root']['rootName'])return _0x4ca48d;const _0x3aaf4a=[];let _0x4ce13e=_0x4ca48d['root'];for(let _0x55b797=0x0;_0x55b797<_0x4ca48d['path']['length'];_0x55b797++){const _0x3945b4=_0x534d9a['get'](_0x4ce13e)||0x0;_0x3aaf4a[_0x55b797]=_0x4ca48d['path'][_0x55b797]+_0x3945b4,_0x4ce13e=_0x4ce13e['getChildAtOffset'](_0x4ca48d['path'][_0x55b797]);}return new _0x590920(_0x4b2bd3,_0x3aaf4a,_0x4ca48d['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x3f4558,content:_0x3acfcd,version:_0x8f0623,aiBalloon:_0xa66374}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x3acfcd,_0x8f0623,_0xa66374,_0x3f4558)['catch'](_0x200f73=>{this['_isAbortError'](_0x200f73)||console['error']('Error\x20refreshing\x20interaction:',_0x200f73);});}['_isAbortError'](_0x260507){return!!_0x260507['message']&&_0x260507['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x5b994d=this['_interactions']['length'];this['_currentInteractionIndex']<_0x5b994d-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x332360){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x332360;const _0x150437=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x150437)return;if(_0x150437['hasError'])return this['_setErrorState'](_0x150437),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x150437['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x5b6577=_0x150437['replies'][_0x150437['replies']['length']-0x1];if(_0x5b6577)try{const _0x4ad1c3=rs({'changeGroups':_0x5b6577['changeGroups'],'documentContextContent':_0x5b6577['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x1dff14=>setTimeout(_0x1dff14,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x4ad1c3[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x1cdcd5){this['_isAbortError'](_0x1cdcd5)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x1cdcd5);}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x319d13){const _0x3c15e5=Mi(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x3c15e5),_0x319d13['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class AIQuickActions extends _0x364f72{static get['requires'](){return[AIQuickActionsUI,AIQuickActionsEditing,AIActions];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2720be){super(_0x2720be),_0x2720be['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class AIReviewCoreReviewCheckListItemResultsView extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x4d70cd,_0x9f7e61){super(_0x4d70cd),this['id']=_0x9f7e61,this['set']('status','pending'),this['set']('changeId',_0x9f7e61),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x3a34e7,_0x8460ff)=>{_0x8460ff&&_0x8460ff['target']&&'A'===_0x8460ff['target']['tagName']&&_0x8460ff['preventDefault'](),this['fire']('activateChange',{'id':_0x9f7e61,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x9f7e61,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x9f7e61,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1d0564=new Nt(this['locale']);return _0x1d0564['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x504444=>!_0x504444)]}}),_0x1d0564;}['_createAcceptButtonView'](){const _0x3b31a5=new yt(this['locale']);return _0x3b31a5['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x3b31a5['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xb56535=>{this['fire']('acceptChange',{'id':this['changeId']}),_0xb56535['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x496a17=>'pending'!==_0x496a17&&'accepted'!==_0x496a17),this['bindTemplate']['if']('status',Bi,_0x27d2ae=>'pending'===_0x27d2ae),this['bindTemplate']['if']('status',Gi,_0x5b5618=>'pending'!==_0x5b5618),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x25b48b=>'accepted'===_0x25b48b)]}}),this['on']('change:status',(_0x4e1dc5,_0x17ea13,_0x7f4fcd)=>{_0x3b31a5['isEnabled']='pending'===_0x7f4fcd,'accepted'===_0x7f4fcd&&(_0x3b31a5['label']=Mi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x3b31a5['icon']=_0x6eb847);}),_0x3b31a5;}['_createDismissButtonView'](){const _0x5c4eea=new yt(this['locale']);return _0x5c4eea['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5c4eea['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x514868=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x514868['stopPropagation']();})},'attributes':{'class':[Gi,this['bindTemplate']['if']('status','ck-hidden',_0x4b85e6=>'pending'!==_0x4b85e6&&'rejected'!==_0x4b85e6),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x2904d3=>'pending'===_0x2904d3),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x5c4a35=>'rejected'===_0x5c4a35)]}}),this['on']('change:status',(_0x4fe850,_0x4133e1,_0x33a5e1)=>{_0x5c4eea['isEnabled']='pending'===_0x33a5e1,'rejected'===_0x33a5e1&&(_0x5c4eea['label']=Mi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x5c4eea['icon']=_0x5e45e9);}),_0x5c4eea;}['_createInfoButtonView'](){const _0x33d694=new yt(this['locale']);return _0x33d694['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x4d1218,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':Gi+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x33d694['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5234c6=>_0x5234c6),_0x33d694['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x33d694;}['_createOutdatedButtonView'](){const _0x285e40=new yt(this['locale']);return _0x285e40['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':st,'withText':!0x0,'isEnabled':!0x1}),_0x285e40['extendTemplate']({'attributes':{'class':[Gi,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x4cb304=>'outdated'!==_0x4cb304)],'disabled':'disabled'}}),_0x285e40;}}class AIReviewCoreBalloonSuggestionItemView extends zt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x1de019,_0x144cdf){super(_0x1de019),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x144cdf['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x3a2fc2){this['resultItemView']['changeId']=_0x3a2fc2['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x3a2fc2['contentDiffed'];}['showBalloon'](_0x41b1c6,_0x599ea8,_0x44ba28,_0x828a31,_0x1f2315,_0x58ca08){const _0x125c56=_0x599ea8();if(!_0x125c56)return;this['updateContent'](_0x41b1c6),this['show']();const _0x56eaf5=Array['from'](_0x125c56['getClientRects']())['reverse'](),_0x57968a=this['_getPointedRectIndexFromEvent'](_0x44ba28,_0x56eaf5),_0x3fc57a=_0x56eaf5[_0x57968a??0x0];'click'===_0x828a31?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x599ea8(),_0x57968a,_0x41b1c6['id'],_0x1f2315,_0x58ca08)||_0x3fc57a})):'hover'===_0x828a31&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x599ea8(),_0x57968a,_0x41b1c6['id'])||_0x3fc57a}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){jt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x4394a8=[this['element']];return this['_pinnedTargetElement']&&_0x4394a8['push'](this['_pinnedTargetElement']),_0x4394a8;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x5becaf=new Nt();return this['resultItemView']=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x5becaf['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x5becaf;}['_getBestRectPositionOnClick'](_0x3d75e5,_0x7c7a40,_0x4ee74c,_0x3a3f5f,_0x23b4a8){if(!_0x3d75e5)return null;const _0x293643=this['position']['replace']('arrow_',''),_0xd8cafe=Array['from'](_0x3d75e5['getClientRects']());let _0x686645,_0x15cf9c=_0xd8cafe['reverse']();return void 0x0!==_0x7c7a40&&this['_isPinnedRectVisible'](_0x15cf9c[_0x7c7a40],_0x3a3f5f,_0x23b4a8)?(_0x686645=_0x15cf9c[_0x7c7a40],this['_pinnedRectIndex']=_0x7c7a40):this['_isPinnedRectVisible'](_0x15cf9c[0x0],_0x3a3f5f,_0x23b4a8)&&void 0x0===_0x7c7a40?_0x686645=_0x15cf9c[0x0]:(_0x15cf9c='s'==_0x293643[0x0]?[..._0xd8cafe]['reverse']():_0xd8cafe,_0x15cf9c['forEach'](_0x18137e=>{this['_isPinnedRectVisible'](_0x18137e,_0x3a3f5f,_0x23b4a8)&&(_0x686645=_0x18137e);})),this['_pinnedTargetChangeId']=_0x4ee74c,this['_pinnedTargetElement']=_0x3d75e5,_0x686645||_0x3d75e5['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x27659c,_0x4e2fc3,_0x5192a7){if(!_0x27659c)return null;const _0xada571=Array['from'](_0x27659c['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x4e2fc3&&this['_pinnedTargetChangeId']!==_0x5192a7)return this['_pinnedRectIndex']=_0x4e2fc3,this['_pinnedTargetElement']=_0x27659c,this['_pinnedTargetChangeId']=_0x5192a7,_0xada571[_0x4e2fc3];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x5192a7){if(_0x27659c!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0xada571[this['_pinnedRectIndex']];}return void 0x0!==_0x4e2fc3&&this['_pinnedTargetChangeId']!==_0x5192a7?(this['_pinnedRectIndex']=_0x4e2fc3,this['_pinnedTargetElement']=_0x27659c,this['_pinnedTargetChangeId']=_0x5192a7,_0xada571[_0x4e2fc3]):_0x27659c['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x490dae,_0x3a0310){if(_0x490dae)for(let _0x2fb049=0x0;_0x2fb049<_0x3a0310['length'];_0x2fb049++){const _0xfc5a32=_0x3a0310[_0x2fb049];if(_0x490dae['clientX']>=_0xfc5a32['left']-0x3&&_0x490dae['clientX']<=_0xfc5a32['right']+0x3&&_0x490dae['clientY']>=_0xfc5a32['top']-0x3&&_0x490dae['clientY']<=_0xfc5a32['bottom']+0x3)return _0x2fb049;}}['_isPinnedRectVisible'](_0x364dbf,_0x20a8df,_0xf807f6){const _0x1ed297=new dt(_0x364dbf),_0x581626=_0x20a8df||document['documentElement'],_0x5c6ca3=_0x1ed297['getIntersection'](Ot(_0xf807f6)),_0x2898a1=new dt(_0x581626)['getIntersection'](_0x1ed297);return!!(_0x5c6ca3&&_0x2898a1&&_0x1ed297['width']>0x0);}}const Jn=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class AIReviewCoreUI extends _0x5df7d5{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[AITabs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4338a7){super(_0x4338a7),this['_bodyCollection']=new Xt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...Jn)['to'](this),this['_balloonSuggestionView']=new AIReviewCoreBalloonSuggestionItemView(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0xa7da1=this['context']['plugins']['get']('AITabs');this['registerTab'](_0xa7da1);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x160d9a){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x38ed33=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x160d9a,_0x38ed33);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x25c0a3){_0x25c0a3&&('error-general'!==_0x25c0a3['status']?'error-chunk'!==_0x25c0a3['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x196554){this['_mainView']['addCheckRunResult'](_0x196554);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x1e4c50){this['_mainView']['showGeneralReviewCoreErrorView'](_0x1e4c50??Mi(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x323cd4,_0xe53f68){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x323cd4,_0xe53f68);}['setActiveStateInResults'](_0x1057e8){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x2b5b86=>{_0x2b5b86['id']===_0x1057e8&&_0x2b5b86['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x23a6c6=>_0x23a6c6['setItemAsInactive']());}['updateChangeState'](_0x25cd02,_0x3d96b8){'accepted'===_0x3d96b8||'rejected'===_0x3d96b8||'outdated'===_0x3d96b8?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x25cd02,_0x3d96b8):this['_mainView']['reviewCheckResultsView']['showResult'](_0x25cd02,_0x3d96b8);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x1fb4eb,_0x13117a,_0x1b4c50,_0x22dc45,_0x579307,_0x2c7473){this['_balloonSuggestionView']['showBalloon'](_0x1fb4eb,_0x13117a,_0x1b4c50,_0x22dc45,_0x579307,_0x2c7473);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x279ba8){const _0x375666=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x3af96c=>_0x3af96c['id']===_0x279ba8);return _0x375666?_0x375666['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class AIReviewCoreGeneralErrorView extends Nt{constructor(_0x178963){super(_0x178963),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x46f58f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x46f58f['if']('isVisible','ck-hidden',_0x1f4404=>!_0x1f4404)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x46f58f['to']('errorMessage')}]}]});}}class AIReviewCoreView extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0xa2cb38,_0x54d879){super(_0xa2cb38),this['reviewCoreHeader']=_0x54d879['header'],this['generalErrorView']=new AIReviewCoreGeneralErrorView(_0xa2cb38),this['reviewCheckListView']=_0x54d879['list'],this['reviewCheckListView']['delegate'](...Jn)['to'](this),this['reviewCheckResultsView']=_0x54d879['results'],this['reviewCheckResultsView']['delegate'](...Jn)['to'](this),this['reviewCompletedView']=_0x54d879['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x2004ae){this['reviewCheckResultsView']['addResult'](_0x2004ae),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x50bde8){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x50bde8;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class AIReviewCoreFinishReviewButtonView extends yt{constructor(_0x434668,_0x268368){super(_0x268368),this['set']({'label':_0x434668,'withText':!0x0,'class':Ui}),this['on']('execute',()=>{this['fire']('finishReview');});}}class AIReviewCoreUICheckResultsView extends Ht{['_resultViews'];['_resultsHeader'];['_resultsBody'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x29be24,_0x12e3aa){super(_0x29be24),this['_contents']=_0x12e3aa,this['_resultViews']=new _0x461da8(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_resultsBody']=this['_createResultsBodyView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new AIDisclaimerView(_0x29be24),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x535fcb=this['_createCombinedSkeletonLoader'](),_0x131758=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x131758['if']('isLoading','ck-ai_review__check-run_loading',_0x32fa5b=>_0x32fa5b),_0x131758['if']('isResultReady','ck-ai_review__check-run_ready',_0x2a3b21=>_0x2a3b21),_0x131758['if']('isVisible','ck-hidden',_0x24a1af=>!_0x24a1af)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x535fcb,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x1b0b2a){const _0xf85e5e=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],_0x1b0b2a['id']);_0xf85e5e['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0xf85e5e),_0xf85e5e['resultResponseView']['element']['innerHTML']=_0x1b0b2a['contentDiffed'];}['hideResult'](_0xcf2c61,_0x2b1e1d){if('pending'===_0x2b1e1d)return;const _0x2435a5=this['_resultViews']['find'](_0x7985ed=>_0x7985ed['id']===_0xcf2c61);_0x2435a5&&(_0x2435a5['status']=_0x2b1e1d,_0x2435a5['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x1bd82f,_0x31ecaf){if('pending'!==_0x31ecaf)return;const _0x527ae3=this['_resultViews']['find'](_0x17638c=>_0x17638c['id']===_0x1bd82f);_0x527ae3&&(_0x527ae3['status']=_0x31ecaf,_0x527ae3['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x4e7d4d,_0x11f83b){this['headerTitle']=_0x4e7d4d,this['headerSubtitle']=_0x11f83b||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new AISkeletonView(this['locale'],xs['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0xe16d17=new Nt(this['locale']),_0x359abc=[];for(let _0x6aca15=0x0;_0x6aca15<0x10;_0x6aca15++){const _0x2c1724=this['_createSkeletonLoader']();_0x2c1724['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x359abc['push'](_0x2c1724);}return _0xe16d17['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2b1a69=>!_0x2b1a69)]},'children':_0x359abc}),_0xe16d17;}['_createResultsBodyView'](){const _0x274cc2=new Nt(this['locale']);return _0x274cc2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2f5c5e=>_0x2f5c5e)]},'children':this['_resultViews']}),_0x274cc2;}['_createErrorView'](){const _0x2cbcd2=new Nt(this['locale']),_0x2016a7=new yt(this['locale']),t=this['locale']['t'];return _0x2cbcd2['delegate']('retryReview')['to'](this),_0x2016a7['set']({'label':t('Try\x20again'),'withText':!0x0,'class':Bi+'\x20ck-ai_review__check-run-error-retry-button'}),_0x2016a7['on']('execute',()=>{this['fire']('retryReview');}),_0x2cbcd2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x4f2d08=>!_0x4f2d08),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0xef6ab6=>'chunk'===_0xef6ab6)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x38fb7b=>'chunk'===_0x38fb7b)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0xcd8469=>'general'!==_0xcd8469)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x270265=>'chunk'!==_0x270265)]},'children':[{'text':Mi(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x2016a7]}),_0x2cbcd2;}['_createCancelButtonView'](){const _0x168c04=new yt(this['locale']);return _0x168c04['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[Bi+'\x20ck-ai-button-stop-generating'],'icon':_0x31e237}),_0x168c04['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4b3cb1=>_0x4b3cb1),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x112820=>_0x112820)]}}),_0x168c04['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x168c04;}['_createToggleDiffButtonView'](){const _0x217ae4=new yt(this['locale']);_0x217ae4['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x217ae4['bind']('isEnabled')['to'](this,'isError',_0x4f2c70=>!_0x4f2c70),_0x217ae4['extendTemplate']({'attributes':{'class':[Bi,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xceebaa=>!_0xceebaa),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x375054=>_0x375054)]}});const _0x5f17b2=Mi(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x1556bc=Mi(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x217ae4['bind']('isOn')['to'](this,'isToggleDiffOn',_0xf3c69b=>_0xf3c69b),_0x217ae4['bind']('icon')['to'](this,'isToggleDiffOn',_0x52d39b=>_0x52d39b?nt:rt),_0x217ae4['bind']('label')['to'](this,'isToggleDiffOn',_0x52c114=>_0x52c114?_0x5f17b2:_0x1556bc),_0x217ae4['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x217ae4;}['_createAcceptAllButtonView'](){const _0x31011d=new yt(this['locale']);return _0x31011d['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x31011d['bind']('isEnabled')['to'](this,'isError',_0x36f7ba=>!_0x36f7ba),_0x31011d['extendTemplate']({'attributes':{'class':[Ui,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4b06ab=>!_0x4b06ab),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5505dc=>_0x5505dc)]}}),_0x31011d['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x31011d;}['_createExitReviewButtonView'](){const _0x4e41a1=new yt(this['locale']);return _0x4e41a1['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x4e41a1['extendTemplate']({'attributes':{'class':[Gi,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2630c8=>!_0x2630c8),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x30eb05=>_0x30eb05)]}}),_0x4e41a1['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x4e41a1;}['_createResultHeaderView'](){const _0x12f42f=new Nt(this['locale']),_0x464ace=this['_createTitleView']();return _0x12f42f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x44cd33=>_0x44cd33)]},'children':[_0x464ace,{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x58b17e=>!_0x58b17e)],'title':Mi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')},'children':[{'text':Mi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x12f42f;}['_createTitleView'](){const _0x389dfa=new Nt(this['locale']),_0x46e33f=new AISpinnerView();return _0x46e33f['bind']('isVisible')['to'](this,'isResultReady',_0x4d8eb6=>!_0x4d8eb6),_0x389dfa['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3490bc=>_0x3490bc)]},'children':[_0x46e33f,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]}]}),_0x389dfa;}['_createFinishReviewButtonView'](){const _0x1513d1=new AIReviewCoreFinishReviewButtonView(Mi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x1513d1['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3add0a=>!_0x3add0a)]}}),_0x1513d1['delegate']('finishReview')['to'](this),_0x1513d1;}}class AIReviewCoreReviewCompletedView extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x550195,_0x1f8da6){super(_0x550195),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x1f8da6['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x1f8da6['headerText']);const _0x556002=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x556002['if']('isVisible','ck-hidden',_0x11e1d0=>!_0x11e1d0)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x1f8da6['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x232c98){const _0x3e5a0f=new AIReviewCoreFinishReviewButtonView(_0x232c98,this['locale']);return _0x3e5a0f['delegate']('finishReview')['to'](this),_0x3e5a0f;}['_createResultHeaderView'](_0x28aea8){const _0x81e30=new Nt(this['locale']);return _0x81e30['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title'],'title':_0x28aea8},'children':[{'text':_0x28aea8}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x81e30;}}class AIReviewCoreFormDropdownView extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x18993d,_0x289953){super(_0x18993d),this['_defaultValue']=_0x289953['default']||(_0x289953['data']['length']>0x0?_0x289953['data'][0x0]['id']:''),this['_defaultLabel']=_0x289953['data']['find'](_0x1bf62c=>_0x1bf62c['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Ft(this['locale']);const _0x9f01b7=this['_prepareListOptions'](_0x289953['data']);Jt(this['_dropdownView'],_0x9f01b7,{'role':'menu','ariaLabel':_0x289953['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2c32a4=>{_0x2c32a4['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x34b2d4=>{this['formValue']=_0x34b2d4['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x34b2d4['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x25c9dc=[]){const _0x3bb87a=new _t();this['resetToDefault']();for(const _0x2e7db4 of _0x25c9dc){const _0x4d550c=new Zt({'label':_0x2e7db4['label'],'withText':!0x0,'role':'menuitemradio','id':_0x2e7db4['id'],'model':_0x2e7db4});_0x4d550c['bind']('isOn')['to'](this,'formValue',_0x53bfe4=>_0x53bfe4===_0x4d550c['id']);const _0x3a6507={'type':'button','model':_0x4d550c};_0x3bb87a['add'](_0x3a6507);}return _0x3bb87a;}}class AIReviewCoreFormManagerView extends Ht{['_formItem']=null;constructor(_0x2456a1,_0x25bb57,_0x50d9d8){super(_0x2456a1),this['argsKey']=_0x25bb57?.['argsKey'];if('dropdown'===_0x25bb57['formType'])this['_formItem']=new AIReviewCoreFormDropdownView(this['locale'],_0x25bb57);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x56b45b=new _0x3efa29(this['locale'],{'children':[this['_formItem']],'class':[_0x50d9d8?'ck-form__row_with-submit':'']});_0x50d9d8&&_0x56b45b['children']['add'](_0x50d9d8),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x56b45b]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class AIReviewCorePromptInputView extends _0x24a1b9{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x429078){super(_0x429078),this['set']('isEmpty',!0x0),this['keystrokes']=new At(),this['minRows']=AIReviewCorePromptInputView['MIN_ROWS'],this['maxRows']=AIReviewCorePromptInputView['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class AIReviewCoreCustomCheckView extends Nt{['focusTracker']=new It();['keystrokes']=new At();['focusCycler'];['_focusables']=new _0x461da8();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x5c8d7a,_0x28b7ba,_0x5f2ee4=!0x1){super(_0x5c8d7a),this['_check']=_0x28b7ba,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x28b7ba['defaultModel']?_0x28b7ba['defaultModel']['id']:'',this['_defaultLabel']=_0x28b7ba['defaultModel']?_0x28b7ba['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x535e0b(this['locale'],()=>new AIReviewCorePromptInputView(_0x5c8d7a)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _t(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x5f2ee4),Jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x3efa29(this['locale'],{'children':[this['promptInputView']]}),new _0x3efa29(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x352646,_0x19aac6)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x19aac6()):_0x19aac6();}),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x41b57d=>{this['_focusables']['add'](_0x41b57d),this['focusTracker']['add'](_0x41b57d['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x2583e1 of this['_getFormValidators']()){const _0x340d4e=_0x2583e1();if(_0x340d4e)return this['promptInputView']['errorText']=_0x340d4e,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return Mi(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x20943a=new yt(this['locale']),t=this['locale']['t'];return _0x20943a['set']({'label':t('Submit'),'withText':!0x0,'class':Ui}),_0x20943a['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x20943a;}['_createCancelButtonView'](){const _0x23c971=new yt(this['locale']),t=this['locale']['t'];return _0x23c971['set']({'label':t('Cancel'),'withText':!0x0,'class':Gi}),_0x23c971['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xdc4aff=>{_0xdc4aff['stopPropagation']();})}}),_0x23c971['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x23c971;}['_setModelList'](_0x1e0906){this['_modelSelectionDropdownItems']['clear']();const _0x6d9328=this['_check']['models'];if(_0x1e0906)this['set']('modelDisplayMode','hidden');else{const _0x179c95=0x1===_0x6d9328['length'];this['set']('modelDisplayMode',_0x179c95?'name':'selector');}if(this['resetToDefault'](),_0x6d9328?.['length']){0x1===_0x6d9328['length']&&this['set']('activeModelName',_0x6d9328[0x0]['name']||_0x6d9328[0x0]['id']);for(const _0x27e14f of _0x6d9328){const _0x234ea7=new Zt({'label':_0x27e14f['name'],'withText':!0x0,'role':'menuitemradio','id':_0x27e14f['id'],'model':_0x27e14f});_0x234ea7['bind']('isOn')['to'](this,'modelId',_0x2ccba6=>_0x2ccba6===_0x27e14f['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x234ea7,'labelView':new ModelButtonLabelView(this['locale'],_0x27e14f)});}}}['_createModelSelectionDropdown'](){const _0x46bebb=Ft(this['locale']);return _0x46bebb['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x46bebb['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':Gi}),_0x46bebb['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3e5b1a=>'selector'===_0x3e5b1a),this['listenTo'](_0x46bebb,'execute',_0x8e422f=>{this['modelId']=_0x8e422f['source']['model']['id'],_0x46bebb['buttonView']['label']=_0x8e422f['source']['label'];}),_0x46bebb;}['_createModelNameView'](){const _0x5ce2f9=new ModelNameView(this['locale']);return _0x5ce2f9['bind']('text')['to'](this,'activeModelName',_0x1988a0=>_0x1988a0??''),_0x5ce2f9['bind']('isVisible')['to'](this,'modelDisplayMode',_0x137273=>'name'===_0x137273),_0x5ce2f9;}['_createActionsFooterView'](){const _0x3991ca=new Nt(this['locale']);return _0x3991ca['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x3991ca;}}class ModelNameView extends Nt{constructor(_0x4e5700){super(_0x4e5700),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x272c39=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x272c39['if']('isVisible','ck-hidden',_0x4483eb=>!_0x4483eb)]},'children':[{'text':_0x272c39['to']('text')}]});}}class ModelButtonLabelView extends Mt{constructor(_0x171111,_0xdfd9b1){super();const _0x5b9c32=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5b9c32['to']('style'),'id':_0x5b9c32['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x5b9c32['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0xdfd9b1['description']||'']}]}]});}}class AIReviewCoreReviewCommandListItemView extends Ht{['_formItemsCollection']=new _0x461da8();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x240974,_0x2e2e65,_0x3ff580,_0x2740cf=!0x1){super(_0x240974),this['_hideModels']=_0x2740cf,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x2e2e65['isParameterized']);const _0x12d5e7=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0xc2b632=>_0xc2b632),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x25c2d6=>_0x25c2d6)],'style':{'--ck-ai-review-check-list-item-index':_0x3ff580}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x2e2e65['title']}]},_0x12d5e7]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x2e2e65['description']?[{'text':_0x2e2e65['description']}]:[]}]}]},..._0x2e2e65['isParameterized']?[this['_createParameterizedView'](_0x2e2e65)]:[],...'custom'===_0x2e2e65['id']?[this['_createCustomView'](_0x2e2e65,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x2e2e65['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x2e2e65['id'],'args':_0x2e2e65['useArgs']?_0x2e2e65['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&jt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x49a6a1=>{_0x49a6a1['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x52ce90=new Lt();return _0x52ce90['content']=ot,_0x52ce90['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x52ce90;}['_createParameterizedView'](_0x5abfde){const _0x17eccf=new Nt(),_0x29a6b7=this['_createFormView'](_0x5abfde);return _0x17eccf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x5e5ef7=>!_0x5e5ef7)]},'children':[_0x29a6b7]}),_0x17eccf;}['_createFormView'](_0x30b28f){const _0x1a3c26=new Nt(),_0x2fb788=Array['isArray'](_0x30b28f['options'])?_0x30b28f['options']:[],_0xb706bf=new yt(this['locale']),t=this['locale']['t'];_0xb706bf['set']({'label':t('Submit'),'withText':!0x0,'class':Ui}),_0xb706bf['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x481f9a=>{_0x481f9a['stopPropagation']();})}}),_0xb706bf['on']('execute',()=>{const _0x13cc9d=[],_0x48bb9c={};this['_formItemsCollection']['forEach'](_0x2307c8=>{_0x13cc9d['push'](_0x2307c8['value']),_0x30b28f['useArgs']&&_0x30b28f['options']&&(_0x48bb9c[_0x2307c8['argsKey']]=_0x2307c8['value']);}),this['fire']('runReviewCheck',{'id':_0x30b28f['id'],'params':_0x13cc9d['length']?_0x13cc9d:void 0x0,'args':Object['keys'](_0x48bb9c)['length']?_0x48bb9c:void 0x0});});const _0x3e3a79=_0x2fb788['length'];return _0x2fb788['forEach']((_0x460868,_0x1f2e9d)=>{const _0xf3af7e=_0x1f2e9d===_0x3e3a79-0x1;this['_formItemsCollection']['add'](new AIReviewCoreFormManagerView(this['locale'],_0x460868,_0xf3af7e?_0xb706bf:null));}),_0x1a3c26['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x1a3c26;}['_createCustomView'](_0x321e13,_0x22653c=!0x1){return this['_customCheckView']=new AIReviewCoreCustomCheckView(this['locale'],_0x321e13,_0x22653c),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x462db5=>!_0x462db5)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x4a2316,_0x1f4b6c,_0x11c23f)=>{_0x11c23f||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class AIReviewCoreReviewCheckListView extends Ht{['_checkViews'];constructor(_0x162722){super(_0x162722),this['_checkViews']=new _0x461da8(),this['_setupTemplate']();}['setChecks'](_0x564a63,_0x285d22=!0x1){this['_checkViews']['clear']();for(const [_0x4ab2f,_0x2fd791]of _0x564a63['entries']()){const _0x322f23=new AIReviewCoreReviewCommandListItemView(this['locale'],_0x2fd791,_0x4ab2f,_0x285d22);_0x322f23['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x322f23);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x536e95 of this['_checkViews'])_0x536e95 instanceof AIReviewCoreReviewCommandListItemView&&_0x536e95['resetToDefault']();}['_setupTemplate'](){const _0x556b8f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x556b8f['if']('isVisible','ck-hidden',_0xec4e9a=>!_0xec4e9a)]},'children':this['_checkViews']});}}class AIReviewModeUI extends AIReviewCoreUI{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0xd4e0e1=this['context']['plugins']['get']('AITabs'),_0x214c8a=this['context']['locale'],_0xa190b2=new AIHeaderView(_0x214c8a,{'label':Mi(_0x214c8a,'AI_REVIEW_MODE'),'icon':_0x46396f,'class':'ck-ai-header_review','showResizeButton':_0xd4e0e1['showResizeButton']});return _0xa190b2['delegate']('resizeTabs')['to'](_0xd4e0e1),_0xa190b2['bind']('isMaximized')['to'](_0xd4e0e1['view'],'isMaximized',_0xc4ffc1=>_0xc4ffc1),new AIReviewCoreView(this['context']['locale'],{'header':_0xa190b2,'list':new AIReviewCoreReviewCheckListView(_0x214c8a),'results':new AIReviewCoreUICheckResultsView(_0x214c8a,{'generalErrorText':Mi(_0x214c8a,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x214c8a,{'headerText':Mi(_0x214c8a,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':Mi(_0x214c8a,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':Mi(_0x214c8a,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x2124ac=this['context']['plugins']['get']('AITabs');_0x2124ac['view']['on']('activateTab',(_0x2962d6,{newTab:_0x45c74d,oldTab:_0x5d37ba})=>{'reviewMode'===_0x45c74d?this['fire']('getReviewCheckList'):'reviewMode'===_0x5d37ba&&this['fire']('leaveReview');}),_0x2124ac['view']['addTab']({'id':'reviewMode','buttonLabel':Mi(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x46396f,'order':0x0,'content':this['_mainView']});}}const Zn='review-',tr=['softBreak'],er=['htmlScript','htmlStyle','htmlCustomElement'];class AIReviewCoreEditing extends _0x5df7d5{static get['requires'](){return[_0x4d0fee,AIEditing];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];['_reviewEditingAttachedEditors']=new WeakSet();['_boundEditables']=new WeakMap();constructor(_0x4fc7ac){super(_0x4fc7ac),this['_domEmitter']=new(vt())(),this['_eventEmitter']=new(Et())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x4439d0=_0x414d75=>this['_scheduleAttachReviewEditingToEditor'](_0x414d75);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x2b21e9)return void _0x4439d0(this['context']);const _0x5efc66=this['context'];for(const _0x340267 of _0x5efc66['editors'])_0x4439d0(_0x340267);this['listenTo'](_0x5efc66['editors'],'add',(_0x220692,_0x5e7127)=>{_0x4439d0(_0x5e7127);}),this['listenTo'](_0x5efc66['editors'],'remove',(_0x164a9d,_0x4ba4a7)=>{for(const [_0x3aa184,_0x3eb9aa]of this['_markers'])_0x3eb9aa['editor']===_0x4ba4a7&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x3aa184,'changeId':_0x3eb9aa['groupId']}),this['_markers']['delete'](_0x3aa184));});}['_scheduleAttachReviewEditingToEditor'](_0x102fb9){const _0x1f0c89=()=>{'destroyed'!==_0x102fb9['state']&&_0x102fb9['conversion']&&this['_attachReviewEditingToEditor'](_0x102fb9);};if('ready'===_0x102fb9['state'])return void _0x1f0c89();const _0x1a3a62=()=>{this['stopListening'](_0x102fb9,'ready',_0x1a3a62),_0x1f0c89();};this['listenTo'](_0x102fb9,'ready',_0x1a3a62);}['_attachReviewEditingToEditor'](_0xcc9b75){this['_reviewEditingAttachedEditors']['has'](_0xcc9b75)||(_0xcc9b75['conversion']['for']('editingDowncast')['markerToElement']({'model':Zn+'insert','view':(_0x2393d2,{writer:_0x3791ac})=>{const _0x32efb1=this['_markers']['get'](_0x2393d2['markerName']),_0xf80897={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x32efb1?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2393d2['markerName']};return _0x3791ac['createUIElement']('span',_0xf80897,function(_0x5208ac){const _0x3fdcf7=this['toDomElement'](_0x5208ac);return _0x3fdcf7['innerHTML']=_0x32efb1?.['content']?.['asString']||'',_0x3fdcf7;});}}),_0xcc9b75['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zn+'remove-only','view':_0x1b2912=>{const _0x4da33d=this['_markers']['get'](_0x1b2912['markerName']),_0x2c61ac=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x4da33d?.['id']||'')&&_0x2c61ac['push']('ck-ai_review__change_active'),{'classes':_0x2c61ac,'attributes':{'data-marker-id':_0x1b2912['markerName']}};}}),_0xcc9b75['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zn+'remove-context','view':_0x4fac5c=>{const _0x41fc73=this['_markers']['get'](_0x4fac5c['markerName']),_0x533436=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x41fc73?.['id']||'')&&_0x533436['push']('ck-ai_review__change_active'),{'classes':_0x533436,'attributes':{'data-marker-id':_0x4fac5c['markerName']}};}}),_0xcc9b75['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zn+'remove-text','view':_0x1318f2=>{const _0x3ad967=this['_markers']['get'](_0x1318f2['markerName']),_0x45bcdc=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x3ad967?.['id']||'')&&_0x45bcdc['push']('ck-ai_review__change_active'),{'classes':_0x45bcdc,'attributes':{'data-marker-id':_0x1318f2['markerName']}};}}),_0xcc9b75['conversion']['for']('dataDowncast')['markerToElement']({'model':Zn+'suggestion-context','view':(_0x31c0ca,{writer:_0x70b6d9})=>_0x70b6d9['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x31c0ca['isOpening']?'start':'end')})}),_0xcc9b75['conversion']['for']('downcast')['attributeToAttribute']({'model':_0xbb716,'view':_0x188ac1}),this['_updateMouseMarkerInteractionListeners'](_0xcc9b75),this['listenTo'](_0xcc9b75,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0xcc9b75),{'priority':'lowest'}),this['listenTo'](_0xcc9b75,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0xcc9b75),{'priority':'lowest'}),_0xcc9b75['model']['document']['registerPostFixer'](_0x422929=>this['_validateMarkers'](_0xcc9b75,_0x422929)),_0xcc9b75['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0xcc9b75)),this['_reviewEditingAttachedEditors']['add'](_0xcc9b75));}['_updateMouseMarkerInteractionListeners'](_0x4ef8fb){let _0x168d92=this['_boundEditables']['get'](_0x4ef8fb);_0x168d92||(_0x168d92=new Map(),this['_boundEditables']['set'](_0x4ef8fb,_0x168d92));const _0x1fe62f=new Set(_0x4ef8fb['ui']['getEditableElementsNames']());for(const _0x32681d of _0x1fe62f){if(_0x168d92['has'](_0x32681d))continue;const _0x5365cd=_0x4ef8fb['ui']['getEditableElement'](_0x32681d);_0x168d92['set'](_0x32681d,_0x5365cd),this['_attachMouseMarkerInteractionListeners'](_0x5365cd);}for(const [_0x3a307f,_0x4a03b4]of _0x168d92)_0x1fe62f['has'](_0x3a307f)||(_0x168d92['delete'](_0x3a307f),this['_domEmitter']['stopListening'](_0x4a03b4));}['_attachMouseMarkerInteractionListeners'](_0x571fc1){this['_domEmitter']['listenTo'](_0x571fc1,'mouseup',(_0x5e8ae0,_0x55939c)=>{const _0x11703a=_0x55939c['target'],_0x3e58ad=this['_findMarkerElement'](_0x11703a);if(!_0x3e58ad)return;const _0x4ddfe2=_0x3e58ad['getAttribute']('data-marker-id'),_0x1b7683=_0x4ddfe2['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x4ddfe2,'changeId':_0x1b7683,'markerElement':()=>this['_findMarkerElementById'](_0x4ddfe2),'domEvent':_0x55939c});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x571fc1,'mouseover',(_0x302e50,_0x50340a)=>{const _0x18d38c=_0x50340a['target'],_0x468c69=_0x50340a['relatedTarget'];let _0x13b0c8=this['_findMarkerElement'](_0x18d38c);if(!_0x13b0c8&&_0x468c69&&(_0x13b0c8=this['_findMarkerElement'](_0x468c69)),!_0x13b0c8)return;const _0xa7052e=_0x13b0c8['getAttribute']('data-marker-id'),_0x487725=_0xa7052e['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x487725,'markerElement':()=>this['_findMarkerElementById'](_0xa7052e),'domEvent':_0x50340a});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x1b20e1((_0x48bcf9,_0x1837c0)=>{const _0x527a00=_0x1837c0['target'];if(this['_findMarkerElement'](_0x527a00))return;_0x527a00['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x1d78a4=this['context']['plugins']['get']('AIEditing'),_0x132139=Cs(this['context']);if(!_0x132139['length'])throw new ht('ai-get-editor-from-context-no-editor',this);const _0x129255=new Set(),_0x1f2cc2=[],_0xc11fc1=new Map();for(const _0x1a4c26 of _0x132139)for(const _0x119840 of _0x1a4c26['model']['document']['getRoots']()){if('$graveyard'===_0x119840['rootName'])continue;const _0x49c86f=this['_buildDocumentDataSliceForRoot'](_0x1a4c26,_0x119840,_0x1d78a4,_0x129255);_0x1f2cc2['push'](_0x49c86f['content']);for(const [_0x2d6b7,_0x501176]of _0x49c86f['elements'])_0xc11fc1['set'](_0x2d6b7,_0x501176);}return{'elements':_0xc11fc1,'content':_0x1f2cc2['join']('')};}['_buildDocumentDataSliceForRoot'](_0x462427,_0xee6146,_0x3873e9,_0x1b7634){const _0x3d4941=_0x462427['model'],_0x312f0d=new _0x415042();for(const _0x2e70a9 of _0xee6146['getChildren']())_0x312f0d['_appendChild'](_0x2e70a9['_clone'](!0x0));for(const _0x124223 of _0x3d4941['markers']){const _0x13b1e5=_0x124223['getRange']();_0x13b1e5&&_0x13b1e5['root']['rootName']===_0xee6146['rootName']&&_0x312f0d['markers']['set'](_0x124223['name'],this['_changeRangeOwnerDocument'](_0x13b1e5['clone'](),_0x312f0d));}const _0x73a8f0=new Map(),_0x3d045a=_0x3d4941['document']['version'],_0x4f0743=new _0x3403b6({'ignoreElementEnd':!0x0,'startPosition':_0x3d4941['createPositionAt'](_0x312f0d,0x0)});for(const {item:_0x1a0726}of _0x4f0743){if(_0x1a0726['is']('element')&&_0x1a0726['name']&&er['includes'](_0x1a0726['name'])){const _0x48f880=this['_upsertDataId'](_0x1a0726,()=>_0x3873e9['_nextDataId'](_0x1b7634));_0x1b7634['add'](_0x48f880);}if(!_0x1a0726['is']('$textProxy'))continue;const _0x320d8a=_0x1a0726['parent'];if(!_0x320d8a||!_0x320d8a['is']('element'))continue;const _0x3604e4=this['_upsertDataId'](_0x320d8a,()=>_0x3873e9['_nextDataId'](_0x1b7634));_0x1b7634['add'](_0x3604e4);for(const _0x22c278 of _0x320d8a['getChildren']())_0x22c278['is']('element')&&(_0x22c278['name']&&tr['includes'](_0x22c278['name'])||_0x1b7634['add'](this['_upsertDataId'](_0x22c278,()=>_0x3873e9['_nextDataId'](_0x1b7634))));let _0x578d5f=_0x320d8a;for(;_0x578d5f['parent']&&!_0x578d5f['parent']['is']('documentFragment');)_0x578d5f=_0x578d5f['parent'],_0x578d5f['hasAttribute'](_0xbb716)&&_0x578d5f['_removeAttribute'](_0xbb716);_0x73a8f0['set'](_0x3604e4,{'editor':_0x462427,'rootName':_0xee6146['rootName'],'path':_0x320d8a['getPath'](),'documentVersion':_0x3d045a,'getContent':this['_createGetContentUsingDataIdFn'](_0x578d5f['_clone'](!0x0),_0x3604e4,_0x462427['data'])}),_0x4f0743['jumpTo'](_0x3d4941['createPositionAfter'](_0x320d8a));}return{'content':_0x462427['data']['processor']['toData'](_0x462427['data']['toView'](_0x312f0d)),'elements':_0x73a8f0};}['diffContent'](_0x532e17,_0x4bb777,_0x42e92d,_0x27e835=!0x1){const _0x52be1c=[],_0x2512c4=_0x532e17['data']['parse'](_0x42e92d,'$documentFragment'),_0x4887d5=_0x532e17['data']['parse'](_0x4bb777,'$documentFragment'),_0x2d3af1=_0x532e17['model']['createPositionAt'](_0x4887d5,0x0);if(this['_haveSingleTopLevelElement'](_0x2512c4)){if(!this['_hasSameTopLevelElement'](_0x4887d5,_0x2512c4))return _0x52be1c;}else{const _0x40a24c=_0x532e17['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x4887d5,_0x40a24c)||!this['_haveOnlyInlineContent'](_0x2512c4,_0x40a24c))return _0x52be1c;}const _0x3a5327=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x4bb777,_0x42e92d,{'targetEditor':_0x532e17,'anchor':_0x2d3af1,'markDeletions':!0x0})['getOperations']()['filter'](_0x511e89=>'insert'===_0x511e89['type']||'marker'===_0x511e89['type']&&_0x511e89['name']['startsWith']('$markedRemove')),_0x14bff8=this['_groupAdjacentOperations'](_0x3a5327),_0x33a361=[];if(_0x27e835){if(_0x14bff8['length']){const _0x2e8674=_0x14bff8[0x0]['operations'][0x0],_0xf43dc1='insert'===_0x2e8674['type']?_0x2e8674['position']:_0x2e8674['newRange']['start'],_0x336b27=this['_getPositionLimitingRange'](_0xf43dc1,_0x532e17,'inside'),_0x1123cb=_0x336b27?_0x2512c4['getChild'](0x0)['getChildren']():_0x2512c4['getChildren'](),_0x4ac70e=_0x336b27||_0x532e17['model']['createRangeIn'](_0x4887d5),_0x21ec58=[new _0x4b10e1('$markedRemove:synthetic'+at(),null,_0x4ac70e,_0x532e17['model']['document']['model']['markers'],!0x0,_0x532e17['model']['document']['version']+0x1),new _0x1d1cfc(_0x4ac70e['end'],_0x1123cb,_0x532e17['model']['document']['version']+0x2)];_0x33a361['push']({'operations':_0x21ec58,'operationsIsolated':_0x21ec58,'groupOffset':0x0});}}else _0x33a361['push'](..._0x14bff8);let _0x2da49f=0x0;return _0x532e17['model']['change'](_0x4b86ec=>{for(let _0x4604e2=0x0;_0x4604e2<_0x33a361['length'];_0x4604e2++){const _0x3bf88e=_0x33a361[_0x4604e2],_0x5b43a4=_0x4b86ec['createDocumentFragment']();for(const _0x336784 of _0x4887d5['getChildren']())_0x4b86ec['append'](_0x336784['_clone'](!0x0),_0x5b43a4);for(const _0x483b72 of _0x3bf88e['operationsIsolated'])if('insert'===_0x483b72['type']){const _0x53ec49=_0x483b72;_0x53ec49['baseVersion']=null,_0x53ec49['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x53ec49,_0x5b43a4),_0x4b86ec['batch']['addOperation'](_0x483b72),_0x532e17['model']['applyOperation'](_0x483b72);const _0x3a3337='suggestion:insertion:id:authorId:'+_0x2da49f++,_0x16165a=_0x532e17['model']['createRange'](_0x53ec49['position'],_0x53ec49['position']['getShiftedBy'](_0x53ec49['howMany']));_0x5b43a4['markers']['set'](_0x3a3337,_0x16165a);}else{if('marker'===_0x483b72['type']&&_0x483b72['name']['startsWith']('$markedRemove')){const _0x517071=_0x483b72,_0x3c2695='suggestion:deletion:id:authorId:'+_0x2da49f++;this['_changeOperationOwnerDocument'](_0x517071,_0x5b43a4),_0x5b43a4['markers']['set'](_0x3c2695,_0x517071['newRange']);}}if(_0x27e835)_0x52be1c['push']({..._0x3bf88e,'context':this['_createGetContentFn'](_0x4887d5,_0x532e17['data']),'content':this['_createGetContentFn'](_0x4887d5,_0x532e17['data'])});else{const _0x509e61=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x3bf88e['operationsIsolated'][0x0]),_0x5b43a4),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x3bf88e['operationsIsolated'][_0x3bf88e['operationsIsolated']['length']-0x1]),_0x5b43a4),_0x532e17);_0x5b43a4['markers']['set'](Zn+'suggestion-context',new _0x14d15a(_0x509e61['start'],_0x509e61['end'])),_0x52be1c['push']({..._0x3bf88e,'context':this['_createGetContextFn'](_0x5b43a4,_0x532e17['data'],{'ellipsisBefore':_0x509e61['hasContentBefore'],'ellipsisAfter':_0x509e61['hasContentAfter']}),'content':this['_createGetContentFn'](_0x5b43a4,_0x532e17['data'])});}}}),_0x52be1c;}['markChangePositionInEditorContent'](_0x3f5471,_0x545109){if(!_0x3f5471['length'])return;const _0x5c9b22=_0x3f5471[0x0]['parent']['id'],_0xb875a4=_0x545109['elements']['get'](_0x5c9b22);if(!_0xb875a4)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x5c9b22);const _0x75a2d0=_0xb875a4['path'],_0x450a98=_0xb875a4['editor'],_0x1fb202=_0x450a98['model']['document']['getRoot'](_0xb875a4['rootName']);if(!_0x1fb202)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0xb875a4['rootName']);const _0x2987ad=_0x450a98['model']['document']['history']['getOperations'](_0xb875a4['documentVersion']),_0x598b28=[];for(const _0x3a304d of _0x3f5471){const _0x298b5b=_0x3a304d['operationsIsolated']['map'](_0x17fdaf=>this['_translateOperationToEditorContent'](_0x17fdaf,_0x75a2d0,_0x1fb202));if(!_0x298b5b||!_0x298b5b['length'])continue;const _0x3fcf73=_0x298b5b['every'](_0x2d533a=>'marker'===_0x2d533a['type']&&_0x2d533a['name']['startsWith']('$markedRemove')),_0x59f5c4={'document':_0x450a98['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x98b662=_0x4779ab(_0x298b5b,_0x2987ad,_0x59f5c4)['operationsA'];for(const _0x1216eb of _0x98b662)if('insert'===_0x1216eb['type']){const _0x1bb4fd=_0x1216eb,_0x36ba0b=_0x1bb4fd['nodes'];_0x450a98['model']['change'](_0x24652f=>{const _0x510d5e=_0x24652f['createDocumentFragment']();for(const _0x3f9778 of _0x36ba0b)_0x24652f['append'](_0x3f9778['_clone'](!0x0),_0x510d5e);_0x598b28['push']({'start':_0x1bb4fd['position'],'end':_0x1bb4fd['position'],'type':'insert','groupId':_0x3a304d['id'],'content':{'asString':this['_createGetContentFn'](_0x510d5e,_0x450a98['data'])(),'asFragment':_0x510d5e}});});}else{if('marker'===_0x1216eb['type']&&_0x1216eb['name']['startsWith']('$markedRemove')){const _0x3c2e31=_0x1216eb;let _0xd26ad2='remove-text';if(_0x3fcf73){const _0x11efa0=this['_findAdjacentContextDistance'](_0x3c2e31['newRange']['start'],'backward',_0x450a98['model']['schema']),_0x8ed301=this['_findAdjacentContextDistance'](_0x3c2e31['newRange']['end'],'forward',_0x450a98['model']['schema']);if(_0x11efa0||_0x8ed301){const _0x36f376=_0x3c2e31['newRange']['start']['getShiftedBy'](-_0x11efa0),_0x47c7ce=_0x3c2e31['newRange']['end']['getShiftedBy'](_0x8ed301);_0x598b28['push']({'start':_0x36f376,'end':_0x47c7ce,'groupId':_0x3a304d['id'],'type':'remove-context'});}else _0xd26ad2='remove-only';}_0x598b28['push']({'start':_0x3c2e31['newRange']['start'],'end':_0x3c2e31['newRange']['end'],'groupId':_0x3a304d['id'],'type':_0xd26ad2});}}}this['_insertMarkers'](_0x598b28,_0x450a98);}['clearAllMarkers'](){const _0x32f7b8=new Map();for(const _0x4805a7 of this['_markers']['keys']()){const _0x44fcc7=this['_markers']['get'](_0x4805a7);_0x44fcc7?.['editor']&&(_0x32f7b8['has'](_0x44fcc7['editor'])||_0x32f7b8['set'](_0x44fcc7['editor'],[]),_0x32f7b8['get'](_0x44fcc7['editor'])['push'](_0x4805a7));}for(const [_0x22fb2d,_0x48dcf3]of _0x32f7b8)_0x22fb2d['model']['change'](_0x40198f=>{for(const _0x424d44 of _0x48dcf3)_0x22fb2d['model']['markers']['get'](_0x424d44)&&_0x40198f['removeMarker'](_0x424d44);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0xe8018e of Cs(this['context']))_0xe8018e['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0xd5f4d0 of Cs(this['context']))_0xd5f4d0['disableReadOnlyMode']('ai-review');}['applyChange'](_0xa45e){const _0x4d644e=_0xa45e['map'](_0x235b41=>this['_getMarkersDataForGroup'](_0x235b41))['flat'](),_0x17e060=new Map();for(const _0x3365d5 of _0x4d644e)_0x17e060['has'](_0x3365d5['editor'])||_0x17e060['set'](_0x3365d5['editor'],[]),_0x17e060['get'](_0x3365d5['editor'])['push'](_0x3365d5);for(const [_0x41d7b8,_0x450d9e]of _0x17e060){const _0x3bedb4=_0x41d7b8['model'];_0x3bedb4['change'](_0x524ff2=>{for(const _0x284e49 of _0x450d9e){const _0x4d028e=_0x41d7b8['model']['markers']['get'](_0x284e49['id']);if(_0x4d028e){if('insert'===_0x284e49['type']){if(!_0x284e49['content'])continue;_0x3bedb4['insertContent'](_0x284e49['content']['asFragment']||null,_0x4d028e['getRange']()['start']);}else'remove-text'!==_0x284e49['type']&&'remove-only'!==_0x284e49['type']||_0x3bedb4['deleteContent'](_0x3bedb4['createSelection'](_0x4d028e['getRange']()));_0x524ff2['removeMarker'](_0x284e49['id']),this['_markers']['delete'](_0x284e49['id']);}}});}}['rejectChange'](_0x13dec0){const _0x2eae4b=this['_getMarkersDataForGroup'](_0x13dec0),_0x3681f3=new Map();for(const _0x3e1da8 of _0x2eae4b)_0x3681f3['has'](_0x3e1da8['editor'])||_0x3681f3['set'](_0x3e1da8['editor'],[]),_0x3681f3['get'](_0x3e1da8['editor'])['push'](_0x3e1da8);for(const [_0x402844,_0x32c9a3]of _0x3681f3)_0x402844['model']['change'](_0x571a24=>{for(const _0x5dc6af of _0x32c9a3)_0x571a24['removeMarker'](_0x5dc6af['id']),this['_markers']['delete'](_0x5dc6af['id']);});}['getEditor'](){return ms(this['context']);}['getEditors'](){return Cs(this['context']);}['getEditorForChange'](_0x2cc8a0){const _0x5090bc=this['_getMarkersDataForGroup'](_0x2cc8a0);return _0x5090bc[0x0]?.['editor'];}['getMarkerElementForChange'](_0x568220){const _0x4d602d=Array['from'](this['_markers']['values']())['filter'](_0x55fc3f=>_0x55fc3f['groupId']===_0x568220);if(!_0x4d602d['length'])return null;const _0x533c8e=0x1===_0x4d602d['length']?_0x4d602d[0x0]:this['_sortMarkers'](_0x4d602d)[0x0],_0x299814=_0x533c8e['editor']['model']['markers']['get'](_0x533c8e['id']);if(!_0x299814)return null;return{'modelRange':_0x299814['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x533c8e['id'])};}['getContentElementForChange'](_0x3f002d){const _0x4be578=Array['from'](this['_markers']['values']())['filter'](_0x549bdb=>_0x549bdb['groupId']===_0x3f002d);if(!_0x4be578['length'])return null;const _0x3a1625=0x1===_0x4be578['length']?_0x4be578[0x0]:this['_sortMarkers'](_0x4be578)[0x0],_0x574b48=_0x3a1625['editor'],_0x496eb7=_0x574b48['model']['markers']['get'](_0x3a1625['id']);if(!_0x496eb7)return null;const _0x1536ab=_0x496eb7['getRange'](),_0x2c9c45=_0x574b48['editing']['view']['getDomRoot'](_0x1536ab['root']['rootName'])||_0x574b48['editing']['view']['getDomRoot']();if(!_0x2c9c45||!_0x1536ab)return null;let _0x354a54=_0x1536ab['start']['parent'];for(;_0x354a54['parent']&&!_0x354a54['parent']['is']('rootElement');)_0x354a54=_0x354a54['parent'];if(!_0x354a54||!_0x354a54['name'])return null;const _0x4b6c9a=_0x2c9c45['querySelector']('[data-marker-id=\x22'+_0x3a1625['id']+'\x22]');if(!_0x4b6c9a)return null;let _0x53a45a=null;_0x574b48['model']['change'](_0x9b94ed=>{_0x53a45a=_0x9b94ed['createDocumentFragment'](),_0x9b94ed['append'](_0x354a54['_clone'](!0x0),_0x53a45a);});const _0x1fd9a9=_0x574b48['data']['toView'](_0x53a45a)['getChild'](0x0);return _0x4b6c9a['closest'](_0x1fd9a9['name']);}['reactivateMarkers'](_0x42288f){const _0x15be35=this['_getMarkersDataForGroup'](_0x42288f);if(!_0x15be35['length'])return;const _0xb0a56=Array['from'](this['_activeMarkers'])['sort'](),_0x1b52cb=Array['from'](new Set(_0x15be35['map'](_0x21f0aa=>_0x21f0aa['id'])))['sort']();_0xb0a56['join']('|')!==_0x1b52cb['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x42288f));}['setMarkersInElementAsActive'](_0x25a979){const _0xbd7e40=this['_getMarkersDataForGroup'](_0x25a979);if(!_0xbd7e40['length'])return;const _0x293d11=_0xbd7e40[0x0]['editor'],_0x1ee063=new Set(_0xbd7e40['map'](_0x47e95c=>_0x47e95c['id'])),_0x25c1df=Array['from'](_0x1ee063['values']())['map'](_0x29c6c8=>_0x293d11['model']['markers']['get'](_0x29c6c8))['filter'](_0xb5256b=>!!_0xb5256b);_0x1ee063['forEach'](_0x5cecb4=>{this['_activeMarkers']['add'](_0x5cecb4);}),_0x293d11['model']['change'](()=>{_0x25c1df['forEach'](_0x37019c=>{_0x293d11['editing']['reconvertMarker'](_0x37019c);});});}['setAllMarkersAsInactive'](){const _0x40bbb0=Array['from'](this['_activeMarkers']);if(!_0x40bbb0['length'])return;this['_activeMarkers']['clear']();const _0x49b682=new Map();for(const _0x280542 of _0x40bbb0){const _0x5b6c49=this['_markers']['get'](_0x280542);if(!_0x5b6c49)continue;const _0x50d091=_0x5b6c49['editor'],_0x43371f=_0x50d091['model']['markers']['get'](_0x280542);_0x43371f&&(_0x49b682['has'](_0x50d091)||_0x49b682['set'](_0x50d091,[]),_0x49b682['get'](_0x50d091)['push'](_0x43371f));}for(const [_0x384d7f,_0x4ca509]of _0x49b682)_0x384d7f['model']['change'](()=>{_0x4ca509['forEach'](_0x1b0877=>{_0x384d7f['editing']['reconvertMarker'](_0x1b0877);});});}['_getPositionLimitingRange'](_0x71d66f,_0x53c768,_0x1fbfc8='outside'){if(!_0x71d66f)return null;let _0x3746aa=_0x71d66f['parent'];for(;_0x3746aa&&_0x3746aa['parent']&&!_0x3746aa['parent']['is']('rootElement')&&!_0x53c768['model']['schema']['isLimit'](_0x3746aa)&&!_0x53c768['model']['schema']['isBlock'](_0x3746aa);)_0x3746aa=_0x3746aa['parent'];if(!_0x3746aa||!_0x3746aa['name']||_0x3746aa['is']('rootElement'))return null;let _0x5ace38=null;return _0x53c768['model']['change'](_0x4b864c=>{_0x5ace38='inside'===_0x1fbfc8?_0x4b864c['createRangeIn'](_0x3746aa):_0x4b864c['createRangeOn'](_0x3746aa);}),_0x5ace38;}['_validateMarkers'](_0x36d035,_0x4049dd){const _0x2bd08b=Array['from'](this['_markers']['keys']()),_0x262c0d=new Map();for(const _0x5e9a25 of _0x2bd08b){const _0x1ef373=_0x36d035['model']['markers']['get'](_0x5e9a25);if(!_0x1ef373)continue;const _0x5a1456=_0x1ef373['getStart']()['root']['rootName']+':'+_0x1ef373['getStart']()['path'][0x0];_0x262c0d['has'](_0x5a1456)||_0x262c0d['set'](_0x5a1456,[]),_0x262c0d['get'](_0x5a1456)['push'](_0x1ef373);}const _0x34b7a9=new Set();for(const _0x2028c2 of _0x36d035['model']['document']['differ']['getChanges']()){let _0x65cc0a='',_0x43173a=null;if('insert'===_0x2028c2['type'])_0x43173a=new _0x14d15a(_0x2028c2['position'],_0x2028c2['position']['getShiftedBy'](_0x2028c2['length'])),_0x65cc0a=_0x2028c2['position']['root']['rootName']+':'+_0x2028c2['position']['path'][0x0];else{if('remove'!==_0x2028c2['type'])continue;_0x43173a=new _0x14d15a(_0x2028c2['position']),_0x65cc0a=_0x2028c2['position']['root']['rootName']+':'+_0x2028c2['position']['path'][0x0];}const _0x2faab4=_0x262c0d['get'](_0x65cc0a)||[];if(_0x2faab4['length']){for(const _0x4adefd of _0x2faab4)if(_0x43173a['root']['rootName']===_0x4adefd['getRange']()['root']['rootName']&&('insert'!==_0x2028c2['type']||!_0x43173a['containsRange'](_0x4adefd['getRange']()))&&(_0x43173a['isIntersecting'](_0x4adefd['getRange']())||_0x43173a['start']['isTouching'](_0x4adefd['getRange']()['end'])||_0x43173a['end']['isTouching'](_0x4adefd['getRange']()['start']))){const _0x434217=this['_parseMarkerName'](_0x4adefd['name']);Array['from'](this['_markers']['values']())['filter'](_0x3150e5=>_0x3150e5['groupId']===_0x434217['groupId'])['forEach'](_0x488d2d=>_0x34b7a9['add'](_0x488d2d['id']));}}}if(_0x34b7a9['size']){for(const _0x50f6b4 of _0x34b7a9)_0x4049dd['removeMarker'](_0x50f6b4);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xda85b4){for(const {name:_0x5285dd,data:_0x593b44}of _0xda85b4['model']['document']['differ']['getChangedMarkers']()){if(!_0x5285dd['startsWith'](Zn))continue;const _0x32bfea=_0x593b44['oldRange'],_0x5e6b65=_0x593b44['newRange'],_0x3cc7c2=_0x32bfea&&'$graveyard'===_0x32bfea['root']['rootName'],_0x3a260d=_0x5e6b65&&'$graveyard'===_0x5e6b65['root']['rootName'];if(_0x3cc7c2&&_0x3a260d)continue;const _0x4f5c69=this['_parseMarkerName'](_0x5285dd);this['_markers']['get'](_0x5285dd)&&(_0x3a260d||!_0x5e6b65?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x5285dd,'changeId':_0x4f5c69['groupId']}):_0x3cc7c2&&_0x5e6b65&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x5285dd,'changeId':_0x4f5c69['groupId']}));}}['_parseMarkerName'](_0x4c72a4){const _0x2f0fb8=_0x4c72a4['split'](':'),_0x326127=(_0x2f0fb8[0x1]||'')['split']('_');return{'prefix':_0x2f0fb8[0x0],'groupId':_0x326127[0x0],'suffix':_0x326127[0x1]};}['_translateOperationToEditorContent'](_0x30afeb,_0x51f287,_0x160f68){if('insert'===_0x30afeb['type']){const _0x3d8a8c=_0x30afeb;return new _0x1d1cfc(this['_changePosition'](_0x51f287['concat'](_0x3d8a8c['position']['offset']),_0x160f68),_0x3d8a8c['nodes'],_0x3d8a8c['baseVersion']);}if('marker'===_0x30afeb['type']&&_0x30afeb['name']['startsWith']('$markedRemove')){const _0x2c276a=_0x30afeb;return new _0x4b10e1(_0x2c276a['name'],_0x2c276a['oldRange'],this['_changeRange'](_0x2c276a['newRange'],_0x51f287['concat'](_0x2c276a['newRange']['start']['offset']),_0x51f287['concat'](_0x2c276a['newRange']['end']['offset']),_0x160f68),_0x2c276a['_markers'],_0x2c276a['affectsData'],_0x2c276a['baseVersion']);}return _0x30afeb;}['_groupAdjacentOperations'](_0x1568bf){if(!_0x1568bf['length'])return[];const _0x4f362f=[];let _0x4a5479=0x0,_0xe06bb1=0x0,_0x4e175a=[];for(let _0x201b71=0x0;_0x201b71<=_0x1568bf['length'];_0x201b71++){const _0x21c676=_0x1568bf[_0x201b71],_0x511c4f=_0x1568bf[_0x201b71-0x1];!_0x21c676||_0x511c4f&&!this['_getOperationEnd'](_0x511c4f)['isTouching'](this['_getOperationStart'](_0x21c676))?(_0x4f362f['push']({'operations':_0x4e175a,'operationsIsolated':_0x4e175a['map'](_0x14e8aa=>this['_shiftOperation'](_0x14e8aa['clone'](),-_0xe06bb1)),'groupOffset':_0x4a5479}),_0x4e175a=_0x21c676?[_0x21c676]:[],_0xe06bb1+=_0x4a5479,_0x4a5479=0x0):_0x4e175a['push'](_0x21c676),_0x21c676&&'insert'===_0x21c676['type']&&(_0x4a5479+=_0x21c676['howMany']);}return _0x4f362f;}['_findAdjacentContextDistance'](_0x4cb2cf,_0x1c0096,_0xcd181c,_0x3efbb3=0x1){const _0x1913a1=new _0x3403b6({'startPosition':_0x4cb2cf,'direction':_0x1c0096});let _0x42678c=0x0;for(let _0x4adfb5=0x0;_0x4adfb5<_0x3efbb3;_0x4adfb5++){let _0x55201e=0x0,_0x377c6d=!0x1,_0x55ed6e='forward'===_0x1c0096?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x22ae8e}of _0x1913a1)if(_0x22ae8e['is']('$textProxy')){const _0x20868e=_0x55ed6e['exec'](_0x22ae8e['data']);if(_0x20868e&&_0x20868e['length']){if(_0x55201e+='forward'===_0x1c0096?_0x20868e['index']+_0x20868e[0x0]['length']:_0x22ae8e['data']['length']-_0x20868e['index'],_0x20868e[0x0]['length']!==_0x22ae8e['data']['length'])break;_0x377c6d=!0x0,_0x55ed6e='forward'===_0x1c0096?/^\w+/:/\w+$/;}else{if(_0x377c6d)break;_0x55201e+=_0x22ae8e['offsetSize'];}}else{if(_0x22ae8e['is']('element')){_0xcd181c['isInline'](_0x22ae8e)&&!_0x377c6d&&(_0x55201e+=0x1);break;}}_0x42678c+=_0x55201e,_0x1913a1['jumpTo'](_0x4cb2cf['getShiftedBy']('forward'===_0x1c0096?_0x42678c:-_0x42678c));}return _0x42678c;}['_getChangeContext'](_0x52ccd9,_0x4f1364,_0x42ee9c){const _0x150d2b=_0x42ee9c['model']['schema'],_0x8c5aa7=this['_findAdjacentContextDistance'](_0x52ccd9,'backward',_0x150d2b,0x6),_0x571d78=this['_findAdjacentContextDistance'](_0x4f1364,'forward',_0x150d2b,0x6),_0x91b6d1=_0x52ccd9['getShiftedBy'](-_0x8c5aa7),_0x1b360d=_0x4f1364['getShiftedBy'](_0x571d78);return{'start':_0x91b6d1,'end':_0x1b360d,'hasContentBefore':!_0x91b6d1['isAtStart'],'hasContentAfter':!_0x1b360d['isAtEnd']};}['_insertMarkers'](_0x4c033d,_0x234372){const _0x4f8363=this['context']['plugins']['get']('AIEditing'),_0x40619d=new Set();_0x234372['model']['change'](_0x4717f8=>{for(const _0x27d52b of _0x4c033d){const _0x38e969=''+Zn+_0x27d52b['type']+':'+_0x27d52b['groupId']+'_'+_0x4f8363['_nextDataId'](_0x40619d);this['_markers']['set'](_0x38e969,{'id':_0x38e969,'groupId':_0x27d52b['groupId'],'type':_0x27d52b['type'],'content':_0x27d52b['content'],'editor':_0x234372}),_0x4717f8['addMarker'](_0x38e969,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4717f8['createRange'](_0x27d52b['start'],_0x27d52b['end'])});}});}['_createGetContextFn'](_0x13686a,_0x356c25,_0x465527){let _0x3dc307='';return()=>{if(!_0x3dc307){const _0x3c98d6=_0x356c25['toView'](_0x13686a,{'showSuggestionHighlights':!0x0});let _0x5cac04=_0x3c98d6['getChild'](0x0);if(_0x5cac04['is']('containerElement')||(_0x5cac04=_0x3c98d6),!_0x5cac04)return'';let _0x32a57b=!0x1;const _0x4b39cb=[];for(const _0x3d3f4b of _0x5cac04['getChildren']())_0x3d3f4b['is']('element','span')&&_0x3d3f4b['hasClass']('ck-ai_review-marker_context-end')&&(_0x32a57b=!0x1),_0x32a57b&&_0x4b39cb['push'](_0x3d3f4b),_0x3d3f4b['is']('element','span')&&_0x3d3f4b['hasClass']('ck-ai_review-marker_context-start')&&(_0x32a57b=!0x0);_0x5cac04['_removeChildren'](0x0,_0x5cac04['childCount']),_0x465527?.['ellipsisBefore']&&_0x5cac04['_appendChild']('…'),_0x5cac04['_appendChild'](_0x4b39cb),_0x465527?.['ellipsisAfter']&&_0x5cac04['_appendChild']('…');const _0xf9633b=_0x356c25['htmlProcessor']['domConverter']['viewToDom'](_0x3c98d6),_0xdb008c=_0x356c25['htmlProcessor']['htmlWriter']['getHtml'](_0xf9633b);_0x3dc307=this['_removeUnsupportedElements'](_0xdb008c);}return _0x3dc307;};}['_createGetContentFn'](_0x118829,_0x57f059){let _0x46a5de='';return()=>(_0x46a5de||(_0x46a5de=this['_removeUnsupportedElements'](_0x57f059['stringify'](_0x118829,{'showSuggestionHighlights':!0x0}))),_0x46a5de);}['_createGetContentUsingDataIdFn'](_0x45302f,_0x116906,_0x646e58){let _0x462141='';return()=>{if(!_0x462141){const _0x474de3=_0x646e58['toView'](new _0x415042(_0x45302f)),_0x19547c=_0x646e58['htmlProcessor']['domConverter']['viewToDom'](_0x474de3)['querySelector']('[data-id=\x22'+_0x116906+'\x22]');_0x462141=this['_removeUnsupportedElements'](_0x19547c?.['outerHTML']||'');}return _0x462141;};}['_removeUnsupportedElements'](_0x1d7ccc){if(!_0x1d7ccc)return'';const _0x5ebb62=Wi(_0x1d7ccc,{'decodeEntities':!0x1}),_0x4ad7ff=qi(_0x5ebb62);if(!_0x4ad7ff['length'])return _0x1d7ccc;for(const _0x1f6125 of _0x4ad7ff)_0x383ffd(_0x1f6125);return Ki(_0x5ebb62,{'encodeEntities':!0x1});}['_findMarkerElement'](_0x444493,_0x578169=0x5){let _0x4353cd=_0x444493,_0x37eecb=null;for(let _0xab4fad=0x0;_0xab4fad<_0x578169&&_0x4353cd;_0xab4fad++){if(!_0x4353cd['className']){_0x4353cd=_0x4353cd['parentElement'];continue;}if(!(''+_0x4353cd['className'])['includes']('ck-ai_review-marker_')){_0x4353cd=_0x4353cd['parentElement'];continue;}if(!_0x4353cd['getAttribute']('data-marker-id'))break;_0x37eecb=_0x4353cd;break;}return _0x37eecb;}['_findMarkerElementById'](_0x417015){const _0x232fa5=this['_markers']['get'](_0x417015);if(!_0x232fa5)return null;const _0x3f704d=_0x232fa5['editor']['model']['markers']['get'](_0x417015);return _0x3f704d?_0x3e2279(_0x232fa5['editor']['editing'],_0x3f704d):null;}['_getMarkersDataForGroup'](_0x410e2){return Array['from'](this['_markers']['values']())['filter'](_0x11a6f9=>_0x11a6f9['groupId']===_0x410e2);}['_getOperationStart'](_0x2884e0){return'insert'===_0x2884e0['type']?_0x2884e0['position']:_0x2884e0['newRange']['start'];}['_getOperationEnd'](_0x4cf517,_0xcc8a7a=!0x1){return'insert'===_0x4cf517['type']?_0xcc8a7a?_0x4cf517['position']:_0x4cf517['position']['getShiftedBy'](_0x4cf517['howMany']):_0x4cf517['newRange']['end'];}['_shiftOperation'](_0x4b1625,_0x497e22){return'insert'===_0x4b1625['type']?_0x4b1625['position']=_0x4b1625['position']['getShiftedBy'](_0x497e22):'marker'===_0x4b1625['type']&&_0x4b1625['newRange']&&(_0x4b1625['newRange']=new _0x14d15a(_0x4b1625['newRange']['start']['getShiftedBy'](_0x497e22),_0x4b1625['newRange']['end']['getShiftedBy'](_0x497e22))),_0x4b1625;}['_changeOperationOwnerDocument'](_0x331203,_0x55b653){'insert'===_0x331203['type']?_0x331203['position']=this['_changePositionOwnerDocument'](_0x331203['position'],_0x55b653):'marker'===_0x331203['type']&&_0x331203['newRange']&&(_0x331203['newRange']=this['_changeRangeOwnerDocument'](_0x331203['newRange'],_0x55b653));}['_changePositionOwnerDocument'](_0x78bb3e,_0x4b1bad){return new _0x590920(_0x4b1bad,_0x78bb3e['path']);}['_changeRangeOwnerDocument'](_0x174b9b,_0xa1601d){return new _0x14d15a(this['_changePositionOwnerDocument'](_0x174b9b['start'],_0xa1601d),this['_changePositionOwnerDocument'](_0x174b9b['end'],_0xa1601d));}['_changePosition'](_0x1a5223,_0x172f25){return new _0x590920(_0x172f25,[..._0x1a5223]);}['_changeRange'](_0x20d3f3,_0x597e17,_0x435223,_0x3218fb){return new _0x14d15a(this['_changePosition'](_0x597e17,_0x3218fb),this['_changePosition'](_0x435223,_0x3218fb));}['_sortMarkers'](_0x238b38){const _0x186002=_0x49ced9=>{switch(_0x49ced9){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x238b38['sort']((_0x827bba,_0xe8e25)=>_0x186002(_0x827bba['type'])-_0x186002(_0xe8e25['type']));}['_hasSameTopLevelElement'](_0x3ce357,_0x1d4581){const _0x4491ae=_0x3ce357['getChild'](0x0),_0x21132f=_0x1d4581['getChild'](0x0);return!(!_0x4491ae||!_0x21132f)&&((!_0x4491ae['is']('element')||!_0x21132f['is']('element')||_0x4491ae['name']===_0x21132f['name'])&&!(_0x4491ae['is']('element')&&!_0x21132f['is']('element')||!_0x4491ae['is']('element')&&_0x21132f['is']('element')));}['_haveSingleTopLevelElement'](_0x5337b7){return 0x1===_0x5337b7['childCount'];}['_haveOnlyInlineContent'](_0x455bce,_0x3a4129){for(const _0x49a564 of _0x455bce['getChildren']())if(_0x49a564['is']('element')&&!_0x3a4129['isInline'](_0x49a564))return!0x1;return!0x0;}['_upsertDataId'](_0xb6525,_0x57b0ea){let _0x1843f2=_0xb6525['getAttribute'](_0xbb716);return _0x1843f2||(_0x1843f2=_0x57b0ea(),_0xb6525['_setAttribute'](_0xbb716,_0x1843f2)),_0x1843f2;}}class AIReviewCheckResult extends Et(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x7826d1,contentNew:_0x4dc748,contentInitial:_0x9e32ea,documentVersion:_0x458192}){super(),this['id']=_0x7826d1,this['contentNew']=_0x4dc748,this['contentInitial']=_0x9e32ea,this['documentVersion']=_0x458192;}}class AIReviewCheckResultChange extends ct(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x57001f,_0x5ed48f,_0x1e636b){super(),this['id']=_0x57001f,this['parent']=_0x1e636b,this['_data']=_0x5ed48f,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class AIReviewCheckRun extends ct(){['id']=at();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x1c3449,_0x417d48,_0x1e6ff8,_0x53d3a7,_0x146931){super(),this['_sourceCheck']=_0x417d48,this['_documentData']=_0x1c3449,this['_aiConnector']=_0x1e6ff8,this['_reviewParams']=_0x53d3a7,this['_reviewArgs']=_0x146931,this['on']('change:status',(_0x51ad5b,_0x41c7aa,_0x4367af)=>{'aborted'==_0x4367af&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x4367af,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0x41a14a=>'pending'===_0x41a14a['status']);}get['currentError'](){return this['_currentError'];}get['results'](){return Array['from'](this['_results']['values']());}['updateDocumentData'](_0x493931){this['_documentData']=_0x493931;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x5902e2=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x1ed76f of _0x5902e2)'unmodified'!==_0x1ed76f['data']['operation']&&('error'!==_0x1ed76f['data']['operation']?'review-metadata'!==_0x1ed76f['event']?this['_addReviewCheckResult'](_0x1ed76f['data']['dataId'],_0x1ed76f['data']['textDelta']):this['callId']=_0x1ed76f['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x4c0039){this['_currentError']=_0x4c0039,_0x4c0039 instanceof Error&&_0x4c0039['message']['includes']('ai-request-aborted')?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async['restart'](){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,await this['start']();}['addResultChanges'](_0x4922c9,_0x5f3c91){const _0x37dcda=this['_results']['get'](_0x4922c9);if(!_0x37dcda)return;if(0x0===_0x5f3c91['length'])return;const _0x1cb8db=[];_0x5f3c91['forEach']((_0x4ea26c,_0x148169)=>{const _0x17e6e0=new AIReviewCheckResultChange(_0x37dcda['id']+'-'+_0x148169,_0x4ea26c,_0x37dcda);_0x17e6e0['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x17e6e0,'status':_0x17e6e0['status']});}),_0x17e6e0['on']('change:isActivated',()=>{_0x17e6e0['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x17e6e0}):this['fire']('reviewCheckResultDeactivated',{'change':_0x17e6e0});}),this['_changes']['push'](_0x17e6e0),_0x1cb8db['push'](_0x17e6e0);}),this['fire']('reviewCheckResultReady',{'changes':_0x1cb8db,'result':_0x37dcda,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x44fe89){const _0x5c8f81=this['_changes']['find'](_0x4364e4=>_0x4364e4['id']===_0x44fe89);return!(!_0x5c8f81||'pending'!==_0x5c8f81['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x51ac03=>!0x0===_0x51ac03['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x11ac8b=>'pending'===_0x11ac8b['status']);}['getChangeById'](_0x12b9a3){return this['_changes']['find'](_0x187c92=>_0x187c92['id']===_0x12b9a3);}['markAllChangesAsAccepted'](){for(const _0x39fc4b of this['_changes'])'pending'===_0x39fc4b['status']&&(_0x39fc4b['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x9ce11e){const _0x5145c0=this['_changes']['find'](_0x73a66a=>_0x73a66a['id']===_0x9ce11e);_0x5145c0&&'pending'===_0x5145c0['status']&&(_0x5145c0['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1db643){const _0x5418dd=this['_changes']['find'](_0x5b6a24=>_0x5b6a24['id']===_0x1db643);_0x5418dd&&'pending'===_0x5418dd['status']&&(_0x5418dd['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x171c35){const _0x577e15=this['_changes']['find'](_0x459907=>_0x459907['id']===_0x171c35);_0x577e15&&'pending'===_0x577e15['status']&&(_0x577e15['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x5d486f){const _0x220dcf=this['_changes']['find'](_0x598260=>_0x598260['id']===_0x5d486f);_0x220dcf&&'outdated'===_0x220dcf['status']&&(_0x220dcf['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3c6f3){this['_changes']['filter'](_0x44b008=>_0x44b008['isActivated']&&_0x44b008['id']!==_0x3c6f3)['forEach'](_0x5a2ebf=>{_0x5a2ebf['isActivated']=!0x1;});const _0x1a4720=this['_changes']['find'](_0x5c6b32=>_0x5c6b32['id']===_0x3c6f3);_0x1a4720&&'pending'===_0x1a4720['status']&&(_0x1a4720['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x3ad6ec=>_0x3ad6ec['isActivated'])['forEach'](_0x1fed48=>{_0x1fed48['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x266384){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x3d297f;if(_0x266384){const _0x287d84=this['_changes']['find'](_0x192402=>_0x192402['id']===_0x266384);if(_0x287d84&&_0x287d84['isRated'])return;_0x287d84&&(_0x3d297f=_0x287d84['parent']['id'],_0x287d84['isRated']=!0x0);}const _0x3c0fe7={'positiveCount':this['_changes']['filter'](_0x20a39a=>'accepted'===_0x20a39a['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x3c0fe7,this['callId'],_0x3d297f);}['_addReviewCheckResult'](_0x1d295e,_0x2b4729){const _0xaf7392=this['_documentData']['elements']['get'](_0x1d295e);if(!_0xaf7392)return;const _0x248f25=_0xaf7392['getContent']();if(_0x248f25===_0x2b4729)return;const _0x37b60a=new AIReviewCheckResult({'id':_0x1d295e,'contentInitial':_0x248f25,'contentNew':_0x2b4729,'documentVersion':_0xaf7392['documentVersion']});this['_results']['set'](_0x37b60a['id'],_0x37b60a),this['fire']('reviewCheckResultAdded',{'result':_0x37b60a,'source':this,'editor':_0xaf7392['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x576312=>'pending'===_0x576312['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x1dd17e=>'pending'===_0x1dd17e['status'])['length']&&(this['status']='finished'));}}class AIReviewSystemCheckRun extends AIReviewCheckRun{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1aa2a0=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x46a064=0x0;_0x46a064<this['_reviewParams']['length'];_0x46a064++){if(!this['_reviewParams'][_0x46a064]||!this['_sourceCheck']['options'][_0x46a064])continue;const _0x2e7aec=this['_sourceCheck']['options'][_0x46a064],_0xe2467e=_0x2e7aec['data']?.['find'](_0x4af622=>_0x4af622['id']===this['_reviewParams'][_0x46a064]);_0xe2467e&&_0x1aa2a0['push'](_0xe2467e['label']);}return _0x1aa2a0['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x813819,_0x34c65a,_0x20a309){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x34c65a,_0x813819,_0x20a309);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class AIReviewCoreController extends _0x5df7d5{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_availableReviewChecks'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_initRequiredPlugins'](),this['_initAvailableReviewChecks'](),this['_initUIListeners']();}async['_initAvailableReviewChecks'](){this['_availableReviewChecks']=await this['_getReviewChecks'](),this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}['_initUIListeners'](){this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_availableReviewChecks']&&this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',(_0xc30bb9,_0x291454)=>this['runCheck'](_0x291454)),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>this['abort']()),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x6f2429=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x6f2429['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x6f2429['map'](_0x34c78e=>_0x34c78e['id']));const _0x18a2d1=this['_currentReviewCheckRun'];_0x18a2d1['markAllChangesAsAccepted'](),_0x18a2d1['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x1f92c1,_0x14aa03)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x14aa03['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x14aa03['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x14aa03['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x14aa03['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x294e17,_0x2e4393)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x2e4393['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x2e4393['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x2e4393['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x2e4393['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x5ce250,_0x19d16b)=>{this['_onActivateChange'](_0x19d16b);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x575621,_0x5d8d5e)=>{this['_onDeactivateChange'](_0x5d8d5e);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x2b8abb,_0x39a639)=>{this['_onChangeMarkerClicked'](_0x2b8abb,_0x39a639);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x4b5ab8,_0x41ac26)=>{this['_onChangeMarkerHovered'](_0x4b5ab8,_0x41ac26);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x85189e,_0x3f8a8f)=>{this['_onChangeMarkerRemoved'](_0x85189e,_0x3f8a8f);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x2a3dfb,_0x42057e)=>{this['_onChangeMarkerRestored'](_0x2a3dfb,_0x42057e);});}async['runCheck'](_0x320b1d){if(!this['_availableReviewChecks'])return;const _0x209d48=this['_availableReviewChecks']['find'](_0x158dac=>_0x158dac['id']===_0x320b1d['id']);if(_0x209d48){this['_onReviewCheckRun'](_0x320b1d),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x320b1d,_0x209d48),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x55cc9a,_0x26bc76)=>{switch(_0x26bc76['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x26bc76);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new ht('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ht('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x26bc76['status']&&'error-chunk'!==_0x26bc76['status']&&'error-general'!==_0x26bc76['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x4f993a,_0x107010)=>{if(!this['_currentReviewCheckRun'])throw new ht('ai-review-mode-no-current-check-run',this);const _0x25758a=this['_diffContent'](_0x107010['editor'],_0x107010['result']['contentInitial'],_0x107010['result']['contentNew']);_0x107010['source']['addResultChanges'](_0x107010['result']['id'],_0x25758a);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x5d2241,_0x42e0d3)=>{for(const _0x80d3b7 of _0x42e0d3['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x80d3b7);this['_markChangePositionInEditorContent'](_0x42e0d3['changes'],_0x42e0d3['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x37073b,_0x132b26)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x132b26['change']['id'],_0x132b26['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x3559f0,_0x522d6b)=>{this['_onReviewCheckResultActivated'](_0x522d6b);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x81bb33){_0x81bb33 instanceof Error&&_0x81bb33['message']['includes']('ai-request-aborted')||(_0x81bb33 instanceof ht?this['_logError'](_0x81bb33):this['_logError'](new ht('ai-review-mode-check-run-failed',this,void 0x0,_0x81bb33)));}}else this['_logError'](new ht('ai-review-mode-source-check-not-found',this,{'checkId':_0x320b1d['id']}));}['abort'](){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}['getAvailableChecks'](){return this['_availableReviewChecks']??[];}['getCurrentCheckRun'](){return this['_currentReviewCheckRun'];}['_createReviewCheckRun'](_0x5ee933,_0x83b5f0){return new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x83b5f0,this['_aiConnector'],_0x5ee933['params'],_0x5ee933['args']);}['_onChangeMarkerRemoved'](_0x575fb2,_0x4be062){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4be062['changeId']);}['_onChangeMarkerRestored'](_0x178853,_0xe444fd){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0xe444fd['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x4170fb=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x4170fb&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x3d1a4e of this['_aiReviewCoreEditing']['getEditors']())_0x3d1a4e['editing']['view']['change'](_0x426a5c=>{for(const _0x42af8c of _0x3d1a4e['editing']['view']['document']['getRoots']())_0x426a5c['removeClass']('ck-ai_review-diff',_0x42af8c),_0x426a5c['removeClass']('ck-ai_review-highlights',_0x42af8c),_0x426a5c['removeClass']('ck-ai-translate-mode-content',_0x42af8c);});}['_logError'](_0x27375e,_0x41c9b9=!0x1){Ct(_0x27375e['message']),_0x41c9b9||(_0x27375e['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x3fd4bb){if('content'===this['_changeActivationSource']){const _0x3d60c8=this['_aiReviewCoreUi']['getChangeElement'](_0x3fd4bb);_0x3d60c8&&Rt(_0x3d60c8['closest']('.ck-ai_review__check-run-result')||_0x3d60c8);}else{if('panel'===this['_changeActivationSource']){const _0x245e26=this['_getChangeContentElement'](_0x3fd4bb);if(!_0x245e26)return;Tt({'target':_0x245e26,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}class AIReviewCustomCheckRun extends AIReviewCheckRun{['_prompt'];['_model'];constructor(_0x474b2e,_0xc52f94,_0x444545,_0x29d7b6,_0x4f8acc){super(_0x444545,_0x29d7b6,_0x4f8acc),this['_prompt']=_0x474b2e,this['_model']=_0xc52f94;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x184284,_0xea8be3,_0x20f910){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xea8be3,_0x184284,_0x20f910);}}class AIReviewCheck{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x8bec76){this['id']=_0x8bec76['id'],this['commandId']=_0x8bec76['commandId'],this['title']=_0x8bec76['title'],this['description']=_0x8bec76['description'],this['isParameterized']=_0x8bec76['isParameterized'],this['useArgs']=_0x8bec76['useArgs'],this['options']=_0x8bec76['options'],this['args']=_0x8bec76['args'];}}class AIReviewCheckExtra extends AIReviewCheck{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x40a0ca,_0x386b3b,_0x3dd7b5){super(_0x40a0ca),this['prompt']=_0x40a0ca['prompt'],this['model']=_0x40a0ca['model'],this['model']?this['_defaultModel']=_0x386b3b['find'](_0x219047=>_0x219047['id']===this['model'])||null:this['_defaultModel']=_0x3dd7b5;}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewExtraCheckRun extends AIReviewCustomCheckRun{get['subTitle'](){return'';}set['prompt'](_0x410141){this['_prompt']=_0x410141;}set['model'](_0x3a0559){this['_model']=_0x3a0559;}}class AIReviewCoreCheckRegistry extends _0x5df7d5{static get['requires'](){return[AIConnector];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_cache'];['getChecksList'](){return this['_cache']||(this['_cache']=this['_loadChecksList']()),this['_cache'];}}const ir=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class AIReviewCheckList extends ct(){['_checks']=[];['setupChecks'](_0x36eb7f){this['_checks']=_0x36eb7f['map'](_0xc019b0=>new AIReviewCheck(_0xc019b0));}get['checks'](){return this['_checks'];}['getCheckById'](_0xef39cf){return this['checks']['find'](_0x36540c=>_0x36540c['id']===_0xef39cf);}['removeCheckById'](_0x1326d2){this['_checks']=this['_checks']['filter'](_0x365c4e=>_0x365c4e['id']!==_0x1326d2);}}class AIReviewCheckCustom extends AIReviewCheck{['_models']=[];['_defaultModel']=null;constructor(_0x5025ee,_0x505588,_0x36d3a0){super(_0x5025ee),this['_models']=_0x505588,this['_defaultModel']=_0x36d3a0;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewModeCheckList extends AIReviewCheckList{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x29c011,_0x24d272,_0x185089){super(),this['_allModels']=_0x29c011,this['_recommendedModels']=_0x24d272,this['_defaultModel']=_0x185089;}get['allModels'](){return this['_allModels'];}['setupChecks'](_0x1713b8){this['_checks']=_0x1713b8['map'](_0x2e6420=>!0x0===_0x2e6420['isExtra']?new AIReviewCheckExtra(_0x2e6420,this['_allModels'],this['_defaultModel']):'custom'===_0x2e6420['id']?new AIReviewCheckCustom(_0x2e6420,this['_recommendedModels'],this['_defaultModel']):new AIReviewCheck(_0x2e6420));}}class AIReviewModeCheckRegistry extends AIReviewCoreCheckRegistry{static get['pluginName'](){return'AIReviewModeCheckRegistry';}['_modelsLoadError']=null;constructor(_0x5c2c5f){super(_0x5c2c5f),this['context']['config']['define']('ai.review.extraCommands',[]);}get['modelsLoadError'](){return this['_modelsLoadError'];}['getExtraChecks'](){return this['context']['config']['get']('ai.review.extraCommands')['map'](_0xfbcfc0=>({'id':_0xfbcfc0['id'],'commandId':_0xfbcfc0['id'],'title':_0xfbcfc0['label'],'description':_0xfbcfc0['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0xfbcfc0['prompt'],'model':_0xfbcfc0['model']}));}async['_loadChecksList'](){const _0x45bc6c=[...ir,...this['getExtraChecks']()]['map'](_0x1f212b=>_0x1f212b['isExtra']?_0x1f212b:this['_translateReviewCheck'](_0x1f212b)),_0x1d7330=await this['_getModels'](),_0x47070c=new AIReviewModeCheckList(_0x1d7330['all'],_0x1d7330['recommended'],_0x1d7330['default']);return _0x47070c['setupChecks'](_0x45bc6c),_0x47070c;}async['_getModels'](){const _0x1bb3d0=this['context']['plugins']['get']('AIConnector');try{const _0x23b99=new AIModels({'connector':_0x1bb3d0,'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']}),_0x36b800={'all':await _0x23b99['getAll'](),'recommended':await _0x23b99['getAvailableModels'](),'default':await _0x23b99['getDefault']()};return this['_modelsLoadError']=null,_0x36b800;}catch(_0x28d45c){return this['_modelsLoadError']=new ht('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x28d45c),Ct(this['_modelsLoadError']['message']),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x16e4dd){const _0x4d8545='AI_REVIEW_CHECK_'+_0x16e4dd['id']['toUpperCase']()['replaceAll']('-','_'),_0x566534={..._0x16e4dd,'title':this['_translate'](_0x4d8545+'_TITLE',_0x16e4dd['title']),'description':this['_translate'](_0x4d8545+'_DESCRIPTION',_0x16e4dd['description'])};return _0x16e4dd['options']&&(_0x566534['options']=_0x16e4dd['options']['map'](_0x4a7029=>({..._0x4a7029,'label':this['_translate'](_0x4d8545+'_OPTIONS_LABEL',_0x4a7029['label']||''),'data':_0x4a7029['data']?_0x4a7029['data']['map'](_0x3cabf3=>({..._0x3cabf3,'label':this['_translate'](_0x4d8545+'_OPTIONS_DATA_'+_0x3cabf3['id']['toUpperCase'](),_0x3cabf3['label'])})):void 0x0}))),_0x566534;}['_translate'](_0x591ea1,_0x474713){const _0x358f23=Mi(this['context']['locale'],_0x591ea1);return _0x358f23===_0x591ea1?_0x474713:_0x358f23;}}class AIReviewModeController extends AIReviewCoreController{static get['pluginName'](){return'AIReviewModeController';}static get['requires'](){return[AIReviewModeCheckRegistry];}['_isDiffOn']=!0x1;['_usesAvailableCommandsConfig'];constructor(_0x3d19e6){super(_0x3d19e6),this['_usesAvailableCommandsConfig']=Boolean(this['context']['config']['get']('ai.review.availableCommands')),this['context']['config']['define']('ai.review.availableCommands',ir['map'](_0x4ba0ae=>_0x4ba0ae['id']));}['init'](){super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0xba66b7,_0x57be26)=>{this['_isDiffOn']=_0x57be26['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x27be20,_0x5d89a1){if(_0x27be20['isCustom'])return new AIReviewCustomCheckRun(_0x27be20['args']['prompt'],_0x27be20['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5d89a1,this['_aiConnector']);if(_0x5d89a1['isExtra']){const _0x456e52=_0x5d89a1;return new AIReviewExtraCheckRun(_0x27be20['args']?.['prompt']??_0x456e52['prompt'],_0x27be20['args']?.['model']??_0x456e52['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5d89a1,this['_aiConnector']);}return new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5d89a1,this['_aiConnector'],_0x27be20['params'],_0x27be20['args']);}['_onReviewCheckResultActivated'](_0x188156){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x188156['change']['id']),this['_scrollToChange'](_0x188156['change']['id']);const _0x13dfb0=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x188156['change']['id']);if(!_0x13dfb0)return;const _0x21d19e=this['_aiReviewCoreEditing']['getEditorForChange'](_0x188156['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x188156['change'],()=>_0x13dfb0['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x21d19e,_0x13dfb0['modelRange']['root']['rootName']),_0x21d19e?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x188156['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x4dcff7){this['_currentReviewCheckRun']&&'click'===_0x4dcff7['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x4dcff7['id']));}['_onDeactivateChange'](_0x4d96d6){this['_currentReviewCheckRun']&&'balloon'===_0x4d96d6['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5942fa,_0x5ae1c1){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5ae1c1['changeId']);const _0x4fadcd=this['_currentReviewCheckRun']['getChangeById'](_0x5ae1c1['changeId']);if(!_0x4fadcd)return;const _0x3c0f6a=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5ae1c1['changeId']),_0x122a82=this['_aiReviewCoreEditing']['getEditorForChange'](_0x5ae1c1['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x4fadcd,_0x5ae1c1['markerElement'],_0x5ae1c1['domEvent'],'click',this['_getBalloonDomRoot'](_0x122a82,_0x3c0f6a?.['modelRange']['root']['rootName']),_0x122a82?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x14ae53,_0x367a4a){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x2794e5=this['_currentReviewCheckRun']['getChangeById'](_0x367a4a['changeId']);if(!_0x2794e5)return;const _0x4de79e=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x367a4a['changeId']),_0x491dec=this['_aiReviewCoreEditing']['getEditorForChange'](_0x367a4a['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2794e5,_0x367a4a['markerElement'],_0x367a4a['domEvent'],'hover',this['_getBalloonDomRoot'](_0x491dec,_0x4de79e?.['modelRange']['root']['rootName']),_0x491dec?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x3b3523){const _0x6c9604=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x3b3523);return _0x6c9604?_0x6c9604['getElement']():null;}['_markChangePositionInEditorContent'](_0xad698b,_0x3339a7){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0xad698b,_0x3339a7);}['_diffContent'](_0x5cebe8,_0x5f3d8a,_0x1c8959){return this['_aiReviewCoreEditing']['diffContent'](_0x5cebe8,_0x5f3d8a,_0x1c8959,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x42dd3a){_0x42dd3a?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x4f5ebd of this['_aiReviewCoreEditing']['getEditors']())_0x4f5ebd['editing']['view']['change'](_0x4e27a7=>{for(const _0x91e4bb of _0x4f5ebd['editing']['view']['document']['getRoots']()){for(const _0x9bce62 of _0x91e4bb['getClassNames']())_0x9bce62['startsWith']('ck-ai_review-')&&_0x4e27a7['removeClass'](_0x9bce62,_0x91e4bb);_0x4e27a7['addClass'](_0x42dd3a?'ck-ai_review-diff':'ck-ai_review-highlights',_0x91e4bb);}});}['_getBalloonDomRoot'](_0x9858db,_0xddb1a6){const _0x4ffee4=_0x9858db['editing']['view'];if(_0xddb1a6){const _0x3ebf7d=_0x4ffee4['getDomRoot'](_0xddb1a6);if(_0x3ebf7d)return _0x3ebf7d;}return _0x4ffee4['getDomRoot']()??void 0x0;}async['_getReviewChecks'](){const _0x27ed79=this['context']['plugins']['get']('AIReviewModeCheckRegistry'),_0x4286a5=await _0x27ed79['getChecksList']();_0x27ed79['modelsLoadError']&&this['_logError'](_0x27ed79['modelsLoadError']);let _0x473155=_0x4286a5['checks'];const _0x4f9c93=this['context']['config']['get']('ai.review.availableCommands');return this['_logWarningForNonExistentChecks'](_0x4f9c93,_0x473155),this['_usesAvailableCommandsConfig']&&(_0x473155=_0x4f9c93['map'](_0x1b8b4e=>_0x473155['find'](_0x44ec6d=>_0x44ec6d['id']===_0x1b8b4e))['filter'](_0x1aaea3=>!!_0x1aaea3)),this['_filterChecksWithMissingModel'](_0x473155);}['_logWarningForNonExistentChecks'](_0x1416a8,_0x329a96){const _0x113431=_0x1416a8['filter'](_0xb17953=>!_0x329a96['some'](_0x3cd5e5=>_0x3cd5e5['id']===_0xb17953));if(_0x113431['length']){const _0x34c3cd=new ht('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x113431['join'](',\x20')});wt(_0x34c3cd['message']);}}['_filterChecksWithMissingModel'](_0x4c4c67){const _0x12c18f=[];return _0x4c4c67['forEach'](_0x27e4c7=>{(_0x27e4c7 instanceof AIReviewCheckExtra&&!_0x27e4c7['defaultModel']||_0x27e4c7 instanceof AIReviewCheckCustom&&!_0x27e4c7['models']['length'])&&_0x12c18f['push'](_0x27e4c7['id']);}),_0x12c18f['length']&&_0x12c18f['forEach'](_0x8b6c11=>{_0x4c4c67=_0x4c4c67['filter'](_0x27e652=>_0x27e652['id']!==_0x8b6c11);const _0x152ba1=new ht('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x8b6c11});Ct(_0x152ba1['message']);}),_0x4c4c67;}}class AIRunResult{['_editor'];['_rootName'];['_channelId'];['_sessionId'];['_documentVersion'];['_contentRawOld'];['_contentRawNew'];['_error'];['_isAborted']=!0x1;constructor(_0x119c59){this['_editor']=_0x119c59['editor'],this['_rootName']=_0x119c59['rootName'],this['_channelId']=_0x119c59['channelId'],this['_sessionId']=_0x119c59['sessionId'];}get['status'](){return this['_error']?'error':this['_isAborted']?'aborted':void 0x0!==this['_contentRawNew']?'completed':'initialized';}get['editor'](){return this['_editor'];}get['rootName'](){return this['_rootName'];}get['channelId'](){return this['_channelId'];}get['sessionId'](){return this['_sessionId'];}get['documentVersion'](){return this['_documentVersion'];}set['documentVersion'](_0xa7da9){this['_documentVersion']=_0xa7da9;}get['contentRawOld'](){return this['_contentRawOld'];}set['contentRawOld'](_0x1ff88b){this['_contentRawOld']=_0x1ff88b;}get['contentRawNew'](){return this['_contentRawNew'];}set['contentRawNew'](_0x4b1d19){this['_contentRawNew']=_0x4b1d19;}get['contentOld'](){return this['_dropDataIds'](this['_contentRawOld']||'');}get['contentNew'](){return this['_dropDataIds'](this['_contentRawNew']||'');}get['error'](){return this['_error'];}set['error'](_0x214fcb){this['_error']=_0x214fcb;}['abort'](){this['_isAborted']=!0x0;}['_dropDataIds'](_0x188504){return _0x188504['replace'](/ data-id="[a-z0-9]+"/g,'');}}class AIReviewRunResult extends AIRunResult{['_affectedBlocks']=[];get['affectedBlocks'](){return this['_affectedBlocks'];}set['affectedBlocks'](_0x2ac51f){this['_affectedBlocks']=_0x2ac51f;}}class AIGateway extends _0x5df7d5{static get['pluginName'](){return'AIGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['apply'](_0x354efd,_0x3f6b82){if('completed'!==_0x354efd['status'])throw new ht('ai-gateway-apply-invalid-status',this,{'status':_0x354efd['status']});const _0x305bbe=_0x354efd['editor'];if('suggest'===_0x3f6b82&&!_0x305bbe['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',this);const _0x1b6f39='suggest'===_0x3f6b82,_0x18f961=this['context']['plugins']['get'](_0x4d0fee),_0x190a0b=_0x305bbe['model']['createPositionAt'](_0x305bbe['model']['document']['getRoot'](),0x0),_0x176631=_0x18f961['getDiff'](_0x354efd['contentRawOld'],_0x354efd['contentRawNew'],{'anchor':_0x190a0b,'markDeletions':_0x1b6f39,'targetEditor':_0x305bbe}),_0x37b218=_0x305bbe['model']['document']['history']['getOperations'](_0x354efd['documentVersion']),_0x189084={'document':_0x305bbe['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x5353f4=_0x4779ab(_0x176631['getOperations'](),_0x37b218,_0x189084)['operationsA'];_0x305bbe['model']['change'](_0x5eeba0=>{if(_0x1b6f39)_0x305bbe['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5353f4);else{for(const _0x8f58c3 of _0x5353f4)_0x8f58c3['baseVersion']=_0x305bbe['model']['document']['version'],Es(_0x305bbe,_0x8f58c3),_0x5eeba0['batch']['addOperation'](_0x8f58c3),_0x305bbe['model']['applyOperation'](_0x8f58c3);}});}['mergeChangesIntoContent'](_0x271e94,_0x175a7d,_0x1e88b3){const _0x402847=new AIResponseParser(),_0x5da2c8=new AIResponseApplier();let _0x401fb7=_0x402847['parseAndNormalizeHTML'](_0x175a7d);for(const _0x560f8e of _0x271e94)try{const _0x3ad4f2=_0x402847['parseAndNormalizeHTML'](_0x560f8e['content']);_0x401fb7=_0x5da2c8['merge'](_0x3ad4f2,_0x401fb7,{'cutAfterUnstable':!0x1,'replaceRemovedWith':void 0x0})['parsedContent'];}catch(_0x455ada){throw new ht('ai-gateway-merge-failed',this,{..._0x560f8e},_0x455ada);}return os(_0x1e88b3,_0x402847['parseAndNormalizeHTML'](_0x175a7d),_0x401fb7,!0x1,!0x1)['content'];}}class AIReviewGateway extends _0x5df7d5{static get['pluginName'](){return'AIReviewGateway';}static get['requires'](){return[AIReviewCoreEditing,AIReviewModeCheckRegistry,AIConnector,AIEditing,AIGateway];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['getAllCommands'](){const _0x34ae5c=this['context']['plugins']['get']('AIReviewModeCheckRegistry');return(await _0x34ae5c['getChecksList']())['checks']['map'](_0x4d9173=>{const _0x5afbad={'id':_0x4d9173['id'],'title':_0x4d9173['title'],'description':_0x4d9173['description']};return'custom'!==_0x4d9173['id']&&_0x4d9173['options']?.['length']&&(_0x5afbad['parameters']=_0x4d9173['options'][0x0]['data']['map'](_0x3b59ae=>({..._0x3b59ae}))),_0x5afbad;});}async['getAvailableModels'](){const _0xcb9379=this['context']['plugins']['get']('AIConnector');return new AIModels({'connector':_0xcb9379,'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']})['getAll']();}async['runReview'](_0x26f295,_0x1fb6e7){return await this['_runReviewCheck'](_0x26f295,()=>this['_createReviewCheckRun'](_0x26f295,_0x1fb6e7?.['parameterId']),_0x1fb6e7?.['signal']);}async['runCustomReview'](_0x1b2fc4,_0x278e31){return await this['_runReviewCheck']('custom',()=>this['_createCustomReviewCheckRun']('custom',_0x1b2fc4,_0x278e31?.['model']),_0x278e31?.['signal']);}['applyReview'](_0x2c01c7,_0x17e777){this['context']['plugins']['get']('AIGateway')['apply'](_0x2c01c7,_0x17e777);}async['_runReviewCheck'](_0x341c60,_0x3a8eb7,_0x24d510){const _0x3764f6=ms(this['context']),_0x4f1363=new AIReviewRunResult({'editor':_0x3764f6,'rootName':_0x3764f6['model']['document']['getRootNames']()[0x0],'channelId':this['context']['config']['get']('collaboration.channelId'),'sessionId':_0x3764f6['plugins']['get']('AIEditing')['getSessionId'](_0x3764f6)});let _0x4e4d0e,_0x58781d;if(_0x24d510){if(_0x24d510['aborted'])return _0x4f1363['abort'](),_0x4f1363;const _0x3d0c94=()=>{_0x4f1363['error']||(_0x4f1363['abort'](),_0x4e4d0e&&_0x4e4d0e['abort']());};_0x24d510['addEventListener']('abort',_0x3d0c94),_0x58781d=()=>_0x24d510['removeEventListener']('abort',_0x3d0c94);}try{_0x4e4d0e=await _0x3a8eb7(),_0x4f1363['contentRawOld']=_0x4e4d0e['documentData']['content'],_0x4f1363['documentVersion']=Array['from'](_0x4e4d0e['documentData']['elements'])['find'](([,_0x38eeb4])=>_0x38eeb4['rootName']===_0x4f1363['rootName'])?.[0x1]['documentVersion']??0x1,_0x4e4d0e['on']('reviewCheckRunUpdated',(_0xac8ede,_0x2f1f03)=>{'aborted'===_0x2f1f03['status']?_0x4f1363['abort']():'error-general'!==_0x2f1f03['status']&&'error-chunk'!==_0x2f1f03['status']||(_0x4f1363['error']=this['_normalizeError'](_0x2f1f03['error'],'ai-reviewgateway-review-command-run-failed',{'checkId':_0x341c60}));}),'aborted'!==_0x4f1363['status']&&await _0x4e4d0e['start']();}catch(_0xb04d19){_0x4f1363['error']=this['_normalizeError'](_0xb04d19,'ai-reviewgateway-review-command-run-failed',{'checkId':_0x341c60});}finally{_0x58781d&&_0x58781d();}if(!_0x4e4d0e||'aborted'===_0x4f1363['status']||'error'===_0x4f1363['status'])return _0x4f1363;_0x4f1363['affectedBlocks']=_0x4e4d0e['results']['map'](_0x43f776=>({'id':_0x43f776['id'],'content':_0x43f776['contentNew']}));try{_0x4f1363['contentRawNew']=Ki(this['context']['plugins']['get']('AIGateway')['mergeChangesIntoContent'](_0x4f1363['affectedBlocks'],_0x4f1363['contentRawOld'],_0x4f1363['editor']));}catch(_0x33390c){_0x4f1363['error']=this['_normalizeError'](_0x33390c,'ai-reviewgateway-review-command-run-failed',{'checkId':_0x341c60});}return _0x4f1363;}async['_createReviewCheckRun'](_0x4ff47f,_0x456cd0){const _0x12af5e=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x3ef5bf=>_0x3ef5bf['id']===_0x4ff47f);if(!_0x12af5e)throw new ht('ai-reviewgateway-unknown-command',this,{'checkId':_0x4ff47f});if(_0x12af5e instanceof AIReviewCheckCustom)throw new ht('ai-reviewgateway-not-a-system-command',this,{'checkId':_0x4ff47f});const _0x5c333e=this['context']['plugins']['get']('AIReviewCoreEditing')['getDocumentData'](),_0x10dd05=this['context']['plugins']['get']('AIConnector');if(_0x12af5e instanceof AIReviewCheckExtra){if(!_0x12af5e['defaultModel']?.['id'])throw new ht('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x4ff47f});return new AIReviewExtraCheckRun(_0x12af5e['prompt'],_0x12af5e['defaultModel']['id'],_0x5c333e,_0x12af5e,_0x10dd05);}return new AIReviewSystemCheckRun(_0x5c333e,_0x12af5e,_0x10dd05,_0x456cd0?[_0x456cd0]:void 0x0);}async['_createCustomReviewCheckRun'](_0x1d3a85,_0x4dcb3a,_0xd333ca){const _0xd8cfed=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x318d9f=>_0x318d9f['id']===_0x1d3a85);if(!_0xd8cfed)throw new ht('ai-reviewgateway-unknown-command',this,{'checkId':_0x1d3a85});if(!(_0xd8cfed instanceof AIReviewCheckCustom))throw new ht('ai-reviewgateway-not-a-custom-command',this,{'checkId':_0x1d3a85});const _0x55cd69=_0xd333ca??_0xd8cfed['defaultModel']?.['id'];if(!_0x4dcb3a)throw new ht('ai-reviewgateway-missing-custom-command-prompt',this,{'checkId':_0x1d3a85});if(!_0x55cd69)throw new ht('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x1d3a85});return new AIReviewCustomCheckRun(_0x4dcb3a,_0x55cd69,this['context']['plugins']['get']('AIReviewCoreEditing')['getDocumentData'](),_0xd8cfed,this['context']['plugins']['get']('AIConnector'));}['_normalizeError'](_0x1dcdf9,_0xfddcd7,_0x4518fb){let _0x1f814b=_0x1dcdf9;return _0x1dcdf9 instanceof ht||(_0x1f814b=new ht(_0xfddcd7,this,_0x4518fb,_0x1dcdf9)),_0x1f814b;}}class AIReviewMode extends _0x5df7d5{static get['requires'](){return[AIReviewModeController,AIReviewModeUI,AIReviewCoreEditing,AIReviewGateway];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['startReview'](_0x259936,_0x35f3e5){if(this['assertStartReviewPreconditions'](_0x259936)instanceof AIReviewCheckCustom)throw new ht('ai-reviewmode-not-a-system-command',this,{'commandId':_0x259936});const _0x591f96=this['context']['plugins']['get']('AIReviewModeController');await _0x591f96['runCheck']({'id':_0x259936,'params':_0x35f3e5?.['parameterId']?[_0x35f3e5['parameterId']]:void 0x0});}async['startCustomReview'](_0x2662d3,_0x3847e4){if(!_0x2662d3)throw new ht('ai-reviewmode-missing-custom-command-prompt',this);const _0x432394=ir['find'](_0x396801=>'custom'===_0x396801['commandId'])['id'],_0x738fec=this['assertStartReviewPreconditions'](_0x432394),_0x4dd167=_0x3847e4?.['model']??_0x738fec['defaultModel']?.['id'];if(!_0x4dd167)throw new ht('ai-reviewmode-missing-custom-command-model',this);const _0x2ca75d=this['context']['plugins']['get']('AIReviewModeController');await _0x2ca75d['runCheck']({'id':_0x432394,'isCustom':!0x0,'args':{'prompt':_0x2662d3,'model':_0x4dd167}});}['getAvailableCommands'](){return this['context']['plugins']['get']('AIReviewModeController')['getAvailableChecks']()['map'](_0x101cdd=>{const _0x58aba1={'id':_0x101cdd['id'],'title':_0x101cdd['title'],'description':_0x101cdd['description']};return'custom'!==_0x101cdd['id']&&_0x101cdd['options']?.['length']&&(_0x58aba1['parameters']=_0x101cdd['options'][0x0]['data']['map'](_0x4887e4=>({..._0x4887e4}))),_0x58aba1;});}['assertStartReviewPreconditions'](_0x465813){const _0x21330f=this['context']['plugins']['get']('AIReviewModeController');if(_0x21330f['getCurrentCheckRun']())throw new ht('ai-reviewmode-review-already-running',this);const _0x18a0cd=_0x21330f['getAvailableChecks']()['find'](_0x3196d8=>_0x3196d8['id']===_0x465813);if(!_0x18a0cd)throw new ht('ai-reviewmode-unknown-command',this,{'commandId':_0x465813});const _0x60d183=this['context']['plugins']['get']('AITabs')['view'];return _0x60d183['isVisible']=!0x0,_0x60d183['activateTab']('reviewMode'),_0x18a0cd;}}class AITranslateCheckRun extends AIReviewSystemCheckRun{['_title'];constructor(_0x34a7c6,_0x43ea51,_0x2e6062,_0x50dd1f,_0xd856a7,_0x527db3){super(_0x34a7c6,_0x43ea51,_0x2e6062,_0xd856a7,_0x527db3),this['_title']=_0x50dd1f;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class AITranslateCheck extends AIReviewCheck{get['apiId'](){return'translate';}}class AITranslateCheckList extends AIReviewCheckList{['setupChecks'](_0xcd744e){this['_checks']=_0xcd744e['map'](_0x3e3c42=>new AITranslateCheck(_0x3e3c42));}}const sr=[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}];class AITranslateCheckRegistry extends AIReviewCoreCheckRegistry{static get['pluginName'](){return'AITranslateCheckRegistry';}constructor(_0x468c4d){super(_0x468c4d),this['context']['config']['define']('ai.translate.languages',sr);}async['_loadChecksList'](){const _0x3ecdcf=[],_0x408bc2=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x2ec29c of _0x408bc2)_0x3ecdcf['push']({'title':_0x2ec29c['label'],'id':_0x2ec29c['id'],'commandId':_0x2ec29c['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x2ec29c['id']}});const _0x558e20=new AITranslateCheckList();return _0x558e20['setupChecks'](this['_translateChecks'](_0x3ecdcf)),_0x558e20;}['_translateChecks'](_0x54b00b){const _0x3a386e=this['context']['locale'];return _0x54b00b['map'](_0x12890b=>{const _0x5ee1cd='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x12890b['title']['toUpperCase']()['replaceAll']('-','_'),_0x51d5f3=Mi(_0x3a386e,_0x5ee1cd);return{..._0x12890b,'title':_0x51d5f3===_0x5ee1cd?_0x12890b['title']:_0x51d5f3};});}}class AITranslateController extends AIReviewCoreController{static get['pluginName'](){return'AITranslateController';}static get['requires'](){return[AITranslateCheckRegistry];}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x32f120,_0x4a3a11){return new AITranslateCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4a3a11,this['_aiConnector'],Mi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x32f120['params'],_0x32f120['args']);}['_onReviewCheckResultActivated'](_0xe72cf){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xe72cf['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xe72cf['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x45ed67){this['_currentReviewCheckRun']&&('hover'===_0x45ed67['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x45ed67['id'])),'click'===_0x45ed67['uiInteraction']&&this['_scrollToChange'](_0x45ed67['id']));}['_onDeactivateChange'](_0x58ce27){this['_currentReviewCheckRun']&&'panel'===_0x58ce27['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x9d3877,_0x45191e){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x45191e['changeId']),this['_scrollToChange'](_0x45191e['changeId']));}['_onChangeMarkerHovered'](_0x58cc2f,_0x1a9c53){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1a9c53['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x1a9c53['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0xc117ae){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0xc117ae);}['_markChangePositionInEditorContent'](_0x701caa,_0x158d29){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x701caa,_0x158d29);}['_diffContent'](_0x1d5d33,_0x24ebaa,_0xb96660){return this['_aiReviewCoreEditing']['diffContent'](_0x1d5d33,_0x24ebaa,_0xb96660,!0x0);}['_onReviewCheckRun'](){for(const _0x5b2498 of this['_aiReviewCoreEditing']['getEditors']())_0x5b2498['editing']['view']['change'](_0x12c04a=>{for(const _0x137f7d of _0x5b2498['editing']['view']['document']['getRoots']())_0x12c04a['addClass']('ck-ai-translate-mode-content',_0x137f7d);});}async['_getReviewChecks'](){return(await this['context']['plugins']['get']('AITranslateCheckRegistry')['getChecksList']())['checks'];}}class AITranslateCheckResultsView extends AIReviewCoreUICheckResultsView{constructor(_0x211af2,_0x321dc3){super(_0x211af2,_0x321dc3),this['on']('set:isLoading',(_0x4168e2,_0x3e47a6,_0x4df108)=>{_0x4df108&&(this['headerTitle']=Mi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x5db70d,_0x4649eb,_0x8e5804)=>{_0x8e5804&&(this['headerTitle']=Mi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x121f63=super['_createAcceptAllButtonView']();return _0x121f63['set']('label',Mi(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x121f63;}['_createExitReviewButtonView'](){const _0x52fc83=super['_createExitReviewButtonView']();return _0x52fc83['set']('label',Mi(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x52fc83;}}class AITranslateCheckListView extends AIReviewCoreReviewCheckListView{['_setupTemplate'](){const _0x524104=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x524104['if']('isVisible','ck-hidden',_0x15b385=>!_0x15b385)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':Mi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':Mi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x524104['if']('isVisible','ck-hidden',_0x5f4d8d=>!_0x5f4d8d)]},'children':this['_checkViews']}]});}}class AITranslateUI extends AIReviewCoreUI{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x5f34a8=this['context']['plugins']['get']('AITabs'),_0x26f630=this['context']['locale'],_0x59f125=new AIHeaderView(_0x26f630,{'label':Mi(_0x26f630,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x5a7bff,'class':'ck-ai-header_review-translate','showResizeButton':_0x5f34a8['showResizeButton']});_0x59f125['delegate']('resizeTabs')['to'](_0x5f34a8),_0x59f125['bind']('isMaximized')['to'](_0x5f34a8['view'],'isMaximized',_0x3c6b8d=>_0x3c6b8d);const _0x5c46f3=new AIReviewCoreView(_0x26f630,{'header':_0x59f125,'list':new AITranslateCheckListView(_0x26f630),'results':new AITranslateCheckResultsView(_0x26f630,{'generalErrorText':Mi(_0x26f630,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x26f630,{'headerText':Mi(_0x26f630,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':Mi(_0x26f630,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':Mi(_0x26f630,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x5c46f3['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x5c46f3;}['registerTab'](){const _0x2b8ede=this['context']['plugins']['get']('AITabs');_0x2b8ede['view']['on']('activateTab',(_0x4da4c1,{newTab:_0x51894c,oldTab:_0xa69d97})=>{'translate'===_0x51894c?this['fire']('getReviewCheckList'):'translate'===_0xa69d97&&this['fire']('leaveReview');}),_0x2b8ede['view']['addTab']({'id':'translate','buttonLabel':Mi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x5a7bff,'order':0x0,'content':this['_mainView']});}}class AITranslate extends _0x5df7d5{static get['requires'](){return[AITranslateController,AITranslateUI,AIReviewCoreEditing];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{AIActions,AIAdapter,AIAssistant,AIAssistantUI,AIBalloon,AIChat,AIChatController,AIChatFeedCustomElementView,AIChatHistory,AIChatHistoryController,AIChatHistoryUI,AIChatInteraction,AIChatShortcuts,AIChatUI,AIConnector,AIEditing,AIEditorIntegration,AIGateway,AIInteraction,AIQuickActions,AIQuickActionsUI,AIReply,AIRequestError,AIReviewCheck,AIReviewCheckResult,AIReviewCheckResultChange,AIReviewCheckRun,AIReviewGateway,AIReviewMode,AIReviewCoreController as AIReviewModeController,AIReviewCoreEditing as AIReviewModeEditing,AIReviewModeUI,AIReviewRunResult,AIRunResult,AITabs,AITabsMainView,AITabsView,AITextAdapter,AIToggleButtonUI,AITranslate,AITranslateController,AITranslateUI,AWSTextAdapter,OpenAITextAdapter,ShowAIAssistantCommand,ToggleAICommand,Fi as createResizeButton,Di as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0xaa1572,Command as _0x2f8b52,ContextPlugin as _0x2bf4b8,Editor as _0x331160}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x46c01f,IconCheck as _0x34cc80,IconError as _0x553e3f,IconSubmit as _0x410e30,IconAIHistory as _0x511ede,IconMagicWand as _0x5a1294,IconRobotPencil as _0x40726a,IconMaximize as _0x54362b,IconMinimize as _0x32acbe,IconShowChangesOn as _0x42017b,IconShowChangesOff as _0x43a129,IconDocument as _0x5e66bf,IconBoxWithCross as _0x467d7e,IconBoxWithCheck as _0x409f7a,IconBoxWithMarker as _0x3ba364,IconInfo as _0x4e4581,IconWeb as _0x4c80e3,IconCancel as _0x45e38d,IconSelection as _0x4093e5,IconFileUpload as _0x1f08c5,IconLink as _0x5f5a21,IconImage as _0x1abdb8,IconBulb as _0x585754,IconAI as _0x2b3fb1,IconPreviousArrow as _0x26e333,IconDocumentOutline as _0x17333b,IconLoupe as _0x360100,IconPaperClip as _0x557527,IconBrowseFiles as _0x564c95,IconDropdownArrow as _0xdfd917,IconStop as _0x5025db,IconPlus as _0x49f9cd,IconAIChat as _0x5de332,IconPin as _0x533bcb,IconThreeHorizontalDots as _0xf44d1,IconAIReview as _0x497872,IconAITranslate as _0x13c6bf,IconAIAskAI as _0x368b3f,IconThumbUp as _0x2b92aa,IconThumbDown as _0x9aefe6,IconChevronDown as _0x4f0514,IconChevronUp as _0x9f74cc,IconAIQuickActions as _0xd64df0,IconAIChatCommands as _0x5176fc,IconAIImproveWriting as _0x3d58a7,IconAIContinueWriting as _0x1092ea,IconAIGrammarCheck as _0x43ab05,IconAIAdjustLength as _0x44c3f4,IconAIChangeTone as _0x5352e2,IconAIOther as tt,IconRefresh as et,IconNextArrow as it,IconOutdated as st,IconEye as nt,IconEyeCrossedOut as rt,IconChevronRight as ot}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as at,CKEditorError as ht,ObservableMixin as ct,global as lt,isVisible as ut,Rect as dt,Collection as _t,FocusTracker as It,KeystrokeHandler as At,first as gt,logWarning as wt,logError as Ct,toArray as mt,version as pt,EmitterMixin as Et,scrollViewportToShowTarget as Tt,insertToPriorityArray as ft,scrollAncestorsToShowTarget as Rt,ResizeObserver as bt,_isMotionReduced as St,getConstrainedViewportRect as Ot,DomEmitterMixin as vt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as kt,ButtonView as yt,View as Nt,SpinnerView as xt,IconView as Lt,AutocompleteView as Pt,ListView as Dt,ListItemGroupView as Vt,ListItemView as Ht,ButtonLabelView as Mt,FocusCycler as Ut,createLabeledTextarea as Bt,Dialog as Gt,createDropdown as Ft,addMenuToDropdown as Wt,MenuBarMenuView as Kt,MenuBarMenuListItemButtonView as Yt,DialogViewPosition as $t,MenuBarMenuListView as qt,MenuBarMenuListItemView as Qt,BodyCollection as Xt,BalloonPanelView as zt,clickOutsideHandler as jt,addListToDropdown as Jt,UIModel as Zt,submitHandler as te,LabeledFieldView as _0x5e9241,createLabeledInputText as _0x286d14,FormHeaderView as _0x355178,HighlightedTextView as _0x72d2dd,ViewCollection as _0x42c8a3,FileDialogButtonView as _0x1863aa,InputTextView as _0x89a3ef,SearchTextView as _0xabfc72,ListItemButtonView as _0x7b7d38,ButtonLabelWithHighlightView as _0x519544,DropdownMenuPanelPositioningFunctions as _0x413191,BalloonToolbar as _0x3ffeea,FormRowView as _0x2e5b92,TextareaView as _0x3a3bfa}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x2ec8bd,ClipboardMarkersUtils as _0x43d3ab}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x4ef13b,ViewDataTransfer as _0x385333,ViewUpcastWriter as _0x11c9b7,Matcher as _0x475fef,_DetachOperation as _0x3d09e2,_insertIntoModelNodeList as _0x4b4721,_removeFromModelNodeList as _0x16299d,ModelRange as _0x303302,transformOperationSets as _0x329636,ViewDowncastWriter as _0x26d283,ModelDocumentFragment as _0x4d6f3c,ModelPosition as _0x4ff74e,ModelTreeWalker as _0x3d7344,MarkerOperation as _0x55cc4a,InsertOperation as _0x121d37}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x47c559,escape as _0x16b809,cloneDeep as _0x1e62db,throttle as _0x4479f7,debounce as _0x432e5f,escapeRegExp as _0x40e363}from'es-toolkit/compat';import{createParser as _0x4a7344}from'eventsource-parser';import{CloudServices as _0x31b684}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x3454ec}from'htmlparser2';import{isTag as _0x2d72d5,findOne as _0x4d1e9b,getParent as _0x5c16cf,findAll as _0x1a2411,removeElement as _0x5ca789,prepend as _0x45243d,prependChild as _0x4ee198,appendChild as _0x406d41,append as _0x4750be,find as _0x16a579,isComment as _0x5d00d2,replaceElement as _0x4a3720,getChildren as _0x5a18a3,textContent as ti}from'domutils';import _0x771648 from'dom-serializer';import{isText as _0x4c1c37,cloneNode as _0x4269c1,Document as _0xd8df80,Element as _0x50156a,Text as _0x6d9ab,isDocument as _0x26ea3d,NodeWithChildren as _0x52878d}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x23cd9e,MarkdownGfmMdToHtml as _0x5b4a47}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x4c9890 from'rehype-sanitize';import{fixElementSuggestionRange as _0x4eba22,DocumentCompare as _0x2ab8a5,DATA_ID_MODEL_ATTRIBUTE as _0x2f50ff,ConfirmMixin as _0x116fb2,getAllMarkersDomElementsSorted as _0x3f723c,SuggestionsConversion as _0x1318a9,DATA_ID_VIEW_ATTRIBUTE as _0x271537,getMarkerDomElement as _0x71a789}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x1e976c from'morphdom';import{diffArrays as _0x2c8954}from'diff';const Ti='_ungrouppedCommands';function fi(_0x5df7ec,_0x3af199){const _0xca49ad=(0x0,_0x3af199['t'])('Other');return _0x5df7ec['length']?'groupId'in _0x5df7ec[0x0]?_0x5df7ec:[{'groupId':Ti,'groupLabel':_0xca49ad,'order':0x1/0x0,'commands':_0x5df7ec}]:[{'groupId':Ti,'groupLabel':_0xca49ad,'order':0x1/0x0,'commands':[]}];}const Ri=globalThis['DataTransfer'],bi='ai-ui';class AIAssistantEditing extends _0xaa1572{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x59aab8}=this,_0x5b3c6c=['ck-fake-ai-selection'];_0x59aab8['config']['get']('ai.assistant.useTheme')&&_0x5b3c6c['push']('ck-ai-assistant-ui_theme'),_0x59aab8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x5b3c6c,'priority':0xc}}),_0x59aab8['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x28e2b2,{writer:_0x301d8c})=>{if(!_0x28e2b2['markerRange']['isCollapsed'])return null;const _0x328a25=_0x301d8c['createUIElement']('span');return _0x301d8c['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x328a25),_0x328a25;}});}['afterInit'](){!async function(_0x537f0d){const _0x194e26=_0x5a7313([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x5b70f0=0x3dffc4e1,_0x2c683b=0x3df84f69^_0x5b70f0,_0x17bb73=window[_0x5a7313([0x44,0x61,0x74,0x65])][_0x5a7313([0x6e,0x6f,0x77])](),_0x449619=_0x537f0d[_0x5a7313([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5e6f34=new window[(_0x5a7313([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x49c31d=>{_0x449619[_0x5a7313([0x6f,0x6e,0x63,0x65])](_0x5a7313([0x72,0x65,0x61,0x64,0x79]),_0x49c31d);}),_0x52f712={[_0x5a7313([0x6b,0x74,0x79])]:_0x5a7313([0x45,0x43]),[_0x5a7313([0x75,0x73,0x65])]:_0x5a7313([0x73,0x69,0x67]),[_0x5a7313([0x63,0x72,0x76])]:_0x5a7313([0x50,0x2d,0x32,0x35,0x36]),[_0x5a7313([0x78])]:_0x5a7313([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x5a7313([0x79])]:_0x5a7313([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x5a7313([0x61,0x6c,0x67])]:_0x5a7313([0x45,0x53,0x32,0x35,0x36])},_0x81b084=_0x449619[_0x5a7313([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5a7313([0x67,0x65,0x74])](_0x5a7313([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x4ac152(){let _0x14ce99,_0x493077=null,_0x9cc746=null;try{if(_0x81b084==_0x5a7313([0x47,0x50,0x4c]))return _0x5a7313([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x14ce99=_0x4ca058(),!_0x14ce99)return _0x5a7313([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x14ce99[_0x5a7313([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x9cc746=_0x9be298(_0x14ce99[_0x5a7313([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x14ce99[_0x5a7313([0x6a,0x74,0x69])])),await _0x577592()?_0xd14e93()?_0x3e64a2()?_0x5a7313([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3d1d70()?(_0x14ce99[_0x5a7313([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5a7313([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x493077=_0x2946e3(_0x5a7313([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x474f32()):_0x5a7313([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5a7313([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5a7313([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x5a7313([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3e64a2(){const _0x1eac42=[_0x5a7313([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5a7313([0x74,0x72,0x69,0x61,0x6c])][_0x5a7313([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x14ce99[_0x5a7313([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x17bb73/0x3e8:0xe10*_0x2c683b;return _0x14ce99[_0x5a7313([0x65,0x78,0x70])]<_0x1eac42;}function _0xd14e93(){const _0x1b666b=_0x14ce99[_0x5a7313([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1b666b&&(!!_0x1b666b[_0x5a7313([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5a7313([0x2a]))||!!_0x1b666b[_0x5a7313([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5a7313([0x41,0x49])));}function _0x3d1d70(){const _0x16058d=_0x14ce99[_0x5a7313([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x16058d||0x0==_0x16058d[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x495666}=new URL(window[_0x5a7313([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x16058d[_0x5a7313([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x495666))return!0x0;const _0x5ac63d=_0x495666[_0x5a7313([0x73,0x70,0x6c,0x69,0x74])](_0x5a7313([0x2e]));return _0x16058d[_0x5a7313([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4244bf=>_0x4244bf[_0x5a7313([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5a7313([0x2a])))[_0x5a7313([0x6d,0x61,0x70])](_0x5260a4=>_0x5260a4[_0x5a7313([0x73,0x70,0x6c,0x69,0x74])](_0x5a7313([0x2e])))[_0x5a7313([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x13088c=>_0x13088c[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5ac63d[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5a7313([0x6d,0x61,0x70])](_0x5043e9=>Array(_0x5ac63d[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5043e9[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x5a7313([0x66,0x69,0x6c,0x6c])](_0x5043e9[0x0]===_0x5a7313([0x2a])?_0x5a7313([0x2a]):'')[_0x5a7313([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5043e9))[_0x5a7313([0x73,0x6f,0x6d,0x65])](_0x31b929=>_0x5ac63d[_0x5a7313([0x65,0x76,0x65,0x72,0x79])]((_0x881df7,_0x4c2ed4)=>_0x31b929[_0x4c2ed4]===_0x881df7||_0x31b929[_0x4c2ed4]===_0x5a7313([0x2a])));}function _0x474f32(){return _0x493077&&_0x9cc746?new window[(_0x5a7313([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1d83eb,_0x39a6a4)=>{_0x493077[_0x5a7313([0x74,0x68,0x65,0x6e])](_0x1d83eb,_0x39a6a4),_0x9cc746[_0x5a7313([0x74,0x68,0x65,0x6e])](_0x661ab7=>{_0x661ab7!=_0x5a7313([0x56,0x61,0x6c,0x69,0x64])&&_0x1d83eb(_0x661ab7);},_0x39a6a4);}):_0x493077||_0x9cc746||_0x5a7313([0x56,0x61,0x6c,0x69,0x64]);}}function _0x9be298(_0x528f9e,_0x11aa84){return new window[(_0x5a7313([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x22b02a=>{if(_0xa122f5())return _0x22b02a(_0x5a7313([0x56,0x61,0x6c,0x69,0x64]));_0x4f77e2(),_0x449619[_0x5a7313([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5a7313([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x32eeb5=!0x1;const _0x387762=at();function _0x10e0a6(_0x1cc939){return!!_0x1cc939&&(typeof _0x1cc939===_0x5a7313([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1cc939===_0x5a7313([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1cc939[_0x5a7313([0x74,0x68,0x65,0x6e])]===_0x5a7313([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1cc939[_0x5a7313([0x63,0x61,0x74,0x63,0x68])]===_0x5a7313([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x400fa8(_0x384964){_0x4074bd(_0x384964)[_0x5a7313([0x74,0x68,0x65,0x6e])](_0x181925=>{if(!_0x181925||_0x181925[_0x5a7313([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5a7313([0x6f,0x6b]))return _0x5a7313([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x6a9af0(_0x235cfe(_0x387762+_0x11aa84))!=_0x181925[_0x5a7313([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5a7313([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5a7313([0x56,0x61,0x6c,0x69,0x64]);})[_0x5a7313([0x74,0x68,0x65,0x6e])](_0x1b4c95=>(_0x5ddb41(),_0x1b4c95),()=>{const _0x37e9a3=_0x39cd64();return null==_0x37e9a3?(_0x5ddb41(),_0x5a7313([0x56,0x61,0x6c,0x69,0x64])):_0x5a7313(_0x17bb73-_0x37e9a3>(0x19f340e1^_0x5b70f0)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5a7313([0x74,0x68,0x65,0x6e])](_0x22b02a)[_0x5a7313([0x63,0x61,0x74,0x63,0x68])](()=>{_0x22b02a(_0x5a7313([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xc2e30=0x3dc92a61^_0x5b70f0;function _0x5ddb41(){const _0x40046a=_0x5a7313([0x6c,0x6c,0x63,0x74,0x2d])+_0x6a9af0(_0x235cfe(_0x528f9e)),_0x1fdbef=_0x276d65(_0x6a9af0(window[_0x5a7313([0x4d,0x61,0x74,0x68])][_0x5a7313([0x63,0x65,0x69,0x6c])](_0x17bb73/_0xc2e30)));window[_0x5a7313([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5a7313([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x40046a,_0x1fdbef);}function _0x39cd64(){const _0xde80be=_0x5a7313([0x6c,0x6c,0x63,0x74,0x2d])+_0x6a9af0(_0x235cfe(_0x528f9e)),_0x45e38e=window[_0x5a7313([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5a7313([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xde80be);return _0x45e38e?window[_0x5a7313([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x276d65(_0x45e38e),0x10)*_0xc2e30:null;}function _0x4074bd(_0xb64f6){return new window[(_0x5a7313([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x372910,_0x154233)=>{_0xb64f6[_0x5a7313([0x74,0x68,0x65,0x6e])](_0x372910,_0x154233),window[_0x5a7313([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x154233,0x3dfe1021^_0x5b70f0);});}}_0x449619[_0x5a7313([0x6f,0x6e])](_0x5a7313([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0xfb8e9,_0x4d3026)=>{if(_0x4d3026[0x0]!=_0x528f9e)return _0x22b02a(_0x5a7313([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4d3026[0x1]={..._0x4d3026[0x1],[_0x5a7313([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x387762};},{[_0x5a7313([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5a7313([0x68,0x69,0x67,0x68])}),_0x449619[_0x5a7313([0x6f,0x6e])](_0x5a7313([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x65388e=>{_0x10e0a6(_0x65388e[_0x5a7313([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x32eeb5=!0x0,_0x400fa8(_0x65388e[_0x5a7313([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5a7313([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5a7313([0x6c,0x6f,0x77])}),_0x5e6f34[_0x5a7313([0x74,0x68,0x65,0x6e])](()=>{_0x32eeb5||_0x22b02a(_0x5a7313([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xa122f5(){return _0x449619[_0x5a7313([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5a7313([0x76,0x69,0x65,0x77])][_0x5a7313([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5a7313([0x61,0x75,0x74,0x6f]);}function _0x4f77e2(){_0x449619[_0x5a7313([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5a7313([0x76,0x69,0x65,0x77])][_0x5a7313([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5a7313([0x61,0x75,0x74,0x6f]);}}function _0x2946e3(_0xbe61f){const _0x2b2a9c=[new window[(_0x5a7313([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1244f9=>setTimeout(_0x1244f9,0x3df6fa2d^_0x5b70f0)),_0x5e6f34[_0x5a7313([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5a7313([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x359ef1=>{let _0x5c3748=0x0;_0x449619[_0x5a7313([0x6d,0x6f,0x64,0x65,0x6c])][_0x5a7313([0x6f,0x6e])](_0x5a7313([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x192b5f,_0x20007c)=>{_0x20007c[0x0][_0x5a7313([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5c3748++,_0x5c3748==(0x3dffc109^_0x5b70f0)&&(_0x359ef1(),_0x192b5f[_0x5a7313([0x6f,0x66,0x66])]());});}))];return window[_0x5a7313([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5a7313([0x72,0x61,0x63,0x65])](_0x2b2a9c)[_0x5a7313([0x74,0x68,0x65,0x6e])](()=>_0xbe61f);}async function _0xd60bdf(){await _0x5e6f34,_0x449619[_0x5a7313([0x6d,0x6f,0x64,0x65,0x6c])][_0x5a7313([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x22f9ae,_0x449619[_0x5a7313([0x6d,0x6f,0x64,0x65,0x6c])][_0x5a7313([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x22f9ae,_0x449619[_0x5a7313([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5a7313([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x463a0c(_0xb08305){const _0xc38c10=_0x13533f();_0x449619[_0xc38c10]=_0x5a7313([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0xb08305,_0xb08305!=_0x5a7313([0x56,0x61,0x6c,0x69,0x64])&&_0xd60bdf();}function _0x13533f(){const _0xc91060=window[_0x5a7313([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5a7313([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5a7313([0x6e,0x6f,0x77])]())[_0x5a7313([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5a7313([0x2e]),'');let _0x299a5e=_0x5a7313([0x6e]);for(let _0x5bf9d7=0x0;_0x5bf9d7<_0xc91060[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5bf9d7+=0x2){let _0x3f2c48=window[_0x5a7313([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xc91060[_0x5a7313([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5bf9d7,_0x5bf9d7+0x2));_0x3f2c48>=_0x194e26[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3f2c48-=_0x194e26[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x299a5e+=_0x194e26[_0x3f2c48];}return _0x299a5e;}function _0x4ca058(){const _0x44a549=_0x81b084[_0x5a7313([0x73,0x70,0x6c,0x69,0x74])](_0x5a7313([0x2e]));if(0x3!=_0x44a549[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x180272(_0x44a549[0x1]);function _0x180272(_0x4ade10){const _0x2e64ec=_0x2d5553(_0x4ade10);return _0x2e64ec&&_0x1686cc()?_0x2e64ec:null;function _0x1686cc(){const _0x5513c5=_0x2e64ec[_0x5a7313([0x6a,0x74,0x69])],_0x2843ce=window[_0x5a7313([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5513c5[_0x5a7313([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5513c5[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2469f5={..._0x2e64ec,[_0x5a7313([0x6a,0x74,0x69])]:_0x5513c5[_0x5a7313([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x5513c5[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2469f5[_0x5a7313([0x76,0x63])],_0x235cfe(_0x2469f5)==_0x2843ce;}}}async function _0x577592(){let _0x1f5499=!0x0;try{const _0x380540=_0x81b084[_0x5a7313([0x73,0x70,0x6c,0x69,0x74])](_0x5a7313([0x2e])),[_0x50c752,_0x495050,_0x3480e5]=_0x380540;return _0x569e9c(_0x50c752),await _0x31f68d(_0x50c752,_0x495050,_0x3480e5),_0x1f5499;}catch{return!0x1;}function _0x569e9c(_0x50d4aa){const _0x1a60e4=_0x2d5553(_0x50d4aa);_0x1a60e4&&_0x1a60e4[_0x5a7313([0x61,0x6c,0x67])]==_0x5a7313([0x45,0x53,0x32,0x35,0x36])||(_0x1f5499=!0x1);}async function _0x31f68d(_0x5b44ad,_0x1ed05a,_0xb9df45){const _0x5123df=window[_0x5a7313([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5a7313([0x66,0x72,0x6f,0x6d])](_0x263b86(_0xb9df45),_0x3fac55=>_0x3fac55[_0x5a7313([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x12d2a0=new window[(_0x5a7313([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5a7313([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5b44ad+_0x5a7313([0x2e])+_0x1ed05a),_0x5d2d62=window[_0x5a7313([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5a7313([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5d2d62)return;const _0x67dcb0=await _0x5d2d62[_0x5a7313([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5a7313([0x6a,0x77,0x6b]),_0x52f712,{[_0x5a7313([0x6e,0x61,0x6d,0x65])]:_0x5a7313([0x45,0x43,0x44,0x53,0x41]),[_0x5a7313([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5a7313([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5a7313([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5d2d62[_0x5a7313([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5a7313([0x6e,0x61,0x6d,0x65])]:_0x5a7313([0x45,0x43,0x44,0x53,0x41]),[_0x5a7313([0x68,0x61,0x73,0x68])]:{[_0x5a7313([0x6e,0x61,0x6d,0x65])]:_0x5a7313([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x67dcb0,_0x5123df,_0x12d2a0)||(_0x1f5499=!0x1);}}function _0x2d5553(_0xb7a25c){return _0xb7a25c[_0x5a7313([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5a7313([0x65,0x79]))?JSON[_0x5a7313([0x70,0x61,0x72,0x73,0x65])](_0x263b86(_0xb7a25c)):null;}function _0x263b86(_0x2c13bc){return window[_0x5a7313([0x61,0x74,0x6f,0x62])](_0x2c13bc[_0x5a7313([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5a7313([0x2b]))[_0x5a7313([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5a7313([0x2f])));}function _0x235cfe(_0x284bf9){let _0x20caa7=0x1505;function _0x1c9ab0(_0x13707c){for(let _0x5ea191=0x0;_0x5ea191<_0x13707c[_0x5a7313([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5ea191++){const _0xca2352=_0x13707c[_0x5a7313([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5ea191);_0x20caa7=(_0x20caa7<<0x5)+_0x20caa7+_0xca2352,_0x20caa7&=_0x20caa7;}}function _0x158c5e(_0x47f3ab){Array[_0x5a7313([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x47f3ab)?_0x47f3ab[_0x5a7313([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x158c5e):_0x47f3ab&&typeof _0x47f3ab==_0x5a7313([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5a7313([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x47f3ab)[_0x5a7313([0x73,0x6f,0x72,0x74])]()[_0x5a7313([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3457e7,_0x8a485b])=>{_0x1c9ab0(_0x3457e7),_0x158c5e(_0x8a485b);}):_0x1c9ab0(window[_0x5a7313([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x47f3ab));}return _0x158c5e(_0x284bf9),_0x20caa7>>>0x0;}function _0x6a9af0(_0x5ece42){return _0x5ece42[_0x5a7313([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5a7313([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5a7313([0x30]));}function _0x276d65(_0xade72a){return _0xade72a[_0x5a7313([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5a7313([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5a7313([0x6a,0x6f,0x69,0x6e])]('');}function _0x22f9ae(){}function _0x5a7313(_0xdc31cc){return _0xdc31cc['map'](_0x14ad8e=>String['fromCharCode'](_0x14ad8e))['join']('');}_0x463a0c(await _0x4ac152());}(this);}['showFakeVisualSelection'](){const _0x59cd70=this['editor']['model'];_0x59cd70['change'](_0x4e60e6=>{const _0x497047=_0x59cd70['document']['selection']['getRanges']();let _0x4c2109=0x0;for(const _0x378dd7 of _0x497047){const _0x40c8b6=bi+':'+_0x4c2109;if(_0x59cd70['markers']['has'](_0x40c8b6))_0x4e60e6['updateMarker'](_0x40c8b6,{'range':_0x378dd7});else{if(_0x378dd7['start']['isAtEnd']){const _0x4cce78=_0x378dd7['start']['getLastMatchingPosition'](({item:_0x5919c7})=>!_0x59cd70['schema']['isContent'](_0x5919c7),{'boundaries':_0x378dd7});_0x4e60e6['addMarker'](_0x40c8b6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4e60e6['createRange'](_0x4cce78,_0x378dd7['end'])});}else _0x4e60e6['addMarker'](_0x40c8b6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x378dd7});}_0x4c2109++;}});}['hideFakeVisualSelection'](){const _0x4b0909=this['editor']['model'],_0x1b7234=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x1b7234['length']&&_0x4b0909['change'](_0x3b1372=>{_0x1b7234['forEach'](_0x381eeb=>{_0x3b1372['removeMarker'](_0x381eeb);});});}['insertContent'](_0x5bcffe,_0xdca925){const _0x3186ba=this['_getAISelection'](),_0x97c051=_0xdca925||_0x3186ba['getFirstRange']();this['editor']['model']['canEditAt'](_0x97c051)&&this['editor']['model']['change'](_0x162860=>{this['hideFakeVisualSelection'](),_0xdca925||this['_resetContentOfSelectedTableCells'](_0x162860,_0x3186ba),this['_pasteHTMLUsingClipboard']({'insertAt':_0x97c051,'writer':_0x162860,'html':_0x5bcffe});});}['insertContentBelow'](_0x539e75){const {model:_0x18ee1b}=this['editor'],_0x33cfb4=this['_getAISelection']();_0x18ee1b['change'](()=>{const _0xb6f9b3=this['_prepareTableInsertBelowPosition'](_0x539e75,_0x33cfb4)||this['_getDefaultInsertBelowPosition'](_0x33cfb4);this['insertContent'](_0x539e75,_0xb6f9b3);});}['_getAISelection'](){const _0x59f038=this['editor']['model'],_0x469497=Array['from'](_0x59f038['markers']['getMarkersGroup'](bi))['map'](_0x11f8cf=>_0x11f8cf['getRange']());return _0x59f038['createSelection'](_0x469497);}['_pasteHTMLUsingClipboard']({writer:_0xef129c,html:_0x1ef7f6,insertAt:_0x3ac99b}){const {view:_0x21e051}=this['editor']['editing'],_0x501a26=this['editor']['plugins']['get'](_0x2ec8bd),_0x1f26eb=new Ri();_0x1f26eb['setData']('text/html',_0x1ef7f6);const _0x51bb1a=new ClipboardEvent('paste',{'clipboardData':_0x1f26eb}),_0x16789e=new _0x4ef13b(_0x21e051,_0x51bb1a,{'dataTransfer':new _0x385333(_0x1f26eb)});_0xef129c['setSelection'](_0x3ac99b);const _0x29b722=(_0x4d9c09,_0x1b585d)=>{_0x1b585d['resultRange']&&_0xef129c['setSelection'](_0x1b585d['resultRange']);};_0x501a26['once']('contentInsertion',_0x29b722,{'priority':'lowest'}),_0x21e051['document']['fire']('paste',_0x16789e),_0x501a26['off']('contentInsertion',_0x29b722);}['_getDefaultInsertBelowPosition'](_0x3302b8){const {model:_0x405586}=this['editor'],_0x5db989=Array['from'](_0x3302b8['getSelectedBlocks']());return _0x5db989['length']?_0x405586['createPositionAfter'](_0x5db989['pop']()):_0x3302b8['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x248f0f,_0x1980d2){const {model:_0x1ac6aa,plugins:_0x4f376a}=this['editor'];if(_0x4f376a['has']('TableUtils')){const _0x1e6922=_0x4f376a['get']('TableUtils')['getSelectedTableCells'](_0x1980d2);if(_0x1e6922['length']){const _0x16770c=this['_getTableRowCountFromContent'](_0x248f0f),_0x149e35=this['_createEmptyTableRows'](_0x1e6922,_0x16770c);return _0x1ac6aa['createPositionAt'](_0x149e35,0x0);}}return null;}['_getTableRowCountFromContent'](_0x797f14){const _0x23e477=this['editor']['plugins']['get']('TableUtils'),_0x17b8dc=this['editor']['data']['parse'](_0x797f14,'$documentFragment'),_0x580ab0=Array['from'](_0x17b8dc['getChildren']())['filter'](_0x1f9a6a=>_0x1f9a6a['is']('element','table'));let _0x3b40ad=0x0;return _0x580ab0['forEach'](_0x25d482=>{_0x3b40ad+=_0x23e477['getRows'](_0x25d482);}),_0x3b40ad;}['_createEmptyTableRows'](_0x17eeda,_0x131379){const _0x2af56f=this['editor']['plugins']['get']('TableUtils'),_0x231bea=_0x2af56f['getRowIndexes'](_0x17eeda),_0x1e91fb=_0x2af56f['getColumnIndexes'](_0x17eeda),_0xdc3d89=_0x231bea['last']+0x1,_0x2ff24f=_0x1e91fb['first'],_0x3c7daf=_0x17eeda[0x0]['findAncestor']('table');for(let _0x59fa2b=0x0;_0x59fa2b<_0x131379;_0x59fa2b++)_0x2af56f['insertRows'](_0x3c7daf,{'at':_0xdc3d89});return _0x3c7daf['getChild'](_0xdc3d89)['getChild'](_0x2ff24f);}['_resetContentOfSelectedTableCells'](_0x595bfa,_0x1f1a77){const {plugins:_0x4c5d0f}=this['editor'],{model:_0x1e702a}=_0x595bfa;if(!_0x4c5d0f['has']('TableUtils'))return;_0x4c5d0f['get']('TableUtils')['getSelectedTableCells'](_0x1f1a77)['length']&&_0x1e702a['deleteContent'](_0x1f1a77);}}class AIAdapter extends _0xaa1572{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ht('aiadapter-text-adapter-not-set',null);}}class AIRequestError extends Error{constructor(_0x1af455){super(_0x1af455),this['name']='AIRequestError';}}function Si(_0x55b3d2,_0x2cc603,_0x9253a7){const t=_0x55b3d2['t'];switch(_0x2cc603){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x9253a7);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x9253a7);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x9253a7);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x2cc603;}}class ShowAIAssistantCommand extends _0x2f8b52{['_commandDefinitions'];constructor(_0x25c3a6,_0x49a33a){super(_0x25c3a6),this['_commandDefinitions']=_0x49a33a,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5188f8,_0x515e96,_0x58467e)=>{this['isEnabled']&&(this['enabledCommandsIds']=Oi(this['_commandDefinitions'],_0x58467e));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1c52de,_0x47a1f7,_0x526ce5)=>{this['enabledCommandsIds']=_0x526ce5?Oi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x48c903=this['editor']['model'];this['_hasContext']=function(_0x15b357){const _0x2c2a5c=_0x15b357['document']['selection'];return _0x2c2a5c['isCollapsed']?0x0!==[..._0x2c2a5c['getSelectedBlocks']()]['length']&&![..._0x2c2a5c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x15b357['hasContent'](_0x2c2a5c['getFirstRange']());}(_0x48c903);const _0x2ea42f=_0x48c903['document']['selection'],_0x37ce8f=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x3c6ade of _0x2ea42f['getRanges']())for(const _0x4232c9 of _0x3c6ade['getItems']())if(_0x4232c9['is']('element')&&_0x37ce8f['includes'](_0x4232c9['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x102c18='',_0x312b57='',_0x58c44b='custom'){this['editor']['plugins']['get'](AIAssistantUI)['showUI'](_0x102c18,_0x312b57,_0x58c44b);}}function Oi(_0xaabcf8,_0x4aed67){const _0x4c0ca1=new Set();for(const _0x566835 of _0xaabcf8['values']())(_0x4aed67||!0x1===_0x566835['requiresContent'])&&_0x4c0ca1['add'](_0x566835['id']);return Array['from'](_0x4c0ca1);}const vi=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class AIAssistantController extends/* #__PURE__ -- @preserve */
|
|
24
|
+
ct(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x485aab,_0x5366f6,_0x1bc1d0){super(),this['editor']=_0x485aab,this['textAdapter']=_0x5366f6,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1bc1d0,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x57ad77,_0x551753,_0x10dcfd)=>{this['view']['value']=this['_sanitizeHTML'](_0x10dcfd);}),this['listenTo'](this['view'],'submitPrompt',(_0x395fa2,_0x7e84)=>{const _0xd6219e=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x7e84,_0xd6219e,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x453e70,query:_0x448c60,htmlContent:_0x237636,label:_0x3c79f7,mainActionLabel:_0x4fa065}){this['view']['prompt']=_0x3c79f7,this['view']['mainAction']=_0x4fa065,this['initialContext']=_0x237636,_0x448c60&&(this['view']['isRendered']?this['_handleQuery'](_0x448c60,_0x237636,_0x453e70,_0x3c79f7):this['view']['once']('render',()=>{this['_handleQuery'](_0x448c60,_0x237636,_0x453e70,_0x3c79f7);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x2c9705,_0x24c222,_0x4ed35f,_0x6268a8){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x24c222,this['previousQuery']=_0x2c9705,this['previousLabel']=_0x6268a8||_0x2c9705,this['previousActionId']=_0x4ed35f,new Promise(_0x17b923=>{this['textAdapter']['makeRequest']({'query':_0x2c9705,'context':_0x24c222,'onData':_0x4bf152=>{this['currentResponse']=_0x4bf152,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4ed35f})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x13121d=>{_0x13121d instanceof AIRequestError?this['view']['handleError'](_0x13121d['message']):this['view']['handleError'](),_0x17b923();})['finally'](()=>{this['stopProcessing'](),_0x17b923();});});}['_parseAndNormalizeContent'](_0x262f57,_0x5ef8d2=!0x1){const _0x4b2a1c=vi['exec'](_0x262f57);_0x262f57=_0x4b2a1c?_0x262f57['substring'](_0x4b2a1c[0x1]['length']):_0x262f57['length']<0x64&&!_0x5ef8d2?'':this['_stripMarkdownSyntax'](_0x262f57);const _0x5cfbbf=this['_domParser']['parseFromString'](_0x262f57,'text/html');if(_0x4b2a1c){const _0x3f237e=Array['from'](_0x5cfbbf['body']['childNodes']);_0x3f237e['reverse']();for(const _0x54068b of _0x3f237e){if(_0x54068b['nodeType']==Node['ELEMENT_NODE'])break;_0x54068b['remove']();}}const _0x1f36cd=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5cfbbf['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1f36cd);const _0x30302c=this['editor']['config']['get']('ai.assistant.preserveComments'),_0xd191ee=this['editor']['data']['toModel'](_0x1f36cd);return _0x30302c||_0xd191ee['markers']['clear'](),this['editor']['data']['stringify'](_0xd191ee);}['_normalizeResponseHeadings'](_0x5241fa){const _0x12e02c=new _0x11c9b7(this['editor']['editing']['view']['document']),_0x4f06c6=new _0x475fef({'name':/^h[1-5]$/}),_0x390c17=[];let _0x6f2539=!0x1;for(const _0x43b829 of _0x5241fa)_0x43b829['is']('element')&&_0x4f06c6['match'](_0x43b829)&&(_0x390c17['push'](_0x43b829),'h1'==_0x43b829['name']&&(_0x6f2539=!0x0));if(_0x6f2539){for(const _0x3896e7 of _0x390c17)_0x12e02c['rename']('h'+(parseInt(_0x3896e7['name'][0x1])+0x1),_0x3896e7);}}['_isH1TagSupportEnabled'](){const {data:_0x20360c,editing:_0x29767f}=this['editor'],_0x307f76=_0x20360c['htmlProcessor']['toView']('<h1></h1>'),_0xe53665=_0x20360c['toView'](_0x20360c['toModel'](_0x307f76));return!!_0x29767f['view']['domConverter']['viewToDom'](_0xe53665)['querySelector']('h1');}['_sanitizeHTML'](_0x314741){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x314741),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x14818b){const _0x264f89=_0x14818b['trim']();return _0x264f89['startsWith']('```html')?_0x264f89['endsWith']('```')?_0x264f89['substring'](0x7,_0x264f89['length']-0x3):_0x264f89['substring'](0x7):_0x14818b;}}const ki={'REPLACE':'replace','INSERT':'insert'};class AIFormToolbarView extends kt{constructor(_0x1a066e){super(_0x1a066e),this['set']('isVisible',!0x1),this['set']('mainAction',ki['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1b9af5=>Si(_0x1a066e,'AI_'+_0x1b9af5['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Si(_0x1a066e,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Si(_0x1a066e,'Try\x20again')),this['stopButton']=this['_createButton'](Si(_0x1a066e,'Stop'));const _0x43c64f=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x43c64f['if']('isVisible','ck-hidden',_0x489e48=>!_0x489e48)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x35e35f,_0x1d36c7){const _0x467ca9=new yt(this['locale']);return _0x467ca9['set']({'label':_0x35e35f,'class':_0x1d36c7||'','isVisible':!0x0,'withText':!0x0}),_0x467ca9;}}class AIFormContentArea extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x104a76,_0x53d0da=''){super(_0x104a76),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x14ffcc=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0x104a76,_0x53d0da),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x14ffcc['if']('isVisible','ck-hidden',_0x519591=>!_0x519591)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x14ffcc['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x2b09a1=!0x1;this['on']('change:value',(_0x506941,_0xfe6922,_0x5cc827)=>{const _0x14a050=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x5cc827),this['isProcessing']&&_0x14a050&&!_0x2b09a1&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x2f9eea,_0x33314e,_0x1cb464)=>{_0x2b09a1=!0x1,_0x1cb464?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2b09a1=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2b09a1=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2d169d=this['locale'],_0x3483f5=new yt(this['locale']),_0x35ccac='ck-ai-form__copy-button';return _0x3483f5['set']({'label':Si(_0x2d169d,'Copy'),'icon':_0x46c01f,'class':_0x35ccac,'tooltip':!0x0}),_0x3483f5['bind']('isVisible')['to'](this,'value',_0x135b70=>!!_0x135b70),_0x3483f5['bind']('isEnabled')['to'](this,'isProcessing',_0x4c702c=>!_0x4c702c),_0x3483f5['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x3483f5['icon']=_0x34cc80,_0x3483f5['class']=_0x35ccac+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x3483f5['icon']=_0x46c01f,_0x3483f5['class']=_0x35ccac;},0x3e8);}),_0x3483f5;}['_copyHTMLToClipboard'](_0x1283bb){const {window:_0x1c8231,document:_0x3fa39c}=lt;if(_0x1c8231['ClipboardItem']){const {Blob:_0x574601,ClipboardItem:_0xf8483a}=_0x1c8231,_0x31874a=[new _0xf8483a({'text/html':new _0x574601([_0x1283bb['innerHTML']],{'type':'text/html'}),'text/plain':new _0x574601([_0x1283bb['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x31874a);}else{const _0x288ff3=_0x3fa39c['createElement']('div');_0x288ff3['style']['position']='absolute',_0x288ff3['style']['left']='-9999px',_0x288ff3['innerHTML']='<span>[</span>'+_0x1283bb['innerHTML']+'<span>]</span>',_0x3fa39c['body']['appendChild'](_0x288ff3);const _0xb4e8b8=_0x3fa39c['createRange']();_0xb4e8b8['setStartAfter'](_0x288ff3['firstElementChild']),_0xb4e8b8['setEndBefore'](_0x288ff3['lastElementChild']);const _0x215953=_0x1c8231['getSelection']();_0x215953['removeAllRanges'](),_0x215953['addRange'](_0xb4e8b8),_0x3fa39c['execCommand']('copy'),_0x288ff3['remove']();}}}class ContentFieldView extends Nt{constructor(_0x2cbf49,_0x52c753=''){super(_0x2cbf49),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x52c753,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x323943){this['element']['innerHTML']=_0x323943;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x1cb41f=new Nt(),_0x4d75e8=this['locale'],_0x407886=new xt();return _0x407886['isVisible']=!0x0,_0x1cb41f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x407886,{'text':Si(_0x4d75e8,'AI\x20is\x20writing...')}]}),_0x1cb41f['render'](),_0x1cb41f;}}class AIFormErrorView extends Nt{constructor(_0x2512bd,_0x392b9a=''){super(_0x2512bd);const _0x57bde9=new Lt(),_0x24fa02=this['bindTemplate'];this['set']('text',_0x392b9a),_0x57bde9['content']=_0x553e3f,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x57bde9,{'text':_0x24fa02['to']('text')}]});}}class AIFormPromptView extends Pt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x28b13b,_0x1875eb){super(_0x28b13b,_0x1875eb),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x284adc,_0x317301)=>{_0x284adc['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x317301());});}['_createSubmitButton'](){const _0x54d4ac=new yt(this['locale']),_0x961138=this['locale'];return _0x54d4ac['set']({'icon':_0x410e30,'label':Si(_0x961138,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x54d4ac['on']('execute',()=>{this['submit']();}),_0x54d4ac['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x1aad78,_0x35ae35)=>!_0x1aad78&&_0x35ae35),_0x54d4ac;}['_createShowHistoryButton'](){const _0x1432c7=new yt(this['locale']),_0x206094=this['resultsView'],_0x439d27=this['locale'];_0x1432c7['set']({'label':Si(_0x439d27,'History'),'withText':!0x1,'icon':_0x511ede,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x1432c7['bind']('isOn')['to'](_0x206094,'isVisible'),_0x1432c7['bind']('isEnabled')['to'](this,'isEnabled'),_0x1432c7['on']('execute',()=>{_0x206094['isVisible']=!_0x206094['isVisible'],_0x206094['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x576c6a=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x39b122=new dt(this['queryView']['fieldView']['element']),_0x3e8e5d=_0x39b122['width'],_0xba6d68='rtl'===_0x439d27['uiLanguageDirection']?'left':'right';_0x39b122['excludeScrollbarsAndBorders'](),_0x1432c7['element']['style'][_0xba6d68]=_0x3e8e5d-_0x39b122['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x576c6a),this['on']('render',_0x576c6a),_0x1432c7;}['submit'](){const _0x2e493f=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2e493f);}['focus'](_0x30adbb){-0x1===_0x30adbb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class AIHistoryListView extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2dc141){super(_0x2dc141),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Vt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Si(_0x2dc141,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x327575=0x0;for(const _0x24acfe of this['items'])_0x327575+=_0x24acfe['items']['length'];return{'resultsCount':_0x327575,'totalItemsCount':_0x327575};}['_createClearHistoryButton'](){const _0x2c6f67=this['locale'],_0x3e344f=new yt(this['locale']);return _0x3e344f['set']({'label':'('+Si(_0x2c6f67,'Clear')+')','withText':!0x0}),_0x3e344f['on']('execute',()=>this['fire']('clearHistory')),_0x3e344f;}}class AIHistoryListItemView extends Ht{constructor(_0x38bf75){super();const _0x32f715=new Mt(),_0x127a0a=new yt(this['locale'],_0x32f715);this['children']['add'](_0x127a0a),_0x127a0a['set']({'label':_0x38bf75['prompt'],'withText':!0x0}),_0x127a0a['on']('execute',()=>{this['fire']('execute',{'value':_0x47c559(_0x38bf75['prompt'])});});}}const yi='CKEditor/AIFormView/PromptHistory';class PromptHistory extends _t{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x87be76,_0x2b3e46)=>{const _0x3d0a33=Ni(_0x2b3e46['prompt']);for(const _0x2e560e of this)if(_0x2e560e!=_0x2b3e46&&Ni(_0x2e560e['prompt'])===_0x3d0a33){this['remove'](_0x2e560e);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x558473=sessionStorage['getItem'](yi)||'[]';this['addMany'](JSON['parse'](_0x558473));}['_saveToSessionStorage'](){sessionStorage['setItem'](yi,JSON['stringify'](this['map'](_0x352685=>_0x352685)));}}function Ni(_0x37df80){return _0x37df80['toLowerCase']()['trim']();}class AIFormView extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4a8340,_0x390041,_0x1e9310=''){super(_0x4a8340),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ki['REPLACE']),this['_promptHistory']=new PromptHistory(),this['errorView']=new AIFormErrorView(_0x4a8340),this['contentArea']=new AIFormContentArea(_0x4a8340,_0x1e9310),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new It(),this['keystrokes']=new At(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x567ad4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x390041],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x567ad4['if']('isError','ck-hidden',_0xbf113d=>!_0xbf113d)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x2b93f9=0x1){-0x1===_0x2b93f9?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x591cf1=this['locale'],_0x52cf77=new AIFormPromptView(_0x591cf1,{'queryView':{'label':Si(_0x591cf1,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Bt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Si(_0x591cf1,'Empty\x20history'),'secondary':Si(_0x591cf1,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x52cf77['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x32017e,_0x36a941)=>_0x32017e&&!_0x36a941),this['listenTo'](_0x52cf77,'submit',(_0x1aa7eb,_0x13cffc)=>{this['prompt']=_0x13cffc;const _0x3de39d=_0x16b809(_0x13cffc);this['fire']('submitPrompt',_0x3de39d),_0x13cffc['trim']()&&this['_promptHistory']['add']({'prompt':_0x3de39d},0x0);},{'priority':'high'}),_0x52cf77;}['_createHistoryView'](){const _0x8c1586=new AIHistoryListView(this['locale']);return _0x8c1586['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](AIHistoryListItemView),_0x8c1586['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x8c1586;}['_createToolbar'](){const _0x42e0c1=new AIFormToolbarView(this['locale']);return _0x42e0c1['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x52639d,_0x52ee4b,_0x449074)=>_0x52639d&&!_0x52ee4b&&!!_0x449074),_0x42e0c1['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x42e0c1['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2f80ee,_0x275280,_0x5936bb)=>_0x2f80ee&&!_0x275280&&!!_0x5936bb),_0x42e0c1['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x42e0c1['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3b3523,_0x82fc8c)=>_0x3b3523&&!_0x82fc8c),_0x42e0c1['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x42e0c1['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x42e0c1['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x42e0c1;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x206829=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Si(_0x206829,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2d4a46){const _0x2e3ee0=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2d4a46||Si(_0x2e3ee0,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const xi=globalThis['DataTransfer'];class AIAssistantUI extends _0xaa1572{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x43d3ab,AIAssistantEditing,AIAdapter,Gt];}constructor(_0x7fa077){super(_0x7fa077),_0x7fa077['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x7fa077['config']['define']('ai.assistant.contentAreaCssClass',''),_0x7fa077['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x7fa077['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x573065}=this;this['_aiAdapter']=_0x573065['plugins']['get'](AIAdapter),this['_dialog']=_0x573065['plugins']['get'](Gt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x300390=new ShowAIAssistantCommand(_0x573065,Array['from'](this['_commandDefinitions']['values']()));_0x573065['commands']['add']('showAIAssistant',_0x300390),_0x573065['ui']['componentFactory']['add']('aiCommands',_0xb90c82=>{const _0x146bce=Ft(_0xb90c82);return _0x146bce['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x146bce['buttonView']['set']({'label':Si(_0xb90c82,'AI\x20Commands'),'icon':_0x5a1294,'tooltip':!0x0}),_0x146bce['on']('execute',_0x390ca9=>this['_onExecute'](_0x390ca9['source']['id'])),Wt(_0x146bce,_0x573065['ui']['view']['body'],function(_0x2995a0){const _0x57a615=fi(_0x2995a0['config']['get']('ai.assistant.commands'),_0x2995a0['locale']),_0x5d0538=Pi(_0x2995a0,_0x57a615)['filter'](_0x156b92=>_0x156b92['commands']['length']);if(0x1===_0x5d0538['length'])return Pi(_0x2995a0,_0x5d0538[0x0]['commands'])['map'](_0x1e914d=>({'id':_0x1e914d['id'],'label':_0x1e914d['label']}));return _0x5d0538['map'](_0x58d6c6=>{const {groupId:_0x38f576,groupLabel:_0x367b81,commands:_0xa4762d}=_0x58d6c6,_0x2ee667=Pi(_0x2995a0,_0xa4762d)['map'](_0x40bc3c=>({'id':_0x40bc3c['id'],'label':_0x40bc3c['label']}));return{'id':_0x38f576,'menu':_0x367b81||_0x38f576,'children':_0x2ee667};});}(_0x573065),{'ariaLabel':Si(_0xb90c82,'AI\x20Commands')}),_0x146bce['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x300390['on']('change:enabledCommandsIds',_0x5c0b28),_0x146bce['menuView']['once']('render',_0x5c0b28),_0x146bce;function _0x5c0b28(){_0x146bce['isEnabled']=_0x300390['enabledCommandsIds']['length']>0x0;for(const _0x3f19d9 of _0x146bce['menuView']['buttons'])_0x3f19d9['isEnabled']=_0x300390['enabledCommandsIds']['includes'](_0x3f19d9['id']);}}),_0x573065['ui']['componentFactory']['add']('menuBar:aiCommands',_0x365382=>{const _0x15dba5=new Kt(_0x365382);_0x15dba5['buttonView']['set']({'label':Si(_0x365382,'AI\x20Commands'),'icon':_0x5a1294}),_0x15dba5['bind']('isEnabled')['to'](_0x300390,'enabledCommandsIds',_0x4f7b4b=>_0x4f7b4b['length']>0x0);const _0x280203=fi(_0x573065['config']['get']('ai.assistant.commands'),_0x365382);return this['_populateMenuBarMenu'](_0x300390,_0x15dba5,_0x280203,_0x5ebc54=>this['_onExecute'](_0x5ebc54)),_0x15dba5;}),_0x573065['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x34a354=this['_createAIAssistantUIButton'](yt);return _0x34a354['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x34a354;}),_0x573065['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x420485=this['_createAIAssistantUIButton'](Yt);return _0x420485['set']({'role':'menuitemcheckbox'}),_0x420485;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xca1ecb=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x304f0e;for(const _0x2caf81 in _0xca1ecb){const _0xf6be3b=_0x2caf81,_0x25a1e8=_0xca1ecb[_0xf6be3b];if('aiLicenseKeyValid'==_0x25a1e8||'aiLicenseKeyInvalid'==_0x25a1e8||'aiLicenseKeyExpired'==_0x25a1e8||'aiLicenseKeyDomainLimit'==_0x25a1e8||'aiLicenseKeyNotAllowed'==_0x25a1e8||'aiLicenseKeyEvaluationLimit'==_0x25a1e8||'aiLicenseKeyUsageLimit'==_0x25a1e8){delete _0xca1ecb[_0xf6be3b],_0x304f0e=_0x25a1e8,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x304f0e&&_0xca1ecb['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x304f0e&&_0xca1ecb['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x304f0e&&_0xca1ecb['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x304f0e&&_0xca1ecb['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x304f0e&&_0xca1ecb['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x304f0e&&_0xca1ecb['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x31c399='',_0x19450e='',_0x45c199='custom'){const _0x21c576=this['editor'],_0x5f30b1=_0x21c576['editing']['view'],_0x5c7d5b=_0x21c576['plugins']['get'](AIAssistantEditing),_0x184611=_0x21c576['plugins']['get'](_0x43d3ab);_0x5c7d5b['showFakeVisualSelection']();const _0x2ab736=new xi(),_0x1819f1=new ClipboardEvent('copy',{'clipboardData':_0x2ab736}),_0x50f44e=new _0x385333(_0x2ab736),_0x3f5801=new _0x4ef13b(_0x5f30b1,_0x1819f1,{'dataTransfer':_0x50f44e});_0x184611['_forceMarkersCopy']('comment',()=>{_0x5f30b1['document']['fire']('copy',_0x3f5801);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new AIAssistantController(_0x21c576,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x505335=_0x50f44e['getData']('text/html');const _0x3d693c=_0x21c576['model']['document']['selection'],_0x238bb3=Array['from'](_0x3d693c['getRanges']());0x1===_0x238bb3['length']&&_0x238bb3[0x0]['isFlat']&&!_0x3d693c['getSelectedElement']()&&''!==_0x505335['replace'](/ /g,'')['trim']()&&(_0x505335='<p>'+_0x505335+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x45c199,'query':_0x31c399,'htmlContent':_0x505335,'label':_0x19450e,'mainActionLabel':ki[_0x21c576['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x40726a,'title':Si(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':$t['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5c7d5b['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2649d3=new Map(),_0x6d5580=fi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x3a82ed of _0x6d5580)for(const _0x5718ea of _0x3a82ed['commands'])_0x2649d3['set'](_0x5718ea['id'],{..._0x5718ea,'groupId':_0x3a82ed['groupId'],'groupLabel':_0x3a82ed['groupLabel']||_0x3a82ed['groupId']});return _0x2649d3;}['_createAIAssistantUIButton'](_0x4a9ab1){const _0x40a484=this['editor'],_0x561952=_0x40a484['commands']['get']('showAIAssistant'),_0x2f70d8=new _0x4a9ab1(_0x40a484['locale']);return _0x2f70d8['set']({'label':Si(_0x40a484['locale'],'AI\x20Assistant'),'icon':_0x40726a,'isToggleable':!0x0}),_0x2f70d8['bind']('isEnabled')['to'](_0x561952),_0x2f70d8['bind']('isOn')['to'](this['_dialog'],'id',_0x19e4e7=>'aiAssistant'===_0x19e4e7),this['listenTo'](_0x2f70d8,'execute',()=>{_0x2f70d8['isOn']?this['hideUI']():_0x561952['execute']();}),_0x2f70d8;}['_initView'](){const _0x475564=this['editor']['plugins']['get'](AIAssistantEditing);this['_formView']=new AIFormView(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x475564['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x475564['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x116a04,ui:{ariaLiveAnnouncer:_0x266def}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x12d619,_0x11f5af,_0x31638b)=>{const _0x42ad2e=this['_aiAssistantController']['currentContext'];_0x31638b?_0x266def['announce'](Si(_0x116a04,'AI\x20is\x20writing')):_0x42ad2e&&_0x266def['announce'](Si(_0x116a04,'Generated\x20content:\x20%0',_0x42ad2e),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x318621,_0xabbabd,_0x56ca1c)=>{if(_0x56ca1c){const _0x1ee335=this['_formView']['errorView']['text'];_0x266def['announce'](Si(_0x116a04,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1ee335));}});}['_onExecute'](_0x348492){const _0x3ed006=this['_commandDefinitions']['get'](_0x348492),_0x19daa1=this['editor'],_0x403c70=_0x19daa1['model']['document']['selection'],_0xd28b8b=_0x19daa1['commands']['get']('showAIAssistant'),_0x2221ef=_0x19daa1['plugins']['get'](AIAssistantEditing),_0xe75a40=''+(_0x3ed006['groupId']!==Ti?_0x3ed006['groupLabel']+':\x20':'')+_0x3ed006['label'];if(!0x1!==_0x3ed006['requiresContent']&&_0x403c70['isCollapsed']){const _0x3006aa=gt(_0x403c70['getSelectedBlocks']())||_0x19daa1['model']['schema']['getLimitElement'](_0x403c70);_0x19daa1['model']['change'](_0x4a5428=>{_0x4a5428['setSelection'](_0x3006aa,'in');});}_0x2221ef['showFakeVisualSelection'](),_0xd28b8b['execute'](_0x3ed006['prompt'],_0xe75a40,'command:'+_0x348492);}['_populateMenuBarMenu'](_0x1bcdcd,_0x587faa,_0x8897ec,_0x41db08){const _0x588c82=this['editor'],_0x5434bc=_0x588c82['locale'],_0x12594b=new qt(_0x5434bc),_0x3958e1=Pi(_0x588c82,_0x8897ec)['filter'](_0x48ee94=>_0x48ee94['commands']['length']);0x1===_0x3958e1['length']?this['_getMenuBarGroupButtons']({'command':_0x1bcdcd,'commands':_0x3958e1[0x0]['commands'],'parentMenuView':_0x587faa,'onExecute':_0x41db08})['forEach'](_0x5c1834=>_0x12594b['items']['add'](_0x5c1834)):_0x3958e1['forEach'](({groupId:_0x54e91b,groupLabel:_0xfea38a,commands:_0x4bbb01})=>{const _0x1be5de=new Qt(_0x5434bc,_0x587faa),_0x5ddf08=new Kt(_0x5434bc),_0x5a2e8d=new qt(_0x5434bc),_0x4ad935=this['_getMenuBarGroupButtons']({'command':_0x1bcdcd,'commands':_0x4bbb01,'parentMenuView':_0x5ddf08,'onExecute':_0x41db08});_0x5ddf08['buttonView']['set']({'label':_0xfea38a||_0x54e91b}),_0x5ddf08['delegate']('execute')['to'](_0x587faa),_0x5a2e8d['items']['addMany'](_0x4ad935),_0x5ddf08['panelView']['children']['add'](_0x5a2e8d),_0x1be5de['children']['add'](_0x5ddf08),_0x12594b['items']['add'](_0x1be5de);}),_0x587faa['panelView']['children']['add'](_0x12594b);}['_getMenuBarGroupButtons']({command:_0x61bd43,commands:_0x49dc02,parentMenuView:_0x32f3b6,onExecute:_0x2e50ec}){const _0x5451e8=this['editor'],_0x48e284=_0x5451e8['locale'];return Pi(_0x5451e8,_0x49dc02)['map'](_0x4f53aa=>{const _0x348ba7=new Qt(_0x48e284,_0x32f3b6),_0x44a684=new Yt(_0x48e284);return _0x44a684['set']({'label':_0x4f53aa['label']}),_0x44a684['delegate']('execute')['to'](_0x32f3b6),_0x44a684['on']('execute',()=>_0x2e50ec(_0x4f53aa['id'])),_0x44a684['bind']('isEnabled')['to'](_0x61bd43,'enabledCommandsIds',_0xb86669=>_0xb86669['includes'](_0x4f53aa['id'])),_0x348ba7['children']['add'](_0x44a684),_0x348ba7;});}}function Li(_0x4db8fb,_0x507539){return void 0x0!==_0x4db8fb['order']&&void 0x0===_0x507539['order']?0x1:void 0x0===_0x4db8fb['order']&&void 0x0!==_0x507539['order']?-0x1:void 0x0!==_0x4db8fb['order']&&void 0x0!==_0x507539['order']?_0x4db8fb['order']-_0x507539['order']:0x0;}function Pi(_0x3b65db,_0x4e427f){_0x4e427f['sort'](Li);const _0x51e30d={},_0x428d78=[];for(const _0x312fc1 of _0x4e427f)if(void 0x0!==_0x312fc1['order']){if(_0x312fc1['order']in _0x51e30d)throw new ht('ai-commands-config-order-collision',_0x3b65db,{'conflictingDefinitions':[_0x312fc1,_0x51e30d[_0x312fc1['order']]]});_0x51e30d[_0x312fc1['order']]=_0x312fc1,_0x428d78['splice'](_0x312fc1['order'],0x0,_0x312fc1);}else _0x428d78['push'](_0x312fc1);return _0x428d78;}class AIAssistant extends _0xaa1572{static get['requires'](){return[AIAssistantUI,AIAssistantEditing];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x234a76){super(_0x234a76);const _0x2cdfdd=_0x234a76['config'],_0x1cc52a=_0x234a76['locale'];_0x2cdfdd['define']('ai.assistant.preserveComments',!0x0),_0x2cdfdd['define']('ai.assistant.commands',Di(_0x1cc52a)),_0x2cdfdd['define']('ai.assistant.extraCommandGroups',[]),_0x2cdfdd['define']('ai.assistant.removeCommands',[]);let _0x533a83=fi(_0x2cdfdd['get']('ai.assistant.commands'),_0x1cc52a);const _0x5000f8=_0x2cdfdd['get']('ai.assistant.extraCommandGroups'),_0x5e8b6b=_0x2cdfdd['get']('ai.assistant.removeCommands');_0x5000f8['forEach'](_0x279faa=>{const _0x4fb9dd=_0x533a83['find'](_0x4e7b49=>_0x4e7b49['groupId']===_0x279faa['groupId']);_0x4fb9dd?_0x4fb9dd['commands']=_0x4fb9dd['commands']['concat'](_0x279faa['commands']):_0x533a83['push'](_0x279faa);}),_0x533a83=_0x533a83['filter'](_0x49c083=>!_0x5e8b6b['includes'](_0x49c083['groupId'])),_0x533a83['forEach'](_0x52b42c=>{_0x52b42c['commands']=_0x52b42c['commands']['filter'](_0x166752=>!_0x5e8b6b['includes'](_0x166752['id']));}),_0x2cdfdd['set']('ai.assistant.commands',_0x533a83);}}function Di(_0x54c954){return[{'groupId':'editOrReview','groupLabel':Si(_0x54c954,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Si(_0x54c954,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Si(_0x54c954,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Si(_0x54c954,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Si(_0x54c954,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Si(_0x54c954,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Si(_0x54c954,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Si(_0x54c954,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Si(_0x54c954,'Change\x20tone'),'commands':[{'id':'professional','label':Si(_0x54c954,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Si(_0x54c954,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Si(_0x54c954,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Si(_0x54c954,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Si(_0x54c954,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Si(_0x54c954,'Change\x20style'),'commands':[{'id':'business','label':Si(_0x54c954,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Si(_0x54c954,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Si(_0x54c954,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Si(_0x54c954,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Si(_0x54c954,'Translate'),'commands':[{'id':'translateEnglish','label':Si(_0x54c954,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Si(_0x54c954,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Si(_0x54c954,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Si(_0x54c954,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Si(_0x54c954,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Si(_0x54c954,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Si(_0x54c954,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Si(_0x54c954,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class AITextAdapter extends _0xaa1572{['abortController'];static get['requires'](){return[AIAdapter];}constructor(_0x146b39){super(_0x146b39),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](AIAdapter)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x123fda){return this['sendRequest'](_0x123fda)['catch'](_0x269b4f=>{if(_0x269b4f instanceof AIRequestError)return Promise['reject'](_0x269b4f);if('AbortError'==_0x269b4f['name'])return Promise['resolve']();throw console['error'](_0x269b4f),new ht('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1f57ef,_0x3d8251){const _0x15592d=this['editor']['locale'],_0x8a34a9={'Content-Type':'application/json'};if('object'==typeof _0x1f57ef)Object['assign'](_0x8a34a9,_0x1f57ef);else{if(_0x1f57ef)try{const _0x4a8b0d=await _0x1f57ef(_0x3d8251);Object['assign'](_0x8a34a9,_0x4a8b0d);}catch{return Promise['reject'](new AIRequestError(Si(_0x15592d,'AI_ERROR_GET_HEADERS')));}}return _0x8a34a9;}async['_prepareRequestParameters'](_0x9aeb66,_0x22ce48){const _0x14254e=this['editor']['locale'];if('object'==typeof _0x9aeb66)return _0x9aeb66;try{return await _0x9aeb66(_0x22ce48);}catch{return Promise['reject'](new AIRequestError(Si(_0x14254e,'AI_ERROR_GET_PARAMETERS')));}}}class OpenAITextAdapter extends AITextAdapter{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x864081){super(_0x864081),_0x864081['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x864081['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x864081['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x864081['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x864081['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x864081['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0xb3ed17,context:_0x1fc95b,onData:_0x514a3c,actionId:_0x65a314}){const _0x28f3b7=this['editor']['locale'],_0x2423aa=await this['prepareMessages'](_0xb3ed17,_0x1fc95b,_0x65a314),_0x290af6=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x65a314),_0x2c731c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x65a314),_0x5a40da={'messages':_0x2423aa,..._0x2c731c},_0x500240={'method':'POST','headers':_0x290af6,'body':JSON['stringify'](_0x5a40da),'signal':this['abortController']['signal']},_0x3077cf=await fetch(this['_apiUrl'],_0x500240);if(_0x3077cf['ok'])return _0x2c731c['stream']?await this['_readStreamableResponse'](_0x3077cf,_0x514a3c):await this['_readStaticResponse'](_0x3077cf,_0x514a3c),Promise['resolve']();{const _0x25dcb7=await _0x3077cf['text']();return _0x25dcb7['includes']('context_length_exceeded')?Promise['reject'](new AIRequestError(Si(_0x28f3b7,'AI_ERROR_CONTEXT_LENGTH'))):_0x25dcb7['includes']('Moderation')?Promise['reject'](new AIRequestError(Si(_0x28f3b7,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x25dcb7));}}async['prepareMessages'](_0x5edf48,_0x1bb572,_0x3dff52){let _0x401510,_0x9fa575;return _0x1bb572?(_0x401510='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x9fa575='Instruction:\x0a'+_0x5edf48+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1bb572):(_0x401510='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x9fa575=_0x5edf48),[{'role':'system','content':_0x401510},{'role':'user','content':_0x9fa575}];}async['_readStreamableResponse'](_0x2eded4,_0x4cc825){const _0x30a056=_0x2eded4['body']['getReader'](),_0x4997eb=new TextDecoder();let _0x47f8f5='',_0x1fbf1f='',_0x16cdfb='',_0x5734f9=!0x1;for(;!_0x5734f9;){const {done:_0x1911bf,value:_0x33cb4f}=await _0x30a056['read'](),_0x3c89b9=_0x47f8f5+_0x4997eb['decode'](_0x33cb4f);let _0x578153='';_0x5734f9=_0x1911bf;try{_0x578153=this['_cleanUpData'](_0x3c89b9),_0x47f8f5='';}catch{_0x47f8f5=_0x3c89b9;continue;}_0x1fbf1f+=_0x578153,!_0x5734f9&&this['_isBufferIncomplete'](_0x1fbf1f)||_0x1fbf1f&&(_0x16cdfb+=_0x1fbf1f,_0x1fbf1f='',_0x4cc825(_0x16cdfb));}return Promise['resolve']();}async['_readStaticResponse'](_0x31ce3a,_0x4d9450){return _0x4d9450((await _0x31ce3a['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x11f3fc){const _0x355258=_0x11f3fc['split']('<')['length']!==_0x11f3fc['split']('>')['length'],_0x128b7a=_0x11f3fc['length']<0x1e;return _0x355258&&_0x128b7a;}['_cleanUpData'](_0x3b8163){return _0x3b8163['split'](/\n(?![^{]*\})/g)['map'](_0x38e446=>_0x38e446['replace']('data:\x20',''))['filter'](_0x559c2=>_0x559c2&&_0x559c2['length']>0x0&&'[DONE]'!==_0x559c2)['map'](_0x375529=>{const {choices:_0x166842}=JSON['parse'](_0x375529);if(_0x166842[0x0]?.['delta']?.['content'])return _0x166842[0x0]['delta']['content'];})['filter'](_0x37e49f=>_0x37e49f)['join']('');}}class AWSTextAdapter extends AITextAdapter{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),wt('ai-aws-adapter-not-supported');}async['sendRequest'](_0x5f57be){throw Ct('ai-aws-adapter-not-supported'),new AIRequestError(Si(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class TabButtonView extends yt{constructor(_0x4deffa,_0x5eb344={}){super(_0x4deffa),this['isToggleable']=!0x0,this['set']('side',_0x5eb344['side']||'top');const _0x5a4771=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...mt(_0x5eb344['class']||[]),_0x5a4771['to']('side',_0x83ac22=>'ck-tab-button_'+_0x83ac22),_0x5a4771['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class TabPanelView extends Nt{['children'];constructor(_0x2e1f96,_0x56c496={}){super(_0x2e1f96);const _0x3c731f=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...mt(_0x56c496['class']||[]),_0x3c731f['to']('class'),_0x3c731f['if']('isVisible','ck-hidden',_0x13c3ca=>!_0x13c3ca)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class AITabsView extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x4c53ea,_0xfbb371={}){super(_0x4c53ea),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0xfbb371['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0xfbb371['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x47de4d,_0x13604b)=>_0x47de4d&&null!==_0x13604b);const _0x40d542=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...mt(_0xfbb371['class']||[]),_0x40d542['to']('side',_0x24d429=>'ck-tabs_'+_0x24d429),_0x40d542['to']('class'),_0x40d542['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x40d542['to']('activeTab',_0x30bf30=>null===_0x30bf30?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x40d542['to']('side',_0x50ace5=>'ck-tabs__buttons-container_'+_0x50ace5)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x40d542['to']('side',_0x593334=>'ck-tabs__panels-container_'+_0x593334)]},'children':this['panelViews']},...mt(_0xfbb371['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x43886e){const _0x9c8cda=this['_tabs']['get'](_0x43886e);return _0x9c8cda||null;}['addTab'](_0x5035bf){const _0x54b770=this['_setupButton']({'id':_0x5035bf['id'],'label':_0x5035bf['buttonLabel'],'icon':_0x5035bf['buttonIcon'],'order':_0x5035bf['order']}),_0x3da0fb=new TabPanelView(this['locale']);return _0x3da0fb['render'](),_0x5035bf['content']&&_0x3da0fb['children']['add'](_0x5035bf['content']),this['panelViews']['add'](_0x3da0fb),this['_tabs']['set'](_0x5035bf['id'],{'button':_0x54b770,'panel':_0x3da0fb,'order':void 0x0!==_0x5035bf['order']?_0x5035bf['order']:null}),this['fire']('addTab:'+_0x5035bf['id'],{'id':_0x5035bf['id'],'button':_0x54b770,'panel':_0x3da0fb}),null===this['activeTab']?this['activateTab'](_0x5035bf['id']):this['_hidePanel'](_0x5035bf['id']),{'button':_0x54b770,'panel':_0x3da0fb};}['activateTab'](_0x292180){if(null!==_0x292180&&!this['getTab'](_0x292180))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x292180});if(this['activeTab']===_0x292180)return;const _0x30b77e=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x292180,_0x292180&&this['_showPanel'](_0x292180),this['fire']('activateTab:'+_0x292180,{'newTab':_0x292180,'oldTab':_0x30b77e});}['toggleTabPanel'](_0x258db1){if(!this['getTab'](_0x258db1))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x258db1});this['activeTab']===_0x258db1?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x258db1);}['showTab'](_0x39335e){if(!this['getTab'](_0x39335e))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x39335e});this['_showPanel'](_0x39335e),this['_showButton'](_0x39335e),this['fire']('show:'+_0x39335e,_0x39335e);}['hideTab'](_0x99b43){if(!this['getTab'](_0x99b43))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x99b43});const _0x491c34=this['activeTab'];this['_hidePanel'](_0x99b43),this['_hideButton'](_0x99b43);const _0x4bcc63=this['getTabIds']();_0x491c34===_0x99b43&&_0x4bcc63['length']>0x1&&this['activateTab'](_0x4bcc63['find'](_0x9eabcd=>_0x9eabcd!==_0x99b43)),this['fire']('hide:'+_0x99b43,_0x99b43);}['_getPanel'](_0x2b116c){const _0x30da71=this['_tabs']['get'](_0x2b116c);return _0x30da71?_0x30da71['panel']:null;}['_showPanel'](_0x29006f){null!==this['activeTab']&&this['activeTab']!==_0x29006f||this['_getPanel'](_0x29006f)['show']();}['_hidePanel'](_0x41c991){const _0xf60329=this['_getPanel'](_0x41c991);_0xf60329['isVisible']&&(this['activeTab']===_0x41c991&&(this['activeTab']=null),_0xf60329['hide']());}['_getButton'](_0x5b77b5){const _0x50eb30=this['_tabs']['get'](_0x5b77b5);return _0x50eb30?_0x50eb30['button']:null;}['_showButton'](_0x14e4a3){this['_getButton'](_0x14e4a3)['show']();}['_hideButton'](_0x56994e){this['_getButton'](_0x56994e)['hide']();}['_setupButton'](_0x3c0192){const _0x2c9611=new TabButtonView(this['locale'],{'side':this['side']}),_0x5d9e8a=this['buttonViews'];if(_0x2c9611['set']({'label':_0x3c0192['label'],'icon':_0x3c0192['icon'],'tooltip':!0x0,'withText':!0x0}),_0x2c9611['bind']('isOn')['to'](this,'activeTab',_0x207c01=>_0x207c01===_0x3c0192['id']),_0x2c9611['bind']('side')['to'](this,'side'),_0x3c0192['order']){const _0x556b00=[...this['_tabs']]['reduce']((_0x1e114d,_0x50a443)=>{const _0x4dab75=_0x50a443[0x0],{order:_0x389e70}=_0x50a443[0x1];return!_0x389e70||_0x389e70>_0x3c0192['order']?_0x1e114d:_0x389e70>=_0x1e114d['order']?{'id':_0x4dab75,'order':_0x389e70}:_0x1e114d;},{'id':'','order':0x0}),_0x30665f=_0x5d9e8a['getIndex'](this['_getButton'](_0x556b00['id']));_0x5d9e8a['add'](_0x2c9611,_0x30665f+0x1);}else _0x5d9e8a['add'](_0x2c9611);return _0x2c9611['on']('execute',()=>{this['toggleTabPanel'](_0x3c0192['id']);}),_0x2c9611;}}const Vi=['overlay','sidebar','custom'],Hi=['left','right'];class AITabsMainView extends AITabsView{constructor(_0x482de5,_0x4589cf={}){super(_0x482de5,_0x4589cf),this['set']('type',_0x4589cf['type']||'sidebar'),this['set']('side',_0x4589cf['side']||'right'),this['set']('isVisible',_0x4589cf['visibleByDefault']??!0x0);const _0x2399c0=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x2399c0['if']('type','ck-ai-tabs__overlay',_0x2e2ec8=>'overlay'===_0x2e2ec8),_0x2399c0['if']('type','ck-ai-tabs__sidebar',_0x5242ac=>'sidebar'===_0x5242ac),_0x2399c0['if']('isVisible','ck-hidden',_0x198bff=>!_0x198bff)]}}),this['buttonViews']['on']('add',(_0x1e4fe9,_0x14689e)=>{_0x14689e['set']('withText',!0x1);});}}class AITabs extends _0x2bf4b8{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x52be6d){if(super(_0x52be6d),!this['context']['config']['get']('ai.container'))throw new ht('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x1cfbd3=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x1cfbd3['showResizeButton']&&(this['showResizeButton']=_0x1cfbd3['showResizeButton']),'sidebar'!==_0x1cfbd3['type']&&'overlay'!==_0x1cfbd3['type']||_0x1cfbd3['side']&&(this['side']=_0x1cfbd3['side']),'sidebar'===_0x1cfbd3['type']){if(this['container']=_0x1cfbd3['element'],this['set']('type','sidebar'),!this['container'])throw new ht('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x1cfbd3['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new AITabsMainView(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x1cfbd3['visibleByDefault'],'collapsible':_0x1cfbd3['collapsible']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof _0x331160&&this['context']['ui']['focusTracker']['add'](this['view']['element']),this['listenTo'](this,'resizeTabs',()=>{this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);});}['switchType'](_0x2126b3){if(_0x2126b3&&this['type']!==_0x2126b3){if(!Vi['includes'](_0x2126b3))throw new ht('ai-tabs-unsupported-ui-type');this['type']=_0x2126b3;}}['switchSide'](_0x3238c3){if(_0x3238c3&&this['side']!==_0x3238c3){if(!Hi['includes'](_0x3238c3))throw new ht('ai-tabs-unsupported-ui-side');this['side']=_0x3238c3;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class AIConnector extends _0x2bf4b8{['_apiUrl'];get['_apiUrlV11'](){return this['_apiUrl']['replace'](/\/v1$/,'/v1.1');}['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x31b684];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x342d4c){if(super(_0x342d4c),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl')['replace'](/\/+$/,''),!this['_apiUrl']['endsWith']('/v1'))throw new ht('ai-service-url-invalid-version',this,{'serviceUrl':this['_apiUrl']});this['_token']=null,this['_decoder']=new TextDecoder(),this['_responseCache']=new Map();}['init'](){const _0x7572c=this['context']['plugins']['get'](_0x31b684);if(!_0x7572c['token'])throw new ht('ai-missing-token',this);this['_token']=_0x7572c['token'];}['startConversation'](_0x2423bd,_0x14593c){const _0x3202a1=this['_sendApiRequest']('/conversations','POST',{'id':_0x2423bd,'group':_0x14593c});return{'getConversation':async()=>(await _0x3202a1['request'])['json'](),'abortController':_0x3202a1['abortController']};}['queryAssistant']({message:_0x5f4a04,conversationId:_0xaf9ff,parts:_0x88ef23,capabilities:_0x337e80,model:_0x44f6f9,attributes:_0x40b951}){const _0x512f6f={'prompt':_0x5f4a04,'content':_0x88ef23,'model':_0x44f6f9,..._0x337e80&&{'capabilities':_0x337e80},..._0x40b951&&{'attributes':_0x40b951}},_0x29d88b=this['_sendApiRequest']('/conversations/'+_0xaf9ff+'/messages','POST',_0x512f6f,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x39b37d=(await _0x29d88b['request'])['body'];return this['_getStreamReader'](_0x39b37d);},'abortController':_0x29d88b['abortController']};}['executeCustomAction']({content:_0x17544b,message:_0x38b2b3,model:_0x44e3a3,outputFormat:_0x5b33a3}){const _0x21057f={'content':[{'type':'text','content':_0x17544b}],'prompt':_0x38b2b3,'model':_0x44e3a3,'outputFormat':_0x5b33a3},_0xb46985=this['_sendApiRequest']('/actions/custom/calls','POST',_0x21057f);return{'getStream':async()=>{const _0x1c36cb=(await _0xb46985['request'])['body'];return this['_getStreamReader'](_0x1c36cb);},'abortController':_0xb46985['abortController']};}['executeAction']({actionName:_0x46d108,content:_0x1c89c0,args:_0x548155}){const _0x19bac4={'content':[{'type':'text','content':_0x1c89c0}],'args':_0x548155},_0x3e6cc9=this['_sendApiRequest']('/actions/system/'+_0x46d108+'/calls','POST',_0x19bac4);return{'getStream':async()=>{const _0x127ecd=(await _0x3e6cc9['request'])['body'];return this['_getStreamReader'](_0x127ecd);},'abortController':_0x3e6cc9['abortController']};}['uploadFile'](_0x4752c1,_0x16e306,_0x18151f){const _0x41ccbd=new FormData();_0x41ccbd['append']('file',_0x16e306,_0x16e306['name']),_0x18151f&&_0x41ccbd['append']('attributes',JSON['stringify'](_0x18151f));const _0x712102=this['_sendApiRequest']('/conversations/'+_0x4752c1+'/files','POST',_0x41ccbd);return{'getId':async()=>(await _0x712102['request'])['json'](),'abortController':_0x712102['abortController']};}['fetchDocument'](_0x1d35ed,_0x2eace8){const _0x428039=this['_sendApiRequest']('/conversations/'+_0x1d35ed+'/documents/'+_0x2eace8,'GET');return{'getDocument':async()=>(await _0x428039['request'])['json'](),'abortController':_0x428039['abortController']};}['uploadDocument'](_0x1400d1,_0x1ff412,_0x20583a){const _0x179656={'content':_0x1ff412};_0x20583a&&(_0x179656['attributes']=_0x20583a);const _0x459769=this['_sendApiRequest']('/conversations/'+_0x1400d1+'/documents','POST',_0x179656);return{'getId':async()=>(await _0x459769['request'])['json'](),'abortController':_0x459769['abortController']};}['uploadDocuments'](_0x417228,_0x519138){const _0x53f4d0={'documents':_0x519138['map'](_0x5c24e3=>({'content':_0x5c24e3['content'],'attributes':{'version':_0x5c24e3['version'],'sessionId':_0x5c24e3['sessionId'],'channelId':_0x5c24e3['channelId'],'rootName':_0x5c24e3['rootName'],'selections':_0x5c24e3['selections']},...void 0x0!==_0x5c24e3['name']?{'name':_0x5c24e3['name']}:{},...void 0x0!==_0x5c24e3['description']?{'description':_0x5c24e3['description']}:{}}))},_0x3179e0=this['_sendApiRequest']('/conversations/'+_0x417228+'/documents/batch','POST',_0x53f4d0);return{'getIds':async()=>(await _0x3179e0['request'])['json'](),'abortController':_0x3179e0['abortController']};}['fetchDocuments'](_0x53435a,_0x46733b){const _0x1d3b0b=new URLSearchParams();_0x1d3b0b['append']('documentIds',_0x46733b['join'](','));const _0x1e1be9=this['_sendApiRequest']('/conversations/'+_0x53435a+'/documents/batch?'+_0x1d3b0b['toString'](),'GET');return{'getDocuments':async()=>(await _0x1e1be9['request'])['json'](),'abortController':_0x1e1be9['abortController']};}['fetchConversations'](_0xeca55a,_0x9267ec={}){const _0x603788=new URLSearchParams();_0x603788['append']('group',_0xeca55a),_0x603788['append']('excludeEmpty',!0x1!==_0x9267ec['excludeEmpty']?'true':'false'),_0x603788['append']('limit',_0x9267ec['limit']?_0x9267ec['limit']['toString']():'100'),_0x603788['append']('sortBy',_0x9267ec['sortBy']?_0x9267ec['sortBy']:'createdAt'),_0x603788['append']('order',_0x9267ec['order']?_0x9267ec['order']:'desc');const _0x3eda45=this['_sendApiRequest']('/conversations?'+_0x603788['toString'](),'GET');return{'getConversations':async()=>{const _0x373b84=await _0x3eda45['request'];return(await _0x373b84['json']())['items'];},'abortController':_0x3eda45['abortController']};}['deleteConversation'](_0x2f2667){const _0x2a9eb5=this['_sendApiRequest']('/conversations/'+_0x2f2667,'DELETE');return{'execute':async()=>{await _0x2a9eb5['request'];},'abortController':_0x2a9eb5['abortController']};}['updateConversation'](_0x57f8bc,_0x37f71c){const _0x327fa9=this['_sendApiRequest']('/conversations/'+_0x57f8bc,'PATCH',_0x37f71c);return{'getResult':async()=>(await _0x327fa9['request'],_0x37f71c),'abortController':_0x327fa9['abortController']};}['fetchConversation'](_0x1b7d95){const _0x3b6fe9=this['_sendApiRequest']('/conversations/'+_0x1b7d95,'GET');return{'getConversation':async()=>(await _0x3b6fe9['request'])['json'](),'abortController':_0x3b6fe9['abortController']};}['fetchConversationMessages'](_0x22ef65){const _0x5c19ee=this['_sendApiRequest']('/conversations/'+_0x22ef65+'/messages','GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getMessages':async()=>{const _0x1b51fe=await _0x5c19ee['request'];return(await _0x1b51fe['json']())['items'];},'abortController':_0x5c19ee['abortController']};}['uploadUrl'](_0x1d24a7,_0x4235f9,_0x33e926){const _0x53a4f2=this['_sendApiRequest']('/conversations/'+_0x1d24a7+'/web-resources','POST',{'url':_0x4235f9,'attributes':_0x33e926});return{'getId':async()=>(await _0x53a4f2['request'])['json'](),'abortController':_0x53a4f2['abortController']};}['getModels'](_0x5c71a0='en'){const _0x5a9880=new URLSearchParams();_0x5a9880['append']('language',_0x5c71a0);const _0x1fae2b='/models/1?'+_0x5a9880['toString'](),_0x52a2fc=this['_sendApiRequest'](_0x1fae2b,'GET',void 0x0,{'useCache':!0x0});return{'list':async()=>await(await _0x52a2fc['request'])['json'](),'abortController':_0x52a2fc['abortController']};}['deleteFile'](_0x2b6120,_0x13ab34){const _0x3ab782=this['_sendApiRequest']('/conversations/'+_0x2b6120+'/files/'+_0x13ab34,'DELETE');return{'execute':async()=>{await _0x3ab782['request'];},'abortController':_0x3ab782['abortController']};}['deleteDocument'](_0xfbc633,_0x1708a4){const _0x1d123c=this['_sendApiRequest']('/conversations/'+_0xfbc633+'/documents/'+_0x1708a4,'DELETE');return{'execute':async()=>{await _0x1d123c['request'];},'abortController':_0x1d123c['abortController']};}['deleteWebResource'](_0x359529,_0x59ef3b){const _0x304bed=this['_sendApiRequest']('/conversations/'+_0x359529+'/web-resources/'+_0x59ef3b,'DELETE');return{'execute':async()=>{await _0x304bed['request'];},'abortController':_0x304bed['abortController']};}['cancelStream'](_0x1b75c5,_0x3396c2){const _0x27668d=this['_sendApiRequest']('/conversations/'+_0x1b75c5+'/messages/'+_0x3396c2+'/stream','DELETE',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'execute':async()=>{await _0x27668d['request'];},'abortController':_0x27668d['abortController']};}['resumeStream'](_0x548ef1,_0x51145f,_0x37e150='0-0'){const _0x133a15=new URLSearchParams({'lastEventId':_0x37e150}),_0x18f096=this['_sendApiRequest']('/conversations/'+_0x548ef1+'/messages/'+_0x51145f+'/stream?'+_0x133a15['toString'](),'GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x10d024=await _0x18f096['request'];return this['_getStreamReader'](_0x10d024['body']);},'abortController':_0x18f096['abortController']};}['callSystemReview']({reviewName:_0x4cf5f8,content:_0x5f1341,args:_0x2b344c}){const _0x4d90f8=this['_sendApiRequest']('/reviews/system/'+_0x4cf5f8+'/calls','POST',{'content':[{'type':'text','content':_0x5f1341}],'args':_0x2b344c});return{'getStream':async()=>{const _0xb489b6=(await _0x4d90f8['request'])['body'];return this['_getStreamReader'](_0xb489b6);},'abortController':_0x4d90f8['abortController']};}['callCustomReview']({content:_0x22b83f,prompt:_0xe09d18,model:_0x15f4f3}){const _0x1b01da=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x22b83f}],'prompt':_0xe09d18,'model':_0x15f4f3});return{'getStream':async()=>{const _0x50b1d4=(await _0x1b01da['request'])['body'];return this['_getStreamReader'](_0x50b1d4);},'abortController':_0x1b01da['abortController']};}['upsertAIChatRating'](_0xe2a2f5,_0x54b94f,_0x35ddd8){const _0x3fe8ea=this['_sendApiRequest']('/conversations/'+_0xe2a2f5+'/messages/'+_0x54b94f+'/ratings','PUT',{'positiveCount':_0x35ddd8['positiveCount'],'totalCount':_0x35ddd8['totalCount'],'modificationId':_0x35ddd8['modificationId']});return{'execute':async()=>{await _0x3fe8ea['request'];},'abortController':_0x3fe8ea['abortController']};}['upsertAIActionRating'](_0x5c138f,_0x44736d,_0x504eca){const _0x5c4961=this['_sendApiRequest']('/actions/system/'+_0x5c138f+'/calls/'+_0x44736d+'/ratings','PUT',{'positiveCount':_0x504eca['positiveCount'],'totalCount':_0x504eca['totalCount']});return{'execute':async()=>{await _0x5c4961['request'];},'abortController':_0x5c4961['abortController']};}['upsertCustomAIActionRating'](_0xe30c32,_0x35997f){const _0x1f6b56=this['_sendApiRequest']('/actions/custom/calls/'+_0xe30c32+'/ratings','PUT',{'positiveCount':_0x35997f['positiveCount'],'totalCount':_0x35997f['totalCount']});return{'execute':async()=>{await _0x1f6b56['request'];},'abortController':_0x1f6b56['abortController']};}['upsertAIReviewRating'](_0x5d2db7,_0x44e1f4,_0x88b394,_0x4920d4){const _0x179d50=this['_sendApiRequest']('/reviews/system/'+_0x5d2db7+'/calls/'+_0x44e1f4+'/ratings','PUT',{'positiveCount':_0x88b394['positiveCount'],'totalCount':_0x88b394['totalCount'],'dataId':_0x4920d4});return{'execute':async()=>{await _0x179d50['request'];},'abortController':_0x179d50['abortController']};}['upsertCustomAIReviewRating'](_0x23020c,_0x1cdf8,_0x2fc392){const _0x5b6653=this['_sendApiRequest']('/reviews/custom/calls/'+_0x23020c+'/ratings','PUT',{'positiveCount':_0x1cdf8['positiveCount'],'totalCount':_0x1cdf8['totalCount'],'dataId':_0x2fc392});return{'execute':async()=>{await _0x5b6653['request'];},'abortController':_0x5b6653['abortController']};}['_sendApiRequest'](_0x5337d4,_0x1e244f,_0x329118,_0x131892={}){const {useCache:_0x585608=!0x1,apiUrl:_0x45c2e6=this['_apiUrl']}=_0x131892,_0x3c61af=new AbortController(),_0x356338=_0x585608?_0x1e244f+':'+_0x5337d4:null;if(_0x356338){const _0x10b662=this['_responseCache']['get'](_0x356338);if(_0x10b662)return{'request':_0x10b662['then'](_0x4f7c88=>_0x4f7c88['clone']()),'abortController':_0x3c61af};}const _0x545f7d=_0x329118 instanceof FormData,_0x58ee7a={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':pt};_0x329118&&!_0x545f7d&&(_0x58ee7a['Content-Type']='application/json');const _0x16ab85={'method':_0x1e244f,'headers':_0x58ee7a,'signal':_0x3c61af['signal']};_0x329118&&(_0x16ab85['body']=_0x545f7d?_0x329118:JSON['stringify'](_0x329118));const _0x474889=fetch(''+_0x45c2e6+_0x5337d4,_0x16ab85)['catch'](_0x337ff7=>{_0x356338&&this['_responseCache']['delete'](_0x356338),this['_handleError'](_0x337ff7);})['then'](_0x439edc=>_0x439edc['ok']?_0x439edc:_0x439edc['json']()['then'](_0x4d8f77=>{throw _0x356338&&this['_responseCache']['delete'](_0x356338),{'url':_0x45c2e6,'path':_0x5337d4,'method':_0x1e244f,'body':_0x329118,'status':(_0x439edc||{})['status'],'statusText':(_0x439edc||{})['statusText'],'code':_0x4d8f77['code'],'message':_0x4d8f77['message'],'traceId':_0x4d8f77['traceId']};}));return _0x356338&&this['_responseCache']['set'](_0x356338,_0x474889['then'](_0x3212ab=>_0x3212ab['clone']())),{'request':_0x474889,'abortController':_0x3c61af};}async*['_getStreamReader'](_0x5e51d3){const _0x2512e7=[],_0x39d39a=_0x5e51d3['getReader'](),_0x21f39d=_0x4a7344({'onError':_0x31e4fd=>{this['_handleError'](_0x31e4fd);},'onEvent':_0x1f535d=>{_0x1f535d['data']=JSON['parse'](_0x1f535d['data']),_0x2512e7['push'](_0x1f535d);}});try{let _0x7f7d61=!0x1;for(;!_0x7f7d61;){const {done:_0x42199b,value:_0x3e7d0a}=await _0x39d39a['read']();_0x42199b&&(_0x7f7d61=!0x0),_0x21f39d['feed'](this['_decoder']['decode'](_0x3e7d0a,{'stream':!0x0})),yield*_0x2512e7,_0x2512e7['length']=0x0;}}catch(_0x3768c8){this['_handleError'](_0x3768c8);}finally{_0x39d39a['releaseLock'](),_0x21f39d['reset']();}}['_handleError'](_0x3ece15){if(_0x3ece15 instanceof ht)throw _0x3ece15;if(_0x3ece15 instanceof Error&&'AbortError'===_0x3ece15['name'])throw new ht('ai-request-aborted',this,{'originalError':_0x3ece15});throw new ht('ai-request-failed',this,{'originalError':_0x3ece15});}}function Mi(_0x19e2f4,_0x1596e0,_0x3b3839){const t=_0x19e2f4['t'];switch(_0x1596e0){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Proposed\x20changes'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20details'});case'AI_MINI_TOOLBAR_LIKE':return t({'id':'AI_MINI_TOOLBAR_LIKE','string':'I\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_DISLIKE':return t({'id':'AI_MINI_TOOLBAR_DISLIKE','string':'I\x20don\x27t\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_COPY':return t({'id':'AI_MINI_TOOLBAR_COPY','string':'Copy\x20to\x20clipboard'});case'AI_SUGGESTION_CONTENT_PART_TITLE':return t({'id':'AI_SUGGESTION_CONTENT_PART_TITLE','string':'Change\x20%0'},_0x3b3839);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'Response\x20stopped.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x3b3839);case'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED':return t({'id':'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED','string':'Folders\x20cannot\x20be\x20added\x20to\x20the\x20chat.\x20Try\x20adding\x20individual\x20files\x20instead.'});case'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES','string':'Unable\x20to\x20load\x20resources\x20from\x20%0.\x20Please\x20try\x20again.'},_0x3b3839);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_PASTED_TEXT_NAME':return t({'id':'AI_CHAT_CONTEXT_PASTED_TEXT_NAME','string':'Pasted\x20Text'});case'AI_CHAT_DROP_ZONE_HINT':return t({'id':'AI_CHAT_DROP_ZONE_HINT','string':'Drop\x20files\x20here\x20to\x20add\x20to\x20the\x20chat'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x3b3839);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x3b3839);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x3b3839);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x3b3839);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x3b3839);case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY','string':'Please\x20try\x20a\x20different\x20phrase\x20or\x20check\x20the\x20spelling.'});case'AI_CHAT_HISTORY_EMPTY_MESSAGE':return t({'id':'AI_CHAT_HISTORY_EMPTY_MESSAGE','string':'Your\x20chat\x20history\x20for\x20current\x20document\x20will\x20appear\x20here.'});case'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON':return t({'id':'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON','string':'Go\x20to\x20chat'});case'AI_CHAT_HISTORY_PIN_BUTTON':return t({'id':'AI_CHAT_HISTORY_PIN_BUTTON','string':'Pin'});case'AI_CHAT_HISTORY_SHOW_MORE_ITEMS':return t({'id':'AI_CHAT_HISTORY_SHOW_MORE_ITEMS','string':'Show\x20more\x20items'});case'AI_CHAT_HISTORY_EDIT_NAME':return t({'id':'AI_CHAT_HISTORY_EDIT_NAME','string':'Edit\x20name'});case'AI_CHAT_HISTORY_REMOVE':return t({'id':'AI_CHAT_HISTORY_REMOVE','string':'Remove'});case'AI_CHAT_HISTORY_REMOVE_CONFIRM':return t({'id':'AI_CHAT_HISTORY_REMOVE_CONFIRM','string':'Do\x20you\x20want\x20to\x20remove\x20this\x20chat?'});case'AI_CHAT_HISTORY_ACCEPT':return t({'id':'AI_CHAT_HISTORY_ACCEPT','string':'Accept'});case'AI_CHAT_HISTORY_CANCEL':return t({'id':'AI_CHAT_HISTORY_CANCEL','string':'Cancel'});case'AI_CHAT_HISTORY_LOADING_REMOVING':return t({'id':'AI_CHAT_HISTORY_LOADING_REMOVING','string':'Removing\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_RENAMING':return t({'id':'AI_CHAT_HISTORY_LOADING_RENAMING','string':'Renaming\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_PINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_PINNING','string':'Pinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_UNPINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_UNPINNING','string':'Unpinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_CATEGORY_PINNED':return t({'id':'AI_CHAT_HISTORY_CATEGORY_PINNED','string':'Pinned'});case'AI_CHAT_HISTORY_CATEGORY_TODAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_TODAY','string':'Today'});case'AI_CHAT_HISTORY_CATEGORY_YESTERDAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_YESTERDAY','string':'Yesterday'});case'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS','string':'Last\x2014\x20days'});case'AI_CHAT_HISTORY_CATEGORY_LATER':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LATER','string':'Later'});case'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE','string':'Failed\x20to\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20later.'},_0x3b3839);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Failed\x20to\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x3b3839);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Failed\x20to\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x3b3839);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Failed\x20to\x20load\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_PIN_ACTION':return t({'id':'AI_CHAT_HISTORY_PIN_ACTION','string':'pin'});case'AI_CHAT_HISTORY_UNPIN_ACTION':return t({'id':'AI_CHAT_HISTORY_UNPIN_ACTION','string':'unpin'});case'AI_BALLOON_HEADER_TITLE':return t({'id':'AI_BALLOON_HEADER_TITLE','string':'Change\x20%0'},_0x3b3839);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x3b3839);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x1596e0;}}const Ui='ck-ai-button-primary',Bi='ck-ai-button-secondary',Gi='ck-ai-button-tertiary';function Fi(_0x491221,_0x56e524){const _0x4a0c11=new yt(_0x491221),_0xb4581=Mi(_0x491221,'AI_TABS_LABEL_MINIMIZE'),_0x52eacd=Mi(_0x491221,'AI_TABS_LABEL_MAXIMIZE');return _0x4a0c11['set']({'withText':!0x1,'icon':_0x54362b,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+Gi}),_0x4a0c11['bind']('label')['to'](_0x56e524,'isMaximized',_0x49b9fd=>_0x49b9fd?_0xb4581:_0x52eacd),_0x4a0c11['bind']('icon')['to'](_0x56e524,'isMaximized',_0x49b0a0=>_0x49b0a0?_0x32acbe:_0x54362b),_0x4a0c11['bind']('isOn')['to'](_0x56e524,'isMaximized'),_0x4a0c11['on']('execute',()=>{_0x56e524['fire']('resizeTabs');}),_0x4a0c11;}function Wi(_0x3cc9b7,_0x5e4ced){return _0x3454ec(_0x3cc9b7,_0x5e4ced);}function Ki(_0xbc807e,_0x237d88){return _0x771648(_0xbc807e,_0x237d88);}function Yi(_0x15bec1,_0xbc4fee,_0x2b0669){const _0x2e8abf=null!==_0xbc4fee?_0x46a601=>_0x46a601['attribs'][_0x15bec1]===_0xbc4fee:_0x2963f0=>Boolean(_0x2963f0['attribs'][_0x15bec1]);return _0x4d1e9b(_0x1031ed=>_0x2d72d5(_0x1031ed)&&_0x2e8abf(_0x1031ed),_0x2b0669);}function $i(_0x577843,_0x389927,_0x3b6d73){const _0x5d3feb=null!==_0x389927?_0x10c3c7=>_0x10c3c7['attribs'][_0x577843]===_0x389927:_0x14b0a0=>Boolean(_0x14b0a0['attribs'][_0x577843]);return _0x1a2411(_0x523acd=>_0x2d72d5(_0x523acd)&&_0x5d3feb(_0x523acd),_0x3b6d73);}function qi(_0x21ee0f){return _0x1a2411(_0xf9a833=>_0x2d72d5(_0xf9a833)&&function(_0x49934c){const _0x2e5cfb=_0x49934c['toLowerCase']();return'script'===_0x2e5cfb||'style'===_0x2e5cfb||_0x2e5cfb['includes']('-');}(_0xf9a833['name']),_0x21ee0f);}function Qi(_0x1834c6){return _0x16a579(_0x527e8c=>_0x5d00d2(_0x527e8c),_0x1834c6,!0x0,0x1/0x0);}function Xi(_0x20d858,_0x559da0){return _0x20d858&&_0x2d72d5(_0x20d858)?_0x20d858['attribs'][_0x559da0]:null;}function zi(_0x26ae88,_0x40f748,_0x50aeaa){_0x2d72d5(_0x26ae88)&&(null===_0x50aeaa?delete _0x26ae88['attribs'][_0x40f748]:_0x26ae88['attribs'][_0x40f748]=_0x50aeaa);}function ji(_0x19aa65,_0x51bdf5,_0x4f7b25){const _0x3405b7=_0x51bdf5['cloneNode'](!0x0);'beforebegin'===_0x4f7b25?_0x45243d(_0x19aa65,_0x3405b7):'afterbegin'===_0x4f7b25?_0x4ee198(_0x19aa65,_0x3405b7):'beforeend'===_0x4f7b25?_0x406d41(_0x19aa65,_0x3405b7):'afterend'===_0x4f7b25&&_0x4750be(_0x19aa65,_0x3405b7);}function Ji(_0x115d2b){const _0x28acca=[];let _0x599128=_0x115d2b;for(;_0x599128;)_0x599128=_0x5c16cf(_0x599128),_0x599128&&_0x28acca['push'](_0x599128);return _0x28acca;}function Zi(_0x2cb58f){return _0x2cb58f['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ts(_0x5e8a1f){let _0x204cd8=0x0;for(;_0x5e8a1f['parentNode'];)_0x5e8a1f=_0x5e8a1f['parentNode'],_0x204cd8++;return _0x204cd8;}function es(_0x48d633){const _0x1b1627=[];let _0x3e7b53=_0x48d633['nextSibling'];for(;_0x3e7b53;)_0x1b1627['push'](_0x3e7b53),_0x3e7b53=_0x3e7b53['nextSibling'];_0x1b1627['forEach'](_0xda2d3c=>{_0x5ca789(_0xda2d3c);});}class AIResponseParser extends/* #__PURE__ -- @preserve */
|
|
25
|
+
ct(){['_m2html'];constructor(){super();const _0x400fcf=Object['entries'](_0x23cd9e),_0x3e987c=_0x400fcf['findIndex'](([_0x247d5])=>'rehypeDomRaw'===_0x247d5);if(-0x1===_0x3e987c)throw new ht('ai-response-parser-unable-to-set-up-parser');_0x400fcf['splice'](_0x3e987c+0x1,0x0,['rehypeSanitize',_0x4c9890]),this['_m2html']=new _0x5b4a47({'plugins':Object['fromEntries'](_0x400fcf)});}['convertMarkdownToHTML'](_0x1daed3){const _0x576796=this['_m2html']['parse'](_0x1daed3);return this['parseAndNormalizeHTML'](_0x576796);}['parseAndNormalizeHTML'](_0x36a39e){return this['_parseHTML'](_0x36a39e);}['_parseHTML'](_0x4ef7b5){const _0x28f5f2=Wi('<dummy>'+_0x4ef7b5['replace'](/<[^>]*?$/g,'')+'</dummy>');return is(_0x28f5f2),_0x28f5f2['children']=_0x28f5f2['children'][0x0]['children'],_0x28f5f2;}}function is(_0x1134c7){for(const _0x7a84ba of _0x1134c7['children'])_0x2d72d5(_0x7a84ba)?'pre'!==_0x7a84ba['name']&&is(_0x7a84ba):_0x4c1c37(_0x7a84ba)&&(_0x7a84ba['data']=_0x7a84ba['data']['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/[ \t\r\f\v]+/g,'\x20'));}class AIResponseApplier extends/* #__PURE__ -- @preserve */
|
|
26
|
+
ct(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null,'rescuedNewIds':new Set()};['_existingDataIds']=new Set();['_referencedExistingIds']=new Set();constructor(_0x50343a){super(),this['_generateUid']=_0x50343a||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x38e05e,_0x3435f,_0x490f20){this['_uidCounter']=0x0;const _0x4f0317=_0x38e05e['cloneNode'](!0x0);rs(_0x3435f,_0x4f0317);const _0x586c93=_0x4f0317['childNodes'],_0x47232e=Array['from'](_0x586c93)['filter'](_0xb6e09e=>!(0x3===_0xb6e09e['nodeType']&&''===Ki(_0xb6e09e)['trim']())),_0x2680aa=_0x47232e['length'];for(const _0xe07356 of _0x47232e)_0xe07356&&_0x2d72d5(_0xe07356)&&void 0x0===_0xe07356['attribs']['data-id']&&zi(_0xe07356,'data-id','new-element');if(0x0===_0x3435f['childNodes']['length']){const _0x218d9e=[];return $i('data-id','new-element',_0x4f0317)['forEach'](_0x40f16d=>{const _0x2b2f6e=this['_generateUid']();zi(_0x40f16d,'data-id',_0x2b2f6e),_0x218d9e['push'](_0x2b2f6e);}),this['_removeSpecialComments'](_0x4f0317),{'parsedContent':_0x4f0317,'newNodeIds':_0x218d9e,'modifiedNodeIds':[],'removedNodeIds':[]};}this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_touchedNodesState']['rescuedNewIds']=new Set(),this['_referencedExistingIds']=new Set(),this['_existingDataIds']=new Set($i('data-id',null,_0x3435f)['map'](_0x1e3a4d=>Xi(_0x1e3a4d,'data-id'))['filter'](_0x41683c=>!!_0x41683c));let _0x458185=-0x1,_0x4f73cd=!0x1;for(let _0x2b3565=0x0;_0x2b3565<_0x2680aa;_0x2b3565++){const _0x559cb5=_0x47232e[_0x2b3565],_0x20ff6c=_0x47232e[_0x2b3565+0x1];if(this['_isNewNode'](_0x559cb5)){if(-0x1===_0x458185&&(_0x458185=_0x2b3565),this['_markWrappedElements'](_0x559cb5),!this['_isNewNode'](_0x20ff6c)){const [_0x329a1a,_0x1501bd]=this['_findReferenceNode'](_0x559cb5,_0x4f73cd,_0x3435f);if(_0x329a1a){const _0x1a0cae=Array['from'](_0x47232e)['slice'](_0x458185,_0x2b3565+0x1);this['_insertNodes'](_0x329a1a,_0x1a0cae,_0x1501bd),_0x458185=-0x1;}}}else{if(this['_isExistingContentComment'](_0x559cb5))_0x4f73cd=!0x0;else{if(this['_isExistingNode'](_0x559cb5)){const _0x5833cc=Xi(_0x559cb5,'data-id');if(_0x5833cc&&this['_existingDataIds']['has'](_0x5833cc)){this['_referencedExistingIds']['add'](_0x5833cc);const _0xd57b5=Yi('data-id',_0x5833cc,_0x3435f);this['_replaceNode'](_0xd57b5,_0x559cb5);}}else{if(ss(_0x559cb5)){const _0x389298=ns(_0x559cb5);!!Yi('data-id',_0x389298,_0x4f0317)||this['_touchedNodesState']['removedIds']['push'](_0x389298);}}}}}for(const _0x48ac88 of this['_touchedNodesState']['removedIds']){const _0x560dda=Yi('data-id',_0x48ac88,_0x3435f);_0x560dda&&(this['_rescueUnwrappedElements'](_0x560dda),this['_removeNode'](_0x560dda,_0x48ac88,_0x490f20));}if($i('data-id','new-element',_0x3435f)['forEach'](_0x2315f1=>{const _0x467f14=this['_getUid'](_0x2315f1);zi(_0x2315f1,'data-id',_0x467f14),this['_touchedNodesState']['newIds']['push'](_0x467f14);}),this['_removeSpecialComments'](_0x3435f),_0x490f20&&_0x490f20['cutAfterUnstable']){const _0x1c596f=this['_findLastConfirmationPoint'](_0x47232e),_0x26d952=this['_getLastStableElement'](_0x3435f,_0x1c596f);this['_markUnstableElements'](_0x3435f,_0x26d952);}if(this['_processWrappedElements'](_0x3435f,_0x490f20),_0x490f20&&_0x490f20['cutAfterUnstable']&&this['_touchedNodesState']['lastTouchedId']){const _0x5720e2=$i('data-id',this['_touchedNodesState']['lastTouchedId'],_0x3435f);let _0x4e2444=_0x5720e2[_0x5720e2['length']-0x1];for(;_0x4e2444;)es(_0x4e2444),_0x4e2444=_0x4e2444['parentNode'];}return{'parsedContent':_0x3435f,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x1d1d12,_0x2468d3,_0x2d63b3){for(const _0x1a00c8 of _0x2468d3){const _0x22c419=this['_getUid'](_0x1a00c8);zi(_0x1a00c8,'data-id',_0x22c419),this['_touchedNodesState']['newIds']['push'](_0x22c419),this['_touchedNodesState']['lastTouchedId']=_0x22c419;}const _0x5312bd='afterbegin'===_0x2d63b3||'afterend'===_0x2d63b3?_0x2468d3['reverse']():_0x2468d3;for(const _0x4990ae of _0x5312bd)ji(_0x1d1d12,_0x4990ae,_0x2d63b3);}['_replaceNode'](_0x5026aa,_0xa8c834){if(!_0x5026aa)return;if(_0x54ab0f=_0xa8c834,Zi(Ki(_0x5026aa))===Zi(Ki(_0x54ab0f)))return;var _0x54ab0f;const _0x519c79=Xi(_0x5026aa,'data-id');this['_touchedNodesState']['modifiedIds']['push'](_0x519c79),this['_touchedNodesState']['lastTouchedId']=_0x519c79,_0x4a3720(_0x5026aa,_0xa8c834['cloneNode'](!0x0));}['_removeNode'](_0x5c39f9,_0x25f851,_0x4962b9){if(_0x4962b9&&_0x4962b9['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x25f851;const _0x2500a4=_0x4962b9['replaceRemovedWith']['cloneNode'](!0x0);zi(_0x2500a4,'data-id',_0x25f851),zi(_0x2500a4,'data-removed','true'),_0x4a3720(_0x5c39f9,_0x2500a4);}else _0x5ca789(_0x5c39f9);}['_findReferenceNode'](_0x52fb1a,_0x574349,_0x45c4c3){const _0x3b0ec9=this['_findPrevElementWithDataId'](_0x52fb1a,!0x1);if(_0x3b0ec9){const _0x1eedee=ns(_0x3b0ec9),_0x2e8b7b=Yi('data-id',_0x1eedee,_0x45c4c3);if(_0x2e8b7b)return[_0x2e8b7b,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x1eedee);}const _0x5b105f=this['_findNextElementWithDataId'](_0x52fb1a,!0x1);if(_0x5b105f){const _0x5eaab1=ns(_0x5b105f),_0x1dd0a8=Yi('data-id',_0x5eaab1,_0x45c4c3);if(_0x1dd0a8)return[_0x1dd0a8,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x5eaab1);}return _0x574349?_0x52fb1a['nextSibling']?this['_findFallbackReferenceNode'](_0x52fb1a,_0x45c4c3):[_0x45c4c3['childNodes'][_0x45c4c3['childNodes']['length']-0x1],'afterend']:[_0x45c4c3['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0xc081a0,_0x41601e){const _0x562d9e=[],_0x1b78e3=this['_findPrevElementWithDataId'](_0xc081a0,!0x0);if(_0x1b78e3){const _0x2ccd55=Yi('data-id',ns(_0x1b78e3),_0x41601e);_0x2ccd55&&_0x562d9e['push']([_0x2ccd55,'afterend']);}const _0x4af6aa=this['_findNextElementWithDataId'](_0xc081a0,!0x0);if(_0x4af6aa){const _0x52db19=Yi('data-id',ns(_0x4af6aa),_0x41601e);_0x52db19&&_0x562d9e['push']([_0x52db19,'beforebegin']);}if(_0x562d9e['length']>0x1)return ts(_0x562d9e[0x0][0x0])<=ts(_0x562d9e[0x1][0x0])?_0x562d9e[0x0]:_0x562d9e[0x1];return 0x1===_0x562d9e['length']?_0x562d9e[0x0]:[_0x41601e['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0xc2f1a2,_0x292b35){let _0x4b580f=_0xc2f1a2['nextSibling'],_0x42fb09=null,_0x4c24cc=!0x1;for(;_0x4b580f;){if(_0x5d00d2(_0x4b580f)){if(ss(_0x4b580f)&&(_0x42fb09=_0x4b580f),this['_isExistingContentComment'](_0x4b580f)&&_0x292b35&&!_0x4c24cc){_0x4c24cc=!0x0,_0x4b580f=_0x4b580f['nextSibling'];continue;}break;}const _0xa0df00=Xi(_0x4b580f,'data-id');if(_0xa0df00&&'new-element'!==_0xa0df00&&this['_existingDataIds']['has'](_0xa0df00)){_0x42fb09=_0x4b580f;break;}_0x4b580f=_0x4b580f['nextSibling'];}return _0x42fb09;}['_findPrevElementWithDataId'](_0xe3ad02,_0x57002e){let _0x220bbd=_0xe3ad02['previousSibling'],_0x5bfb6b=null,_0x5e65e1=!0x1;for(;_0x220bbd;){if(_0x5d00d2(_0x220bbd)){if(ss(_0x220bbd)&&(_0x5bfb6b=_0x220bbd),this['_isExistingContentComment'](_0x220bbd)&&_0x57002e&&!_0x5e65e1){_0x5e65e1=!0x0,_0x220bbd=_0x220bbd['previousSibling'];continue;}break;}const _0x3bea37=Xi(_0x220bbd,'data-id');if(_0x3bea37&&'new-element'!==_0x3bea37&&this['_existingDataIds']['has'](_0x3bea37)){_0x5bfb6b=_0x220bbd;break;}_0x220bbd=_0x220bbd['previousSibling'];}return _0x5bfb6b;}['_markWrappedElements'](_0x395d82){_0x2d72d5(_0x395d82)&&$i('data-id',null,_0x395d82)['forEach'](_0x1ac36e=>{this['_isExistingNode'](_0x1ac36e)&&(zi(_0x1ac36e,'data-wrapped-id',Xi(_0x1ac36e,'data-id')),zi(_0x1ac36e,'data-id',null));});}['_processWrappedElements'](_0xcd6ce7,_0x534119){$i('data-wrapped-id',null,_0xcd6ce7)['forEach'](_0x23fc9a=>{const _0x3b6f12=Xi(_0x23fc9a,'data-wrapped-id');if(this['_hasUnstableParent'](_0x23fc9a))return;const _0x24f8f5=Yi('data-id',_0x3b6f12,_0xcd6ce7);zi(_0x23fc9a,'data-id',_0x3b6f12),_0x24f8f5&&(this['_removeNode'](_0x24f8f5,_0x3b6f12,_0x534119),this['_touchedNodesState']['removedIds']['push'](_0x3b6f12),this['_touchedNodesState']['lastTouchedId']=_0x3b6f12);});}['_hasUnstableParent'](_0xba0f2d){let _0x3b97e8=_0xba0f2d['parentNode'];for(;_0x3b97e8;){if(Xi(_0x3b97e8,'data-unstable'))return!0x0;_0x3b97e8=_0x3b97e8['parentNode'];}return!0x1;}['_rescueUnwrappedElements'](_0x1101a4){const _0x46ccda=new Set(this['_touchedNodesState']['removedIds']),_0x4ba6ee=new Set(this['_touchedNodesState']['newIds']);$i('data-id',null,_0x1101a4)['forEach'](_0x367275=>{const _0x213aa8=Xi(_0x367275,'data-id'),_0x214a1d=!!_0x213aa8&&this['_referencedExistingIds']['has'](_0x213aa8),_0x1f9a65=!!_0x213aa8&&_0x4ba6ee['has'](_0x213aa8);if(!_0x213aa8||!_0x214a1d&&!_0x1f9a65)return;if(_0x46ccda['has'](_0x213aa8))return;let _0x3d3418=_0x367275['parentNode'],_0x5a70c6=!0x1;for(;_0x3d3418;){if(_0x3d3418===_0x1101a4){_0x5a70c6=!0x0;break;}const _0x462abb=Xi(_0x3d3418,'data-id');if(_0x462abb&&(this['_referencedExistingIds']['has'](_0x462abb)||_0x4ba6ee['has'](_0x462abb)))return;_0x3d3418=_0x3d3418['parentNode'];}if(_0x5a70c6){if(_0x45243d(_0x1101a4,_0x367275),_0x214a1d){const _0x258e73=this['_generateUid'](),_0x3845c1=this['_touchedNodesState']['modifiedIds']['indexOf'](_0x213aa8);-0x1!==_0x3845c1&&this['_touchedNodesState']['modifiedIds']['splice'](_0x3845c1,0x1),zi(_0x367275,'data-unwrapped-id',_0x213aa8),zi(_0x367275,'data-id',_0x258e73),this['_touchedNodesState']['newIds']['push'](_0x258e73),this['_touchedNodesState']['rescuedNewIds']['add'](_0x258e73),this['_touchedNodesState']['lastTouchedId']=_0x258e73;}else this['_touchedNodesState']['rescuedNewIds']['add'](_0x213aa8),this['_touchedNodesState']['lastTouchedId']=_0x213aa8;}});}['_getUid'](_0x16a3e1){return this['_isExistingNode'](_0x16a3e1)?Xi(_0x16a3e1,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x4f2d7c){Qi(_0x4f2d7c)['filter'](_0x25636d=>ss(_0x25636d)||this['_isExistingContentComment'](_0x25636d))['forEach'](_0x31e0fc=>{_0x5ca789(_0x31e0fc);});}['_findLastConfirmationPoint'](_0x3cc386){let _0x3ebacb=null,_0x43eaa3=null,_0x54b285=null,_0x445533=null;const _0x47e76d=_0x1da054=>{_0x1da054&&(_0x3ebacb=_0x1da054),_0x54b285=null,_0x445533=null;};for(let _0x2c2230=0x0;_0x2c2230<_0x3cc386['length'];_0x2c2230++){const _0x139c8c=_0x3cc386[_0x2c2230];if(this['_isExistingContentComment'](_0x139c8c)){_0x47e76d(_0x43eaa3);continue;}if(_0x2d72d5(_0x139c8c)){const _0x5e48c6=Xi(_0x139c8c,'data-id'),_0x3bdb7c=_0x2c2230===_0x3cc386['length']-0x1;if(_0x5e48c6&&'new-element'!==_0x5e48c6&&this['_touchedNodesState']['modifiedIds']['includes'](_0x5e48c6)&&!_0x3bdb7c){_0x47e76d(_0x5e48c6),_0x43eaa3=_0x5e48c6;continue;}}let _0x17be83=null;const _0x5effaf=ns(_0x139c8c);if(_0x5effaf&&this['_touchedNodesState']['rescuedNewIds']['has'](_0x5effaf))_0x43eaa3=_0x5effaf;else{if(_0x5effaf&&this['_touchedNodesState']['newIds']['includes'](_0x5effaf))_0x17be83='N';else{if(!ss(_0x139c8c))continue;_0x17be83='R';}_0x17be83===_0x445533||null===_0x445533?_0x445533=_0x17be83:null!==_0x54b285?(_0x47e76d(_0x43eaa3),_0x445533=_0x17be83):(_0x54b285=_0x445533,_0x445533=_0x17be83),_0x43eaa3=_0x5effaf;}}const _0x22f29a=_0x3cc386[_0x3cc386['length']-0x1];return _0x22f29a&&!_0x2d72d5(_0x22f29a)&&!ss(_0x22f29a)&&_0x43eaa3&&_0x47e76d(_0x43eaa3),_0x3ebacb;}['_getLastStableElement'](_0x1b5190,_0x4c62d3){if(!_0x4c62d3)return null;const _0x5a11cc=Yi('data-id',_0x4c62d3,_0x1b5190);if(!_0x5a11cc)return null;const _0x301571=[_0x5a11cc,...Ji(_0x5a11cc)]['at'](-0x2);if(_0x301571===_0x5a11cc)return _0x5a11cc;let _0x4e010c=_0x301571['previousSibling'];for(;_0x4e010c&&!_0x2d72d5(_0x4e010c);)_0x4e010c=_0x4e010c['previousSibling'];return _0x4e010c;}['_markUnstableElements'](_0xd43164,_0x660f13){const _0x2adc86=new Set([...this['_touchedNodesState']['newIds'],...this['_touchedNodesState']['modifiedIds'],...this['_touchedNodesState']['removedIds']]);let _0x1bd636=_0x660f13?_0x660f13['nextSibling']:_0xd43164['firstChild'];for(;_0x1bd636;){_0x2d72d5(_0x1bd636)&&((_0x2adc86['has'](Xi(_0x1bd636,'data-id'))||$i('data-id',null,_0x1bd636)['some'](_0x10e241=>_0x2adc86['has'](Xi(_0x10e241,'data-id'))))&&zi(_0x1bd636,'data-unstable','true')),_0x1bd636=_0x1bd636['nextSibling'];}}['_isNewNode'](_0x1ac032){return Boolean('new-element'===Xi(_0x1ac032,'data-id'));}['_isExistingNode'](_0x1e1532){return Boolean((Xi(_0x1e1532,'data-id')||'')['length']>0x0&&'new-element'!==Xi(_0x1e1532,'data-id'));}['_isExistingContentComment'](_0x2622bc){return Boolean(_0x5d00d2(_0x2622bc)&&Ki(_0x2622bc)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function ss(_0x26d7cd){return!!_0x26d7cd&&Boolean(_0x5d00d2(_0x26d7cd)&&Ki(_0x26d7cd)['match'](/removed[\s*-]data-id="[^"]+"/));}function ns(_0x1af0bc){if(!_0x1af0bc)return null;if(_0x2d72d5(_0x1af0bc))return Xi(_0x1af0bc,'data-id')??null;if(_0x5d00d2(_0x1af0bc)){const _0x519975=Ki(_0x1af0bc)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x519975&&_0x519975[0x1])return _0x519975[0x1];}return null;}function rs(_0x3ea7f6,_0x9df69f){const _0x3689bb=new Map();for(const _0x46cc12 of qi(_0x3ea7f6))_0x3689bb['set'](Xi(_0x46cc12,'data-id'),_0x46cc12);const _0x8273b8=new Set();for(const _0x3f6db3 of qi(_0x9df69f)){const _0x1263c8=Xi(_0x3f6db3,'data-id'),_0x73ffd=_0x1263c8?_0x3689bb['get'](_0x1263c8):void 0x0;_0x73ffd?(_0x4a3720(_0x3f6db3,_0x4269c1(_0x73ffd,!0x0)),_0x8273b8['add'](_0x1263c8)):_0x5ca789(_0x3f6db3);}for(const _0x48e54b of Qi(_0x9df69f))ss(_0x48e54b)&&_0x3689bb['has'](ns(_0x48e54b))&&_0x5ca789(_0x48e54b);const _0x32d50c=new Set($i('data-id',null,_0x9df69f)['map'](_0x12f612=>Xi(_0x12f612,'data-id')));for(const [_0x448560,_0x37c6c3]of _0x3689bb){if(_0x8273b8['has'](_0x448560))continue;let _0x54b8ff=_0x37c6c3['parent'],_0x3cbf26=null;for(;_0x54b8ff&&_0x2d72d5(_0x54b8ff);){const _0x21f2e8=Xi(_0x54b8ff,'data-id');if(_0x21f2e8&&_0x32d50c['has'](_0x21f2e8)){_0x3cbf26=_0x21f2e8;break;}_0x54b8ff=_0x54b8ff['parent'];}if(!_0x3cbf26)continue;const _0x20be8b=Yi('data-id',_0x3cbf26,_0x9df69f);_0x20be8b&&_0x406d41(_0x20be8b,_0x4269c1(_0x37c6c3,!0x0));}}function os({changeGroups:_0x1047c4,documentContextContent:_0x2fb51f,showDiff:_0x47b21f,trimUnchanged:_0x626d29=!0x0}){return _0x1047c4['map'](_0x1c2eb1=>{if('destroyed'===_0x1c2eb1['editor']['state'])return null;const _0x2bb2ea=new _0xd8df80([]),_0x3bbb79=new _0xd8df80([]),_0x482435=new Set();for(const _0x1698ba of _0x1c2eb1['changes'])'new'==_0x1698ba['type']&&$i('data-id',null,_0x1698ba['node'])['forEach'](_0x4ef525=>{_0x482435['add'](Xi(_0x4ef525,'data-id'));});for(const _0x18f60c of _0x1c2eb1['changes'])if('removed'!=_0x18f60c['type']?_0x3bbb79['children']['push'](_0x18f60c['node']['cloneNode'](!0x0)):_0x47b21f||_0x482435['has'](_0x18f60c['id'])||_0x3bbb79['children']['push'](_0x18f60c['node']['cloneNode'](!0x0)),'new'!=_0x18f60c['type']&&(_0x47b21f||'removed'!=_0x18f60c['type'])){const _0x47eca0=_0x4d1e9b(_0x276058=>Xi(_0x276058,'data-id')==_0x18f60c['id'],_0x2fb51f['get'](_0x1c2eb1['documentId']),!0x0);_0x47eca0&&_0x2bb2ea['children']['push'](_0x47eca0['cloneNode'](!0x0));}const {content:_0x2b9eb9,hasChanges:_0x100c93}=as(_0x1c2eb1['editor'],_0x2bb2ea,_0x3bbb79,_0x47b21f,_0x626d29);return{'type':_0x1c2eb1['changes'][0x0]['type'],'index':_0x1c2eb1['index'],'content':_0x2b9eb9,'hasChanges':_0x100c93};})['filter'](_0x21a9cc=>null!==_0x21a9cc);}function as(_0x59e608,_0x713edd,_0x4ff6c6,_0x13967b,_0x48691b=!0x0){const _0x228160=_0x59e608['plugins']['get']('DocumentCompare'),_0x12fdc3=Ki(_0x713edd),_0xa2693b=Ki(_0x4ff6c6),_0x552f0c=_0x59e608['data']['parse'](_0x12fdc3,'$root'),_0x175fe3=_0x59e608['model']['createPositionAt'](_0x552f0c,0x0),_0x368ddf=_0x228160['getDiff'](_0x12fdc3,_0xa2693b,{'anchor':_0x175fe3,'markDeletions':_0x13967b,'targetEditor':_0x59e608})['getOperations']();if(0x0==_0x368ddf['length'])return{'content':_0x713edd['cloneNode'](!0x0),'hasChanges':!0x1};if(_0x13967b?function(_0x293290,_0x50082c,_0x4f41bc){if(0x0==_0x293290['length'])return;const _0x5bbc13=_0x4f41bc['plugins']['get']('DocumentCompare'),_0x297e2d=_0x4f41bc['plugins']['get']('SuggestionsConversion');_0x4f41bc['model']['change'](_0x3929d9=>{const _0x4c2eaa=new Set();for(let _0x64be5=0x0;_0x64be5<_0x293290['length'];_0x64be5++){const _0x4569a9=_0x293290[_0x64be5];if(_0x4569a9['baseVersion']=null,_0x4569a9['isDocumentOperation']=!0x1,_0x5bbc13['isMarkedRemoveOperation'](_0x4569a9)){const _0x2ac9ac=_0x4eba22(_0x4569a9['newRange'],_0x4f41bc['model']),_0x469998='suggestion:deletion:'+at()+':$aiSuggestion';_0x50082c['markers']['set'](_0x469998,_0x2ac9ac);}else switch(_0x4569a9['type']){case'rename':{if(_0x4569a9['oldName']==_0x4569a9['newName'])break;_0x3929d9['batch']['addOperation'](_0x4569a9),_0x4f41bc['model']['applyOperation'](_0x4569a9);const _0x2d797e='$elementName',_0x3a8b19=_0x4569a9['position'],_0x40c69c=_0x4f41bc['model']['createRange'](_0x3a8b19,_0x4f41bc['model']['createPositionAt'](_0x3a8b19['nodeAfter'],'end')),_0x39b992='suggestion:attribute:'+_0x2d797e+':'+at()+':$aiSuggestion';_0x50082c['markers']['set'](_0x39b992,_0x40c69c);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x4569a9['oldValue']==_0x4569a9['newValue'])break;_0x3929d9['batch']['addOperation'](_0x4569a9),_0x4f41bc['model']['applyOperation'](_0x4569a9);const _0x3106b4=_0x4569a9['key'];if(!_0x297e2d['isRegisteredAttribute'](_0x3106b4))break;const _0x4c0ed3=_0x4eba22(_0x4569a9['range'],_0x4f41bc['model']),_0x320e23='suggestion:attribute:'+_0x3106b4+':'+at()+':$aiSuggestion';_0x50082c['markers']['set'](_0x320e23,_0x4c0ed3);break;}case'insert':{_0x3929d9['batch']['addOperation'](_0x4569a9),_0x4f41bc['model']['applyOperation'](_0x4569a9);if(_0x293290[_0x64be5+0x1]&&'move'==_0x293290[_0x64be5+0x1]['type']){hs(_0x50082c,_0x4569a9);break;}const _0x232790=_0x4569a9['position'],_0x4cdbed=_0x4569a9['howMany'],_0x43e686=_0x4eba22(_0x4f41bc['model']['createRange'](_0x232790,_0x232790['getShiftedBy'](_0x4cdbed)),_0x4f41bc['model']),_0x877674='suggestion:insertion:'+at()+':$aiSuggestion';_0x50082c['markers']['set'](_0x877674,_0x43e686);break;}case'split':{_0x3929d9['batch']['addOperation'](_0x4569a9),_0x4f41bc['model']['applyOperation'](_0x4569a9);const _0x13c1c7=_0x4569a9['splitPosition'],_0x37983b=_0x4569a9['moveTargetPosition'],_0x7e2761=_0x4f41bc['model']['createRange'](_0x13c1c7,_0x37983b),_0x234d7f='suggestion:insertion:'+at()+':$aiSuggestion';_0x50082c['markers']['set'](_0x234d7f,_0x7e2761);break;}case'move':{_0x3929d9['batch']['addOperation'](_0x4569a9),_0x4f41bc['model']['applyOperation'](_0x4569a9),_0x293290[_0x64be5-0x1]&&'insert'==_0x293290[_0x64be5-0x1]['type']&&hs(_0x50082c,_0x4569a9);const _0x3372d1=_0x4569a9['getMovedRangeStart'](),_0xf33a94=_0x4569a9['howMany'];for(let _0x479dc2=0x0;_0x479dc2<_0xf33a94;_0x479dc2++){const _0x69adb0=_0x3372d1['getShiftedBy'](_0x479dc2)['nodeAfter'];_0x4c2eaa['add'](_0x69adb0);}break;}case'remove':{const _0x242049=_0x4569a9['sourcePosition'],_0x5df1aa=_0x4569a9['howMany'],_0x77fc7a=new _0x3d09e2(_0x242049,_0x5df1aa);_0x3929d9['batch']['addOperation'](_0x77fc7a),_0x4f41bc['model']['applyOperation'](_0x77fc7a);break;}}}for(const _0x574685 of _0x4c2eaa){const _0x15b5df=_0x4f41bc['model']['createRangeOn'](_0x574685),_0x22520f='suggestion:formatBlock:$fakeWrap:'+at()+':$aiSuggestion';_0x50082c['markers']['set'](_0x22520f,_0x4eba22(_0x15b5df,_0x4f41bc['model']));}});}(_0x368ddf,_0x552f0c,_0x59e608):_0x59e608['model']['change'](_0x591732=>{for(const _0x1475af of _0x368ddf)if('remove'==_0x1475af['type']){const _0x2fdb38=_0x1475af['sourcePosition'],_0x4aaa9e=_0x1475af['howMany'],_0x2f4ab4=new _0x3d09e2(_0x2fdb38,_0x4aaa9e);_0x591732['batch']['addOperation'](_0x2f4ab4),_0x59e608['model']['applyOperation'](_0x2f4ab4);}else{if('marker'==_0x1475af['type']){const _0x7b64db=_0x1475af['name'],_0x2b2f3e=_0x1475af['newRange'];null!==_0x2b2f3e?_0x552f0c['markers']['set'](_0x7b64db,_0x2b2f3e):_0x552f0c['markers']['delete'](_0x7b64db);}else _0x1475af['baseVersion']=null,_0x1475af['isDocumentOperation']=!0x1,_0x591732['batch']['addOperation'](_0x1475af),_0x59e608['model']['applyOperation'](_0x1475af);}}),_0x48691b){const _0x596123=cs(_0x59e608,_0x368ddf,_0x552f0c);us(_0x59e608['model'],_0x596123),function(_0x32d104,_0x184e79){const _0x4a0e3c=_0x184e79['getFirstRange']()['start'];let _0x213c4f=_0x184e79['getFirstRange']()['end'];const _0x3d26f0=_0x4a0e3c['root'];(_0x213c4f['textNode']||_0x213c4f['nodeAfter']&&_0x213c4f['nodeAfter']['is']('$text'))&&(_0x4b4721(_0x213c4f,'...'),_0x213c4f=_0x213c4f['getShiftedBy'](0x3)),(_0x4a0e3c['textNode']||_0x4a0e3c['nodeBefore']&&_0x4a0e3c['nodeBefore']['is']('$text'))&&(_0x4b4721(_0x4a0e3c,'...'),function(_0x22a282,_0x2c5424,_0x398d8a){for(let [_0x4288e5,_0x5629fd]of _0x22a282['markers']){const _0x1a8bd2=_0x5629fd['_getTransformedByInsertion'](_0x2c5424,_0x398d8a,!0x1);_0x5629fd=_0x1a8bd2[0x0],_0x22a282['markers']['set'](_0x4288e5,_0x5629fd);}}(_0x3d26f0,_0x4a0e3c,0x3),_0x4a0e3c['parent']==_0x213c4f['parent']&&(_0x213c4f=_0x213c4f['getShiftedBy'](0x3)));const _0x20cf97=_0x32d104['createRange'](_0x32d104['createPositionAt'](_0x3d26f0,0x0),_0x4a0e3c),_0x6d889c=_0x32d104['createRange'](_0x213c4f,_0x32d104['createPositionAt'](_0x3d26f0,'end')),_0xd06657=[..._0x20cf97['getMinimalFlatRanges'](),..._0x6d889c['getMinimalFlatRanges']()];_0xd06657['reverse']();for(const _0x1d0bab of _0xd06657)_0x16299d(_0x1d0bab),_s(_0x3d26f0,_0x1d0bab);}(_0x59e608['model'],_0x596123);}return{'content':Wi(_0x59e608['data']['stringify'](_0x552f0c,{'showSuggestionHighlights':!0x0})),'hasChanges':!0x0};}function hs(_0x13b4e2,_0x34ec6c){for(const [_0x162f31,_0x17900c]of _0x13b4e2['markers']){const _0x2c00bc=_0x303302['_createFromRanges'](_0x17900c['getTransformedByOperation'](_0x34ec6c));_0x13b4e2['markers']['set'](_0x162f31,_0x2c00bc);}}function cs(_0x4831db,_0x342820,_0x4f3040){const _0x4d6282=_0x4831db['plugins']['get']('DocumentCompare');let _0xaadfaf=_0x4831db['model']['createPositionAt'](_0x4f3040,Number['POSITIVE_INFINITY']),_0x3d048e=_0x4831db['model']['createPositionAt'](_0x4f3040,0x0);for(const _0x1e4b5f of _0x342820){let _0x3119ca,_0x422a56;if(_0x4d6282['isMarkedRemoveOperation'](_0x1e4b5f))_0x3119ca=_0x1e4b5f['newRange']['start'],_0x422a56=_0x1e4b5f['newRange']['end'];else switch(_0xaadfaf=ls(_0xaadfaf,_0x1e4b5f),_0x3d048e=ls(_0x3d048e,_0x1e4b5f),_0x1e4b5f['type']){case'rename':_0x3119ca=_0x1e4b5f['position'],_0x422a56=_0x3119ca['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x3119ca=_0x1e4b5f['range']['start'],_0x422a56=_0x1e4b5f['range']['end'];break;case'insert':_0x3119ca=_0x1e4b5f['position'],_0x422a56=_0x3119ca['getShiftedBy'](_0x1e4b5f['howMany']);break;case'split':_0x3119ca=_0x1e4b5f['splitPosition'],_0x422a56=_0x1e4b5f['moveTargetPosition'];break;case'merge':{const _0x4935b3=_0x1e4b5f['targetPosition']['path']['slice'](0x0,-0x1);_0x3119ca=_0x4831db['model']['createPositionFromPath'](_0x4f3040,_0x4935b3),_0x422a56=_0x3119ca['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x2f81dd=_0x1e4b5f['howMany'],_0x26e6d8=_0x1e4b5f['sourcePosition']['_getTransformedByInsertion'](_0x1e4b5f['targetPosition'],_0x2f81dd),_0x2984a6=_0x1e4b5f['getMovedRangeStart']();'remove'==_0x1e4b5f['type']?(_0x3119ca=_0x26e6d8,_0x422a56=_0x26e6d8):(_0x3119ca=_0x2984a6,_0x422a56=_0x2984a6['getShiftedBy'](_0x2f81dd));break;}}_0x3119ca&&_0x3119ca['isBefore'](_0xaadfaf)&&(_0xaadfaf=_0x3119ca['clone'](),_0xaadfaf['stickiness']='toNone'),_0x422a56&&_0x422a56['isAfter'](_0x3d048e)&&(_0x3d048e=_0x422a56['clone'](),_0x3d048e['stickiness']='toNone');}return _0x4831db['model']['createSelection'](_0x4831db['model']['createRange'](_0xaadfaf,_0x3d048e));}function ls(_0x64a70d,_0xf79b81){return'move'!=_0xf79b81['type']&&'remove'!=_0xf79b81['type']||_0xf79b81['sourceRange']['containsPosition'](_0x64a70d)&&((_0x64a70d=_0xf79b81['sourcePosition']['clone']())['stickiness']='toNone'),_0x64a70d['getTransformedByOperation'](_0xf79b81);}function us(_0x10ca3e,_0x26d768){ds(_0x10ca3e,_0x26d768,'forward');const _0xcf13a4=_0x26d768['getFirstRange']();_0x26d768['setTo']([]),_0x26d768['setTo'](_0xcf13a4,{'backward':!0x0}),ds(_0x10ca3e,_0x26d768,'backward');}function ds(_0x19a658,_0x386fcb,_0x3b3f97){let _0x5dc031=0x14;for(;_0x5dc031;){_0x19a658['modifySelection'](_0x386fcb,{'unit':'word','direction':_0x3b3f97}),_0x5dc031--;const _0x12d7ef=_0x386fcb['focus']['forward'==_0x3b3f97?'nodeBefore':'nodeAfter'];if(_0x12d7ef&&_0x12d7ef['is']('element')&&_0x19a658['schema']['isBlock'](_0x12d7ef)&&_0x19a658['schema']['isObject'](_0x12d7ef))break;}}function _s(_0x348678,_0x367de2){for(const [_0x2d2930,_0x580647]of _0x348678['markers']){const _0x33ff1c=_0x580647['_getTransformedByDeletion'](_0x367de2['start'],_0x367de2['end']['offset']-_0x367de2['start']['offset']);null!=_0x33ff1c?_0x348678['markers']['set'](_0x2d2930,_0x33ff1c):_0x348678['markers']['delete'](_0x2d2930);}}class AIReply extends ct(){['id'];['interactionId'];['type'];['content']=new Map();['sources']=[];['parsedContent']=new Map();['parsedMergedContent']=new Map();['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['_documentIdToSource']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x41128c,isDone:_0x2ca7aa=!0x1,isComplete:_0x32bf1b,interactionId:_0x30ac80,areActionsDisabled:_0x429bdf,isFromHistory:_0x4edcb8=!0x1,documentContextContent:_0xcf34e7,locale:_0x52b06c,id:_0x3e5118,channelsToEditors:_0x58259}){super(),this['id']=_0x3e5118||at(),this['interactionId']=_0x30ac80,this['type']=_0x41128c,this['areActionsDisabled']=!!_0x429bdf,this['isFromHistory']=_0x4edcb8,this['locale']=_0x52b06c,this['aiResponseParser']=new AIResponseParser(),this['aiResponseApplier']=new AIResponseApplier(),this['documentContextContent']=new Map(_0xcf34e7?.['map'](_0x14ff94=>[_0x14ff94['id'],Wi(_0x14ff94['content'])])||[]),this['_documentIdToSource']=new Map(_0xcf34e7?.['map'](_0x4042db=>[_0x4042db['id'],{'editor':_0x58259['get'](_0x4042db['channelId']),'rootName':_0x4042db['rootName']}])||[]),this['set']('isDone',_0x2ca7aa),this['set']('isComplete',_0x32bf1b??_0x2ca7aa),'text'===this['type']&&this['content']['set']('text','');}['appendContent'](_0x988d03,_0x51be66){const _0x5576da='text'===this['type']?'text':_0x51be66;this['content']['has'](_0x5576da)||this['content']['set'](_0x5576da,''),this['content']['set'](_0x5576da,this['content']['get'](_0x5576da)+_0x988d03),this['onContentChange'](_0x5576da);}['done'](_0x26802a=!0x0){this['isComplete']=_0x26802a,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x4caf3e,_0x568889){this['changeGroups'][_0x4caf3e]['state']=_0x568889,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x4caf3e,'state':_0x568889});}['getContentParts']({showDiff:_0x1a5f46,groupIndex:_0x542a5a}){const _0x2a25d8=this['_getCachedContentParts'](_0x1a5f46,_0x542a5a);if(_0x2a25d8)return _0x2a25d8;let _0x48950b=[];if(void 0x0===_0x542a5a)_0x48950b=this['changeGroups'];else{const _0x12647f=this['changeGroups']['find'](({index:_0x390651})=>_0x390651===_0x542a5a);if(!_0x12647f)throw new ht('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x542a5a});_0x48950b=[_0x12647f];}const _0x1d63a8=os({'showDiff':_0x1a5f46,'changeGroups':_0x48950b,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x1a5f46,_0x1d63a8),_0x1d63a8;}['_getCachedContentParts'](_0x10ff75,_0x48e4f9){const _0x3f8fc7=_0x10ff75?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x3f8fc7]['length'])return null;const _0x3e2b10=this['cachedSuggestionContentParts'][_0x3f8fc7];if(void 0x0===_0x48e4f9)return _0x3e2b10['length']>0x0&&_0x3e2b10['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x10ff75,null),null):_0x1e62db(_0x3e2b10);{const _0x32b114=_0x3e2b10['find'](({index:_0x5e2ab2})=>_0x5e2ab2===_0x48e4f9);if(_0x32b114)return[_0x1e62db(_0x32b114)];}return null;}['_setCachedContentParts'](_0x13c9cb,_0xd3af10){const _0x39c75b=_0x13c9cb?'withDiff':'withoutDiff';_0xd3af10?_0xd3af10['forEach'](_0x2065e7=>{const _0x2b5ec1=this['cachedSuggestionContentParts'][_0x39c75b],_0x2d1593=_0x2b5ec1['find'](({index:_0x7d028a})=>_0x7d028a===_0x2065e7['index']);if(_0x2d1593){const _0x423538=_0x2b5ec1['indexOf'](_0x2d1593);_0x2b5ec1['splice'](_0x423538,0x1,_0x2065e7);}else _0x2b5ec1['push'](_0x2065e7);}):this['cachedSuggestionContentParts'][_0x39c75b]['length']=0x0;}['onContentChange'](_0xf4df6a){if('modification'===this['type']){if(_0xf4df6a)this['parsedContent']['set'](_0xf4df6a,this['aiResponseParser']['parseAndNormalizeHTML'](this['content']['get'](_0xf4df6a)));else{for(const [_0x154821,_0x3014a5]of this['content'])this['parsedContent']['set'](_0x154821,this['aiResponseParser']['parseAndNormalizeHTML'](_0x3014a5));}const _0x593cb2=this['changeGroups'];for(const _0x1c9c9e of this['content']['keys']())this['updateChangeGroups'](_0x1c9c9e);const _0xecee29=this['_getDifferentChangeGroups'](_0x593cb2,this['changeGroups']);(_0xecee29['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0xecee29),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']['set']('text',this['aiResponseParser']['convertMarkdownToHTML'](this['content']['get']('text'))),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x2df768,_0x111ca5){const _0x2975af=[];for(const _0x5d3a1a of _0x111ca5){const _0x2677af=_0x2df768[_0x5d3a1a['index']];_0x2677af?_0x2677af['changes']['length']!==_0x5d3a1a['changes']['length']?_0x2975af['push'](_0x5d3a1a):_0x2677af['changes']['forEach']((_0x3934fd,_0xb03bbc)=>{const _0x5339ac=_0x5d3a1a['changes'][_0xb03bbc];_0x3934fd['id']!==_0x5339ac['id']&&_0x2975af['push'](_0x5d3a1a);}):_0x2975af['push'](_0x5d3a1a);}return _0x2975af;}['updateChangeGroups'](_0x378388){const _0x21024b=this['documentContextContent']['get'](_0x378388),_0x29b100=this['parsedContent']['get'](_0x378388);if(!_0x21024b||!_0x29b100)return;const _0x5d8974=new _0x50156a('p',{},[new _0x50156a('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x6d9ab(Mi(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x25d42c=this['aiResponseApplier']['merge'](_0x29b100,_0x21024b['cloneNode'](!0x0),{'cutAfterUnstable':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x5d8974});this['parsedMergedContent']['set'](_0x378388,_0x25d42c['parsedContent']);let _0x562874=[];if(_0x1a2411(_0x5e96f2=>{const _0x15e3ca=Xi(_0x5e96f2,'data-id');if(!_0x15e3ca||!_0x31df34(_0x15e3ca))return!0x1;const _0x5369f8=[_0x5e96f2,...Ji(_0x5e96f2)]['at'](-0x2);if(_0x5e96f2!=_0x5369f8){const _0x14a1cb=Xi(_0x5369f8,'data-id');_0x31df34(_0x14a1cb)||(_0x562874['push']({'node':_0x5369f8,'id':_0x14a1cb,'type':'modified'}),_0x25d42c['modifiedNodeIds']['push'](_0x14a1cb));}else _0x25d42c['modifiedNodeIds']['includes'](_0x15e3ca)?_0x562874['push']({'node':_0x5e96f2,'type':'modified','id':_0x15e3ca}):_0x25d42c['newNodeIds']['includes'](_0x15e3ca)?_0x562874['push']({'node':_0x5e96f2,'type':'new','id':_0x15e3ca,'anchorId':Xi(_0x5e96f2['previousSibling'],'data-id')}):_0x562874['push']({'node':_0x5e96f2,'type':'removed','id':_0x15e3ca});return!0x0;},this['parsedMergedContent']['get'](_0x378388)),_0x562874=_0x562874['filter'](({node:_0x1badeb})=>[...Ji(_0x1badeb),_0x1badeb]['every'](_0x1d126b=>!Xi(_0x1d126b,'data-unstable'))),this['changeGroups']=this['changeGroups']['filter'](_0xe06bf6=>_0xe06bf6['documentId']!==_0x378388),0x0==_0x562874['length'])return;const _0x3f6947=[[_0x562874[0x0]]];for(let _0x1d8f9b=0x1;_0x1d8f9b<_0x562874['length'];_0x1d8f9b++){const _0x1055e7=_0x3f6947[_0x3f6947['length']-0x1],_0x574763=_0x1055e7[_0x1055e7['length']-0x1];_0x562874[_0x1d8f9b]['node']['previousSibling']==_0x574763['node']&&'modified'!=_0x562874[_0x1d8f9b]['type']&&'modified'!=_0x574763['type']?_0x1055e7['push'](_0x562874[_0x1d8f9b]):_0x3f6947['push']([_0x562874[_0x1d8f9b]]);}for(const _0x429ac9 of _0x3f6947){const _0x495dad=_0x429ac9[0x0],_0x1b7f3b=_0x429ac9[_0x429ac9['length']-0x1],_0x3df036=_0x3c9d8f(_0x495dad['node']['previousSibling']);_0x3df036&&_0x429ac9['unshift'](_0x3df036);const _0x12bf0d=_0x3c9d8f(_0x1b7f3b['node']['nextSibling']);_0x12bf0d&&_0x429ac9['push'](_0x12bf0d);}$i('data-wrapped-id',null,this['parsedMergedContent']['get'](_0x378388))['forEach'](_0x488fee=>{zi(_0x488fee,'data-wrapped-id',null);});const _0x162046=new Map();$i('data-unwrapped-id',null,this['parsedMergedContent']['get'](_0x378388))['forEach'](_0x5de6cb=>{const _0x58efd0=Xi(_0x5de6cb,'data-unwrapped-id'),_0x2dc288=Xi(_0x5de6cb,'data-id');_0x162046['set'](_0x2dc288,_0x58efd0),zi(_0x5de6cb,'data-id',_0x58efd0),zi(_0x5de6cb,'data-unwrapped-id',null);});for(const _0x19a06c of _0x562874){const _0xfea973=_0x162046['get'](_0x19a06c['id']);_0xfea973&&(_0x19a06c['id']=_0xfea973);}this['changeGroups']['push'](..._0x3f6947['map']((_0x51a412,_0x599479)=>({'changes':_0x51a412,'state':'pending','index':_0x599479,'editor':this['_documentIdToSource']['get'](_0x378388)['editor'],'rootName':this['_documentIdToSource']['get'](_0x378388)['rootName'],'documentId':_0x378388})));const _0x552791=Array['from'](this['documentContextContent']['keys']());function _0x31df34(_0x5a4424){return _0x25d42c['modifiedNodeIds']['includes'](_0x5a4424)||_0x25d42c['newNodeIds']['includes'](_0x5a4424)||_0x25d42c['removedNodeIds']['includes'](_0x5a4424);}function _0x3c9d8f(_0x1e75d8){if(_0x1e75d8&&Xi(_0x1e75d8,'data-id')&&!Xi(_0x1e75d8,'data-unstable')){const _0x50ec35=Xi(_0x1e75d8,'data-id');if(!_0x31df34(_0x50ec35))return{'node':_0x1e75d8,'type':'context','id':_0x50ec35};}return null;}this['changeGroups']['sort']((_0x46391a,_0x4f470a)=>_0x552791['indexOf'](_0x46391a['documentId'])-_0x552791['indexOf'](_0x4f470a['documentId'])),this['changeGroups']['forEach']((_0x32933f,_0x1ec511)=>{_0x32933f['index']=_0x1ec511;});}}const Is=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class AIInteraction extends Et(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;['_channelsToEditors'];constructor({connector:_0x52a2fd,locale:_0x565f1c,channelsToEditors:_0x1783e5}){super(),this['id']=at(),this['connector']=_0x52a2fd,this['isStopped']=!0x0,this['locale']=_0x565f1c,this['_channelsToEditors']=_0x1783e5||new Map();}async['start'](){await this['_run']();}async['resume'](_0x5e4bf6){await this['_run'](_0x5e4bf6);}async['_run'](_0x4572f6){const _0x1da9f7=[];let _0x135ea9,_0x4c4cd3,_0x5151c4,_0x2cfec8=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=_0x4572f6||await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x51e9a3=await this['currentRequest']['getStream']();for await(const _0xb5b129 of _0x51e9a3){if(this['isStopped'])return;if('error'==_0xb5b129['event'])return void this['fire']('error',{'error':new ht('ai-chat-interaction-error',this)});switch(_0xb5b129['event']){case'message-metadata':this['messageId']=_0xb5b129['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0xb5b129['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0xb5b129['data']['conversationTitle'],!0x0);break;case'source':_0x1da9f7['push'](_0xb5b129['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x135ea9='modification-delta'==_0xb5b129['event']?'modification':'text',_0x4c4cd3='modification-delta'==_0xb5b129['event']?_0xb5b129['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x135ea9&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x135ea9,'interactionId':this['id'],'id':_0x4c4cd3,'channelsToEditors':this['_channelsToEditors'],...'modification-delta'==_0xb5b129['event']&&{'documentId':_0xb5b129['data']['documentId']}}),'modification'==_0x135ea9&&(this['currentReply']['sources']=_0x1da9f7['splice'](0x0))),this['currentReply']['appendContent'](_0xb5b129['data']['textDelta'],_0xb5b129['data']['documentId']);break;case'mcp-tool-result':_0x5151c4=JSON['parse'](_0xb5b129['data']['result']),this['_handleToolResultData']({'toolName':_0xb5b129['data']['toolName'],'data':_0x5151c4['data'],'attributes':_0x5151c4['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0xb5b129['data']['toolName'],'data':_0xb5b129['data']['data']});}}_0x2cfec8=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x1da9f7['length']>0x0&&(this['currentReply']['sources']=_0x1da9f7['splice'](0x0)),this['_finalizeInteraction'](_0x2cfec8),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x1ad69d){return this['replies']['find'](_0x17ed3f=>_0x17ed3f['id']===_0x1ad69d);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x2b602b=>_0x2b602b['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x3a2e9f){const _0x2cea4b=this['getDocumentContext'](),_0xf07663=new AIReply({'locale':this['locale'],'documentContextContent':_0x2cea4b?.['documents'],..._0x3a2e9f});return this['replies']['push'](_0xf07663),_0xf07663['delegate'](...Is)['to'](this),this['fire']('replyCreated',_0xf07663),_0xf07663;}['setConversationTitle'](_0x265093,_0x3ccf4c=!0x1){this['fire']('setConversationTitle',_0x265093,_0x3ccf4c);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x320729){this['fire']('toolDataReceived',{'type':'result','toolName':_0x320729['toolName'],'data':structuredClone(_0x320729['data']||{}),'attributes':structuredClone(_0x320729['attributes']||{})},this);}['_handleToolNotificationData'](_0xa2f328){this['fire']('toolDataReceived',{'type':'notification','toolName':_0xa2f328['toolName'],'data':structuredClone(_0xa2f328['data'])},this);}['_finalizeInteraction'](_0x506805=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x506805),this['currentRequest']=this['currentReply']=void 0x0;}}const As=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),gs=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class AIChatContext extends ct(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x14e58,config:_0x398da2,ownerId:_0x5078d6}){super(),this['_connector']=_0x14e58,this['_config']=_0x398da2,this['_ownerId']=_0x5078d6;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x3f9ac8){const _0x38a0a2=await this['_createContextItemFromContent'](_0x3f9ac8);return this['_addToConversationContextItem'](_0x38a0a2),'current-document'===_0x38a0a2['uiId']&&this['toggleAddCurrentDocumentOptionVisibility'](),_0x38a0a2;}async['populateDocumentsFromMessage'](_0x200ba5,_0x53bd7){const _0x1efb47=_0x200ba5['filter'](_0x56921a=>'document'===_0x56921a['type']);if(0x0===_0x1efb47['length'])return{'hasUnmatched':!0x1};const _0x24059c=_0x1efb47['map'](_0x3f1299=>_0x3f1299['id']),_0x23742f=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x24059c)['getDocuments'](),_0x53b5f6=new Map(_0x23742f['map'](_0x5a4570=>[_0x5a4570['id'],_0x5a4570])),_0x1a7bcd=[];let _0xb57bab=!0x1;for(const _0x369907 of _0x1efb47){const _0x9384c3=_0x53b5f6['get'](_0x369907['id']);_0x9384c3&&(this['_matchDocumentToRoot'](_0x9384c3,_0x53bd7)||(_0xb57bab=!0x0),_0x1a7bcd['push']({'id':_0x9384c3['id'],'content':_0x9384c3['content'],'version':_0x9384c3['attributes']?.['version']??0x0,'sessionId':_0x9384c3['attributes']?.['sessionId']??null,'selection':[],'channelId':_0x9384c3['attributes']?.['channelId']??_0x53bd7[0x0]?.['config']['get']('collaboration.channelId')??'','rootName':_0x9384c3['attributes']?.['rootName']??_0x53bd7[0x0]?.['model']['document']['getRoots']()[0x0]['rootName']??''}));}const _0xbfdc96={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x1a7bcd};return this['_addToConversationContextItem'](_0xbfdc96),this['toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0xbfdc96,'hasUnmatched':_0xb57bab};}['_matchDocumentToRoot'](_0x4df96a,_0x299ef4){const _0x4bd788=_0x4df96a['attributes']?.['channelId'],_0x268805=_0x4df96a['attributes']?.['rootName'];if(_0x4bd788&&_0x268805){for(const _0x4a49ea of _0x299ef4)if(_0x4a49ea['config']['get']('collaboration.channelId')===_0x4bd788){for(const _0x50dbfb of _0x4a49ea['model']['document']['getRoots']())if('$graveyard'!==_0x50dbfb['rootName']&&_0x50dbfb['rootName']===_0x268805)return{'editor':_0x4a49ea,'rootName':_0x50dbfb['rootName']};}}}async['_createContextItemFromContent'](_0x9e9fa1){if('document'===_0x9e9fa1['type']){const _0x3330e0=await this['_connector']['fetchDocument'](this['_ownerId'],_0x9e9fa1['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x9e9fa1['type'],'content':_0x3330e0['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x3330e0['attributes']?.['version'],'sessionId':_0x3330e0['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x9e9fa1['type'])return{'id':_0x9e9fa1['id'],'uiId':_0x9e9fa1['id'],'label':_0x9e9fa1['data']?.['label']||_0x9e9fa1['id'],'type':'mcp-tool-context','mcpServerName':_0x9e9fa1['mcpServerName'],'toolName':_0x9e9fa1['toolName'],'data':_0x9e9fa1['data']||{}};return{'id':_0x9e9fa1['id'],'uiId':_0x9e9fa1['id'],'label':_0x9e9fa1['attributes']?.['label']||_0x9e9fa1['name']||_0x9e9fa1['url']||_0x9e9fa1['id'],'type':_0x9e9fa1['type'],..._0x9e9fa1?.['attributes']?.['resourceId']?{'resourceId':_0x9e9fa1['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x4e98d4){const _0x3fa8fa=this['_pendingContextItems']['get'](_0x4e98d4);_0x3fa8fa?.['isReadOnly']||this['_removeContextItem'](_0x4e98d4);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x49fff3 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x49fff3['uiId']);const _0x54ac9a=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x54ac9a&&this['_addContextItem']({..._0x54ac9a,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x79e409){for(const _0x4c185b of _0x79e409['values']())this['_addToConversationContextItem'](_0x4c185b);this['clearPendingContextItems'](),this['fire']('contextSent',{'contextItems':Array['from'](this['getSentContextItems']()['values']())});}['isCurrentDocumentInContext'](){return this['_pendingContextItems']['has']('current-document');}['isSelectionInContext'](){return this['_pendingContextItems']['has']('selection');}['isCurrentDocumentInConversation'](){return this['_conversationContextItems']['has']('current-document');}static['mapContextItemsToRequestData'](_0x852c9f){return Array['from'](_0x852c9f['values']())['flatMap'](_0x479a51=>this['_mapContextItemToRequestData'](_0x479a51));}async['addFilesToContext'](_0x26ba35,_0x5b1a46,_0x5d2303='file'){const _0x17d32e='files-'+at();this['_startUploadOperation'](_0x17d32e);try{await Promise['all'](_0x26ba35['map'](async _0x44799f=>{const _0x4cf530='file-'+at(),_0x402a96=_0x16b809(_0x44799f['name']),_0x81820d='file'===_0x5d2303&&_0x44799f['type']['startsWith']('image/')?'image':_0x5d2303;try{this['_addContextItem']({'type':_0x81820d,'label':_0x5b1a46?.['label']||_0x402a96,'uiId':_0x4cf530,'resourceId':_0x5b1a46?.['resourceId']},!0x0);const _0x2a296a=this['_connector']['uploadFile'](this['_ownerId'],_0x44799f,_0x5b1a46);this['_ongoingUploads']['set'](_0x4cf530,_0x2a296a['abortController']);const {id:_0x518c65}=await _0x2a296a['getId']();this['_ongoingUploads']['delete'](_0x4cf530),this['_finishContextItemLoading']({'type':_0x81820d,'id':_0x518c65,'label':_0x5b1a46?.['label']||_0x402a96,'uiId':_0x4cf530,'resourceId':_0x5b1a46?.['resourceId']},!0x1);}catch(_0x2a46b0){this['_ongoingUploads']['delete'](_0x4cf530);if(!(_0x2a46b0 instanceof ht&&_0x2a46b0['message']['startsWith']('ai-request-aborted'))){const _0xc0ba02=As['get'](_0x2a46b0['code'])||'ai-chat-file-upload-failed',_0x442bab=new ht(_0xc0ba02,null,{'fileName':_0x402a96,..._0x2a46b0});_0x442bab['stack']=_0x2a46b0['stack'],this['fire']('error',{'error':_0x442bab});}this['_removeContextItem'](_0x4cf530);}}));}finally{this['_finishUploadOperation'](_0x17d32e);}}['addCurrentDocumentToContext'](_0x302e7d){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x1103f5={'type':'document','uiId':'current-document','label':_0x302e7d,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x1103f5);}async['updateCurrentDocuments'](_0x25cd25){const _0x5bf2d4=this['_pendingContextItems']['get']('current-document');if(!_0x5bf2d4||!_0x25cd25['length']||_0x25cd25['every'](_0x118dde=>!_0x118dde['content']))return;_0x25cd25['length']>0x1&&_0x25cd25['some'](_0x167c12=>!_0x167c12['description'])&&wt('ai-chat-documents-missing-description');try{const _0x228d4c=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x25cd25)['getIds']();if(_0x228d4c['length']!==_0x25cd25['length']||_0x228d4c['some'](_0x56505b=>!_0x56505b?.['id'])){const _0x1031b6=new ht('ai-chat-document-upload-reply-mismatch',null);return void this['fire']('error',{'error':_0x1031b6});}_0x5bf2d4['documents']=_0x25cd25['map']((_0x39c39b,_0x34940a)=>{return{'id':_0x228d4c[_0x34940a]['id'],'content':_0x39c39b['content'],'version':_0x39c39b['version'],'sessionId':_0x39c39b['sessionId'],'selection':(_0x273f63=_0x39c39b['selections'],_0x273f63?_0x273f63['map'](_0x39f745=>({'start':_0x39f745['start'],'end':_0x39f745['end']})):[]),'channelId':_0x39c39b['channelId'],'rootName':_0x39c39b['rootName']};var _0x273f63;});}catch(_0x87d5e2){const _0x1dcecc=new ht('ai-chat-document-upload-failed',null);_0x1dcecc['stack']=_0x87d5e2['stack'],this['fire']('error',{'error':_0x1dcecc});}}['addSelectionToContext'](_0x44d196){this['_addContextItem']({'type':'selection','label':_0x44d196,'uiId':'selection','content':_0x44d196});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x4af465,_0x51f9ca){const _0x29c0b5='url-'+at();this['_startUploadOperation'](_0x29c0b5);const _0x245659='url-'+at();try{this['_addContextItem']({'type':'web-resource','label':_0x51f9ca?.['label']||_0x4af465,'uiId':_0x245659,'resourceId':_0x51f9ca?.['resourceId']},!0x0);const _0x2c672d=this['_connector']['uploadUrl'](this['_ownerId'],_0x4af465,_0x51f9ca);this['_ongoingUploads']['set'](_0x245659,_0x2c672d['abortController']);const {id:_0x189940}=await _0x2c672d['getId']();this['_ongoingUploads']['delete'](_0x245659),this['_finishContextItemLoading']({'type':'web-resource','id':_0x189940,'label':_0x51f9ca?.['label']||_0x4af465,'uiId':_0x245659,'resourceId':_0x51f9ca?.['resourceId']},!0x1);}catch(_0xc8b446){this['_ongoingUploads']['delete'](_0x245659),(_0xc8b446['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ht('ai-chat-url-upload-failed',this,{'url':_0x4af465,'originalError':_0xc8b446}),'url':_0x4af465}),this['_removeContextItem'](_0x245659));}finally{this['_finishUploadOperation'](_0x29c0b5);}}['addToolItemToContext'](_0x4d3c8d){_0x4d3c8d['id']=_0x4d3c8d['id']??at()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x4d3c8d['uiId'],_0x4d3c8d),this['fire']('contextItemAdded',{'contextItem':_0x4d3c8d,'isLoading':!0x1});}async['loadSourceResources'](_0x11d34c,_0xe643c5,_0x588eaf){const _0x5bfc2a=this['_addContextOptionsState']['sources']['find'](_0x16146a=>_0x16146a['id']===_0x11d34c);if(!_0x5bfc2a)return this['fire']('error',{'error':new ht('ai-chat-source-not-found',this,{'sourceId':_0x11d34c}),'sourceId':_0x11d34c}),[];try{const _0x3f1d19=(await _0x5bfc2a['getResources'](_0xe643c5))['map'](_0x3346d0=>{const _0x2e7c4a=this['_isResourceInContext'](_0x3346d0['id']);return{..._0x3346d0,'isInContext':_0x2e7c4a};});return _0x5bfc2a['resources']=_0x3f1d19,this['fire']('sourceResourcesLoaded',{'sourceId':_0x11d34c,'source':_0x5bfc2a,'resources':_0x3f1d19,'uid':_0x588eaf}),_0x3f1d19;}catch(_0x5694da){return this['fire']('error',{'error':new ht('ai-chat-source-resources-load-failed',this,{'sourceId':_0x11d34c,'originalError':_0x5694da}),'sourceId':_0x11d34c,'sourceLabel':_0x5bfc2a['label']}),[];}}async['addResourceToContext'](_0x298b14,_0x4deb28){if(this['_isResourceInContext'](_0x4deb28['id']))return;let _0x45a5c2=_0x4deb28['data'];if(!_0x45a5c2&&_0x298b14['getData'])try{_0x45a5c2=await _0x298b14['getData'](_0x4deb28['id']);}catch(_0x617c58){return void this['fire']('error',{'error':new ht('ai-chat-resource-load-failed',this,{'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id'],'originalError':_0x617c58}),'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id']});}if(_0x45a5c2)switch(_0x4deb28['type']){case'web-resource':if('string'!=typeof _0x45a5c2)return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id'],'expectedType':'string','actualType':typeof _0x45a5c2}),'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id']});await this['addUrlToContext'](_0x45a5c2,{'label':_0x4deb28['label'],'resourceId':_0x4deb28['id']});break;case'file':if(!(_0x45a5c2 instanceof File))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id'],'expectedType':'File','actualType':typeof _0x45a5c2}),'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id']});await this['addFilesToContext']([_0x45a5c2],{'label':_0x4deb28['label'],'resourceId':_0x4deb28['id']});break;case'text':if('object'!=typeof _0x45a5c2||!('content'in _0x45a5c2)||!('type'in _0x45a5c2))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x45a5c2}),'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id']});_0x45a5c2=AIChatContext['_convertTextResourceToFile'](_0x45a5c2,_0x4deb28['label']),await this['addFilesToContext']([_0x45a5c2],{'label':_0x4deb28['label'],'resourceId':_0x4deb28['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ht('ai-chat-context-unsupported-type',this,{'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id'],'resourceType':_0x4deb28['type']}),'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id']});}else this['fire']('error',{'error':new ht('ai-chat-resource-no-data',this,{'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id']}),'resourceId':_0x4deb28['id'],'sourceId':_0x298b14['id']});}['toggleAddCurrentDocumentOptionVisibility'](_0x3fc2c2){if(void 0x0!==_0x3fc2c2)this['_addContextOptionsState']['document']['isHidden']=!_0x3fc2c2;else{const _0x12d5e1=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x12d5e1;}this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}static['_convertTextResourceToFile'](_0x57439f,_0x23e894){switch(_0x57439f['type']){case'markdown':return new File([_0x57439f['content']],_0x23e894,{'type':'text/markdown'});case'html':return new File([_0x57439f['content']],_0x23e894,{'type':'text/html'});default:return new File([_0x57439f['content']],_0x23e894,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0xf32cad){switch(_0xf32cad['type']){case'file':case'image':case'text':return[{'type':'file','id':_0xf32cad['id']}];case'web-resource':return[{'type':'web-resource','id':_0xf32cad['id']}];case'document':return _0xf32cad['documents']?.['length']?_0xf32cad['documents']['map'](_0x37cc16=>({'type':'document','id':_0x37cc16['id'],..._0x37cc16['selection']?.['length']&&{'selection':_0x37cc16['selection']}})):[{'type':'document','id':_0xf32cad['id'],..._0xf32cad['selection']?.['length']&&{'selection':_0xf32cad['selection']}}];case'mcp-tool-context':{const _0x57cf52=_0xf32cad;return[{'type':'mcp-tool-context','mcpServerName':_0x57cf52['mcpServerName'],'toolName':_0x57cf52['toolName'],'data':{..._0x57cf52['data'],'label':_0x57cf52['label']||_0x57cf52['data']?.['label']||_0x57cf52['id']},'id':_0x57cf52['id']}];}default:return[];}}['_addContextItem'](_0x1e99a0,_0x3e8982=!0x1){if(this['_pendingContextItems']['set'](_0x1e99a0['uiId'],_0x1e99a0),_0x1e99a0['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x1e99a0,'isLoading':_0x3e8982}),'current-document'===_0x1e99a0['uiId']&&this['toggleAddCurrentDocumentOptionVisibility'](),_0x1e99a0['resourceId']){const _0x59b7d8=this['_findSourceIdsByResourceId'](_0x1e99a0['resourceId']);_0x59b7d8&&_0x59b7d8['forEach'](_0x26732f=>{this['_updateResourceInContextState'](_0x26732f,_0x1e99a0['resourceId'],!0x0);});}}['_removeContextItem'](_0x104f43){const _0x383a88=this['_pendingContextItems']['get'](_0x104f43),_0xff96f=this['_ongoingUploads']['get'](_0x104f43);if(_0xff96f&&(_0xff96f['abort'](),this['_ongoingUploads']['delete'](_0x104f43)),_0x383a88?.['resourceId']){const _0x213be5=this['_findSourceIdsByResourceId'](_0x383a88['resourceId']);_0x213be5&&_0x213be5['forEach'](_0x2d5fad=>{this['_updateResourceInContextState'](_0x2d5fad,_0x383a88['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x104f43),this['fire']('contextItemRemoved',{'uiId':_0x104f43,'type':_0x383a88?.['type']}),'current-document'===_0x104f43&&this['toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x24ae5c,_0x260ebf){if(this['_pendingContextItems']['has'](_0x24ae5c['uiId'])&&(this['_pendingContextItems']['set'](_0x24ae5c['uiId'],_0x24ae5c),this['fire']('contextItemLoadingEnded',{'contextItem':_0x24ae5c,'isLoading':_0x260ebf}),_0x24ae5c['resourceId'])){const _0x23891b=this['_findSourceIdsByResourceId'](_0x24ae5c['resourceId']);_0x23891b&&_0x23891b['forEach'](_0x15ec65=>{this['_updateResourceInContextState'](_0x15ec65,_0x24ae5c['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x4760b2){this['_conversationContextItems']['set'](_0x4760b2['uiId'],_0x4760b2);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x50ee7a=>({..._0x50ee7a,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x3ff17f=>({..._0x3ff17f,'resources':[]}))??[];}['_isResourceInContext'](_0x394564){for(const _0x17349d of this['_pendingContextItems']['values']())if(_0x17349d['resourceId']===_0x394564)return!0x0;for(const _0x4a91a3 of this['_conversationContextItems']['values']())if(_0x4a91a3['resourceId']===_0x394564)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x5ef70b){const _0x85d42d=[];for(const _0x1df6a3 of this['_addContextOptionsState']['sources']){_0x1df6a3['resources']['find'](_0x222de6=>_0x222de6['id']===_0x5ef70b)&&_0x85d42d['push'](_0x1df6a3['id']);}return 0x0===_0x85d42d['length']?null:_0x85d42d;}['_updateResourceInContextState'](_0x1cac32,_0x221790,_0x2f3918){const _0x3274d5=this['_addContextOptionsState']['sources']['find'](_0x17b49e=>_0x17b49e['id']===_0x1cac32);if(!_0x3274d5)return;const _0x2965bd=_0x3274d5['resources']['find'](_0x5a0d33=>_0x5a0d33['id']===_0x221790);_0x2965bd&&(_0x2965bd['isInContext']=_0x2f3918,this['fire']('resourceStateChanged',{'sourceId':_0x1cac32,'resourceId':_0x221790,'isInContext':_0x2f3918}));}['_startUploadOperation'](_0x439184){this['_ongoingUploadOperations']['set'](_0x439184,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x5e27eb){this['_ongoingUploadOperations']['delete'](_0x5e27eb),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const ws=['capabilitiesUpdated'];class AICapabilities extends Et(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x1a276f){const _0x2593d9={};return _0x1a276f&&_0x1a276f['isWebSearchEnabled']&&(_0x2593d9['webSearch']={}),_0x1a276f&&_0x1a276f['isReasoningEnabled']&&(_0x2593d9['reasoning']={}),_0x2593d9;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x3dafde){_0x3dafde!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x3dafde,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x9a45ee){_0x9a45ee!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x9a45ee,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class AIChatInteraction extends AIInteraction{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x3fd9e9){super(_0x3fd9e9),this['conversationId']=_0x3fd9e9['conversationId'],this['contextItems']=_0x3fd9e9['contextItems'],this['capabilities']=_0x3fd9e9['capabilities'],this['userMessage']=_0x3fd9e9['userMessage'],this['model']=_0x3fd9e9['model'],this['attributes']=_0x3fd9e9['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':AIChatContext['mapContextItemsToRequestData'](this['contextItems']),'capabilities':AICapabilities['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class AIChatConversation extends Et(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];['_channelsToEditors'];['_getSessionId'];constructor(_0x23805a){super(),this['options']=_0x23805a,this['connector']=_0x23805a['connector'],this['chatModels']=_0x23805a['chatModels'],this['id']=_0x23805a['conversationId'],this['isFromHistory']=_0x23805a['isFromHistory'],this['_channelsToEditors']=_0x23805a['channelsToEditors'],this['_getSessionId']=_0x23805a['getSessionId'];}async['init'](_0x1f8b4a){try{this['chatContext']=new AIChatContext({'connector':this['connector'],'config':_0x1f8b4a,'ownerId':this['id']}),this['chatContext']['delegate'](...gs)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new AICapabilities(),this['chatCapabilities']['delegate'](...ws)['to'](this),this['chatCapabilities']['init']();const _0x5a0409=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5a0409});const _0x18a4de=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x18a4de&&await this['setModel'](_0x18a4de);}catch(_0x172381){const _0x539f21=new ht('ai-chat-conversation-init-failed',null,{'message':_0x172381['message']||_0x172381});_0x539f21['stack']=_0x172381['stack'],this['fire']('error',{'error':_0x539f21});}}async['start'](){if(this['isStarted'])throw new ht('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ht('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x518047}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x518047,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x5d7911){const _0x5a9abf=new ht('ai-chat-conversation-start-failed',null,{'message':_0x5d7911['message'],'conversationId':this['id']});throw _0x5a9abf['stack']=_0x5d7911['stack'],this['fire']('error',{'error':_0x5a9abf}),_0x5a9abf;}}async['load'](_0x1e05cc){try{const _0x779340=await this['connector']['fetchConversation'](_0x1e05cc)['getConversation'](),_0x14e437=await this['connector']['fetchConversationMessages'](_0x1e05cc)['getMessages'](),_0x552d14=_0x14e437[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x779340['id'],'title'in _0x779340?this['fire']('setConversationTitle',_0x779340['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x5f344c=(await this['chatModels']['getAll']())['find'](_0x53af80=>_0x53af80['id']['toLowerCase']()===_0x552d14['toLowerCase']());this['selectedModel']=_0x5f344c,this['fire']('modelSelected',{'selectedModel':_0x5f344c,'isDisabled':!0x0});const {streamingMessageId:_0xc4bfe8}=await this['_processMessagesToInteractions'](_0x14e437,_0x552d14);return _0xc4bfe8&&this['currentInteraction']?this['_resumeStream'](_0xc4bfe8):this['currentInteraction']=void 0x0,this;}catch(_0x22cc5a){const _0x527088=new ht('ai-chat-conversation-init-from-id-failed',null,{'message':_0x22cc5a['message'],'conversationId':_0x1e05cc});throw _0x527088['stack']=_0x22cc5a['stack'],this['fire']('error',{'error':_0x527088}),_0x527088;}}async['_processMessagesToInteractions'](_0x3fc499,_0x39b8ec){let _0x55827d,_0x2202ac,_0x460c22=!0x1;for(const _0x5e5059 of _0x3fc499)if('user'===_0x5e5059['role']){const {contextItems:_0x5045d0,hasUnmatched:_0x29d8e8}=await this['_extractContextItems'](_0x5e5059);_0x460c22=_0x29d8e8;const _0x407fdd={'isReasoningEnabled':Object['hasOwn'](_0x5e5059['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x5e5059['capabilities'],'webSearch')};_0x55827d=this['createInteraction']({'userMessage':_0x5e5059['prompt'],'contextItems':_0x5045d0,'capabilities':_0x407fdd,'modelId':_0x39b8ec,'attributes':_0x5e5059['attributes'],'channelsToEditors':this['_channelsToEditors']}),this['currentInteraction']=_0x55827d,_0x2202ac=void 0x0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x5e5059['role']&&_0x55827d){if('streaming'===_0x5e5059['status']){_0x2202ac=_0x5e5059['id'];continue;}if('error'===_0x5e5059['status'])continue;const _0x5eb0b6=[];for(const _0x340354 of _0x5e5059['content'])switch(_0x340354['type']){case'text':case'modification':{const _0x462dce=_0x55827d['getDocumentContext'](),_0x56ab2f=this['_hasSessionMismatch'](_0x462dce)||_0x460c22;_0x55827d['currentReply']?.['type']!==_0x340354['type']&&(_0x55827d['currentReply']=_0x55827d['createReply']({'type':_0x340354['type'],'isDone':!0x0,'interactionId':_0x55827d['id'],'areActionsDisabled':_0x56ab2f,'isFromHistory':!0x0,'channelsToEditors':this['_channelsToEditors']}),_0x5eb0b6['length']>0x0&&(_0x55827d['currentReply']['sources']=_0x5eb0b6['splice'](0x0))),_0x55827d['currentReply']['appendContent'](_0x340354['content'],_0x340354['documentId']);break;}case'url':_0x5eb0b6['push'](_0x340354);break;case'mcp-tool-result':{const {data:_0x5247b2,attributes:_0x4bcb98}=JSON['parse'](_0x340354['content']);_0x55827d['_handleToolResultData']({'toolName':_0x340354['toolName'],'data':_0x5247b2,'attributes':_0x4bcb98});break;}}'cancelled'===_0x5e5059['status']&&this['fire']('error',{'interactionId':_0x55827d['id'],'error':new ht('ai-request-aborted',this)});}}return{'streamingMessageId':_0x2202ac};}async['_resumeStream'](_0x540db9){if(this['currentInteraction'])try{const _0x7de8d2=this['connector']['resumeStream'](this['id'],_0x540db9);await this['currentInteraction']['resume'](_0x7de8d2);}catch(_0xb0e507){_0xb0e507 instanceof ht&&this['fire']('error',{'interactionId':this['currentInteraction']?.['id'],'error':_0xb0e507});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}async['_extractContextItems'](_0x5432f2){const _0x3f21da=new Map();if(!_0x5432f2['content'])return{'contextItems':_0x3f21da,'hasUnmatched':!0x1};const {contextItem:_0x10f456,hasUnmatched:_0x241815}=await this['chatContext']['populateDocumentsFromMessage'](_0x5432f2['content'],Array['from'](this['_channelsToEditors']['values']()));_0x10f456&&_0x3f21da['set'](_0x10f456['id'],_0x10f456);for(const _0x52be5b of _0x5432f2['content']){if('document'===_0x52be5b['type'])continue;const _0x22c41f=await this['chatContext']['populateFromMessage'](_0x52be5b);_0x22c41f&&_0x3f21da['set'](_0x22c41f['id'],_0x22c41f);}return{'contextItems':_0x3f21da,'hasUnmatched':_0x241815};}async['handleUserInteraction']({userMessage:_0x4128ea,attributes:_0xebe5c}){if(!this['isStarted'])throw new ht('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ht('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0xf152c0=new Map(this['getPendingContextItems']()),_0x1e012e=this['chatCapabilities']['getCapabilitiesConfig'](),_0x5addaa=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x4128ea,'contextItems':_0xf152c0,'capabilities':_0x1e012e,'modelId':_0x5addaa,'attributes':_0xebe5c,'channelsToEditors':this['_channelsToEditors']}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x195453){if(_0x195453 instanceof ht)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x195453});else{const _0x2f71d0=As['get'](_0x195453['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ht(_0x2f71d0,null,{'error':_0x195453})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x1eb340,contextItems:_0x2ba1f7,capabilities:_0x7076bd,modelId:_0x28be9c,attributes:_0x329b35,channelsToEditors:_0x3086f3}){const _0x5f1d2b=new AIChatInteraction({'userMessage':_0x1eb340,'contextItems':_0x2ba1f7,'capabilities':_0x7076bd,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x28be9c,'attributes':_0x329b35,'channelsToEditors':_0x3086f3});return _0x5f1d2b['delegate'](...Is)['to'](this),this['interactions']['push'](_0x5f1d2b),this['fire']('interactionCreated',_0x5f1d2b),_0x5f1d2b;}['getInteraction'](_0x34abff){return this['interactions']['find'](_0x35c46d=>_0x35c46d['id']===_0x34abff);}['removeInteraction'](_0x4a343a){const _0x5b9e39=this['getInteraction'](_0x4a343a);_0x5b9e39&&(_0x5b9e39['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x5b9e39),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['cancelLastInteractionStream'](){const _0x4856eb=this['lastInteraction'];_0x4856eb?.['conversationId']&&_0x4856eb['messageId']&&this['connector']['cancelStream'](_0x4856eb['conversationId'],_0x4856eb['messageId'])['execute']()['catch'](()=>{});}['addCurrentDocumentToContext'](_0x45ed1c){this['chatContext']['addCurrentDocumentToContext'](_0x45ed1c);}async['updateCurrentDocumentsInContext'](_0x426ddb){await this['chatContext']['updateCurrentDocuments'](_0x426ddb);}['toggleAddCurrentDocumentOptionVisibility'](_0x370c9e){this['chatContext']['toggleAddCurrentDocumentOptionVisibility'](_0x370c9e);}['_hasSessionMismatch'](_0x58189e){return!!_0x58189e&&_0x58189e['documents']['some'](_0x550991=>{const _0x132d3f=this['_channelsToEditors']['get'](_0x550991['channelId']);return!_0x132d3f||_0x550991['sessionId']!==this['_getSessionId'](_0x132d3f);});}['addSelectionToContext'](_0x56bb01){this['chatContext']['addSelectionToContext'](_0x56bb01);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x10e08e){this['chatContext']['addFilesToContext'](_0x10e08e);}['addUrlToContext'](_0x448dfb){this['chatContext']['addUrlToContext'](_0x448dfb);}['addToolItemToContext'](_0x42d86c){this['chatContext']['addToolItemToContext'](_0x42d86c);}['addResourceToContext'](_0x29116d,_0x3e8ffb){this['chatContext']['addResourceToContext'](_0x29116d,_0x3e8ffb);}['loadSourceResources'](_0x3a6f21,_0x30f2e1,_0x133aa3){return this['chatContext']['loadSourceResources'](_0x3a6f21,_0x30f2e1,_0x133aa3);}['removeFromContext'](_0x55be70){this['chatContext']['removeFromContext'](_0x55be70);}['setWebSearch'](_0x346938){this['chatCapabilities']['setWebSearch'](_0x346938);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x12a0ff){this['chatCapabilities']['setReasoning'](_0x12a0ff);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}['getPendingContextItems'](){return this['chatContext']['getPendingContextItems']();}async['setModel'](_0x110d8e){_0x110d8e?!0x1===await this['chatModels']['isAvailable'](_0x110d8e)&&(wt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x110d8e}),_0x110d8e=(await this['chatModels']['getAvailableModels']())[0x0]):(wt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x110d8e=(await this['chatModels']['getAvailableModels']())[0x0]),_0x110d8e['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x110d8e,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x110d8e}));}}class AIModels extends Et(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x10dbe7,config:_0x23ce41,locale:_0x2ba0cc}){super(),this['_connector']=_0x10dbe7,this['_config']=_0x23ce41,this['_locale']=_0x2ba0cc;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x2ad9fe=await this['getAll']();let _0x82d95;return _0x82d95=this['_availableModels']?this['_filterModels'](_0x2ad9fe,this['_availableModels']):_0x2ad9fe['filter'](_0x3a2dd9=>_0x3a2dd9['recommended']),_0x82d95;}async['getModel'](_0x50e332){const _0x5b2af4=await this['getAll']();if(!_0x5b2af4['length'])return null;if(_0x50e332){const _0x5bca7f=this['_getModelById'](_0x5b2af4,_0x50e332);if(_0x5bca7f)return _0x5bca7f;wt('ai-chat-model-id-unrecognized',{'modelId':_0x50e332,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x58ed47=await this['getAvailableModels']();if(!_0x58ed47['length'])return null;if(this['_defaultModelId']){const _0x491458=this['_getModelById'](_0x58ed47,this['_defaultModelId']);if(_0x491458)return _0x491458;wt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x58ed47[0x0]['id']});}return _0x58ed47[0x0];}async['isAvailable'](_0x2efe9c){return(await this['getAvailableModels']())['some'](_0x50c99d=>_0x50c99d['name']===_0x2efe9c['name']&&_0x50c99d['provider']===_0x2efe9c['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x25a772=this['_locale']['uiLanguage']||'en',_0x9760e1=this['_connector']['getModels'](_0x25a772),_0x5c64d2=await _0x9760e1['list']();this['_modelList']=_0x5c64d2['items']['map'](_0x7b760b=>Cs(_0x7b760b)?{..._0x7b760b,'name':Mi(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x7b760b);}catch(_0x5d8ab5){throw Ct('ai-models-unable-to-retrieve',{'error':_0x5d8ab5}),_0x5d8ab5;}return[...this['_modelList']];}['_filterModels'](_0x341da5,_0x681ba3){let _0x168af0;if(_0x681ba3){_0x168af0=[];const _0x23520a=new Set(),_0x7ee7fb='string'==typeof _0x681ba3?[_0x681ba3['toLocaleLowerCase']()]:_0x681ba3['map'](_0x19a212=>_0x19a212['toLocaleLowerCase']());for(const _0x25ee0c of _0x7ee7fb)for(const _0x280de9 of _0x341da5)!_0x23520a['has'](_0x280de9['id'])&&this['_isMatchingFilter'](_0x280de9,_0x25ee0c)&&(_0x168af0['push'](_0x280de9),_0x23520a['add'](_0x280de9['id']));}else _0x168af0=_0x341da5;return _0x168af0;}['_isMatchingFilter'](_0x2a0fe7,_0x513c8a){const _0x45f358=_0x2a0fe7['id']['toLocaleLowerCase'](),_0x12039e=_0x2a0fe7['name']['toLocaleLowerCase'](),_0x3ef96d=_0x2a0fe7['provider']['toLocaleLowerCase']();return _0x45f358===_0x513c8a||_0x12039e===_0x513c8a||Cs(_0x2a0fe7)&&'auto'===_0x513c8a||_0x3ef96d===_0x513c8a||_0x45f358['startsWith'](_0x513c8a);}['_getModelById'](_0x5afa0d,_0x30ea06){return _0x5afa0d['find'](_0x118d21=>Cs(_0x118d21)&&'auto'===_0x30ea06?_0x118d21:_0x118d21['id']===_0x30ea06)||null;}}function Cs(_0x4b9191){return _0x4b9191['id']['startsWith']('agent');}function ms(_0x170ff6){return _0x170ff6?_0x170ff6 instanceof _0x331160?[_0x170ff6]:_0x170ff6['editors']&&0x0!==_0x170ff6['editors']['length']?Array['from'](_0x170ff6['editors']):[]:[];}function ps(_0x227bcd){const _0x54b325=ms(_0x227bcd);if(!_0x54b325['length'])throw new ht('ai-get-editor-from-context-no-editor');if(0x1===_0x54b325['length'])return _0x54b325[0x0];const _0x304dc5=_0x54b325['find'](_0x385a5c=>_0x385a5c['ui']?.['focusTracker']?.['isFocused']);if(_0x304dc5)return _0x304dc5;const _0x3823eb=function(_0x166ede){if(_0x166ede instanceof _0x331160)return;const _0xe0ef93=_0x166ede;if(!_0xe0ef93['plugins']||!_0xe0ef93['plugins']['has']('AIEditing'))return;const _0x29a06d=_0xe0ef93['plugins']['get']('AIEditing');return _0x29a06d['getLastContentFocusedEditor']?.();}(_0x227bcd);return _0x3823eb&&_0x54b325['includes'](_0x3823eb)?_0x3823eb:_0x54b325[0x0];}function Es({interaction:_0x2d333d,reply:_0x380f22,groups:_0x43e4d9,transform:_0xa87427,documentCompare:_0x33c15b,documentCompareOptions:_0xb4a15c}){const _0x1c3e23=_0x2d333d['getDocumentContext']()['documents']['find'](_0x2b0ea3=>_0x2b0ea3['id']==_0x43e4d9[0x0]['documentId']),_0x137cc2=_0x43e4d9[0x0]['editor'];if(!_0x1c3e23)return[];const _0x57aa7c=_0x1c3e23['content'],_0x3169f3=_0x1c3e23['version'],_0x4a3336=_0x380f22['documentContextContent']['get'](_0x43e4d9[0x0]['documentId'])['cloneNode'](!0x0);for(const {changes:_0x491d02}of _0x43e4d9){const _0x5762fd=_0x491d02['filter'](_0x4b4c8d=>'new'!=_0x4b4c8d['type'])['map'](_0x3d4d5e=>Yi('data-id',_0x3d4d5e['id'],_0x4a3336)),_0x263e76=_0x491d02['filter'](_0x4044a0=>'removed'!=_0x4044a0['type'])['map'](_0x374a6e=>_0x374a6e['node']['cloneNode'](!0x0));let _0x1b5d94=null;if(_0x5762fd['length']){_0x1b5d94=_0x5762fd[0x0]['previousSibling'];for(let _0xffed73=0x0;_0xffed73<_0x5762fd['length'];_0xffed73++)_0x5ca789(_0x5762fd[_0xffed73]);}if(_0x263e76['length']){_0x1b5d94||(_0x491d02[0x0]['anchorId']?_0x1b5d94=Yi('data-id',_0x491d02[0x0]['anchorId'],_0x4a3336):(_0x1b5d94=_0x263e76['shift'](),_0x4ee198(_0x4a3336,_0x1b5d94)));for(let _0x174ef0=0x0;_0x174ef0<_0x263e76['length'];_0x174ef0++)_0x4750be(_0x1b5d94,_0x263e76[_0x174ef0]),_0x1b5d94=_0x263e76[_0x174ef0];}}const _0x574a7b=Ki(_0x4a3336),_0x434c30=_0x33c15b['getDiff'](_0x57aa7c,_0x574a7b,{'targetEditor':_0x137cc2,..._0xb4a15c})['getOperations']();if(_0xa87427){const _0x6d247e=_0x137cc2['model']['document']['history']['getOperations'](_0x3169f3),_0xa01334={'document':_0x137cc2['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x329636(_0x434c30,_0x6d247e,_0xa01334)['operationsA'];}return _0x434c30;}function Ts(_0x11b1f7,_0x383aa3){if('marker'!=_0x383aa3['type'])return;const _0x35b6c6=_0x11b1f7['model']['markers']['get'](_0x383aa3['name']);_0x35b6c6&&(_0x383aa3['oldRange']=_0x35b6c6['getRange']());}function fs(_0x33ba89,_0x9686b1){if(_0x33ba89['files']['length']>0x0&&_0x9686b1['filesEnabled']){const _0x50ac46=_0x33ba89['files']['filter'](_0x4f087a=>_0x4f087a['name']);return _0x50ac46['length']>0x0?{'type':'file','files':_0x50ac46}:null;}if(_0x9686b1['urlsEnabled']){const _0x30a4ff=function(_0x576743){const _0x2624f7=_0x576743['trim']();if(/\s/['test'](_0x2624f7))return null;try{const _0x3f17a0=new URL(_0x2624f7);return'http:'!==_0x3f17a0['protocol']&&'https:'!==_0x3f17a0['protocol']?null:_0x3f17a0['toString']();}catch{return null;}}(_0x33ba89['plainText']);if(_0x30a4ff)return{'type':'url','url':_0x30a4ff};}const _0x240d5f=_0x33ba89['forceTextAttachment']?0x1:_0x9686b1['longTextThreshold']??0x1/0x0;if(_0x33ba89['plainText']['length']>=Math['max'](_0x240d5f,0x1)&&_0x9686b1['filesEnabled']){const _0x2ac71a=_0x9686b1['pastedTextLabel']+'.txt';return{'type':'text','files':[new File([_0x33ba89['plainText']],_0x2ac71a,{'type':'text/plain'})]};}return null;}class AIChatController extends _0x2bf4b8{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_hasAIChatBalloon']=!0x1;['_activeBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];['_channelsToEditors']=new Map();static get['requires'](){return[AIConnector,_0x2ab8a5];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['set']('isConversationReady',!0x1),this['_bodyCollection']=new Xt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new AIModels({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x5a5a57=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x5e3811,_0x584cbe)=>{this['_handleUIUserMessage']({'message':_0x584cbe});}),this['listenTo'](_0x5a5a57['view'],'change:activeTab',(_0x24182d,_0x196881,_0x1564a3)=>{'chat'!==_0x1564a3&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext'](),this['activeConversation']?.['cancelLastInteractionStream']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x47259a,_0xfe2701)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0xfe2701));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x4a3dae,_0x3e8fca)=>{this['activeConversation']?.['addUrlToContext'](_0x3e8fca);}),this['listenTo'](this['_aiChatUi'],'promptInputPaste',(_0xc913fd,_0x1da9c3)=>{const _0xf9f3c4=this['activeConversation'];if(!_0xf9f3c4)return;_0x1da9c3['hasDirectory']&&(_0x1da9c3['preventDefault'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED'),'id':'folder-error-'+at()}));const _0x3ef803=fs(_0x1da9c3,{'pastedTextLabel':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_PASTED_TEXT_NAME'),'longTextThreshold':this['context']['config']['get']('ai.chat.context.paste.textThreshold'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled'),'urlsEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.urls.enabled')});_0x3ef803&&(_0x1da9c3['preventDefault'](),'url'===_0x3ef803['type']?_0xf9f3c4['addUrlToContext'](_0x3ef803['url']):_0xf9f3c4['chatContext']['addFilesToContext'](_0x3ef803['files'],void 0x0,_0x3ef803['type']));}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x33e42d,_0x74f4f3)=>{_0x74f4f3['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x4c843c,_0x3ad64e)=>{this['activeConversation']?.['addResourceToContext'](_0x3ad64e['source'],_0x3ad64e['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x47b788,_0x4fd45c)=>{this['_removeFromContext'](_0x4fd45c);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x45c4d9,_0x524ddc)=>{this['activeConversation']?.['loadSourceResources'](_0x524ddc['sourceId'],_0x524ddc['query'],_0x524ddc['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x2f697c,_0x2ae50f)=>{this['activeConversation']?.['setModel'](_0x2ae50f);}),this['listenTo'](this['_aiChatUi'],'like',(_0x1a22f6,{replyId:_0x4e8e08})=>{console['log']('Liked\x20response',_0x4e8e08);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x110a8a,{replyId:_0x5ece5c})=>{console['log']('Disliked\x20response',_0x5ece5c);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x5c4d67,_0x425924)=>{this['_insertSuggestion'](_0x425924);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x148372,{replyId:_0x591e3e,partIndex:_0x3fc003})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x591e3e,_0x3fc003);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x528efc,{replyId:_0x38c2f6,partIndex:_0x1ed96b})=>{const _0x1993ec=this['_getDocumentRangeForReplyChanges'](_0x38c2f6,_0x1ed96b);if(!_0x1993ec)return;const {reply:_0x2c89ee}=this['getInteractionAndReplyById'](_0x38c2f6);'$graveyard'!=_0x1993ec['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'editor':_0x2c89ee['changeGroups'][_0x1ed96b]['editor'],'ranges':[_0x1993ec['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3ce586,_0xc454cd)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0xc454cd);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x2afb90,{replyId:_0x7e6523,showDiff:_0x144432})=>{const {interaction:_0x407306,reply:_0x666122}=this['getInteractionAndReplyById'](_0x7e6523),_0x2ee292=_0x666122['getContentParts']({'showDiff':_0x144432});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x407306['id']+':'+_0x666122['id'],'parts':_0x2ee292});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x2dd532,{replyId:_0x22188b,partIndex:_0x1594f2})=>{this['_rejectSuggestion']({'replyId':_0x22188b,'partIndex':_0x1594f2}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['on']('interactionCreated',(_0x89df96,_0x49cb94)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x49cb94);}),this['on']('replyCreated',(_0x672ed4,_0x166e34)=>{this['_addFeedItemReply'](_0x166e34);});}['afterInit'](){this['context']instanceof _0x331160?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1bd4bb,_0x24cea6)=>{_0x24cea6['on']('ready',()=>{this['_integrateEditor'](_0x24cea6);});}),this['_initConversation']();}async['_initConversation'](){const _0x569d21=this['context']['config']['get']('ai.chat.initialConversation');let _0x461d1c=_0x569d21;('lastCreated'!=_0x569d21||(_0x461d1c=await this['_getLastCreatedConversationId'](),_0x461d1c))&&('new'==_0x461d1c?await this['_startConversationSafely']():await this['loadConversation'](_0x461d1c));}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x4637c7){this['_closeActiveBalloon'](),(this['context']['plugins']['get'](AITabs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),this['activeConversation']&&this['stopListening'](this['activeConversation']),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x4637c7)['getConversation'](),await this['_startConversationSafely']({'id':_0x4637c7}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x4637c7),this['_aiChatUi']['enableControls'](),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x92895a){this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x4637c7}),this['_logError'](new ht('ai-chat-conversation-not-found',this,{'error':_0x92895a}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x476417){let _0x28a5d0=null,_0x32944d=null;this['on']('toolDataReceived',(_0x3fd833,_0x2ad5ba,_0x29ce64)=>{_0x29ce64['id']!==_0x28a5d0&&(_0x28a5d0=_0x29ce64['id'],_0x32944d=this['_getAIChatFeedAPI'](_0x29ce64)),_0x476417(_0x2ad5ba,_0x32944d);});}['addCurrentDocumentToChatContext'](){ms(this['context'])['length']&&this['activeConversation']?.['addCurrentDocumentToContext'](Mi(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](_0x32b583){const _0x4d7ed0=this['_aiEditing']['getSelectionText'](_0x32b583);this['activeConversation']?.['addSelectionToContext'](_0x4d7ed0),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x522f50){await this['_startConversationSafely']({'modelId':_0x522f50?.['modelId']});}async['sendMessage'](_0x5577f7){await this['_handleUIUserMessage'](_0x5577f7);}['getGroupId'](){const _0x536ea8=this['context']['config']['get']('collaboration.channelId');if(!_0x536ea8)throw new ht('ai-missing-channel-id',this);return _0x536ea8;}['_handleRemovedConversation'](_0x5ce4be){this['activeConversation']['id']===_0x5ce4be&&this['_startConversationSafely']();}['_insertSuggestion'](_0x553a73){const _0x12075a=this['context']['plugins']['get'](_0x2ab8a5),{reply:_0x56441d,interaction:_0x27bfe8}=this['getInteractionAndReplyById'](_0x553a73['replyId']),_0x5a950c=void 0x0!==_0x553a73['partIndex']?[_0x56441d['changeGroups'][_0x553a73['partIndex']]]:_0x56441d['changeGroups']['filter'](_0x4d0e57=>'pending'==_0x4d0e57['state']);_0x5a950c['map'](_0x5d5a61=>_0x56441d['changeGroups']['indexOf'](_0x5d5a61))['forEach'](_0x5e6c14=>{const _0x36124f=this['_getDocumentRangeForReplyChanges'](_0x553a73['replyId'],_0x5e6c14);_0x36124f&&'$graveyard'!=_0x36124f['range']['root']['rootName']?(_0x56441d['setChangeGroupState'](_0x5e6c14,'accepted'),void 0x0!==_0x553a73['partIndex']&&this['_scrollToSuggestionRange'](_0x36124f['range'],!0x1,_0x36124f['targetEditor'])):_0x56441d['setChangeGroupState'](_0x5e6c14,'outdated');});const _0x3d3055={},_0x1d2669=_0x5a950c['reduce']((_0x16efe0,_0x1ca035)=>('outdated'===_0x1ca035['state']||(_0x16efe0[_0x1ca035['documentId']]=[..._0x16efe0[_0x1ca035['documentId']]||[],_0x1ca035],_0x3d3055[_0x1ca035['documentId']]=[..._0x3d3055[_0x1ca035['documentId']]||[],_0x56441d['changeGroups']['indexOf'](_0x1ca035)]),_0x16efe0),{});for(const [_0x1717ff,_0x56f4cd]of Object['entries'](_0x1d2669)){const _0x24dfef=_0x56f4cd[0x0]['editor'];if(!_0x24dfef['plugins']['has']('TrackChanges')){wt('ai-no-track-changes',{'editor':_0x24dfef});continue;}const _0x31b530=Es({'reply':_0x56441d,'interaction':_0x27bfe8,'groups':_0x56f4cd,'transform':!0x0,'documentCompare':_0x12075a,'documentCompareOptions':{'anchor':_0x56f4cd[0x0]['rootName'],'markDeletions':!0x0}});let _0x194d4c;_0x24dfef['model']['change'](_0xf3e706=>{_0x194d4c=_0xf3e706['batch'],_0x24dfef['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x31b530),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x194d4c,{'interactionId':_0x27bfe8['id'],'replyId':_0x56441d['id'],'indexes':_0x3d3055[_0x1717ff]});}this['_updateRatings'](_0x56441d);}['_applySuggestion'](_0x54e972){const _0x264cb8=this['context']['plugins']['get'](_0x2ab8a5),{reply:_0x4230a3,interaction:_0x2464fc}=this['getInteractionAndReplyById'](_0x54e972['replyId']),_0x8d6e48=void 0x0!==_0x54e972['partIndex']?[_0x4230a3['changeGroups'][_0x54e972['partIndex']]]:_0x4230a3['changeGroups']['filter'](_0x443f72=>'pending'==_0x443f72['state']);_0x8d6e48['map'](_0xc4611a=>_0x4230a3['changeGroups']['indexOf'](_0xc4611a))['forEach'](_0x223c16=>{const _0x4ce9ee=this['_getDocumentRangeForReplyChanges'](_0x54e972['replyId'],_0x223c16);_0x4ce9ee&&'$graveyard'!=_0x4ce9ee['range']['root']['rootName']?(_0x4230a3['setChangeGroupState'](_0x223c16,'accepted'),void 0x0!==_0x54e972['partIndex']&&this['_scrollToSuggestionRange'](_0x4ce9ee['range'],!0x1,_0x4ce9ee['targetEditor'])):_0x4230a3['setChangeGroupState'](_0x223c16,'outdated');});const _0x38d29b={},_0x138e41=_0x8d6e48['reduce']((_0x1d1cac,_0x5480b1)=>('outdated'===_0x5480b1['state']||(_0x1d1cac[_0x5480b1['documentId']]=[..._0x1d1cac[_0x5480b1['documentId']]||[],_0x5480b1],_0x38d29b[_0x5480b1['documentId']]=[..._0x38d29b[_0x5480b1['documentId']]||[],_0x4230a3['changeGroups']['indexOf'](_0x5480b1)]),_0x1d1cac),{});for(const [_0x39af0f,_0x228aa3]of Object['entries'](_0x138e41)){const _0x23b4f5=Es({'reply':_0x4230a3,'interaction':_0x2464fc,'groups':_0x228aa3,'transform':!0x0,'documentCompare':_0x264cb8,'documentCompareOptions':{'anchor':_0x228aa3[0x0]['rootName'],'markDeletions':!0x1}});let _0x3b7040;const _0x59b223=_0x228aa3[0x0]['editor'];_0x59b223['model']['change'](_0x31ef96=>{_0x3b7040=_0x31ef96['batch'];for(const _0x7e7329 of _0x23b4f5)_0x7e7329['baseVersion']=_0x59b223['model']['document']['version'],Ts(_0x59b223,_0x7e7329),_0x31ef96['batch']['addOperation'](_0x7e7329),_0x59b223['model']['applyOperation'](_0x7e7329);}),this['_batchToChanges']['set'](_0x3b7040,{'interactionId':_0x2464fc['id'],'replyId':_0x4230a3['id'],'indexes':_0x38d29b[_0x39af0f]});}this['_updateRatings'](_0x4230a3);}['_rejectSuggestion'](_0x47d810){const {reply:_0x4b73ca}=this['getInteractionAndReplyById'](_0x47d810['replyId']);_0x4b73ca['setChangeGroupState'](_0x47d810['partIndex'],'rejected');}['_openBalloonFor'](_0x2fe95d,_0x4397b2){if(!this['_hasAIChatBalloon'])return;const {reply:_0x285c47}=this['getInteractionAndReplyById'](_0x2fe95d),_0x2819b4=_0x285c47['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(!_0x2819b4['length'])return;let _0x46d730,_0x3a41c2;if(void 0x0!==_0x4397b2?(_0x3a41c2=_0x2819b4['find'](_0x454ce7=>_0x454ce7['index']==_0x4397b2),_0x46d730=_0x3a41c2?.['index']):(_0x3a41c2=_0x2819b4[0x0],_0x46d730=_0x3a41c2['index']),!_0x3a41c2)return void _0x285c47['setChangeGroupState'](_0x4397b2??0x0,'outdated');if(this['_currentPreviewedChangeGroup']?.['replyId']==_0x2fe95d&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x46d730)return;const _0x13b057=this['_getUserPresentableContentPartDocumentRange'](_0x2fe95d,_0x285c47,_0x3a41c2),_0x17cb14=_0x285c47['changeGroups']['find'](_0xabcd31=>_0xabcd31['index']==_0x46d730)['editor'],_0x1b4e73=_0x17cb14['plugins']['get']('AIChatBalloon');if(this['_activeBalloon']&&this['_activeBalloon']!==_0x1b4e73&&this['_activeBalloon']['close'](),!_0x13b057)return _0x1b4e73['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x1b4e73,this['_currentPreviewedChangeGroup']={'replyId':_0x2fe95d,'partIndex':_0x46d730},this['_scrollToSuggestionRange'](_0x13b057,!0x0,_0x17cb14);const _0x42cb16=this['_getPresentableSiblingContentPartIndex'](_0x2fe95d,_0x46d730,'next');_0x1b4e73['clearContent'](),_0x1b4e73['updateContent']({'part':_0x3a41c2,'renderingStrategy':'static'}),_0x1b4e73['open']({'index':_0x46d730,'title':Mi(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x46d730+0x1)['toString']()),'showRotator':null!==_0x42cb16,'ranges':[_0x13b057],'areActionsDisabled':_0x285c47['areActionsDisabled'],'targetEditor':_0x17cb14}),_0x1b4e73['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x2fe95d,_0x46d730),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x2fe95d,'index':_0x46d730,'isActive':!0x0});}['_closeActiveBalloon'](){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;}['_getPresentableSiblingContentPartIndex'](_0x41ce95,_0x34c804,_0x54feec){const {reply:_0x30a69c}=this['getInteractionAndReplyById'](_0x41ce95),_0x354654=_0x30a69c['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x354654['length'])return null;const _0x17c7cd='next'==_0x54feec?0x1:-0x1;function _0x2ced45(_0x519db4){const _0x19221c=(_0x519db4+_0x17c7cd+_0x354654['length'])%_0x354654['length'];return{'siblingIndex':_0x19221c,'siblingPart':_0x354654[_0x19221c]};}const _0x4929fc=_0x354654['findIndex'](_0x2bd560=>_0x2bd560['index']==_0x34c804);let {siblingIndex:_0x55f037,siblingPart:_0x318fb4}=_0x2ced45(_0x4929fc);for(;!this['_getUserPresentableContentPartDocumentRange'](_0x41ce95,_0x30a69c,_0x318fb4);)if({siblingIndex:_0x55f037,siblingPart:_0x318fb4}=_0x2ced45(_0x55f037),_0x55f037===_0x4929fc)return null;return _0x318fb4['index'];}['_getUserPresentableContentPartDocumentRange'](_0x409016,_0x2e63fd,_0x156237){const _0x2c5762=_0x2e63fd['changeGroups'];if(!_0x156237['hasChanges'])return null;const _0xfd7795=_0x2c5762['find'](_0x16e14a=>_0x16e14a['index']==_0x156237['index']);if('pending'!==_0xfd7795?.['state'])return null;if('destroyed'===_0xfd7795?.['editor']['state'])return _0x2e63fd['setChangeGroupState'](_0x156237['index'],'outdated'),null;const _0x4d8351=this['_getDocumentRangeForReplyChanges'](_0x409016,_0x156237['index']);if(!_0x4d8351)return _0x2e63fd['setChangeGroupState'](_0x156237['index'],'outdated'),null;const {range:_0x4a48e4,currentIndex:_0x2c3928}=_0x4d8351;return'$graveyard'==_0x4a48e4['root']['rootName']?(_0x2e63fd['setChangeGroupState'](_0x2c3928,'outdated'),null):_0x4d8351['range'];}['_getDocumentRangeForReplyChanges'](_0x36e93a,_0x5b65c6){const {reply:_0x1e1b1c,interaction:_0x4aab1a}=this['getInteractionAndReplyById'](_0x36e93a),_0x2197f6=_0x1e1b1c['changeGroups']['filter'](_0xdcf4ff=>'pending'==_0xdcf4ff['state']),_0x33d48f=_0x2197f6['map'](_0x16d2cc=>_0x1e1b1c['changeGroups']['indexOf'](_0x16d2cc));void 0x0===_0x5b65c6&&(_0x5b65c6=_0x33d48f[0x0]);const _0x11f023=_0x33d48f['indexOf'](_0x5b65c6);if(-0x1==_0x11f023)return null;const _0xa47b9d=_0x2197f6[_0x11f023],_0x55febe=_0xa47b9d['editor'];if('destroyed'===_0x55febe['state'])return null;const _0x1558af=_0x1e1b1c['documentContextContent']['get'](_0xa47b9d['documentId']),_0x29e413=new _0xd8df80([]),_0xaec786=new _0xd8df80([]);for(const _0x58660e of _0xa47b9d['changes'])if('removed'!=_0x58660e['type']&&_0xaec786['children']['push'](_0x58660e['node']['cloneNode'](!0x0)),'new'!=_0x58660e['type']){const _0x71cef9=_0x4d1e9b(_0x3a4bd2=>Xi(_0x3a4bd2,'data-id')==_0x58660e['id'],_0x1558af,!0x0);_0x29e413['children']['push'](_0x71cef9['cloneNode'](!0x0));}if(0x0==_0x29e413['children']['length']){if(_0xa47b9d['changes'][0x0]['anchorId']){const _0x451779=Yi('data-id',_0xa47b9d['changes'][0x0]['anchorId'],_0x1558af);_0x29e413['children']['unshift'](_0x451779['cloneNode'](!0x0)),_0xaec786['children']['unshift'](_0x451779['cloneNode'](!0x0)),_0x451779['nextSibling']&&(_0x29e413['children']['push'](_0x451779['nextSibling']['cloneNode'](!0x0)),_0xaec786['children']['push'](_0x451779['nextSibling']['cloneNode'](!0x0)));}else{const _0x954d4b=_0x1558af['children'][0x0];if(!_0x954d4b)return null;_0x29e413['children']['push'](_0x954d4b['cloneNode'](!0x0)),_0xaec786['children']['push'](_0x954d4b['cloneNode'](!0x0));}}const _0x27b637=_0x4aab1a['getDocumentContext'](),_0x54e96d=_0x27b637['content']||_0x27b637['documents']['find'](_0x44754f=>_0x44754f['id']==_0xa47b9d['documentId'])['content'],_0x3e8866=_0x55febe['model']['document']['getRoot'](_0xa47b9d['rootName']),_0x18e9e2=_0x55febe['data']['parse'](_0x54e96d,_0x3e8866),_0x38bc83=Ki(_0x29e413),_0xfb9478=_0x55febe['data']['parse'](_0x38bc83,_0x3e8866),_0xde02cc=_0x55febe['data']['parse'](_0x38bc83,_0x3e8866),_0x288a44=_0x55febe['model']['createPositionAt'](_0xfb9478,0x0),_0x54c6e5=Ki(_0xaec786),_0x385a76={'targetEditor':_0x55febe,'anchor':_0x288a44,'markDeletions':!0x1},_0x30dd83=_0x55febe['plugins']['get'](_0x2ab8a5)['getDiff'](_0x38bc83,_0x54c6e5,_0x385a76)['getOperations']();if(!_0x30dd83['length'])return null;_0x55febe['model']['change'](_0x477fc9=>{for(const _0x477b1e of _0x30dd83)if('remove'==_0x477b1e['type']){const _0x39a8ea=_0x477b1e['sourcePosition'],_0xb09e9=_0x477b1e['howMany'],_0x46b2c5=new _0x3d09e2(_0x39a8ea,_0xb09e9);_0x477fc9['batch']['addOperation'](_0x46b2c5),_0x55febe['model']['applyOperation'](_0x46b2c5);}else'marker'!==_0x477b1e['type']&&(_0x477b1e['baseVersion']=null,_0x477b1e['isDocumentOperation']=!0x1,_0x477fc9['batch']['addOperation'](_0x477b1e),_0x55febe['model']['applyOperation'](_0x477b1e));});const _0x2e5ec5=cs(_0x55febe,_0x30dd83,_0xfb9478);us(_0x55febe['model'],_0x2e5ec5);const _0x53b87b=_0x2e5ec5['getFirstRange']()['start']['path']['slice'](),_0x9db2ee=_0x2e5ec5['getFirstRange']()['end']['path']['slice'](),_0x11214f=[];let _0x1637c3=_0xfb9478,_0x2f35ab=_0xde02cc;for(let _0x5d91a4=0x0;_0x5d91a4<_0x9db2ee['length'];_0x5d91a4++){const _0x4c2cc5=_0x1637c3['maxOffset']-_0x9db2ee[_0x5d91a4];_0x11214f[_0x5d91a4]=_0x2f35ab['maxOffset']-_0x4c2cc5,_0x1637c3=_0x1637c3['getChildAtOffset'](_0x9db2ee[_0x5d91a4]),_0x2f35ab=_0x2f35ab['getChildAtOffset'](_0x11214f[_0x5d91a4]);}const _0x3876d4=_0x55febe['model']['createRange'](_0x55febe['model']['createPositionFromPath'](_0xde02cc,_0x53b87b),_0x55febe['model']['createPositionFromPath'](_0xde02cc,_0x11214f)),_0x277b44=_0xde02cc['getChild'](0x0)['getAttribute'](_0x2f50ff),_0x5ebfe2=Array['from'](_0x18e9e2['getChildren']())['find'](_0xfdda24=>_0xfdda24['getAttribute'](_0x2f50ff)==_0x277b44)['getPath'](),_0x36b060=_0x3876d4['start']['path']['slice'](),_0x51faf5=_0x3876d4['end']['path']['slice']();_0x36b060[0x0]=_0x5ebfe2[0x0]+_0x36b060[0x0],_0x51faf5[0x0]=_0x5ebfe2[0x0]+_0x51faf5[0x0];let _0x391a2b=_0x55febe['model']['createRange'](_0x55febe['model']['createPositionFromPath'](_0x55febe['model']['document']['getRoot'](_0xa47b9d['rootName']),_0x36b060),_0x55febe['model']['createPositionFromPath'](_0x55febe['model']['document']['getRoot'](_0xa47b9d['rootName']),_0x51faf5));const _0x48e9d9=_0x27b637['documents']['find'](_0x423e14=>_0x423e14['id']==_0xa47b9d['documentId'])['version'],_0x406d30=_0x55febe['model']['document']['history']['getOperations'](_0x48e9d9);for(const _0x4a33f8 of _0x406d30)_0x391a2b=_0x303302['_createFromRanges'](_0x391a2b['getTransformedByOperation'](_0x4a33f8));return{'range':_0x391a2b,'currentIndex':_0x5b65c6,'targetEditor':_0x55febe};}['_integrateEditorBalloon'](_0x23f3de){if(!_0x23f3de['plugins']['has']('AIChatBalloon'))return;const _0x5608a5=_0x23f3de['plugins']['get']('AIChatBalloon');this['_hasAIChatBalloon']=!0x0,_0x5608a5['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x5608a5,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x271917,partIndex:_0x39006d}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x5cff2b}=this['getInteractionAndReplyById'](_0x271917),_0x9729cd=_0x5cff2b['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x39006d});_0x5608a5['updateContent']({'part':_0x9729cd[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x5608a5,'applySuggestion',()=>{const {replyId:_0x16af16,partIndex:_0x43aa2b}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x16af16,'partIndex':_0x43aa2b}),_0x5608a5['setState']('accepted');}),this['listenTo'](_0x5608a5,'insertSuggestion',()=>{const {replyId:_0x1ad6bb,partIndex:_0x156879}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x1ad6bb,'partIndex':_0x156879}),_0x5608a5['setState']('accepted');}),this['listenTo'](_0x5608a5,'rejectSuggestion',()=>{const {replyId:_0x1d2689,partIndex:_0x3f286f}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x1d2689,'partIndex':_0x3f286f}),_0x5608a5['setState']('rejected');}),this['listenTo'](_0x5608a5,'showNext',()=>{const {replyId:_0x5092f9,partIndex:_0x5dd464}=this['_currentPreviewedChangeGroup'],_0x3b2b06=this['_getPresentableSiblingContentPartIndex'](_0x5092f9,_0x5dd464,'next');null!==_0x3b2b06&&this['_openBalloonFor'](_0x5092f9,_0x3b2b06);}),this['listenTo'](_0x5608a5,'showPrevious',()=>{const {replyId:_0x1d98a4,partIndex:_0x491293}=this['_currentPreviewedChangeGroup'],_0x35140d=this['_getPresentableSiblingContentPartIndex'](_0x1d98a4,_0x491293,'previous');null!==_0x35140d&&this['_openBalloonFor'](_0x1d98a4,_0x35140d);}),this['listenTo'](_0x5608a5,'dialogClosed',(_0x4b11e2,{id:_0x3b40f4})=>{if('aiChatBalloon'!==_0x3b40f4)return;const {replyId:_0xb9c021,partIndex:_0x1d79a3}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0xb9c021,'index':_0x1d79a3,'isActive':!0x1}),this['_activeBalloon']===_0x5608a5&&(this['_activeBalloon']=void 0x0);});}['_integrateEditor'](_0x3e2507){if(this['_channelsToEditors']['set'](_0x3e2507['config']['get']('collaboration.channelId'),_0x3e2507),this['_integrateEditorBalloon'](_0x3e2507),this['addCurrentDocumentToChatContext'](),_0x3e2507['once']('destroy',()=>{this['_checkRemoveCurrentDocumentFromChatContext']();}),_0x3e2507['plugins']['has']('Undo')){const _0x4421c7=_0x3e2507['commands']['get']('undo'),_0x2a2901=_0x3e2507['commands']['get']('redo');this['listenTo'](_0x4421c7,'revert',(_0x1b85b2,_0x2e30f1,_0x50d497)=>{const _0x494ebd=this['_batchToChanges']['get'](_0x2e30f1);if(!_0x494ebd)return;const _0x2f91d9=this['activeConversation']['getInteraction'](_0x494ebd['interactionId']),_0x331e07=_0x2f91d9?.['getReply'](_0x494ebd['replyId']);this['_batchToChanges']['delete'](_0x2e30f1),_0x2f91d9&&_0x331e07&&(_0x494ebd['indexes']['forEach'](_0x3a0e4c=>_0x331e07['setChangeGroupState'](_0x3a0e4c,'pending')),this['_batchToChanges']['set'](_0x50d497,_0x494ebd));}),this['listenTo'](_0x2a2901,'revert',(_0x494e4b,_0x56408d,_0x58cb4d)=>{const _0x2e010a=this['_batchToChanges']['get'](_0x56408d);if(!_0x2e010a)return;const _0x2bdb90=this['activeConversation']['getInteraction'](_0x2e010a['interactionId']),_0x1de3cf=_0x2bdb90?.['getReply'](_0x2e010a['replyId']);this['_batchToChanges']['delete'](_0x56408d),_0x2bdb90&&_0x1de3cf&&(_0x2e010a['indexes']['forEach'](_0x3949cc=>_0x1de3cf['setChangeGroupState'](_0x3949cc,'accepted')),this['_batchToChanges']['set'](_0x58cb4d,_0x2e010a));});}const _0xdab280=_0x3e2507['config']['get']('ai.chat.context');_0xdab280['alwaysAddSelection']&&_0xdab280['document']['enabled']&&this['listenTo'](_0x3e2507['model']['document']['selection'],'change:range',(_0x224b9a,_0x13da6b)=>{if(!_0x13da6b['directChange'])return;'chat'===_0x3e2507['plugins']['get']('AITabs')['view']['activeTab']&&(_0x3e2507['model']['hasContent'](_0x3e2507['model']['document']['selection'])?this['addSelectionToChatContext'](_0x3e2507):this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x309347=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x17cff8=await _0x309347['getConversations']();return _0x17cff8['length']?_0x17cff8[0x0]['id']:'new';}catch(_0x13a32e){return this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':at()}),this['_logError'](new ht('ai-chat-conversation-init-failed',this,{'error':_0x13a32e})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x50ac31={}){this['set']('isConversationReady',!0x1);try{await this['_handleStartConversation'](_0x50ac31);}catch(_0x3ea242){this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x50ac31['id']||at()}),console['error'](_0x3ea242),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x6d7410,modelId:_0x3d31d8}={}){this['_closeActiveBalloon']();let _0x14d387=_0x3d31d8;_0x14d387||(_0x6d7410||!this['activeConversation']?_0x14d387=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x14d387=this['activeConversation']['selectedModel']['id'])),this['activeConversation']&&this['stopListening'](this['activeConversation']),await this['_stopLastInteraction']();const _0x2c4540=this['getGroupId'](),_0x508f38=_0x6d7410||at();let _0x57eebc;this['activeConversation']=new AIChatConversation({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x14d387,'conversationId':_0x508f38,'group':_0x2c4540,'locale':this['context']['locale'],'isFromHistory':!!_0x6d7410,'channelsToEditors':this['_channelsToEditors'],'getSessionId':_0xac5af6=>this['_aiEditing']['getSessionId'](_0xac5af6)}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['listenTo'](this['activeConversation'],'conversationInitialized',(_0x1fff8f,_0x3de06a)=>{this['_aiChatUi']['createConversation'](_0x3de06a),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x6d7410||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['listenTo'](this['activeConversation'],'uploadProgressChanged',(_0x4158ec,_0xcc0895)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xcc0895['isUploadInProgress']);}),this['listenTo'](this['activeConversation'],'webSearchStarted',()=>{const _0x5248e8=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x5248e8);}),this['listenTo'](this['activeConversation'],'reasoningStarted',()=>{const _0x8a6b95=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x8a6b95);}),this['listenTo'](this['activeConversation'],'webSearchFinished',(_0x183666,_0x3669bb)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3669bb,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['listenTo'](this['activeConversation'],'reasoningFinished',(_0x3a3e8e,_0x5d5171)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x5d5171,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['listenTo'](this['activeConversation'],'interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['listenTo'](this['activeConversation'],'interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['listenTo'](this['activeConversation'],'interactionDestroyed',(_0x5962da,_0x5f267e)=>{this['_aiChatUi']['removeFeedInteraction'](_0x5f267e['id']);}),this['listenTo'](this['activeConversation'],'setConversationTitle',(_0x56b528,_0xe21dc6,_0x4ff047)=>{this['_updateConversationTitle'](_0xe21dc6,_0x4ff047);}),this['listenTo'](this['activeConversation'],'replyContentUpdated',async(_0x2a5460,_0x245136)=>{void 0x0!==_0x57eebc&&_0x57eebc!==_0x245136['id']&&this['_updateReplyContentThrottled']['flush'](),_0x57eebc=_0x245136['id'],_0x245136['isFromHistory']?await this['_updateReplyContent']({'reply':_0x245136}):await this['_updateReplyContentThrottled']({'reply':_0x245136});}),this['listenTo'](this['activeConversation'],'replyChangeGroupStateUpdated',(_0x51a93b,{reply:_0x4f1c3d,index:_0x387e4d,state:_0x56ed1e})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x4f1c3d['id'],'index':_0x387e4d,'state':_0x56ed1e}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x4f1c3d['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x387e4d&&this['_activeBalloon']?.['setState'](_0x56ed1e);}),this['listenTo'](this['activeConversation'],'contextItemAdded',(_0x321fc6,_0x698f53)=>{if(this['_aiChatUi']['addContextItem'](_0x698f53['contextItem'],_0x698f53['isLoading']),'selection'===_0x698f53['contextItem']['type']){const _0x1d67b3=ps(this['context']),_0x58b2df=[..._0x1d67b3['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'editor':_0x1d67b3,'ranges':_0x58b2df,'id':'context','priority':0x1});}}),this['listenTo'](this['activeConversation'],'contextItemRemoved',(_0x2e9e0b,_0x1869cd)=>{this['_aiChatUi']['removeContextItem'](_0x1869cd['uiId']),'current-document'==_0x1869cd['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x1869cd['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['listenTo'](this['activeConversation'],'contextItemLoadingEnded',(_0x16bd9d,_0x7f196c)=>{this['_aiChatUi']['setContextItemLoading'](_0x7f196c['contextItem']['uiId'],_0x7f196c['isLoading']);}),this['listenTo'](this['activeConversation'],'contextSent',(_0x2fe024,_0x3db5cc)=>{this['_aiChatUi']['setConversationContext'](_0x3db5cc['contextItems']);}),this['listenTo'](this['activeConversation'],'addContextOptionsChanged',(_0x4febc2,_0x5528d3)=>{this['_aiChatUi']['setAddContextOptions'](_0x5528d3['options']);}),this['listenTo'](this['activeConversation'],'sourceResourcesLoaded',(_0x33202e,_0x53bca1)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x53bca1['sourceId'],_0x53bca1['source'],_0x53bca1['resources'],_0x53bca1['uid']);}),this['listenTo'](this['activeConversation'],'resourceStateChanged',(_0x51d693,_0x4de768)=>{this['_aiChatUi']['updateResourceState'](_0x4de768['sourceId'],_0x4de768['resourceId'],_0x4de768['isInContext']);}),this['listenTo'](this['activeConversation'],'capabilitiesUpdated',(_0x1cebd0,_0x469ca3)=>{this['_aiChatUi']['updateCapabilities'](_0x469ca3);}),this['listenTo'](this['activeConversation'],'modelSelected',async(_0x51c4fe,_0x36cdb9)=>{const _0x457baa=(await this['_aiChatModels']['getAll']())['find'](_0x1aedee=>_0x1aedee['id']===_0x36cdb9['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x457baa,_0x36cdb9['isDisabled']);}),this['listenTo'](this['activeConversation'],'error',(_0xb668d1,{error:_0x74eac3,interactionId:_0x55a5d1,fileName:_0x6caef2,url:_0x371bf8,sourceId:_0x417a6f,sourceLabel:_0x3abf0c})=>{const _0x313e23=_0x55a5d1?_0x55a5d1+':'+at():at();_0x74eac3['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Mi(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x313e23}):_0x74eac3['message']['startsWith']('ai-chat-conversation-init-failed')||_0x74eac3['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x313e23}),this['_logError'](_0x74eac3)):_0x74eac3['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x6caef2),'id':_0x313e23}):_0x74eac3['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x371bf8),'id':_0x313e23}):_0x74eac3['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x313e23}):_0x74eac3['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x313e23}):_0x74eac3['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x417a6f&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x417a6f),this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x3abf0c||'source'),'id':_0x313e23}),this['_logError'](_0x74eac3)):_0x74eac3['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x313e23}),this['_logError'](_0x74eac3)):_0x74eac3['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x313e23}),this['_logError'](_0x74eac3)):_0x74eac3['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x313e23}),this['_logError'](_0x74eac3)):_0x74eac3['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x313e23}),this['_logError'](_0x74eac3)):_0x74eac3['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x313e23}),this['_logError'](_0x74eac3)):_0x74eac3['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x313e23}),this['_logError'](_0x74eac3)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Mi(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x313e23}),this['_logError'](_0x74eac3));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x6d7410||(await this['activeConversation']['start'](),this['_aiChatUi']['enableControls']()),this['set']('isConversationReady',!0x0);}async['_handleUIUserMessage']({message:_0x10bd82,attributes:_0x1ef8df}){if(!this['activeConversation'])throw new ht('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x5b4851=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentsInContext'](_0x5b4851);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x10bd82,'attributes':_0x1ef8df});}['_logError'](_0x21a766){Ct(_0x21a766['message'],_0x21a766['data']);}['_removeFromContext'](_0x38dd58){this['activeConversation']?.['removeFromContext'](_0x38dd58);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x34af70){const [_0x43571e,_0x4419e7]=_0x34af70['split'](':'),_0x484464=this['activeConversation']['getInteraction'](_0x43571e),_0x4fe26c=_0x484464['getReply'](_0x4419e7);return{'interaction':_0x484464,'reply':_0x4fe26c};}['_scrollToSuggestionRange'](_0x45565d,_0x455caf=!0x1,_0x535e38){const _0x11d3cb={'target':_0x535e38['editing']['view']['domConverter']['viewRangeToDom'](_0x535e38['editing']['mapper']['toViewRange'](_0x45565d)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x455caf};_0x455caf&&(_0x11d3cb['alignToTop']=!0x0),Tt(_0x11d3cb);}['_updateConversationTitle'](_0x594ea0,_0x2e1d34=!0x1){this['_aiChatUi']['setConversationTitle'](_0x594ea0||Mi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x2e1d34);}['_addFeedItemReply'](_0x2346c7){'text'===_0x2346c7['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2346c7):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2346c7);}async['_updateReplyContent']({reply:_0x2d1d56,renderingStrategy:_0x159137}){const {id:_0xc9c4b3,interactionId:_0x3db469,isDone:_0x27233d,type:_0x31af1c,parsedContent:_0x2ce6eb}=_0x2d1d56,_0x561f1b=_0x3db469+':'+_0xc9c4b3;if('modification'===_0x31af1c){const _0x1bf5c8=_0x2d1d56['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x561f1b,'parts':_0x1bf5c8,'isDone':_0x27233d,'skipLoadingEffects':_0x2d1d56['isFromHistory']});}else'text'===_0x31af1c&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x561f1b,'parsedContent':_0x2ce6eb['get']('text'),'renderingStrategy':_0x159137,'isDone':_0x27233d});_0x27233d&&_0x2d1d56['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x561f1b,_0x2d1d56['sources']);}['_updateReplyContentThrottled']=_0x4479f7(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x1e4088=this['activeConversation']?.['lastInteraction'];_0x1e4088&&(_0x1e4088['stop'](),this['_aiChatUi']['stopInteraction'](_0x1e4088)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x30933b=this['activeConversation']?.['lastInteraction'];if(_0x30933b){for await(const _0x4a6b2c of _0x30933b['replies'])this['_aiChatUi']['hasFeedItem'](_0x4a6b2c['id'])||this['_addFeedItemReply'](_0x4a6b2c),await this['_updateReplyContent']({'reply':_0x4a6b2c,'renderingStrategy':'static'});}}['_updateRatings'](_0x13e0fe){const _0x3e5995={'positiveCount':_0x13e0fe['changeGroups']['filter'](_0x4a8661=>'accepted'===_0x4a8661['state'])['length'],'totalCount':_0x13e0fe['changeGroups']['length'],'modificationId':_0x13e0fe['id']},_0x136898=this['activeConversation']['getInteraction'](_0x13e0fe['interactionId'])['messageId'];_0x136898&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x136898,_0x3e5995);}['_getAIChatFeedAPI'](_0x3ddf58){const _0x51a0cf=this['_aiChatUi'],_0x1cd63b=()=>{_0x3ddf58['resetWebSearchState'](),_0x3ddf58['resetReasoningState'](),_0x51a0cf['clearLoadingMessage']();},_0x1a04eb=()=>{_0x3ddf58['currentReply']&&(_0x3ddf58['currentReply']['done'](),_0x3ddf58['currentReply']=void 0x0);};return{'insertTextReply':(_0x4ecf1f,_0xf0262a)=>{_0x1a04eb(),_0x1cd63b();const _0x2d3867=_0x3ddf58['currentReply']=_0x3ddf58['createReply']({'type':'text','interactionId':_0x3ddf58['id'],'id':_0xf0262a||at(),'channelsToEditors':this['_channelsToEditors']});return _0x2d3867['appendContent'](_0x4ecf1f),_0x1a04eb(),_0x2d3867;},'insertCustomElement':async(_0x3dbd2f,_0x34c68c)=>(_0x1a04eb(),_0x1cd63b(),_0x51a0cf['addFeedItemCustomElement'](_0x3dbd2f,_0x34c68c||at())),'setLoadingMessage':_0xc2e30b=>{_0x51a0cf['setLoadingMessage'](_0xc2e30b);},'clearLoadingMessage':()=>{_0x51a0cf['clearLoadingMessage']();}};}['_checkRemoveCurrentDocumentFromChatContext'](){ms(this['context'])['find'](_0x353aaf=>'destroyed'!==_0x353aaf['state'])||(this['activeConversation']?.['removeFromContext']('current-document'),this['activeConversation']?.['toggleAddCurrentDocumentOptionVisibility'](!0x1));}}const Rs='ai-selection',bs=['br'];class AIEditing extends _0x2bf4b8{constructor(_0x3e5e86){super(_0x3e5e86),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionIdByEditor']=new WeakMap();['_lastContentFocusedEditor'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['getLastContentFocusedEditor'](){return this['_lastContentFocusedEditor'];}['getSessionId'](_0xed566d){let _0xcff466=this['_sessionIdByEditor']['get'](_0xed566d);return!_0xcff466&&(_0xcff466=_0xed566d['plugins']['has']('RealTimeCollaborationClient')&&_0xed566d['plugins']['get']('RealTimeCollaborationClient')['sessionId']||at(),this['_sessionIdByEditor']['set'](_0xed566d,_0xcff466)),_0xcff466;}async['getDocumentData'](){const _0x3d8a4c=ms(this['context']);if(!_0x3d8a4c['length'])throw new ht('ai-get-editor-from-context-no-editor');const _0x88a6c8=[],_0x1fb179=new Set();for(const _0xc1f7f3 of _0x3d8a4c){const _0x299c2f=_0xc1f7f3['config']['get']('roots')||{};for(const _0x157c3a of _0xc1f7f3['model']['document']['getRoots']()){if('$graveyard'===_0x157c3a['rootName'])continue;const _0xf3b3f1=await this['_getDocumentDataForEditorRoot'](_0xc1f7f3,_0x157c3a,_0x1fb179),_0x4ef09e=_0x299c2f[_0x157c3a['rootName']];let _0x12ef2f;_0x4ef09e?.['label']?_0x12ef2f=_0x4ef09e['label']:(wt('ai-document-root-missing-label',{'editor':_0xc1f7f3,'rootConfig':_0x4ef09e}),_0x12ef2f=_0x157c3a['rootName']),_0x88a6c8['push']({'editor':_0xc1f7f3,'rootName':_0x157c3a['rootName'],'content':_0xf3b3f1['content'],'version':_0xf3b3f1['version'],'sessionId':this['getSessionId'](_0xc1f7f3),'channelId':_0xc1f7f3['config']['get']('collaboration.channelId'),'selections':_0xf3b3f1['selections'],'name':_0x12ef2f,'description':_0x4ef09e?.['description']});}}return _0x88a6c8;}async['_getDocumentDataForEditorRoot'](_0x3e2ae5,_0x2e238f,_0x53f3cc){const _0x761816=_0x3e2ae5['data']['toView'](_0x2e238f,{'convertAiChatSelectionMarker':!0x0}),_0x57fe41=new _0x26d283(_0x3e2ae5['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x761816,_0x57fe41,_0x53f3cc);let _0x451fe4=await this['_getDocumentDataStringFromView'](_0x761816,_0x3e2ae5);const _0x17595f=this['_getMarkersInDocumentOrder'](_0x3e2ae5,_0x2e238f),_0x15a4dd=[];for(const _0x1330e4 of _0x17595f){const _0x4a38dd='<'+_0x1330e4['name']+':start></'+_0x1330e4['name']+':start>',_0x1762d8=_0x451fe4['indexOf'](_0x4a38dd);_0x451fe4=_0x451fe4['substring'](0x0,_0x1762d8)+_0x451fe4['substring'](_0x1762d8+_0x4a38dd['length']);const _0x521ea4='<'+_0x1330e4['name']+':end></'+_0x1330e4['name']+':end>',_0x446415=_0x451fe4['indexOf'](_0x521ea4);_0x451fe4=_0x451fe4['substring'](0x0,_0x446415)+_0x451fe4['substring'](_0x446415+_0x521ea4['length']),_0x15a4dd['push']({'markerName':_0x1330e4['name'],'start':_0x1762d8,'end':_0x446415,'htmlFragment':_0x451fe4['substring'](_0x1762d8,_0x446415)});}return{'content':_0x451fe4,'version':_0x3e2ae5['model']['document']['version'],'selections':_0x15a4dd};}['afterInit'](){this['context']instanceof _0x331160?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x45cf6e,_0x144b4b)=>{_0x144b4b['on']('ready',()=>{this['_integrateEditor'](_0x144b4b);});});}['_setOutputDataProcessor'](_0x3d17de){this['_outputDataProcessor']=_0x3d17de;}async['_getDocumentDataStringFromView'](_0x3913ec,_0x49c6e8){let _0x4fdde0;if(this['_outputDataProcessor']){const _0x5059b4=_0x49c6e8['data']['processor']['domConverter']['viewToDom'](_0x3913ec),_0x263436=await this['_outputDataProcessor'](_0x5059b4);_0x4fdde0=_0x49c6e8['data']['processor']['htmlWriter']['getHtml'](_0x263436);}else _0x4fdde0=_0x49c6e8['data']['processor']['toData'](_0x3913ec);return _0x4fdde0;}['_integrateEditor'](_0x2aa4be){if(!_0x2aa4be['config']['get']('collaboration.channelId'))throw new ht('ai-missing-channel-id',_0x2aa4be);_0x2aa4be['ui']['focusTracker']['on']('change:isFocused',(_0x49e6d2,_0x1be787,_0x447ca8)=>{_0x447ca8&&(this['_lastContentFocusedEditor']=_0x2aa4be);}),_0x2aa4be['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x2aa4be&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x2aa4be['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Rs,'view':({markerName:_0x100dd3})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x100dd3['split'](':')[0x1]],'priority':0xc})}),_0x2aa4be['conversion']['for']('dataDowncast')['markerToElement']({'model':Rs+':context','view':(_0x394787,{writer:_0x5a0d75,options:_0x3f78f7})=>_0x3f78f7['convertAiChatSelectionMarker']?_0x5a0d75['createUIElement'](_0x394787['markerName']+':'+(_0x394787['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x2667d4){const _0x5ba516=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x2667d4);const _0xced9a0=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x5ba516,_0xced9a0);}['hideFakeVisualSelection'](_0x54580e){const _0x3a819a=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x54580e);const _0x1abf14=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x3a819a,_0x1abf14);}async['modelToDataWithIds'](_0x8e71bd,_0x488da6){const _0x3d85c0=_0x488da6['data']['toView'](_0x8e71bd),_0x2ad7b1=new _0x26d283(_0x488da6['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x3d85c0,_0x2ad7b1),this['_getDocumentDataStringFromView'](_0x3d85c0,_0x488da6);}['_setDataIdsOnChildren'](_0x3b5f63,_0xc64be1,_0x9404d0=new Set()){let _0x4399ab=!0x1;for(const _0x381616 of _0x3b5f63['getChildren']()){if(!_0x381616['is']('view:element')||bs['includes'](_0x381616['name']))continue;const _0xdab6c3=_0x381616['is']('view:containerElement'),_0x4eb991=_0x381616['is']('view:emptyElement'),_0x19a975=_0x381616['is']('view:rawElement'),_0x54d811=this['_setDataIdsOnChildren'](_0x381616,_0xc64be1,_0x9404d0);if(_0x381616['hasAttribute']('data-id')){_0x4399ab=!0x0,_0x9404d0['add'](_0x381616['getAttribute']('data-id'));continue;}(_0xdab6c3||_0x4eb991||_0x19a975||_0x54d811)&&(_0xc64be1['setAttribute']('data-id',this['_nextDataId'](_0x9404d0),_0x381616),_0x4399ab=!0x0);}return _0x4399ab;}['_nextDataId'](_0x38b023){let _0x439a73;do{_0x439a73='';for(let _0x3920b3=0x0;_0x3920b3<0x4;_0x3920b3++)_0x439a73+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x38b023['has'](_0x439a73));return _0x38b023['add'](_0x439a73),_0x439a73;}['getSelectionText'](_0x40570a){const _0x323893=(_0x40570a?_0x40570a['model']:ps(this['context'])['model'])['document']['selection'],_0xf0f3d=[],_0xd43e2a=Array['from'](_0x323893['getRanges']());_0xd43e2a['sort']((_0x16f9c5,_0x36823b)=>_0x16f9c5['start']['isBefore'](_0x36823b['start'])?-0x1:0x1);for(const _0x3a9e75 of _0xd43e2a)for(const _0x3113ad of _0x3a9e75['getItems']())_0x3113ad['is']('$textProxy')?_0xf0f3d['push'](_0x3113ad['data']):_0x3113ad['is']('element')&&_0xf0f3d['length']>0x0&&'\x20'!==_0xf0f3d[_0xf0f3d['length']-0x1]&&_0xf0f3d['push']('\x20');return _0xf0f3d['length']?'\x22'+_0xf0f3d['join']('')['trim']()+'\x22':Mi(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x5b965f){for(let _0xc33d8e=0x0;_0xc33d8e<this['_fakeSelections']['length'];_0xc33d8e++)if(this['_fakeSelections'][_0xc33d8e]['id']==_0x5b965f)return void this['_fakeSelections']['splice'](_0xc33d8e,0x1);}['_addFakeSelection'](_0x30a2cf){this['_removeFakeSelectionById'](_0x30a2cf['id']),ft(this['_fakeSelections'],_0x30a2cf);}['_refreshFakeSelection'](_0x104efa,_0x5cc52a){if(_0x104efa==_0x5cc52a)return;const _0x475abb=_0x104efa?_0x104efa['editor']:null,_0xfdff1f=_0x5cc52a?_0x5cc52a['editor']:null,_0x5828dc=(_0x512c7f,_0x2f6ecc)=>{const _0x437757=_0x2f6ecc['model']['markers']['getMarkersGroup'](Rs);for(const _0x3f374e of _0x437757)_0x512c7f['removeMarker'](_0x3f374e);},_0x19e54b=(_0x65095a,_0x3d8f4c,_0x1a1ac2)=>{const _0x2481fb=_0x3d8f4c['model'];for(let _0x14fb19=0x0;_0x14fb19<_0x1a1ac2['ranges']['length'];_0x14fb19++){let _0x3e8c72=_0x1a1ac2['ranges'][_0x14fb19];const _0x13eec9=Rs+':'+_0x1a1ac2['id']+':'+_0x14fb19;if(_0x3e8c72['start']['isAtEnd']){const _0x52d87e=_0x3e8c72['start']['getLastMatchingPosition'](({item:_0x4aa150})=>!_0x2481fb['schema']['isContent'](_0x4aa150),{'boundaries':_0x3e8c72});_0x3e8c72=_0x65095a['createRange'](_0x52d87e,_0x3e8c72['end']);}_0x65095a['addMarker'](_0x13eec9,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3e8c72});}};_0x475abb&&_0xfdff1f&&_0x475abb===_0xfdff1f&&_0x5cc52a?_0x475abb['model']['change'](_0x35fdc0=>{_0x5828dc(_0x35fdc0,_0x475abb),_0x19e54b(_0x35fdc0,_0xfdff1f,_0x5cc52a);}):(_0x475abb&&_0x475abb['model']['change'](_0x51de0d=>_0x5828dc(_0x51de0d,_0x475abb)),_0xfdff1f&&_0x5cc52a&&_0xfdff1f['model']['change'](_0x37f14d=>_0x19e54b(_0x37f14d,_0xfdff1f,_0x5cc52a)));}['_getMarkersInDocumentOrder'](_0x24a1e1,_0x4228c0){const _0x3d0b8b=Array['from'](_0x24a1e1['model']['markers']['getMarkersGroup'](Rs+':context'));return(_0x4228c0?_0x3d0b8b['filter'](_0x23d40f=>{const _0x151357=_0x23d40f['getRange']();return _0x151357&&_0x151357['root']['rootName']===_0x4228c0['rootName'];}):_0x3d0b8b)['sort']((_0x5b2658,_0x15bfa8)=>_0x5b2658['getStart']()['isBefore'](_0x15bfa8['getStart']())?-0x1:_0x5b2658['getStart']()['isAfter'](_0x15bfa8['getStart']())?0x1:0x0);}}const Ss=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Os=[...Ss,'startConversation','sendUserMessage','promptInputPaste','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function vs(_0xa53c85){const _0x5da6ce=new AbortController();return{'promise':new Promise((_0x5bacaf,_0x51d526)=>{const _0x54d223=setTimeout(_0x5bacaf,_0xa53c85);_0x5da6ce['signal']['addEventListener']('abort',()=>{clearTimeout(_0x54d223),_0x51d526();});}),'abortController':_0x5da6ce};}class HTMLStreamer{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x25dea1){this['options']={'delay':_0x25dea1?.['delay']??0xa,'textNodeStyle':_0x25dea1?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x188a7c,targetElement:_0x545bcc,abortSignal:_0x211285}){this['isStreaming']&&this['stop'](),_0x211285?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x4269c1(_0x188a7c,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x3e541a=0x0;_0x3e541a<this['currentIndex'];_0x3e541a++)this['nodesList'][_0x3e541a]['shouldBeStreamed']=!0x0;do{const _0x3f51f7=Date['now'](),_0x4633db=this['nodesList'][this['currentIndex']],_0x530a5e=_0x3f51f7-this['lastUpdateTime'];if(_0x4633db){_0x4633db['shouldBeStreamed']=!0x0;let _0x5a8169=_0x4633db['parent'];for(;_0x5a8169;)_0x5a8169['shouldBeStreamed']=!0x0,_0x5a8169=_0x5a8169['parent'];}if(_0x530a5e<this['options']['delay'])try{const {promise:_0x43d67f,abortController:_0x298545}=vs(this['options']['delay']-_0x530a5e);this['timeoutAbortController']=_0x298545,await _0x43d67f;}catch(_0x495968){return;}_0x1e976c(_0x545bcc,'<'+_0x545bcc['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x545bcc['tagName']+'>',{'childrenOnly':!0x0}),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x1abaea}){Array['from'](_0x1abaea['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x4737f8=>{_0x4737f8['replaceWith'](_0x4737f8['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x426e53){let _0x37dacc='';if(function(_0x24805b){return _0x26ea3d(_0x24805b);}(_0x426e53)){for(const _0x462e99 of _0x426e53['children'])_0x37dacc+=this['renderNode'](_0x462e99);}else{if(Ns(_0x426e53)){if(!_0x426e53['shouldBeStreamed'])return'';const _0x5b3c75=_0x426e53,_0x537f93=Object['entries'](_0x5b3c75['attribs'])['map'](([_0x3fa83f,_0x431835])=>_0x3fa83f+'=\x22'+_0x431835+'\x22')['join']('\x20');_0x37dacc+='<'+_0x5b3c75['tagName']+(_0x537f93?'\x20'+_0x537f93:'')+'>';for(const _0x2d5d9e of _0x5a18a3(_0x5b3c75))_0x37dacc+=this['renderNode'](_0x2d5d9e);_0x37dacc+='</'+_0x5b3c75['tagName']+'>';}else{if(!ys(_0x426e53))return'';if(!_0x426e53['shouldBeStreamed'])return'';!function(_0x4fac7e){if(!_0x4fac7e['parent']||!Ns(_0x4fac7e['parent']))return!0x1;if(!ks['includes'](_0x4fac7e['parent']['tagName']))return!0x1;return!ti(_0x4fac7e)['match'](/^\s*[<>]\s*$/);}(_0x426e53)?_0x37dacc+=_0x771648(_0x426e53):_0x37dacc+=_0x771648(new _0x50156a('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x426e53]));}}return _0x37dacc;}['getParsedDocumentNodeList'](){const _0x378580=[];return function(_0x31a309,_0x436e59){const _0x1b8588=_0x1d8a2b=>{if(_0x436e59(_0x1d8a2b),_0x1d8a2b instanceof _0x52878d)for(let _0x52624e=0x0;_0x52624e<_0x1d8a2b['children']['length'];_0x52624e++){const _0x5038c8=_0x1d8a2b['children'][_0x52624e];_0x1b8588(_0x5038c8);}};for(let _0x8e203b=0x0;_0x8e203b<_0x31a309['children']['length'];_0x8e203b++)_0x1b8588(_0x31a309['children'][_0x8e203b]);}(this['document'],_0x52163b=>{if(ys(_0x52163b)){const _0x152221=this['splitTextNodeIntoWordNodes'](_0x52163b);_0x152221['length']&&_0x378580['push'](..._0x152221);}_0x52163b['isWordSplitSource']||_0x52163b['isWordSplitResult']||_0x378580['push'](_0x52163b);}),_0x378580;}['splitTextNodeIntoWordNodes'](_0x12187d){if(_0x12187d['isWordSplitSource']||_0x12187d['isWordSplitResult'])return[];const _0x92887=ti(_0x12187d)['match'](/(?:\s*\S+\s*)/g),_0xbf88f8=[];if(_0x92887&&_0x92887['length']>0x1){for(const _0x596192 of _0x92887){const _0x45579c=new _0x6d9ab(_0x596192);_0x45579c['isWordSplitResult']=!0x0,_0x45243d(_0x12187d,_0x45579c),_0xbf88f8['push'](_0x45579c);}_0x12187d['isWordSplitSource']=!0x0,_0x5ca789(_0x12187d);}return _0xbf88f8;}}const ks=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ys(_0x2db203){return _0x4c1c37(_0x2db203);}function Ns(_0x289c17){return _0x2d72d5(_0x289c17);}class AIChatFeedItemView extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x28c889){super();const _0x242ac0=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new HTMLStreamer(),this['options']=_0x28c889,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x242ac0['if']('isDone','ck-ai-chat__feed__item_done'),_0x242ac0['if']('isVisible','ck-hidden',_0x2366fe=>!_0x2366fe),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){this['htmlStreamer']['cleanUpAnimations']({'targetElement':this['element']}),this['element']['querySelectorAll']('[data-id]')['forEach'](_0x1f5097=>{_0x1f5097['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x353820,_0x338f87,_0x3f96bf){await this['htmlStreamer']['stream']({'document':_0x353820,'targetElement':_0x338f87,'abortSignal':_0x3f96bf});}}class AISuggestionHeaderView extends Nt{['showChangesToggleView'];constructor(_0x29656c,_0x1e7025){super(_0x29656c),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ShowChangesToggleView(_0x29656c),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+Gi,'label':Mi(_0x29656c,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1e7025['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x1ff45b=>_0x1ff45b?_0x42017b:_0x43a129),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x411531=new Lt();_0x411531['content']=_0x5e66bf,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1e7025['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x411531,{'tag':'span','children':[Mi(_0x29656c,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ShowChangesToggleView extends yt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const xs={'accepted':_0x409f7a,'rejected':_0x467d7e,'outdated':_0x467d7e};class AISuggestionContentPartStateView extends Nt{['stateIconView'];constructor(_0x1ad933){super(_0x1ad933);const _0x51a86a=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new StateIconView(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x51a86a['to']('state',_0x35203e=>'ck-ai-suggestion__content-part-state_'+_0x35203e),_0x51a86a['if']('isVisible','ck-hidden',_0x5996d4=>!_0x5996d4)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x51a86a['to']('state',_0x57f86b=>{switch(_0x57f86b){case'accepted':return Mi(_0x1ad933,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return Mi(_0x1ad933,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return Mi(_0x1ad933,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x1c1c7b){this['state']=_0x1c1c7b;}}class StateIconView extends Lt{constructor(){super(),this['set']('state','accepted'),this['content']=xs[this['state']],this['on']('change:state',()=>{this['content']=xs[this['state']];});}}class AISuggestionContentPartToolbarView extends kt{['_applyButton'];['_suggestButton'];constructor(_0x423ebd,_0x127686,_0x451512){super(_0x423ebd);const _0x25f828=Boolean(_0x451512);this['set']('isEnabled',!_0x25f828),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x4bb922=[];if(_0x25f828){const _0x27ca84=new yt(_0x423ebd);_0x27ca84['set']({'label':Mi(_0x423ebd,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4e4581}),_0x27ca84['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x4bb922['push'](_0x27ca84);}else{_0x127686['includes']('applySuggestion')&&(this['_applyButton']=new yt(_0x423ebd),this['_applyButton']['set']({'label':Mi(_0x423ebd,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x409f7a}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['bind']('isVisible')['to'](this,'isTrackChangesOn',_0xf7047f=>!_0xf7047f),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x4bb922['push'](this['_applyButton'])),_0x127686['includes']('insertSuggestion')&&(this['_suggestButton']=new yt(_0x423ebd),this['_suggestButton']['set']({'label':Mi(_0x423ebd,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3ba364}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x4bb922['push'](this['_suggestButton']));const _0x4948cc=new yt(_0x423ebd);_0x4948cc['set']({'label':Mi(_0x423ebd,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x467d7e}),_0x4948cc['bind']('isEnabled')['to'](this),_0x4948cc['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x4bb922['push'](_0x4948cc);}this['items']['addMany'](_0x4bb922);const _0x37c1ef=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x37c1ef['if']('isVisible','ck-hidden',_0x55c88d=>!_0x55c88d)]}});}['setButtonsVisibility']({showApplyButton:_0x1391c2,showSuggestButton:_0x4f3866}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x1391c2),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x4f3866);}}class AISuggestionContentPartHeaderView extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x48133b,{part:_0x5f878c,uiIndex:_0x5f5a66,availableActions:_0x327802,areActionsDisabled:_0x468466}){super(_0x48133b),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['set']('isTrackChangesOn',!0x1),this['toolbarView']=new AISuggestionContentPartToolbarView(_0x48133b,_0x327802,_0x468466),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x5f878c['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x5f878c['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x5f878c['index']});}),this['toolbarView']['bind']('isEnabled','isTrackChangesOn')['to'](this),this['stateView']=new AISuggestionContentPartStateView(_0x48133b),this['titleLabelView']=new AISuggestionBodyContentPartTitleLabelView(_0x48133b,_0x5f5a66),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x3f8d81,_0x293688,_0x2a97f2,_0x5cc70b)=>{'pending'===_0x5cc70b?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x2a97f2?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x2a97f2),this['children']['add'](this['stateView']));});}}class AISuggestionBodyContentPartTitleLabelView extends Nt{constructor(_0x376f3e,_0x550a22){super(_0x376f3e),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Mi(_0x376f3e,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x550a22['toString']())]});}}class AISuggestionStreamableContentView extends Nt{['htmlStreamer'];constructor(_0x546c24){super(_0x546c24),this['htmlStreamer']=new HTMLStreamer(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x3b02d5,renderingStrategy:_0x3ca1c9,abortSignal:_0x10d759}){const _0x155cb0=_0x4269c1(_0x3b02d5['content'],!0x0);for(const _0xab2188 of qi(_0x155cb0))_0x5ca789(_0xab2188);'streaming'===_0x3ca1c9?await this['htmlStreamer']['stream']({'document':_0x155cb0,'targetElement':this['element'],'abortSignal':_0x10d759}):_0x1e976c(this['element'],'<'+this['element']['tagName']+'>'+Ki(_0x155cb0)+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='',this['element']['scrollTop']=0x0;}}class AISuggestionBodyViewContentPartView extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x24fd78,{part:_0x119b56,uiIndex:_0x307226,areActionsDisabled:_0x45a1eb,availableActions:_0x11f162}){super(_0x24fd78);const _0x55d571=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1),this['set']('isTrackChangesOn',!0x1);const _0xca44d8=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x45a1eb;};this['on']('change:state',_0xca44d8),this['on']('change:isDone',_0xca44d8),_0xca44d8(),this['_children']=this['createCollection'](),this['_headerView']=new AISuggestionContentPartHeaderView(_0x24fd78,{'part':_0x119b56,'uiIndex':_0x307226,'availableActions':_0x11f162,'areActionsDisabled':_0x45a1eb}),this['_headerView']['bind']('isEnabled','state','isTrackChangesOn')['to'](this),this['_headerView']['delegate'](...Ss)['to'](this),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x24fd78),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x55d571['to']('state',_0x1160f4=>'ck-ai-suggestion__body__content-part_'+_0x1160f4),_0x55d571['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x55d571['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x55d571['if']('isVisible','ck-hidden',_0x18d94f=>!_0x18d94f)]},'children':this['_children'],'on':{'mouseenter':_0x55d571['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x119b56['index']});}),'mouseleave':_0x55d571['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x119b56['index']});}),'click':_0x55d571['to'](_0x4950be=>{const _0x4110e9=_0x4950be['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x4110e9)&&this['fire']('showChangeInText',{'index':_0x119b56['index']});})}});}async['updateContent']({part:_0x13bdaf,showUnchangedParts:_0x20fc4d=!0x1,abortSignal:_0x4f040b}){this['partDefinition']=_0x13bdaf,this['isVisible']=this['partDefinition']['hasChanges']||_0x20fc4d,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x13bdaf,'renderingStrategy':'static','abortSignal':_0x4f040b});}['markAsDone'](){this['isDone']=!0x0;}}class AISkeletonView extends Nt{constructor(_0x1e40e3,_0x142180){super(_0x1e40e3),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0xbc7021=>!_0xbc7021)]},'children':this['_createSkeletonItems'](_0x142180)});}['_createSkeletonItems'](_0x18a98e){const _0x29b1b1=['ck','ck-ai-skeleton__item'];return _0x18a98e['map'](_0x2cea27=>{let _0x46e317='';switch(_0x2cea27['attributes']['align']){case'right':_0x46e317='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x46e317='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x46e317='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x2cea27['tag'],'attributes':{'class':[..._0x29b1b1,_0x2cea27['attributes']['class']?_0x2cea27['attributes']['class']:''],'style':'width:\x20'+_0x2cea27['attributes']['width']+';\x20height:\x20'+_0x2cea27['attributes']['height']+';'+_0x46e317}};});}}const Ls={'aiSuggestionBody':[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}}],'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':Ps(0x5,'100%','44px','right'),'aiChatResources':Ps(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function Ps(_0x20830f,_0x9c0f25,_0x5b54e6,_0x281bd8){return new Array(_0x20830f)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x9c0f25,'height':_0x5b54e6,'align':_0x281bd8}}));}class PromiseQueue extends Et(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x524d88){const _0x5e8155=this['createTask'](_0x524d88);return this['queue']['push'](_0x5e8155),this['_processQueue'](),_0x5e8155['completePromise'];}['abort'](){this['isProcessing']&&(this['_abortController']['abort'](),this['_abortController']=void 0x0,this['queue']=[],this['fire']('_queueEmpty'),this['isProcessing']=!0x1);}get['queueEmptyPromise'](){return this['queue']['length']||this['isProcessing']?new Promise(_0xfc15f6=>{this['once']('_queueEmpty',()=>{_0xfc15f6();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x4efd7a=this['queue']['shift']();try{await _0x4efd7a['callback'](this['_abortController']['signal']),_0x4efd7a['resolve']();}catch(_0x386dfc){_0x4efd7a['reject'](_0x386dfc);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x3dba1d){let _0x2967e0,_0x314b40;const _0x70e47=new Promise((_0x336c39,_0x53ff4b)=>{_0x2967e0=_0x336c39,_0x314b40=_0x53ff4b;});return{'callback':_0x3dba1d,'resolve':_0x2967e0,'reject':_0x314b40,'completePromise':_0x70e47};}}class AIChatFeedErrorItemView extends AIChatFeedItemView{constructor(_0x2780e6){super(_0x2780e6),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x2780e6['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x22c6f7){this['element']['innerHTML']=_0x22c6f7;}}const Ds=['applySuggestion','insertSuggestion'];class AIChatFeedSuggestionItemActionsView extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x7f851c,_0x47de3b=[...Ds],_0x134303){super(_0x7f851c);const _0x573788=this['bindTemplate'],_0x507a35=Boolean(_0x134303);if(this['set']('isEnabled',!_0x507a35),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x507a35){const _0x4910a2=new yt(_0x7f851c);_0x4910a2['set']({'label':Mi(_0x7f851c,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4e4581}),_0x4910a2['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x2f0152=new Nt(_0x7f851c);_0x2f0152['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[Mi(_0x7f851c,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x4910a2]}]}),this['children']['add'](_0x2f0152);}else this['_applyChangesButton']=new yt(_0x7f851c),this['_applyChangesButton']['set']({'label':Mi(_0x7f851c,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x47de3b['includes']('applySuggestion'),'class':Ui}),this['_insertSuggestionsButton']=new yt(_0x7f851c),this['_insertSuggestionsButton']['set']({'label':Mi(_0x7f851c,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x47de3b['includes']('insertSuggestion'),'class':Bi}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x518af1=>{_0x518af1['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x573788['if']('isVisible','ck-hidden',_0x2ee5f0=>!_0x2ee5f0)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x4c98d4){this['isVisible']=_0x4c98d4;}['_switchButtonLabelsPlurality'](_0x391a0d){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x391a0d?(this['_applyChangesButton']['label']=Mi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=Mi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=Mi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=Mi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class AIWebSourcesView extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x53417e,_0x1f52fc){super(_0x53417e),this['bodyCollection']=_0x1f52fc,this['children']=this['createCollection'](),this['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources',this['bindTemplate']['if']('isVisible','ck-hidden',_0x2b8154=>!_0x2b8154)]},'children':this['children']});const _0x4f577d=new Nt(this['locale']),_0x30a0ec=new Lt();_0x30a0ec['content']=_0x4c80e3,_0x4f577d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x30a0ec,{'tag':'span','children':[{'text':Mi(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x4f577d),this['_setupBalloonPanel'](_0x53417e);}['addSource'](_0xb03f72){this['children']['add'](new AIWebSourceView(this['locale'],_0xb03f72,this['balloonPanelView']));}['_setupBalloonPanel'](_0x4d2f4a){this['balloonPanelView']=new zt(_0x4d2f4a),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class AIWebSourceView extends yt{['balloonPanelView'];['source'];constructor(_0x277019,_0x230191,_0x111b22){super(_0x277019),this['source']=_0x230191,this['balloonPanelView']=_0x111b22,this['set']({'label':_0x230191['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x52f7c7=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x52f7c7['to'](()=>{window['open'](_0x230191['url'],'_blank');}),'mouseenter':_0x52f7c7['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x52f7c7['to'](()=>{this['_hideTooltip']();})}}),_0x230191['favicon']){const _0x3386c1=new Nt(_0x277019);_0x3386c1['setTemplate']({'tag':'img','attributes':{'src':_0x230191['favicon']||_0x4c80e3,'alt':_0x230191['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x3386c1);}else this['set']('icon',_0x4c80e3);}['_createTooltipContentView'](_0x49366e,_0x33129a){const _0x45f529=new Nt(_0x49366e),_0x34e1d9=[];let _0x1a8f98;_0x33129a?.['favicon']?(_0x1a8f98=new Nt(_0x49366e),_0x1a8f98['setTemplate']({'tag':'img','attributes':{'src':_0x33129a['favicon'],'alt':_0x33129a['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x1a8f98=new Lt(),_0x1a8f98['content']=_0x4c80e3,_0x1a8f98['extendTemplate']({'attributes':{'alt':_0x33129a['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x34e1d9['push'](_0x1a8f98);const _0x16c131=new Nt(_0x49366e);_0x16c131['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x33129a['url']},'children':[{'text':new URL(_0x33129a['url'])?.['hostname']}]}),_0x34e1d9['push'](_0x16c131);const _0x140f59=new Nt(_0x49366e);_0x140f59['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x34e1d9});const _0xf97432=new Nt(_0x49366e);return _0xf97432['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x33129a['title']['length']>0x190?_0x33129a['title']['substring'](0x0,0x190)+'...':_0x33129a['title']}]}),_0x45f529['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x140f59,_0xf97432]}),_0x45f529;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[zt['defaultPositions']['northArrowSouth'],zt['defaultPositions']['northArrowSouthWest'],zt['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0xe2ae14=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0xe2ae14);}}class AISuggestionBodyView extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x432e5f(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x388127,_0x7dc223){super(_0x388127);const {areActionsDisabled:_0x3a9bd1,showUnchangedParts:_0x5ecf6b,availableActions:_0xffd09}=_0x7dc223;this['_areActionsDisabled']=_0x3a9bd1,this['_showUnchangedParts']=_0x5ecf6b,this['_availableActions']=_0xffd09,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new AISkeletonView(_0x388127,Ls['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new PromiseQueue(),this['_emptyPartsWarningView']=new AIChatFeedErrorItemView({'id':'empty-parts-warning','initialContent':Mi(_0x388127,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new AIChatFeedSuggestionItemActionsView(_0x388127,_0x7dc223['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new AIWebSourcesView(this['locale'],_0x7dc223['bodyCollection']),_0x7dc223['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Ss)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}['destroy'](){this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),super['destroy']();}get['partsCount'](){return this['_contentPartViews']['length'];}get['_contentPartViews'](){return Array['from'](this['_children'])['filter'](_0x4f8f55=>_0x4f8f55 instanceof AISuggestionBodyViewContentPartView);}async['updateContentParts']({parts:_0x5d7753,abortSignal:_0x220613,skipLoadingEffects:_0x530f10}){this['_cachedContentParts']['length']?_0x5d7753['forEach'](_0x43e880=>{const _0x5cfabe=this['_cachedContentParts']['findIndex'](_0x58db5c=>_0x58db5c['index']==_0x43e880['index']);-0x1===_0x5cfabe?this['_cachedContentParts']['push'](_0x43e880):this['_cachedContentParts'][_0x5cfabe]=_0x43e880;}):this['_cachedContentParts']=_0x5d7753;const _0x629caf=this['_showUnchangedParts']?_0x5d7753:_0x5d7753['filter'](_0x48352a=>_0x48352a['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x629caf['length']>0x1),_0x530f10&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x487c60 of _0x629caf)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x5ca8ac=>{let _0x1d5733=this['getPartView'](_0x487c60['index']);if(!_0x1d5733){if(_0x1d5733=new AISuggestionBodyViewContentPartView(this['locale'],{'part':_0x487c60,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x1d5733['delegate'](...Ss)['to'](this),_0x1d5733['bind']('isTrackChangesOn')['to'](this),!_0x530f10&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x5ca8ac),_0x5ca8ac['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x1d5733,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x530f10||this['_showSkeletonDebounced']();}await _0x1d5733['updateContent']({'part':_0x487c60,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x5ca8ac}),_0x1d5733['markAsDone']();});return _0x220613?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x18f581,_0x480601){const _0x1e0e09=this['getPartView'](_0x18f581);_0x1e0e09&&(_0x1e0e09['state']=_0x480601),this['hasPendingParts']='pending'==_0x480601||this['_contentPartViews']['some'](_0x3144d6=>'pending'==_0x3144d6['state']);}['setPartActive'](_0x203710,_0x4d36e1){if(!0x1===_0x203710){for(const _0x1c6557 of this['_contentPartViews'])_0x1c6557['isActive']=!0x1;}else{const _0x2fdf0a=this['getPartView'](_0x203710);_0x2fdf0a&&(_0x2fdf0a['isActive']=_0x4d36e1);}}['updateSources'](_0x2b4881){_0x2b4881['forEach'](_0x2c9997=>this['_sourcesView']['addSource'](_0x2c9997)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x1b3e64){return this['_contentPartViews']['find'](_0x1efced=>_0x1efced['partDefinition']['index']==_0x1b3e64)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0xf89534=!this['_cachedContentParts']['find'](({hasChanges:_0x6ddc8e})=>_0x6ddc8e),_0x491def=!!this['_cachedContentParts']['find'](({hasChanges:_0x54d366})=>!_0x54d366);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x491def,_0xf89534?this['_emptyPartsWarningView']['setContent'](Mi(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Mi(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x2a5800=>_0x2a5800['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x463e31){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x5f5ccb=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x5f5ccb>0x0){const {promise:_0x1f98ae,abortController:_0x39857c}=vs(_0x5f5ccb);_0x463e31?.['addEventListener']('abort',()=>_0x39857c['abort']()),await _0x1f98ae['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x4e634a=>_0x4e634a['partDefinition']['hasChanges'])['length']>0x0;}}class AISuggestionContainerView extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x3ab89b,_0x453cea,_0x109c05){super(_0x3ab89b);const {showDiff:_0x3bd008,areActionsDisabled:_0x3dbb71,showUnchangedParts:_0x5edb8b,availableActions:_0x13cf3b}=_0x453cea;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new AISuggestionHeaderView(_0x3ab89b,{'showDiff':_0x3bd008}),this['headerView']['on']('toggleShowChanges',(_0x2ac182,_0x1bd12a)=>{this['areChangesVisible']=_0x1bd12a['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1bd12a['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new AISuggestionBodyView(_0x3ab89b,{'areActionsDisabled':_0x3dbb71,'showUnchangedParts':!!_0x5edb8b,'availableActions':_0x13cf3b,'bodyCollection':_0x109c05}),this['bodyView']['delegate'](...Ss)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x194b81){await this['bodyView']['updateContentParts'](_0x194b81);}['updateSources'](_0x1360e2){this['bodyView']['updateSources'](_0x1360e2);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class AIChatFeedSuggestionItemView extends AIChatFeedItemView{['containerView'];constructor(_0x2a6d31,_0x211511,_0x2e01be){super(_0x211511),this['set']('isTrackChangesOn',!0x1),this['containerView']=new AISuggestionContainerView(_0x2a6d31,{'showDiff':_0x211511['showDiff'],'areActionsDisabled':_0x211511['areActionsDisabled'],'availableActions':_0x211511['availableActions']},_0x2e01be),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x914d76,_0x14f4d0)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x14f4d0['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0xf9f1ce,{index:_0x2a50fc})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x2a50fc});}),this['containerView']['on']('applySuggestion',(_0x521086,{index:_0x28907a}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x28907a});}),this['containerView']['on']('insertSuggestion',(_0x53402f,{index:_0x30508c}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x30508c});}),this['containerView']['on']('rejectSuggestion',(_0xc4650b,{index:_0x56048a})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x56048a});}),this['containerView']['on']('mouseOverSuggestion',(_0x2b2e71,{index:_0x3382c7})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3382c7});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x1d662c,{index:_0x7bcde8})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x7bcde8});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x5a8609){await this['containerView']['updateContent'](_0x5a8609);}['updatePartState'](_0x3b1f6d,_0x38c4a3){this['containerView']['bodyView']['updatePartState'](_0x3b1f6d,_0x38c4a3);}['setPartActive'](_0x34c4af,_0xf23ca){!0x1===_0x34c4af?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x34c4af,_0xf23ca);}['updateSources'](_0x1533e6){this['containerView']['updateSources'](_0x1533e6);}['getPartView'](_0xdf011d){return this['containerView']['bodyView']['getPartView'](_0xdf011d);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class AIChatFeedReplyItemView extends AIChatFeedItemView{['replyContainer'];['_bodyCollection'];constructor(_0x1c9f79,_0x37b86f,_0x17f182){super(_0x37b86f),this['_bodyCollection']=_0x17f182,this['locale']=_0x1c9f79,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container','ck-ai-chat-content']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Wi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x21b6b0,renderingStrategy:_0x5d0ba3,abortSignal:_0x41d2bd}){'streaming'===_0x5d0ba3?await this['streamIntoElement'](_0x21b6b0,this['replyContainer']['element'],_0x41d2bd):this['replyContainer']['element']['innerHTML']=_0x771648(_0x21b6b0);}['updateSources'](_0x23fbd8){const _0x2899f2=new AIWebSourcesView(this['locale'],this['_bodyCollection']);_0x2899f2['children']['addMany'](_0x23fbd8['map'](_0x4ec603=>new AIWebSourceView(this['locale'],_0x4ec603,_0x2899f2['balloonPanelView']))),_0x2899f2['isVisible']=!0x0,this['children']['add'](_0x2899f2);}}class AISpinnerView extends xt{constructor(_0x1f7ca5=void 0x0){super();const _0x52fb83=_0x1f7ca5?'ck-ai-spinner_'+_0x1f7ca5:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x52fb83]}});}}const Vs={'file':_0x1f08c5,'image':_0x1abdb8,'document':_0x5e66bf,'web-resource':_0x5f5a21,'text':_0x1f08c5,'selection':_0x4093e5,'mcp-tool-context':_0x5e66bf},Hs='ck-ai-chat-context-chip',Ms='ck-ai-chat-context-chip_wide',Us='ck-ai-chat-context-chip_document',Bs='ck-ai-chat-context-chip__label',Gs='ck-ai-chat-context-chip__type-icon',Fs='ck-ai-chat-context-controls__chip-tooltip',Ws='n';class AIChatContextItemButtonView extends yt{constructor(_0x1833dd,_0x4ef48b,_0x1eabc9,_0x218f0d,_0xc98319=!0x1){super(_0x1833dd),this['_isAnimationOnEnterEnabled']=_0x218f0d,this['_initializeProperties'](_0x4ef48b,_0x1eabc9,_0xc98319),this['_setupTemplate']();}['render'](){super['render'](),this['_isAnimationOnEnterEnabled']&&this['element']&&(this['element']['classList']['add']('ck-ai-chat-context-chip_new-chip'),this['_handleAnimationEndOnce'](this['element'],()=>{this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}));}['disableAnimationOnEnter'](){this['_isAnimationOnEnterEnabled']=!0x1,this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}['_initializeProperties'](_0x50205e,_0xc978c,_0x4c5d69){this['set']('label',_0x50205e['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x50205e['type']),this['set']('id',_0x50205e['uiId']),this['set']('readonly',_0xc978c),this['set']('isLoading',_0x4c5d69);}['_setupTemplate'](){const _0x1956cf=this['_createIconView'](),_0x47b7d1=this['_createRemoveButton'](),_0x5a0d62=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x5a0d62),'children':this['_createTemplateChildren'](_0x1956cf,_0x47b7d1,_0x5a0d62)});}['_createTemplateAttributes'](_0x5d58a7){return{'class':[Hs,_0x5d58a7['if']('itemType',Us,_0x42eda2=>'document'==_0x42eda2),_0x5d58a7['if']('itemType',Ms,_0x320db6=>'selection'==_0x320db6)],'data-cke-tooltip-text':_0x5d58a7['to']('label',Ks),'data-cke-tooltip-position':Ws,'data-cke-tooltip-class':Fs};}['_createTemplateChildren'](_0x4cb32b,_0x33b982,_0x3c8118){const _0x2f5873=this['_createLabelElement'](_0x3c8118),_0x5db46f=this['_createLoaderIcon']();return this['readonly']?[_0x4cb32b,_0x2f5873]:[_0x4cb32b,_0x5db46f,_0x2f5873,_0x33b982];}['_createLabelElement'](_0x4b9a2b){return{'tag':'span','attributes':{'class':Bs},'children':[{'text':_0x4b9a2b['to']('label')}]};}['_createRemoveButton'](){const _0x2ea2b8=new yt(this['locale']);return _0x2ea2b8['set']({'label':Mi(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x45e38d}),this['_setupRemoveButtonEvent'](_0x2ea2b8),_0x2ea2b8;}['_setupRemoveButtonEvent'](_0x2ce946){_0x2ce946['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x201c04=this['bindTemplate'],_0xf1e9c=new Lt();return _0xf1e9c['content']=Vs[this['itemType']],_0xf1e9c['extendTemplate']({'attributes':{'class':[Gs,_0x201c04['if']('isLoading','ck-hidden',_0x5b7121=>_0x5b7121)]}}),_0xf1e9c;}['_handleAnimationEndOnce'](_0x558686,_0x5cac5c){if(!_0x558686)return;const _0x3d2a17=()=>{_0x5cac5c(),_0x558686['removeEventListener']('animationend',_0x3d2a17),_0x558686['removeEventListener']('webkitAnimationEnd',_0x3d2a17);};_0x558686['addEventListener']('animationend',_0x3d2a17),_0x558686['addEventListener']('webkitAnimationEnd',_0x3d2a17);}['_createLoaderIcon'](){const _0x20500d=new AISpinnerView('small');return _0x20500d['bind']('isVisible')['to'](this,'isLoading',_0x1a5519=>_0x1a5519),_0x20500d;}}function Ks(_0x169ecb){if(!_0x169ecb)return _0x169ecb;if(_0x169ecb['length']<=0x78)return _0x169ecb;const _0x524360=_0x169ecb['slice'](0x0,0x78),_0x404d76=_0x524360['lastIndexOf']('\x20');return(_0x404d76>0x0?_0x524360['slice'](0x0,_0x404d76):_0x524360)+'…';}const Ys={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},$s='300px';class AIChatChipsOverflowManager{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x37cae7,_0x4bed79,_0x377829,_0x2fd082,_0xfa71b){this['_locale']=_0x37cae7,this['_visibleChips']=_0x4bed79,this['_config']={...Ys,..._0x377829,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x377829['cssClasses']}},this['_overflowChips']=new _t(),this['_bodyCollection']=_0x2fd082,this['_parentView']=_0xfa71b||null;}['setContainerElement'](_0x31973d){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x31973d,this['_setupVisibilityObserver']();}get['showMoreButtonView'](){return this['_showMoreButtonView'];}get['overflowChips'](){return this['_overflowChips'];}['reorganizeChips'](){requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});}['showBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_updateBalloonContent'](),this['_showMoreButtonView']['isOn']=!0x0,this['_showMoreBalloonPanelView']['show'](),this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')}));}['hideBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_showMoreButtonView']['isOn']=!0x1,this['_showMoreBalloonPanelView']['hide']());}['clear'](){this['_overflowChips']['clear'](),this['hideBalloonPanel'](),this['_updateShowMoreButtonVisibility'](),this['_showMoreButtonView']&&(this['_showMoreButtonView']['label']=''),this['_showMoreBalloonPanelView']&&this['_showMoreBalloonPanelView']['content']['clear']();}['destroy'](){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_showMoreButtonView']&&(this['_showMoreButtonView']['destroy'](),this['_showMoreButtonView']=null),this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['destroy'](),this['_showMoreBalloonPanelView']=null);}['_checkAndHandleOverflow'](){if(!this['_containerElement'])return;if(!this['_isContainerVisible']())return void(this['_pendingCalculation']=!0x0);this['_pendingCalculation']=!0x1;const _0x573398=[...this['_visibleChips'],...this['_overflowChips']],_0x49cc7c=this['_createCalculationContainer'](),_0x2c1930=this['_calculateOverflowInContainer'](_0x49cc7c,_0x573398),_0x69b39=_0x49cc7c['_ancestorsToRestore'];_0x69b39&&this['_restoreAncestorVisibility'](_0x69b39),_0x49cc7c['remove'](),this['_applyOverflowResults'](_0x573398,_0x2c1930);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),jt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x2a97e0=new yt(this['_locale']);_0x2a97e0['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x30bec5=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x30bec5['push'](this['_config']['cssClasses']['controlsButton']),_0x2a97e0['extendTemplate']({'attributes':{'class':_0x30bec5}}),_0x2a97e0;}['_createShowMoreBalloonPanelView'](){const _0x51e63b=new zt(this['_locale']);return _0x51e63b['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x51e63b),_0x51e63b;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x2532f4=>{_0x2532f4['disableAnimationOnEnter']();});const _0x462035=new Nt(this['_locale']);_0x462035['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x462035);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x1d10f0=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x1d10f0?'':'none');}['_repinBalloonPanel'](){this['_showMoreButtonView']?.['isOn']&&this['_showMoreBalloonPanelView']?.['isVisible']&&this['_showMoreButtonView']['element']&&this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')});}['_findTargetContainer'](_0x51b5ae){const _0x48b885=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x171ab7=this['_containerElement']?.['classList'];if(_0x171ab7){const _0x1327e5=_0x171ab7[0x0]||'',_0x18f60b=_0x51b5ae['querySelector']('.'+_0x1327e5),_0x2be67d=_0x51b5ae['querySelector'](_0x48b885);return _0x18f60b||_0x2be67d||_0x51b5ae;}return _0x51b5ae['querySelector'](_0x48b885)||_0x51b5ae;}['_calculateContainerWidth'](){const _0x377733=this['_parentView']?.['element']||this['_containerElement'];if(!_0x377733)return $s;const _0x210abb=window['getComputedStyle'](_0x377733)['width'];if('auto'===_0x210abb||'0px'===_0x210abb||!_0x210abb){const _0x455976=_0x377733['parentElement'];if(_0x455976){const _0x42f832=window['getComputedStyle'](_0x455976);return'auto'!==_0x42f832['width']?_0x42f832['width']:$s;}return $s;}return _0x210abb;}['_applyCalculationStyles'](_0x3eab28,_0x19917f){this['_config']['cssClasses']['calculationContainer']&&_0x3eab28['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x3eab28['style']['width']=_0x19917f,_0x3eab28['style']['position']='absolute',_0x3eab28['style']['top']='-9999px',_0x3eab28['style']['left']='-9999px',_0x3eab28['style']['opacity']='0',_0x3eab28['style']['pointerEvents']='none',_0x3eab28['style']['zIndex']='-1',_0x3eab28['style']['visibility']='visible\x20!important',_0x3eab28['style']['display']='block\x20!important',_0x3eab28['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x38b25d){_0x38b25d['forEach'](({element:_0x453ba2,originalDisplay:_0x3f8c6f,originalVisibility:_0x37a110})=>{_0x453ba2['style']['display']=_0x3f8c6f,_0x453ba2['style']['visibility']=_0x37a110;});}['_makeAncestorsVisible'](_0x3bb1a2){const _0x1b9c46=[];let _0x487ea0=_0x3bb1a2;for(;_0x487ea0&&_0x487ea0!==document['body'];){const _0x1678a1=window['getComputedStyle'](_0x487ea0);'none'!==_0x1678a1['display']&&'hidden'!==_0x1678a1['visibility']||(_0x1b9c46['push']({'element':_0x487ea0,'originalDisplay':_0x487ea0['style']['display'],'originalVisibility':_0x487ea0['style']['visibility']}),_0x487ea0['style']['display']='block',_0x487ea0['style']['visibility']='visible'),_0x487ea0=_0x487ea0['parentElement'];}return _0x1b9c46;}['_createContainerElements'](){let _0x5a07a7,_0x453260;return this['_parentView']?.['element']?(_0x5a07a7=this['_parentView']['element']['cloneNode'](!0x0),_0x453260=this['_findTargetContainer'](_0x5a07a7)):(_0x5a07a7=document['createElement']('div'),_0x453260=_0x5a07a7),{'calculationContainer':_0x5a07a7,'targetContainer':_0x453260};}['_createCalculationContainer'](){const {calculationContainer:_0x31bda1,targetContainer:_0x183969}=this['_createContainerElements'](),_0x4cbe9b=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x31bda1,_0x4cbe9b);const _0x308062=this['_parentView']?.['element']||this['_containerElement'],_0x90a805=_0x308062?.['parentElement'];_0x90a805?_0x90a805['appendChild'](_0x31bda1):document['body']['appendChild'](_0x31bda1),_0x31bda1['_targetContainer']=_0x183969;const _0x5d632a=this['_makeAncestorsVisible'](_0x90a805||null);return _0x31bda1['offsetWidth'],_0x31bda1['_ancestorsToRestore']=_0x5d632a,_0x31bda1;}['_calculateOverflowInContainer'](_0x1515ef,_0x4046d9){const _0x12f7b8=_0x1515ef['_targetContainer']||_0x1515ef,_0x28c869=[],{rowCount:_0x27d1d1}=this['_renderChipsAndCountRows'](_0x12f7b8,_0x4046d9);if(_0x27d1d1<=this['_config']['maxVisibleRows'])return _0x28c869;const _0x3838d8=_0x4046d9['slice']();for(;_0x3838d8['length']>0x0;){if(this['_testButtonFit'](_0x1515ef,_0x12f7b8,_0x3838d8)){const _0x56ba22=_0x4046d9['filter'](_0x26405e=>!_0x3838d8['includes'](_0x26405e));_0x28c869['push'](..._0x56ba22);break;}if(!_0x3838d8['pop']())break;}return _0x28c869;}['_renderChipsAndCountRows'](_0x1908ce,_0x4406fa){_0x1908ce['innerHTML']='',_0x4406fa['forEach'](_0x40d47a=>{if(_0x40d47a['element']){const _0x12b9c2=_0x40d47a['element']['cloneNode'](!0x0);_0x1908ce['appendChild'](_0x12b9c2);}}),_0x1908ce['offsetWidth'];const _0x3302ba=_0x1908ce['children'],_0x5ead25=[];return Array['from'](_0x3302ba)['forEach'](_0x4c49e8=>{const _0x141052=_0x4c49e8['getBoundingClientRect']()['top'];_0x5ead25['some'](_0x5af6d7=>Math['abs'](_0x5af6d7-_0x141052)<this['_config']['rowDetectionTolerance'])||_0x5ead25['push'](_0x141052);}),{'rowCount':_0x5ead25['length']};}['_createMockButton'](){const _0x238928=document['createElement']('button');return _0x238928['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x238928['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x238928['textContent']='+\x201',_0x238928;}['_testButtonFit'](_0x208163,_0x1c27f5,_0x26ab1c){this['_renderChipsAndCountRows'](_0x1c27f5,_0x26ab1c);const _0x145cee=this['_createMockButton']();_0x208163['appendChild'](_0x145cee),_0x208163['offsetWidth'];const _0x51cce1=[..._0x1c27f5['children'],_0x145cee],_0x2edc9c=[];_0x51cce1['forEach'](_0x217752=>{const _0x37d8ac=_0x217752['getBoundingClientRect']()['top'];_0x2edc9c['some'](_0x32269b=>Math['abs'](_0x32269b-_0x37d8ac)<this['_config']['rowDetectionTolerance'])||_0x2edc9c['push'](_0x37d8ac);});const _0x975f12=_0x2edc9c['length'];return _0x145cee['remove'](),_0x975f12<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x44618e,_0x4a58c9){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x44618e['forEach'](_0x293c7e=>{_0x4a58c9['includes'](_0x293c7e)?this['_overflowChips']['add'](_0x293c7e):this['_visibleChips']['add'](_0x293c7e);});}['_updateOverflowUI'](_0x47eeef){if(_0x47eeef>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x47eeef>0x0&&this['_showMoreButtonView']){const _0x1b9010=''+this['_config']['showMoreLabelPrefix']+(_0x47eeef<0x63?_0x47eeef:'99');this['_showMoreButtonView']['label']=_0x1b9010;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x5c0448,_0x2ef31d){this['_distributeChips'](_0x5c0448,_0x2ef31d),this['_updateOverflowUI'](_0x2ef31d['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x338244=>{_0x338244[0x0]['isIntersecting']&&this['_pendingCalculation']&&requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});},{'threshold':0.01,'rootMargin':'50px'}),this['_intersectionObserver']['observe'](this['_containerElement']));}['_isContainerVisible'](){if(!this['_containerElement'])return!0x1;if(!this['_containerElement']['isConnected'])return!0x1;const _0x9453f3=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x9453f3['width']||0x0===_0x9453f3['height'])return!0x1;const _0x55c2aa=window['innerHeight']||document['documentElement']['clientHeight'],_0x3a7c83=window['innerWidth']||document['documentElement']['clientWidth'],_0x3baf79=0xc8;return _0x9453f3['bottom']>=-0xc8&&_0x9453f3['top']<=_0x55c2aa+_0x3baf79&&_0x9453f3['right']>=-0xc8&&_0x9453f3['left']<=_0x3a7c83+_0x3baf79;}}const qs='ck-ai-chat__feed__context-chips',Qs='ck-ai-chat-context-chips-wrapper',Xs='ck-ai-chat-context-chips-wrapper-balloon',zs='ck-ai-chat-controls-button',js='ck-ai-chat-controls_context_show-more-button',Js='ck-ai-chat-context-controls__show-more-balloon-panel';class AIChatFeedContextChipsView extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x5eb0d2,_0x4ee098,_0x2f02e4){super(_0x5eb0d2),this['_bodyCollection']=_0x2f02e4,this['_createContextChips'](_0x4ee098);const _0x2aefe2={'cssClasses':{'showMoreButton':js+'\x20'+Gi,'showMoreBalloon':Js,'overflowContainer':Xs,'controlsButton':zs}};this['_overflowManager']=new AIChatChipsOverflowManager(_0x5eb0d2,this['_contextChips'],_0x2aefe2,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[qs,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Qs},'children':this['_contextChips']}]});}['render'](){super['render']();const _0xb4562a=this['element']['querySelector']('.'+Qs);_0xb4562a&&(this['_overflowManager']['setContainerElement'](_0xb4562a),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x2578bd){for(const _0x1dfea9 of _0x2578bd){const _0x20dd79=new AIChatContextItemButtonView(this['locale'],_0x1dfea9,!0x0,!0x1);this['_contextChips']['add'](_0x20dd79);}}}class AIChatFeedUserMessageItemView extends AIChatFeedItemView{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x41c366,_0x2734ba,_0x1210eb){super(_0x2734ba),this['_locale']=_0x41c366,this['_bodyCollection']=_0x1210eb,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new AIChatFeedContextChipsView(this['_locale'],this['options']['contextItems']['filter'](_0x223ecb=>!_0x223ecb['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':['ck-reset_all-excluded','ck-ai-chat__feed__message-content','ck-ai-chat-content']}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class AIChatFeedInteractionHeaderView extends AIChatFeedItemView{['capabilities'];constructor(_0x15c35a,_0x4df84a){super(_0x4df84a);const {isWebSearchEnabled:_0x2f4d01,isReasoningEnabled:_0x9b9922}=_0x4df84a['capabilities'],_0x313e2d=[];let _0x59f618='';_0x2f4d01&&_0x9b9922?(_0x59f618=Mi(_0x15c35a,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x313e2d['push'](Zs(_0x4c80e3)),_0x313e2d['push'](Zs(_0x585754))):_0x2f4d01?(_0x59f618=Mi(_0x15c35a,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x313e2d['push'](Zs(_0x4c80e3))):_0x9b9922&&(_0x59f618=Mi(_0x15c35a,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x313e2d['push'](Zs(_0x585754))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x59f618?'':'ck-hidden']}});const _0x925755=new Nt();_0x925755['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x313e2d,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x59f618]}]}),this['children']['add'](_0x925755),this['capabilities']=_0x4df84a['capabilities'];}}function Zs(_0x35a27d){const _0x319d1e=new Lt();return _0x319d1e['content']=_0x35a27d,_0x319d1e;}const tn=['wheel','touchstart','pointerdown','keydown'],en=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ScrollManager{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x340f0f){this['element']=_0x340f0f,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x4e5dec of tn){const _0xc8d0='keydown'!==_0x4e5dec;this['element']['addEventListener'](_0x4e5dec,this['_onUserEvent']['bind'](this),{'passive':_0xc8d0,'signal':this['abortController']['signal']});}}['start']({smooth:_0x320f1c=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x320f1c?'smooth':'auto',this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}['stop'](){requestAnimationFrame(()=>{this['_stop']();});}['destroy'](){this['_stop'](),this['abortController']['abort']();}['_stop'](){null!==this['animationFrameId']&&(cancelAnimationFrame(this['animationFrameId']),this['animationFrameId']=null),this['isRunning']&&(this['isRunning']=!0x1),this['isUserPaused']=!0x1;}['_onUserEvent'](_0xf9ac98){if(this['isRunning']){if('keydown'===_0xf9ac98['type']){const _0x44e9d8=_0xf9ac98['key'];if(!en['includes'](_0x44e9d8))return;}_0xf9ac98 instanceof WheelEvent?_0xf9ac98['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x16f407,scrollHeight:_0x59a5d4,clientHeight:_0x68b544}=this['element'];return _0x59a5d4-_0x16f407-_0x68b544<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class AIChatFeedCustomElementView extends AIChatFeedItemView{constructor(_0x3ce43a){super(_0x3ce43a),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class AIChatFeedView extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x3f9e36,_0x37c5fc){super(_0x3f9e36),this['_bodyCollection']=_0x37c5fc,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Os)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ScrollManager(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x3d0283,_0x43ae13){let _0x369390;return'ai-reply'===_0x3d0283?_0x369390=new AIChatFeedReplyItemView(this['locale'],_0x43ae13,this['_bodyCollection']):'ai-suggestion-reply'===_0x3d0283?(_0x369390=new AIChatFeedSuggestionItemView(this['locale'],_0x43ae13,this['_bodyCollection']),_0x369390['bind']('isTrackChangesOn')['to'](this)):_0x369390='user-message'===_0x3d0283?new AIChatFeedUserMessageItemView(this['locale'],_0x43ae13,this['_bodyCollection']):'interaction-header'===_0x3d0283?new AIChatFeedInteractionHeaderView(this['locale'],_0x43ae13):'custom-element'===_0x3d0283?new AIChatFeedCustomElementView(_0x43ae13):new AIChatFeedErrorItemView(_0x43ae13),this['children']['add'](_0x369390),_0x369390;}async['updateReplyItem']({id:_0x5485aa,parsedContent:_0x2f95cc,renderingStrategy:_0x43c47c,abortSignal:_0x1db5df}){const _0x614d16=this['getItemById'](_0x5485aa);if(!(_0x614d16 instanceof AIChatFeedReplyItemView))throw new ht('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x614d16,'id':_0x5485aa,'parsedContent':_0x2f95cc});await _0x614d16['updateContent']({'parsedContent':_0x2f95cc,'renderingStrategy':_0x43c47c,'abortSignal':_0x1db5df});}async['updateWebSources'](_0x43306,_0x1b5e3d){const _0x1aefba=this['getItemById'](_0x43306);if(_0x1aefba instanceof AIChatFeedSuggestionItemView)_0x1aefba['updateSources'](_0x1b5e3d);else{if(!(_0x1aefba instanceof AIChatFeedReplyItemView))throw new ht('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x1aefba,'id':_0x43306,'sources':_0x1b5e3d});_0x1aefba['updateSources'](_0x1b5e3d);}}async['updateSuggestionItem']({id:_0xc3067f,parts:_0x16ffc5,abortSignal:_0x3c4f54,skipLoadingEffects:_0x1a69d2}){const _0x317842=this['getItemById'](_0xc3067f);if(!(_0x317842 instanceof AIChatFeedSuggestionItemView))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x317842,'id':_0xc3067f,'parts':_0x16ffc5});await _0x317842['updateContent']({'parts':_0x16ffc5,'abortSignal':_0x3c4f54,'skipLoadingEffects':_0x1a69d2});}['updateSuggestionPartState']({id:_0x2e6a4d,index:_0x416437,state:_0x23fd4d}){const _0x189e68=this['getItemById'](_0x2e6a4d);if(!(_0x189e68 instanceof AIChatFeedSuggestionItemView))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2e6a4d});_0x189e68['updatePartState'](_0x416437,_0x23fd4d);}['setSuggestionPartActive']({id:_0x220476,index:_0x507cad,isActive:_0x49305d}){const _0x26bd5b=this['getItemById'](_0x220476);if(!(_0x26bd5b instanceof AIChatFeedSuggestionItemView))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x220476});this['children']['filter'](_0x4ae606=>_0x4ae606 instanceof AIChatFeedSuggestionItemView)['forEach'](_0x27e414=>{_0x27e414['setPartActive'](!0x1);}),_0x26bd5b['setPartActive'](_0x507cad,_0x49305d);}['markItemAsDone'](_0x453cac){this['getItemById'](_0x453cac)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x539f10=>_0x539f10['options']['id']);}['removeItem'](_0x42e180){this['children']['remove'](this['getItemById'](_0x42e180));}['hasItem'](_0x2d4e65){return!!this['children']['find'](_0x2900eb=>_0x2900eb['options']['id']['includes'](_0x2d4e65));}['scrollToSuggestion'](_0x522e23,_0x51024a){const _0x420c8e=this['getItemById'](_0x522e23);if(!(_0x420c8e instanceof AIChatFeedSuggestionItemView))return void wt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x522e23,'partIndex':_0x51024a});const _0x290efd=_0x420c8e['getPartView'](_0x51024a);_0x290efd?Rt(_0x290efd['element'],0x14,this['element']['parentElement'],!0x0,!0x0):wt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x522e23,'partIndex':_0x51024a});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x24b32f=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x24b32f,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0xdf39d0=new AISkeletonView(this['locale'],Ls['aiFeed']);return _0xdf39d0['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0xdf39d0;}['_createFeedItems'](){const _0x57b1e5=new Nt(this['locale']);return _0x57b1e5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x57b1e5;}['_createFeedLoader'](){const _0x8d3068=new Nt(this['locale']);return _0x8d3068['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0xf126cd=>!_0xf126cd)]},'children':this['_createLoaderChildren']()}),_0x8d3068;}['_createLoaderChildren'](){const _0x4813ca=new AISpinnerView();return _0x4813ca['isVisible']=!0x0,[_0x4813ca,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0xc48a70){const _0x123934=this['children']['find'](_0x4d5e4c=>_0x4d5e4c['options']['id']['includes'](_0xc48a70));if(!_0x123934)throw new ht('ai-chat-feed-view-item-not-found',this,{'id':_0xc48a70});return _0x123934;}['setLoadingMessage'](_0x2f7b3e){this['set']('loadingMessage',_0x2f7b3e);}['toggleLoadingSkeleton'](_0x2154e4){this['set']('isLoadingSkeletonVisible',_0x2154e4);}['startAutoScroll'](_0x584b41={}){this['scrollManager']['start'](_0x584b41);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class AIChatPromptSuggestionsListView extends Dt{['filter'](){let _0x263bde=0x0;for(const _0x3e7683 of this['items'])_0x263bde+=_0x3e7683['items']['length'];return{'resultsCount':_0x263bde,'totalItemsCount':_0x263bde};}}function sn(_0xcf5c5a){const _0x5eb4d2=[];let _0x22b8b3=!0x1;for(const _0x5fb184 of Array['from'](_0xcf5c5a['items'])){if('file'!==_0x5fb184['kind'])continue;const _0x4c95d5=_0x5fb184['webkitGetAsEntry']();if(_0x4c95d5?.['isDirectory']){_0x22b8b3=!0x0;continue;}const _0x8808f6=_0x5fb184['getAsFile']();_0x8808f6&&_0x5eb4d2['push'](_0x8808f6);}return{'files':_0x5eb4d2,'hasDirectory':_0x22b8b3};}const nn='ck-ai-chat__prompt-input_highlighted';class AIChatPromptInputView extends Pt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x2f124f,_0x52aee8){super(_0x2f124f,{'queryView':{'label':'','creator':Bt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new AIChatPromptSuggestionsListView(_0x2f124f),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x52aee8,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=AIChatPromptInputView['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=AIChatPromptInputView['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x1e20dd,_0x123467)=>!_0x1e20dd&&!_0x123467),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x46142b,_0x4721f9)=>{this['isUploadInProgress']||this['isEmpty']||_0x46142b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4721f9());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();}),this['queryView']['fieldView']['element']['addEventListener']('paste',_0xce4641=>this['_handlePaste'](_0xce4641)),this['element']['addEventListener']('drop',_0x4c0c33=>this['_handleDrop'](_0x4c0c33));}['_handlePaste'](_0x3e58d1){const _0x4d59cf=_0x3e58d1['clipboardData'];if(!_0x4d59cf)return;const {files:_0x457661,hasDirectory:_0x28ccb2}=sn(_0x4d59cf),_0x510bc={'files':_0x457661,'plainText':_0x4d59cf['getData']('text/plain'),'hasDirectory':_0x28ccb2,'forceTextAttachment':!0x1,'preventDefault':()=>_0x3e58d1['preventDefault']()};this['fire']('promptInputPaste',_0x510bc);}['_handleDrop'](_0x153fad){const _0x180cba=_0x153fad['dataTransfer'];if(!_0x180cba)return;const _0x3fade8={'files':[],'plainText':_0x180cba['getData']('text/uri-list')||_0x180cba['getData']('text/plain'),'hasDirectory':!0x1,'forceTextAttachment':!0x1,'preventDefault':()=>_0x153fad['preventDefault']()};this['fire']('promptInputPaste',_0x3fade8);}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x19d94f=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x19d94f)return this['queryView']['errorText']=Mi(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x1cf7c7=_0x16b809(_0x19d94f);this['fire']('sendUserMessage',_0x1cf7c7),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x26da1c){this['queryView']['fieldView']['set']('placeholder',_0x26da1c);}['focus'](_0x9c4195=!0x1){super['focus'](),_0x9c4195&&(this['element']['classList']['contains'](nn)||(this['element']['classList']['add'](nn),setTimeout(()=>{this['element']['classList']['remove'](nn);},0x320)));}['_createSubmitButton'](){const _0x3f6196=new yt(this['locale']);return _0x3f6196['set']({'icon':_0x410e30,'label':Mi(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+Ui,'isEnabled':!0x1}),_0x3f6196['on']('execute',()=>{this['submit']();}),_0x3f6196;}['setIsUploadInProgress'](_0x5473b4){this['isUploadInProgress']=_0x5473b4;}['_setUpAddContextButtonPositioning'](){const _0x4a11d5=this['locale'],_0x13c74b=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0xa36090=new dt(this['queryView']['fieldView']['element']),_0xb6a8b1=new dt(this['_addContextButtonView']['element']),_0x356732=_0xa36090['width'],_0x5424bf='rtl'===_0x4a11d5['uiLanguageDirection']?'right':'left';_0xa36090['excludeScrollbarsAndBorders']();const _0x446006=_0x356732-_0xa36090['width']+0x1;this['_addContextButtonView']['element']['style'][_0x5424bf]='calc('+(_0x356732-_0xb6a8b1['width']-_0x446006)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x13c74b),this['on']('render',()=>{_0x13c74b(),this['_queryViewResizeObserver']=new bt(this['queryView']['fieldView']['element'],()=>{_0x13c74b();});});}}class AIChatDropZoneView extends Nt{constructor(_0xc217be){super(_0xc217be);const _0x36bbf9=new Lt();_0x36bbf9['content']=_0x1f08c5,this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls__drop-overlay']},'children':[_0x36bbf9,{'tag':'span','attributes':{'class':['ck-ai-chat-controls__drop-overlay__label']},'children':[{'text':Mi(_0xc217be,'AI_CHAT_DROP_ZONE_HINT')}]}]});}['attach'](_0x1a5f9d){let _0x2d2b8f=0x0;_0x1a5f9d['addEventListener']('dragenter',_0x23c03d=>{_0x23c03d['dataTransfer']&&(_0x2d2b8f++,0x1===_0x2d2b8f&&this['fire']('dragEnter'),_0x1a5f9d['classList']['add']('ck-ai-chat-controls_drag-over'));}),_0x1a5f9d['addEventListener']('dragover',_0x49d94a=>{_0x49d94a['dataTransfer']&&_0x49d94a['preventDefault']();}),_0x1a5f9d['addEventListener']('dragleave',()=>{--_0x2d2b8f<=0x0&&(_0x2d2b8f=0x0,_0x1a5f9d['classList']['remove']('ck-ai-chat-controls_drag-over'));}),_0x1a5f9d['addEventListener']('drop',_0x5aa315=>{_0x5aa315['preventDefault'](),_0x2d2b8f=0x0,_0x1a5f9d['classList']['remove']('ck-ai-chat-controls_drag-over'),this['_handleDrop'](_0x5aa315);});}['_handleDrop'](_0x4757f8){const _0x2f8b9b=_0x4757f8['dataTransfer'];if(!_0x2f8b9b)return;const {files:_0x2f17d9,hasDirectory:_0x44d24c}=sn(_0x2f8b9b),_0x353f74={'files':_0x2f17d9,'plainText':_0x2f8b9b['getData']('text/uri-list')||_0x2f8b9b['getData']('text/plain'),'hasDirectory':_0x44d24c,'forceTextAttachment':!0x0,'preventDefault':()=>{}};this['fire']('promptInputPaste',_0x353f74);}}const rn='ck-ai-chat__prompt-capabilities',on='ck-ai-chat-controls-button',an='ck-ai-chat-controls-button--commands',hn='ck-ai-chat-controls__model-selection',cn='ck-ai-chat-controls__model-selection__item-name',ln='ck-ai-chat-controls__model-selection__item-description',un='ck-ai-chat-controls__model-selection__item-capabilities',dn='n';class AIChatPromptCapabilitiesView extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x4089c8){super(_0x4089c8),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4ea43b=>'selector'===_0x4ea43b),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x35d8d4=>_0x35d8d4?this['_modelSelectionDropdown']['buttonView']['label']:Mi(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x293ad0=>_0x293ad0),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x2fdffa=>_0x2fdffa),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x2e39bd=>Mi(this['locale'],_0x2e39bd?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x259663=>_0x259663),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x39a422=>Mi(this['locale'],_0x39a422?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[rn]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _t(),Jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x37685f,_0x366060){if(_0x366060)this['set']('modelDisplayMode','hidden');else{const _0x2493bc=0x1===_0x37685f['length'];this['set']('modelDisplayMode',_0x2493bc?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x37685f?.['length'])for(const _0x5b33dc of _0x37685f){const _0x50683f=new Zt({'label':_0x5b33dc['name'],'withText':!0x0,'role':'menuitemradio','id':_0x5b33dc['id'],'model':_0x5b33dc});_0x50683f['bind']('isOn')['to'](this,'activeModelId',_0x12dc03=>_0x12dc03===_0x5b33dc['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x50683f,'labelView':new _n(this['locale'],_0x5b33dc)});}}['setWebSearch'](_0x5ad2bb){this['set']('webSearchActive',_0x5ad2bb);}['setReasoning'](_0x1b5cf1){this['set']('reasoningActive',_0x1b5cf1);}['setModel'](_0x5784c1){if(!_0x5784c1)return;this['activeModelId']=_0x5784c1['id'],this['activeModelName']=_0x5784c1['name']||_0x5784c1['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x5784c1['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x5784c1['name']);const _0x56b09f=_0x5784c1['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x56b09f),this['_webSearchButton']['set']('isVisible',_0x56b09f);const _0x2c33c9=_0x5784c1['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x2c33c9),this['_reasoningButton']['set']('isVisible',_0x2c33c9);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x543e95){this['set']('modelSelectorEnabled',!0x1),_0x543e95&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x5ed3c4=new yt();return _0x5ed3c4['set']({'label':Mi(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x4c80e3,'class':on+'\x20'+Gi,'isToggleable':!0x0,'tooltipPosition':dn}),_0x5ed3c4['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x5ed3c4;}['_createReasoningButton'](){const _0x17855c=new yt();return _0x17855c['set']({'label':Mi(this['locale'],'AI_CHAT_REASONING'),'icon':_0x585754,'class':on+'\x20'+Gi,'isToggleable':!0x0,'tooltipPosition':dn}),_0x17855c['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x17855c;}['_createCommandsButton'](){const _0x5d3f08=new yt();return _0x5d3f08['set']({'label':Mi(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x2b3fb1,'withText':!0x0,'class':on+'\x20'+Gi,'isToggleable':!0x0,'tooltip':Mi(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':dn}),_0x5d3f08['extendTemplate']({'attributes':{'class':[an]}}),_0x5d3f08['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x5d3f08;}['_createModelSelectionDropdown'](){const _0x2fdaef=Ft(this['locale']);return _0x2fdaef['set']({'panelPosition':'ne','class':[hn]}),_0x2fdaef['buttonView']['set']({'label':Mi(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':dn,'class':Gi}),this['listenTo'](_0x2fdaef,'execute',_0x23b662=>{this['fire']('selectModel',_0x23b662['source']['model']);}),_0x2fdaef;}['_createModelNameView'](){const _0xe96570=new In(this['locale']);return _0xe96570['bind']('text')['to'](this,'activeModelName',_0x140787=>_0x140787??''),_0xe96570['bind']('isVisible')['to'](this,'modelDisplayMode',_0x585fe2=>'name'===_0x585fe2),_0xe96570;}}let _n=class ModelButtonLabelView extends Mt{constructor(_0x36a28c,_0x37852c){super();const _0x3af441=this['bindTemplate'],_0x278191=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x3af441['to']('style'),'id':_0x3af441['to']('id')},'children':[{'tag':'div','attributes':{'class':[cn]},'children':[{'text':_0x3af441['to']('text')}]},{'tag':'div','attributes':{'class':[ln]},'children':[{'tag':'span','children':[{'text':_0x37852c['description']}]}]},{'tag':'div','attributes':{'class':[un]},'children':_0x278191}]}),_0x278191['addMany'](this['_getCapabilityParts'](_0x36a28c,_0x4c80e3,'AI_CHAT_SEARCH_WEB',_0x37852c['capabilities']['webSearch']?.['enabled']??!0x1)),_0x278191['addMany'](this['_getCapabilityParts'](_0x36a28c,_0x585754,'AI_CHAT_REASONING',_0x37852c['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x1579ec,_0x53dfd3,_0xc421e8,_0x2741dc){const _0x33dda1=new Lt();_0x33dda1['content']=_0x53dfd3;const _0x4b9d5b=new Nt(_0x1579ec);_0x4b9d5b['setTemplate']({'tag':'span','children':[{'text':Mi(_0x1579ec,_0xc421e8)+':\x20'}]});const _0xcdf99a=new Nt(_0x1579ec);return _0xcdf99a['setTemplate']({'tag':'span','children':[{'text':Mi(_0x1579ec,_0x2741dc?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x33dda1,_0x4b9d5b,_0xcdf99a];}},In=class ModelNameView extends Nt{constructor(_0x29ea00){super(_0x29ea00),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0xb3b6b9=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0xb3b6b9['if']('isVisible','ck-hidden',_0x620d78=>!_0x620d78)]},'children':[{'text':_0xb3b6b9['to']('text')}]});}};const An='ck-ai-chat-context-controls__url-form',gn='ck-ai-chat-context-controls__url-input-section';class AIChatContextPanelUrlInputView extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x36d178){super(_0x36d178),this['focusTracker']=new It(),this['keystrokes']=new At(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x193421=>{this['focusTracker']['add'](_0x193421['element']),this['keystrokes']['listenTo'](_0x193421['element']);}),te({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x270f31){this['urlInputField']['errorText']=_0x270f31,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x2fda21=new yt(this['locale']);return _0x2fda21['set']({'icon':_0x26e333,'tooltip':Mi(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x1c1903,_0x4b1a4e,_0x2ea14b)=>{_0x2fda21['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x2ea14b?'':'\x20ck-hidden')]});}),_0x2fda21;}['_createUrlInputField'](){const _0x7fa6c1=new _0x5e9241(this['locale'],_0x286d14);return _0x7fa6c1['set']({'label':Mi(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x7fa6c1['fieldView']['set']({'placeholder':Mi(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x7fa6c1;}['_createConfirmButton'](){const _0x42133b=new yt(this['locale']);return _0x42133b['set']({'icon':_0x34cc80,'tooltip':Mi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x42133b;}['_setupTemplate'](){const _0x1eacf3=new _0x355178(this['locale'],{'label':Mi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x1eacf3['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':An,'tabindex':'-1'},'children':[_0x1eacf3,{'tag':'div','attributes':{'class':gn},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x2830a2=>{_0x2830a2['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x12ae37,_0x5b704c)=>{this['clear'](),this['fire']('cancel'),_0x5b704c();});}['_handleSubmit'](){const _0x339792=this['getValue']()['trim']();_0x339792?this['_isValidUrl'](_0x339792)?(this['clearError'](),this['fire']('submitUrl',_0x339792)):this['setError'](Mi(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Mi(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x3f4152=this['getValue']()['trim'](),_0x105e32=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x3f4152['length']>0x0&&!_0x105e32;}['_isValidUrl'](_0x5e93e1){try{return!!new URL(_0x5e93e1);}catch{return!0x1;}}}const wn='ck-ai-chat-resources__item',Cn='ck-ai-chat-resources__item--in-context',mn='ck-ai-chat-resources__item-title',pn='ck-ai-chat-resources__item__icon';class AIChatResourceListItemView extends Ht{['resource'];['_titleView'];['_iconView'];constructor(_0x1b6220,_0x1d1877){super(_0x1b6220),this['resource']=_0x1d1877,this['set']('isInContext',!!_0x1d1877['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x223ccd){if(_0x223ccd['isInContext'])return _0x34cc80;switch(_0x223ccd['type']){case'document':return _0x5e66bf;case'web-resource':return _0x5f5a21;case'file':case'text':return _0x1f08c5;default:return _0x17333b;}}['highlightText'](_0x49ebc0){if(!_0x49ebc0||''===_0x49ebc0['trim']())return void this['_titleView']['highlightText'](null);const _0x1ff535=new RegExp(_0x40e363(_0x49ebc0),'gi');this['_titleView']['highlightText'](_0x1ff535);}['updateResourceState'](_0x500675){this['resource']['isInContext']=_0x500675,this['isInContext']=_0x500675,this['_updateIcon']();}['_createTitleView'](){const _0x47da80=new _0x72d2dd();return _0x47da80['text']=this['resource']['label'],_0x47da80['extendTemplate']({'tag':'span','attributes':{'class':[mn]}}),_0x47da80;}['_createIconView'](){const _0x331bc5=new Lt();return _0x331bc5['content']=this['getResourceIcon'](this['resource']),_0x331bc5;}['_setupTemplate'](){const _0x4c7eb0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[wn,_0x4c7eb0['if']('isVisible','ck-hidden',_0x29624e=>!_0x29624e),_0x4c7eb0['if']('isInContext',Cn)]},'children':[{'tag':'div','attributes':{'class':[pn]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x4c7eb0['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const En='ck-ai-chat-resources__list';class AIChatContextResourcesListView extends Dt{['_source'];constructor(_0x45bd9e,_0x3c2f0b){super(_0x45bd9e),this['_source']=_0x3c2f0b,this['extendTemplate']({'attributes':{'class':[En]}});}['setResources'](_0x37ef08,_0x365784){this['items']['clear']();let _0x198f6d=_0x37ef08;if(this['_source']['useDefaultFiltering']&&_0x365784&&''!==_0x365784['trim']()){const _0x18bacf=new RegExp(_0x365784['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x198f6d=_0x37ef08['filter'](_0x54d12a=>_0x18bacf['test'](_0x54d12a['label']));}for(const _0x57ef90 of _0x198f6d){const _0x3b3586=new AIChatResourceListItemView(this['locale'],_0x57ef90);_0x3b3586['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x57ef90);}),this['items']['add'](_0x3b3586);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x365784);}['highlightText'](_0x343f52){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x263fbb=>{_0x263fbb['highlightText'](_0x343f52);});}['updateResourceState'](_0x5dbc5d,_0x245a76){for(const _0x56a8a1 of this['items']){const _0x3b9a5c=_0x56a8a1;_0x3b9a5c['resource']['id']===_0x5dbc5d&&_0x3b9a5c['updateResourceState'](_0x245a76);}}['_handleResourceSelection'](_0x634151,_0x3abe0d){this['fire']('addResourceToContext',{'source':_0x634151,'resource':_0x3abe0d});}}class AIChatContextResourcesSearchInputView extends _0x5e9241{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x497c49){const t=_0x497c49['t'],_0x8f445e={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x286d14,'label':Mi(_0x497c49,'AI_CHAT_SEARCH_RESOURCES')};super(_0x497c49,_0x8f445e['creator']),this['label']=_0x8f445e['label'],this['_viewConfig']=_0x8f445e,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x497c49,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x12b04b){this['fire']('search',_0x12b04b);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new Lt(),this['iconView']['content']=_0x360100,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x48e2a5,t){this['resetButtonView']=new yt(_0x48e2a5),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x45e38d,'class':'ck-search__reset','isVisible':!0x1,'tooltip':!0x0}),this['resetButtonView']['on']('execute',()=>{this['reset'](),this['focus'](),this['fire']('reset');}),this['resetButtonView']['bind']('isVisible')['to'](this['fieldView'],'isEmpty',_0x52ea5b=>!_0x52ea5b),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class AIChatContextResourcesView extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x152e1c,_0x46deda){super(_0x152e1c),this['_source']=_0x46deda['source'],this['_searchInputVisibleFrom']=_0x46deda['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x42c8a3([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new AIChatContextResourcesSearchInputView(this['locale']);}['_createSearchSection'](){const _0x3037a7=new Nt(this['locale']);return _0x3037a7['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1faa1c,_0x2baffe)=>{this['loadResources'](_0x2baffe),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x2baffe);}),_0x3037a7;}['_createResourcesListView'](){const _0x533643=new AIChatContextResourcesListView(this['locale'],this['_source']);return _0x533643['delegate']('addResourceToContext')['to'](this),_0x533643['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x533643;}['_createSkeletonView'](){const _0x212531=new AISkeletonView(this['locale'],Ls['aiChatResources']);return _0x212531['bind']('isVisible')['to'](this,'isLoading'),_0x212531;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x20c8ee){const _0x230e57=at();this['_latestLoadResourcesUid']=_0x230e57,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x20c8ee,'uid':_0x230e57}),this['isLoading']=!0x0;}['setResources'](_0x34fc15,_0x5e46ff){if(_0x5e46ff&&_0x5e46ff!==this['_latestLoadResourcesUid'])return;const _0x411dd3=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x34fc15,_0x411dd3),_0x34fc15['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x449f5b,_0x2e90d2){this['_resourcesListView']['updateResourceState'](_0x449f5b,_0x2e90d2);}}const Tn='ck-ai-chat-context-controls__source-balloon-panel',fn='ck-button-icon\x20ck-button-back',Rn='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class AIChatResourcesBalloonView{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x2630c5,_0x300687,_0x399cfd){this['_locale']=_0x2630c5,this['_bodyCollection']=_0x300687,this['_config']=_0x399cfd;}['showSourceResourcesBalloon']({source:_0x537f12,withBackButton:_0x43be53}){let _0x16907d=this['_sourceResourceBalloons']['get'](_0x537f12['id']);_0x16907d||(_0x16907d=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x537f12['id'],_0x16907d),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x16907d)),this['_addSourceResourceContent']({'balloonPanel':_0x16907d,'source':_0x537f12,'withBackButton':_0x43be53}),_0x16907d['show']();const _0x4016e2=this['_config']['getTargetElement']();_0x4016e2&&_0x16907d['pin']({'target':_0x4016e2,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x5b64d5,_0x2f040f,_0x148c59){const _0xdb3c43=this['_sourceResourceBalloons']['get'](_0x5b64d5);if(!_0xdb3c43)return;const _0x2798f5=this['_getResourcesViewFromBalloon'](_0xdb3c43);_0x2798f5&&(_0x2798f5['setResources'](_0x2f040f,_0x148c59),_0x2798f5['once']('change:isLoading',()=>{_0xdb3c43['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x2d54e2){const _0x27f45c=this['_sourceResourceBalloons']['get'](_0x2d54e2);_0x27f45c&&requestAnimationFrame(()=>{_0x27f45c['hide'](),this['_sourceResourceBalloons']['delete'](_0x2d54e2),this['_config']['onBalloonClosed']();});}['closeAll'](){for(const _0x582a17 of Array['from'](this['_sourceResourceBalloons']['keys']()))this['closeSourceResourceBalloon'](_0x582a17);}['isAnyResourceBalloonVisible'](){for(const _0x1fab1c of this['_sourceResourceBalloons']['values']())if(_0x1fab1c['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x25c818,_0x11b3a2,_0x3ec222){const _0x1ebb96=this['_sourceResourceBalloons']['get'](_0x25c818);if(!_0x1ebb96||!_0x1ebb96['isVisible'])return;const _0x4df13a=this['_config']['getTargetElement']();if(!_0x4df13a)return;_0x1ebb96['pin']({'target':_0x4df13a,'limiter':this['_config']['getLimiterElement']()});const _0x20f044=this['_getResourcesViewFromBalloon'](_0x1ebb96);_0x20f044&&_0x20f044['updateResourceState'](_0x11b3a2,_0x3ec222);}['destroy'](){for(const _0x46e4ca of this['_sourceResourceBalloons']['values']())_0x46e4ca['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x150016=new zt(this['_locale']);return _0x150016['extendTemplate']({'attributes':{'class':Tn}}),this['_bodyCollection']['add'](_0x150016),_0x150016;}['_addSourceResourceContent']({balloonPanel:_0xd78c17,source:_0x587bad,withBackButton:_0xb8459c}){_0xd78c17['content']['clear']();const _0x40e9d0=this['_createBalloonHeader']({'balloonPanel':_0xd78c17,'source':_0x587bad,'withBackButton':_0xb8459c});_0xd78c17['content']['add'](_0x40e9d0);const _0x449889=this['_createBalloonResourcesView'](_0x587bad);_0xd78c17['content']['add'](_0x449889);}['_createBalloonHeader']({balloonPanel:_0x47aa8c,source:_0x329dec,withBackButton:_0x320854}){const _0x982529=new _0x355178(this['_locale'],{'label':_0x329dec['label'],'class':Rn});return _0x320854&&_0x982529['children']['add'](this['_createBackButton'](_0x47aa8c),0x0),_0x982529;}['_createBackButton'](_0x4bfafa){const _0x1c8ec2=new yt(this['_locale']);return _0x1c8ec2['set']({'icon':_0x26e333,'tooltip':Mi(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':fn}),_0x1c8ec2['on']('execute',()=>{_0x4bfafa['hide'](),this['_config']['onBackToContext']();}),_0x1c8ec2;}['_createBalloonResourcesView'](_0x4e14bf){const _0xd79272=new AIChatContextResourcesView(this['_locale'],{'source':_0x4e14bf,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0xd79272['on']('loadSourceResources',(_0x54b329,_0x2d5e9a)=>{this['_config']['onLoadSourceResources'](_0x2d5e9a);}),_0xd79272['on']('addResourceToContext',(_0x59ef87,_0x4885f3)=>{this['_config']['onResourceSelected'](_0x4885f3['source'],_0x4885f3['resource']),this['closeSourceResourceBalloon'](_0x4e14bf['id']);}),_0xd79272;}['_getResourcesViewFromBalloon'](_0x9244f){const _0x44379f=_0x9244f['content']['get'](0x1);return _0x44379f instanceof AIChatContextResourcesView?_0x44379f:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x51501d){jt({'emitter':_0x51501d,'contextElements':[_0x51501d['element']],'callback':()=>{_0x51501d['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x51501d['isVisible']});}}const bn=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Sn='ck-ai-chat-context-controls',On='ck-ai-chat-context-controls__pending-contexts',vn='ck-ai-chat-context-controls__add-context-balloon-panel',kn='ck-ai-chat-context-controls__add-context-button',yn='ck-ai-chat-context-controls__url-balloon-panel',Nn='ck-ai-chat-context-controls__balloon-button',xn='ck-ai-chat-context-controls__balloon-button-source',Ln='ck-ai-chat-controls-button',Pn='ck-ai-chat-context-chips-wrapper-balloon',Dn='ck-ai-chat-controls_context_show-more-button',Vn='ck-ai-chat-context-controls__show-more-balloon-panel',Hn='ck-ai-chat',Mn=[zt['defaultPositions']['northArrowSouthWest'],zt['defaultPositions']['northArrowSouth'],zt['defaultPositions']['northArrowSouthEast'],zt['defaultPositions']['southArrowNorthWest'],zt['defaultPositions']['southArrowNorth'],zt['defaultPositions']['southArrowNorthEast']];class AIChatContextPanelView extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x51710e,_0x392729){super(_0x51710e),this['bodyCollection']=_0x392729['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x51710e),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x51710e),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x51710e),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x51710e,_0x392729);const _0x1427d8={'cssClasses':{'showMoreButton':Dn+'\x20'+Gi,'showMoreBalloon':Vn,'overflowContainer':Pn,'controlsButton':Ln}};this['_overflowManager']=new AIChatChipsOverflowManager(_0x51710e,this['_currentContextsChips'],_0x1427d8,this['bodyCollection'],this),this['_addContextBalloonConfig']={'buttonView':this['addContextButtonView'],'balloonView':this['_addContextBalloonPanelView'],'hideMethod':this['hideAddContextBalloonPanel']['bind'](this),'showMethod':this['showAddContextBalloonPanel']['bind'](this)},this['_setupTemplate'](),this['_bindEventHandlers']();}['render'](){super['render'](),this['_setupAllBalloonClickOutsideHandlers'](),this['_overflowManager']['setContainerElement'](this['element']),this['_overflowManager']['reorganizeChips']();}['destroy'](){super['destroy'](),this['_overflowManager']['destroy'](),this['_resourcesBalloonView']['destroy']();}['addContextItem'](_0x2e78de,_0x357d0c){const _0x3d5958=this['_createContextButton'](_0x2e78de,'current',!0x0,_0x357d0c);this['_addContextToCollection'](_0x3d5958,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x59336b){this['_removeContextFromCollection'](_0x59336b,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x59336b,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x5c07c3,_0x2f34da){let _0x1490a8=this['_currentContextsChips']['find'](_0x4bed8a=>_0x4bed8a['id']===_0x5c07c3);_0x1490a8||(_0x1490a8=this['_overflowManager']['overflowChips']['find'](_0x297be0=>_0x297be0['id']===_0x5c07c3)),_0x1490a8&&(_0x1490a8['isLoading']=_0x2f34da);}['setConversationContext'](_0x42220e){this['_conversationContextsChips']['clear']();for(const _0x327736 of _0x42220e){const _0x2eba8c=this['_createContextButton'](_0x327736,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x2eba8c,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x33636e,_0x228e59,_0x451ae2){this['_resourcesBalloonView']['updateResourceState'](_0x33636e,_0x228e59,_0x451ae2);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['hideAllBalloons'](){this['hideAddContextBalloonPanel'](),this['hideUrlBalloonPanel'](),this['_resourcesBalloonView']['closeAll']();}['_showSourceResourcesBalloon']({source:_0x401803,withBackButton:_0x10fdb0}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x401803,'withBackButton':_0x10fdb0}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x3388e9,_0x577d15,_0x306f06,_0x31297e){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x3388e9,_0x306f06,_0x31297e);}['closeSourceResourceBalloon'](_0x1b9db4){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x1b9db4),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x19a227){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x19a227),this['_setAddContextButtonEnabled'](_0x19a227);}['_setAddContextButtonEnabled'](_0x58c5ed){const _0xa5dd57=!_0x58c5ed['document']['isHidden']&&_0x58c5ed['document']['enabled'],_0xc84cd8=_0x58c5ed['urls']['enabled'],_0x39f3aa=_0x58c5ed['files']['enabled'],_0x1c08e2=_0x58c5ed['sources']['length']>0x0,_0x4acd78=_0x58c5ed['customItems']&&_0x58c5ed['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0xa5dd57||_0xc84cd8||_0x39f3aa||_0x1c08e2||_0x4acd78;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Sn,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':On},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0xdc7e59){const _0x425399=new yt(_0xdc7e59);return _0x425399['set']({'label':Mi(_0xdc7e59,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Ln+'\x20'+kn+'\x20'+Gi,'icon':_0x557527,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x425399;}['_createAddContextBalloonPanelView'](_0x249a4a){return this['_createBaseBalloonPanel'](_0x249a4a,vn);}['_createUrlBalloonPanelView'](_0x35fc20){const _0x321774=this['_createBaseBalloonPanel'](_0x35fc20,yn);return this['_addUrlContent'](_0x321774,_0x35fc20),_0x321774;}['_createResourcesBalloonView'](_0x3faf9a,_0x5bcc89){const _0x5954e6={'searchInputVisibleFrom':_0x5bcc89['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Mn});},'onResourceSelected':(_0x413c3a,_0xcbb39)=>{this['fire']('addResourceToContext',{'source':_0x413c3a,'resource':_0xcbb39});},'onLoadSourceResources':_0x50df80=>{this['fire']('loadSourceResources',_0x50df80);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new AIChatResourcesBalloonView(_0x3faf9a,_0x5bcc89['bodyCollection'],_0x5954e6);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Hn)||document['body'];}['_createBaseBalloonPanel'](_0x2d6e57,_0x162afb){const _0x2fa259=new zt(_0x2d6e57);return _0x2fa259['extendTemplate']({'attributes':{'class':_0x162afb}}),this['bodyCollection']['add'](_0x2fa259),_0x2fa259;}['_setBalloonPanelContent'](_0x5f03cf,_0x177171,_0x1283e6){if(_0x5f03cf['content']['clear'](),!_0x1283e6['document']['isHidden']&&_0x1283e6['document']['enabled']){const _0x24b51c=this['_createBalloonButton'](_0x177171,{'label':Mi(_0x177171,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x5e66bf});_0x24b51c['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x5f03cf['content']['add'](_0x24b51c);}if(_0x1283e6['urls']['enabled']){const _0x9b62dd=this['_createBalloonButton'](_0x177171,{'label':Mi(_0x177171,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x5f5a21});_0x9b62dd['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Mn}),this['_urlInputView']['focus']();}),_0x5f03cf['content']['add'](_0x9b62dd);}if(_0x1283e6['files']['enabled']){const _0x164a12=new _0x1863aa(_0x177171);_0x164a12['set']({'label':Mi(_0x177171,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x564c95,'withText':!0x0,'tooltip':!0x0,'class':Nn,'allowMultipleFiles':!0x0}),_0x164a12['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x164a12['on']('done',(_0x3d6172,_0xca86d4)=>{this['fire']('addFileToContext',_0xca86d4);}),_0x164a12['tooltip']=!0x0,_0x5f03cf['content']['add'](_0x164a12);}for(const _0xf8c84f of _0x1283e6['sources']){const _0x3caea4=this['_createBalloonButton'](_0x177171,{'label':_0xf8c84f['label'],'icon':_0xf8c84f['icon']||_0x17333b,'type':'source'});_0x5f03cf['content']['add'](_0x3caea4),_0x3caea4['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0xf8c84f,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x4f51ea of _0x1283e6['customItems']||[]){const _0x374441=this['_createBalloonButton'](_0x177171,{'label':_0x4f51ea['label'],'icon':_0x4f51ea['icon']||_0x17333b,'type':'customItem'});_0x5f03cf['content']['add'](_0x374441),_0x374441['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x4f51ea);});}this['_hasExactlyOneSource']=0x1===_0x5f03cf['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x1c6657,_0x5821a2){this['_urlInputView']=new AIChatContextPanelUrlInputView(_0x5821a2),this['_urlInputView']['on']('submitUrl',(_0x85d5b5,_0x1337bf)=>{this['_handleUrlSubmit'](_0x1337bf);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Mn}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Mn});}),_0x1c6657['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x1d93d9,_0x4e7f71){const _0x3ae47f='source'===_0x4e7f71['type']?new SourcesBalloonButtonView(_0x1d93d9):new yt(_0x1d93d9);return _0x3ae47f['set']({'label':_0x4e7f71['label'],'icon':_0x4e7f71['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Nn}),_0x3ae47f;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){jt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0xc0c0dd){const _0x55c0b4=this['_addContextBalloonConfig'];_0x55c0b4['buttonView']['isOn']=_0xc0c0dd,_0xc0c0dd?_0x55c0b4['balloonView']['show']():_0x55c0b4['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x1d2a30,buttonView:_0x14f0a7,hideMethod:_0x412362}=this['_addContextBalloonConfig'];jt({'emitter':_0x1d2a30,'contextElements':[_0x1d2a30['element'],_0x14f0a7['element']],'callback':()=>{_0x412362();},'activator':()=>_0x14f0a7['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4cde71,_0x3c8460,_0x2fea06=!0x1,_0x4c556b=!0x1){const _0x53aed5='conversation'===_0x3c8460||!0x0===_0x4cde71['isReadOnly'],_0x4e9a5c=new AIChatContextItemButtonView(this['locale'],_0x4cde71,_0x53aed5,_0x2fea06,_0x4c556b);return _0x53aed5||_0x4e9a5c['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x4e9a5c['id']);}),_0x4e9a5c;}['_addContextToCollection'](_0x22d1cf,_0x5beb34){_0x5beb34['add'](_0x22d1cf,0x0);}['_removeContextFromCollection'](_0x12bbb7,_0x2a297d){const _0x28630d=_0x2a297d['find'](_0x3f26da=>_0x3f26da['id']===_0x12bbb7);_0x28630d&&_0x2a297d['remove'](_0x28630d);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Mn}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x182f82){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x182f82);}}class SourcesBalloonButtonView extends yt{['arrowView'];constructor(_0x26d444){super(_0x26d444),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[xn]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x50e55a=new Lt();return _0x50e55a['content']=_0xdfd917,_0x50e55a['extendTemplate']({'attributes':{'class':xn+'__arrow'}}),_0x50e55a;}}class AIChatControlsLoaderView extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x44397e){super(_0x44397e),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_loaderView']=this['_createLoaderView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-loader-wrapper','ck-reset_all']},'children':[this['_loaderView'],this['_cancelButtonView']]});}['_createCancelButtonView'](){const _0x121383=new yt(this['locale']);return _0x121383['set']({'label':Mi(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':Bi+'\x20ck-ai-button-stop-generating','icon':_0x5025db}),_0x121383['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x121383;}['_createLoaderView'](){const _0x38939=new Nt(this['locale']);return _0x38939['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':Mi(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x38939;}}class AIChatControlsView extends Nt{['_contextPanelView'];['_promptInputView'];['_dropZoneView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];['_filesEnabled'];constructor(_0x54e32f,_0x3d063f){super(_0x54e32f),this['_filesEnabled']=_0x3d063f['filesEnabled'],this['_contextPanelView']=this['_createContextPanelView'](_0x54e32f,{'bodyCollection':_0x3d063f['bodyCollection'],'searchInputVisibleFrom':_0x3d063f['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x54e32f),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x54e32f),this['_loaderView']=this['_createLoaderView'](_0x54e32f),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x54e32f),this['_dropZoneView']=new AIChatDropZoneView(_0x54e32f),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage','promptInputPaste')['to'](this),this['_dropZoneView']['delegate']('promptInputPaste')['to'](this),this['_dropZoneView']['on']('dragEnter',()=>this['_contextPanelView']['hideAllBalloons']()),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...bn)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x1cde3e=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x1cde3e['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x1cde3e['if']('isLoading','ck-hidden',_0x55213a=>_0x55213a||!this['isModelAvailable']),_0x1cde3e['if']('isModelAvailable','ck-hidden',_0x4cb4e8=>!_0x4cb4e8||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x1cde3e['if']('isLoading','ck-hidden',_0x40ddf8=>!_0x40ddf8)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x1cde3e['if']('isModelAvailable','ck-hidden',_0x154c24=>_0x154c24)]},'children':[this['_modelUnavailableMessageView']]},this['_dropZoneView']]}),jt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['render'](){super['render'](),this['_filesEnabled']&&this['_dropZoneView']['attach'](this['element']);}['_createContextPanelView'](_0x275b72,_0x4f3a67){return new AIChatContextPanelView(_0x275b72,_0x4f3a67);}['_createPromptInputView'](_0x3bf4bd){return new AIChatPromptInputView(_0x3bf4bd,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x526589){return new AIChatPromptCapabilitiesView(_0x526589);}['_createLoaderView'](_0x16f48f){return new AIChatControlsLoaderView(_0x16f48f);}['_createModelUnavailableMessageView'](_0x10fa3d){const _0x44da96=new AIChatModelUnavailableMessageView(_0x10fa3d);return _0x44da96['delegate']('startConversation')['to'](this),_0x44da96;}['_handlePromptInputFocus'](_0x5a6bca,_0x5c6b19,_0x18d4c6){_0x18d4c6?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x262bd2,_0x32243e){this['_contextPanelView']['addContextItem'](_0x262bd2,_0x32243e);}['removeContextItem'](_0x39d889){this['_contextPanelView']['removeContextItem'](_0x39d889);}['setContextItemLoading'](_0x5ccbef,_0x30134d){this['_contextPanelView']['setContextItemLoading'](_0x5ccbef,_0x30134d);}['setIsUploadInProgress'](_0x5554ef){this['_promptInputView']['setIsUploadInProgress'](_0x5554ef);}['setConversationContext'](_0x268ea3){this['_contextPanelView']['setConversationContext'](_0x268ea3);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x56ee05,_0x43b2b0,_0x47c9b3){this['_contextPanelView']['updateResourceState'](_0x56ee05,_0x43b2b0,_0x47c9b3);}['setWebSearch'](_0x59ffc8){this['_promptCapabilitiesView']['setWebSearch'](_0x59ffc8);}['setReasoning'](_0x33e0f1){this['_promptCapabilitiesView']['setReasoning'](_0x33e0f1);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x306392){this['_contextPanelView']['setAddContextOptions'](_0x306392);}['setInputPlaceholder'](_0xbf9db2){this['_promptInputView']['setPlaceholderText'](_0xbf9db2);}['setModelList'](_0x399838,_0x401bfb){this['_promptCapabilitiesView']['setModelList'](_0x399838,_0x401bfb);}['setModel'](_0x112407){_0x112407?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x112407)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x1c74ec){this['_promptCapabilitiesView']['disableModelSelector'](_0x1c74ec);}['populateSourceResourceBalloon'](_0x11c779,_0x844c10,_0x213766,_0x2cce8d){this['_contextPanelView']['populateSourceResourceBalloon'](_0x11c779,_0x844c10,_0x213766,_0x2cce8d);}['closeSourceResourceBalloon'](_0x1970fb){this['_contextPanelView']['closeSourceResourceBalloon'](_0x1970fb);}['focusPromptInput'](_0x32b0f1=!0x1){this['_promptInputView']['focus'](_0x32b0f1);}['setPromptInputValue'](_0x4daedb){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x4daedb;}}class AIChatModelUnavailableMessageView extends Nt{constructor(_0xe98f0c){super(_0xe98f0c);const _0x11569e=new yt(_0xe98f0c);_0x11569e['set']({'label':Mi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x11569e['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':Mi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x11569e]}]});}}class AIHeaderView extends _0x355178{['resizeButton'];constructor(_0x421022,_0x4ab093){super(_0x421022,{'label':_0x4ab093['label'],'class':'ck-ai-header\x20'+_0x4ab093['class'],'icon':_0x4ab093['icon']}),this['set']('isMaximized',!0x1),_0x4ab093['content']&&this['children']['add'](_0x4ab093['content']),_0x4ab093['showResizeButton']&&(this['resizeButton']=Fi(_0x421022,this),this['children']['add'](this['resizeButton']));}}class AIDisclaimerView extends Nt{constructor(_0x9b1cbf){super(_0x9b1cbf),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Mi(_0x9b1cbf,'AI_DISCLAIMER_TEXT')}]}]});}}function Un(_0x3ae71e,_0x30b8eb){const _0x2346b3=new yt(_0x3ae71e);return _0x2346b3['set']({'label':Mi(_0x3ae71e,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x49f9cd,'class':'ck-ai-chat__start-conversation\x20'+Bi}),_0x2346b3['on']('execute',()=>{_0x30b8eb['fire']('startConversation');}),_0x2346b3;}class AIChatView extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x2f3ed6,_0x5b9061){super(_0x2f3ed6),this['_bodyCollection']=new Xt(_0x2f3ed6),this['_bodyCollection']['attachToDom']();const _0x3475eb=Un(_0x2f3ed6,this);this['chatHeader']=new AIHeaderView(_0x2f3ed6,{'label':Mi(_0x2f3ed6,'AI_CHAT_HEADING'),'icon':_0x5de332,'class':'ck-ai-header_chat','content':_0x3475eb,'showResizeButton':_0x5b9061['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new AIChatFeedView(_0x2f3ed6,this['_bodyCollection']),this['chatFeed']['delegate'](...Os)['to'](this),this['chatControls']=new AIChatControlsView(_0x2f3ed6,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x5b9061['contextResourcesSearchInputVisibleFrom'],'filesEnabled':_0x5b9061['filesEnabled']}),this['chatControls']['delegate'](...Os)['to'](this),this['chatDisclaimer']=new AIDisclaimerView(_0x2f3ed6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x2f3ed6['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0xe123c5,_0x56da6f,_0x56f5d8,_0x1670a4){this['chatControls']['populateSourceResourceBalloon'](_0xe123c5,_0x56da6f,_0x56f5d8,_0x1670a4);}['closeSourceResourceBalloon'](_0x5c6297){this['chatControls']['closeSourceResourceBalloon'](_0x5c6297);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class AIChatUI extends _0x2bf4b8{static get['requires'](){return[AITabs];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x4f9ba9){super(_0x4f9ba9);const _0x273951=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue(),this['_view']=new AIChatView(this['context']['locale'],{'showResizeButton':_0x273951['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled')}),this['_view']['delegate']('resizeTabs')['to'](_0x273951),this['_view']['delegate'](...Os)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x522ef4,{showDiff:_0x106493})=>{this['showDiff']=_0x106493;}),this['disableControls'](),_0x273951['view']['addTab']({'id':'chat','buttonLabel':Mi(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x5de332,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x273951['view'],'isMaximized',_0x41914d=>_0x41914d),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x5440e3=>_0x5440e3),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x35f33a){const _0x2c2eeb=this['context']['config']['get']('ai.chat.welcomeMessage')??Mi(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x35f33a['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x2c2eeb}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x2c33f8,staticMessage:_0x4372fc}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2c33f8,'initialContent':'<p>'+_0x4372fc+'</p>'});});}async['addFeedItemUserMessage'](_0x4b2e46){const _0x504546=_0x4b2e46['attributes']?.['displayedPrompt']||_0x4b2e46['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x4b2e46['contextItems']['values']()),'initialContent':'<p>'+_0x504546+'</p>','id':_0x4b2e46['id']});});}async['addFeedItemError']({errorMessage:_0x2bb55b,id:_0x584338}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x2bb55b+'</p>','id':_0x584338});});}async['addFeedItemAIReply'](_0x556dea){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x556dea['interactionId']+':'+_0x556dea['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x89b9df){const _0xad7b9=ms(this['context']),_0x2b0c67=_0xad7b9['map'](_0x174021=>_0x174021['config']['get']('ai.availableReplyActions')||[...Ds]);let _0x593295=_0x2b0c67['reduce']((_0x291f65,_0x3aa124)=>_0x291f65['filter'](_0x359031=>_0x3aa124['includes'](_0x359031)),_0x2b0c67[0x0]||[...Ds]);const _0x4f858e=_0xad7b9['every'](_0x28a784=>_0x28a784['plugins']['has']('TrackChanges')),_0x22f17f=_0xad7b9['map'](_0x235983=>_0x235983['commands']['get']('trackChanges'));return _0x4f858e?this['_isTrackChangesCommandValueBound']||(this['_isTrackChangesCommandValueBound']=!0x0,this['_view']['chatFeed']['bind']('isTrackChangesOn')['toMany'](_0x22f17f,'value',(..._0x42b3ad)=>_0x42b3ad['some'](_0x487750=>_0x487750))):_0x593295=_0x593295['filter'](_0x1dc516=>'insertSuggestion'!=_0x1dc516),this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x89b9df['interactionId']+':'+_0x89b9df['id'],'areActionsDisabled':_0x89b9df['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x593295}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x9e6069,_0x142d98){return this['_promiseQueue']['enqueue'](async()=>{const _0x3c5275=this['_view']['chatFeed']['children']['last'];if(_0x3c5275 instanceof AIChatFeedInteractionHeaderView)return this['_view']['chatFeed']['children']['remove'](_0x3c5275),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x9e6069['id'],'capabilities':{'isWebSearchEnabled':_0x3c5275['capabilities']['isWebSearchEnabled']||_0x142d98['isWebSearchEnabled'],'isReasoningEnabled':_0x3c5275['capabilities']['isReasoningEnabled']||_0x142d98['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x9e6069['id'],'capabilities':_0x142d98});});}async['addFeedItemCustomElement'](_0x13cca0,_0xb2b7fc){let _0x3206c2;return await this['_promiseQueue']['enqueue'](async()=>{_0x3206c2=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x13cca0,'id':_0xb2b7fc});}),_0x3206c2;}['removeFeedItem'](_0x106af7){this['_view']['chatFeed']['removeItem'](_0x106af7);}['hasFeedItem'](_0x495f8f){return this['_view']['chatFeed']['hasItem'](_0x495f8f);}['updateFeedInteractionHeader'](_0x4c42cc){const _0x95080a=this['_view']['chatFeed']['children']['find'](_0x5c0bef=>_0x5c0bef['options']['id']==_0x4c42cc['id']&&_0x5c0bef instanceof AIChatFeedInteractionHeaderView);_0x95080a&&_0x95080a['set']('isVisible',_0x4c42cc['isVisible']);}async['updateFeedItemAIReplyContent'](_0x26fe20){const _0x1e9258=_0x26fe20['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x3eb3ba=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x26fe20,'abortSignal':_0x3eb3ba,'renderingStrategy':_0x1e9258}),_0x26fe20['isDone']&&this['markFeedItemAsDone'](_0x26fe20['id']);});}['updateFeedItemAIReplySources'](_0x5eec12,_0x399014){this['_view']['chatFeed']['updateWebSources'](_0x5eec12,_0x399014);}async['updateFeedItemAIReplySuggestionContent'](_0x26b525){return this['_promiseQueue']['enqueue'](async _0x4b7819=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x26b525,'abortSignal':_0x4b7819}),_0x26b525['isDone']&&this['markFeedItemAsDone'](_0x26b525['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x3f2114){this['_view']['chatFeed']['updateSuggestionPartState'](_0x3f2114);}['setFeedItemAIReplySuggestionPartActive'](_0x1245b7){this['_view']['chatFeed']['setSuggestionPartActive'](_0x1245b7);}['markFeedItemAsDone'](_0x2c477b){this['_view']['chatFeed']['markItemAsDone'](_0x2c477b);}['removeFeedInteraction'](_0x53dc94){this['_view']['chatFeed']['getItemIds']()['filter'](_0x60a0ca=>_0x60a0ca['startsWith'](_0x53dc94))['forEach'](_0x2155d4=>this['_view']['chatFeed']['removeItem'](_0x2155d4));}['startInteraction'](){const _0x58fe49=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x58fe49),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x3fe322){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x462074=>_0x462074['startsWith'](_0x3fe322['id']))['forEach'](_0x444d68=>this['markFeedItemAsDone'](_0x444d68)),this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x1f14c4,_0x560ae2){this['_view']['chatControls']['addContextItem'](_0x1f14c4,_0x560ae2);}['removeContextItem'](_0x3a647f){this['_view']['chatControls']['removeContextItem'](_0x3a647f);}['setContextItemLoading'](_0x33054d,_0x353822){this['_view']['chatControls']['setContextItemLoading'](_0x33054d,_0x353822);}['setIsUploadInProgress'](_0x49d4e6){this['_view']['chatControls']['setIsUploadInProgress'](_0x49d4e6);}['setConversationContext'](_0x176fa2){this['_view']['chatControls']['setConversationContext'](_0x176fa2);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x352d1d,_0x433732,_0x7db304){this['_view']['chatControls']['updateResourceState'](_0x352d1d,_0x433732,_0x7db304);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x653e40){this['_view']['chatControls']['setAddContextOptions'](_0x653e40);}['updateCapabilities'](_0x4d11a9){this['_view']['chatControls']['setWebSearch'](_0x4d11a9['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x4d11a9['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x4d11a9));}['setSelectedModel'](_0x2b505b,_0x54cfc7){this['_view']['chatControls']['setModel'](_0x2b505b),_0x54cfc7&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x396b58){this['feedItemRenderingStrategy']=_0x396b58;}['toggleLoadingSkeleton'](_0x58f938){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x58f938);}['resetConversationTitle'](){this['setConversationTitle'](Mi(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x295bc4,_0x2df9dd=!0x1){if(_0x2df9dd&&!St()&&_0x295bc4['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x295bc4);this['_view']['chatHeader']['label']=_0x295bc4;}['setLoadingMessage'](_0x1eadb4){this['_view']['chatFeed']['setLoadingMessage'](_0x1eadb4);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x5e898a){let _0x2d5574=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x5e898a[_0x2d5574],_0x2d5574++,_0x2d5574===_0x5e898a['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0xc49bb3){return _0xc49bb3['isWebSearchEnabled']&&_0xc49bb3['isReasoningEnabled']?Mi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0xc49bb3['isWebSearchEnabled']?Mi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0xc49bb3['isReasoningEnabled']?Mi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Mi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x3b699f){return _0x3b699f?_0x3b699f['isWebSearchEnabled']&&_0x3b699f['isReasoningEnabled']?Mi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x3b699f['isWebSearchEnabled']?Mi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x3b699f['isReasoningEnabled']?Mi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Mi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Mi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x177786,_0x2769e7,_0x660464,_0x278617){this['_view']['populateSourceResourceBalloon'](_0x177786,_0x2769e7,_0x660464,_0x278617);}['closeSourceResourceBalloon'](_0x17d63f){this['_view']['closeSourceResourceBalloon'](_0x17d63f);}['setPromptInputValue'](_0x469259){this['_view']['chatControls']['setPromptInputValue'](_0x469259);}['focusPromptInput'](_0x995906=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x995906);}['scrollFeedToSuggestion'](_0x165628,_0x5c659d){this['_view']['chatFeed']['scrollToSuggestion'](_0x165628,_0x5c659d);}['startAutoScroll'](_0x257fa8={}){this['_view']['chatFeed']['startAutoScroll'](_0x257fa8);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class AIChatHistorySectionListView extends Dt{['sections'];constructor(_0x34a0d9,_0x5598f8){super(_0x34a0d9),this['sections']=_0x5598f8,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5169c5){let _0x5b1ff1=0x0,_0x3c0fe4=0x0;for(const _0x27a7e2 of this['sections']){const {resultsCount:_0x4a35fb,totalItemsCount:_0x32cc30}=_0x27a7e2['filter'](_0x5169c5);_0x5b1ff1+=_0x4a35fb,_0x3c0fe4+=_0x32cc30;}return{'resultsCount':_0x5b1ff1,'totalItemsCount':_0x3c0fe4};}}class AIChatHistoryListView extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x4f1bcc,{title:_0x348105,items:_0x173ee4}){super(_0x4f1bcc);const _0x20dd00=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x348105,this['itemsViews']=_0x173ee4;const _0x321bdf=new Nt(_0x4f1bcc);_0x321bdf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x4f1bcc),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x20dd00['if']('isVisible','ck-hidden',_0x2ff360=>!_0x2ff360)]},'children':[_0x321bdf,this['_itemsListView']]});}['filter'](_0x2d24ec){const _0x5bddff=this['itemsViews']['length'];let _0x4e5e9f=0x0;for(const _0x1fd11e of this['itemsViews']){if(_0x2d24ec){const _0x2315d9=_0x1fd11e['isMatching'](_0x2d24ec);_0x1fd11e['isVisible']=!!_0x2315d9,_0x1fd11e['highlightText'](_0x2d24ec);}else _0x1fd11e['isVisible']=!0x0,_0x1fd11e['highlightText'](null);_0x1fd11e['isVisible']&&_0x4e5e9f++;}return this['isVisible']=_0x4e5e9f>0x0,{'resultsCount':_0x4e5e9f,'totalItemsCount':_0x5bddff};}['getItem'](_0x4960cb){return this['itemsViews']['find'](_0x112419=>_0x112419['id']===_0x4960cb);}['removeItem'](_0x4e6986){const _0x187530=this['itemsViews']['indexOf'](_0x4e6986);-0x1!==_0x187530&&(this['itemsViews']['splice'](_0x187530,0x1),this['_itemsListView']['items']['remove'](_0x4e6986));}}class AIChatHistoryListItemView extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x116fb2(Ht){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x31cae2,_0x5642a2){super(_0x31cae2);const _0x2c7cce=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x5642a2['pinned']),this['set']('loadingState',null),this['set']('title',_0x5642a2['title']),this['id']=_0x5642a2['id'];const {createdAt:_0x355c2c,active:_0x26a57e=!0x1}=_0x5642a2;this['_titleView']=new _0x72d2dd(),this['_titleView']['bind']('text')['to'](this,'title'),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x40cc5a=this['_createCheckView'](),_0x58b046=this['_createPinButtonView'](_0x31cae2),_0x8b387=this['_createMenuDropdownView'](),_0x5d1096=this['_createEditInputView'](_0x31cae2),_0x3fdd32=this['_createAcceptEditButtonView'](_0x31cae2,_0x5d1096),_0x23b819=this['_createCancelEditButtonView'](_0x31cae2);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x58b046),this['actions']['add'](_0x8b387),this['on']('change:isEdit',(_0x4d213d,_0xbd4b43,_0x422cf4)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x422cf4?(this['actions']['add'](_0x3fdd32),this['actions']['add'](_0x23b819),this['mainContent']['add'](_0x5d1096),_0x5d1096['element']['value']=this['title']||'',_0x5d1096['element']['focus']()):(this['actions']['add'](_0x58b046),this['actions']['add'](_0x8b387),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x26a57e?'ck-ai-chat-history__item--active':'',_0x2c7cce['if']('isVisible','ck-hidden',_0x2c55b7=>!_0x2c55b7),_0x2c7cce['if']('isEdit','ck-ai-chat-history__item--edit')],'role':'listitem'},'children':[{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-check-container']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-check',_0x2c7cce['if']('loadingState','ck-hidden',_0x1f9589=>!!_0x1f9589)]},'children':_0x26a57e?[_0x40cc5a]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2c7cce['if']('loadingState','ck-hidden',_0x219573=>!_0x219573)]},'children':[this['_createSpinnerView']()]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-row']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-content']},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-title-container',_0x2c7cce['if']('loadingState','ck-hidden',_0x3dfed8=>!!_0x3dfed8)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2c7cce['if']('loadingState','ck-hidden',_0x3d7cfc=>!_0x3d7cfc)]},'children':[{'text':_0x2c7cce['to']('loadingState',_0x4b1f4f=>_0x4b1f4f?Mi(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x4b1f4f]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x355c2c]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-actions']},'children':this['actions']}]}]}),this['on']('click',()=>{this['isEdit']||this['fire']('selectConversation',{'id':this['id']});});}['updateTitle'](_0x17fdb1){this['set']('title',_0x17fdb1);}['updateLoadingState'](_0x487c83,_0x37a235){this['set']('loadingState',_0x37a235?_0x487c83:null);}['_createCheckView'](){const _0x1d8549=new Lt();return _0x1d8549['set']({'content':_0x34cc80}),_0x1d8549;}['_createPinButtonView'](_0x43d910){const _0xf0336=new yt(_0x43d910);return _0xf0336['set']({'label':Mi(_0x43d910,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x533bcb,'withText':!0x1,'tooltip':!0x0}),_0xf0336['bind']('isOn')['to'](this,'pinned'),_0xf0336['on']('execute',()=>{const _0x1c0db4=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x1c0db4});}),_0xf0336;}['_createMenuDropdownView'](){const _0x22c664=Ft(this['locale']),_0x3570d3=_0x22c664['panelView']['children'];_0x22c664['buttonView']['set']({'label':Mi(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0xf44d1}),_0x22c664['panelPosition']='sw';const _0x4c6ba4=new yt(this['locale']);_0x4c6ba4['label']=Mi(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x4c6ba4['withText']=!0x0,_0x4c6ba4['on']('execute',()=>{this['isEdit']=!0x0;});const _0x21072d=new yt(this['locale']);_0x21072d['label']=Mi(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x21072d['withText']=!0x0,_0x21072d['on']('execute',()=>{this['showConfirm'](Mi(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x3b15ce=new Dt(this['locale']),_0x187a57=new Ht(this['locale']);_0x187a57['children']['add'](_0x4c6ba4);const _0x6582a7=new Ht(this['locale']);return _0x6582a7['children']['add'](_0x21072d),_0x3b15ce['items']['addMany']([_0x187a57,_0x6582a7]),_0x3570d3['add'](_0x3b15ce),_0x22c664;}['_createEditInputView'](_0xfea9de){const _0x500865=new _0x89a3ef(_0xfea9de),_0x1f7c17=_0x500865['bindTemplate'];return _0x500865['extendTemplate']({'on':{'keydown':_0x1f7c17['to'](_0x57f0ff=>{'Enter'==_0x57f0ff['key']&&this['_commitEditInputValue'](_0x500865);})}}),_0x500865;}['_createAcceptEditButtonView'](_0x3e27b3,_0x2a045f){const _0x564753=new yt(_0x3e27b3);return _0x564753['set']({'icon':_0x34cc80,'withText':!0x1,'tooltip':Mi(_0x3e27b3,'AI_CHAT_HISTORY_ACCEPT')}),_0x564753['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x564753['on']('execute',()=>{this['_commitEditInputValue'](_0x2a045f);}),_0x564753;}['_commitEditInputValue'](_0x1351f3){const _0x29d105=_0x1351f3['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x29d105});}['_createCancelEditButtonView'](_0x5e8976){const _0x4c47b3=new yt(_0x5e8976);return _0x4c47b3['set']({'icon':_0x45e38d,'withText':!0x1,'tooltip':Mi(_0x5e8976,'AI_CHAT_HISTORY_CANCEL')}),_0x4c47b3['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x4c47b3['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x4c47b3;}['_createSpinnerView'](){const _0x30ca75=new AISpinnerView('tiny');return _0x30ca75['isVisible']=!0x0,_0x30ca75;}['isMatching'](_0x2b4e23){return'string'==typeof this['title']&&this['title']['match'](_0x2b4e23)?{'title':!0x0}:null;}['highlightText'](_0x4b430e){this['_titleView']['highlightText'](_0x4b430e);}}class AIChatHistoryView extends Nt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x17e119,_0x16a213){super(_0x17e119),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x41ec2e=Un(_0x17e119,this);this['headerView']=new AIHeaderView(_0x17e119,{'label':Mi(_0x17e119,'AI_CHAT_HISTORY_HEADING'),'icon':_0x511ede,'class':'ck-ai-header_history','content':_0x41ec2e,'showResizeButton':_0x16a213}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new AIChatHistorySectionListView(_0x17e119,[]),this['sectionsView']['delegate'](...Bn)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x3b9293=>!_0x3b9293)]}}),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[this['headerView'],{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x38fb3d=new _0xabfc72(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Mi(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x3b2118=>Mi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x3b2118),'secondary':Mi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x573951=this['_createErrorView']();return _0x573951['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x4ead0f=>!_0x4ead0f)]}}),_0x38fb3d['on']('render',()=>{_0x38fb3d['children']['add'](_0x573951,0x1);}),_0x38fb3d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x49a7e6=>!_0x49a7e6)]}}),_0x38fb3d;}['_createSkeletonView'](){const _0x5ccae3=new AISkeletonView(this['locale'],Ls['aiHistory']);return _0x5ccae3['bind']('isVisible')['to'](this,'isLoading'),_0x5ccae3;}['_createErrorView'](){const _0x554319=new Nt(this['locale']),_0xc14edd=new yt(this['locale']);_0xc14edd['set']({'withText':!0x1,'icon':_0x45e38d,'class':'ck-ai-notification_error__dismiss-button'}),_0xc14edd['bind']('isVisible')['to'](this,'hasItems',_0x2f4f81=>!!_0x2f4f81),_0xc14edd['on']('execute',()=>{this['errorMessage']='';});const _0x2c02bf=this['bindTemplate'];return _0x554319['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x2c02bf['to']('errorMessage')}]},_0xc14edd]}),_0x554319;}['_createEmptyStateView'](){const _0x5bee14=new Nt(this['locale']);return _0x5bee14['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x21965c=>!_0x21965c)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Mi(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x5bee14;}['_createListItemViews'](_0x3742c4,_0x56c7ea){const _0x3f20ed=[];for(const _0x5f0707 of _0x3742c4){const _0x4879f0=new AIChatHistoryListItemView(_0x56c7ea,_0x5f0707);_0x4879f0['delegate'](...Bn)['to'](this),_0x3f20ed['push'](_0x4879f0);}return _0x3f20ed;}['updateHistoryItemsWithCategories'](_0x49d50b){const _0x672ba9=this['locale']||'en',_0x5ef326=[];for(const _0x544931 of _0x49d50b){const _0x37d2cc=this['_createListItemViews'](_0x544931['items'],_0x672ba9);_0x5ef326['push'](new AIChatHistoryListView(_0x672ba9,{'title':_0x544931['title'],'items':_0x37d2cc}));}this['sectionsView']['sections']=_0x5ef326,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x5ef326),this['hasItems']=_0x49d50b['some'](_0x20cc07=>_0x20cc07['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x2ec441){for(const _0x3ee4a2 of this['sectionsView']['sections']){const _0x1f9b78=_0x3ee4a2['getItem'](_0x2ec441);if(_0x1f9b78){if(_0x3ee4a2['removeItem'](_0x1f9b78),0x0===_0x3ee4a2['itemsViews']['length']){const _0x2f136f=this['sectionsView']['sections']['indexOf'](_0x3ee4a2);-0x1!==_0x2f136f&&(this['sectionsView']['sections']['splice'](_0x2f136f,0x1),this['sectionsView']['items']['remove'](_0x3ee4a2));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x3f471b,_0x4718f0){for(const _0x712ce2 of this['sectionsView']['sections']){const _0x24044b=_0x712ce2['getItem'](_0x3f471b);if(_0x24044b){_0x24044b['updateTitle'](_0x4718f0);break;}}}['updateItemLoadingState'](_0x584ae9,_0x34373d,_0x11cf97){for(const _0x504f93 of this['sectionsView']['sections']){const _0xf7aafa=_0x504f93['getItem'](_0x584ae9);if(_0xf7aafa){_0xf7aafa['updateLoadingState'](_0x34373d,_0x11cf97);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x9a20c4=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x9a20c4);}}}const Bn=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class AIChatHistoryUI extends _0x2bf4b8{static get['requires'](){return[AITabs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x13f671){super(_0x13f671);const _0x4747d7=this['context']['plugins']['get']('AITabs');this['_historyView']=new AIChatHistoryView(this['context']['locale'],_0x4747d7['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x4747d7),this['_historyView']['delegate'](...Bn)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x4747d7['view'],'isMaximized',_0x2ffeb1=>_0x2ffeb1),_0x4747d7['view']['addTab']({'id':'history','buttonLabel':Mi(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x511ede,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x34f89b){this['_historyView']['removeHistoryItem'](_0x34f89b);}['updateItems'](_0x460fbf){this['_historyView']['updateHistoryItemsWithCategories'](_0x460fbf);}['updateItemTitle'](_0x25ac82,_0x2de1ab){this['_historyView']['updateItemTitle'](_0x25ac82,_0x2de1ab);}['updateItemLoadingState'](_0x888b46,_0x56cb28,_0x1e0799){this['_historyView']['updateItemLoadingState'](_0x888b46,_0x56cb28,_0x1e0799);}['setLoadingSkeleton'](_0x3394f4){this['_historyView']['isLoading']=_0x3394f4;}['showError'](_0x49fc3c){this['_historyView']['errorMessage']=_0x49fc3c;}['hideError'](){this['_historyView']['errorMessage']='';}}class AIChatHistoryItem extends ct(){['id'];['createdAt'];constructor({id:_0x3acf71,title:_0xbc2c62,createdAt:_0x1d61d4,updatedAt:_0x5b54b2,pinned:_0x5d4829}){super(),this['id']=_0x3acf71,this['createdAt']=new Date(_0x1d61d4),this['set']('title',_0xbc2c62),this['set']('updatedAt',_0x5b54b2?new Date(_0x5b54b2):null),this['set']('pinned',_0x5d4829||!0x1);}['updateTitle'](_0x4a7175){this['set']('title',_0x4a7175),this['updatedAt']=new Date();}['updatePinned'](_0x1b03a6){this['set']('pinned',_0x1b03a6),this['updatedAt']=new Date();}}class AIChatHistoryConversations extends Et(){['items']=[];['connector'];['group'];constructor({connector:_0x36d0b4,group:_0x54a11a}){super(),this['connector']=_0x36d0b4,this['group']=_0x54a11a;}async['init'](){try{const _0x4fb70c=this['connector']['fetchConversations'](this['group']),_0x28ba10=await _0x4fb70c['getConversations']();this['loadItems'](_0x28ba10);}catch(_0x183062){this['fire']('error',{'error':_0x183062,'operation':'init'});}}['addItem'](_0x2d9e91){this['items']['push'](_0x2d9e91);}async['removeItem'](_0x5da751){const _0x31ec24=this['items']['findIndex'](_0x1458b5=>_0x1458b5['id']===_0x5da751);if(-0x1===_0x31ec24)return!0x1;try{return await this['connector']['deleteConversation'](_0x5da751)['execute'](),this['items']['splice'](_0x31ec24,0x1),this['fire']('itemRemoved',{'itemId':_0x5da751}),!0x0;}catch(_0x116bb8){return this['fire']('error',{'error':_0x116bb8,'operation':'removeItem','itemId':_0x5da751}),!0x1;}}['getItem'](_0xd42f5){return this['items']['find'](_0x181901=>_0x181901['id']===_0xd42f5);}async['updateItemTitle'](_0x2bbbfb,_0x36568e){const _0x5c5a96=this['getItem'](_0x2bbbfb);if(!_0x5c5a96)return!0x1;try{return await this['connector']['updateConversation'](_0x2bbbfb,{'title':_0x36568e})['getResult'](),_0x5c5a96['updateTitle'](_0x36568e),this['fire']('itemUpdated',{'itemId':_0x2bbbfb,'updates':{'title':_0x36568e}}),!0x0;}catch(_0x391e07){return this['fire']('error',{'error':_0x391e07,'operation':'updateItemTitle','itemId':_0x2bbbfb}),!0x1;}}async['updateItemPinned'](_0x2bbbd4,_0x499467){const _0x3c9a7b=this['getItem'](_0x2bbbd4);if(!_0x3c9a7b)return!0x1;try{return await this['connector']['updateConversation'](_0x2bbbd4,{'pinned':_0x499467})['getResult'](),_0x3c9a7b['updatePinned'](_0x499467),this['fire']('itemUpdated',{'itemId':_0x2bbbd4,'updates':{'pinned':_0x499467}}),!0x0;}catch(_0xb6e32e){return this['fire']('error',{'error':_0xb6e32e,'operation':'updateItemPinned','itemId':_0x2bbbd4}),!0x1;}}['loadItems'](_0x4eba95){try{this['items']=[],_0x4eba95['map'](_0x31d3c5=>{this['addItem'](new AIChatHistoryItem(_0x31d3c5));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x503812){this['fire']('error',{'error':_0x503812,'operation':'loadItems'});}}['getItems'](_0x47db20={}){const _0x354773=void 0x0!==_0x47db20['pinned']&&_0x47db20['pinned'],_0x377420=_0x47db20['from']?new Date(_0x47db20['from']['getFullYear'](),_0x47db20['from']['getMonth'](),_0x47db20['from']['getDate']()):null,_0x492d20=_0x47db20['to']?new Date(_0x47db20['to']['getFullYear'](),_0x47db20['to']['getMonth'](),_0x47db20['to']['getDate']()):null;return this['items']['filter'](_0xe2558c=>{if(_0xe2558c['pinned']!==_0x354773)return!0x1;if(_0x492d20){const _0x4eea3f=new Date(_0xe2558c['createdAt']['getFullYear'](),_0xe2558c['createdAt']['getMonth'](),_0xe2558c['createdAt']['getDate']());return _0x377420?_0x377420['getTime']()===_0x492d20['getTime']()?_0x4eea3f['getTime']()===_0x377420['getTime']():_0x4eea3f<_0x492d20&&_0x4eea3f>=_0x377420:_0x4eea3f<_0x492d20;}return!0x0;});}}class AIChatHistoryController extends _0x2bf4b8{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[AIConnector,AIChatController,AIChatHistoryUI,AITabs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](AIConnector),this['_aiChatHistoryUi']=this['context']['plugins']['get'](AIChatHistoryUI),this['_aiChatController']=this['context']['plugins']['get'](AIChatController);const _0x574143=this['context']['plugins']['get'](AITabs);try{const _0x4243c4=this['_aiChatController']['getGroupId']();this['history']=new AIChatHistoryConversations({'connector':this['_aiConnector'],'group':_0x4243c4}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x4c18f9,_0x5ed154)=>{this['_setItemLoading'](_0x5ed154['id'],'remove'),this['_handleRemove'](_0x5ed154['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x4a8ef0,_0x44bff2)=>{this['_setItemLoading'](_0x44bff2['id'],'rename'),this['_handleEditTitle'](_0x44bff2['id'],_0x44bff2['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x246756,_0x61892e)=>{void 0x0!==_0x61892e['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x61892e['itemId'],_0x61892e['updates']['title']),void 0x0!==_0x61892e['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x61892e['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x438746,_0x37ffd0)=>{this['_aiChatController']['_handleRemovedConversation'](_0x37ffd0['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x37ffd0['itemId']),this['_clearItemLoading'](_0x37ffd0['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x9c7998,_0x24229b)=>{this['_handleHistoryErrorUI'](_0x24229b['error'],_0x24229b['operation'],_0x24229b['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x4f341b,_0x5dae25)=>{this['_handleSelectConversation'](_0x5dae25['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x2c877f,_0x2ac88d)=>{const _0x2a7cdb=_0x2ac88d['pinned']?'pin':'unpin';this['_setItemLoading'](_0x2ac88d['id'],_0x2a7cdb),this['_handleTogglePin'](_0x2ac88d['id'],_0x2ac88d['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x574143['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x574143['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x58677e){this['_handleHistoryErrorUI'](_0x58677e,'init');}}async['_handleEditTitle'](_0x30e7b8,_0x52a241){await this['history']['updateItemTitle'](_0x30e7b8,_0x52a241);}async['_handleTogglePin'](_0x5e781b,_0x55c39e){await this['history']['updateItemPinned'](_0x5e781b,_0x55c39e);}async['_handleRemove'](_0x432e9a){await this['history']['removeItem'](_0x432e9a);}async['_handleSelectConversation'](_0x17c786){await this['_aiChatController']['loadConversation'](_0x17c786);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x582cfc=this['_aiChatController']['activeConversation']?.['id'],_0x2e0e3d=this['_getCategorizedItems']()['map'](_0x4fbdf8=>({'title':_0x4fbdf8['title'],'items':_0x4fbdf8['items']['map'](_0x48c31d=>({'id':_0x48c31d['id'],'title':_0x48c31d['title']||Mi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x48c31d['createdAt'])['toLocaleDateString'](),'active':_0x48c31d['id']===_0x582cfc,'pinned':_0x48c31d['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x2e0e3d);}['_setItemLoading'](_0x14ac14,_0x393369){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x14ac14,_0x393369,!0x0);}['_clearItemLoading'](_0x2606d8){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2606d8,null,!0x1);}['_handleHistoryErrorUI'](_0x3c6676,_0x41c0a9,_0x21781b){const _0x299606=this['_generateErrorMessage'](_0x41c0a9,_0x21781b);this['_aiChatHistoryUi']['showError'](_0x299606),_0x21781b&&this['_clearItemLoading'](_0x21781b),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x56db41,_0x36273b){const _0x1fa359=_0x36273b?this['history']['getItem'](_0x36273b):null,_0x459f4b=_0x1fa359?.['title']||Mi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x56db41){case'updateItemTitle':return Mi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x459f4b);case'updateItemPinned':{const _0x5a4ef7=Mi(this['context']['locale'],_0x1fa359?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Mi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x5a4ef7,_0x459f4b]);}case'removeItem':return Mi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x459f4b);case'init':case'loadItems':return Mi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Mi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x4a013c=new Date(),_0x5bd9b2=new Date(_0x4a013c['getFullYear'](),_0x4a013c['getMonth'](),_0x4a013c['getDate']()),_0x108bb5=new Date(_0x5bd9b2);_0x108bb5['setDate'](_0x108bb5['getDate']()-0x1);const _0x2ec8ca=new Date(_0x5bd9b2);_0x2ec8ca['setDate'](_0x2ec8ca['getDate']()-0xe);const _0xd248ae=this['history']['getItems']({'pinned':!0x0}),_0x1b1c32=this['history']['getItems']({'from':_0x5bd9b2,'to':_0x5bd9b2}),_0x3927c8=this['history']['getItems']({'from':_0x108bb5,'to':_0x108bb5}),_0x38e6ed=this['history']['getItems']({'from':_0x2ec8ca,'to':_0x108bb5}),_0x4ba7c7=this['history']['getItems']({'to':_0x2ec8ca}),_0x55153a=[];return _0xd248ae['length']>0x0&&_0x55153a['push']({'title':Mi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0xd248ae}),_0x1b1c32['length']>0x0&&_0x55153a['push']({'title':Mi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x1b1c32}),_0x3927c8['length']>0x0&&_0x55153a['push']({'title':Mi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x3927c8}),_0x38e6ed['length']>0x0&&_0x55153a['push']({'title':Mi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x38e6ed}),_0x4ba7c7['length']>0x0&&_0x55153a['push']({'title':Mi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x4ba7c7}),_0x55153a;}}class AIChatHistory extends _0x2bf4b8{static get['requires'](){return[AIChatHistoryController,AIChatHistoryUI];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AIChat extends _0x2bf4b8{static get['requires'](){return[AIChatController,AIEditing,AIChatUI,AIChatHistory];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xfa2d1b){super(_0xfa2d1b),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1,'paste':{'textThreshold':0x5dc}}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class AIChatShortcutView extends yt{['id'];constructor(_0x36caa8,_0x5971ab){super(_0x36caa8);const {id:_0x58506e,type:_0x27cbcf,icon:_0x2c9a3e}=_0x5971ab;this['id']=_0x58506e,this['set']({'label':_0x5971ab['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x5971ab['id']}}),_0x2c9a3e?this['icon']=_0x2c9a3e:'chat'===_0x27cbcf?this['icon']=_0x5de332:'review'===_0x27cbcf?this['icon']=_0x497872:'translate'===_0x27cbcf&&(this['icon']=_0x13c6bf);}}class AIChatShortcutsView extends Nt{['listView'];constructor(_0x3a821d,_0x26afe5){super(_0x3a821d),this['set']('isEnabled',!0x0);const _0x220d5c=_0x26afe5['map'](_0xb6f9d4=>{const _0x252f3=new Ht(this['locale']),_0x2d3652=new AIChatShortcutView(this['locale'],_0xb6f9d4);return _0x2d3652['bind']('isEnabled')['to'](this),_0x252f3['children']['add'](_0x2d3652),_0x2d3652['delegate']('execute')['to'](this),_0x252f3;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x220d5c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Gn='chat-shortcuts';class AIChatShortcuts extends _0x2bf4b8{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];['_listenedConversation'];static get['requires'](){return[AIChatUI];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](AIChatUI),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0xbe34c7=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{const _0x15e6a5=_0xbe34c7['activeConversation'];_0x15e6a5['isFromHistory']||this['_injectShortcuts'](_0x15e6a5);}),this['listenTo'](_0xbe34c7,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x611441=['chat','review','translate'];this['_shortcuts']['forEach'](_0x34ca99=>{let _0x4f0fc2=!0x0;if(_0x34ca99['id']&&_0x34ca99['label']&&_0x611441['includes'](_0x34ca99['type'])?'chat'===_0x34ca99['type']&&(_0x4f0fc2='string'==typeof _0x34ca99['prompt']):_0x4f0fc2=!0x1,!_0x4f0fc2)throw new ht('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x34ca99});});}['_injectShortcuts'](_0x15f7fd){this['_removeShortcuts'](),this['_shortcutsView']=new AIChatShortcutsView(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),this['_aiChatUI']['addFeedItemCustomElement'](this['_shortcutsView']['element'],Gn),this['_shortcutsView']['on']('execute',_0x16f3d5=>{const _0x5e6f96=_0x16f3d5['source']['id'];this['_executeShortcut'](_0x5e6f96);}),this['_listenedConversation']=_0x15f7fd,this['listenTo'](_0x15f7fd,'uploadProgressChanged',(_0x26fa72,_0x43ccd4)=>{this['_shortcutsView']['isEnabled']=!_0x43ccd4['isUploadInProgress'];});}['_removeShortcuts'](){const _0x1b8921=this['context']['plugins']['get'](AIChatUI);_0x1b8921['hasFeedItem'](Gn)&&_0x1b8921['removeFeedItem'](Gn),this['_listenedConversation']&&(this['stopListening'](this['_listenedConversation'],'uploadProgressChanged'),this['_listenedConversation']=void 0x0),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x300bb3){const _0x469048=this['_shortcuts']['find'](_0x56d5dc=>_0x56d5dc['id']===_0x300bb3),_0x1583cb=_0x469048['type'];'chat'===_0x1583cb?this['_runChatShortcut'](_0x469048):'review'===_0x1583cb?_0x469048['commandId']?this['_runReviewShortcut'](_0x469048):this['_switchTab']('reviewMode'):'translate'===_0x1583cb&&(_0x469048['language']?this['_runTranslateShortcut'](_0x469048):this['_switchTab']('translate'));}['_switchTab'](_0x16ccb8){if(!this['context']['plugins']['has']('AITabs'))throw new ht('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x16ccb8});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x16ccb8);}async['_runChatShortcut']({prompt:_0x28495a,draftMode:_0xc7e0d,useWebSearch:_0x349bcc=!0x1,useReasoning:_0x2ab819=!0x1,model:_0x2bd3f6}){const _0x197297=this['context']['plugins']['get']('AIChatController'),_0x322a1c=_0x197297['activeConversation'];let _0x5022f1;_0x5022f1=_0x2bd3f6?await _0x322a1c['chatModels']['getModel'](_0x2bd3f6):await _0x322a1c['chatModels']['getDefault'](),_0x5022f1&&await _0x322a1c['setModel'](_0x5022f1),_0x322a1c['setWebSearch'](_0x349bcc),_0x322a1c['setReasoning'](_0x2ab819),_0x197297['addCurrentDocumentToChatContext'](),_0xc7e0d?(this['_aiChatUI']['setPromptInputValue'](_0x28495a),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x197297['sendMessage']({'message':_0x28495a});}['_runReviewShortcut']({commandId:_0x138c2f,model:_0x1419c5,prompt:_0x1f2527,params:_0x61569d}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ht('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x402f31={'id':_0x138c2f,'isCustom':'custom'===_0x138c2f};_0x1419c5&&_0x1f2527&&(_0x402f31['args']={'model':_0x1419c5,'prompt':_0x1f2527}),_0x61569d&&(_0x402f31['params']=_0x61569d),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x402f31);}['_runTranslateShortcut']({language:_0x5c832b}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ht('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x5c832b,'args':{'language':_0x5c832b}});}}class ToggleAICommand extends _0x2f8b52{constructor(_0x31222e){super(_0x31222e);const _0x9431d7=_0x31222e['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x9431d7,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x1fdbd1=this['editor']['plugins']['get']('AITabs')['view'];_0x1fdbd1['isVisible']=!_0x1fdbd1['isVisible'];}}class AIToggleButtonUI extends _0xaa1572{static get['requires'](){return[AITabs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x11fd53=this['editor'];_0x11fd53['commands']['add']('toggleAi',new ToggleAICommand(_0x11fd53)),_0x11fd53['ui']['componentFactory']['add']('toggleAi',()=>{const _0x5de4b4=this['_createAIUIButton'](yt);return _0x5de4b4['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x5de4b4;}),_0x11fd53['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x3c0b8d=this['_createAIUIButton'](Yt);return _0x3c0b8d['set']({'role':'menuitemcheckbox'}),_0x3c0b8d;});}['_createAIUIButton'](_0x19c27e){const _0x43ebd1=this['editor'],_0x55130c=_0x43ebd1['commands']['get']('toggleAi'),_0x3dbae9=new _0x19c27e(_0x43ebd1['locale']);return _0x3dbae9['set']({'label':Mi(_0x43ebd1['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x368b3f,'isToggleable':!0x0}),_0x3dbae9['bind']('isEnabled')['to'](_0x55130c),_0x3dbae9['bind']('isOn')['to'](_0x55130c,'value',_0x3353ef=>!!_0x3353ef),this['listenTo'](_0x3dbae9,'execute',()=>{_0x55130c['execute']();}),_0x3dbae9;}}const Fn=['applySuggestion','insertSuggestion','showNext','showPrevious'];class AIBalloonView extends Nt{['_errorView'];constructor(_0x5da707){super(_0x5da707),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x534ca0){this['showError'](_0x534ca0);}['showError'](_0x460060){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x460060,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x53c5f3=new Nt(this['locale']),_0x260cde=new Nt(this['locale']);return _0x260cde['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x53c5f3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x18d811=>!_0x18d811)]},'children':[_0x260cde]}),_0x53c5f3;}}const Wn=0xa;class AIBalloon extends _0x2bf4b8{static get['requires'](){return[AIEditing];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_editor'];['_isUpdatingMarkers']=!0x1;['open'](_0x18e493){const {id:_0x3915da}=this['_currentConfig']??{};this['_currentConfig']=_0x18e493,this['_editor']=_0x18e493['targetEditor'];const {id:_0x554280}=this['_currentConfig'];this['isOpen']&&_0x3915da===_0x554280?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x271774=this['_editor'];if(!_0x271774)return;const _0x24ae48=_0x271774['plugins']['get']('Dialog');_0x24ae48['isOpen']&&this['_currentConfig']&&_0x24ae48['id']===this['_currentConfig']['id']&&_0x24ae48['hide']();}['_updateDialog'](){const _0x555b18=this['_editor']['plugins']['get']('Dialog'),{icon:_0x248cf7,title:_0x98e863}=this['_currentConfig'];_0x555b18['view']?.['headerView']&&(_0x555b18['view']['headerView']['label']=_0x98e863,_0x555b18['view']['headerView']['iconView']&&_0x248cf7&&(_0x555b18['view']['headerView']['iconView']['content']=_0x248cf7)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x555b18['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['showFakeVisualSelection']({'editor':this['_editor'],'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x5dd846=this['_editor']['plugins']['get']('Dialog'),{id:_0x3a77cb,title:_0x1c112b,icon:_0x5765ee,class:_0x7eca3f,mainView:_0x26d241}=this['_currentConfig'];_0x26d241['delegate'](...Fn)['to'](this),_0x5dd846['show']({'title':_0x1c112b,'icon':_0x5765ee,'hasCloseButton':!0x0,'id':_0x3a77cb,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x7eca3f||''),'content':_0x26d241,'onShow':_0xd54982=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0xd54982['view']?.['updatePosition']();const _0x27a6c7=this['_getSelectionElements']();_0x27a6c7&&_0x27a6c7[0x0]&&Tt({'target':_0x27a6c7[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0xd54982['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x3a77cb});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x3a77cb}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x32e5d1,_0x4df36b){if(!_0x4df36b){const _0x3c2a19=this['_getTargetRootDomRect']();if(!_0x3c2a19)return null;_0x4df36b=_0x3c2a19;}const _0x3dacc9=this['_getSelectionElements']();if(!_0x3dacc9||0x0===_0x3dacc9['length'])return{'left':Math['round'](_0x4df36b['left']+_0x4df36b['width']/0x2-_0x32e5d1['width']/0x2),'top':Math['round'](_0x4df36b['top']+_0x4df36b['height']/0x2-_0x32e5d1['height']/0x2)};const _0x2f35d0=Math['round'](_0x4df36b['left']+_0x4df36b['width']/0x2-_0x32e5d1['width']/0x2),_0xbdc12e=_0x3dacc9['map'](_0x356c28=>new dt(_0x356c28)),_0x4b9237=_0x32e5d1['height'];return{'left':_0x2f35d0,'top':this['_calculateOptimalTopPosition'](_0xbdc12e,_0x4b9237,_0x4df36b)};}['_calculateOptimalTopPosition'](_0x33a5d8,_0x2f0d39,_0x418df0){const _0x3c6fba=new dt(lt['window']),_0x56c945=_0x33a5d8['map'](_0x3fc4e7=>_0x3fc4e7['getVisible']())['filter'](_0x3f1dcb=>_0x3f1dcb),_0x4931c6=dt['getBoundingRect'](_0x56c945);if(!_0x4931c6)return Math['round'](_0x418df0['top']+_0x418df0['height']/0x2);const _0x392f09=_0x3c6fba['getIntersection'](_0x4931c6);if(!_0x392f09)return Math['round'](_0x418df0['top']+_0x418df0['height']/0x2);const _0x19dfb4=_0x418df0['getVisible'](),_0x2d62a2=_0x19dfb4&&_0x4931c6['height']>_0x19dfb4['height'],_0x5d8cfb=_0x392f09['top'],_0x472d33=_0x392f09['bottom'];if(_0x2d62a2){const _0x59b434=(_0x19dfb4||_0x3c6fba)['height']/0x2-_0x2f0d39/0x2,_0x101fd4=_0x5d8cfb-Wn-_0x418df0['top'],_0x4464c4=_0x418df0['bottom']-_0x472d33-Wn;return _0x101fd4>=_0x2f0d39?Math['max'](Wn,_0x5d8cfb-_0x2f0d39-Wn):_0x4464c4>=_0x2f0d39?_0x472d33+Wn:Math['max'](Wn,_0x59b434);}const _0x553a62=_0x5d8cfb-_0x2f0d39,_0x3f7307=_0x418df0['bottom']-_0x472d33-Wn,_0x273b9e=_0x5d8cfb-Wn-_0x418df0['top'];let _0x41f815;if(_0x3f7307>=_0x2f0d39)_0x41f815=_0x472d33+Wn;else{if(_0x273b9e>=_0x2f0d39)_0x41f815=_0x553a62-Wn;else _0x41f815=_0x5d8cfb+_0x4931c6['height']/0x2-_0x2f0d39/0x2;}return _0x41f815;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0xd52c1d=this['_editor'];this['listenTo'](_0xd52c1d['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x35dbcc,data:{newRange:_0x1b9735}}of _0xd52c1d['model']['document']['differ']['getChangedMarkers']())if(_0x35dbcc['startsWith'](Rs+':')&&(_0x1b9735&&(_0x1b9735['start']['isEqual'](_0x1b9735['end'])||'$graveyard'==_0x1b9735['root']['rootName'])||null==_0x1b9735)){const _0x5019c0=Mi(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x5019c0),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x5369e0=this['_editor'];this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x5369e0['model']['document']);}['_getSelectionElements'](){const _0x1b4acc=this['_editor'];return _0x3f723c(_0x1b4acc['editing'],[..._0x1b4acc['model']['markers']['getMarkersGroup']('ai-selection'),..._0x1b4acc['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x41df85=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x41df85)return null;const _0x2cb4bf=this['_editor'],_0x45ca0e=_0x2cb4bf['editing']['view']['document']['getRoot'](_0x41df85['rootName']);if(!_0x45ca0e)return null;const _0x3af6e5=_0x2cb4bf['editing']['view']['domConverter']['mapViewToDom'](_0x45ca0e);return _0x3af6e5&&_0x3af6e5 instanceof HTMLElement?new dt(_0x3af6e5):null;}}class AIMiniToolbarView extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x23d022,_0x12fc3f={}){super(_0x23d022),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x12fc3f};const _0x55410f=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x55410f?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x551aea){this['showChangesButton']['isEnabled']=_0x551aea;}['_setupRatingButtons'](){this['likeButton']=new yt(this['locale']),this['likeButton']['set']({'icon':_0x2b92aa,'label':Mi(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':Gi,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new yt(this['locale']),this['dislikeButton']['set']({'icon':_0x9aefe6,'label':Mi(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':Gi,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new yt(this['locale']),this['copyButton']['set']({'icon':_0x46c01f,'label':Mi(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+Gi,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x30a510=new Lt();_0x30a510['set']({'content':_0x34cc80}),_0x30a510['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied\x20'+Gi,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+Gi;},0x7d0);}),this['copyButton']['children']['add'](_0x30a510);}['_setupShowChangesButton'](){this['showChangesButton']=new yt(this['locale']),this['showChangesButton']['set']({'icon':_0x43a129,'label':Mi(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':Gi}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x17629f=>_0x17629f?_0x42017b:_0x43a129),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class AIChatBalloonView extends AIBalloonView{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x7f8c96,_0x50f725){super(_0x7f8c96);const _0x54e5d3=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new It(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x50f725,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x7f8c96),this['_partToolbarView']=new AISuggestionContentPartToolbarView(_0x7f8c96,_0x50f725['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x50f725),this['_stateView']=new AISuggestionContentPartStateView(_0x7f8c96),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new AIMiniToolbarView(_0x7f8c96,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new AIChatBalloonToolbarContainerView(_0x7f8c96,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x5c2e7f,_0x269d67,_0x38364b,_0x3ae270)=>{let _0x339f18,_0x31a7ff;'pending'===_0x3ae270?(_0x339f18=this['_partToolbarView'],_0x31a7ff=this['_stateView']):(_0x339f18=this['_stateView'],_0x31a7ff=this['_partToolbarView']),this['_stateView']['setState'](_0x38364b),_0x339f18['isVisible']=!0x1,_0x31a7ff['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x54e5d3['to']('_state',_0x4ffd8b=>'ck-ai-chat-balloon-main_state_'+_0x4ffd8b)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x50f725);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x5af945){_0x5af945?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x5af945);}['clearContent'](){this['_streamableContentView']['clear']();}['setState'](_0x5198f1){this['_state']=_0x5198f1;}['showError'](_0x14fb93){super['showError'](_0x14fb93),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x96cb9){super['showBlockingError'](_0x96cb9),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x558614){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x558614;}['togglePartToolbarEnabled'](_0x4a27a7){this['_partToolbarView']['isEnabled']=_0x4a27a7;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x4bfec6,showSuggestButton:_0x4eb12c}){_0x4bfec6=_0x4bfec6&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x4eb12c=_0x4eb12c&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x4bfec6,'showSuggestButton':_0x4eb12c});}['_createNextButtonView'](){const _0xaafe3c=new yt(this['locale']);return _0xaafe3c['set']({'icon':_0x4f0514,'label':Mi(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0xaafe3c['on']('execute',()=>{this['fire']('showNext');}),_0xaafe3c;}['_createPreviousButtonView'](){const _0x41d5e7=new yt(this['locale']);return _0x41d5e7['set']({'icon':_0x9f74cc,'label':Mi(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x41d5e7['on']('execute',()=>{this['fire']('showPrevious');}),_0x41d5e7;}}class AIChatBalloonToolbarContainerView extends Nt{constructor(_0x370310,_0x498bc5){super(_0x370310),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x498bc5});}}class AIChatBalloon extends _0xaa1572{static get['requires'](){return[Gt,AIBalloon];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x3e9de6){super(_0x3e9de6),this['set']('showDiff',!0x1);}['open'](_0x214429){const _0x2b0f8c=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2b0f8c['plugins']['get']('AIBalloon')['open']({..._0x214429,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x214429['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x214429['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x26dd7a){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x26dd7a);}['clearContent'](){this['_chatBalloonView']&&this['_chatBalloonView']['clearContent']();}['setState'](_0x3e10b4){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x3e10b4);}['_createChatBalloonView'](){const _0x2df3d9=this['editor'],_0x14878e=_0x2df3d9['plugins']['get']('AIBalloon'),_0x3070db=_0x2df3d9['commands']['get']('trackChanges');let _0x330d11=_0x2df3d9['config']['get']('ai.availableReplyActions')||[...Ds];_0x2df3d9['plugins']['has']('TrackChanges')||(_0x330d11=_0x330d11['filter'](_0xe407b3=>'insertSuggestion'!=_0xe407b3));const _0x22bbb7=new AIChatBalloonView(_0x2df3d9['locale'],{'availableActions':_0x330d11,'showApplyButton':!0x0,'showSuggestButton':!!_0x3070db});return _0x22bbb7['bind']('showDiff')['to'](this),_0x22bbb7['delegate'](...Ss)['to'](this),_0x22bbb7['delegate']('showPrevious','showNext')['to'](this),_0x14878e['delegate']('dialogClosed')['to'](this),_0x22bbb7['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x22bbb7['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x22bbb7['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x3070db&&_0x22bbb7['bind']('isTrackChangesOn')['to'](_0x3070db,'value'),_0x22bbb7['render'](),_0x22bbb7;}['_toggleRotatorButtonsInDialogHeader'](_0x24841e){const _0xa0de5a=this['editor'],_0x1d863b=_0xa0de5a['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x24841e),_0x1d863b['has'](this['_chatBalloonView']['previousButtonView'])||(_0x1d863b['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0xa0de5a['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x1d863b['remove'](this['_chatBalloonView']['previousButtonView']),_0x1d863b['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class AIEditorIntegration extends _0xaa1572{static get['requires'](){return[AIToggleButtonUI,AIChatBalloon,_0x1318a9];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Kn(_0x380f4a){const {editor:_0x452cca,action:_0x44f50b,withText:_0x56528c=!0x1,withIcon:_0xb3e014=!0x0,isInDropdown:_0x573c4c=!0x0,shouldPreventFocus:_0x4707cd=!0x1,actionButtons:_0x1c05a1}=_0x380f4a;return()=>{const _0x33e5d2=_0x452cca['locale'],_0x5188c9=new yt(_0x33e5d2),_0x32de0c=_0x5188c9['bindTemplate'];_0x573c4c&&_0x5188c9['extendTemplate']({'on':{'mouseenter':_0x32de0c['to'](()=>{_0x4707cd&&_0x4707cd()||_0x5188c9['focus']();})}}),_0x1c05a1['push']({'buttonView':_0x5188c9,'action':_0x44f50b});const _0x1643ef=_0x44f50b['icon']??_0x44f50b['parent']?.['icon'];return _0x5188c9['set']({'label':_0x44f50b['label'],'withText':_0x56528c,'role':'menuitem','icon':_0xb3e014?_0x1643ef??_0xd64df0:void 0x0,'tooltip':!_0x56528c,'class':'ck-ai-quick-actions-button','isEnabled':_0x44f50b['isEnabled']}),_0x5188c9['on']('execute',()=>{_0x452cca['editing']['view']['focus'](),_0x452cca['commands']['execute']('aiQuickAction',_0x44f50b);}),_0x5188c9;};}class DropdownMenuButtonWithHighlightView extends _0x7b7d38{['arrowView'];constructor(_0x491c7f,_0x48a7fd){super(_0x491c7f,_0x48a7fd);const _0x39a37d=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x3f3ec5=>String(_0x3f3ec5)),'data-cke-tooltip-disabled':_0x39a37d['to']('isOn')},'on':{'mouseenter':_0x39a37d['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x18e25d=new Lt();return _0x18e25d['content']=_0xdfd917,_0x18e25d['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x18e25d;}}class AIQuickActionsFilteredListView extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x28e3d5,_0x52dc91,_0x14346e){super(_0x28e3d5),this['_allListItems']=_0x52dc91,this['_allSearchableItems']=_0x14346e;}['filter'](_0x46fadf){if(!_0x46fadf)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x194672=_0x46fadf['source']['toLowerCase']()['trim'](),_0x15955e=this['_allSearchableItems']['filter'](_0x319777=>(_0x319777['groupLabel']?_0x319777['label']+'\x20('+_0x319777['groupLabel']+')':_0x319777['label'])['toLowerCase']()['includes'](_0x194672));return this['items']['clear'](),this['items']['addMany'](_0x15955e['sort']((_0x69b151,_0x41def2)=>{const _0x40c12e=_0x69b151['groupLabel'],_0x48e6c3=_0x41def2['groupLabel'];return _0x40c12e||_0x48e6c3?_0x40c12e?0x1:-0x1:0x0;})['map'](_0x5787a1=>_0x5787a1['item'])),this['_highlightQuery'](_0x194672,_0x15955e),{'resultsCount':_0x15955e['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x1c5de8,_0x42c161){if(!_0x1c5de8)return;const _0x15df6a=new RegExp(_0x40e363(_0x1c5de8),'gi');_0x42c161['forEach'](_0x4b9411=>{_0x4b9411['highlightViews']&&_0x4b9411['highlightViews']['forEach'](_0x13a7a1=>{'function'==typeof _0x13a7a1['highlightText']&&_0x13a7a1['highlightText'](_0x15df6a);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x4dcd4f=>{_0x4dcd4f['highlightViews']&&_0x4dcd4f['highlightViews']['forEach'](_0x43ee38=>{'function'==typeof _0x43ee38['highlightText']&&_0x43ee38['highlightText'](null);});});}}const Yn='menu',$n='menuitem';class AIQuickActionsDropdownContentView extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];['_actionButtons'];constructor(_0x469332,_0x38cfa8,_0x199bb2,_0x17044a,_0x28fe70=!0x1,_0x4ba7f8=[]){const _0x513a0c=_0x469332['locale'];super(_0x513a0c),this['_bodyCollection']=_0x17044a,this['_hasSearch']=_0x28fe70,this['_actionButtons']=_0x4ba7f8;const _0x5c1fd4=this['_createListItems'](_0x469332,_0x38cfa8,_0x199bb2);this['optionsListView']=new AIQuickActionsFilteredListView(_0x513a0c,_0x5c1fd4,this['_allSearchableItems']),this['optionsListView']['role']=Yn,this['optionsListView']['items']['addMany'](_0x5c1fd4),this['focusTracker']=new It(),this['keystrokes']=new At(),_0x28fe70&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x5c1fd4,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x28fe70&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x2f1900=_0x28fe70&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x42c8a3(_0x2f1900),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x513a0c['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0xabfc72(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':Mi(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':Mi(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x3d60d2=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x3d60d2);}['_createListItems'](_0x3c13ab,_0x1fbe28,_0x526a25){const _0x4e6b80=new _0x42c8a3();return _0x1fbe28['forEach'](_0x40b09a=>{if('actions'in _0x40b09a){const {listItem:_0x1f5d6f}=this['_createActionGroupButton'](_0x3c13ab,_0x40b09a,_0x526a25);_0x4e6b80['add'](_0x1f5d6f),_0x40b09a['actions']['forEach'](_0x27f7f4=>{const {listItem:_0x2131a8,highlightViews:_0x767a7d}=this['_createSearchResultActionButton'](_0x3c13ab,_0x27f7f4,_0x40b09a['label'],_0x40b09a['icon']);this['_allSearchableItems']['push']({'item':_0x2131a8,'label':_0x27f7f4['label'],'groupLabel':_0x40b09a['label'],'highlightViews':_0x767a7d});});}else{const {listItem:_0x5dc816}=this['_createActionButton'](_0x3c13ab,_0x40b09a);_0x4e6b80['add'](_0x5dc816);const _0x31fa8b=_0x5dc816['children']['first'];if(_0x31fa8b){const {listItem:_0x2a7b0f,highlightViews:_0x43dcce}=this['_createSearchResultActionButton'](_0x3c13ab,_0x40b09a);this['_allSearchableItems']['push']({'item':_0x2a7b0f,'label':_0x31fa8b['label']||'','highlightViews':_0x43dcce});}}}),_0x4e6b80;}['_createActionButton'](_0x2bcb42,_0x32f1c2,_0x1f7387,_0x250bac){const _0x4af529=new Ht(this['locale']);if(_0x1f7387&&_0x250bac){const _0x3f539c=new yt(this['locale']),_0x2bca51=_0x3f539c['bindTemplate'],_0x452406=new _0x72d2dd();_0x452406['text']=_0x32f1c2['label'];const _0x346b01=new _0x72d2dd();_0x346b01['text']=_0x1f7387;const _0x42febe=new Lt();_0x42febe['content']=_0x250bac,_0x42febe['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0xefdebc=new Nt(this['locale']);_0xefdebc['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x1cdb41=new Nt(this['locale']);return _0x1cdb41['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x3f539c['set']({'label':_0x32f1c2['label']+'\x20('+_0x1f7387+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1,'isEnabled':_0x32f1c2['isEnabled']}),_0x3f539c['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group',_0x2bca51['if']('isEnabled','ck-disabled',_0x258965=>!_0x258965)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x452406,_0xefdebc,_0x42febe,_0x346b01,_0x1cdb41],'on':{'mouseenter':_0x2bca51['to'](()=>{this['_isSearchFocused']()||_0x3f539c['focus']();}),'click':_0x2bca51['to'](()=>{_0x3f539c['fire']('execute');})}}),_0x3f539c['on']('execute',()=>{_0x3f539c['isEnabled']&&(_0x2bcb42['editing']['view']['focus'](),_0x2bcb42['commands']['execute']('aiQuickAction',_0x32f1c2));}),_0x4af529['children']['add'](_0x3f539c),this['_actionButtons']['push']({'buttonView':_0x3f539c,'action':_0x32f1c2}),{'listItem':_0x4af529,'highlightViews':[_0x452406,_0x346b01]};}{const _0x3a6772=new _0x519544(),_0xae6b0=new yt(this['locale'],_0x3a6772),_0x4b2505=_0xae6b0['bindTemplate'],_0x5e1bce=_0x32f1c2['icon']??_0x32f1c2['parent']?.['icon'],_0x5d1b01=void 0x0!==_0x32f1c2['icon'];return _0xae6b0['set']({'label':_0x32f1c2['label'],'withText':!0x0,'role':'menuitem','icon':_0x5d1b01?_0x5e1bce??_0xd64df0:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button','isEnabled':_0x32f1c2['isEnabled']}),_0xae6b0['extendTemplate']({'on':{'mouseenter':_0x4b2505['to'](()=>{this['_isSearchFocused']()||_0xae6b0['focus']();})}}),_0xae6b0['on']('execute',()=>{_0x2bcb42['editing']['view']['focus'](),_0x2bcb42['commands']['execute']('aiQuickAction',_0x32f1c2);}),_0x4af529['children']['add'](_0xae6b0),this['_actionButtons']['push']({'buttonView':_0xae6b0,'action':_0x32f1c2}),{'listItem':_0x4af529,'highlightViews':[_0x3a6772]};}}['_createSearchResultActionButton'](_0x2d4a1c,_0x31bff2,_0x3a3872,_0x30b39c){return _0x3a3872&&_0x30b39c?this['_createSearchResultGroupedActionButton'](_0x2d4a1c,_0x31bff2,_0x3a3872,_0x30b39c):this['_createSearchResultIndividualActionButton'](_0x2d4a1c,_0x31bff2);}['_createSearchResultGroupedActionButton'](_0x580a67,_0x381cf7,_0x135032,_0x534cba){const _0x30c993=new Ht(this['locale']),_0x51e295=new yt(this['locale']),_0x30dafc=_0x51e295['bindTemplate'],{view:_0x3af500,highlightView:_0x3d984a}=this['_createSearchResultGroupRow'](_0x135032,_0x534cba),{view:_0x68ef13,highlightView:_0x361261}=this['_createSearchResultActionRow'](_0x381cf7['label']),_0x12e77d=this['_createSearchResultContentView'](_0x3af500,_0x68ef13);return _0x51e295['set']({'label':_0x381cf7['label'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1,'isEnabled':_0x381cf7['isEnabled']}),_0x51e295['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group',_0x30dafc['if']('isEnabled','ck-disabled',_0x5ef6bd=>!_0x5ef6bd)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x12e77d],'on':{'mouseenter':_0x30dafc['to'](()=>{this['_isSearchFocused']()||_0x51e295['focus']();}),'click':_0x30dafc['to'](()=>{this['_handleSearchResultButtonClick'](_0x51e295);})}}),this['_setupActionButtonExecution'](_0x51e295,_0x580a67,_0x381cf7),_0x30c993['children']['add'](_0x51e295),this['_actionButtons']['push']({'buttonView':_0x51e295,'action':_0x381cf7}),{'listItem':_0x30c993,'highlightViews':[_0x3d984a,_0x361261]};}['_createSearchResultIndividualActionButton'](_0x3dc25e,_0x5aafbe){const _0x5f3582=new Ht(this['locale']),_0x2c1fca=new _0x519544(),_0xf21c5e=new yt(this['locale'],_0x2c1fca),_0x1359c7=_0xf21c5e['bindTemplate'];return _0xf21c5e['set']({'label':_0x5aafbe['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button','isEnabled':_0x5aafbe['isEnabled']}),_0xf21c5e['extendTemplate']({'on':{'mouseenter':_0x1359c7['to'](()=>{this['_isSearchFocused']()||_0xf21c5e['focus']();})}}),this['_setupActionButtonExecution'](_0xf21c5e,_0x3dc25e,_0x5aafbe),_0x5f3582['children']['add'](_0xf21c5e),this['_actionButtons']['push']({'buttonView':_0xf21c5e,'action':_0x5aafbe}),{'listItem':_0x5f3582,'highlightViews':[_0x2c1fca]};}['_createSearchResultGroupRow'](_0x1e3496,_0x37287d){const _0x56fdb7=new Nt(this['locale']),_0x15bd41=new Lt();_0x15bd41['content']=_0x37287d,_0x15bd41['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x10c15a=new _0x72d2dd();return _0x10c15a['text']=_0x1e3496,_0x56fdb7['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x15bd41,_0x10c15a]}),{'view':_0x56fdb7,'highlightView':_0x10c15a};}['_createSearchResultActionRow'](_0x4f5e80){const _0x2b17be=new Nt(this['locale']),_0x660bf0=new _0x72d2dd();return _0x660bf0['text']=_0x4f5e80,_0x2b17be['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x660bf0]}),{'view':_0x2b17be,'highlightView':_0x660bf0};}['_createSearchResultContentView'](_0x159199,_0x179e33){const _0x550230=new Nt(this['locale']);return _0x550230['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x159199,_0x179e33]}),_0x550230;}['_setupActionButtonExecution'](_0x4bf175,_0x560ff0,_0x28e4cb){_0x4bf175['on']('execute',()=>{_0x4bf175['isEnabled']&&(_0x560ff0['editing']['view']['focus'](),_0x560ff0['commands']['execute']('aiQuickAction',_0x28e4cb));});}['_createActionGroupButton'](_0x4b9f45,_0x425e03,_0x2b0aac){const _0x37bf64=new Ht(this['locale']),_0x580073=new _0x519544(),_0x164409=new DropdownMenuButtonWithHighlightView(this['locale'],_0x580073),_0x2ed6ec=_0x164409['bindTemplate'],_0x272923=this['_getPanelKeystroke'](_0x2b0aac),_0x1b534d=this['_createGroupActionsList'](_0x4b9f45,_0x425e03['actions'],_0x2b0aac);_0x164409['set']({'label':_0x425e03['label'],'withText':!0x0,'role':$n,'icon':_0x425e03['icon']??_0xd64df0,'isEnabled':_0x425e03['actions']['some'](_0x30d710=>_0x30d710['isEnabled'])}),_0x164409['extendTemplate']({'on':{'mouseenter':_0x2ed6ec['to'](()=>{this['_isSearchFocused']()||_0x164409['focus']();})}});const _0x3f5a19=new zt(this['locale']);return _0x3f5a19['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x2ed6ec['to'](_0x129ec6=>{this['_handlePanelKeydown'](_0x129ec6,_0x272923,_0x164409,_0x3f5a19);})}}),_0x164409['bind']('isOn')['to'](_0x3f5a19,'isVisible'),this['_bodyCollection']['add'](_0x3f5a19),_0x3f5a19['content']['add'](_0x1b534d),this['_setupGroupMenuBehavior'](_0x164409,_0x3f5a19),_0x37bf64['children']['add'](_0x164409),this['_actionButtons']['push']({'buttonView':_0x164409,'action':_0x425e03}),{'listItem':_0x37bf64,'highlightView':_0x580073};}['_createGroupActionsList'](_0x331482,_0x2a33d2,_0x4bacf6){const _0x9102c6=new Dt(this['locale']);return _0x9102c6['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x2a33d2['forEach'](_0x10c623=>{const _0x446660=new Ht(this['locale']),_0x1922ec=Kn({'editor':_0x331482,'action':_0x10c623,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused'](),'actionButtons':this['_actionButtons']})();_0x446660['children']['add'](_0x1922ec),_0x4bacf6['focusTracker']['add'](_0x1922ec),_0x9102c6['items']['add'](_0x446660);}),_0x9102c6;}['_setupGroupMenuBehavior'](_0x4b0a4e,_0x3a7e94){const _0x3904b5=_0x4b0a4e['bindTemplate'],_0xa5c332=this['_getButtonKeystroke'](_0x4b0a4e);_0x4b0a4e['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x3904b5['to'](()=>{this['_showNestedPanel'](_0x3a7e94,_0x4b0a4e);}),'mouseleave':_0x3904b5['to'](_0x553687=>{const _0x351a0c=_0x553687['relatedTarget'];this['_isMovingToNestedMenu'](_0x351a0c,_0x3a7e94)||this['_hideNestedPanel'](_0x3a7e94);}),'keydown':_0x3904b5['to'](_0x336723=>{_0x336723['key']==_0xa5c332&&(this['_showNestedPanel'](_0x3a7e94,_0x4b0a4e),_0x3a7e94['content']['get'](0x0)['focus']());})}}),_0x3a7e94['on']('render',()=>{_0x3a7e94['element']?.['addEventListener']('mouseleave',_0x223c54=>{const _0x292e29=_0x223c54['relatedTarget'];_0x4b0a4e['element']?.['contains'](_0x292e29)||this['_isMovingToNestedMenu'](_0x292e29,_0x3a7e94)||this['_hideNestedPanel'](_0x3a7e94);});});}['_showNestedPanel'](_0x2de3d2,_0x29ed88){this['_openNestedPanels']['forEach'](_0x48ab38=>{_0x48ab38!==_0x2de3d2&&_0x48ab38['isVisible']&&_0x48ab38['hide']();}),_0x2de3d2['show'](),_0x2de3d2['pin']({'positions':[_0x413191['eastSouth']],'target':_0x29ed88['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2de3d2);}['_hideNestedPanel'](_0x28ea46){_0x28ea46['hide'](),this['_openNestedPanels']['delete'](_0x28ea46);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x1cd403=>_0x1cd403['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x53d280,_0x33d2fd){if(!_0x53d280)return!0x1;if(_0x33d2fd['element']?.['contains'](_0x53d280))return!0x0;const _0x250019=_0x53d280;return _0x250019['closest']&&(null!==_0x250019['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x250019['closest']('.ck-ai-quick-actions-group-list')||null!==_0x250019['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x18ebcb){return'rtl'===_0x18ebcb['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0xc1543f){return'rtl'===_0xc1543f['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x192653,_0x5585e5,_0x2f0b16,_0x279a41){_0x192653['key']==_0x5585e5&&(_0x2f0b16['focus'](),this['_hideNestedPanel'](_0x279a41));}['_handleSearchResultButtonClick'](_0x52408c){_0x52408c['fire']('execute');}}function qn(_0x1eb521){const {editor:_0x473771,content:_0x2b322d,buttonDefinition:_0x121936,bodyCollection:_0x44c55b,hasSearch:_0x4b2705=!0x1,actionButtons:_0x33a3e8}=_0x1eb521;return()=>{const _0x2e6179=_0x473771['locale'],_0x2d539f=_0x473771['commands']['get']('aiQuickAction'),_0x9960d3=Ft(_0x2e6179);_0x9960d3['bind']('isEnabled')['to'](_0x2d539f),_0x9960d3['buttonView']['set']({'icon':_0x121936['icon']??_0xd64df0,'label':_0x121936['label'],'tooltip':!0x0}),_0x9960d3['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1816af=new AIQuickActionsDropdownContentView(_0x473771,_0x2b322d,_0x9960d3,_0x44c55b,_0x4b2705,_0x33a3e8);return _0x9960d3['panelView']['children']['add'](_0x1816af),_0x4b2705&&_0x9960d3['on']('change:isOpen',(_0x4b8437,_0x37487b,_0x3d4c28)=>{if(_0x3d4c28){if(_0x473771['plugins']['has']('AIEditing')){const _0x58d93d=_0x473771['plugins']['get'](AIEditing),_0x385e26=_0x473771['model']['document']['selection'],_0x2595db=Array['from'](_0x385e26['getRanges']());_0x2595db['length']>0x0&&_0x58d93d['showFakeVisualSelection']({'editor':_0x473771,'ranges':_0x2595db,'id':'quick-action','priority':0x14});}}else _0x473771['plugins']['has']('AIEditing')&&_0x473771['plugins']['get'](AIEditing)['hideFakeVisualSelection']('quick-action'),_0x1816af['resetSearch']();}),_0x9960d3;};}const Qn='<task>Explain\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x20plain,\x20simple\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).-\x20Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20explanation,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant,\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Xn='<task>Summarize\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x202–4\x20clear\x20sentences,\x20capturing\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20summary,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',zn='<task>Extract\x20and\x20present\x20the\x20key\x20points\x20from\x20the\x20selected\x20part\x20of\x20the\x20document\x20as\x20a\x20concise\x20bulleted\x20list.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20key\x20points\x20list,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',jn=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>({'chat':'AIChat','action':'AIActions'}))());class AIQuickActionsUI extends _0xaa1572{['_actionButtons']=[];['_menuBarGroupViews']=[];static get['requires'](){return[_0x3ffeea,AIConnector];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x285801=this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x285801),this['_initializeQuickActionsComponentsAndCommands'](),this['_initActionTypeQuickActions'](),this['_initChatTypeQuickActions']();}static['getDefaultQuickActions'](_0x1f1727){return function(_0x24298a){const _0x55fb84=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x24298a['uiLanguage']),_0x7f17a9=_0x55fb84||'English',_0x53477e=[{'id':'ask-ai','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x5176fc},{'id':'chat-commands','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x5176fc,'actions':[{'id':'explain','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':Mi(_0x24298a,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Qn['replace']('%0',_0x7f17a9),'type':'chat'},{'id':'summarize','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':Mi(_0x24298a,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Xn['replace']('%0',_0x7f17a9),'type':'chat'},{'id':'highlight-key-points','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':Mi(_0x24298a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':zn['replace']('%0',_0x7f17a9),'type':'chat'}]},{'id':'improve-writing','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x3d58a7},{'id':'continue','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x1092ea},{'id':'fix-grammar','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x43ab05},{'id':'adjust-length','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x44c3f4,'actions':[{'id':'make-shorter','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x5352e2,'actions':[{'id':'make-tone-casual','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x13c6bf,'actions':[{'id':'translate-to-english','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':Mi(_0x24298a,'AI_QUICK_ACTIONS_OTHER'),'icon':tt,'actions':[]}];return _0x53477e;}(_0x1f1727);}['_getDefaultAndCustomActions'](){const _0x1d776f=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0x228170=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x563589=>({..._0x563589,'type':'chat'===_0x563589['type']?'chat':'action','icon':void 0x0}));return _0x1d776f['find'](_0x1599a2=>'other'===_0x1599a2['id'])['actions']['push'](..._0x228170),_0x1d776f;}async['_initActionTypeQuickActions'](){try{const _0x3a36aa=new AIModels({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']}),_0x34db64=await _0x3a36aa['getAll'](),_0x51a2a5=(await _0x3a36aa['getDefault']())?.['id'];this['_assignDefaultModelToCustomActions'](_0x51a2a5),this['_enableButtonsByType']('action',_0x148791=>!!_0x34db64['find'](_0x468886=>_0x468886['id']===_0x148791['model'])||void 0x0===_0x148791['model']);}catch(_0x24e8ca){const _0x57c0c4=new ht('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x24e8ca});Ct(_0x57c0c4['message']);}}['_initChatTypeQuickActions'](){if(!this['editor']['plugins']['has']('AIChatController'))return;const _0x4131ef=this['editor']['plugins']['get']('AIChatController');this['listenTo'](_0x4131ef,'change:isConversationReady',(_0x3c5c63,_0x41368,_0x22acd8)=>{_0x22acd8&&this['_enableButtonsByType']('chat',()=>!0x0);}),_0x4131ef['isConversationReady']&&this['_enableButtonsByType']('chat',()=>!0x0);}['_enableButtonsByType'](_0x46b3bc,_0x145021){this['_quickActionsDefinition']['forEach'](_0x24fda3=>{'actions'in _0x24fda3?_0x24fda3['actions']['forEach'](_0x4fa79e=>{_0x4fa79e['type']===_0x46b3bc&&(_0x4fa79e['isEnabled']=_0x145021(_0x4fa79e));}):_0x24fda3['type']===_0x46b3bc&&(_0x24fda3['isEnabled']=_0x145021(_0x24fda3));}),this['_actionButtons']['forEach'](_0x20e17b=>{if(Jn(_0x20e17b['action']))return;if(_0x20e17b['action']['type']!==_0x46b3bc)return;const _0x3a9e44=_0x145021(_0x20e17b['action']);if(_0x20e17b['action']['isEnabled']=_0x3a9e44,_0x20e17b['buttonView']['isEnabled']=_0x3a9e44,!_0x3a9e44&&_0x20e17b['action']['model']){const _0x3eb2f8=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x20e17b['action']['id'],'modelId':_0x20e17b['action']['model']});Ct(_0x3eb2f8['message']);}}),this['_actionButtons']['filter'](_0x127858=>Jn(_0x127858['action']))['forEach'](_0x582a26=>{_0x582a26['buttonView']['isEnabled']=_0x582a26['action']['actions']['some'](_0x1d3bcd=>_0x1d3bcd['isEnabled']);}),this['_menuBarGroupViews']['forEach'](({view:_0x22fca7,group:_0x12f9dc})=>{_0x22fca7['isEnabled']=_0x12f9dc['actions']['some'](_0x5c5b65=>_0x5c5b65['isEnabled']);});}['_assignDefaultModelToCustomActions'](_0x54e25f){this['_actionButtons']['forEach'](_0x192337=>{Jn(_0x192337['action'])||'action'===_0x192337['action']['type']&&(_0x192337['action']['model']||(_0x192337['action']['model']=_0x54e25f));});}['_initializeQuickActionsComponentsAndCommands'](){const _0x50cae6=new Xt(this['editor']['locale']);_0x50cae6['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x50cae6),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x50cae6);}['_initializeQuickActionsDropdown'](_0x219bfb){const _0x366b2c=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',qn({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0xd64df0,'label':Mi(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x219bfb,'hasSearch':_0x366b2c,'actionButtons':this['_actionButtons']}));}['_prepareQuickActionsDefinition'](_0x4f01e7){this['_quickActionsDefinition']=_0x4f01e7['map'](_0x14c8ce=>{if('actions'in _0x14c8ce){const _0x36bd6b=_0x14c8ce;return{..._0x36bd6b,'actions':_0x36bd6b['actions']['map'](_0x1b9469=>{const {actions:_0x2950a3,..._0x57e3b6}=_0x36bd6b;return{..._0x1b9469,'isEnabled':!0x1,'parent':_0x57e3b6};})['filter'](_0x3e2bb7=>this['_shouldIncludeAction'](_0x3e2bb7))};}return{..._0x14c8ce,'isEnabled':!0x1};})['filter'](_0x303b66=>'actions'in _0x303b66?_0x303b66['actions']['length']>0x0:this['_shouldIncludeAction'](_0x303b66));}['_shouldIncludeAction'](_0x337f47){const _0x23b35d=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](jn[_0x337f47['type']])&&!_0x23b35d['includes'](_0x337f47['id'])&&!('chat'===_0x337f47['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x4f4d80){this['_quickActionsDefinition']['forEach'](_0x569b54=>{if('actions'in _0x569b54){const _0x560d2d=qn({'editor':this['editor'],'content':_0x569b54['actions'],'buttonDefinition':_0x569b54,'bodyCollection':_0x4f4d80,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x569b54['id'],_0x560d2d),_0x569b54['actions']['forEach'](_0x116a1c=>{const _0x43101d=Kn({'editor':this['editor'],'action':_0x116a1c,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x116a1c['id'],_0x43101d);});}else{const _0x2e1cf8=Kn({'editor':this['editor'],'action':_0x569b54,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x569b54['id'],_0x2e1cf8);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x5096fe=>{const _0x41ed09=this['editor']['commands']['get']('aiQuickAction'),_0x1a89a6=new Kt(_0x5096fe),_0x2794e8=Mi(_0x5096fe,'AI_QUICK_ACTIONS_HEADING');_0x1a89a6['buttonView']['set']({'label':_0x2794e8,'icon':_0xd64df0});const _0x43b032=new qt(_0x5096fe);return _0x43b032['set']({'ariaLabel':_0x2794e8,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x5b8175=>{if('actions'in _0x5b8175){const _0x226ae1=_0x5b8175,_0x54ed85=new Qt(_0x5096fe,_0x1a89a6),_0x3e3024=new Kt(_0x5096fe),_0x3be85f=new qt(_0x5096fe);_0x3e3024['buttonView']['set']({'label':_0x226ae1['label'],'icon':_0x226ae1['icon']}),_0x226ae1['actions']['forEach'](_0x10e06e=>{const _0x40c84b=new Qt(_0x5096fe,_0x3e3024),_0x4ec8b8=new Yt(_0x5096fe);_0x4ec8b8['set']({'label':_0x10e06e['label'],'icon':_0x10e06e['icon'],'role':'menuitem','isEnabled':_0x10e06e['isEnabled']}),_0x4ec8b8['on']('execute',()=>{this['_executeQuickAction'](_0x10e06e);}),this['_actionButtons']['push']({'buttonView':_0x4ec8b8,'action':_0x10e06e}),_0x4ec8b8['delegate']('execute')['to'](_0x3e3024),_0x40c84b['children']['add'](_0x4ec8b8),_0x3be85f['items']['add'](_0x40c84b);}),_0x3e3024['isEnabled']=_0x226ae1['actions']['some'](_0x498015=>_0x498015['isEnabled']),this['_menuBarGroupViews']['push']({'view':_0x3e3024,'group':_0x226ae1}),_0x3e3024['panelView']['children']['add'](_0x3be85f),_0x54ed85['children']['add'](_0x3e3024),_0x43b032['items']['add'](_0x54ed85);}else{const _0x29004f=_0x5b8175,_0x3c4760=new Qt(_0x5096fe,_0x1a89a6),_0x65b42f=new Yt(_0x5096fe);_0x65b42f['set']({'label':_0x29004f['label'],'icon':_0x29004f['icon'],'role':'menuitem','isEnabled':_0x29004f['isEnabled']}),this['_actionButtons']['push']({'buttonView':_0x65b42f,'action':_0x29004f}),_0x65b42f['on']('execute',()=>{this['_executeQuickAction'](_0x29004f);}),_0x65b42f['delegate']('execute')['to'](_0x1a89a6),_0x3c4760['children']['add'](_0x65b42f),_0x43b032['items']['add'](_0x3c4760);}}),(Object['values'](jn)['some'](_0x152010=>this['editor']['plugins']['has'](_0x152010))?_0x1a89a6['bind']('isEnabled')['to'](_0x41ed09):_0x1a89a6['set']({'isEnabled':!0x1}),_0x1a89a6['panelView']['children']['add'](_0x43b032),_0x1a89a6);});}['_executeQuickAction'](_0x2022b7){const _0x25113d=this['editor'];_0x25113d['editing']['view']['focus'](),_0x25113d['commands']['execute']('aiQuickAction',_0x2022b7);const _0x3bc0f5=_0x25113d['ui']['view']['menuBarView'];_0x3bc0f5&&_0x3bc0f5['close']&&_0x3bc0f5['close']();}}function Jn(_0x19c8e3){return'actions'in _0x19c8e3;}class AIQuickActionsCommand extends _0x2f8b52{['execute'](_0x350f16){switch(this['_expandSelectionIfCollapsed'](),_0x350f16['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x54ee8c=Mi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x54ee8c});}this['_handleAIChatAction'](_0x350f16);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x299c2c=Mi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x299c2c});}this['_handleAIActionsAction'](_0x350f16);}}async['_handleAIChatAction'](_0x4cfe01){const _0x1402eb=this['editor']['plugins']['get']('AIChatController'),_0x55cfa6=this['editor']['plugins']['get']('AITabs')['view'];if(_0x55cfa6['isVisible']||(_0x55cfa6['isVisible']=!0x0),'chat'!==_0x55cfa6['activeTab']&&_0x55cfa6['activateTab']('chat'),'ask-ai'===_0x4cfe01['id'])_0x1402eb['removeSelectionFromChatContext'](),_0x1402eb['addSelectionToChatContext'](this['editor']),_0x1402eb['focusPromptInput']();else await _0x1402eb['startConversation']({'modelId':_0x4cfe01['model']}),_0x1402eb['removeSelectionFromChatContext'](),_0x1402eb['addSelectionToChatContext'](this['editor']),_0x1402eb['focusPromptInput'](),await _0x1402eb['sendMessage']({'message':_0x4cfe01['prompt']||_0x4cfe01['displayedPrompt']||_0x4cfe01['label'],'attributes':{'quickActionData':{'id':_0x4cfe01['id']},'displayedPrompt':_0x4cfe01['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x5ee405=this['editor'],_0x2931ac=_0x5ee405['model']['document']['selection'];if(!_0x2931ac['isCollapsed'])return;const _0x424070=gt(_0x2931ac['getSelectedBlocks']())||_0x5ee405['model']['schema']['getLimitElement'](_0x2931ac);_0x5ee405['model']['change'](_0x2425d5=>{_0x2425d5['setSelection'](_0x424070,'in');});}['_handleAIActionsActionLabel'](_0x3b44f4){return _0x3b44f4['parent']?.['label']&&'other'!==_0x3b44f4['parent']?.['id']?_0x3b44f4['parent']['label']+':\x20'+_0x3b44f4['label']:_0x3b44f4['label'];}async['_handleAIActionsAction'](_0x22ddb0){const _0x1904d6=this['editor']['plugins']['get']('AIActions'),_0x4d21b1=_0x22ddb0['prompt']?{'userMessage':_0x22ddb0['prompt'],'model':_0x22ddb0['model']}:{'actionName':_0x22ddb0['actionName']||_0x22ddb0['id'],'args':_0x22ddb0['args']},_0x33cc84=this['_handleAIActionsActionLabel'](_0x22ddb0);await _0x1904d6['executeAction'](_0x4d21b1,_0x33cc84,_0x22ddb0['icon']);}}class AIQuickActionsEditing extends _0xaa1572{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x589860=this['editor'],_0x27cb35=new AIQuickActionsCommand(this['editor']);if(_0x589860['commands']['add']('aiQuickAction',_0x27cb35),_0x589860['plugins']['has']('AIChat')){const _0x4392b5=this['editor']['plugins']['get']('AIChatController');_0x589860['model']['document']['selection']['on']('change:range',(_0x1293d5,_0x52d58a)=>{_0x52d58a['directChange']&&_0x4392b5['removeSelectionFromChatContext']();});}}}class AIActionsReply extends AIReply{['appendContent'](_0x2b8765,_0x132596='text'){'modification'===this['type']&&'text'===_0x132596&&(_0x132596=this['documentContextContent']['keys']()['next']()['value']),super['appendContent'](_0x2b8765,_0x132596);}['updateChangeGroups'](_0x501c8d){const _0x3f2b35=this['parsedContent']['get'](_0x501c8d)['cloneNode'](!0x0);if(this['parsedMergedContent']['set'](_0x501c8d,_0x3f2b35),this['changeGroups']=[],0x0==_0x3f2b35['childNodes']['length'])return;rs(this['documentContextContent']['get'](_0x501c8d),this['parsedMergedContent']['get'](_0x501c8d));const _0x35c7d3=this['documentContextContent']['get'](_0x501c8d)['children']['map'](_0x3b50e5=>({'node':_0x3b50e5,'id':Xi(_0x3b50e5,'data-id')})),_0xb077ce=_0x3f2b35['children']['map'](_0x1fbd70=>({'node':_0x1fbd70,'id':Xi(_0x1fbd70,'data-id')||at()})),_0x421adf=_0x2c8954(_0x35c7d3,_0xb077ce,{'comparator':(_0x24cc67,_0x3dabd1)=>_0x24cc67['id']==_0x3dabd1['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x421adf['length']&&_0x421adf[_0x421adf['length']-0x1]['removed'];)_0x421adf['pop']();}const _0x3b6142=_0x421adf['map'](_0x1f2824=>{const _0x499b28=_0x1f2824['added']?'new':_0x1f2824['removed']?'removed':'modified';return{'node':_0x1f2824['value'][0x0]['node'],'type':_0x499b28,'id':_0x1f2824['value'][0x0]['id']};}),_0x3fcf19=this['_documentIdToSource']['get'](_0x501c8d);this['changeGroups']['push']({'changes':_0x3b6142,'state':'pending','index':this['changeGroups']['length'],'editor':_0x3fcf19['editor'],'rootName':_0x3fcf19['rootName'],'documentId':_0x501c8d});}['_getDifferentChangeGroups'](_0x573f0b,_0x1c845e){return _0x1c845e;}}class AIActionsInteraction extends AIInteraction{['content'];['version'];['editor'];['rootName'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x1e77bc){super(_0x1e77bc),this['content']=_0x1e77bc['content'],this['version']=_0x1e77bc['version'],this['editor']=_0x1e77bc['editor'],this['rootName']=_0x1e77bc['rootName'],this['actionName']=_0x1e77bc['actionName'],this['args']=_0x1e77bc['args'],this['userMessage']=_0x1e77bc['userMessage'],this['model']=_0x1e77bc['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':'document','documents':[{'id':this['id'],'content':this['content'],'version':this['version'],'rootName':this['rootName'],'sessionId':at(),'channelId':this['editor']['config']['get']('collaboration.channelId')}],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x3ecfb5){const _0x55e472=this['editor']['config']['get']('collaboration.channelId'),_0xb239d2=new AIActionsReply({..._0x3ecfb5,'locale':this['locale'],'documentContextContent':[{'id':this['id'],'content':this['content'],'channelId':_0x55e472,'rootName':this['rootName']}],'channelsToEditors':new Map([[_0x55e472,this['editor']]])});return this['replies']['push'](_0xb239d2),_0xb239d2['delegate'](...Is)['to'](this),this['fire']('replyCreated',_0xb239d2),_0xb239d2;}}class AIActionsBalloonToolbarView extends kt{constructor(_0x19cb04,_0x55c8ed=!0x0,_0x4a393b=!0x0){super(_0x19cb04),this['set']('isEnabled',!0x1),_0x55c8ed&&(this['applyButton']=this['_createButton'](Mi(_0x19cb04,'AI_BALLOON_APPLY_BUTTON'),Ui),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x4a393b&&(this['suggestButton']=this['_createButton'](Mi(_0x19cb04,'AI_BALLOON_SUGGEST_BUTTON'),_0x55c8ed?Bi:Ui),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x55c8ed,'showSuggestButton':_0x4a393b}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x55621e,showSuggestButton:_0xa8b407}){this['applyButton']&&(this['applyButton']['isVisible']=_0x55621e),this['suggestButton']&&(this['suggestButton']['isVisible']=_0xa8b407);}['_createButton'](_0x52cf55,_0x35084b){const _0x546d84=new yt(this['locale']);return _0x546d84['set']({'label':_0x52cf55,'class':_0x35084b,'isVisible':!0x0,'withText':!0x0}),_0x546d84;}}class AIActionsBalloonDisclaimerView extends Nt{constructor(_0x25e2f9){super(_0x25e2f9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Mi(_0x25e2f9,'AI_DISCLAIMER_TEXT')}]}]});}}class AISuggestionLoaderView extends Nt{constructor(_0x27966e){super(_0x27966e),this['set']('isVisible',!0x0);const _0x32a473=new AISpinnerView('small');_0x32a473['isVisible']=!0x0;const _0x3d1541=new Nt(this['locale']);_0x3d1541['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Mi(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x136bc6=>!_0x136bc6)]},'children':[_0x32a473,_0x3d1541]});}}class AIActionsBalloonView extends AIBalloonView{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x3a8150,_0x3dadd9){super(_0x3a8150),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x3dadd9,this['_focusTracker']=new It(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x42c8a3(),this['_addContentWrapper'](_0x3dadd9),this['_addDisclaimerView'](),this['_addToolbar'](_0x3dadd9),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x3dadd9);});}['render'](){super['render']();for(const _0x46b99e of this['_focusables'])this['_focusTracker']['add'](_0x46b99e['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x4d984c){-0x1===_0x4d984c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x18b83d){this['_isLoading']=_0x18b83d;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x2f96cb){super['showError'](_0x2f96cb),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x25d3a4){super['showBlockingError'](_0x25d3a4),this['setErrorState']();}['addMiniToolbarItem'](_0x29c120){this['_miniToolbarView']['items']['has'](_0x29c120)||this['_miniToolbarView']['items']['add'](_0x29c120);}['removeMiniToolbarItem'](_0x1248cd){this['_miniToolbarView']['items']['has'](_0x1248cd)&&this['_miniToolbarView']['items']['remove'](_0x1248cd);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x2c19a2,showSuggestButton:_0x2edff6}){_0x2c19a2=_0x2c19a2&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2edff6=_0x2edff6&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x2c19a2,'showSuggestButton':_0x2edff6});}async['updateContent'](_0x52c611){await this['_streamableContentView']['update'](_0x52c611);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x5d3c12){this['_contentWrapper']=new Nt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x5d3c12['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new AIActionsBalloonDisclaimerView(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x2aee3f,showSuggestButton:_0x3b255a}){this['_toolbarView']=new AIActionsBalloonToolbarView(this['locale'],_0x2aee3f,_0x3b255a),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x2bf655,_0x4863e8,_0x189549)=>!(_0x2bf655||_0x4863e8||_0x189549)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x2aee3f,'showSuggestButton':_0x3b255a}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x58c207){return this['_miniToolbarView']=new AIMiniToolbarView(this['locale'],_0x58c207),this['_miniToolbarView']['delegate'](...Ss)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x46ad23,_0x558a25)=>!(_0x46ad23||_0x558a25)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new AISuggestionLoaderView(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new AISuggestionStreamableContentView(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x2838e5=new yt(this['locale']),_0x1e01c5=new yt(this['locale']),_0x3a4d60=new AIActionsBalloonNavigationCounterView(this['locale']),_0x5565a1=new yt(this['locale']);_0x2838e5['set']({'icon':et,'label':Mi(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+Gi}),_0x1e01c5['set']({'icon':_0x26e333,'tooltip':Mi(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+Gi}),_0x5565a1['set']({'icon':it,'tooltip':Mi(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+Gi}),_0x2838e5['bind']('isEnabled')['to'](this,'isBusy',_0x3cad5b=>!_0x3cad5b),_0x2838e5['on']('execute',()=>{this['fire']('tryAgain');}),_0x1e01c5['bind']('isEnabled')['to'](this,'isBusy',_0x6bc901=>!_0x6bc901),_0x1e01c5['on']('execute',()=>{this['fire']('showPrevious');}),_0x5565a1['bind']('isEnabled')['to'](this,'isBusy',_0xf86246=>!_0xf86246),_0x5565a1['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x1e01c5,this['_navigationCounter']=_0x3a4d60,this['_navigationNextButton']=_0x5565a1,this['_navigationTryAgainButton']=_0x2838e5;}['updateMiniToolbarButtons'](_0x4f1aa0,_0x56b586){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x1cbbbc=_0x4f1aa0>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x1cbbbc){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x55540f=_0x4f1aa0-_0x56b586;this['_navigationCounter']['setInteractionCount'](_0x55540f+'/'+_0x4f1aa0),this['_navigationPreviousButton']['isEnabled']=_0x56b586<_0x4f1aa0-0x1,this['_navigationNextButton']['isEnabled']=_0x56b586>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x2cccdc){this['_isLoading']=_0x2cccdc;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0xb6cb29=this['_getScrollableElement']();_0xb6cb29&&!this['_scrollManager']&&(this['_scrollManager']=new ScrollManager(_0xb6cb29));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class AIActionsBalloonNavigationCounterView extends Nt{constructor(_0x1e4737){super(_0x1e4737);const _0x49c894=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x49c894['to']('interactionCount')}]});}['setInteractionCount'](_0x4dcd80){this['set']('interactionCount',_0x4dcd80);}}class AIActions extends _0xaa1572{static get['requires'](){return[AIConnector,Gt,AIEditing,AIBalloon,_0x2ab8a5];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x44d7e5){super(_0x44d7e5),this['_bodyCollection']=new Xt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x172662,_0x4c3ae9,_0x376a9d){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0xf982b1,anchorData:_0x40c8ac,root:_0x51fa2d}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x172662,_0xf982b1,_0x40c8ac,_0x51fa2d,_0x4c3ae9,_0x376a9d);}}const {modelFragment:_0x351bd8,anchorData:_0x493ff2,root:_0xfff58b}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x172662,_0x351bd8,_0x493ff2,_0xfff58b,_0x4c3ae9,_0x376a9d);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x2e4085=this['editor']['plugins']['has']('TrackChanges');let _0x23c29f=this['editor']['config']['get']('ai.availableReplyActions')||[...Ds];_0x2e4085||(_0x23c29f=_0x23c29f['filter'](_0x9d833a=>'insertSuggestion'!=_0x9d833a));const _0x10ef93=this['editor']['commands']['get']('trackChanges'),_0x250d77=new AIActionsBalloonView(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x2e4085,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x23c29f});return _0x250d77['bind']('isBusy')['to'](this),_0x10ef93&&_0x250d77['bind']('isTrackChangesOn')['to'](_0x10ef93,'value'),_0x250d77['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x250d77['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x250d77['on']('showNext',()=>{this['_navigateToNext']();}),_0x250d77;}['_normalizeSelectionStart'](){const _0x3e141e=this['editor']['model'],_0x55d732=_0x3e141e['document']['selection'],_0x134713=_0x55d732['getFirstRange']();if(!_0x134713||_0x134713['isCollapsed'])return;const _0x3a197f=gt(_0x55d732['getSelectedBlocks']());if(!_0x3a197f)return;const _0xdd32a1=_0x3e141e['createPositionAt'](_0x3a197f,0x0);_0xdd32a1['isAfter'](_0x134713['start'])&&_0x3e141e['change'](_0x377221=>{_0x377221['setSelection'](_0x377221['createRange'](_0xdd32a1,_0x134713['end']));});}['_getExecuteDataRegular'](){const _0x154641=this['editor']['model']['document']['selection'],_0x319f40=_0x154641['getFirstRange']()['start']['root'];if(_0x154641['isCollapsed']){const _0x5c88ed=gt(_0x154641['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x154641);this['editor']['model']['change'](_0x1f1308=>{_0x1f1308['setSelection'](_0x5c88ed,'in');});}this['_normalizeSelectionStart']();const _0x24b3a7=_0x154641['getFirstRange'](),_0x305ad8=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x154641),_0x24b3a7['start'],_0x24b3a7['end']);this['_copyMarkersToFragment'](_0x305ad8,_0x154641,{'isTableSelection':!0x1});const _0x425f34=_0x154641['getFirstRange']()['start'],_0x3f71c4=new Map();let _0xc9e7b5=_0x305ad8;for(let _0x379de9=0x0;_0x379de9<_0x425f34['path']['length'];_0x379de9++)_0x3f71c4['set'](_0xc9e7b5,_0x425f34['path'][_0x379de9]),_0xc9e7b5=_0xc9e7b5['getChild'](0x0);return{'modelFragment':_0x305ad8,'anchorData':_0x3f71c4,'root':_0x319f40};}['_getExecuteDataInTable'](){const _0x3befc4=this['editor']['model']['document']['selection'],_0x15f519=this['editor']['plugins']['get']('TableSelection'),_0x428ede=_0x3befc4['getFirstRange']()['start']['root'],_0x2797af=_0x15f519['getSelectionAsFragment'](),_0x289b7d=_0x3befc4['getFirstRange']()['start']['parent']['parent'],_0x4e2c0d=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x289b7d),this['editor']['model']['createPositionAfter'](_0x289b7d)),_0x3db9d7=this['_wrapWithCommonAncestors'](_0x2797af,_0x4e2c0d['start'],_0x4e2c0d['end']);this['_copyMarkersToFragment'](_0x3db9d7,_0x3befc4,{'isTableSelection':!0x0});const _0xd47f85=_0x3befc4['getFirstRange']()['start'],_0x1c99b5=new Map();let _0x492f2f=_0x3db9d7;for(let _0x5cc025=0x0;_0x5cc025<_0xd47f85['path']['length'];_0x5cc025++)if(_0x1c99b5['set'](_0x492f2f,_0xd47f85['path'][_0x5cc025]),_0x5cc025<_0xd47f85['path']['length']-0x1)_0x492f2f=_0x492f2f['getChild'](0x0);else{let _0x1446aa=_0x492f2f['nextSibling'];for(;_0x1446aa;)_0x1c99b5['set'](_0x1446aa,_0xd47f85['path'][_0x5cc025]),_0x1446aa=_0x1446aa['nextSibling'];}return{'modelFragment':_0x3db9d7,'anchorData':_0x1c99b5,'root':_0x428ede};}async['_executeAction'](_0x2953e5,_0x33886e,_0x22c3f9,_0x5cb60d,_0x481fc7,_0x2242ec){const _0x1d9934=this['editor']['plugins']['get'](AIEditing),_0x59bc4f=this['editor']['plugins']['get'](AIBalloon),_0x2edf77=this['editor']['model']['document']['selection'],_0x884e28=await _0x1d9934['modelToDataWithIds'](_0x33886e,this['editor']),_0x4cee62=this['editor']['model']['document']['version'],_0xa0f150=[..._0x2edf77['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x59bc4f['open']({'targetEditor':this['editor'],'index':0x3e8*Math['random']()%0x3e8,'title':_0x481fc7,'icon':_0x2242ec||_0xd64df0,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0xa0f150,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x59bc4f),this['_interactionParams']={'action':_0x2953e5,'content':_0x884e28,'version':_0x4cee62,'aiBalloon':_0x59bc4f,'modelFragment':_0x33886e,'anchorData':_0x22c3f9,'root':_0x5cb60d},this['_setupApplyListeners'](),this['listenTo'](_0x59bc4f,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x59bc4f,'dialogClosed',(_0x59646e,{id:_0x33b4e8})=>{if('aiActionsBalloon'===_0x33b4e8){for(const _0x2642e3 of this['_interactions']){if(0x0===_0x2642e3['replies']['length']||_0x2642e3['stoppedExplicitly'])continue;const _0x3be885=_0x2642e3['replies'][_0x2642e3['replies']['length']-0x1],_0x105f77=_0x3be885['changeGroups'][0x0];_0x105f77&&'pending'===_0x105f77['state']&&_0x3be885['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x59bc4f);}}),this['_createInteraction'](_0x884e28,_0x4cee62,_0x59bc4f,_0x2953e5);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0xef2a7b,anchorData:_0x1395cd,root:_0x5d6f9d}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0xef2a7b,_0x1395cd,_0x5d6f9d,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0xef2a7b,_0x1395cd,_0x5d6f9d,!0x0);});}['_wrapWithCommonAncestors'](_0x5cf77f,_0xccafe1,_0x2deb30){const _0x3ba77b=this['editor']['model']['createRange'](_0xccafe1,_0x2deb30)['getCommonAncestor'](),_0x4c3c03=_0x3ba77b['is']('documentFragment')?[]:_0x3ba77b['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x4c3c03['length']){const _0x3bf83d=_0x4c3c03['map'](_0x2db6b8=>_0x2db6b8['_clone'](!0x1));for(let _0x48f125=0x1;_0x48f125<_0x3bf83d['length'];_0x48f125++)_0x3bf83d[_0x48f125-0x1]['_appendChild'](_0x3bf83d[_0x48f125]);return _0x3bf83d[_0x3bf83d['length']-0x1]['_appendChild'](_0x5cf77f),new _0x4d6f3c(_0x3bf83d[0x0]);}return _0x5cf77f;}['_copyMarkersToFragment'](_0x494867,_0x295147,_0x4f742f={'isTableSelection':!0x1}){const _0x489aa0=this['editor']['model'],_0x46217b=Array['from'](_0x295147['getRanges']()),_0x52ebb8=_0x295147['getFirstRange']()['start'];for(const _0x5311b5 of _0x489aa0['markers']){if(_0x5311b5['name']['startsWith'](Rs)||!_0x5311b5['affectsData'])continue;const _0x218709=_0x5311b5['getRange']();if(!_0x46217b['some'](_0x2e6f75=>_0x2e6f75['containsRange'](_0x218709,!0x0)))continue;const _0x30e315=this['_regularCalculateMarkerPath'](_0x218709['start'],_0x52ebb8,_0x4f742f['isTableSelection']),_0x2a4bf3=this['_regularCalculateMarkerPath'](_0x218709['end'],_0x52ebb8,_0x4f742f['isTableSelection']),_0x1a3c8f=_0x489aa0['createPositionFromPath'](_0x494867,_0x30e315),_0x3153d6=_0x489aa0['createPositionFromPath'](_0x494867,_0x2a4bf3);if(!_0x1a3c8f['isEqual'](_0x3153d6)){const _0x3aae75=_0x489aa0['createRange'](_0x1a3c8f,_0x3153d6);_0x494867['markers']['set'](_0x5311b5['name'],_0x3aae75);}}}['_regularCalculateMarkerPath'](_0x3701b0,_0x53c85a,_0x4a9bec=!0x1){const _0x45e9ba=[..._0x3701b0['path']['slice']()];for(let _0x4634f1=0x0;_0x4634f1<Math['max'](_0x53c85a['path']['length'],_0x3701b0['path']['length']);_0x4634f1++){const _0xf17a0d=_0x53c85a['path'][_0x4634f1]||0x0,_0x16c83d=(_0x3701b0['path'][_0x4634f1]||0x0)-_0xf17a0d;if(_0x45e9ba[_0x4634f1]=_0x16c83d,0x0!==_0x16c83d&&!_0x4a9bec)break;}return _0x45e9ba;}async['_createInteraction'](_0x38619f,_0x28166d,_0x350752,_0x5da93c){const _0x367bb8=this['editor'],_0x10c1c2=_0x367bb8['model']['document']['selection']['getFirstRange']()['start']['root'];this['_interactionParams']||(this['_interactionParams']={'action':_0x5da93c,'content':_0x38619f,'version':_0x28166d,'aiBalloon':_0x350752,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':_0x10c1c2});const _0x48ab79=new AIActionsInteraction({'connector':this['_aiConnector'],'locale':_0x367bb8['locale'],'content':_0x38619f,'version':_0x28166d,'editor':_0x367bb8,'rootName':_0x10c1c2['rootName'],..._0x5da93c});this['_interactions']['push'](_0x48ab79);const _0x12c72a=(_0x2cd0f5,_0x2a7f8c=!0x1,_0x5ac823='streaming')=>this['_promiseQueue']['enqueue'](async _0x2d15cd=>{try{const _0x207695=os({'changeGroups':_0x2cd0f5['changeGroups'],'documentContextContent':_0x2cd0f5['documentContextContent'],'showDiff':_0x2a7f8c,'trimUnchanged':!0x1});_0x207695['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x207695[0x0],'renderingStrategy':_0x5ac823,'abortSignal':_0x2d15cd});}catch(_0x675ea6){if(this['_isAbortError'](_0x675ea6))return;throw _0x675ea6;}});_0x48ab79['on']('replyCreated',(_0x48f13c,_0x10a5a7)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x12c72a(_0x10a5a7)['catch'](_0x4da28c=>{this['_isAbortError'](_0x4da28c)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x4da28c),this['_setErrorState'](_0x48ab79));});}),_0x48ab79['on']('replyContentUpdated',(_0x2bca0f,_0x254f7a)=>{_0x12c72a(_0x254f7a)['catch'](_0x3d9de9=>{this['_isAbortError'](_0x3d9de9)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x3d9de9),this['_setErrorState'](_0x48ab79));});}),_0x48ab79['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x291212){this['_isAbortError'](_0x291212)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x291212),this['_setErrorState'](_0x48ab79));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x29cdfa,{showDiff:_0x530627})=>{try{this['_balloonShowDiff']=_0x530627;const _0x27f2ae=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x27f2ae&&await _0x12c72a(_0x27f2ae,_0x530627,'static');}catch(_0x20d222){this['_isAbortError'](_0x20d222)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x20d222),this['_setErrorState'](_0x48ab79));}}),_0x48ab79['on']('replyChangeGroupStateUpdated',()=>{const _0x2b8ca1={'positiveCount':_0x48ab79['replies']['reduce']((_0x4ab09b,_0x2816a5)=>_0x4ab09b+_0x2816a5['changeGroups']['filter'](_0x2995f=>'accepted'===_0x2995f['state'])['length'],0x0),'totalCount':_0x48ab79['replies']['reduce']((_0x222d8a,_0x39e096)=>_0x222d8a+_0x39e096['changeGroups']['length'],0x0)},_0x465106=_0x48ab79['actionCallId'],_0xe39de4=_0x48ab79['actionName'];_0xe39de4?this['_aiConnector']['upsertAIActionRating'](_0xe39de4,_0x465106,_0x2b8ca1):this['_aiConnector']['upsertCustomAIActionRating'](_0x465106,_0x2b8ca1);}),this['_setLoadingState']();try{const _0x50c140=await _0x48ab79['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x50c140;}catch(_0x4e0e6d){if(this['_isAbortError'](_0x4e0e6d))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x48ab79);}}['_applyChanges'](_0x3f4fc6,_0x1f1164,_0x346a1c,_0x205ee1){const _0x38302a=this['editor'];if(_0x205ee1&&!_0x38302a['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x3273c8=this['editor']['plugins']['get'](_0x2ab8a5),_0x47a3dc=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x47a3dc||!_0x47a3dc['replies']['length'])return;const _0x2b9f0e=_0x47a3dc['replies'][_0x47a3dc['replies']['length']-0x1],_0x2bfadf=_0x2b9f0e['changeGroups'];_0x2b9f0e['setChangeGroupState'](0x0,'accepted');let _0x5cceef=Es({'reply':_0x2b9f0e,'interaction':_0x47a3dc,'groups':_0x2bfadf,'transform':!0x1,'documentCompare':_0x3273c8,'documentCompareOptions':{'anchor':_0x38302a['model']['createPositionAt'](_0x3f4fc6,0x0),'markDeletions':_0x205ee1}});_0x5cceef=this['_filterOperationsOutsideRange'](_0x5cceef,_0x1f1164);for(const _0x3304e3 of _0x5cceef)this['_anchorOperation'](_0x1f1164,_0x3304e3,_0x346a1c);const _0x42b63f=_0x47a3dc['getDocumentContext']()['documents'][0x0]['version'],_0x4caddc=_0x38302a['model']['document']['history']['getOperations'](_0x42b63f),_0x3a42c4={'document':_0x38302a['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4d9b94=_0x329636(_0x5cceef,_0x4caddc,_0x3a42c4)['operationsA'];_0x38302a['model']['change'](_0x2afd38=>{if(_0x2afd38['setSelection'](_0x38302a['model']['document']['selection']['focus']),_0x205ee1)_0x38302a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4d9b94);else{for(const _0x29797e of _0x4d9b94)_0x29797e['baseVersion']=_0x38302a['model']['document']['version'],Ts(_0x38302a,_0x29797e),_0x2afd38['batch']['addOperation'](_0x29797e),_0x38302a['model']['applyOperation'](_0x29797e);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x207196,_0x4f583f){return _0x207196['filter'](_0x6ce3be=>{if('rename'==_0x6ce3be['type']){const _0x310afd=_0x6ce3be['position']['nodeAfter'];return!_0x4f583f['has'](_0x310afd);}if(_0x6ce3be['type']['indexOf']('Attribute')>-0x1){const _0x1b0664=_0x6ce3be['range']['start']['nodeAfter'];return!_0x4f583f['has'](_0x1b0664);}return!0x0;});}['_anchorOperation'](_0x24c535,_0xb8be1,_0x1d0a75){const _0x3f4225=_0xb8be1['clone']();for(const _0x245bb4 in _0xb8be1){const _0x4ea847=_0xb8be1[_0x245bb4];_0x4ea847 instanceof _0x303302?_0xb8be1[_0x245bb4]=new _0x303302(_0x4fbfbb(_0x4ea847['start']),_0x4fbfbb(_0x4ea847['end'])):_0x4ea847 instanceof _0x4ff74e&&(_0xb8be1[_0x245bb4]=_0x4fbfbb(_0x4ea847));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x3f4225['type'])){if(_0x3f4225['isDocumentOperation']=!0x1,_0x3f4225['baseVersion']=null,'remove'==_0x3f4225['type']){const _0x35d671=_0x3f4225['sourcePosition'],_0x26b120=_0x3f4225['howMany'];new _0x3d09e2(_0x35d671,_0x26b120)['_execute']();}else _0x3f4225['_execute']();}function _0x4fbfbb(_0x2aa3a4){if('$graveyard'==_0x2aa3a4['root']['rootName'])return _0x2aa3a4;const _0x13c0de=[];let _0x4657de=_0x2aa3a4['root'];for(let _0x214843=0x0;_0x214843<_0x2aa3a4['path']['length'];_0x214843++){const _0x4d11c0=_0x24c535['get'](_0x4657de)||0x0;_0x13c0de[_0x214843]=_0x2aa3a4['path'][_0x214843]+_0x4d11c0,_0x4657de=_0x4657de['getChildAtOffset'](_0x2aa3a4['path'][_0x214843]);}return new _0x4ff74e(_0x1d0a75,_0x13c0de,_0x2aa3a4['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x429d2f,content:_0x1e6eb7,version:_0x134e1c,aiBalloon:_0x206b30}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x1e6eb7,_0x134e1c,_0x206b30,_0x429d2f)['catch'](_0x53b9d7=>{this['_isAbortError'](_0x53b9d7)||console['error']('Error\x20refreshing\x20interaction:',_0x53b9d7);});}['_isAbortError'](_0x55528e){return!!_0x55528e['message']&&_0x55528e['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x4aa872=this['_interactions']['length'];this['_currentInteractionIndex']<_0x4aa872-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x1b1f4c){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x1b1f4c;const _0x645ff4=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x645ff4)return;if(_0x645ff4['hasError'])return this['_setErrorState'](_0x645ff4),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x645ff4['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x326baf=_0x645ff4['replies'][_0x645ff4['replies']['length']-0x1];if(_0x326baf)try{const _0x263942=os({'changeGroups':_0x326baf['changeGroups'],'documentContextContent':_0x326baf['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x599775=>setTimeout(_0x599775,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x263942[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x2e1e36){this['_isAbortError'](_0x2e1e36)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x2e1e36);}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x54abc7){const _0x95bc04=Mi(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x95bc04),_0x54abc7['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class AIQuickActions extends _0xaa1572{static get['requires'](){return[AIQuickActionsUI,AIQuickActionsEditing,AIActions];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x9b51ba){super(_0x9b51ba),_0x9b51ba['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class AIReviewCoreReviewCheckListItemResultsView extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x3b8991,_0x2eebc6){super(_0x3b8991),this['id']=_0x2eebc6,this['set']('status','pending'),this['set']('changeId',_0x2eebc6),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x4f0c18,_0x164e4d)=>{_0x164e4d&&_0x164e4d['target']&&'A'===_0x164e4d['target']['tagName']&&_0x164e4d['preventDefault'](),this['fire']('activateChange',{'id':_0x2eebc6,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x2eebc6,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x2eebc6,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4353da=new Nt(this['locale']);return _0x4353da['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x30a309=>!_0x30a309)]}}),_0x4353da;}['_createAcceptButtonView'](){const _0x31216d=new yt(this['locale']);return _0x31216d['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x31216d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x199b1f=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x199b1f['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0xdea6c0=>'pending'!==_0xdea6c0&&'accepted'!==_0xdea6c0),this['bindTemplate']['if']('status',Bi,_0x3fd52d=>'pending'===_0x3fd52d),this['bindTemplate']['if']('status',Gi,_0x69a728=>'pending'!==_0x69a728),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2af0ec=>'accepted'===_0x2af0ec)]}}),this['on']('change:status',(_0xb36a58,_0x5f12a9,_0x21b590)=>{_0x31216d['isEnabled']='pending'===_0x21b590,'accepted'===_0x21b590&&(_0x31216d['label']=Mi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x31216d['icon']=_0x34cc80);}),_0x31216d;}['_createDismissButtonView'](){const _0x22fd6f=new yt(this['locale']);return _0x22fd6f['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x22fd6f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4d4f0a=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x4d4f0a['stopPropagation']();})},'attributes':{'class':[Gi,this['bindTemplate']['if']('status','ck-hidden',_0x4cd53d=>'pending'!==_0x4cd53d&&'rejected'!==_0x4cd53d),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x318dd1=>'pending'===_0x318dd1),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2bdf7a=>'rejected'===_0x2bdf7a)]}}),this['on']('change:status',(_0x4523ec,_0x2c60a2,_0x3cc8d2)=>{_0x22fd6f['isEnabled']='pending'===_0x3cc8d2,'rejected'===_0x3cc8d2&&(_0x22fd6f['label']=Mi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x22fd6f['icon']=_0x45e38d);}),_0x22fd6f;}['_createInfoButtonView'](){const _0x14e0e2=new yt(this['locale']);return _0x14e0e2['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x4e4581,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':Gi+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x14e0e2['bind']('isOn')['to'](this,'isInfoToggleOn',_0xdf8010=>_0xdf8010),_0x14e0e2['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x14e0e2;}['_createOutdatedButtonView'](){const _0x53f676=new yt(this['locale']);return _0x53f676['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':st,'withText':!0x0,'isEnabled':!0x1}),_0x53f676['extendTemplate']({'attributes':{'class':[Gi,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x5db960=>'outdated'!==_0x5db960)],'disabled':'disabled'}}),_0x53f676;}}class AIReviewCoreBalloonSuggestionItemView extends zt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x2043aa,_0x3e348b){super(_0x2043aa),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x3e348b['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x3596ed){this['resultItemView']['changeId']=_0x3596ed['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x3596ed['contentDiffed'];}['showBalloon'](_0x1f9314,_0x1bf3a9,_0x4fe79d,_0x1534e5,_0x3b802d,_0x60a80a){const _0x263451=_0x1bf3a9();if(!_0x263451)return;this['updateContent'](_0x1f9314),this['show']();const _0x4a6de0=Array['from'](_0x263451['getClientRects']())['reverse'](),_0x3c7a62=this['_getPointedRectIndexFromEvent'](_0x4fe79d,_0x4a6de0),_0xa6b37d=_0x4a6de0[_0x3c7a62??0x0];'click'===_0x1534e5?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x1bf3a9(),_0x3c7a62,_0x1f9314['id'],_0x3b802d,_0x60a80a)||_0xa6b37d})):'hover'===_0x1534e5&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x1bf3a9(),_0x3c7a62,_0x1f9314['id'])||_0xa6b37d}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){jt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x4e7d57=[this['element']];return this['_pinnedTargetElement']&&_0x4e7d57['push'](this['_pinnedTargetElement']),_0x4e7d57;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x4fdc53=new Nt();return this['resultItemView']=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x4fdc53['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x4fdc53;}['_getBestRectPositionOnClick'](_0x42318a,_0x15b075,_0x2a3b20,_0x21c6cf,_0x22fa94){if(!_0x42318a)return null;const _0x309a4a=this['position']['replace']('arrow_',''),_0x40410c=Array['from'](_0x42318a['getClientRects']());let _0x294a83,_0x9627e5=_0x40410c['reverse']();return void 0x0!==_0x15b075&&this['_isPinnedRectVisible'](_0x9627e5[_0x15b075],_0x21c6cf,_0x22fa94)?(_0x294a83=_0x9627e5[_0x15b075],this['_pinnedRectIndex']=_0x15b075):this['_isPinnedRectVisible'](_0x9627e5[0x0],_0x21c6cf,_0x22fa94)&&void 0x0===_0x15b075?_0x294a83=_0x9627e5[0x0]:(_0x9627e5='s'==_0x309a4a[0x0]?[..._0x40410c]['reverse']():_0x40410c,_0x9627e5['forEach'](_0x2763b2=>{this['_isPinnedRectVisible'](_0x2763b2,_0x21c6cf,_0x22fa94)&&(_0x294a83=_0x2763b2);})),this['_pinnedTargetChangeId']=_0x2a3b20,this['_pinnedTargetElement']=_0x42318a,_0x294a83||_0x42318a['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x3898ad,_0x444deb,_0x49c306){if(!_0x3898ad)return null;const _0x15071b=Array['from'](_0x3898ad['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x444deb&&this['_pinnedTargetChangeId']!==_0x49c306)return this['_pinnedRectIndex']=_0x444deb,this['_pinnedTargetElement']=_0x3898ad,this['_pinnedTargetChangeId']=_0x49c306,_0x15071b[_0x444deb];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x49c306){if(_0x3898ad!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x15071b[this['_pinnedRectIndex']];}return void 0x0!==_0x444deb&&this['_pinnedTargetChangeId']!==_0x49c306?(this['_pinnedRectIndex']=_0x444deb,this['_pinnedTargetElement']=_0x3898ad,this['_pinnedTargetChangeId']=_0x49c306,_0x15071b[_0x444deb]):_0x3898ad['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x3bf385,_0x58dd64){if(_0x3bf385)for(let _0x3992a3=0x0;_0x3992a3<_0x58dd64['length'];_0x3992a3++){const _0x5e1a36=_0x58dd64[_0x3992a3];if(_0x3bf385['clientX']>=_0x5e1a36['left']-0x3&&_0x3bf385['clientX']<=_0x5e1a36['right']+0x3&&_0x3bf385['clientY']>=_0x5e1a36['top']-0x3&&_0x3bf385['clientY']<=_0x5e1a36['bottom']+0x3)return _0x3992a3;}}['_isPinnedRectVisible'](_0x3bdcba,_0x13471c,_0x478760){const _0x4cc1ac=new dt(_0x3bdcba),_0x20120c=_0x13471c||document['documentElement'],_0x76d4c8=_0x4cc1ac['getIntersection'](Ot(_0x478760)),_0x272ab9=new dt(_0x20120c)['getIntersection'](_0x4cc1ac);return!!(_0x76d4c8&&_0x272ab9&&_0x4cc1ac['width']>0x0);}}const Zn=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class AIReviewCoreUI extends _0x2bf4b8{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[AITabs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3a07b6){super(_0x3a07b6),this['_bodyCollection']=new Xt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...Zn)['to'](this),this['_balloonSuggestionView']=new AIReviewCoreBalloonSuggestionItemView(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x27bf43=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x27bf43);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0xe398a0){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x3f29bb=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0xe398a0,_0x3f29bb);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x3848a6){_0x3848a6&&('error-general'!==_0x3848a6['status']?'error-chunk'!==_0x3848a6['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x434deb){this['_mainView']['addCheckRunResult'](_0x434deb);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x1bdc6a){this['_mainView']['showGeneralReviewCoreErrorView'](_0x1bdc6a??Mi(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x24a1a2,_0x4861ce){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x24a1a2,_0x4861ce);}['setActiveStateInResults'](_0x4376cc){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x2b3a73=>{_0x2b3a73['id']===_0x4376cc&&_0x2b3a73['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x436b14=>_0x436b14['setItemAsInactive']());}['updateChangeState'](_0x1ead63,_0x10cbb0){'accepted'===_0x10cbb0||'rejected'===_0x10cbb0||'outdated'===_0x10cbb0?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x1ead63,_0x10cbb0):this['_mainView']['reviewCheckResultsView']['showResult'](_0x1ead63,_0x10cbb0);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x4410ad,_0x599f82,_0x1cd885,_0x599e33,_0x3b4f4d,_0x5b030a){this['_balloonSuggestionView']['showBalloon'](_0x4410ad,_0x599f82,_0x1cd885,_0x599e33,_0x3b4f4d,_0x5b030a);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x2c72f5){const _0x5554be=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x3181e9=>_0x3181e9['id']===_0x2c72f5);return _0x5554be?_0x5554be['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class AIReviewCoreGeneralErrorView extends Nt{constructor(_0x260b4d){super(_0x260b4d),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x938091=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x938091['if']('isVisible','ck-hidden',_0x1fde14=>!_0x1fde14)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x938091['to']('errorMessage')}]}]});}}class AIReviewCoreView extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x1f3aa2,_0x2a0635){super(_0x1f3aa2),this['reviewCoreHeader']=_0x2a0635['header'],this['generalErrorView']=new AIReviewCoreGeneralErrorView(_0x1f3aa2),this['reviewCheckListView']=_0x2a0635['list'],this['reviewCheckListView']['delegate'](...Zn)['to'](this),this['reviewCheckResultsView']=_0x2a0635['results'],this['reviewCheckResultsView']['delegate'](...Zn)['to'](this),this['reviewCompletedView']=_0x2a0635['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x371e40){this['reviewCheckResultsView']['addResult'](_0x371e40),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x47d527){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x47d527;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class AIReviewCoreFinishReviewButtonView extends yt{constructor(_0x309b90,_0xc0f03c){super(_0xc0f03c),this['set']({'label':_0x309b90,'withText':!0x0,'class':Ui}),this['on']('execute',()=>{this['fire']('finishReview');});}}class AIReviewCoreUICheckResultsView extends Ht{['_resultViews'];['_resultsHeader'];['_resultsBody'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x265752,_0x5b6d3c){super(_0x265752),this['_contents']=_0x5b6d3c,this['_resultViews']=new _0x42c8a3(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_resultsBody']=this['_createResultsBodyView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new AIDisclaimerView(_0x265752),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x56b2f1=this['_createCombinedSkeletonLoader'](),_0x16817e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x16817e['if']('isLoading','ck-ai_review__check-run_loading',_0x513747=>_0x513747),_0x16817e['if']('isResultReady','ck-ai_review__check-run_ready',_0xd9a5b7=>_0xd9a5b7),_0x16817e['if']('isVisible','ck-hidden',_0x190f68=>!_0x190f68)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x56b2f1,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x13161a){const _0xb67bf9=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],_0x13161a['id']);_0xb67bf9['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0xb67bf9),_0xb67bf9['resultResponseView']['element']['innerHTML']=_0x13161a['contentDiffed'];}['hideResult'](_0x228fef,_0x3d7ae8){if('pending'===_0x3d7ae8)return;const _0x125ffb=this['_resultViews']['find'](_0x524460=>_0x524460['id']===_0x228fef);_0x125ffb&&(_0x125ffb['status']=_0x3d7ae8,_0x125ffb['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x33310b,_0x28b2c7){if('pending'!==_0x28b2c7)return;const _0x4f0c11=this['_resultViews']['find'](_0x575ffe=>_0x575ffe['id']===_0x33310b);_0x4f0c11&&(_0x4f0c11['status']=_0x28b2c7,_0x4f0c11['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x2581e4,_0x1eacac){this['headerTitle']=_0x2581e4,this['headerSubtitle']=_0x1eacac||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new AISkeletonView(this['locale'],Ls['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x4531fb=new Nt(this['locale']),_0x5a17c0=[];for(let _0x15ac8c=0x0;_0x15ac8c<0x10;_0x15ac8c++){const _0x11dc85=this['_createSkeletonLoader']();_0x11dc85['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x5a17c0['push'](_0x11dc85);}return _0x4531fb['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x434cab=>!_0x434cab)]},'children':_0x5a17c0}),_0x4531fb;}['_createResultsBodyView'](){const _0x3d2f92=new Nt(this['locale']);return _0x3d2f92['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x37c00c=>_0x37c00c)]},'children':this['_resultViews']}),_0x3d2f92;}['_createErrorView'](){const _0x29db3b=new Nt(this['locale']),_0x235e95=new yt(this['locale']),t=this['locale']['t'];return _0x29db3b['delegate']('retryReview')['to'](this),_0x235e95['set']({'label':t('Try\x20again'),'withText':!0x0,'class':Bi+'\x20ck-ai_review__check-run-error-retry-button'}),_0x235e95['on']('execute',()=>{this['fire']('retryReview');}),_0x29db3b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x2ba4b3=>!_0x2ba4b3),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x2c4040=>'chunk'===_0x2c4040)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x5b28aa=>'chunk'===_0x5b28aa)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2cb3b2=>'general'!==_0x2cb3b2)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x231bf7=>'chunk'!==_0x231bf7)]},'children':[{'text':Mi(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x235e95]}),_0x29db3b;}['_createCancelButtonView'](){const _0x5e589c=new yt(this['locale']);return _0x5e589c['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[Bi+'\x20ck-ai-button-stop-generating'],'icon':_0x5025db}),_0x5e589c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0xbc5817=>_0xbc5817),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x198be9=>_0x198be9)]}}),_0x5e589c['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x5e589c;}['_createToggleDiffButtonView'](){const _0x5219c6=new yt(this['locale']);_0x5219c6['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x5219c6['bind']('isEnabled')['to'](this,'isError',_0x421130=>!_0x421130),_0x5219c6['extendTemplate']({'attributes':{'class':[Bi,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x42ca53=>!_0x42ca53),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x43d657=>_0x43d657)]}});const _0x3692dd=Mi(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x194882=Mi(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x5219c6['bind']('isOn')['to'](this,'isToggleDiffOn',_0x1dbfb9=>_0x1dbfb9),_0x5219c6['bind']('icon')['to'](this,'isToggleDiffOn',_0x2719ac=>_0x2719ac?nt:rt),_0x5219c6['bind']('label')['to'](this,'isToggleDiffOn',_0x4a3458=>_0x4a3458?_0x3692dd:_0x194882),_0x5219c6['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x5219c6;}['_createAcceptAllButtonView'](){const _0xcd6630=new yt(this['locale']);return _0xcd6630['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0xcd6630['bind']('isEnabled')['to'](this,'isError',_0x47d9ff=>!_0x47d9ff),_0xcd6630['extendTemplate']({'attributes':{'class':[Ui,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x54be33=>!_0x54be33),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1e6407=>_0x1e6407)]}}),_0xcd6630['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0xcd6630;}['_createExitReviewButtonView'](){const _0x4d8b2f=new yt(this['locale']);return _0x4d8b2f['set']({'label':Mi(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x4d8b2f['extendTemplate']({'attributes':{'class':[Gi,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3b7fd5=>!_0x3b7fd5),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x465eb6=>_0x465eb6)]}}),_0x4d8b2f['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x4d8b2f;}['_createResultHeaderView'](){const _0x299d96=new Nt(this['locale']),_0x2f2e5c=this['_createTitleView']();return _0x299d96['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x13fb18=>_0x13fb18)]},'children':[_0x2f2e5c,{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4fb0a2=>!_0x4fb0a2)],'title':Mi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')},'children':[{'text':Mi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x299d96;}['_createTitleView'](){const _0x3beabd=new Nt(this['locale']),_0x3fa715=new AISpinnerView();return _0x3fa715['bind']('isVisible')['to'](this,'isResultReady',_0x3d547c=>!_0x3d547c),_0x3beabd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4d8589=>_0x4d8589)]},'children':[_0x3fa715,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]}]}),_0x3beabd;}['_createFinishReviewButtonView'](){const _0x304da6=new AIReviewCoreFinishReviewButtonView(Mi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x304da6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x15ea5c=>!_0x15ea5c)]}}),_0x304da6['delegate']('finishReview')['to'](this),_0x304da6;}}class AIReviewCoreReviewCompletedView extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x2e0b17,_0x282925){super(_0x2e0b17),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x282925['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x282925['headerText']);const _0x12f714=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x12f714['if']('isVisible','ck-hidden',_0x314c4a=>!_0x314c4a)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x282925['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x2feddb){const _0x7b2feb=new AIReviewCoreFinishReviewButtonView(_0x2feddb,this['locale']);return _0x7b2feb['delegate']('finishReview')['to'](this),_0x7b2feb;}['_createResultHeaderView'](_0x57ba68){const _0x2c5c5c=new Nt(this['locale']);return _0x2c5c5c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title'],'title':_0x57ba68},'children':[{'text':_0x57ba68}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x2c5c5c;}}class AIReviewCoreFormDropdownView extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x8e72c8,_0x477907){super(_0x8e72c8),this['_defaultValue']=_0x477907['default']||(_0x477907['data']['length']>0x0?_0x477907['data'][0x0]['id']:''),this['_defaultLabel']=_0x477907['data']['find'](_0x25c5e0=>_0x25c5e0['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Ft(this['locale']);const _0x168bdd=this['_prepareListOptions'](_0x477907['data']);Jt(this['_dropdownView'],_0x168bdd,{'role':'menu','ariaLabel':_0x477907['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1f3f77=>{_0x1f3f77['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x321447=>{this['formValue']=_0x321447['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x321447['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x3aa435=[]){const _0xd618a4=new _t();this['resetToDefault']();for(const _0x112921 of _0x3aa435){const _0x3587c3=new Zt({'label':_0x112921['label'],'withText':!0x0,'role':'menuitemradio','id':_0x112921['id'],'model':_0x112921});_0x3587c3['bind']('isOn')['to'](this,'formValue',_0x202b71=>_0x202b71===_0x3587c3['id']);const _0x40db25={'type':'button','model':_0x3587c3};_0xd618a4['add'](_0x40db25);}return _0xd618a4;}}class AIReviewCoreFormManagerView extends Ht{['_formItem']=null;constructor(_0x2900f7,_0x3bf7e1,_0x2e97e7){super(_0x2900f7),this['argsKey']=_0x3bf7e1?.['argsKey'];if('dropdown'===_0x3bf7e1['formType'])this['_formItem']=new AIReviewCoreFormDropdownView(this['locale'],_0x3bf7e1);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x35b580=new _0x2e5b92(this['locale'],{'children':[this['_formItem']],'class':[_0x2e97e7?'ck-form__row_with-submit':'']});_0x2e97e7&&_0x35b580['children']['add'](_0x2e97e7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x35b580]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class AIReviewCorePromptInputView extends _0x3a3bfa{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x1dc603){super(_0x1dc603),this['set']('isEmpty',!0x0),this['keystrokes']=new At(),this['minRows']=AIReviewCorePromptInputView['MIN_ROWS'],this['maxRows']=AIReviewCorePromptInputView['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class AIReviewCoreCustomCheckView extends Nt{['focusTracker']=new It();['keystrokes']=new At();['focusCycler'];['_focusables']=new _0x42c8a3();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0xca8e68,_0x123f44,_0x2d9ebf=!0x1){super(_0xca8e68),this['_check']=_0x123f44,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x123f44['defaultModel']?_0x123f44['defaultModel']['id']:'',this['_defaultLabel']=_0x123f44['defaultModel']?_0x123f44['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x5e9241(this['locale'],()=>new AIReviewCorePromptInputView(_0xca8e68)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _t(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x2d9ebf),Jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x2e5b92(this['locale'],{'children':[this['promptInputView']]}),new _0x2e5b92(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x4a4ad2,_0x1e83f9)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x1e83f9()):_0x1e83f9();}),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x19310e=>{this['_focusables']['add'](_0x19310e),this['focusTracker']['add'](_0x19310e['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x670af of this['_getFormValidators']()){const _0x2ce33d=_0x670af();if(_0x2ce33d)return this['promptInputView']['errorText']=_0x2ce33d,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return Mi(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x126b25=new yt(this['locale']),t=this['locale']['t'];return _0x126b25['set']({'label':t('Submit'),'withText':!0x0,'class':Ui}),_0x126b25['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x126b25;}['_createCancelButtonView'](){const _0x50f7ee=new yt(this['locale']),t=this['locale']['t'];return _0x50f7ee['set']({'label':t('Cancel'),'withText':!0x0,'class':Gi}),_0x50f7ee['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x43b97f=>{_0x43b97f['stopPropagation']();})}}),_0x50f7ee['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x50f7ee;}['_setModelList'](_0x43e27c){this['_modelSelectionDropdownItems']['clear']();const _0x1797cb=this['_check']['models'];if(_0x43e27c)this['set']('modelDisplayMode','hidden');else{const _0x905a77=0x1===_0x1797cb['length'];this['set']('modelDisplayMode',_0x905a77?'name':'selector');}if(this['resetToDefault'](),_0x1797cb?.['length']){0x1===_0x1797cb['length']&&this['set']('activeModelName',_0x1797cb[0x0]['name']||_0x1797cb[0x0]['id']);for(const _0x4b3ac3 of _0x1797cb){const _0x2853de=new Zt({'label':_0x4b3ac3['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4b3ac3['id'],'model':_0x4b3ac3});_0x2853de['bind']('isOn')['to'](this,'modelId',_0x4c3499=>_0x4c3499===_0x4b3ac3['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2853de,'labelView':new ModelButtonLabelView(this['locale'],_0x4b3ac3)});}}}['_createModelSelectionDropdown'](){const _0x24f04b=Ft(this['locale']);return _0x24f04b['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x24f04b['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':Gi}),_0x24f04b['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x612d42=>'selector'===_0x612d42),this['listenTo'](_0x24f04b,'execute',_0x578604=>{this['modelId']=_0x578604['source']['model']['id'],_0x24f04b['buttonView']['label']=_0x578604['source']['label'];}),_0x24f04b;}['_createModelNameView'](){const _0x625966=new ModelNameView(this['locale']);return _0x625966['bind']('text')['to'](this,'activeModelName',_0x513eb6=>_0x513eb6??''),_0x625966['bind']('isVisible')['to'](this,'modelDisplayMode',_0x28366e=>'name'===_0x28366e),_0x625966;}['_createActionsFooterView'](){const _0x4eae65=new Nt(this['locale']);return _0x4eae65['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x4eae65;}}class ModelNameView extends Nt{constructor(_0x17844e){super(_0x17844e),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x5a045c=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x5a045c['if']('isVisible','ck-hidden',_0x45a84f=>!_0x45a84f)]},'children':[{'text':_0x5a045c['to']('text')}]});}}class ModelButtonLabelView extends Mt{constructor(_0x35f7c4,_0x1e639a){super();const _0x32841c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x32841c['to']('style'),'id':_0x32841c['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x32841c['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x1e639a['description']||'']}]}]});}}class AIReviewCoreReviewCommandListItemView extends Ht{['_formItemsCollection']=new _0x42c8a3();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x462337,_0x3e505a,_0x335957,_0x586bb5=!0x1){super(_0x462337),this['_hideModels']=_0x586bb5,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x3e505a['isParameterized']);const _0x43b8a0=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x228767=>_0x228767),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x43e85c=>_0x43e85c)],'style':{'--ck-ai-review-check-list-item-index':_0x335957}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x3e505a['title']}]},_0x43b8a0]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x3e505a['description']?[{'text':_0x3e505a['description']}]:[]}]}]},..._0x3e505a['isParameterized']?[this['_createParameterizedView'](_0x3e505a)]:[],...'custom'===_0x3e505a['id']?[this['_createCustomView'](_0x3e505a,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x3e505a['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x3e505a['id'],'args':_0x3e505a['useArgs']?_0x3e505a['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&jt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x165bb7=>{_0x165bb7['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x558faa=new Lt();return _0x558faa['content']=ot,_0x558faa['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x558faa;}['_createParameterizedView'](_0x47aa5e){const _0x1dc758=new Nt(),_0x6387bd=this['_createFormView'](_0x47aa5e);return _0x1dc758['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x1da208=>!_0x1da208)]},'children':[_0x6387bd]}),_0x1dc758;}['_createFormView'](_0x27139e){const _0x11f701=new Nt(),_0x393b45=Array['isArray'](_0x27139e['options'])?_0x27139e['options']:[],_0x231659=new yt(this['locale']),t=this['locale']['t'];_0x231659['set']({'label':t('Submit'),'withText':!0x0,'class':Ui}),_0x231659['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4fc1b1=>{_0x4fc1b1['stopPropagation']();})}}),_0x231659['on']('execute',()=>{const _0x47295a=[],_0x34c6df={};this['_formItemsCollection']['forEach'](_0x1a5a4b=>{_0x47295a['push'](_0x1a5a4b['value']),_0x27139e['useArgs']&&_0x27139e['options']&&(_0x34c6df[_0x1a5a4b['argsKey']]=_0x1a5a4b['value']);}),this['fire']('runReviewCheck',{'id':_0x27139e['id'],'params':_0x47295a['length']?_0x47295a:void 0x0,'args':Object['keys'](_0x34c6df)['length']?_0x34c6df:void 0x0});});const _0x33df57=_0x393b45['length'];return _0x393b45['forEach']((_0x5ab913,_0x29ad86)=>{const _0x1c61d6=_0x29ad86===_0x33df57-0x1;this['_formItemsCollection']['add'](new AIReviewCoreFormManagerView(this['locale'],_0x5ab913,_0x1c61d6?_0x231659:null));}),_0x11f701['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x11f701;}['_createCustomView'](_0x52ee4f,_0x5598b8=!0x1){return this['_customCheckView']=new AIReviewCoreCustomCheckView(this['locale'],_0x52ee4f,_0x5598b8),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x14d204=>!_0x14d204)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x37a15e,_0x454bb1,_0x36b6fb)=>{_0x36b6fb||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class AIReviewCoreReviewCheckListView extends Ht{['_checkViews'];constructor(_0x4d2f2d){super(_0x4d2f2d),this['_checkViews']=new _0x42c8a3(),this['_setupTemplate']();}['setChecks'](_0x24ec97,_0x5502d8=!0x1){this['_checkViews']['clear']();for(const [_0x597f32,_0x1bff92]of _0x24ec97['entries']()){const _0x3d1052=new AIReviewCoreReviewCommandListItemView(this['locale'],_0x1bff92,_0x597f32,_0x5502d8);_0x3d1052['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x3d1052);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x2ddc43 of this['_checkViews'])_0x2ddc43 instanceof AIReviewCoreReviewCommandListItemView&&_0x2ddc43['resetToDefault']();}['_setupTemplate'](){const _0xfd131=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0xfd131['if']('isVisible','ck-hidden',_0x29a5fa=>!_0x29a5fa)]},'children':this['_checkViews']});}}class AIReviewModeUI extends AIReviewCoreUI{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x5c1c81=this['context']['plugins']['get']('AITabs'),_0x32ff9c=this['context']['locale'],_0x5a674b=new AIHeaderView(_0x32ff9c,{'label':Mi(_0x32ff9c,'AI_REVIEW_MODE'),'icon':_0x497872,'class':'ck-ai-header_review','showResizeButton':_0x5c1c81['showResizeButton']});return _0x5a674b['delegate']('resizeTabs')['to'](_0x5c1c81),_0x5a674b['bind']('isMaximized')['to'](_0x5c1c81['view'],'isMaximized',_0x2491b1=>_0x2491b1),new AIReviewCoreView(this['context']['locale'],{'header':_0x5a674b,'list':new AIReviewCoreReviewCheckListView(_0x32ff9c),'results':new AIReviewCoreUICheckResultsView(_0x32ff9c,{'generalErrorText':Mi(_0x32ff9c,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x32ff9c,{'headerText':Mi(_0x32ff9c,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':Mi(_0x32ff9c,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':Mi(_0x32ff9c,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x102450=this['context']['plugins']['get']('AITabs');_0x102450['view']['on']('activateTab',(_0x4cdd3b,{newTab:_0x5b6f87,oldTab:_0x14d653})=>{'reviewMode'===_0x5b6f87?this['fire']('getReviewCheckList'):'reviewMode'===_0x14d653&&this['fire']('leaveReview');}),_0x102450['view']['addTab']({'id':'reviewMode','buttonLabel':Mi(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x497872,'order':0x0,'content':this['_mainView']});}}const tr='review-',er=['softBreak'],ir=['htmlScript','htmlStyle','htmlCustomElement'];class AIReviewCoreEditing extends _0x2bf4b8{static get['requires'](){return[_0x2ab8a5,AIEditing];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];['_reviewEditingAttachedEditors']=new WeakSet();['_boundEditables']=new WeakMap();constructor(_0x17d6a2){super(_0x17d6a2),this['_domEmitter']=new(vt())(),this['_eventEmitter']=new(Et())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x5710c9=_0x3fdc7a=>this['_scheduleAttachReviewEditingToEditor'](_0x3fdc7a);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x331160)return void _0x5710c9(this['context']);const _0x214a3d=this['context'];for(const _0x79a2ed of _0x214a3d['editors'])_0x5710c9(_0x79a2ed);this['listenTo'](_0x214a3d['editors'],'add',(_0x4a06f0,_0x18ae16)=>{_0x5710c9(_0x18ae16);}),this['listenTo'](_0x214a3d['editors'],'remove',(_0x146e59,_0x2eaf36)=>{for(const [_0x215634,_0x53143d]of this['_markers'])_0x53143d['editor']===_0x2eaf36&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x215634,'changeId':_0x53143d['groupId']}),this['_markers']['delete'](_0x215634));});}['_scheduleAttachReviewEditingToEditor'](_0x174317){const _0x878316=()=>{'destroyed'!==_0x174317['state']&&_0x174317['conversion']&&this['_attachReviewEditingToEditor'](_0x174317);};if('ready'===_0x174317['state'])return void _0x878316();const _0x4152ae=()=>{this['stopListening'](_0x174317,'ready',_0x4152ae),_0x878316();};this['listenTo'](_0x174317,'ready',_0x4152ae);}['_attachReviewEditingToEditor'](_0x2e71a0){this['_reviewEditingAttachedEditors']['has'](_0x2e71a0)||(_0x2e71a0['conversion']['for']('editingDowncast')['markerToElement']({'model':tr+'insert','view':(_0x2eeb24,{writer:_0x493617})=>{const _0x3dd3c8=this['_markers']['get'](_0x2eeb24['markerName']),_0x17216e={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x3dd3c8?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2eeb24['markerName']};return _0x493617['createUIElement']('span',_0x17216e,function(_0x52f082){const _0x38306c=this['toDomElement'](_0x52f082);return _0x38306c['innerHTML']=_0x3dd3c8?.['content']?.['asString']||'',_0x38306c;});}}),_0x2e71a0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':tr+'remove-only','view':_0x47bf38=>{const _0x345858=this['_markers']['get'](_0x47bf38['markerName']),_0x22ef40=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x345858?.['id']||'')&&_0x22ef40['push']('ck-ai_review__change_active'),{'classes':_0x22ef40,'attributes':{'data-marker-id':_0x47bf38['markerName']}};}}),_0x2e71a0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':tr+'remove-context','view':_0x1c4933=>{const _0x229f0a=this['_markers']['get'](_0x1c4933['markerName']),_0x4a460b=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x229f0a?.['id']||'')&&_0x4a460b['push']('ck-ai_review__change_active'),{'classes':_0x4a460b,'attributes':{'data-marker-id':_0x1c4933['markerName']}};}}),_0x2e71a0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':tr+'remove-text','view':_0x47ff55=>{const _0x49ace3=this['_markers']['get'](_0x47ff55['markerName']),_0x11c66e=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x49ace3?.['id']||'')&&_0x11c66e['push']('ck-ai_review__change_active'),{'classes':_0x11c66e,'attributes':{'data-marker-id':_0x47ff55['markerName']}};}}),_0x2e71a0['conversion']['for']('dataDowncast')['markerToElement']({'model':tr+'suggestion-context','view':(_0x26d60e,{writer:_0x4621e7})=>_0x4621e7['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x26d60e['isOpening']?'start':'end')})}),_0x2e71a0['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x2f50ff,'view':_0x271537}),this['_updateMouseMarkerInteractionListeners'](_0x2e71a0),this['listenTo'](_0x2e71a0,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x2e71a0),{'priority':'lowest'}),this['listenTo'](_0x2e71a0,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x2e71a0),{'priority':'lowest'}),_0x2e71a0['model']['document']['registerPostFixer'](_0x2f812a=>this['_validateMarkers'](_0x2e71a0,_0x2f812a)),_0x2e71a0['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x2e71a0)),this['_reviewEditingAttachedEditors']['add'](_0x2e71a0));}['_updateMouseMarkerInteractionListeners'](_0x2ee54e){let _0x3c5af1=this['_boundEditables']['get'](_0x2ee54e);_0x3c5af1||(_0x3c5af1=new Map(),this['_boundEditables']['set'](_0x2ee54e,_0x3c5af1));const _0x2a2263=new Set(_0x2ee54e['ui']['getEditableElementsNames']());for(const _0x3213d0 of _0x2a2263){if(_0x3c5af1['has'](_0x3213d0))continue;const _0x5462c8=_0x2ee54e['ui']['getEditableElement'](_0x3213d0);_0x3c5af1['set'](_0x3213d0,_0x5462c8),this['_attachMouseMarkerInteractionListeners'](_0x5462c8);}for(const [_0x25abb5,_0x57167a]of _0x3c5af1)_0x2a2263['has'](_0x25abb5)||(_0x3c5af1['delete'](_0x25abb5),this['_domEmitter']['stopListening'](_0x57167a));}['_attachMouseMarkerInteractionListeners'](_0xbf7199){this['_domEmitter']['listenTo'](_0xbf7199,'mouseup',(_0x25a8ee,_0x43308d)=>{const _0x167aa1=_0x43308d['target'],_0x55b47d=this['_findMarkerElement'](_0x167aa1);if(!_0x55b47d)return;const _0x49f898=_0x55b47d['getAttribute']('data-marker-id'),_0xa4102=_0x49f898['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x49f898,'changeId':_0xa4102,'markerElement':()=>this['_findMarkerElementById'](_0x49f898),'domEvent':_0x43308d});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0xbf7199,'mouseover',(_0x55e552,_0x3204ef)=>{const _0x18ddb6=_0x3204ef['target'],_0x1e24ab=_0x3204ef['relatedTarget'];let _0x363941=this['_findMarkerElement'](_0x18ddb6);if(!_0x363941&&_0x1e24ab&&(_0x363941=this['_findMarkerElement'](_0x1e24ab)),!_0x363941)return;const _0x48140b=_0x363941['getAttribute']('data-marker-id'),_0x1cae8e=_0x48140b['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x1cae8e,'markerElement':()=>this['_findMarkerElementById'](_0x48140b),'domEvent':_0x3204ef});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x432e5f((_0x3adf55,_0xbfecb2)=>{const _0x24d541=_0xbfecb2['target'];if(this['_findMarkerElement'](_0x24d541))return;_0x24d541['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x3412b3=this['context']['plugins']['get']('AIEditing'),_0x3ab0e7=ms(this['context']);if(!_0x3ab0e7['length'])throw new ht('ai-get-editor-from-context-no-editor',this);const _0x2c1d9f=new Set(),_0x35bb32=[],_0x53b046=new Map();for(const _0x3cc1c3 of _0x3ab0e7)for(const _0x2fcc8c of _0x3cc1c3['model']['document']['getRoots']()){if('$graveyard'===_0x2fcc8c['rootName'])continue;const _0x3e8400=this['_buildDocumentDataSliceForRoot'](_0x3cc1c3,_0x2fcc8c,_0x3412b3,_0x2c1d9f);_0x35bb32['push'](_0x3e8400['content']);for(const [_0x224566,_0x138af3]of _0x3e8400['elements'])_0x53b046['set'](_0x224566,_0x138af3);}return{'elements':_0x53b046,'content':_0x35bb32['join']('')};}['_buildDocumentDataSliceForRoot'](_0x2c3b58,_0x3c58e2,_0x2c0b47,_0x315136){const _0x4fc568=_0x2c3b58['model'],_0x2611fb=new _0x4d6f3c();for(const _0x2a5cee of _0x3c58e2['getChildren']())_0x2611fb['_appendChild'](_0x2a5cee['_clone'](!0x0));for(const _0x17d86b of _0x4fc568['markers']){const _0x2c0501=_0x17d86b['getRange']();_0x2c0501&&_0x2c0501['root']['rootName']===_0x3c58e2['rootName']&&_0x2611fb['markers']['set'](_0x17d86b['name'],this['_changeRangeOwnerDocument'](_0x2c0501['clone'](),_0x2611fb));}const _0x8a8ab3=new Map(),_0x415191=_0x4fc568['document']['version'],_0x590331=new _0x3d7344({'ignoreElementEnd':!0x0,'startPosition':_0x4fc568['createPositionAt'](_0x2611fb,0x0)});for(const {item:_0x1f9f7b}of _0x590331){if(_0x1f9f7b['is']('element')&&_0x1f9f7b['name']&&ir['includes'](_0x1f9f7b['name'])){const _0x4e7f3a=this['_upsertDataId'](_0x1f9f7b,()=>_0x2c0b47['_nextDataId'](_0x315136));_0x315136['add'](_0x4e7f3a);}if(!_0x1f9f7b['is']('$textProxy'))continue;const _0x310bc9=_0x1f9f7b['parent'];if(!_0x310bc9||!_0x310bc9['is']('element'))continue;const _0x1578c3=this['_upsertDataId'](_0x310bc9,()=>_0x2c0b47['_nextDataId'](_0x315136));_0x315136['add'](_0x1578c3);for(const _0x27c5ba of _0x310bc9['getChildren']())_0x27c5ba['is']('element')&&(_0x27c5ba['name']&&er['includes'](_0x27c5ba['name'])||_0x315136['add'](this['_upsertDataId'](_0x27c5ba,()=>_0x2c0b47['_nextDataId'](_0x315136))));let _0x2a04d9=_0x310bc9;for(;_0x2a04d9['parent']&&!_0x2a04d9['parent']['is']('documentFragment');)_0x2a04d9=_0x2a04d9['parent'],_0x2a04d9['hasAttribute'](_0x2f50ff)&&_0x2a04d9['_removeAttribute'](_0x2f50ff);_0x8a8ab3['set'](_0x1578c3,{'editor':_0x2c3b58,'rootName':_0x3c58e2['rootName'],'path':_0x310bc9['getPath'](),'documentVersion':_0x415191,'getContent':this['_createGetContentUsingDataIdFn'](_0x2a04d9['_clone'](!0x0),_0x1578c3,_0x2c3b58['data'])}),_0x590331['jumpTo'](_0x4fc568['createPositionAfter'](_0x310bc9));}return{'content':_0x2c3b58['data']['processor']['toData'](_0x2c3b58['data']['toView'](_0x2611fb)),'elements':_0x8a8ab3};}['diffContent'](_0x342a9a,_0x300cd6,_0x13acc2,_0x169010=!0x1){const {contentInitial:_0x113814,contentNew:_0x4b5df8}=this['_neutralizeChangesOnUnsupportedElements'](_0x300cd6,_0x13acc2),_0x16c3f8=[],_0x57d3d8=_0x342a9a['data']['parse'](_0x4b5df8,'$documentFragment'),_0xb74689=_0x342a9a['data']['parse'](_0x113814,'$documentFragment'),_0x1f05c2=_0x342a9a['model']['createPositionAt'](_0xb74689,0x0);if(this['_haveSingleTopLevelElement'](_0x57d3d8)){if(!this['_hasSameTopLevelElement'](_0xb74689,_0x57d3d8))return _0x16c3f8;}else{const _0x57c98f=_0x342a9a['model']['schema'];if(!this['_haveOnlyInlineContent'](_0xb74689,_0x57c98f)||!this['_haveOnlyInlineContent'](_0x57d3d8,_0x57c98f))return _0x16c3f8;}const _0x219d92=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x113814,_0x4b5df8,{'targetEditor':_0x342a9a,'anchor':_0x1f05c2,'markDeletions':!0x0})['getOperations']()['filter'](_0x30a7ab=>'insert'===_0x30a7ab['type']||'marker'===_0x30a7ab['type']&&_0x30a7ab['name']['startsWith']('$markedRemove')),_0x55934b=this['_groupAdjacentOperations'](_0x219d92),_0x3d903c=[];if(_0x169010){if(_0x55934b['length']){const _0x129ce3=_0x55934b[0x0]['operations'][0x0],_0x6cdfed='insert'===_0x129ce3['type']?_0x129ce3['position']:_0x129ce3['newRange']['start'],_0x57732a=this['_getPositionLimitingRange'](_0x6cdfed,_0x342a9a,'inside'),_0x596d8b=_0x57732a?_0x57d3d8['getChild'](0x0)['getChildren']():_0x57d3d8['getChildren'](),_0x5070db=_0x57732a||_0x342a9a['model']['createRangeIn'](_0xb74689),_0x3c9105=[new _0x55cc4a('$markedRemove:synthetic'+at(),null,_0x5070db,_0x342a9a['model']['document']['model']['markers'],!0x0,_0x342a9a['model']['document']['version']+0x1),new _0x121d37(_0x5070db['end'],_0x596d8b,_0x342a9a['model']['document']['version']+0x2)];_0x3d903c['push']({'operations':_0x3c9105,'operationsIsolated':_0x3c9105,'groupOffset':0x0});}}else _0x3d903c['push'](..._0x55934b);let _0x59d5e1=0x0;return _0x342a9a['model']['change'](_0x1d2774=>{for(let _0x107390=0x0;_0x107390<_0x3d903c['length'];_0x107390++){const _0x274cb2=_0x3d903c[_0x107390],_0x400505=_0x1d2774['createDocumentFragment']();for(const _0x2a3f9f of _0xb74689['getChildren']())_0x1d2774['append'](_0x2a3f9f['_clone'](!0x0),_0x400505);for(const _0x12363c of _0x274cb2['operationsIsolated'])if('insert'===_0x12363c['type']){const _0x90289b=_0x12363c;_0x90289b['baseVersion']=null,_0x90289b['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x90289b,_0x400505),_0x1d2774['batch']['addOperation'](_0x12363c),_0x342a9a['model']['applyOperation'](_0x12363c);const _0xad81d3='suggestion:insertion:id:authorId:'+_0x59d5e1++,_0xbf300b=_0x342a9a['model']['createRange'](_0x90289b['position'],_0x90289b['position']['getShiftedBy'](_0x90289b['howMany']));_0x400505['markers']['set'](_0xad81d3,_0xbf300b);}else{if('marker'===_0x12363c['type']&&_0x12363c['name']['startsWith']('$markedRemove')){const _0x55a4f5=_0x12363c,_0x376840='suggestion:deletion:id:authorId:'+_0x59d5e1++;this['_changeOperationOwnerDocument'](_0x55a4f5,_0x400505),_0x400505['markers']['set'](_0x376840,_0x55a4f5['newRange']);}}if(_0x169010)_0x16c3f8['push']({..._0x274cb2,'context':this['_createGetContentFn'](_0xb74689,_0x342a9a['data']),'content':this['_createGetContentFn'](_0xb74689,_0x342a9a['data'])});else{const _0x47fd71=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x274cb2['operationsIsolated'][0x0]),_0x400505),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x274cb2['operationsIsolated'][_0x274cb2['operationsIsolated']['length']-0x1]),_0x400505),_0x342a9a);_0x400505['markers']['set'](tr+'suggestion-context',new _0x303302(_0x47fd71['start'],_0x47fd71['end'])),_0x16c3f8['push']({..._0x274cb2,'context':this['_createGetContextFn'](_0x400505,_0x342a9a['data'],{'ellipsisBefore':_0x47fd71['hasContentBefore'],'ellipsisAfter':_0x47fd71['hasContentAfter']}),'content':this['_createGetContentFn'](_0x400505,_0x342a9a['data'])});}}}),_0x16c3f8;}['markChangePositionInEditorContent'](_0x4a84e7,_0x1c17a6){if(!_0x4a84e7['length'])return;const _0x33202d=_0x4a84e7[0x0]['parent']['id'],_0x5be1b0=_0x1c17a6['elements']['get'](_0x33202d);if(!_0x5be1b0)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x33202d);const _0xfe0613=_0x5be1b0['path'],_0x8f3538=_0x5be1b0['editor'],_0x3329ac=_0x8f3538['model']['document']['getRoot'](_0x5be1b0['rootName']);if(!_0x3329ac)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x5be1b0['rootName']);const _0x330a20=_0x8f3538['model']['document']['history']['getOperations'](_0x5be1b0['documentVersion']),_0x317d69=[];for(const _0x402df4 of _0x4a84e7){const _0x3b2b91=_0x402df4['operationsIsolated']['map'](_0x1b8569=>this['_translateOperationToEditorContent'](_0x1b8569,_0xfe0613,_0x3329ac));if(!_0x3b2b91||!_0x3b2b91['length'])continue;const _0x544b6f=_0x3b2b91['every'](_0x2330e3=>'marker'===_0x2330e3['type']&&_0x2330e3['name']['startsWith']('$markedRemove')),_0x27c8d5={'document':_0x8f3538['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x422210=_0x329636(_0x3b2b91,_0x330a20,_0x27c8d5)['operationsA'];for(const _0x3a02dc of _0x422210)if('insert'===_0x3a02dc['type']){const _0x54a0a3=_0x3a02dc,_0xb066a4=_0x54a0a3['nodes'];_0x8f3538['model']['change'](_0x8220df=>{const _0x278888=_0x8220df['createDocumentFragment']();for(const _0x517003 of _0xb066a4)_0x8220df['append'](_0x517003['_clone'](!0x0),_0x278888);_0x317d69['push']({'start':_0x54a0a3['position'],'end':_0x54a0a3['position'],'type':'insert','groupId':_0x402df4['id'],'content':{'asString':this['_createGetContentFn'](_0x278888,_0x8f3538['data'])(),'asFragment':_0x278888}});});}else{if('marker'===_0x3a02dc['type']&&_0x3a02dc['name']['startsWith']('$markedRemove')){const _0x5777f1=_0x3a02dc;let _0x3ff5d9='remove-text';if(_0x544b6f){const _0x42ebcb=this['_findAdjacentContextDistance'](_0x5777f1['newRange']['start'],'backward',_0x8f3538['model']['schema']),_0x1a7045=this['_findAdjacentContextDistance'](_0x5777f1['newRange']['end'],'forward',_0x8f3538['model']['schema']);if(_0x42ebcb||_0x1a7045){const _0x20175a=_0x5777f1['newRange']['start']['getShiftedBy'](-_0x42ebcb),_0x50a882=_0x5777f1['newRange']['end']['getShiftedBy'](_0x1a7045);_0x317d69['push']({'start':_0x20175a,'end':_0x50a882,'groupId':_0x402df4['id'],'type':'remove-context'});}else _0x3ff5d9='remove-only';}_0x317d69['push']({'start':_0x5777f1['newRange']['start'],'end':_0x5777f1['newRange']['end'],'groupId':_0x402df4['id'],'type':_0x3ff5d9});}}}this['_insertMarkers'](_0x317d69,_0x8f3538);}['clearAllMarkers'](){const _0x285cf1=new Map();for(const _0x1d6efa of this['_markers']['keys']()){const _0x465dba=this['_markers']['get'](_0x1d6efa);_0x465dba?.['editor']&&(_0x285cf1['has'](_0x465dba['editor'])||_0x285cf1['set'](_0x465dba['editor'],[]),_0x285cf1['get'](_0x465dba['editor'])['push'](_0x1d6efa));}for(const [_0x515ccc,_0x1ab180]of _0x285cf1)_0x515ccc['model']['change'](_0x24127a=>{for(const _0x4819c0 of _0x1ab180)_0x515ccc['model']['markers']['get'](_0x4819c0)&&_0x24127a['removeMarker'](_0x4819c0);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0xece009 of ms(this['context']))_0xece009['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x3a17c3 of ms(this['context']))_0x3a17c3['disableReadOnlyMode']('ai-review');}['applyChange'](_0x15f09c){const _0x5eb911=_0x15f09c['map'](_0x250298=>this['_getMarkersDataForGroup'](_0x250298))['flat'](),_0x556c3d=new Map();for(const _0x1a73ea of _0x5eb911)_0x556c3d['has'](_0x1a73ea['editor'])||_0x556c3d['set'](_0x1a73ea['editor'],[]),_0x556c3d['get'](_0x1a73ea['editor'])['push'](_0x1a73ea);for(const [_0x366e02,_0x2ee89d]of _0x556c3d){const _0x507b08=_0x366e02['model'];_0x507b08['change'](_0x206e52=>{for(const _0x3ab53d of _0x2ee89d){const _0x3eabae=_0x366e02['model']['markers']['get'](_0x3ab53d['id']);if(_0x3eabae){if('insert'===_0x3ab53d['type']){if(!_0x3ab53d['content'])continue;_0x507b08['insertContent'](_0x3ab53d['content']['asFragment']||null,_0x3eabae['getRange']()['start']);}else'remove-text'!==_0x3ab53d['type']&&'remove-only'!==_0x3ab53d['type']||_0x507b08['deleteContent'](_0x507b08['createSelection'](_0x3eabae['getRange']()));_0x206e52['removeMarker'](_0x3ab53d['id']),this['_markers']['delete'](_0x3ab53d['id']);}}});}}['rejectChange'](_0x4e0317){const _0x37e3ef=this['_getMarkersDataForGroup'](_0x4e0317),_0x3fb463=new Map();for(const _0x40ab63 of _0x37e3ef)_0x3fb463['has'](_0x40ab63['editor'])||_0x3fb463['set'](_0x40ab63['editor'],[]),_0x3fb463['get'](_0x40ab63['editor'])['push'](_0x40ab63);for(const [_0x526377,_0x2f493e]of _0x3fb463)_0x526377['model']['change'](_0x567074=>{for(const _0x4f7267 of _0x2f493e)_0x567074['removeMarker'](_0x4f7267['id']),this['_markers']['delete'](_0x4f7267['id']);});}['getEditor'](){return ps(this['context']);}['getEditors'](){return ms(this['context']);}['getEditorForChange'](_0x345069){const _0x42b65b=this['_getMarkersDataForGroup'](_0x345069);return _0x42b65b[0x0]?.['editor'];}['getMarkerElementForChange'](_0x165ae0){const _0x1db010=Array['from'](this['_markers']['values']())['filter'](_0x2676c8=>_0x2676c8['groupId']===_0x165ae0);if(!_0x1db010['length'])return null;const _0x148c8e=0x1===_0x1db010['length']?_0x1db010[0x0]:this['_sortMarkers'](_0x1db010)[0x0],_0x2b3aa3=_0x148c8e['editor']['model']['markers']['get'](_0x148c8e['id']);if(!_0x2b3aa3)return null;return{'modelRange':_0x2b3aa3['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x148c8e['id'])};}['getContentElementForChange'](_0x29dcc1){const _0x1167b6=Array['from'](this['_markers']['values']())['filter'](_0x3fe60b=>_0x3fe60b['groupId']===_0x29dcc1);if(!_0x1167b6['length'])return null;const _0x25cb1a=0x1===_0x1167b6['length']?_0x1167b6[0x0]:this['_sortMarkers'](_0x1167b6)[0x0],_0x1ba87b=_0x25cb1a['editor'],_0x21c050=_0x1ba87b['model']['markers']['get'](_0x25cb1a['id']);if(!_0x21c050)return null;const _0x3e5458=_0x21c050['getRange'](),_0x43c958=_0x1ba87b['editing']['view']['getDomRoot'](_0x3e5458['root']['rootName'])||_0x1ba87b['editing']['view']['getDomRoot']();if(!_0x43c958||!_0x3e5458)return null;let _0x368278=_0x3e5458['start']['parent'];for(;_0x368278['parent']&&!_0x368278['parent']['is']('rootElement');)_0x368278=_0x368278['parent'];if(!_0x368278||!_0x368278['name'])return null;const _0x4ebc41=_0x43c958['querySelector']('[data-marker-id=\x22'+_0x25cb1a['id']+'\x22]');if(!_0x4ebc41)return null;let _0x5a276f=null;_0x1ba87b['model']['change'](_0x181455=>{_0x5a276f=_0x181455['createDocumentFragment'](),_0x181455['append'](_0x368278['_clone'](!0x0),_0x5a276f);});const _0x2da1bf=_0x1ba87b['data']['toView'](_0x5a276f)['getChild'](0x0);return _0x4ebc41['closest'](_0x2da1bf['name']);}['reactivateMarkers'](_0x25fc9b){const _0x327cde=this['_getMarkersDataForGroup'](_0x25fc9b);if(!_0x327cde['length'])return;const _0xdfcf96=Array['from'](this['_activeMarkers'])['sort'](),_0x5e2b13=Array['from'](new Set(_0x327cde['map'](_0x5eeb1a=>_0x5eeb1a['id'])))['sort']();_0xdfcf96['join']('|')!==_0x5e2b13['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x25fc9b));}['setMarkersInElementAsActive'](_0x53e6f9){const _0x2e6fe5=this['_getMarkersDataForGroup'](_0x53e6f9);if(!_0x2e6fe5['length'])return;const _0xa9df41=_0x2e6fe5[0x0]['editor'],_0x38315c=new Set(_0x2e6fe5['map'](_0x192998=>_0x192998['id'])),_0x21bdbf=Array['from'](_0x38315c['values']())['map'](_0x4cd2c2=>_0xa9df41['model']['markers']['get'](_0x4cd2c2))['filter'](_0x34b8cc=>!!_0x34b8cc);_0x38315c['forEach'](_0x4f302f=>{this['_activeMarkers']['add'](_0x4f302f);}),_0xa9df41['model']['change'](()=>{_0x21bdbf['forEach'](_0x2d1b05=>{_0xa9df41['editing']['reconvertMarker'](_0x2d1b05);});});}['setAllMarkersAsInactive'](){const _0x1a936e=Array['from'](this['_activeMarkers']);if(!_0x1a936e['length'])return;this['_activeMarkers']['clear']();const _0x40510e=new Map();for(const _0x146150 of _0x1a936e){const _0x427879=this['_markers']['get'](_0x146150);if(!_0x427879)continue;const _0x10dad9=_0x427879['editor'],_0x16d4d2=_0x10dad9['model']['markers']['get'](_0x146150);_0x16d4d2&&(_0x40510e['has'](_0x10dad9)||_0x40510e['set'](_0x10dad9,[]),_0x40510e['get'](_0x10dad9)['push'](_0x16d4d2));}for(const [_0x38496f,_0x3a4ea7]of _0x40510e)_0x38496f['model']['change'](()=>{_0x3a4ea7['forEach'](_0x219f51=>{_0x38496f['editing']['reconvertMarker'](_0x219f51);});});}['_getPositionLimitingRange'](_0x5150ca,_0x68db3d,_0x399d8='outside'){if(!_0x5150ca)return null;let _0x34b1b0=_0x5150ca['parent'];for(;_0x34b1b0&&_0x34b1b0['parent']&&!_0x34b1b0['parent']['is']('rootElement')&&!_0x68db3d['model']['schema']['isLimit'](_0x34b1b0)&&!_0x68db3d['model']['schema']['isBlock'](_0x34b1b0);)_0x34b1b0=_0x34b1b0['parent'];if(!_0x34b1b0||!_0x34b1b0['name']||_0x34b1b0['is']('rootElement'))return null;let _0x364acd=null;return _0x68db3d['model']['change'](_0x2f8d74=>{_0x364acd='inside'===_0x399d8?_0x2f8d74['createRangeIn'](_0x34b1b0):_0x2f8d74['createRangeOn'](_0x34b1b0);}),_0x364acd;}['_validateMarkers'](_0x347a6c,_0x4a4b5b){const _0x55350f=Array['from'](this['_markers']['keys']()),_0x186a30=new Map();for(const _0x16d37c of _0x55350f){const _0x1b85cc=_0x347a6c['model']['markers']['get'](_0x16d37c);if(!_0x1b85cc)continue;const _0x50effb=_0x1b85cc['getStart']()['root']['rootName']+':'+_0x1b85cc['getStart']()['path'][0x0];_0x186a30['has'](_0x50effb)||_0x186a30['set'](_0x50effb,[]),_0x186a30['get'](_0x50effb)['push'](_0x1b85cc);}const _0x52f578=new Set();for(const _0x444af0 of _0x347a6c['model']['document']['differ']['getChanges']()){let _0x4df7d1='',_0xd039d0=null;if('insert'===_0x444af0['type'])_0xd039d0=new _0x303302(_0x444af0['position'],_0x444af0['position']['getShiftedBy'](_0x444af0['length'])),_0x4df7d1=_0x444af0['position']['root']['rootName']+':'+_0x444af0['position']['path'][0x0];else{if('remove'!==_0x444af0['type'])continue;_0xd039d0=new _0x303302(_0x444af0['position']),_0x4df7d1=_0x444af0['position']['root']['rootName']+':'+_0x444af0['position']['path'][0x0];}const _0x32635c=_0x186a30['get'](_0x4df7d1)||[];if(_0x32635c['length']){for(const _0x94e8f6 of _0x32635c)if(_0xd039d0['root']['rootName']===_0x94e8f6['getRange']()['root']['rootName']&&('insert'!==_0x444af0['type']||!_0xd039d0['containsRange'](_0x94e8f6['getRange']()))&&(_0xd039d0['isIntersecting'](_0x94e8f6['getRange']())||_0xd039d0['start']['isTouching'](_0x94e8f6['getRange']()['end'])||_0xd039d0['end']['isTouching'](_0x94e8f6['getRange']()['start']))){const _0x515d11=this['_parseMarkerName'](_0x94e8f6['name']);Array['from'](this['_markers']['values']())['filter'](_0x3eecd1=>_0x3eecd1['groupId']===_0x515d11['groupId'])['forEach'](_0x1c9abb=>_0x52f578['add'](_0x1c9abb['id']));}}}if(_0x52f578['size']){for(const _0xab2616 of _0x52f578)_0x4a4b5b['removeMarker'](_0xab2616);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x2f2b82){for(const {name:_0x465256,data:_0x27e778}of _0x2f2b82['model']['document']['differ']['getChangedMarkers']()){if(!_0x465256['startsWith'](tr))continue;const _0x3f18f2=_0x27e778['oldRange'],_0x257983=_0x27e778['newRange'],_0x5c6fcb=_0x3f18f2&&'$graveyard'===_0x3f18f2['root']['rootName'],_0xd77930=_0x257983&&'$graveyard'===_0x257983['root']['rootName'];if(_0x5c6fcb&&_0xd77930)continue;const _0x462a8c=this['_parseMarkerName'](_0x465256);this['_markers']['get'](_0x465256)&&(_0xd77930||!_0x257983?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x465256,'changeId':_0x462a8c['groupId']}):_0x5c6fcb&&_0x257983&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x465256,'changeId':_0x462a8c['groupId']}));}}['_parseMarkerName'](_0x1d3887){const _0x858dce=_0x1d3887['split'](':'),_0x44a73f=(_0x858dce[0x1]||'')['split']('_');return{'prefix':_0x858dce[0x0],'groupId':_0x44a73f[0x0],'suffix':_0x44a73f[0x1]};}['_translateOperationToEditorContent'](_0x241cbe,_0x7fb6f5,_0x9b3e82){if('insert'===_0x241cbe['type']){const _0x2992e8=_0x241cbe;return new _0x121d37(this['_changePosition'](_0x7fb6f5['concat'](_0x2992e8['position']['offset']),_0x9b3e82),_0x2992e8['nodes'],_0x2992e8['baseVersion']);}if('marker'===_0x241cbe['type']&&_0x241cbe['name']['startsWith']('$markedRemove')){const _0x5b16b7=_0x241cbe;return new _0x55cc4a(_0x5b16b7['name'],_0x5b16b7['oldRange'],this['_changeRange'](_0x5b16b7['newRange'],_0x7fb6f5['concat'](_0x5b16b7['newRange']['start']['offset']),_0x7fb6f5['concat'](_0x5b16b7['newRange']['end']['offset']),_0x9b3e82),_0x5b16b7['_markers'],_0x5b16b7['affectsData'],_0x5b16b7['baseVersion']);}return _0x241cbe;}['_groupAdjacentOperations'](_0x412bfe){if(!_0x412bfe['length'])return[];const _0x2041e1=[];let _0x26e04e=0x0,_0x38d090=0x0,_0x1f4ae0=[];for(let _0x1ecbed=0x0;_0x1ecbed<=_0x412bfe['length'];_0x1ecbed++){const _0x5814ba=_0x412bfe[_0x1ecbed],_0x39a951=_0x412bfe[_0x1ecbed-0x1];!_0x5814ba||_0x39a951&&!this['_getOperationEnd'](_0x39a951)['isTouching'](this['_getOperationStart'](_0x5814ba))?(_0x2041e1['push']({'operations':_0x1f4ae0,'operationsIsolated':_0x1f4ae0['map'](_0x1571ff=>this['_shiftOperation'](_0x1571ff['clone'](),-_0x38d090)),'groupOffset':_0x26e04e}),_0x1f4ae0=_0x5814ba?[_0x5814ba]:[],_0x38d090+=_0x26e04e,_0x26e04e=0x0):_0x1f4ae0['push'](_0x5814ba),_0x5814ba&&'insert'===_0x5814ba['type']&&(_0x26e04e+=_0x5814ba['howMany']);}return _0x2041e1;}['_findAdjacentContextDistance'](_0x29a4ee,_0x96750,_0x488aee,_0x2dab80=0x1){const _0x5eecf5=new _0x3d7344({'startPosition':_0x29a4ee,'direction':_0x96750});let _0x214b3a=0x0;for(let _0x3ec6a6=0x0;_0x3ec6a6<_0x2dab80;_0x3ec6a6++){let _0x3621c4=0x0,_0x40d6fb=!0x1,_0x1deeff='forward'===_0x96750?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x1e40a5}of _0x5eecf5)if(_0x1e40a5['is']('$textProxy')){const _0x5b338a=_0x1deeff['exec'](_0x1e40a5['data']);if(_0x5b338a&&_0x5b338a['length']){if(_0x3621c4+='forward'===_0x96750?_0x5b338a['index']+_0x5b338a[0x0]['length']:_0x1e40a5['data']['length']-_0x5b338a['index'],_0x5b338a[0x0]['length']!==_0x1e40a5['data']['length'])break;_0x40d6fb=!0x0,_0x1deeff='forward'===_0x96750?/^\w+/:/\w+$/;}else{if(_0x40d6fb)break;_0x3621c4+=_0x1e40a5['offsetSize'];}}else{if(_0x1e40a5['is']('element')){_0x488aee['isInline'](_0x1e40a5)&&!_0x40d6fb&&(_0x3621c4+=0x1);break;}}_0x214b3a+=_0x3621c4,_0x5eecf5['jumpTo'](_0x29a4ee['getShiftedBy']('forward'===_0x96750?_0x214b3a:-_0x214b3a));}return _0x214b3a;}['_getChangeContext'](_0x594b3d,_0x5050a6,_0x11a67a){const _0x20d878=_0x11a67a['model']['schema'],_0x28b6ea=this['_findAdjacentContextDistance'](_0x594b3d,'backward',_0x20d878,0x6),_0xea00d5=this['_findAdjacentContextDistance'](_0x5050a6,'forward',_0x20d878,0x6),_0x496799=_0x594b3d['getShiftedBy'](-_0x28b6ea),_0x1c89cc=_0x5050a6['getShiftedBy'](_0xea00d5);return{'start':_0x496799,'end':_0x1c89cc,'hasContentBefore':!_0x496799['isAtStart'],'hasContentAfter':!_0x1c89cc['isAtEnd']};}['_insertMarkers'](_0x4e3c21,_0x701052){const _0x1a2762=this['context']['plugins']['get']('AIEditing'),_0xf70590=new Set();_0x701052['model']['change'](_0x34baf6=>{for(const _0x573177 of _0x4e3c21){const _0x1635de=''+tr+_0x573177['type']+':'+_0x573177['groupId']+'_'+_0x1a2762['_nextDataId'](_0xf70590);this['_markers']['set'](_0x1635de,{'id':_0x1635de,'groupId':_0x573177['groupId'],'type':_0x573177['type'],'content':_0x573177['content'],'editor':_0x701052}),_0x34baf6['addMarker'](_0x1635de,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x34baf6['createRange'](_0x573177['start'],_0x573177['end'])});}});}['_createGetContextFn'](_0x4165b3,_0x3bca2b,_0x55a06f){let _0x1be41f='';return()=>{if(!_0x1be41f){const _0x3518d9=_0x3bca2b['toView'](_0x4165b3,{'showSuggestionHighlights':!0x0});let _0x2d510f=_0x3518d9['getChild'](0x0);if(_0x2d510f['is']('containerElement')||(_0x2d510f=_0x3518d9),!_0x2d510f)return'';let _0x488490=!0x1;const _0x3712f6=[];for(const _0x40d0a6 of _0x2d510f['getChildren']())_0x40d0a6['is']('element','span')&&_0x40d0a6['hasClass']('ck-ai_review-marker_context-end')&&(_0x488490=!0x1),_0x488490&&_0x3712f6['push'](_0x40d0a6),_0x40d0a6['is']('element','span')&&_0x40d0a6['hasClass']('ck-ai_review-marker_context-start')&&(_0x488490=!0x0);_0x2d510f['_removeChildren'](0x0,_0x2d510f['childCount']),_0x55a06f?.['ellipsisBefore']&&_0x2d510f['_appendChild']('…'),_0x2d510f['_appendChild'](_0x3712f6),_0x55a06f?.['ellipsisAfter']&&_0x2d510f['_appendChild']('…');const _0x25c867=_0x3bca2b['htmlProcessor']['domConverter']['viewToDom'](_0x3518d9),_0x46103a=_0x3bca2b['htmlProcessor']['htmlWriter']['getHtml'](_0x25c867);_0x1be41f=this['_removeUnsupportedElements'](_0x46103a);}return _0x1be41f;};}['_createGetContentFn'](_0x4a502b,_0x58ae2a){let _0x2032c7='';return()=>(_0x2032c7||(_0x2032c7=this['_removeUnsupportedElements'](_0x58ae2a['stringify'](_0x4a502b,{'showSuggestionHighlights':!0x0}))),_0x2032c7);}['_createGetContentUsingDataIdFn'](_0x2c8b5d,_0x3400b0,_0x6dd361){let _0x5a1dd2='';return()=>{if(!_0x5a1dd2){const _0x3588d6=_0x6dd361['toView'](new _0x4d6f3c(_0x2c8b5d)),_0x2979b0=_0x6dd361['htmlProcessor']['domConverter']['viewToDom'](_0x3588d6)['querySelector']('[data-id=\x22'+_0x3400b0+'\x22]');_0x5a1dd2=_0x2979b0?.['outerHTML']||'';}return _0x5a1dd2;};}['_removeUnsupportedElements'](_0x8f34e0){if(!_0x8f34e0)return'';const _0x2aee24=Wi(_0x8f34e0,{'decodeEntities':!0x1}),_0x31346c=qi(_0x2aee24);if(!_0x31346c['length'])return _0x8f34e0;for(const _0x31992e of _0x31346c)_0x5ca789(_0x31992e);return Ki(_0x2aee24,{'encodeEntities':!0x1});}['_neutralizeChangesOnUnsupportedElements'](_0x5989b0,_0x3fd946){const _0xe56914=Wi(_0x5989b0,{'decodeEntities':!0x1}),_0x4ca949=Wi(_0x3fd946,{'decodeEntities':!0x1}),_0x49b1bf=qi(_0xe56914),_0x3b0276=qi(_0x4ca949);if(!_0x49b1bf['length']&&!_0x3b0276['length'])return{'contentInitial':_0x5989b0,'contentNew':_0x3fd946};const _0x33adb=new Map();for(const _0x53d2a3 of _0x49b1bf)_0x33adb['set'](Xi(_0x53d2a3,'data-id'),_0x53d2a3);for(const _0x46b819 of _0x3b0276){const _0x10d378=Xi(_0x46b819,'data-id'),_0x3f4041=_0x10d378?_0x33adb['get'](_0x10d378):void 0x0;_0x3f4041?_0x4a3720(_0x46b819,_0x4269c1(_0x3f4041,!0x0)):_0x5ca789(_0x46b819);}return{'contentInitial':Ki(_0xe56914,{'encodeEntities':!0x1}),'contentNew':Ki(_0x4ca949,{'encodeEntities':!0x1})};}['_findMarkerElement'](_0x57fc0d,_0x1c7900=0x5){let _0x1e6707=_0x57fc0d,_0x34d331=null;for(let _0x432a9b=0x0;_0x432a9b<_0x1c7900&&_0x1e6707;_0x432a9b++){if(!_0x1e6707['className']){_0x1e6707=_0x1e6707['parentElement'];continue;}if(!(''+_0x1e6707['className'])['includes']('ck-ai_review-marker_')){_0x1e6707=_0x1e6707['parentElement'];continue;}if(!_0x1e6707['getAttribute']('data-marker-id'))break;_0x34d331=_0x1e6707;break;}return _0x34d331;}['_findMarkerElementById'](_0x1990e7){const _0x1ad1d0=this['_markers']['get'](_0x1990e7);if(!_0x1ad1d0)return null;const _0x4fc226=_0x1ad1d0['editor']['model']['markers']['get'](_0x1990e7);return _0x4fc226?_0x71a789(_0x1ad1d0['editor']['editing'],_0x4fc226):null;}['_getMarkersDataForGroup'](_0x242b99){return Array['from'](this['_markers']['values']())['filter'](_0x522b03=>_0x522b03['groupId']===_0x242b99);}['_getOperationStart'](_0x2ba2b9){return'insert'===_0x2ba2b9['type']?_0x2ba2b9['position']:_0x2ba2b9['newRange']['start'];}['_getOperationEnd'](_0x2dc412,_0x48e2e1=!0x1){return'insert'===_0x2dc412['type']?_0x48e2e1?_0x2dc412['position']:_0x2dc412['position']['getShiftedBy'](_0x2dc412['howMany']):_0x2dc412['newRange']['end'];}['_shiftOperation'](_0xfadc40,_0x33eb6d){return'insert'===_0xfadc40['type']?_0xfadc40['position']=_0xfadc40['position']['getShiftedBy'](_0x33eb6d):'marker'===_0xfadc40['type']&&_0xfadc40['newRange']&&(_0xfadc40['newRange']=new _0x303302(_0xfadc40['newRange']['start']['getShiftedBy'](_0x33eb6d),_0xfadc40['newRange']['end']['getShiftedBy'](_0x33eb6d))),_0xfadc40;}['_changeOperationOwnerDocument'](_0x2450f1,_0x2b36a2){'insert'===_0x2450f1['type']?_0x2450f1['position']=this['_changePositionOwnerDocument'](_0x2450f1['position'],_0x2b36a2):'marker'===_0x2450f1['type']&&_0x2450f1['newRange']&&(_0x2450f1['newRange']=this['_changeRangeOwnerDocument'](_0x2450f1['newRange'],_0x2b36a2));}['_changePositionOwnerDocument'](_0x16f448,_0xdd10){return new _0x4ff74e(_0xdd10,_0x16f448['path']);}['_changeRangeOwnerDocument'](_0x1850eb,_0x18b969){return new _0x303302(this['_changePositionOwnerDocument'](_0x1850eb['start'],_0x18b969),this['_changePositionOwnerDocument'](_0x1850eb['end'],_0x18b969));}['_changePosition'](_0x19f0ef,_0x59747f){return new _0x4ff74e(_0x59747f,[..._0x19f0ef]);}['_changeRange'](_0xc6f159,_0x3471ca,_0x4134d7,_0x410314){return new _0x303302(this['_changePosition'](_0x3471ca,_0x410314),this['_changePosition'](_0x4134d7,_0x410314));}['_sortMarkers'](_0xe7c3f0){const _0x2d8109=_0x421b32=>{switch(_0x421b32){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0xe7c3f0['sort']((_0x540786,_0x32d5a6)=>_0x2d8109(_0x540786['type'])-_0x2d8109(_0x32d5a6['type']));}['_hasSameTopLevelElement'](_0x2034f2,_0x57f327){const _0x19508e=_0x2034f2['getChild'](0x0),_0x5b1445=_0x57f327['getChild'](0x0);return!(!_0x19508e||!_0x5b1445)&&((!_0x19508e['is']('element')||!_0x5b1445['is']('element')||_0x19508e['name']===_0x5b1445['name'])&&!(_0x19508e['is']('element')&&!_0x5b1445['is']('element')||!_0x19508e['is']('element')&&_0x5b1445['is']('element')));}['_haveSingleTopLevelElement'](_0x297e58){return 0x1===_0x297e58['childCount'];}['_haveOnlyInlineContent'](_0x9417a1,_0x558eee){for(const _0x2f990b of _0x9417a1['getChildren']())if(_0x2f990b['is']('element')&&!_0x558eee['isInline'](_0x2f990b))return!0x1;return!0x0;}['_upsertDataId'](_0x6f2e1c,_0x2244f6){let _0x244ebc=_0x6f2e1c['getAttribute'](_0x2f50ff);return _0x244ebc||(_0x244ebc=_0x2244f6(),_0x6f2e1c['_setAttribute'](_0x2f50ff,_0x244ebc)),_0x244ebc;}}class AIReviewCheckResult extends Et(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x31f8e7,contentNew:_0xce00b8,contentInitial:_0x6569e8,documentVersion:_0x15b1cf}){super(),this['id']=_0x31f8e7,this['contentNew']=_0xce00b8,this['contentInitial']=_0x6569e8,this['documentVersion']=_0x15b1cf;}}class AIReviewCheckResultChange extends ct(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x235eb8,_0x3c280a,_0x38494e){super(),this['id']=_0x235eb8,this['parent']=_0x38494e,this['_data']=_0x3c280a,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class AIReviewCheckRun extends ct(){['id']=at();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x554bcf,_0x258563,_0x2d119e,_0x423552,_0x53c664){super(),this['_sourceCheck']=_0x258563,this['_documentData']=_0x554bcf,this['_aiConnector']=_0x2d119e,this['_reviewParams']=_0x423552,this['_reviewArgs']=_0x53c664,this['on']('change:status',(_0x323744,_0x422205,_0x3377a2)=>{'aborted'==_0x3377a2&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x3377a2,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0x55fe69=>'pending'===_0x55fe69['status']);}get['currentError'](){return this['_currentError'];}get['results'](){return Array['from'](this['_results']['values']());}['updateDocumentData'](_0xeca9f5){this['_documentData']=_0xeca9f5;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x2d2352=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x4a48b8 of _0x2d2352)'unmodified'!==_0x4a48b8['data']['operation']&&('error'!==_0x4a48b8['data']['operation']?'review-metadata'!==_0x4a48b8['event']?this['_addReviewCheckResult'](_0x4a48b8['data']['dataId'],_0x4a48b8['data']['textDelta']):this['callId']=_0x4a48b8['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x3d4872){this['_currentError']=_0x3d4872,_0x3d4872 instanceof Error&&_0x3d4872['message']['includes']('ai-request-aborted')?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async['restart'](){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,await this['start']();}['addResultChanges'](_0x3f8bd4,_0x455cc2){const _0x2e9183=this['_results']['get'](_0x3f8bd4);if(!_0x2e9183)return;if(0x0===_0x455cc2['length'])return;const _0x5d4ed5=[];_0x455cc2['forEach']((_0x4ce9f4,_0x599eca)=>{const _0xf03b4=new AIReviewCheckResultChange(_0x2e9183['id']+'-'+_0x599eca,_0x4ce9f4,_0x2e9183);_0xf03b4['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0xf03b4,'status':_0xf03b4['status']});}),_0xf03b4['on']('change:isActivated',()=>{_0xf03b4['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0xf03b4}):this['fire']('reviewCheckResultDeactivated',{'change':_0xf03b4});}),this['_changes']['push'](_0xf03b4),_0x5d4ed5['push'](_0xf03b4);}),this['fire']('reviewCheckResultReady',{'changes':_0x5d4ed5,'result':_0x2e9183,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x55b05d){const _0x45771a=this['_changes']['find'](_0x4f434d=>_0x4f434d['id']===_0x55b05d);return!(!_0x45771a||'pending'!==_0x45771a['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x25b38c=>!0x0===_0x25b38c['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x2ff185=>'pending'===_0x2ff185['status']);}['getChangeById'](_0xae192d){return this['_changes']['find'](_0x23ec52=>_0x23ec52['id']===_0xae192d);}['markAllChangesAsAccepted'](){for(const _0x22bf5e of this['_changes'])'pending'===_0x22bf5e['status']&&(_0x22bf5e['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x39f2e8){const _0x4f9ea1=this['_changes']['find'](_0x2901dc=>_0x2901dc['id']===_0x39f2e8);_0x4f9ea1&&'pending'===_0x4f9ea1['status']&&(_0x4f9ea1['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x3efc9b){const _0xdd563f=this['_changes']['find'](_0x3e4398=>_0x3e4398['id']===_0x3efc9b);_0xdd563f&&'pending'===_0xdd563f['status']&&(_0xdd563f['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x509a22){const _0x5c7009=this['_changes']['find'](_0x185d34=>_0x185d34['id']===_0x509a22);_0x5c7009&&'pending'===_0x5c7009['status']&&(_0x5c7009['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x315434){const _0x726e95=this['_changes']['find'](_0x178e03=>_0x178e03['id']===_0x315434);_0x726e95&&'outdated'===_0x726e95['status']&&(_0x726e95['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x168999){this['_changes']['filter'](_0x1de227=>_0x1de227['isActivated']&&_0x1de227['id']!==_0x168999)['forEach'](_0x41ee45=>{_0x41ee45['isActivated']=!0x1;});const _0x556b57=this['_changes']['find'](_0x15b942=>_0x15b942['id']===_0x168999);_0x556b57&&'pending'===_0x556b57['status']&&(_0x556b57['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x656486=>_0x656486['isActivated'])['forEach'](_0x3bd2fc=>{_0x3bd2fc['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x1bb07e){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x52cf74;if(_0x1bb07e){const _0x324512=this['_changes']['find'](_0x537a0e=>_0x537a0e['id']===_0x1bb07e);if(_0x324512&&_0x324512['isRated'])return;_0x324512&&(_0x52cf74=_0x324512['parent']['id'],_0x324512['isRated']=!0x0);}const _0x150ac6={'positiveCount':this['_changes']['filter'](_0x49798a=>'accepted'===_0x49798a['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x150ac6,this['callId'],_0x52cf74);}['_addReviewCheckResult'](_0x599aee,_0x1c6d88){const _0x5d14c3=this['_documentData']['elements']['get'](_0x599aee);if(!_0x5d14c3)return;const _0x4b8ae3=_0x5d14c3['getContent']();if(_0x4b8ae3===_0x1c6d88)return;const _0x3e849=new AIReviewCheckResult({'id':_0x599aee,'contentInitial':_0x4b8ae3,'contentNew':_0x1c6d88,'documentVersion':_0x5d14c3['documentVersion']});this['_results']['set'](_0x3e849['id'],_0x3e849),this['fire']('reviewCheckResultAdded',{'result':_0x3e849,'source':this,'editor':_0x5d14c3['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x537bb3=>'pending'===_0x537bb3['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x4613b2=>'pending'===_0x4613b2['status'])['length']&&(this['status']='finished'));}}class AIReviewSystemCheckRun extends AIReviewCheckRun{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x29b479=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x5b2b9c=0x0;_0x5b2b9c<this['_reviewParams']['length'];_0x5b2b9c++){if(!this['_reviewParams'][_0x5b2b9c]||!this['_sourceCheck']['options'][_0x5b2b9c])continue;const _0x11b61f=this['_sourceCheck']['options'][_0x5b2b9c],_0x4dd425=_0x11b61f['data']?.['find'](_0x12fcd0=>_0x12fcd0['id']===this['_reviewParams'][_0x5b2b9c]);_0x4dd425&&_0x29b479['push'](_0x4dd425['label']);}return _0x29b479['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x2fbfde,_0x32dc08,_0x1f6e04){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x32dc08,_0x2fbfde,_0x1f6e04);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class AIReviewCoreController extends _0x2bf4b8{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_availableReviewChecks'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_initRequiredPlugins'](),this['_initAvailableReviewChecks'](),this['_initUIListeners']();}async['_initAvailableReviewChecks'](){this['_availableReviewChecks']=await this['_getReviewChecks'](),this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}['_initUIListeners'](){this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_availableReviewChecks']&&this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',(_0x4159f1,_0x507858)=>this['runCheck'](_0x507858)),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>this['abort']()),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x55ab96=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x55ab96['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x55ab96['map'](_0x4f6f7f=>_0x4f6f7f['id']));const _0x44e97f=this['_currentReviewCheckRun'];_0x44e97f['markAllChangesAsAccepted'](),_0x44e97f['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x250a7c,_0x2990ae)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x2990ae['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x2990ae['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x2990ae['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x2990ae['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x1c8115,_0x5276dd)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5276dd['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x5276dd['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5276dd['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5276dd['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x80e179,_0x20be5d)=>{this['_onActivateChange'](_0x20be5d);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x5deb5e,_0x4f4fd3)=>{this['_onDeactivateChange'](_0x4f4fd3);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x31d2b9,_0x249bf5)=>{this['_onChangeMarkerClicked'](_0x31d2b9,_0x249bf5);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x42c90c,_0x36c0bd)=>{this['_onChangeMarkerHovered'](_0x42c90c,_0x36c0bd);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x2a8b8c,_0x54da7e)=>{this['_onChangeMarkerRemoved'](_0x2a8b8c,_0x54da7e);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x3de636,_0x523aea)=>{this['_onChangeMarkerRestored'](_0x3de636,_0x523aea);});}async['runCheck'](_0xcc2623){if(!this['_availableReviewChecks'])return;const _0xee587=this['_availableReviewChecks']['find'](_0x32b2ab=>_0x32b2ab['id']===_0xcc2623['id']);if(_0xee587){this['_onReviewCheckRun'](_0xcc2623),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0xcc2623,_0xee587),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x47083a,_0x46a316)=>{switch(_0x46a316['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x46a316);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new ht('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ht('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x46a316['status']&&'error-chunk'!==_0x46a316['status']&&'error-general'!==_0x46a316['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x5c6433,_0x56c4a0)=>{if(!this['_currentReviewCheckRun'])throw new ht('ai-review-mode-no-current-check-run',this);const _0x33c791=this['_diffContent'](_0x56c4a0['editor'],_0x56c4a0['result']['contentInitial'],_0x56c4a0['result']['contentNew']);_0x56c4a0['source']['addResultChanges'](_0x56c4a0['result']['id'],_0x33c791);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x75d9f9,_0x318dc3)=>{for(const _0x229d6e of _0x318dc3['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x229d6e);this['_markChangePositionInEditorContent'](_0x318dc3['changes'],_0x318dc3['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x43aeba,_0x3e5ffc)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x3e5ffc['change']['id'],_0x3e5ffc['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x1dd703,_0x377faa)=>{this['_onReviewCheckResultActivated'](_0x377faa);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x3a797d){_0x3a797d instanceof Error&&_0x3a797d['message']['includes']('ai-request-aborted')||(_0x3a797d instanceof ht?this['_logError'](_0x3a797d):this['_logError'](new ht('ai-review-mode-check-run-failed',this,void 0x0,_0x3a797d)));}}else this['_logError'](new ht('ai-review-mode-source-check-not-found',this,{'checkId':_0xcc2623['id']}));}['abort'](){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}['getAvailableChecks'](){return this['_availableReviewChecks']??[];}['getCurrentCheckRun'](){return this['_currentReviewCheckRun'];}['_createReviewCheckRun'](_0x497a28,_0x111668){return new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x111668,this['_aiConnector'],_0x497a28['params'],_0x497a28['args']);}['_onChangeMarkerRemoved'](_0x29c904,_0x5983c4){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x5983c4['changeId']);}['_onChangeMarkerRestored'](_0xbd892a,_0x522b04){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x522b04['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x2b0447=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x2b0447&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x5b7d0e of this['_aiReviewCoreEditing']['getEditors']())_0x5b7d0e['editing']['view']['change'](_0x3fe7ec=>{for(const _0x455540 of _0x5b7d0e['editing']['view']['document']['getRoots']())_0x3fe7ec['removeClass']('ck-ai_review-diff',_0x455540),_0x3fe7ec['removeClass']('ck-ai_review-highlights',_0x455540),_0x3fe7ec['removeClass']('ck-ai-translate-mode-content',_0x455540);});}['_logError'](_0x3bbd95,_0x40034b=!0x1){Ct(_0x3bbd95['message']),_0x40034b||(_0x3bbd95['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x1658b0){if('content'===this['_changeActivationSource']){const _0x1d0c00=this['_aiReviewCoreUi']['getChangeElement'](_0x1658b0);_0x1d0c00&&Rt(_0x1d0c00['closest']('.ck-ai_review__check-run-result')||_0x1d0c00);}else{if('panel'===this['_changeActivationSource']){const _0x366568=this['_getChangeContentElement'](_0x1658b0);if(!_0x366568)return;Tt({'target':_0x366568,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}class AIReviewCustomCheckRun extends AIReviewCheckRun{['_prompt'];['_model'];constructor(_0x36a26a,_0x1b86f7,_0x1acf02,_0x4911f8,_0x26f943){super(_0x1acf02,_0x4911f8,_0x26f943),this['_prompt']=_0x36a26a,this['_model']=_0x1b86f7;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x5153ba,_0x1a3211,_0x3f37eb){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x1a3211,_0x5153ba,_0x3f37eb);}}class AIReviewCheck{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x524e94){this['id']=_0x524e94['id'],this['commandId']=_0x524e94['commandId'],this['title']=_0x524e94['title'],this['description']=_0x524e94['description'],this['isParameterized']=_0x524e94['isParameterized'],this['useArgs']=_0x524e94['useArgs'],this['options']=_0x524e94['options'],this['args']=_0x524e94['args'];}}class AIReviewCheckExtra extends AIReviewCheck{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x1865a4,_0x11f3b2,_0x331671){super(_0x1865a4),this['prompt']=_0x1865a4['prompt'],this['model']=_0x1865a4['model'],this['model']?this['_defaultModel']=_0x11f3b2['find'](_0x5b148a=>_0x5b148a['id']===this['model'])||null:this['_defaultModel']=_0x331671;}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewExtraCheckRun extends AIReviewCustomCheckRun{get['subTitle'](){return'';}set['prompt'](_0x5c768a){this['_prompt']=_0x5c768a;}set['model'](_0x25a43c){this['_model']=_0x25a43c;}}class AIReviewCoreCheckRegistry extends _0x2bf4b8{static get['requires'](){return[AIConnector];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_cache'];['getChecksList'](){return this['_cache']||(this['_cache']=this['_loadChecksList']()),this['_cache'];}}const sr=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class AIReviewCheckList extends ct(){['_checks']=[];['setupChecks'](_0x3c3fec){this['_checks']=_0x3c3fec['map'](_0x52312a=>new AIReviewCheck(_0x52312a));}get['checks'](){return this['_checks'];}['getCheckById'](_0x5e74b4){return this['checks']['find'](_0x4cd905=>_0x4cd905['id']===_0x5e74b4);}['removeCheckById'](_0xb2462a){this['_checks']=this['_checks']['filter'](_0xb1697=>_0xb1697['id']!==_0xb2462a);}}class AIReviewCheckCustom extends AIReviewCheck{['_models']=[];['_defaultModel']=null;constructor(_0x56873d,_0x25608c,_0x1612f9){super(_0x56873d),this['_models']=_0x25608c,this['_defaultModel']=_0x1612f9;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewModeCheckList extends AIReviewCheckList{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x447b3b,_0x280c12,_0x326072){super(),this['_allModels']=_0x447b3b,this['_recommendedModels']=_0x280c12,this['_defaultModel']=_0x326072;}get['allModels'](){return this['_allModels'];}['setupChecks'](_0x251ae3){this['_checks']=_0x251ae3['map'](_0x59aba8=>!0x0===_0x59aba8['isExtra']?new AIReviewCheckExtra(_0x59aba8,this['_allModels'],this['_defaultModel']):'custom'===_0x59aba8['id']?new AIReviewCheckCustom(_0x59aba8,this['_recommendedModels'],this['_defaultModel']):new AIReviewCheck(_0x59aba8));}}class AIReviewModeCheckRegistry extends AIReviewCoreCheckRegistry{static get['pluginName'](){return'AIReviewModeCheckRegistry';}['_modelsLoadError']=null;constructor(_0x7f8136){super(_0x7f8136),this['context']['config']['define']('ai.review.extraCommands',[]);}get['modelsLoadError'](){return this['_modelsLoadError'];}['getExtraChecks'](){return this['context']['config']['get']('ai.review.extraCommands')['map'](_0x2e849c=>({'id':_0x2e849c['id'],'commandId':_0x2e849c['id'],'title':_0x2e849c['label'],'description':_0x2e849c['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x2e849c['prompt'],'model':_0x2e849c['model']}));}async['_loadChecksList'](){const _0x1bd1cc=[...sr,...this['getExtraChecks']()]['map'](_0x4892b4=>_0x4892b4['isExtra']?_0x4892b4:this['_translateReviewCheck'](_0x4892b4)),_0x417d60=await this['_getModels'](),_0x2e8462=new AIReviewModeCheckList(_0x417d60['all'],_0x417d60['recommended'],_0x417d60['default']);return _0x2e8462['setupChecks'](_0x1bd1cc),_0x2e8462;}async['_getModels'](){const _0x23ee3a=this['context']['plugins']['get']('AIConnector');try{const _0x186671=new AIModels({'connector':_0x23ee3a,'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']}),_0xc02dd6={'all':await _0x186671['getAll'](),'recommended':await _0x186671['getAvailableModels'](),'default':await _0x186671['getDefault']()};return this['_modelsLoadError']=null,_0xc02dd6;}catch(_0x4a9861){return this['_modelsLoadError']=new ht('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x4a9861),Ct(this['_modelsLoadError']['message']),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x5319b8){const _0x579c29='AI_REVIEW_CHECK_'+_0x5319b8['id']['toUpperCase']()['replaceAll']('-','_'),_0x1fb749={..._0x5319b8,'title':this['_translate'](_0x579c29+'_TITLE',_0x5319b8['title']),'description':this['_translate'](_0x579c29+'_DESCRIPTION',_0x5319b8['description'])};return _0x5319b8['options']&&(_0x1fb749['options']=_0x5319b8['options']['map'](_0x1982d7=>({..._0x1982d7,'label':this['_translate'](_0x579c29+'_OPTIONS_LABEL',_0x1982d7['label']||''),'data':_0x1982d7['data']?_0x1982d7['data']['map'](_0xd6f12=>({..._0xd6f12,'label':this['_translate'](_0x579c29+'_OPTIONS_DATA_'+_0xd6f12['id']['toUpperCase'](),_0xd6f12['label'])})):void 0x0}))),_0x1fb749;}['_translate'](_0x47638a,_0x5084ab){const _0x5312d8=Mi(this['context']['locale'],_0x47638a);return _0x5312d8===_0x47638a?_0x5084ab:_0x5312d8;}}class AIReviewModeController extends AIReviewCoreController{static get['pluginName'](){return'AIReviewModeController';}static get['requires'](){return[AIReviewModeCheckRegistry];}['_isDiffOn']=!0x1;['_usesAvailableCommandsConfig'];constructor(_0xc120){super(_0xc120),this['_usesAvailableCommandsConfig']=Boolean(this['context']['config']['get']('ai.review.availableCommands')),this['context']['config']['define']('ai.review.availableCommands',sr['map'](_0x5095a7=>_0x5095a7['id']));}['init'](){super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x13fcf1,_0x3b48c2)=>{this['_isDiffOn']=_0x3b48c2['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x21d08c,_0x5bb04a){if(_0x21d08c['isCustom'])return new AIReviewCustomCheckRun(_0x21d08c['args']['prompt'],_0x21d08c['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5bb04a,this['_aiConnector']);if(_0x5bb04a['isExtra']){const _0x19dd05=_0x5bb04a;return new AIReviewExtraCheckRun(_0x21d08c['args']?.['prompt']??_0x19dd05['prompt'],_0x21d08c['args']?.['model']??_0x19dd05['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5bb04a,this['_aiConnector']);}return new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5bb04a,this['_aiConnector'],_0x21d08c['params'],_0x21d08c['args']);}['_onReviewCheckResultActivated'](_0x1288fb){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x1288fb['change']['id']),this['_scrollToChange'](_0x1288fb['change']['id']);const _0x1df7ff=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1288fb['change']['id']);if(!_0x1df7ff)return;const _0x8a0470=this['_aiReviewCoreEditing']['getEditorForChange'](_0x1288fb['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1288fb['change'],()=>_0x1df7ff['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x8a0470,_0x1df7ff['modelRange']['root']['rootName']),_0x8a0470?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x1288fb['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x3e72cd){this['_currentReviewCheckRun']&&'click'===_0x3e72cd['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3e72cd['id']));}['_onDeactivateChange'](_0x47086c){this['_currentReviewCheckRun']&&'balloon'===_0x47086c['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x52dd24,_0x525788){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x525788['changeId']);const _0x578132=this['_currentReviewCheckRun']['getChangeById'](_0x525788['changeId']);if(!_0x578132)return;const _0x2bb2a6=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x525788['changeId']),_0x221568=this['_aiReviewCoreEditing']['getEditorForChange'](_0x525788['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x578132,_0x525788['markerElement'],_0x525788['domEvent'],'click',this['_getBalloonDomRoot'](_0x221568,_0x2bb2a6?.['modelRange']['root']['rootName']),_0x221568?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x4103cd,_0x47b523){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x5c5519=this['_currentReviewCheckRun']['getChangeById'](_0x47b523['changeId']);if(!_0x5c5519)return;const _0x2f4432=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x47b523['changeId']),_0x3b405=this['_aiReviewCoreEditing']['getEditorForChange'](_0x47b523['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5c5519,_0x47b523['markerElement'],_0x47b523['domEvent'],'hover',this['_getBalloonDomRoot'](_0x3b405,_0x2f4432?.['modelRange']['root']['rootName']),_0x3b405?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x15f64f){const _0x46399d=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x15f64f);return _0x46399d?_0x46399d['getElement']():null;}['_markChangePositionInEditorContent'](_0x30f974,_0x1c9062){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x30f974,_0x1c9062);}['_diffContent'](_0x393e22,_0xbe4029,_0x1b91c8){return this['_aiReviewCoreEditing']['diffContent'](_0x393e22,_0xbe4029,_0x1b91c8,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x3657e3){_0x3657e3?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x4405c2 of this['_aiReviewCoreEditing']['getEditors']())_0x4405c2['editing']['view']['change'](_0x5e569f=>{for(const _0x13d0b3 of _0x4405c2['editing']['view']['document']['getRoots']()){for(const _0x332253 of _0x13d0b3['getClassNames']())_0x332253['startsWith']('ck-ai_review-')&&_0x5e569f['removeClass'](_0x332253,_0x13d0b3);_0x5e569f['addClass'](_0x3657e3?'ck-ai_review-diff':'ck-ai_review-highlights',_0x13d0b3);}});}['_getBalloonDomRoot'](_0xd2c1cc,_0x5cb19d){const _0x3cc6c0=_0xd2c1cc['editing']['view'];if(_0x5cb19d){const _0x5533d7=_0x3cc6c0['getDomRoot'](_0x5cb19d);if(_0x5533d7)return _0x5533d7;}return _0x3cc6c0['getDomRoot']()??void 0x0;}async['_getReviewChecks'](){const _0x39edf3=this['context']['plugins']['get']('AIReviewModeCheckRegistry'),_0x325ac6=await _0x39edf3['getChecksList']();_0x39edf3['modelsLoadError']&&this['_logError'](_0x39edf3['modelsLoadError']);let _0x566410=_0x325ac6['checks'];const _0x59d264=this['context']['config']['get']('ai.review.availableCommands');return this['_logWarningForNonExistentChecks'](_0x59d264,_0x566410),this['_usesAvailableCommandsConfig']&&(_0x566410=_0x59d264['map'](_0x4779cd=>_0x566410['find'](_0x32718c=>_0x32718c['id']===_0x4779cd))['filter'](_0x6bb398=>!!_0x6bb398)),this['_filterChecksWithMissingModel'](_0x566410);}['_logWarningForNonExistentChecks'](_0x3bf8ff,_0x7b555b){const _0x4f7f68=_0x3bf8ff['filter'](_0x19b7fa=>!_0x7b555b['some'](_0x2d187f=>_0x2d187f['id']===_0x19b7fa));if(_0x4f7f68['length']){const _0x447d63=new ht('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x4f7f68['join'](',\x20')});wt(_0x447d63['message']);}}['_filterChecksWithMissingModel'](_0x4c0e4b){const _0x10b2cd=[];return _0x4c0e4b['forEach'](_0x4d55e5=>{(_0x4d55e5 instanceof AIReviewCheckExtra&&!_0x4d55e5['defaultModel']||_0x4d55e5 instanceof AIReviewCheckCustom&&!_0x4d55e5['models']['length'])&&_0x10b2cd['push'](_0x4d55e5['id']);}),_0x10b2cd['length']&&_0x10b2cd['forEach'](_0x7ab772=>{_0x4c0e4b=_0x4c0e4b['filter'](_0x356308=>_0x356308['id']!==_0x7ab772);const _0x267109=new ht('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x7ab772});Ct(_0x267109['message']);}),_0x4c0e4b;}}class AIRunResult{['_editor'];['_rootName'];['_channelId'];['_sessionId'];['_documentVersion'];['_contentRawOld'];['_contentRawNew'];['_error'];['_isAborted']=!0x1;constructor(_0x2187d2){this['_editor']=_0x2187d2['editor'],this['_rootName']=_0x2187d2['rootName'],this['_channelId']=_0x2187d2['channelId'],this['_sessionId']=_0x2187d2['sessionId'];}get['status'](){return this['_error']?'error':this['_isAborted']?'aborted':void 0x0!==this['_contentRawNew']?'completed':'initialized';}get['editor'](){return this['_editor'];}get['rootName'](){return this['_rootName'];}get['channelId'](){return this['_channelId'];}get['sessionId'](){return this['_sessionId'];}get['documentVersion'](){return this['_documentVersion'];}set['documentVersion'](_0x3c6326){this['_documentVersion']=_0x3c6326;}get['contentRawOld'](){return this['_contentRawOld'];}set['contentRawOld'](_0x2e3507){this['_contentRawOld']=_0x2e3507;}get['contentRawNew'](){return this['_contentRawNew'];}set['contentRawNew'](_0xcff225){this['_contentRawNew']=_0xcff225;}get['contentOld'](){return this['_dropDataIds'](this['_contentRawOld']||'');}get['contentNew'](){return this['_dropDataIds'](this['_contentRawNew']||'');}get['error'](){return this['_error'];}set['error'](_0x417db5){this['_error']=_0x417db5;}['abort'](){this['_isAborted']=!0x0;}['_dropDataIds'](_0x36db5c){return _0x36db5c['replace'](/ data-id="[a-z0-9]+"/g,'');}}class AIReviewRunResult extends AIRunResult{['_affectedBlocks']=[];get['affectedBlocks'](){return this['_affectedBlocks'];}set['affectedBlocks'](_0x9f7f49){this['_affectedBlocks']=_0x9f7f49;}}class AIGateway extends _0x2bf4b8{static get['pluginName'](){return'AIGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['apply'](_0x55d755,_0x24da50){if('completed'!==_0x55d755['status'])throw new ht('ai-gateway-apply-invalid-status',this,{'status':_0x55d755['status']});const _0x2dc45f=_0x55d755['editor'];if('suggest'===_0x24da50&&!_0x2dc45f['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',this);const _0xefeca6='suggest'===_0x24da50,_0xbfdd41=this['context']['plugins']['get'](_0x2ab8a5),_0xe74a55=_0x2dc45f['model']['createPositionAt'](_0x2dc45f['model']['document']['getRoot'](),0x0),_0x32613c=_0xbfdd41['getDiff'](_0x55d755['contentRawOld'],_0x55d755['contentRawNew'],{'anchor':_0xe74a55,'markDeletions':_0xefeca6,'targetEditor':_0x2dc45f}),_0x2e29b9=_0x2dc45f['model']['document']['history']['getOperations'](_0x55d755['documentVersion']),_0x163b4d={'document':_0x2dc45f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x13eda3=_0x329636(_0x32613c['getOperations'](),_0x2e29b9,_0x163b4d)['operationsA'];_0x2dc45f['model']['change'](_0x423839=>{if(_0xefeca6)_0x2dc45f['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x13eda3);else{for(const _0x123f50 of _0x13eda3)_0x123f50['baseVersion']=_0x2dc45f['model']['document']['version'],Ts(_0x2dc45f,_0x123f50),_0x423839['batch']['addOperation'](_0x123f50),_0x2dc45f['model']['applyOperation'](_0x123f50);}});}['mergeChangesIntoContent'](_0x5e76a5,_0x537428,_0x2b65b5){const _0x403e0e=new AIResponseParser(),_0x531605=new AIResponseApplier();let _0x540084=_0x403e0e['parseAndNormalizeHTML'](_0x537428);for(const _0x2f117c of _0x5e76a5)try{const _0x2d3cb6=_0x403e0e['parseAndNormalizeHTML'](_0x2f117c['content']);_0x540084=_0x531605['merge'](_0x2d3cb6,_0x540084,{'cutAfterUnstable':!0x1,'replaceRemovedWith':void 0x0})['parsedContent'];}catch(_0x4cc8b6){throw new ht('ai-gateway-merge-failed',this,{..._0x2f117c},_0x4cc8b6);}return as(_0x2b65b5,_0x403e0e['parseAndNormalizeHTML'](_0x537428),_0x540084,!0x1,!0x1)['content'];}}class AIReviewGateway extends _0x2bf4b8{static get['pluginName'](){return'AIReviewGateway';}static get['requires'](){return[AIReviewCoreEditing,AIReviewModeCheckRegistry,AIConnector,AIEditing,AIGateway];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['getAllCommands'](){const _0x8828ba=this['context']['plugins']['get']('AIReviewModeCheckRegistry');return(await _0x8828ba['getChecksList']())['checks']['map'](_0x3a770a=>{const _0x1397cd={'id':_0x3a770a['id'],'title':_0x3a770a['title'],'description':_0x3a770a['description']};return'custom'!==_0x3a770a['id']&&_0x3a770a['options']?.['length']&&(_0x1397cd['parameters']=_0x3a770a['options'][0x0]['data']['map'](_0x22cd45=>({..._0x22cd45}))),_0x1397cd;});}async['getAvailableModels'](){const _0x3c63d7=this['context']['plugins']['get']('AIConnector');return new AIModels({'connector':_0x3c63d7,'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']})['getAll']();}async['runReview'](_0x3d7129,_0x3e9bc7){return await this['_runReviewCheck'](_0x3d7129,()=>this['_createReviewCheckRun'](_0x3d7129,_0x3e9bc7?.['parameterId']),_0x3e9bc7?.['signal']);}async['runCustomReview'](_0x279072,_0x21cf4c){return await this['_runReviewCheck']('custom',()=>this['_createCustomReviewCheckRun']('custom',_0x279072,_0x21cf4c?.['model']),_0x21cf4c?.['signal']);}['applyReview'](_0x30f7d7,_0x561f91){this['context']['plugins']['get']('AIGateway')['apply'](_0x30f7d7,_0x561f91);}async['_runReviewCheck'](_0x206e17,_0x4bbfbf,_0xa21a8f){const _0x2a91ca=ps(this['context']),_0x3d2ae2=new AIReviewRunResult({'editor':_0x2a91ca,'rootName':_0x2a91ca['model']['document']['getRootNames']()[0x0],'channelId':this['context']['config']['get']('collaboration.channelId'),'sessionId':_0x2a91ca['plugins']['get']('AIEditing')['getSessionId'](_0x2a91ca)});let _0x2daf4e,_0x23b39b;if(_0xa21a8f){if(_0xa21a8f['aborted'])return _0x3d2ae2['abort'](),_0x3d2ae2;const _0x5dd508=()=>{_0x3d2ae2['error']||(_0x3d2ae2['abort'](),_0x2daf4e&&_0x2daf4e['abort']());};_0xa21a8f['addEventListener']('abort',_0x5dd508),_0x23b39b=()=>_0xa21a8f['removeEventListener']('abort',_0x5dd508);}try{_0x2daf4e=await _0x4bbfbf(),_0x3d2ae2['contentRawOld']=_0x2daf4e['documentData']['content'],_0x3d2ae2['documentVersion']=Array['from'](_0x2daf4e['documentData']['elements'])['find'](([,_0x2ec374])=>_0x2ec374['rootName']===_0x3d2ae2['rootName'])?.[0x1]['documentVersion']??0x1,_0x2daf4e['on']('reviewCheckRunUpdated',(_0x29fc41,_0x26dff0)=>{'aborted'===_0x26dff0['status']?_0x3d2ae2['abort']():'error-general'!==_0x26dff0['status']&&'error-chunk'!==_0x26dff0['status']||(_0x3d2ae2['error']=this['_normalizeError'](_0x26dff0['error'],'ai-reviewgateway-review-command-run-failed',{'checkId':_0x206e17}));}),'aborted'!==_0x3d2ae2['status']&&await _0x2daf4e['start']();}catch(_0x4433ef){_0x3d2ae2['error']=this['_normalizeError'](_0x4433ef,'ai-reviewgateway-review-command-run-failed',{'checkId':_0x206e17});}finally{_0x23b39b&&_0x23b39b();}if(!_0x2daf4e||'aborted'===_0x3d2ae2['status']||'error'===_0x3d2ae2['status'])return _0x3d2ae2;_0x3d2ae2['affectedBlocks']=_0x2daf4e['results']['map'](_0xbbf698=>({'id':_0xbbf698['id'],'content':_0xbbf698['contentNew']}));try{_0x3d2ae2['contentRawNew']=Ki(this['context']['plugins']['get']('AIGateway')['mergeChangesIntoContent'](_0x3d2ae2['affectedBlocks'],_0x3d2ae2['contentRawOld'],_0x3d2ae2['editor']));}catch(_0x4e55e4){_0x3d2ae2['error']=this['_normalizeError'](_0x4e55e4,'ai-reviewgateway-review-command-run-failed',{'checkId':_0x206e17});}return _0x3d2ae2;}async['_createReviewCheckRun'](_0x10f54d,_0x2daf4c){const _0x193b5d=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x3eac76=>_0x3eac76['id']===_0x10f54d);if(!_0x193b5d)throw new ht('ai-reviewgateway-unknown-command',this,{'checkId':_0x10f54d});if(_0x193b5d instanceof AIReviewCheckCustom)throw new ht('ai-reviewgateway-not-a-system-command',this,{'checkId':_0x10f54d});const _0x1d6b04=this['context']['plugins']['get']('AIReviewCoreEditing')['getDocumentData'](),_0x70ee3f=this['context']['plugins']['get']('AIConnector');if(_0x193b5d instanceof AIReviewCheckExtra){if(!_0x193b5d['defaultModel']?.['id'])throw new ht('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x10f54d});return new AIReviewExtraCheckRun(_0x193b5d['prompt'],_0x193b5d['defaultModel']['id'],_0x1d6b04,_0x193b5d,_0x70ee3f);}return new AIReviewSystemCheckRun(_0x1d6b04,_0x193b5d,_0x70ee3f,_0x2daf4c?[_0x2daf4c]:void 0x0);}async['_createCustomReviewCheckRun'](_0x266342,_0x48a06a,_0x1d70b9){const _0x510077=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x4b9ac8=>_0x4b9ac8['id']===_0x266342);if(!_0x510077)throw new ht('ai-reviewgateway-unknown-command',this,{'checkId':_0x266342});if(!(_0x510077 instanceof AIReviewCheckCustom))throw new ht('ai-reviewgateway-not-a-custom-command',this,{'checkId':_0x266342});const _0x2d100a=_0x1d70b9??_0x510077['defaultModel']?.['id'];if(!_0x48a06a)throw new ht('ai-reviewgateway-missing-custom-command-prompt',this,{'checkId':_0x266342});if(!_0x2d100a)throw new ht('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x266342});return new AIReviewCustomCheckRun(_0x48a06a,_0x2d100a,this['context']['plugins']['get']('AIReviewCoreEditing')['getDocumentData'](),_0x510077,this['context']['plugins']['get']('AIConnector'));}['_normalizeError'](_0x1c6f06,_0x596164,_0x2f25bb){let _0x4991ca=_0x1c6f06;return _0x1c6f06 instanceof ht||(_0x4991ca=new ht(_0x596164,this,_0x2f25bb,_0x1c6f06)),_0x4991ca;}}class AIReviewMode extends _0x2bf4b8{static get['requires'](){return[AIReviewModeController,AIReviewModeUI,AIReviewCoreEditing,AIReviewGateway];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['startReview'](_0x418df9,_0x1fb667){if(this['assertStartReviewPreconditions'](_0x418df9)instanceof AIReviewCheckCustom)throw new ht('ai-reviewmode-not-a-system-command',this,{'commandId':_0x418df9});const _0x32b52b=this['context']['plugins']['get']('AIReviewModeController');await _0x32b52b['runCheck']({'id':_0x418df9,'params':_0x1fb667?.['parameterId']?[_0x1fb667['parameterId']]:void 0x0});}async['startCustomReview'](_0x26adcd,_0x1a9bc5){if(!_0x26adcd)throw new ht('ai-reviewmode-missing-custom-command-prompt',this);const _0x404eaf=sr['find'](_0x48e05a=>'custom'===_0x48e05a['commandId'])['id'],_0x5dbb4a=this['assertStartReviewPreconditions'](_0x404eaf),_0x4003e3=_0x1a9bc5?.['model']??_0x5dbb4a['defaultModel']?.['id'];if(!_0x4003e3)throw new ht('ai-reviewmode-missing-custom-command-model',this);const _0x5ebfd1=this['context']['plugins']['get']('AIReviewModeController');await _0x5ebfd1['runCheck']({'id':_0x404eaf,'isCustom':!0x0,'args':{'prompt':_0x26adcd,'model':_0x4003e3}});}['getAvailableCommands'](){return this['context']['plugins']['get']('AIReviewModeController')['getAvailableChecks']()['map'](_0x36062c=>{const _0x2ff179={'id':_0x36062c['id'],'title':_0x36062c['title'],'description':_0x36062c['description']};return'custom'!==_0x36062c['id']&&_0x36062c['options']?.['length']&&(_0x2ff179['parameters']=_0x36062c['options'][0x0]['data']['map'](_0x9d0386=>({..._0x9d0386}))),_0x2ff179;});}['assertStartReviewPreconditions'](_0x34c9d6){const _0x1b25b2=this['context']['plugins']['get']('AIReviewModeController');if(_0x1b25b2['getCurrentCheckRun']())throw new ht('ai-reviewmode-review-already-running',this);const _0xd86fb3=_0x1b25b2['getAvailableChecks']()['find'](_0x280932=>_0x280932['id']===_0x34c9d6);if(!_0xd86fb3)throw new ht('ai-reviewmode-unknown-command',this,{'commandId':_0x34c9d6});const _0x15e3a8=this['context']['plugins']['get']('AITabs')['view'];return _0x15e3a8['isVisible']=!0x0,_0x15e3a8['activateTab']('reviewMode'),_0xd86fb3;}}class AITranslateCheckRun extends AIReviewSystemCheckRun{['_title'];constructor(_0x588411,_0x56984d,_0xa3da68,_0x889c5f,_0x5ec2cc,_0x1965ed){super(_0x588411,_0x56984d,_0xa3da68,_0x5ec2cc,_0x1965ed),this['_title']=_0x889c5f;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class AITranslateCheck extends AIReviewCheck{get['apiId'](){return'translate';}}class AITranslateCheckList extends AIReviewCheckList{['setupChecks'](_0x3ebf63){this['_checks']=_0x3ebf63['map'](_0x284cba=>new AITranslateCheck(_0x284cba));}}const nr=[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}];class AITranslateCheckRegistry extends AIReviewCoreCheckRegistry{static get['pluginName'](){return'AITranslateCheckRegistry';}constructor(_0x1e2e1a){super(_0x1e2e1a),this['context']['config']['define']('ai.translate.languages',nr);}async['_loadChecksList'](){const _0x5196ac=[],_0x5c8d95=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x4c8da0 of _0x5c8d95)_0x5196ac['push']({'title':_0x4c8da0['label'],'id':_0x4c8da0['id'],'commandId':_0x4c8da0['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x4c8da0['id']}});const _0x1b1bd6=new AITranslateCheckList();return _0x1b1bd6['setupChecks'](this['_translateChecks'](_0x5196ac)),_0x1b1bd6;}['_translateChecks'](_0x15ac01){const _0x3dad0f=this['context']['locale'];return _0x15ac01['map'](_0x35b5e1=>{const _0x121869='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x35b5e1['title']['toUpperCase']()['replaceAll']('-','_'),_0x1b9c52=Mi(_0x3dad0f,_0x121869);return{..._0x35b5e1,'title':_0x1b9c52===_0x121869?_0x35b5e1['title']:_0x1b9c52};});}}class AITranslateController extends AIReviewCoreController{static get['pluginName'](){return'AITranslateController';}static get['requires'](){return[AITranslateCheckRegistry];}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x380d37,_0x5ab7db){return new AITranslateCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5ab7db,this['_aiConnector'],Mi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x380d37['params'],_0x380d37['args']);}['_onReviewCheckResultActivated'](_0x14942e){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x14942e['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x14942e['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x390d17){this['_currentReviewCheckRun']&&('hover'===_0x390d17['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x390d17['id'])),'click'===_0x390d17['uiInteraction']&&this['_scrollToChange'](_0x390d17['id']));}['_onDeactivateChange'](_0x56d65a){this['_currentReviewCheckRun']&&'panel'===_0x56d65a['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x4b86be,_0x4b0d71){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4b0d71['changeId']),this['_scrollToChange'](_0x4b0d71['changeId']));}['_onChangeMarkerHovered'](_0xf5ef09,_0x40e0e8){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x40e0e8['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x40e0e8['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x5d576a){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x5d576a);}['_markChangePositionInEditorContent'](_0x13d3b3,_0x45ef3e){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x13d3b3,_0x45ef3e);}['_diffContent'](_0x4eff27,_0x231a6b,_0x3fed5d){return this['_aiReviewCoreEditing']['diffContent'](_0x4eff27,_0x231a6b,_0x3fed5d,!0x0);}['_onReviewCheckRun'](){for(const _0xad0cac of this['_aiReviewCoreEditing']['getEditors']())_0xad0cac['editing']['view']['change'](_0x9bc249=>{for(const _0x14a702 of _0xad0cac['editing']['view']['document']['getRoots']())_0x9bc249['addClass']('ck-ai-translate-mode-content',_0x14a702);});}async['_getReviewChecks'](){return(await this['context']['plugins']['get']('AITranslateCheckRegistry')['getChecksList']())['checks'];}}class AITranslateCheckResultsView extends AIReviewCoreUICheckResultsView{constructor(_0x375971,_0x6e8a){super(_0x375971,_0x6e8a),this['on']('set:isLoading',(_0x1c3aae,_0x1a8ffc,_0x509d33)=>{_0x509d33&&(this['headerTitle']=Mi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x353537,_0x2f802b,_0x16c4be)=>{_0x16c4be&&(this['headerTitle']=Mi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x3fbf90=super['_createAcceptAllButtonView']();return _0x3fbf90['set']('label',Mi(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x3fbf90;}['_createExitReviewButtonView'](){const _0x32b1f1=super['_createExitReviewButtonView']();return _0x32b1f1['set']('label',Mi(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x32b1f1;}}class AITranslateCheckListView extends AIReviewCoreReviewCheckListView{['_setupTemplate'](){const _0x3cf2ef=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x3cf2ef['if']('isVisible','ck-hidden',_0x2e6248=>!_0x2e6248)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':Mi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':Mi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x3cf2ef['if']('isVisible','ck-hidden',_0x4b58a2=>!_0x4b58a2)]},'children':this['_checkViews']}]});}}class AITranslateUI extends AIReviewCoreUI{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x1732d5=this['context']['plugins']['get']('AITabs'),_0x59b38d=this['context']['locale'],_0x5dae83=new AIHeaderView(_0x59b38d,{'label':Mi(_0x59b38d,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x13c6bf,'class':'ck-ai-header_review-translate','showResizeButton':_0x1732d5['showResizeButton']});_0x5dae83['delegate']('resizeTabs')['to'](_0x1732d5),_0x5dae83['bind']('isMaximized')['to'](_0x1732d5['view'],'isMaximized',_0x4942d6=>_0x4942d6);const _0x548425=new AIReviewCoreView(_0x59b38d,{'header':_0x5dae83,'list':new AITranslateCheckListView(_0x59b38d),'results':new AITranslateCheckResultsView(_0x59b38d,{'generalErrorText':Mi(_0x59b38d,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x59b38d,{'headerText':Mi(_0x59b38d,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':Mi(_0x59b38d,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':Mi(_0x59b38d,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x548425['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x548425;}['registerTab'](){const _0x1d7bad=this['context']['plugins']['get']('AITabs');_0x1d7bad['view']['on']('activateTab',(_0x5dee8b,{newTab:_0x106196,oldTab:_0x384e38})=>{'translate'===_0x106196?this['fire']('getReviewCheckList'):'translate'===_0x384e38&&this['fire']('leaveReview');}),_0x1d7bad['view']['addTab']({'id':'translate','buttonLabel':Mi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x13c6bf,'order':0x0,'content':this['_mainView']});}}class AITranslate extends _0x2bf4b8{static get['requires'](){return[AITranslateController,AITranslateUI,AIReviewCoreEditing];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{AIActions,AIAdapter,AIAssistant,AIAssistantUI,AIBalloon,AIChat,AIChatController,AIChatFeedCustomElementView,AIChatHistory,AIChatHistoryController,AIChatHistoryUI,AIChatInteraction,AIChatShortcuts,AIChatUI,AIConnector,AIEditing,AIEditorIntegration,AIGateway,AIInteraction,AIQuickActions,AIQuickActionsUI,AIReply,AIRequestError,AIReviewCheck,AIReviewCheckResult,AIReviewCheckResultChange,AIReviewCheckRun,AIReviewGateway,AIReviewMode,AIReviewCoreController as AIReviewModeController,AIReviewCoreEditing as AIReviewModeEditing,AIReviewModeUI,AIReviewRunResult,AIRunResult,AITabs,AITabsMainView,AITabsView,AITextAdapter,AIToggleButtonUI,AITranslate,AITranslateController,AITranslateUI,AWSTextAdapter,OpenAITextAdapter,ShowAIAssistantCommand,ToggleAICommand,Fi as createResizeButton,Di as getDefaultAICommands};
|