@ckeditor/ckeditor5-ai 47.2.0-alpha.3 → 47.2.0-alpha.4
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/build/ai.js +1 -1
- package/dist/index.js +5 -5
- package/package.json +15 -15
- package/src/aiactions/aiactions.js +1 -1
- package/src/aiactions/model/aiactionsinteraction.js +1 -1
- package/src/aiactions/model/aiactionsreply.js +1 -1
- package/src/aiassistant/adapters/aiadapter.js +1 -1
- package/src/aiassistant/adapters/aitextadapter.js +1 -1
- package/src/aiassistant/adapters/awstextadapter.js +1 -1
- package/src/aiassistant/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant/aiassistant.js +1 -1
- package/src/aiassistant/aiassistantediting.js +1 -1
- package/src/aiassistant/aiassistantui.js +1 -1
- package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
- package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
- package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
- package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
- package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
- package/src/aiassistant/ui/form/aiformview.js +1 -1
- package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
- package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
- package/src/aiassistant/ui/form/prompthistory.js +1 -1
- package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
- package/src/aiballoon/aiballoon.js +1 -1
- package/src/aiballoon/ui/aiballoondisclaimerview.js +1 -1
- package/src/aiballoon/ui/aiballoontoolbarview.js +1 -1
- package/src/aiballoon/ui/aiballoonview.js +1 -1
- package/src/aichat/aichat.js +1 -1
- package/src/aichat/aichatcontroller.js +1 -1
- package/src/aichat/aichatui.js +1 -1
- package/src/aichat/model/aichatcontext.js +1 -1
- package/src/aichat/model/aichatconversation.js +1 -1
- package/src/aichat/model/aichatinteraction.js +1 -1
- package/src/aichat/model/aichatmodels.js +1 -1
- package/src/aichat/ui/aichatcontrolsview.js +1 -1
- package/src/aichat/ui/aichatfeedview.js +1 -1
- package/src/aichat/ui/aichatheaderview.js +1 -1
- package/src/aichat/ui/aichatview.js +1 -1
- package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
- package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
- package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
- package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
- package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
- package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
- package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
- package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
- package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
- package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
- package/src/aichat/utils/eventnames.js +1 -1
- package/src/aichat/utils/promisequeue.js +1 -1
- package/src/aichat/utils/scrollmanager.js +1 -1
- package/src/aichathistory/aichathistory.js +1 -1
- package/src/aichathistory/aichathistorycontroller.js +1 -1
- package/src/aichathistory/aichathistoryui.js +1 -1
- package/src/aichathistory/model/aichathistoryconversations.js +1 -1
- package/src/aichathistory/model/aichathistoryitem.js +1 -1
- package/src/aichathistory/ui/aichathistorylistitemview.js +2 -2
- package/src/aichathistory/ui/aichathistorylistview.js +1 -1
- package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
- package/src/aichathistory/ui/aichathistoryview.js +1 -1
- package/src/aicore/aiconnector.js +1 -1
- package/src/aicore/aiediting.js +1 -1
- package/src/aicore/model/aicapabilities.js +1 -1
- package/src/aicore/model/aiinteraction.js +1 -1
- package/src/aicore/model/aimodels.js +1 -1
- package/src/aicore/model/aireply.js +1 -1
- package/src/aicore/pipeline/airesponseapplier.js +2 -2
- package/src/aicore/pipeline/airesponseparser.js +2 -2
- package/src/aicore/ui/aidisclaimerview.js +1 -1
- package/src/aicore/ui/aiskeleton.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
- package/src/aicore/utils/createresizebutton.js +1 -1
- package/src/aicore/utils/documentrange.js +1 -1
- package/src/aicore/utils/geteditorfromcontext.js +1 -1
- package/src/aicore/utils/getoperationsfromreply.js +1 -1
- package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
- package/src/aicore/utils/htmlparser.js +1 -1
- package/src/aicore/utils/htmlstreamer.js +1 -1
- package/src/aieditorintegration/aieditorintegration.js +1 -1
- package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
- package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
- package/src/aiquickactions/aiquickactions.js +1 -1
- package/src/aiquickactions/aiquickactionscommand.js +1 -1
- package/src/aiquickactions/aiquickactionsediting.js +1 -1
- package/src/aiquickactions/aiquickactionsui.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
- package/src/aireviewmode/aireviewmode.js +1 -1
- package/src/aireviewmode/aireviewmodecontroller.js +1 -1
- package/src/aireviewmode/aireviewmodeediting.js +1 -1
- package/src/aireviewmode/aireviewmodeui.js +1 -1
- package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
- package/src/aireviewmode/model/aireviewchecklist.js +1 -1
- package/src/aireviewmode/model/aireviewcheckresult.js +1 -1
- package/src/aireviewmode/model/aireviewcheckresultchange.js +1 -1
- package/src/aireviewmode/model/aireviewcheckrun.js +1 -1
- package/src/aireviewmode/ui/aireviemodepromptinputview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodeballoonsuggestionview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodecustomcheckview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodefinishreviewbuttonview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewchecklistview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcompletedview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodeview.js +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformdropdown.js +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformmanager.js +1 -1
- package/src/aitabs/aitabs.js +1 -1
- package/src/aitabs/tabs/aitabsview.js +1 -1
- package/src/aitabs/tabs/tabbuttonview.js +1 -1
- package/src/aitabs/tabs/tabpanelview.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x5f3288,Command as Nt,ContextPlugin as _0x171820,Editor as st}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x308403,IconCheck as _0x547952,IconError as _0x129806,IconSubmit as _0x2a3f1e,IconAIHistory as Ht,IconMagicWand as _0x1dd138,IconRobotPencil as _0x4c398b,IconMaximize as _0x2e7c4e,IconMinimize as to,IconDocumentWithLoupe as _0x13603c,IconAddComment as _0x4c5817,IconShowChangesOn as _0xe9dd5d,IconShowChangesOff as _0x41d5a1,IconDocument as _0x391967,IconThreeStars as _0xa2a32e,IconRemove as _0xdc18ef,IconDocumentWithCheckmark as _0x368b6c,IconDocumentWithCross as _0x43e783,IconLoupe as _0x5a0eff,IconCancel as _0x510307,IconStop as _0x4c89d2,IconAIChat as _t,IconPlus as _0x5c1cc1,IconPin as _0x324381,IconThreeHorizontalDots as _0x56f15d,IconChevronRight as _0x3ced14,IconInfo as _0x136575,IconOutdated as _0x50e8a9,IconEye as _0x58391f,IconEyeCrossedOut as _0x3b8dda,IconAIReview as _0x3451c9}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x223274,CKEditorError as _0x29f184,ObservableMixin as _0x4572ab,global as _0x110318,isVisible as _0x4b2614,Rect as _0x31eb3f,Collection as _0x5d69ef,FocusTracker as ts,KeystrokeHandler as _0x1f1bc5,first as _0x592c76,toArray as _0x7703f2,EmitterMixin as _0x135bec,logWarning as _0xadd6c3,scrollViewportToShowTarget as _0x2992c3,logError as ot,ResizeObserver as _0x474d80,_isMotionReduced as It,scrollAncestorsToShowTarget as _0x38bec5,DomEmitterMixin as _0x556252}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x541968,ButtonView as _0x14ee0a,View as _0x19a8c6,SpinnerView as _0x577daf,IconView as _0x50b9df,AutocompleteView as _0x4dc60c,ListView as _0x556745,ListItemGroupView as _0x4372b2,ListItemView as _0x2269a3,ButtonLabelView as _0x53816d,FocusCycler as $t,createLabeledTextarea as _0x5c1a66,Dialog as _0x10183e,createDropdown as _0x10d828,addMenuToDropdown as _0x12a70a,MenuBarMenuView as _0x38710d,MenuBarMenuListItemButtonView as _0x5b3955,DialogViewPosition as _0x2ccaf1,MenuBarMenuListView as ti,MenuBarMenuListItemView as _0x44e2e2,UIModel as _0x3cd526,SplitButtonView as _0x37ad52,BalloonPanelView as _0x500981,BodyCollection as qt,clickOutsideHandler as _0x29a34e,ListItemButtonView as _0x8cd418,ViewCollection as _0xf07a6b,addListToDropdown as _0x21ea2c,submitHandler as _0x1e2b1f,LabeledFieldView as _0x5cba56,createLabeledInputText as th,FormHeaderView as _0x5720b1,HighlightedTextView as _0x39d67c,FileDialogButtonView as _0xbecc3f,InputTextView as _0x2efa28,SearchTextView as _0x3bb44f,DropdownMenuButtonView as _0x36e81a,DropdownMenuPanelPositioningFunctions as _0x3e8342,BalloonToolbar as zt,FormRowView as _0x222658,TextareaView as _0xf80c43}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x49596b,ClipboardMarkersUtils as _0x41836c}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x162ba2,ViewDataTransfer as _0x1cb9e3,ViewUpcastWriter as _0x27088e,Matcher as _0x5cfc1b,_DetachOperation as _0x1609ec,_insertIntoModelNodeList as _0x5c757f,_removeFromModelNodeList as _0x41016b,ModelRange as _0x59485f,ViewDowncastWriter as kt,transformOperationSets as _0x33bff0,ModelDocumentFragment as _0x25eb17,ModelPosition as _0x58772b,ModelTreeWalker as _0x1fbb34,InsertOperation as te,MarkerOperation as _0x339507}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4efc88,escape as _0x4e9308,escapeRegExp as _0x418237}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x5791f9,InvokeModelWithResponseStreamCommand as _0x3f5e91,InvokeModelCommand as _0x41e453}from'@aws-sdk/client-bedrock-runtime';import{createParser as wt}from'eventsource-parser';import{parseDocument as _0x2817be}from'htmlparser2';import{isTag as _0x41757a,findOne as gt,getParent as _0xb3e946,findAll as _0x23a287,removeElement as _0x33c6d9,replaceElement as _0x173cd4,prepend as _0x53ea51,prependChild as _0x51c386,appendChild as _0x54c92e,append as _0x2b81f1,find as _0x3bb1ba,isComment as _0x5581e1,getChildren as _0x119327,textContent as _0x54cfdd}from'domutils';import _0xec369b from'dom-serializer';import{Document as mt,Element as _0x2c5bc4,Text as _0x2e2b16,cloneNode as _0x54d7fb,isDocument as _0x25fa62,isText as _0x23320c,NodeWithChildren as _0x4b2d52}from'domhandler';import{MarkdownGfmMdToHtml as _0x3205a1}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0xf3fa2c,getAllMarkersDomElementsSorted as _0x1bb7e4,DocumentCompare as _0x2b3cb3,DATA_ID_MODEL_ATTRIBUTE as ct,ConfirmMixin as _0x36aabc,LateFocusDropdownButtonView as _0xfe9b05,DATA_ID_VIEW_ATTRIBUTE as _0x413d9f}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x5e9a78}from'es-toolkit';import{IconThumbUp as _0x3e3995,IconThumbDown as _0x51e959,IconCopy as _0x4a0fe1,IconCheck as _0x270303,IconShowChangesOff as _0x490482,IconShowChangesOn as _0x11ea32,IconWeb as _0x2870b9,IconNextArrow as _0x346a5d,IconPreviousArrow as _0x25d049,IconAI as Ct,IconClose as _0x5e2897,IconSelection as _0x4d97da,IconFileUpload as _0x5b8c8e,IconLink as _0x339b47,IconDocument as _0x776ddc,IconBulb as _0x49c2da,IconDocumentOutline as _0x625012,IconPaperClip as _0x3725c8,IconBrowseFiles as _0x44b793,IconDropdownArrow as _0xf874d9,IconAIAskAI as _0x9ba23f,IconAIQuickActions as _0x32dec3,IconAIChatCommands as Ut,IconAIImproveWriting as Mt,IconAIContinueWriting as Kt,IconAIGrammarCheck as Rt,IconAIAdjustLength as Qt,IconAIChangeTone as xt,IconAITranslate as Dt,IconAIOther as Lt,IconRefresh as _0x395185}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x556937 from'morphdom';import{SuggestionsConversion as Pt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x1896dd}from'diff';const ei='_ungrouppedCommands';function z(_0xb517a5,_0x443c00){const _0x492418=(0x0,_0x443c00['t'])('Other');return _0xb517a5['length']?'groupId'in _0xb517a5[0x0]?_0xb517a5:[{'groupId':ei,'groupLabel':_0x492418,'order':0x1/0x0,'commands':_0xb517a5}]:[{'groupId':ei,'groupLabel':_0x492418,'order':0x1/0x0,'commands':[]}];}const Fn=globalThis['DataTransfer'],q='ai-ui';class F extends _0x5f3288{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4fe82d}=this,_0x2442b2=['ck-fake-ai-selection'];_0x4fe82d['config']['get']('ai.assistant.useTheme')&&_0x2442b2['push']('ck-ai-assistant-ui_theme'),_0x4fe82d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':q,'view':{'classes':_0x2442b2,'priority':0xc}}),_0x4fe82d['conversion']['for']('editingDowncast')['markerToElement']({'model':q,'view':(_0x232371,{writer:_0x157392})=>{if(!_0x232371['markerRange']['isCollapsed'])return null;const _0x5bbe67=_0x157392['createUIElement']('span');return _0x157392['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5bbe67),_0x5bbe67;}});}['afterInit'](){!async function(_0x4586e3){const _0xa2f423=_0x20441b([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]),_0x3c84b6=0x3dffc4e1,_0x411f7e=0x3df8b339^_0x3c84b6,_0x5e9bf7=window[_0x20441b([0x44,0x61,0x74,0x65])][_0x20441b([0x6e,0x6f,0x77])](),_0x31bff6=_0x4586e3[_0x20441b([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2754fa=new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5dfcf6=>{_0x31bff6[_0x20441b([0x6f,0x6e,0x63,0x65])](_0x20441b([0x72,0x65,0x61,0x64,0x79]),_0x5dfcf6);}),_0x42cc1a={[_0x20441b([0x6b,0x74,0x79])]:_0x20441b([0x45,0x43]),[_0x20441b([0x75,0x73,0x65])]:_0x20441b([0x73,0x69,0x67]),[_0x20441b([0x63,0x72,0x76])]:_0x20441b([0x50,0x2d,0x32,0x35,0x36]),[_0x20441b([0x78])]:_0x20441b([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]),[_0x20441b([0x79])]:_0x20441b([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]),[_0x20441b([0x61,0x6c,0x67])]:_0x20441b([0x45,0x53,0x32,0x35,0x36])},_0x2f3cb7=_0x31bff6[_0x20441b([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x20441b([0x67,0x65,0x74])](_0x20441b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x507a09(){let _0x325178,_0x5364d8=null,_0x1d1316=null;try{if(_0x2f3cb7==_0x20441b([0x47,0x50,0x4c]))return _0x20441b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x325178=_0x3e6e7c(),!_0x325178)return _0x20441b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x325178[_0x20441b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1d1316=_0x449e07(_0x325178[_0x20441b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x325178[_0x20441b([0x6a,0x74,0x69])])),await _0x1e87fe()?_0x38c4d5()?_0x2f5397()?_0x20441b([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2e46e3()?(_0x325178[_0x20441b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x20441b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x5364d8=_0x20aa61(_0x20441b([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x325178[_0x20441b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x20441b([0x74,0x72,0x69,0x61,0x6c])&&(_0x5364d8=_0x20aa61(_0x20441b([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x47fa12()):_0x20441b([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x20441b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x20441b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x20441b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2f5397(){const _0xc39afb=[_0x20441b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x20441b([0x74,0x72,0x69,0x61,0x6c])][_0x20441b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x325178[_0x20441b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5e9bf7/0x3e8:0xe10*_0x411f7e;return _0x325178[_0x20441b([0x65,0x78,0x70])]<_0xc39afb;}function _0x38c4d5(){const _0x5116ee=_0x325178[_0x20441b([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5116ee&&(!!_0x5116ee[_0x20441b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x20441b([0x2a]))||!!_0x5116ee[_0x20441b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x20441b([0x41,0x49])));}function _0x2e46e3(){const _0xa9a8e9=_0x325178[_0x20441b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0xa9a8e9||0x0==_0xa9a8e9[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x468216}=new URL(window[_0x20441b([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0xa9a8e9[_0x20441b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x468216))return!0x0;const _0x1c939f=_0x468216[_0x20441b([0x73,0x70,0x6c,0x69,0x74])](_0x20441b([0x2e]));return _0xa9a8e9[_0x20441b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x27f991=>_0x27f991[_0x20441b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x20441b([0x2a])))[_0x20441b([0x6d,0x61,0x70])](_0x2b129f=>_0x2b129f[_0x20441b([0x73,0x70,0x6c,0x69,0x74])](_0x20441b([0x2e])))[_0x20441b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5cda11=>_0x5cda11[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x1c939f[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x20441b([0x6d,0x61,0x70])](_0x2ff4d0=>Array(_0x1c939f[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2ff4d0[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x20441b([0x66,0x69,0x6c,0x6c])](_0x2ff4d0[0x0]===_0x20441b([0x2a])?_0x20441b([0x2a]):'')[_0x20441b([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2ff4d0))[_0x20441b([0x73,0x6f,0x6d,0x65])](_0x599c03=>_0x1c939f[_0x20441b([0x65,0x76,0x65,0x72,0x79])]((_0x1bd925,_0x44fbbd)=>_0x599c03[_0x44fbbd]===_0x1bd925||_0x599c03[_0x44fbbd]===_0x20441b([0x2a])));}function _0x47fa12(){return _0x5364d8&&_0x1d1316?new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x9371cd,_0x17415d)=>{_0x5364d8[_0x20441b([0x74,0x68,0x65,0x6e])](_0x9371cd,_0x17415d),_0x1d1316[_0x20441b([0x74,0x68,0x65,0x6e])](_0x52dd95=>{_0x52dd95!=_0x20441b([0x56,0x61,0x6c,0x69,0x64])&&_0x9371cd(_0x52dd95);},_0x17415d);}):_0x5364d8||_0x1d1316||_0x20441b([0x56,0x61,0x6c,0x69,0x64]);}}function _0x449e07(_0xf4f5ae,_0x342f2c){return new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x203465=>{if(_0x5e44eb())return _0x203465(_0x20441b([0x56,0x61,0x6c,0x69,0x64]));_0x1afb24(),_0x31bff6[_0x20441b([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x20441b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x2bb168=!0x1;const _0x48d3a0=_0x223274();function _0x73fcf6(_0x52ca30){return!!_0x52ca30&&(typeof _0x52ca30===_0x20441b([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x52ca30===_0x20441b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x52ca30[_0x20441b([0x74,0x68,0x65,0x6e])]===_0x20441b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x52ca30[_0x20441b([0x63,0x61,0x74,0x63,0x68])]===_0x20441b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x34649a(_0xdd1535){_0x435be2(_0xdd1535)[_0x20441b([0x74,0x68,0x65,0x6e])](_0x336bfa=>{if(!_0x336bfa||_0x336bfa[_0x20441b([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x20441b([0x6f,0x6b]))return _0x20441b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x31c13e(_0x3de129(_0x48d3a0+_0x342f2c))!=_0x336bfa[_0x20441b([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x20441b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x20441b([0x56,0x61,0x6c,0x69,0x64]);})[_0x20441b([0x74,0x68,0x65,0x6e])](_0x156bbb=>(_0x5119fa(),_0x156bbb),()=>{const _0x453b3d=_0x224525();return null==_0x453b3d?(_0x5119fa(),_0x20441b([0x56,0x61,0x6c,0x69,0x64])):_0x20441b(_0x5e9bf7-_0x453b3d>(0x19f340e1^_0x3c84b6)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x20441b([0x74,0x68,0x65,0x6e])](_0x203465)[_0x20441b([0x63,0x61,0x74,0x63,0x68])](()=>{_0x203465(_0x20441b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x10601f=0x3dc92a61^_0x3c84b6;function _0x5119fa(){const _0x45fdbf=_0x20441b([0x6c,0x6c,0x63,0x74,0x2d])+_0x31c13e(_0x3de129(_0xf4f5ae)),_0x406f37=_0x5d743d(_0x31c13e(window[_0x20441b([0x4d,0x61,0x74,0x68])][_0x20441b([0x63,0x65,0x69,0x6c])](_0x5e9bf7/_0x10601f)));window[_0x20441b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x20441b([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x45fdbf,_0x406f37);}function _0x224525(){const _0x51d4e3=_0x20441b([0x6c,0x6c,0x63,0x74,0x2d])+_0x31c13e(_0x3de129(_0xf4f5ae)),_0x5b30a1=window[_0x20441b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x20441b([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x51d4e3);return _0x5b30a1?window[_0x20441b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5d743d(_0x5b30a1),0x10)*_0x10601f:null;}function _0x435be2(_0x4f36ca){return new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x15c54d,_0xa771ed)=>{_0x4f36ca[_0x20441b([0x74,0x68,0x65,0x6e])](_0x15c54d,_0xa771ed),window[_0x20441b([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0xa771ed,0x3dfe1021^_0x3c84b6);});}}_0x31bff6[_0x20441b([0x6f,0x6e])](_0x20441b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3679ef,_0x599258)=>{if(_0x599258[0x0]!=_0xf4f5ae)return _0x203465(_0x20441b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x599258[0x1]={..._0x599258[0x1],[_0x20441b([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x48d3a0};},{[_0x20441b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x20441b([0x68,0x69,0x67,0x68])}),_0x31bff6[_0x20441b([0x6f,0x6e])](_0x20441b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xcd8b4c=>{_0x73fcf6(_0xcd8b4c[_0x20441b([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x2bb168=!0x0,_0x34649a(_0xcd8b4c[_0x20441b([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x20441b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x20441b([0x6c,0x6f,0x77])}),_0x2754fa[_0x20441b([0x74,0x68,0x65,0x6e])](()=>{_0x2bb168||_0x203465(_0x20441b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5e44eb(){return _0x31bff6[_0x20441b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x20441b([0x76,0x69,0x65,0x77])][_0x20441b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x20441b([0x61,0x75,0x74,0x6f]);}function _0x1afb24(){_0x31bff6[_0x20441b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x20441b([0x76,0x69,0x65,0x77])][_0x20441b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x20441b([0x61,0x75,0x74,0x6f]);}}function _0x20aa61(_0x99bd5e){const _0xfd1214=[new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x55b102=>setTimeout(_0x55b102,0x3df6fa2d^_0x3c84b6)),_0x2754fa[_0x20441b([0x74,0x68,0x65,0x6e])](()=>new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4dead0=>{let _0x1b77e0=0x0;_0x31bff6[_0x20441b([0x6d,0x6f,0x64,0x65,0x6c])][_0x20441b([0x6f,0x6e])](_0x20441b([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3caf43,_0x2eb771)=>{_0x2eb771[0x0][_0x20441b([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1b77e0++,_0x1b77e0==(0x3dffc519^_0x3c84b6)&&(_0x4dead0(),_0x3caf43[_0x20441b([0x6f,0x66,0x66])]());});}))];return window[_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x20441b([0x72,0x61,0x63,0x65])](_0xfd1214)[_0x20441b([0x74,0x68,0x65,0x6e])](()=>_0x99bd5e);}async function _0x1ab77b(){await _0x2754fa,_0x31bff6[_0x20441b([0x6d,0x6f,0x64,0x65,0x6c])][_0x20441b([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x82a304,_0x31bff6[_0x20441b([0x6d,0x6f,0x64,0x65,0x6c])][_0x20441b([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x82a304,_0x31bff6[_0x20441b([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x20441b([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x522fb7(_0x34e54a){const _0x94309d=_0x3fddd1();_0x31bff6[_0x94309d]=_0x20441b([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x34e54a,_0x34e54a!=_0x20441b([0x56,0x61,0x6c,0x69,0x64])&&_0x1ab77b();}function _0x3fddd1(){const _0x1d0eb3=window[_0x20441b([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x20441b([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x20441b([0x6e,0x6f,0x77])]())[_0x20441b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x20441b([0x2e]),'');let _0xc63675=_0x20441b([0x6e]);for(let _0x36af64=0x0;_0x36af64<_0x1d0eb3[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x36af64+=0x2){let _0x8fe65b=window[_0x20441b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1d0eb3[_0x20441b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x36af64,_0x36af64+0x2));_0x8fe65b>=_0xa2f423[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x8fe65b-=_0xa2f423[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xc63675+=_0xa2f423[_0x8fe65b];}return _0xc63675;}function _0x3e6e7c(){const _0x247ff6=_0x2f3cb7[_0x20441b([0x73,0x70,0x6c,0x69,0x74])](_0x20441b([0x2e]));if(0x3!=_0x247ff6[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x40c74e(_0x247ff6[0x1]);function _0x40c74e(_0x55ba3c){const _0x181737=_0x2054a1(_0x55ba3c);return _0x181737&&_0x541e14()?_0x181737:null;function _0x541e14(){const _0x4a76a5=_0x181737[_0x20441b([0x6a,0x74,0x69])],_0x272abc=window[_0x20441b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4a76a5[_0x20441b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4a76a5[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x44ae6c={..._0x181737,[_0x20441b([0x6a,0x74,0x69])]:_0x4a76a5[_0x20441b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4a76a5[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x44ae6c[_0x20441b([0x76,0x63])],_0x3de129(_0x44ae6c)==_0x272abc;}}}async function _0x1e87fe(){let _0x1c3bd4=!0x0;try{const _0x210ebf=_0x2f3cb7[_0x20441b([0x73,0x70,0x6c,0x69,0x74])](_0x20441b([0x2e])),[_0x441c6e,_0x5f5022,_0x4c42f7]=_0x210ebf;return _0x1a1b22(_0x441c6e),await _0xb3f1f6(_0x441c6e,_0x5f5022,_0x4c42f7),_0x1c3bd4;}catch{return!0x1;}function _0x1a1b22(_0x2068d3){const _0x24d94b=_0x2054a1(_0x2068d3);_0x24d94b&&_0x24d94b[_0x20441b([0x61,0x6c,0x67])]==_0x20441b([0x45,0x53,0x32,0x35,0x36])||(_0x1c3bd4=!0x1);}async function _0xb3f1f6(_0x4665c9,_0x501df4,_0x220b7b){const _0x568a47=window[_0x20441b([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x20441b([0x66,0x72,0x6f,0x6d])](_0xb17f26(_0x220b7b),_0x1b77cf=>_0x1b77cf[_0x20441b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x143bc9=new window[(_0x20441b([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x20441b([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4665c9+_0x20441b([0x2e])+_0x501df4),_0x1cfb60=window[_0x20441b([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x20441b([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1cfb60)return;const _0x2b63fa=await _0x1cfb60[_0x20441b([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x20441b([0x6a,0x77,0x6b]),_0x42cc1a,{[_0x20441b([0x6e,0x61,0x6d,0x65])]:_0x20441b([0x45,0x43,0x44,0x53,0x41]),[_0x20441b([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x20441b([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x20441b([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1cfb60[_0x20441b([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x20441b([0x6e,0x61,0x6d,0x65])]:_0x20441b([0x45,0x43,0x44,0x53,0x41]),[_0x20441b([0x68,0x61,0x73,0x68])]:{[_0x20441b([0x6e,0x61,0x6d,0x65])]:_0x20441b([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2b63fa,_0x568a47,_0x143bc9)||(_0x1c3bd4=!0x1);}}function _0x2054a1(_0x4972c0){return _0x4972c0[_0x20441b([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x20441b([0x65,0x79]))?JSON[_0x20441b([0x70,0x61,0x72,0x73,0x65])](_0xb17f26(_0x4972c0)):null;}function _0xb17f26(_0x855849){return window[_0x20441b([0x61,0x74,0x6f,0x62])](_0x855849[_0x20441b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x20441b([0x2b]))[_0x20441b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x20441b([0x2f])));}function _0x3de129(_0x471ca4){let _0x13f8c8=0x1505;function _0x2a448e(_0x540896){for(let _0x24096d=0x0;_0x24096d<_0x540896[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x24096d++){const _0x18761e=_0x540896[_0x20441b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x24096d);_0x13f8c8=(_0x13f8c8<<0x5)+_0x13f8c8+_0x18761e,_0x13f8c8&=_0x13f8c8;}}function _0x23693d(_0xd53199){Array[_0x20441b([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xd53199)?_0xd53199[_0x20441b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x23693d):_0xd53199&&typeof _0xd53199==_0x20441b([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x20441b([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xd53199)[_0x20441b([0x73,0x6f,0x72,0x74])]()[_0x20441b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x246eb6,_0x54e5da])=>{_0x2a448e(_0x246eb6),_0x23693d(_0x54e5da);}):_0x2a448e(window[_0x20441b([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xd53199));}return _0x23693d(_0x471ca4),_0x13f8c8>>>0x0;}function _0x31c13e(_0x3c74ca){return _0x3c74ca[_0x20441b([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x20441b([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x20441b([0x30]));}function _0x5d743d(_0x3c3889){return _0x3c3889[_0x20441b([0x73,0x70,0x6c,0x69,0x74])]('')[_0x20441b([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x20441b([0x6a,0x6f,0x69,0x6e])]('');}function _0x82a304(){}function _0x20441b(_0x5eb23f){return _0x5eb23f['map'](_0x33d5ed=>String['fromCharCode'](_0x33d5ed))['join']('');}_0x522fb7(await _0x507a09());}(this);}['showFakeVisualSelection'](){const _0x49a1ce=this['editor']['model'];_0x49a1ce['change'](_0xb75c43=>{const _0x50ce05=_0x49a1ce['document']['selection']['getRanges']();let _0x5c338c=0x0;for(const _0x3b286b of _0x50ce05){const _0x55fab6=q+':'+_0x5c338c;if(_0x49a1ce['markers']['has'](_0x55fab6))_0xb75c43['updateMarker'](_0x55fab6,{'range':_0x3b286b});else{if(_0x3b286b['start']['isAtEnd']){const _0x5b26df=_0x3b286b['start']['getLastMatchingPosition'](({item:_0x135f81})=>!_0x49a1ce['schema']['isContent'](_0x135f81),{'boundaries':_0x3b286b});_0xb75c43['addMarker'](_0x55fab6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xb75c43['createRange'](_0x5b26df,_0x3b286b['end'])});}else _0xb75c43['addMarker'](_0x55fab6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3b286b});}_0x5c338c++;}});}['hideFakeVisualSelection'](){const _0x518329=this['editor']['model'],_0x22e973=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](q));_0x22e973['length']&&_0x518329['change'](_0x58104b=>{_0x22e973['forEach'](_0x14ec03=>{_0x58104b['removeMarker'](_0x14ec03);});});}['insertContent'](_0x1d2835,_0x544073){const _0x5add61=this['_getAISelection'](),_0x79469e=_0x544073||_0x5add61['getFirstRange']();this['editor']['model']['canEditAt'](_0x79469e)&&this['editor']['model']['change'](_0x3e4035=>{this['hideFakeVisualSelection'](),_0x544073||this['_resetContentOfSelectedTableCells'](_0x3e4035,_0x5add61),this['_pasteHTMLUsingClipboard']({'insertAt':_0x79469e,'writer':_0x3e4035,'html':_0x1d2835});});}['insertContentBelow'](_0x57bfe1){const {model:_0x5f187e}=this['editor'],_0x4f59a9=this['_getAISelection']();_0x5f187e['change'](()=>{const _0x121fc6=this['_prepareTableInsertBelowPosition'](_0x57bfe1,_0x4f59a9)||this['_getDefaultInsertBelowPosition'](_0x4f59a9);this['insertContent'](_0x57bfe1,_0x121fc6);});}['_getAISelection'](){const _0x13fbe7=this['editor']['model'],_0x20c247=Array['from'](_0x13fbe7['markers']['getMarkersGroup'](q))['map'](_0x47782b=>_0x47782b['getRange']());return _0x13fbe7['createSelection'](_0x20c247);}['_pasteHTMLUsingClipboard']({writer:_0xfab793,html:_0x3ac6da,insertAt:_0x24c906}){const {view:_0x47e889}=this['editor']['editing'],_0x101039=this['editor']['plugins']['get'](_0x49596b),_0x27ea5e=new Fn();_0x27ea5e['setData']('text/html',_0x3ac6da);const _0x3b79e6=new ClipboardEvent('paste',{'clipboardData':_0x27ea5e}),_0x306f87=new _0x162ba2(_0x47e889,_0x3b79e6,{'dataTransfer':new _0x1cb9e3(_0x27ea5e)});_0xfab793['setSelection'](_0x24c906);const _0x29dcce=(_0x3fbe7d,_0x4c551c)=>{_0x4c551c['resultRange']&&_0xfab793['setSelection'](_0x4c551c['resultRange']);};_0x101039['once']('contentInsertion',_0x29dcce,{'priority':'lowest'}),_0x47e889['document']['fire']('paste',_0x306f87),_0x101039['off']('contentInsertion',_0x29dcce);}['_getDefaultInsertBelowPosition'](_0x3fce80){const {model:_0x241104}=this['editor'],_0x376957=Array['from'](_0x3fce80['getSelectedBlocks']());return _0x376957['length']?_0x241104['createPositionAfter'](_0x376957['pop']()):_0x3fce80['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5249c2,_0x1e30c3){const {model:_0x567c4f,plugins:_0x199897}=this['editor'];if(_0x199897['has']('TableUtils')){const _0x120175=_0x199897['get']('TableUtils')['getSelectedTableCells'](_0x1e30c3);if(_0x120175['length']){const _0x484573=this['_getTableRowCountFromContent'](_0x5249c2),_0x1dfbfb=this['_createEmptyTableRows'](_0x120175,_0x484573);return _0x567c4f['createPositionAt'](_0x1dfbfb,0x0);}}return null;}['_getTableRowCountFromContent'](_0x4cfaae){const _0x1679f8=this['editor']['plugins']['get']('TableUtils'),_0x598b4c=this['editor']['data']['parse'](_0x4cfaae),_0x31c4bb=Array['from'](_0x598b4c['getChildren']())['filter'](_0x30f495=>_0x30f495['is']('element','table'));let _0x1a2619=0x0;return _0x31c4bb['forEach'](_0x1c1b7c=>{_0x1a2619+=_0x1679f8['getRows'](_0x1c1b7c);}),_0x1a2619;}['_createEmptyTableRows'](_0x1eca9d,_0x1fa1ef){const _0x5259fe=this['editor']['plugins']['get']('TableUtils'),_0x278200=_0x5259fe['getRowIndexes'](_0x1eca9d),_0x20e0bf=_0x5259fe['getColumnIndexes'](_0x1eca9d),_0xdcd605=_0x278200['last']+0x1,_0x3c90b7=_0x20e0bf['first'],_0x11f027=_0x1eca9d[0x0]['findAncestor']('table');for(let _0xb83bc9=0x0;_0xb83bc9<_0x1fa1ef;_0xb83bc9++)_0x5259fe['insertRows'](_0x11f027,{'at':_0xdcd605});return _0x11f027['getChild'](_0xdcd605)['getChild'](_0x3c90b7);}['_resetContentOfSelectedTableCells'](_0x4b486d,_0x348e1a){const {plugins:_0x2b9f60}=this['editor'],{model:_0x531310}=_0x4b486d;if(!_0x2b9f60['has']('TableUtils'))return;_0x2b9f60['get']('TableUtils')['getSelectedTableCells'](_0x348e1a)['length']&&_0x531310['deleteContent'](_0x348e1a);}}class ni extends _0x5f3288{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x29f184('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x1c2c10){super(_0x1c2c10),this['name']='AIRequestError';}}function Yn(_0x38c7a1,_0x9da892,_0x5d6f55){const t=_0x38c7a1['t'];switch(_0x9da892){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',_0x5d6f55);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5d6f55);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'},_0x5d6f55);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_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x9da892;}}class ai extends Nt{['_commandDefinitions'];constructor(_0x240955,_0x413b9c){super(_0x240955),this['_commandDefinitions']=_0x413b9c,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x107c98,_0x2e349c,_0x3aa273)=>{this['isEnabled']&&(this['enabledCommandsIds']=cs(this['_commandDefinitions'],_0x3aa273));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x14f9e9,_0x3b2e0c,_0x4dc4eb)=>{this['enabledCommandsIds']=_0x4dc4eb?cs(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x114ccb=this['editor']['model'];this['_hasContext']=function(_0x13a4d0){const _0x22edcf=_0x13a4d0['document']['selection'];return _0x22edcf['isCollapsed']?0x0!==[..._0x22edcf['getSelectedBlocks']()]['length']&&![..._0x22edcf['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x13a4d0['hasContent'](_0x22edcf['getFirstRange']());}(_0x114ccb);const _0x50bff1=_0x114ccb['document']['selection'],_0x400dc1=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x12c2c7 of _0x50bff1['getRanges']())for(const _0x1fb736 of _0x12c2c7['getItems']())if(_0x1fb736['is']('element')&&_0x400dc1['includes'](_0x1fb736['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x76de00='',_0x323110='',_0x5a3d33='custom'){this['editor']['plugins']['get'](G)['showUI'](_0x76de00,_0x323110,_0x5a3d33);}}function cs(_0x5a2799,_0x5822f9){const _0x26ec0b=new Set();for(const _0x4953a5 of _0x5a2799['values']())(_0x5822f9||!0x1===_0x4953a5['requiresContent'])&&_0x26ec0b['add'](_0x4953a5['id']);return Array['from'](_0x26ec0b);}const as=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class oi extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x4572ab(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x38a64c,_0x5189d0,_0x369daa){super(),this['editor']=_0x38a64c,this['textAdapter']=_0x5189d0,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x369daa,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x284d51,_0x4114c8,_0xe121b5)=>{this['view']['value']=this['_sanitizeHTML'](_0xe121b5);}),this['listenTo'](this['view'],'submitPrompt',(_0x29378e,_0x23632b)=>{const _0x3bf661=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x23632b,_0x3bf661,'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:_0x19b346,query:_0x5f1dfe,htmlContent:_0x4a4181,label:_0x339171,mainActionLabel:_0x271bfe}){this['view']['prompt']=_0x339171,this['view']['mainAction']=_0x271bfe,this['initialContext']=_0x4a4181,_0x5f1dfe&&(this['view']['isRendered']?this['_handleQuery'](_0x5f1dfe,_0x4a4181,_0x19b346,_0x339171):this['view']['once']('render',()=>{this['_handleQuery'](_0x5f1dfe,_0x4a4181,_0x19b346,_0x339171);}));}['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'](_0x20371a,_0x14ad04,_0x287560,_0x23049e){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x14ad04,this['previousQuery']=_0x20371a,this['previousLabel']=_0x23049e||_0x20371a,this['previousActionId']=_0x287560,new Promise(_0x4106a7=>{this['textAdapter']['makeRequest']({'query':_0x20371a,'context':_0x14ad04,'onData':_0x11e89c=>{this['currentResponse']=_0x11e89c,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x287560})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3c5351=>{_0x3c5351 instanceof tr?this['view']['handleError'](_0x3c5351['message']):this['view']['handleError'](),_0x4106a7();})['finally'](()=>{this['stopProcessing'](),_0x4106a7();});});}['_parseAndNormalizeContent'](_0x1e87ea,_0x1b8f24=!0x1){const _0x25cddc=as['exec'](_0x1e87ea);_0x1e87ea=_0x25cddc?_0x1e87ea['substring'](_0x25cddc[0x1]['length']):_0x1e87ea['length']<0x64&&!_0x1b8f24?'':this['_stripMarkdownSyntax'](_0x1e87ea);const _0xdb7968=this['_domParser']['parseFromString'](_0x1e87ea,'text/html');if(_0x25cddc){const _0x3e7410=Array['from'](_0xdb7968['body']['childNodes']);_0x3e7410['reverse']();for(const _0x422fb0 of _0x3e7410){if(_0x422fb0['nodeType']==Node['ELEMENT_NODE'])break;_0x422fb0['remove']();}}const _0x4c1338=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xdb7968['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4c1338);const _0x28d0dc=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x225d5f=this['editor']['data']['toModel'](_0x4c1338);return _0x28d0dc||_0x225d5f['markers']['clear'](),this['editor']['data']['stringify'](_0x225d5f);}['_normalizeResponseHeadings'](_0x4301e8){const _0x5d8a09=new _0x27088e(this['editor']['editing']['view']['document']),_0x15592d=new _0x5cfc1b({'name':/^h[1-5]$/}),_0x13f831=[];let _0x34a2ea=!0x1;for(const _0x4c41c3 of _0x4301e8)_0x4c41c3['is']('element')&&_0x15592d['match'](_0x4c41c3)&&(_0x13f831['push'](_0x4c41c3),'h1'==_0x4c41c3['name']&&(_0x34a2ea=!0x0));if(_0x34a2ea){for(const _0x538325 of _0x13f831)_0x5d8a09['rename']('h'+(parseInt(_0x538325['name'][0x1])+0x1),_0x538325);}}['_isH1TagSupportEnabled'](){const {data:_0x523a9c,editing:_0x54e744}=this['editor'],_0x304664=_0x523a9c['htmlProcessor']['toView']('<h1></h1>'),_0x5520ef=_0x523a9c['toView'](_0x523a9c['toModel'](_0x304664));return!!_0x54e744['view']['domConverter']['viewToDom'](_0x5520ef)['querySelector']('h1');}['_sanitizeHTML'](_0x5eda09){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5eda09),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5eae0f){const _0x302506=_0x5eae0f['trim']();return _0x302506['startsWith']('```html')?_0x302506['endsWith']('```')?_0x302506['substring'](0x7,_0x302506['length']-0x3):_0x302506['substring'](0x7):_0x5eae0f;}}const ci={'REPLACE':'replace','INSERT':'insert'};class wr extends _0x541968{constructor(_0x7849f2){super(_0x7849f2),this['set']('isVisible',!0x1),this['set']('mainAction',ci['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1163b3=>Yn(_0x7849f2,'AI_'+_0x1163b3['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0x7849f2,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0x7849f2,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0x7849f2,'Stop'));const _0x42b97a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x42b97a['if']('isVisible','ck-hidden',_0x318a77=>!_0x318a77)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x48d112,_0x3b7495){const _0x2be9fe=new _0x14ee0a(this['locale']);return _0x2be9fe['set']({'label':_0x48d112,'class':_0x3b7495||'','isVisible':!0x0,'withText':!0x0}),_0x2be9fe;}}class yr extends _0x19a8c6{['contentFieldView'];['copyButtonView'];constructor(_0x26ed52,_0x4204d5=''){super(_0x26ed52),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x305c75=this['bindTemplate'];this['contentFieldView']=new $n(_0x26ed52,_0x4204d5),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x305c75['if']('isVisible','ck-hidden',_0x55dcc0=>!_0x55dcc0)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x305c75['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 _0x5a022f=!0x1;this['on']('change:value',(_0x56f10c,_0x5dc4b0,_0x5eeecf)=>{const _0x12bdbc=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x5eeecf),this['isProcessing']&&_0x12bdbc&&!_0x5a022f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1d5298,_0x1f117a,_0x2e399a)=>{_0x5a022f=!0x1,_0x2e399a?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5a022f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5a022f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1743f0=this['locale'],_0x4d9588=new _0x14ee0a(this['locale']),_0x44b61f='ck-ai-form__copy-button';return _0x4d9588['set']({'label':Yn(_0x1743f0,'Copy'),'icon':_0x308403,'class':_0x44b61f,'tooltip':!0x0}),_0x4d9588['bind']('isVisible')['to'](this,'value',_0x574173=>!!_0x574173),_0x4d9588['bind']('isEnabled')['to'](this,'isProcessing',_0x5e101b=>!_0x5e101b),_0x4d9588['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4d9588['icon']=_0x547952,_0x4d9588['class']=_0x44b61f+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4d9588['icon']=_0x308403,_0x4d9588['class']=_0x44b61f;},0x3e8);}),_0x4d9588;}['_copyHTMLToClipboard'](_0x17784b){const {window:_0x11ee8,document:_0x175da8}=_0x110318;if(_0x11ee8['ClipboardItem']){const {Blob:_0x39a5ad,ClipboardItem:_0xfe915b}=_0x11ee8,_0x41fae0=[new _0xfe915b({'text/html':new _0x39a5ad([_0x17784b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x39a5ad([_0x17784b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x41fae0);}else{const _0x4f6a0f=_0x175da8['createElement']('div');_0x4f6a0f['style']['position']='absolute',_0x4f6a0f['style']['left']='-9999px',_0x4f6a0f['innerHTML']='<span>[</span>'+_0x17784b['innerHTML']+'<span>]</span>',_0x175da8['body']['appendChild'](_0x4f6a0f);const _0x2c50c0=_0x175da8['createRange']();_0x2c50c0['setStartAfter'](_0x4f6a0f['firstElementChild']),_0x2c50c0['setEndBefore'](_0x4f6a0f['lastElementChild']);const _0x8fb0af=_0x11ee8['getSelection']();_0x8fb0af['removeAllRanges'](),_0x8fb0af['addRange'](_0x2c50c0),_0x175da8['execCommand']('copy'),_0x4f6a0f['remove']();}}}class $n extends _0x19a8c6{constructor(_0x36579c,_0x4b5a76=''){super(_0x36579c),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4b5a76,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x510803){this['element']['innerHTML']=_0x510803;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xe69dd6=new _0x19a8c6(),_0x5f1c03=this['locale'],_0x45dcf9=new _0x577daf();return _0x45dcf9['isVisible']=!0x0,_0xe69dd6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x45dcf9,{'text':Yn(_0x5f1c03,'AI\x20is\x20writing...')}]}),_0xe69dd6['render'](),_0xe69dd6;}}class gr extends _0x19a8c6{constructor(_0x2f4507,_0x569252=''){super(_0x2f4507);const _0x45211a=new _0x50b9df(),_0x3c4ec0=this['bindTemplate'];this['set']('text',_0x569252),_0x45211a['content']=_0x129806,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x45211a,{'text':_0x3c4ec0['to']('text')}]});}}class Er extends _0x4dc60c{['submitButtonView'];['showHistoryButtonView'];constructor(_0x367839,_0x465bb7){super(_0x367839,_0x465bb7),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',(_0x211006,_0x275bc2)=>{_0x211006['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x275bc2());});}['_createSubmitButton'](){const _0x49e99c=new _0x14ee0a(this['locale']),_0x41525c=this['locale'];return _0x49e99c['set']({'icon':_0x2a3f1e,'label':Yn(_0x41525c,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x49e99c['on']('execute',()=>{this['submit']();}),_0x49e99c['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x34d37e,_0x22bbf2)=>!_0x34d37e&&_0x22bbf2),_0x49e99c;}['_createShowHistoryButton'](){const _0x371bbc=new _0x14ee0a(this['locale']),_0x52113d=this['resultsView'],_0x307dd6=this['locale'];_0x371bbc['set']({'label':Yn(_0x307dd6,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x371bbc['bind']('isOn')['to'](_0x52113d,'isVisible'),_0x371bbc['bind']('isEnabled')['to'](this,'isEnabled'),_0x371bbc['on']('execute',()=>{_0x52113d['isVisible']=!_0x52113d['isVisible'],_0x52113d['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5bfc31=()=>{_0x110318['window']['requestAnimationFrame'](()=>{if(_0x4b2614(this['element'])){const _0x487183=new _0x31eb3f(this['queryView']['fieldView']['element']),_0x4d315b=_0x487183['width'],_0x2d954e='rtl'===_0x307dd6['uiLanguageDirection']?'left':'right';_0x487183['excludeScrollbarsAndBorders'](),_0x371bbc['element']['style'][_0x2d954e]=_0x4d315b-_0x487183['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5bfc31),this['on']('render',_0x5bfc31),_0x371bbc;}['submit'](){const _0x372eed=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x372eed);}['focus'](_0x25555c){-0x1===_0x25555c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x556745{['historyGroupView'];['clearHistoryButton'];constructor(_0x212293){super(_0x212293),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x4372b2(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x212293,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xf0f594=0x0;for(const _0x13f1be of this['items'])_0xf0f594+=_0x13f1be['items']['length'];return{'resultsCount':_0xf0f594,'totalItemsCount':_0xf0f594};}['_createClearHistoryButton'](){const _0x4a03a4=this['locale'],_0x255aa9=new _0x14ee0a(this['locale']);return _0x255aa9['set']({'label':'('+Yn(_0x4a03a4,'Clear')+')','withText':!0x0}),_0x255aa9['on']('execute',()=>this['fire']('clearHistory')),_0x255aa9;}}class Ar extends _0x2269a3{constructor(_0x243cb8){super();const _0x1aa558=new _0x53816d(),_0x2544e7=new _0x14ee0a(this['locale'],_0x1aa558);this['children']['add'](_0x2544e7),_0x2544e7['set']({'label':_0x243cb8['prompt'],'withText':!0x0}),_0x2544e7['on']('execute',()=>{this['fire']('execute',{'value':_0x4efc88(_0x243cb8['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Pr extends _0x5d69ef{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x14a37b,_0x5226d4)=>{const _0x327a91=fo(_0x5226d4['prompt']);for(const _0xef4b56 of this)if(_0xef4b56!=_0x5226d4&&fo(_0xef4b56['prompt'])===_0x327a91){this['remove'](_0xef4b56);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0xffd772=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0xffd772));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x205b5a=>_0x205b5a)));}}function fo(_0x291e88){return _0x291e88['toLowerCase']()['trim']();}class ri extends _0x19a8c6{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x55ad1c,_0x144516,_0x197a47=''){super(_0x55ad1c),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ci['REPLACE']),this['_promptHistory']=new Pr(),this['errorView']=new gr(_0x55ad1c),this['contentArea']=new yr(_0x55ad1c,_0x197a47),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 ts(),this['keystrokes']=new _0x1f1bc5(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new $t({'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 _0x178827=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x144516],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x178827['if']('isError','ck-hidden',_0x463c03=>!_0x463c03)]},'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'](_0x30f23b=0x1){-0x1===_0x30f23b?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 _0x4a3a74=this['locale'],_0x5a6c9d=new Er(_0x4a3a74,{'queryView':{'label':Yn(_0x4a3a74,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x5c1a66,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x4a3a74,'Empty\x20history'),'secondary':Yn(_0x4a3a74,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5a6c9d['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x19d376,_0x4da405)=>_0x19d376&&!_0x4da405),this['listenTo'](_0x5a6c9d,'submit',(_0xc08c1c,_0x3fb938)=>{this['prompt']=_0x3fb938;const _0x481b17=_0x4e9308(_0x3fb938);this['fire']('submitPrompt',_0x481b17),_0x3fb938['trim']()&&this['_promptHistory']['add']({'prompt':_0x481b17},0x0);},{'priority':'high'}),_0x5a6c9d;}['_createHistoryView'](){const _0xa78ac0=new vr(this['locale']);return _0xa78ac0['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0xa78ac0['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xa78ac0;}['_createToolbar'](){const _0x1a2a39=new wr(this['locale']);return _0x1a2a39['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x16d587,_0x594f8c,_0xe41e53)=>_0x16d587&&!_0x594f8c&&!!_0xe41e53),_0x1a2a39['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1a2a39['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xab72bb,_0x57bb70,_0xcdde93)=>_0xab72bb&&!_0x57bb70&&!!_0xcdde93),_0x1a2a39['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1a2a39['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4cce42,_0x41ce8c)=>_0x4cce42&&!_0x41ce8c),_0x1a2a39['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1a2a39['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1a2a39['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1a2a39;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4a9f1f=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x4a9f1f,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5154f8){const _0x21072c=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5154f8||Yn(_0x21072c,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const J=globalThis['DataTransfer'];class G extends _0x5f3288{['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[_0x41836c,F,ni,_0x10183e];}constructor(_0x487185){super(_0x487185),_0x487185['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x487185['config']['define']('ai.assistant.contentAreaCssClass',''),_0x487185['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x487185['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xc8de38}=this;this['_aiAdapter']=_0xc8de38['plugins']['get'](ni),this['_dialog']=_0xc8de38['plugins']['get'](_0x10183e),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2f3c11=new ai(_0xc8de38,Array['from'](this['_commandDefinitions']['values']()));_0xc8de38['commands']['add']('showAIAssistant',_0x2f3c11),_0xc8de38['ui']['componentFactory']['add']('aiCommands',_0x279341=>{const _0x5b4e85=_0x10d828(_0x279341);return _0x5b4e85['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5b4e85['buttonView']['set']({'label':Yn(_0x279341,'AI\x20Commands'),'icon':_0x1dd138,'tooltip':!0x0}),_0x5b4e85['on']('execute',_0x4dbdec=>this['_onExecute'](_0x4dbdec['source']['id'])),_0x12a70a(_0x5b4e85,_0xc8de38['ui']['view']['body'],function(_0x52f4f3){const _0x4b9ece=z(_0x52f4f3['config']['get']('ai.assistant.commands'),_0x52f4f3['locale']),_0x9f383b=hi(_0x52f4f3,_0x4b9ece)['filter'](_0x2a3ee0=>_0x2a3ee0['commands']['length']);if(0x1===_0x9f383b['length'])return hi(_0x52f4f3,_0x9f383b[0x0]['commands'])['map'](_0x5cf01e=>({'id':_0x5cf01e['id'],'label':_0x5cf01e['label']}));return _0x9f383b['map'](_0x20fbd4=>{const {groupId:_0x4676c2,groupLabel:_0xee2c16,commands:_0xd14582}=_0x20fbd4,_0x56c2cc=hi(_0x52f4f3,_0xd14582)['map'](_0x27ae0d=>({'id':_0x27ae0d['id'],'label':_0x27ae0d['label']}));return{'id':_0x4676c2,'menu':_0xee2c16||_0x4676c2,'children':_0x56c2cc};});}(_0xc8de38),{'ariaLabel':Yn(_0x279341,'AI\x20Commands')}),_0x5b4e85['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2f3c11['on']('change:enabledCommandsIds',_0x2fe602),_0x5b4e85['menuView']['once']('render',_0x2fe602),_0x5b4e85;function _0x2fe602(){_0x5b4e85['isEnabled']=_0x2f3c11['enabledCommandsIds']['length']>0x0;for(const _0x279c48 of _0x5b4e85['menuView']['buttons'])_0x279c48['isEnabled']=_0x2f3c11['enabledCommandsIds']['includes'](_0x279c48['id']);}}),_0xc8de38['ui']['componentFactory']['add']('menuBar:aiCommands',_0x26ca10=>{const _0x2b5c11=new _0x38710d(_0x26ca10);_0x2b5c11['buttonView']['set']({'label':Yn(_0x26ca10,'AI\x20Commands'),'icon':_0x1dd138}),_0x2b5c11['bind']('isEnabled')['to'](_0x2f3c11,'enabledCommandsIds',_0x2a2c38=>_0x2a2c38['length']>0x0);const _0x3ed822=z(_0xc8de38['config']['get']('ai.assistant.commands'),_0x26ca10);return this['_populateMenuBarMenu'](_0x2f3c11,_0x2b5c11,_0x3ed822,_0x312bba=>this['_onExecute'](_0x312bba)),_0x2b5c11;}),_0xc8de38['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x3b13ab=this['_createAIAssistantUIButton'](_0x14ee0a);return _0x3b13ab['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x3b13ab;}),_0xc8de38['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1c99eb=this['_createAIAssistantUIButton'](_0x5b3955);return _0x1c99eb['set']({'role':'menuitemcheckbox'}),_0x1c99eb;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xf8191=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x333bf6;for(const _0xbca7bf in _0xf8191){const _0xc5303a=_0xbca7bf,_0x4b137a=_0xf8191[_0xc5303a];if('aiLicenseKeyValid'==_0x4b137a||'aiLicenseKeyInvalid'==_0x4b137a||'aiLicenseKeyExpired'==_0x4b137a||'aiLicenseKeyDomainLimit'==_0x4b137a||'aiLicenseKeyNotAllowed'==_0x4b137a||'aiLicenseKeyEvaluationLimit'==_0x4b137a||'aiLicenseKeyTrialLimit'==_0x4b137a||'aiLicenseKeyUsageLimit'==_0x4b137a){delete _0xf8191[_0xc5303a],_0x333bf6=_0x4b137a,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x333bf6&&_0xf8191['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x333bf6&&_0xf8191['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x333bf6&&_0xf8191['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x333bf6&&_0xf8191['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x333bf6&&_0xf8191['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x333bf6&&_0xf8191['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x333bf6&&_0xf8191['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5c9814='',_0x34861c='',_0x5b1199='custom'){const _0x114aba=this['editor'],_0x595354=_0x114aba['editing']['view'],_0x505858=_0x114aba['plugins']['get'](F),_0x370e25=_0x114aba['plugins']['get'](_0x41836c);_0x505858['showFakeVisualSelection']();const _0x33f052=new J(),_0x25e628=new ClipboardEvent('copy',{'clipboardData':_0x33f052}),_0x5add08=new _0x1cb9e3(_0x33f052),_0x2df38f=new _0x162ba2(_0x595354,_0x25e628,{'dataTransfer':_0x5add08});_0x370e25['_forceMarkersCopy']('comment',()=>{_0x595354['document']['fire']('copy',_0x2df38f);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new oi(_0x114aba,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4533a9=_0x5add08['getData']('text/html');const _0x4a97bc=_0x114aba['model']['document']['selection'],_0x43086d=Array['from'](_0x4a97bc['getRanges']());0x1===_0x43086d['length']&&_0x43086d[0x0]['isFlat']&&!_0x4a97bc['getSelectedElement']()&&''!==_0x4533a9['replace'](/ /g,'')['trim']()&&(_0x4533a9='<p>'+_0x4533a9+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5b1199,'query':_0x5c9814,'htmlContent':_0x4533a9,'label':_0x34861c,'mainActionLabel':ci[_0x114aba['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4c398b,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2ccaf1['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x505858['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x4ff12d=new Map(),_0x36ceaf=z(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x495090 of _0x36ceaf)for(const _0x43b6b1 of _0x495090['commands'])_0x4ff12d['set'](_0x43b6b1['id'],{..._0x43b6b1,'groupId':_0x495090['groupId'],'groupLabel':_0x495090['groupLabel']||_0x495090['groupId']});return _0x4ff12d;}['_createAIAssistantUIButton'](_0x1ab3b1){const _0x36b242=this['editor'],_0x9fc1de=_0x36b242['commands']['get']('showAIAssistant'),_0x5cbfdf=new _0x1ab3b1(_0x36b242['locale']);return _0x5cbfdf['set']({'label':Yn(_0x36b242['locale'],'AI\x20Assistant'),'icon':_0x4c398b,'isToggleable':!0x0}),_0x5cbfdf['bind']('isEnabled')['to'](_0x9fc1de),_0x5cbfdf['bind']('isOn')['to'](this['_dialog'],'id',_0x1dc921=>'aiAssistant'===_0x1dc921),this['listenTo'](_0x5cbfdf,'execute',()=>{_0x5cbfdf['isOn']?this['hideUI']():_0x9fc1de['execute']();}),_0x5cbfdf;}['_initView'](){const _0x524200=this['editor']['plugins']['get'](F);this['_formView']=new ri(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',()=>{_0x524200['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x524200['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x198d85,ui:{ariaLiveAnnouncer:_0x5b7828}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x3958f6,_0x3c3361,_0xd7a8a6)=>{const _0x51bbef=this['_aiAssistantController']['currentContext'];_0xd7a8a6?_0x5b7828['announce'](Yn(_0x198d85,'AI\x20is\x20writing')):_0x51bbef&&_0x5b7828['announce'](Yn(_0x198d85,'Generated\x20content:\x20%0',_0x51bbef),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x33bb84,_0xba2117,_0x54290e)=>{if(_0x54290e){const _0x5383fd=this['_formView']['errorView']['text'];_0x5b7828['announce'](Yn(_0x198d85,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5383fd));}});}['_onExecute'](_0x54b23f){const _0x3ac885=this['_commandDefinitions']['get'](_0x54b23f),_0xd3918a=this['editor'],_0x41c0fa=_0xd3918a['model']['document']['selection'],_0x61a57f=_0xd3918a['commands']['get']('showAIAssistant'),_0x4e874d=_0xd3918a['plugins']['get'](F),_0xfb9bc2=''+(_0x3ac885['groupId']!==ei?_0x3ac885['groupLabel']+':\x20':'')+_0x3ac885['label'];if(!0x1!==_0x3ac885['requiresContent']&&_0x41c0fa['isCollapsed']){const _0x4984ed=_0x592c76(_0x41c0fa['getSelectedBlocks']())||_0xd3918a['model']['schema']['getLimitElement'](_0x41c0fa);_0xd3918a['model']['change'](_0x494d01=>{_0x494d01['setSelection'](_0x4984ed,'in');});}_0x4e874d['showFakeVisualSelection'](),_0x61a57f['execute'](_0x3ac885['prompt'],_0xfb9bc2,'command:'+_0x54b23f);}['_populateMenuBarMenu'](_0x3a4f13,_0x38e56d,_0x1af6f2,_0x1093e3){const _0x3ee745=this['editor'],_0x4ab132=_0x3ee745['locale'],_0x51affb=new ti(_0x4ab132),_0xb10f7d=hi(_0x3ee745,_0x1af6f2)['filter'](_0x30ca83=>_0x30ca83['commands']['length']);0x1===_0xb10f7d['length']?this['_getMenuBarGroupButtons']({'command':_0x3a4f13,'commands':_0xb10f7d[0x0]['commands'],'parentMenuView':_0x38e56d,'onExecute':_0x1093e3})['forEach'](_0x2e2a5e=>_0x51affb['items']['add'](_0x2e2a5e)):_0xb10f7d['forEach'](({groupId:_0x389803,groupLabel:_0x1b30df,commands:_0x1cde89})=>{const _0xf265af=new _0x44e2e2(_0x4ab132,_0x38e56d),_0x3b42c6=new _0x38710d(_0x4ab132),_0x28c83f=new ti(_0x4ab132),_0x38f885=this['_getMenuBarGroupButtons']({'command':_0x3a4f13,'commands':_0x1cde89,'parentMenuView':_0x3b42c6,'onExecute':_0x1093e3});_0x3b42c6['buttonView']['set']({'label':_0x1b30df||_0x389803}),_0x3b42c6['delegate']('execute')['to'](_0x38e56d),_0x28c83f['items']['addMany'](_0x38f885),_0x3b42c6['panelView']['children']['add'](_0x28c83f),_0xf265af['children']['add'](_0x3b42c6),_0x51affb['items']['add'](_0xf265af);}),_0x38e56d['panelView']['children']['add'](_0x51affb);}['_getMenuBarGroupButtons']({command:_0x897810,commands:_0x506f48,parentMenuView:_0x3bb7ed,onExecute:_0x1eaee0}){const _0x14a1e5=this['editor'],_0x3a1577=_0x14a1e5['locale'];return hi(_0x14a1e5,_0x506f48)['map'](_0x57b06e=>{const _0x86eb74=new _0x44e2e2(_0x3a1577,_0x3bb7ed),_0x3de153=new _0x5b3955(_0x3a1577);return _0x3de153['set']({'label':_0x57b06e['label']}),_0x3de153['delegate']('execute')['to'](_0x3bb7ed),_0x3de153['on']('execute',()=>_0x1eaee0(_0x57b06e['id'])),_0x3de153['bind']('isEnabled')['to'](_0x897810,'enabledCommandsIds',_0x5e8358=>_0x5e8358['includes'](_0x57b06e['id'])),_0x86eb74['children']['add'](_0x3de153),_0x86eb74;});}}function li(_0x2dcb3f,_0x4db420){return void 0x0!==_0x2dcb3f['order']&&void 0x0===_0x4db420['order']?0x1:void 0x0===_0x2dcb3f['order']&&void 0x0!==_0x4db420['order']?-0x1:void 0x0!==_0x2dcb3f['order']&&void 0x0!==_0x4db420['order']?_0x2dcb3f['order']-_0x4db420['order']:0x0;}function hi(_0x1afaee,_0x3f342e){_0x3f342e['sort'](li);const _0x159091={},_0x5e4364=[];for(const _0x339fb5 of _0x3f342e)if(void 0x0!==_0x339fb5['order']){if(_0x339fb5['order']in _0x159091)throw new _0x29f184('ai-commands-config-order-collision',_0x1afaee,{'conflictingDefinitions':[_0x339fb5,_0x159091[_0x339fb5['order']]]});_0x159091[_0x339fb5['order']]=_0x339fb5,_0x5e4364['splice'](_0x339fb5['order'],0x0,_0x339fb5);}else _0x5e4364['push'](_0x339fb5);return _0x5e4364;}class qn extends _0x5f3288{static get['requires'](){return[G,F];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1c13c6){super(_0x1c13c6);const _0x1037d4=_0x1c13c6['config'],_0x2b769c=_0x1c13c6['locale'];_0x1037d4['define']('ai.assistant.preserveComments',!0x0),_0x1037d4['define']('ai.assistant.commands',Qn(_0x2b769c)),_0x1037d4['define']('ai.assistant.extraCommandGroups',[]),_0x1037d4['define']('ai.assistant.removeCommands',[]);let _0x22e455=z(_0x1037d4['get']('ai.assistant.commands'),_0x2b769c);const _0x133ce4=_0x1037d4['get']('ai.assistant.extraCommandGroups'),_0x16aa84=_0x1037d4['get']('ai.assistant.removeCommands');_0x133ce4['forEach'](_0x8bd528=>{const _0x304044=_0x22e455['find'](_0x26d9c6=>_0x26d9c6['groupId']===_0x8bd528['groupId']);_0x304044?_0x304044['commands']=_0x304044['commands']['concat'](_0x8bd528['commands']):_0x22e455['push'](_0x8bd528);}),_0x22e455=_0x22e455['filter'](_0x3ade7a=>!_0x16aa84['includes'](_0x3ade7a['groupId'])),_0x22e455['forEach'](_0x4b7d13=>{_0x4b7d13['commands']=_0x4b7d13['commands']['filter'](_0x31a0ae=>!_0x16aa84['includes'](_0x31a0ae['id']));}),_0x1037d4['set']('ai.assistant.commands',_0x22e455);}}function Qn(_0x3735c8){return[{'groupId':'editOrReview','groupLabel':Yn(_0x3735c8,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x3735c8,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x3735c8,'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':Yn(_0x3735c8,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x3735c8,'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':Yn(_0x3735c8,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x3735c8,'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':Yn(_0x3735c8,'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':Yn(_0x3735c8,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x3735c8,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x3735c8,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x3735c8,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x3735c8,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x3735c8,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x3735c8,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x3735c8,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x3735c8,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x3735c8,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x3735c8,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x3735c8,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x3735c8,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x3735c8,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x3735c8,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x3735c8,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x3735c8,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x3735c8,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x3735c8,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x3735c8,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ue extends _0x5f3288{['abortController'];static get['requires'](){return[ni];}constructor(_0x21d0e4){super(_0x21d0e4),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](ni)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4049b8){return this['sendRequest'](_0x4049b8)['catch'](_0xf5279c=>{if(_0xf5279c instanceof tr)return Promise['reject'](_0xf5279c);if('AbortError'==_0xf5279c['name'])return Promise['resolve']();throw console['error'](_0xf5279c),new _0x29f184('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x36b2d9,_0xaa49b8){const _0x51192d=this['editor']['locale'],_0x4c905c={'Content-Type':'application/json'};if('object'==typeof _0x36b2d9)Object['assign'](_0x4c905c,_0x36b2d9);else{if(_0x36b2d9)try{const _0x41a465=await _0x36b2d9(_0xaa49b8);Object['assign'](_0x4c905c,_0x41a465);}catch{return Promise['reject'](new tr(Yn(_0x51192d,'AI_ERROR_GET_HEADERS')));}}return _0x4c905c;}async['_prepareRequestParameters'](_0x200658,_0x22a1dd){const _0xd934d4=this['editor']['locale'];if('object'==typeof _0x200658)return _0x200658;try{return await _0x200658(_0x22a1dd);}catch{return Promise['reject'](new tr(Yn(_0xd934d4,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends ue{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x12d561){super(_0x12d561),_0x12d561['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x12d561['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x12d561['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x12d561['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x12d561['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x12d561['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x29c0cc,context:_0x2a80fa,onData:_0x383f83,actionId:_0x1b4f78}){const _0x4923df=this['editor']['locale'],_0x82317c=await this['prepareMessages'](_0x29c0cc,_0x2a80fa,_0x1b4f78),_0x2d4abc=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1b4f78),_0x5154aa=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1b4f78),_0x4a2b4c={'messages':_0x82317c,..._0x5154aa},_0xccf0c8={'method':'POST','headers':_0x2d4abc,'body':JSON['stringify'](_0x4a2b4c),'signal':this['abortController']['signal']},_0x56ab4a=await fetch(this['_apiUrl'],_0xccf0c8);if(_0x56ab4a['ok'])return _0x5154aa['stream']?await this['_readStreamableResponse'](_0x56ab4a,_0x383f83):await this['_readStaticResponse'](_0x56ab4a,_0x383f83),Promise['resolve']();{const _0x4c9c6c=await _0x56ab4a['text']();return _0x4c9c6c['includes']('context_length_exceeded')?Promise['reject'](new tr(Yn(_0x4923df,'AI_ERROR_CONTEXT_LENGTH'))):_0x4c9c6c['includes']('Moderation')?Promise['reject'](new tr(Yn(_0x4923df,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x4c9c6c));}}async['prepareMessages'](_0x26f9d6,_0x1ce24c,_0x264181){let _0x46e133,_0x396cf8;return _0x1ce24c?(_0x46e133='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.',_0x396cf8='Instruction:\x0a'+_0x26f9d6+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1ce24c):(_0x46e133='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.',_0x396cf8=_0x26f9d6),[{'role':'system','content':_0x46e133},{'role':'user','content':_0x396cf8}];}async['_readStreamableResponse'](_0x394f5c,_0x32b642){const _0x39fd7b=_0x394f5c['body']['getReader'](),_0x8ec23a=new TextDecoder();let _0x46bb12='',_0x3f1c0a='',_0x1a9a27='',_0x49b556=!0x1;for(;!_0x49b556;){const {done:_0x5d9436,value:_0x5c4dd8}=await _0x39fd7b['read'](),_0x5db132=_0x46bb12+_0x8ec23a['decode'](_0x5c4dd8);let _0x4f9166='';_0x49b556=_0x5d9436;try{_0x4f9166=this['_cleanUpData'](_0x5db132),_0x46bb12='';}catch{_0x46bb12=_0x5db132;continue;}_0x3f1c0a+=_0x4f9166,!_0x49b556&&this['_isBufferIncomplete'](_0x3f1c0a)||_0x3f1c0a&&(_0x1a9a27+=_0x3f1c0a,_0x3f1c0a='',_0x32b642(_0x1a9a27));}return Promise['resolve']();}async['_readStaticResponse'](_0x4833cb,_0x27b7b2){return _0x27b7b2((await _0x4833cb['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x250966){const _0x21778b=_0x250966['split']('<')['length']!==_0x250966['split']('>')['length'],_0x1eb19b=_0x250966['length']<0x1e;return _0x21778b&&_0x1eb19b;}['_cleanUpData'](_0x31f78b){return _0x31f78b['split'](/\n(?![^{]*\})/g)['map'](_0x2f6d6e=>_0x2f6d6e['replace']('data:\x20',''))['filter'](_0x5216f5=>_0x5216f5&&_0x5216f5['length']>0x0&&'[DONE]'!==_0x5216f5)['map'](_0x124f38=>{const {choices:_0x211c53}=JSON['parse'](_0x124f38);if(_0x211c53[0x0]?.['delta']?.['content'])return _0x211c53[0x0]['delta']['content'];})['filter'](_0x405f94=>_0x405f94)['join']('');}}class zn extends ue{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x42bb0f){super(_0x42bb0f),_0x42bb0f['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x42bb0f['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x42bb0f['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x42bb0f['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x42bb0f['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x42bb0f['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x2c4c57,context:_0xc28c8b,onData:_0x4343c8,actionId:_0x1cd7ee}){const {model:_0x37d9d8,stream:_0x3ef6b4,..._0x21ba9e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1cd7ee),_0x2d75a9={'prompt':await this['preparePrompt'](_0x2c4c57,_0xc28c8b,_0x37d9d8,_0x1cd7ee),..._0x21ba9e};this['_apiUrl']?await this['_processProxyRequest'](_0x2d75a9,_0x37d9d8,_0x3ef6b4,_0x4343c8,_0x1cd7ee):await this['_processAWSRequest'](_0x2d75a9,_0x37d9d8,_0x3ef6b4,_0x4343c8);}async['preparePrompt'](_0x59d67e,_0x4ed276,_0x36becc,_0x3dcc20){let _0xa11b,_0x1add56;return _0x4ed276?(_0xa11b='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.',_0x1add56='Instruction:\x0a'+_0x59d67e+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4ed276):(_0xa11b='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.',_0x1add56=_0x59d67e),'meta.llama'==this['getModelFamily'](_0x36becc)?'<<SYS>>\x0a'+_0xa11b+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x1add56+'\x0a[/INST]':'Human:\x0a'+_0xa11b+'\x0a'+_0x1add56+'\x0a\x0aAssistant:';}['getModelFamily'](_0x28e6f0){if(/^anthropic\.claude/['test'](_0x28e6f0))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x28e6f0))return'ai21.j2';if(/^cohere\.command/['test'](_0x28e6f0))return'cohere.command';if(/^meta\.llama/['test'](_0x28e6f0))return'meta.llama';throw new tr(Yn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x28e6f0));}async['_processProxyRequest'](_0x42cc96,_0x454bc0,_0x5994bd,_0x2a5f7b,_0x534f06){const _0x2d5939={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x534f06),'body':JSON['stringify']({..._0x42cc96,'model':_0x454bc0,'stream':_0x5994bd}),'signal':this['abortController']['signal']},_0x188637=await fetch(this['_apiUrl'],_0x2d5939);_0x5994bd?await this['_readStreamableResponse'](_0x188637,_0x454bc0,_0x2a5f7b):await this['_readStaticResponse'](_0x188637,_0x454bc0,_0x2a5f7b);}async['_processAWSRequest'](_0x466e56,_0x488fc3,_0x1e5dab,_0x5462cf){const _0x1d12f0=new _0x5791f9(this['_bedrockClientConfig']),_0x547d6e={'body':JSON['stringify'](_0x466e56),'contentType':'application/json','accept':'application/json','modelId':_0x488fc3};let _0x6dbc5b;if(_0x1e5dab){const _0x95b627=new _0x3f5e91(_0x547d6e);_0x6dbc5b=await _0x1d12f0['send'](_0x95b627,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x6dbc5b,_0x488fc3,_0x5462cf);}else{const _0x59a90a=new _0x41e453(_0x547d6e);_0x6dbc5b=await _0x1d12f0['send'](_0x59a90a,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x6dbc5b,_0x488fc3,_0x5462cf);}}async['_readAsyncIterableResponse'](_0x1393ab,_0x240bfe,_0x2cd42c){const _0x34165c=_0x1393ab['body'],_0x5ca063=new TextDecoder('utf-8');let _0x393f5f='';for await(const _0x1e99e8 of _0x34165c)if(_0x1e99e8['chunk']){const _0x7e6f6=_0x5ca063['decode'](_0x1e99e8['chunk']['bytes']),_0x8e0611=JSON['parse'](_0x7e6f6);_0x393f5f+=this['_getGeneratedText'](_0x8e0611,_0x240bfe),_0x2cd42c(_0x393f5f);}return Promise['resolve']();}async['_readStreamableResponse'](_0x3968ca,_0x5a2298,_0x24a130){const _0xf89f54=_0x3968ca['body'],_0x14cc28=new TextDecoder('utf-8'),_0x160f67=_0xf89f54['getReader']();let _0x1f3e2e='',_0x2a33f2='',_0x3af77b=!0x1;for(;!_0x3af77b;){const {done:_0xf52a3e,value:_0x38a821}=await _0x160f67['read']();if(_0x3af77b=_0xf52a3e,_0x3af77b)break;const _0x108310=(_0x1f3e2e+_0x14cc28['decode'](_0x38a821))['split']('\x0a')['map'](_0x42ee17=>{try{return _0x1f3e2e='',JSON['parse'](_0x42ee17);}catch{return _0x1f3e2e=_0x42ee17,null;}})['filter'](_0xc0ad26=>null!==_0xc0ad26);_0x108310['length']&&(_0x2a33f2+=_0x108310['map'](_0x5ea8e7=>this['_getGeneratedText'](_0x5ea8e7,_0x5a2298))['join'](''),_0x24a130(_0x2a33f2));}return Promise['resolve']();}async['_readStaticResponse'](_0x34b07a,_0x318103,_0x3f45c0){let _0x2ee128;return _0x2ee128=_0x34b07a instanceof Response?await _0x34b07a['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x34b07a['body'])),(_0x3f45c0(this['_getGeneratedText'](_0x2ee128,_0x318103)),Promise['resolve']());}['_getGeneratedText'](_0x5606c4,_0x1f7963){switch(this['getModelFamily'](_0x1f7963)){case'anthropic.claude':return _0x5606c4['completion'];case'ai21.j2':return _0x5606c4['completions'][0x0]['data']['text'];case'cohere.command':return _0x5606c4['generations'][0x0]['text'];case'meta.llama':return _0x5606c4['generation'];}}}class ia extends _0x14ee0a{constructor(_0x17e46e,_0x32d736={}){super(_0x17e46e),this['isToggleable']=!0x0,this['set']('side',_0x32d736['side']||'top');const _0x5161a3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x7703f2(_0x32d736['class']||[]),_0x5161a3['to']('side',_0x1dcba4=>'ck-tab-button_'+_0x1dcba4),_0x5161a3['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x19a8c6{['children'];constructor(_0x3b2701,_0x554830={}){super(_0x3b2701);const _0x38f5e8=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x7703f2(_0x554830['class']||[]),_0x38f5e8['to']('class'),_0x38f5e8['if']('isVisible','ck-hidden',_0x4f4362=>!_0x4f4362)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x19a8c6{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x2f8d25,_0x28ade4={}){super(_0x2f8d25),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x28ade4['side']||'top'),this['set']('isMaximized',!0x1);const _0x11b6c6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x7703f2(_0x28ade4['class']||[]),_0x11b6c6['to']('side',_0x1454b6=>'ck-tabs_'+_0x1454b6),_0x11b6c6['to']('class'),_0x11b6c6['to']('isMaximized',_0x256d08=>_0x256d08?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x11b6c6['to']('side',_0x5cb765=>'ck-tabs__buttons-container_'+_0x5cb765)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x11b6c6['to']('side',_0x2b1ffd=>'ck-tabs__panels-container_'+_0x2b1ffd)]},'children':this['panelViews']},..._0x7703f2(_0x28ade4['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x4d60b1){const _0x58a359=this['_tabs']['get'](_0x4d60b1);return _0x58a359||null;}['addTab'](_0x49ac2d){const _0x23a4fd=this['_setupButton']({'id':_0x49ac2d['id'],'label':_0x49ac2d['buttonLabel'],'icon':_0x49ac2d['buttonIcon'],'order':_0x49ac2d['order']}),_0x40468b=new ea(this['locale']);return _0x40468b['render'](),_0x49ac2d['content']&&_0x40468b['children']['add'](_0x49ac2d['content']),this['panelViews']['add'](_0x40468b),this['_tabs']['set'](_0x49ac2d['id'],{'button':_0x23a4fd,'panel':_0x40468b,'order':void 0x0!==_0x49ac2d['order']?_0x49ac2d['order']:null}),this['fire']('addTab:'+_0x49ac2d['id'],{'id':_0x49ac2d['id'],'button':_0x23a4fd,'panel':_0x40468b}),null===this['activeTab']?this['activateTab'](_0x49ac2d['id']):this['_hidePanel'](_0x49ac2d['id']),{'button':_0x23a4fd,'panel':_0x40468b};}['activateTab'](_0x47c63f){if(null!==_0x47c63f&&!this['getTab'](_0x47c63f))throw new _0x29f184('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x47c63f});this['activeTab']!==_0x47c63f&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x47c63f,_0x47c63f&&this['_showPanel'](_0x47c63f),this['fire']('activateTab:'+_0x47c63f,_0x47c63f));}['showTab'](_0x13ccfb){if(!this['getTab'](_0x13ccfb))throw new _0x29f184('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x13ccfb});this['_showPanel'](_0x13ccfb),this['_showButton'](_0x13ccfb),this['fire']('show:'+_0x13ccfb,_0x13ccfb);}['hideTab'](_0x4e3db2){if(!this['getTab'](_0x4e3db2))throw new _0x29f184('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4e3db2});const _0x3f8f47=this['activeTab'];this['_hidePanel'](_0x4e3db2),this['_hideButton'](_0x4e3db2);const _0x234979=this['getTabIds']();_0x3f8f47===_0x4e3db2&&_0x234979['length']>0x1&&this['activateTab'](_0x234979['find'](_0x2d272a=>_0x2d272a!==_0x4e3db2)),this['fire']('hide:'+_0x4e3db2,_0x4e3db2);}['_getPanel'](_0x5c5faa){const _0x66a43c=this['_tabs']['get'](_0x5c5faa);return _0x66a43c?_0x66a43c['panel']:null;}['_showPanel'](_0x55e00d){null!==this['activeTab']&&this['activeTab']!==_0x55e00d||this['_getPanel'](_0x55e00d)['show']();}['_hidePanel'](_0x44b75a){const _0x1c9f9f=this['_getPanel'](_0x44b75a);_0x1c9f9f['isVisible']&&(this['activeTab']===_0x44b75a&&(this['activeTab']=null),_0x1c9f9f['hide']());}['_getButton'](_0x482f11){const _0x5c1548=this['_tabs']['get'](_0x482f11);return _0x5c1548?_0x5c1548['button']:null;}['_showButton'](_0x1855c5){this['_getButton'](_0x1855c5)['show']();}['_hideButton'](_0x5b8afc){this['_getButton'](_0x5b8afc)['hide']();}['_setupButton'](_0x26f58c){const _0xf0dfd8=new ia(this['locale'],{'side':this['side']}),_0x356a2e=this['buttonViews'];if(_0xf0dfd8['set']({'label':_0x26f58c['label'],'icon':_0x26f58c['icon'],'tooltip':!0x0,'withText':!0x0}),_0xf0dfd8['bind']('isOn')['to'](this,'activeTab',_0x47aa43=>_0x47aa43===_0x26f58c['id']),_0xf0dfd8['bind']('side')['to'](this,'side'),_0x26f58c['order']){const _0x49568c=[...this['_tabs']]['reduce']((_0x2e6e4f,_0x3cde8d)=>{const _0x436ee7=_0x3cde8d[0x0],{order:_0x424149}=_0x3cde8d[0x1];return!_0x424149||_0x424149>_0x26f58c['order']?_0x2e6e4f:_0x424149>=_0x2e6e4f['order']?{'id':_0x436ee7,'order':_0x424149}:_0x2e6e4f;},{'id':'','order':0x0}),_0x330968=_0x356a2e['getIndex'](this['_getButton'](_0x49568c['id']));_0x356a2e['add'](_0xf0dfd8,_0x330968+0x1);}else _0x356a2e['add'](_0xf0dfd8);return _0xf0dfd8['on']('execute',()=>{this['activateTab'](_0x26f58c['id']);}),_0xf0dfd8;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends ss{constructor(_0xab13d9,_0x1af9b3={}){super(_0xab13d9,_0x1af9b3),this['set']('type',_0x1af9b3['type']||'sidebar'),this['set']('side',_0x1af9b3['side']||'right'),this['set']('isVisible',_0x1af9b3['visibleByDefault']??!0x0);const _0x78555b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x78555b['if']('type','ck-ai-tabs__overlay',_0x3ee6e4=>'overlay'===_0x3ee6e4),_0x78555b['if']('type','ck-ai-tabs__sidebar',_0x4d4f46=>'sidebar'===_0x4d4f46),_0x78555b['if']('isVisible','ck-hidden',_0x24cf3e=>!_0x24cf3e)]}}),this['buttonViews']['on']('add',(_0x7481f8,_0x4cce3e)=>{_0x4cce3e['set']('withText',!0x1);});}}class at extends _0x171820{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xedfaf2){super(_0xedfaf2);const _0x4f06f2=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x4f06f2)throw new _0x29f184('ai-tabs-configuration-not-found');if(void 0x0!==_0x4f06f2['showResizeButton']&&(this['showResizeButton']=_0x4f06f2['showResizeButton']),'sidebar'!==_0x4f06f2['type']&&'overlay'!==_0x4f06f2['type']||_0x4f06f2['side']&&(this['side']=_0x4f06f2['side']),'sidebar'===_0x4f06f2['type']){if(this['container']=_0x4f06f2['element'],this['set']('type','sidebar'),!this['container'])throw new _0x29f184('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x4f06f2['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new bi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x4f06f2['visibleByDefault']||_0x4f06f2['visibleByDefault']}),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 st&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x28d02c){if(_0x28d02c&&this['type']!==_0x28d02c){if(!Ti['includes'](_0x28d02c))throw new _0x29f184('ai-tabs-unsupported-ui-type');this['type']=_0x28d02c;}}['switchSide'](_0x5dad00){if(_0x5dad00&&this['side']!==_0x5dad00){if(!yi['includes'](_0x5dad00))throw new _0x29f184('ai-tabs-unsupported-ui-side');this['side']=_0x5dad00;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class s extends _0x171820{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x266a2d){super(_0x266a2d),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x331973=this['context']['plugins']['get']('CloudServices');if(!_0x331973['token'])throw new _0x29f184('ai-missing-token',this);this['_token']=_0x331973['token'];}['startConversation'](_0x2566b8,_0x5c75b3){const _0x44ff86=this['_sendApiRequest']('/conversations','POST',{'id':_0x2566b8,'group':_0x5c75b3});return{'getConversation':async()=>(await _0x44ff86['request'])['json'](),'abortController':_0x44ff86['abortController']};}['queryAssistant']({message:_0x5acd0f,conversationId:_0x387f9e,parts:_0x1e505e,capabilities:_0xca70e2,model:_0x2ecc8c,quickActionData:_0x18594a}){const _0x384f4c={..._0x18594a&&{'quickActionData':_0x18594a}},_0x40d266={'prompt':_0x5acd0f,'content':_0x1e505e,'model':_0x2ecc8c,..._0xca70e2&&{'capabilities':_0xca70e2},...Object['keys'](_0x384f4c)['length']>0x0&&{'attributes':_0x384f4c}},_0x2610c8=this['_sendApiRequest']('/conversations/'+_0x387f9e+'/messages','POST',_0x40d266);return{'getStream':async()=>{const _0x4c2669=(await _0x2610c8['request'])['body'];return this['_getStreamReader'](_0x4c2669);},'abortController':_0x2610c8['abortController']};}['executeCustomAction']({content:_0x24a878,message:_0x45f2e3,model:_0x5d6c0d,outputFormat:_0x58b2d2}){const _0x1d8694={'content':[{'type':'text','content':_0x24a878}],'prompt':_0x45f2e3,'model':_0x5d6c0d,'outputFormat':_0x58b2d2},_0x4e9273=this['_sendApiRequest']('/actions/custom/calls','POST',_0x1d8694);return{'getStream':async()=>{const _0x34c050=(await _0x4e9273['request'])['body'];return this['_getStreamReader'](_0x34c050);},'abortController':_0x4e9273['abortController']};}['executeAction']({actionName:_0x410873,content:_0x368590,args:_0x4cf347}){const _0x205676={'content':[{'type':'text','content':_0x368590}],'args':_0x4cf347},_0x24d68c=this['_sendApiRequest']('/actions/system/'+_0x410873+'/calls','POST',_0x205676);return{'getStream':async()=>{const _0x35c72f=(await _0x24d68c['request'])['body'];return this['_getStreamReader'](_0x35c72f);},'abortController':_0x24d68c['abortController']};}['uploadFile'](_0x5e6e9d,_0x1baefb,_0x4ae4e4){const _0x233726=new FormData();_0x233726['append']('file',_0x1baefb,_0x1baefb['name']),_0x4ae4e4&&_0x233726['append']('attributes',JSON['stringify'](_0x4ae4e4));const _0x505d65=this['_sendApiRequest']('/conversations/'+_0x5e6e9d+'/files','POST',_0x233726);return{'getId':async()=>(await _0x505d65['request'])['json'](),'abortController':_0x505d65['abortController']};}['fetchDocument'](_0xae1550,_0x228a4f){const _0x4f4e4d=this['_sendApiRequest']('/conversations/'+_0xae1550+'/documents/'+_0x228a4f,'GET');return{'getDocument':async()=>(await _0x4f4e4d['request'])['json'](),'abortController':_0x4f4e4d['abortController']};}['uploadDocument'](_0x495913,_0x28bc3a,_0x267600){const _0x389569={'content':_0x28bc3a};_0x267600&&(_0x389569['attributes']=_0x267600);const _0x2b1f39=this['_sendApiRequest']('/conversations/'+_0x495913+'/documents','POST',_0x389569);return{'getId':async()=>(await _0x2b1f39['request'])['json'](),'abortController':_0x2b1f39['abortController']};}['fetchConversations'](_0x5aab4e,_0x9f6343){const _0x5e7709=new URLSearchParams();_0x5e7709['append']('excludeEmpty','true'),_0x5e7709['append']('limit','100'),_0x5e7709['append']('group',_0x5aab4e),_0x9f6343&&_0x5e7709['append']('search',_0x9f6343);const _0x2ee9db=this['_sendApiRequest']('/conversations?'+_0x5e7709['toString'](),'GET');return{'getConversations':async()=>{const _0x4b4599=await _0x2ee9db['request'];return(await _0x4b4599['json']())['items'];},'abortController':_0x2ee9db['abortController']};}['deleteConversation'](_0x114d14){const _0x5831b7=this['_sendApiRequest']('/conversations/'+_0x114d14,'DELETE');return{'execute':async()=>{await _0x5831b7['request'];},'abortController':_0x5831b7['abortController']};}['updateConversation'](_0x1ead45,_0x3d8ae8){const _0x705ed7=this['_sendApiRequest']('/conversations/'+_0x1ead45,'PATCH',_0x3d8ae8);return{'getResult':async()=>(await _0x705ed7['request'],_0x3d8ae8),'abortController':_0x705ed7['abortController']};}['fetchConversation'](_0x500291){const _0x1b109f=this['_sendApiRequest']('/conversations/'+_0x500291,'GET');return{'getConversation':async()=>(await _0x1b109f['request'])['json'](),'abortController':_0x1b109f['abortController']};}['fetchConversationMessages'](_0x467a91){const _0x459238=this['_sendApiRequest']('/conversations/'+_0x467a91+'/messages','GET');return{'getMessages':async()=>{const _0x31b332=await _0x459238['request'];return(await _0x31b332['json']())['items'];},'abortController':_0x459238['abortController']};}['uploadUrl'](_0x3f5758,_0x42e932,_0x41ce56){const _0x5b6ad9=this['_sendApiRequest']('/conversations/'+_0x3f5758+'/web-resources','POST',{'url':_0x42e932,'attributes':_0x41ce56});return{'getId':async()=>(await _0x5b6ad9['request'])['json'](),'abortController':_0x5b6ad9['abortController']};}['getModels'](){const _0x5f48ed=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x5f48ed['request'])['json'](),'abortController':_0x5f48ed['abortController']};}['deleteFile'](_0x2fee8c,_0xc80490){const _0x1d4002=this['_sendApiRequest']('/conversations/'+_0x2fee8c+'/files/'+_0xc80490,'DELETE');return{'execute':async()=>{await _0x1d4002['request'];},'abortController':_0x1d4002['abortController']};}['deleteDocument'](_0x1563d2,_0x3c592a){const _0x1c8de7=this['_sendApiRequest']('/conversations/'+_0x1563d2+'/documents/'+_0x3c592a,'DELETE');return{'execute':async()=>{await _0x1c8de7['request'];},'abortController':_0x1c8de7['abortController']};}['deleteWebResource'](_0x43a5bf,_0x127d47){const _0x1c1e25=this['_sendApiRequest']('/conversations/'+_0x43a5bf+'/web-resources/'+_0x127d47,'DELETE');return{'execute':async()=>{await _0x1c1e25['request'];},'abortController':_0x1c1e25['abortController']};}['callSystemReview']({reviewName:_0x289e2b,content:_0x2ba963,args:_0x74f9e1}){const _0x377277=this['_sendApiRequest']('/reviews/system/'+_0x289e2b+'/calls','POST',{'content':[{'type':'text','content':_0x2ba963}],'args':_0x74f9e1});return{'getStream':async()=>{const _0x43dd71=(await _0x377277['request'])['body'];return this['_getStreamReader'](_0x43dd71);},'abortController':_0x377277['abortController']};}['callCustomReview']({content:_0x49f815,prompt:_0x4858bf,model:_0x221a13}){const _0x45bc71=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x49f815}],'prompt':_0x4858bf,'model':_0x221a13});return{'getStream':async()=>{const _0x500e45=(await _0x45bc71['request'])['body'];return this['_getStreamReader'](_0x500e45);},'abortController':_0x45bc71['abortController']};}['upsertAIChatRating'](_0x37e35f,_0xf36160,_0x64341a){const _0x306408=this['_sendApiRequest']('/conversations/'+_0x37e35f+'/messages/'+_0xf36160+'/ratings','PUT',{'positiveCount':_0x64341a['positiveCount'],'totalCount':_0x64341a['totalCount'],'modificationId':_0x64341a['modificationId']});return{'execute':async()=>{await _0x306408['request'];},'abortController':_0x306408['abortController']};}['upsertAIActionRating'](_0x3cb9cd,_0x3e96a9,_0x315335){const _0x3360b0=this['_sendApiRequest']('/actions/system/'+_0x3cb9cd+'/calls/'+_0x3e96a9+'/ratings','PUT',{'positiveCount':_0x315335['positiveCount'],'totalCount':_0x315335['totalCount']});return{'execute':async()=>{await _0x3360b0['request'];},'abortController':_0x3360b0['abortController']};}['upsertCustomAIActionRating'](_0x279f17,_0x3161f9){const _0x33e743=this['_sendApiRequest']('/actions/custom/calls/'+_0x279f17+'/ratings','PUT',{'positiveCount':_0x3161f9['positiveCount'],'totalCount':_0x3161f9['totalCount']});return{'execute':async()=>{await _0x33e743['request'];},'abortController':_0x33e743['abortController']};}['upsertAIReviewRating'](_0x1f6500,_0x43f926,_0x3bc178,_0x330776){const _0x5499c0=this['_sendApiRequest']('/reviews/system/'+_0x1f6500+'/calls/'+_0x43f926+'/ratings','PUT',{'positiveCount':_0x3bc178['positiveCount'],'totalCount':_0x3bc178['totalCount'],'dataId':_0x330776});return{'execute':async()=>{await _0x5499c0['request'];},'abortController':_0x5499c0['abortController']};}['upsertCustomAIReviewRating'](_0x4886e3,_0xd38230,_0x20884e){const _0x510fcb=this['_sendApiRequest']('/reviews/custom/calls/'+_0x4886e3+'/ratings','PUT',{'positiveCount':_0xd38230['positiveCount'],'totalCount':_0xd38230['totalCount'],'dataId':_0x20884e});return{'execute':async()=>{await _0x510fcb['request'];},'abortController':_0x510fcb['abortController']};}['_sendApiRequest'](_0x4fc8d2,_0x3b11f6,_0x147495){const _0x3a27b4=new AbortController(),_0x5e379c=_0x147495 instanceof FormData,_0x4da716={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x147495&&!_0x5e379c&&(_0x4da716['Content-Type']='application/json');const _0x2eb01b={'method':_0x3b11f6,'headers':_0x4da716,'signal':_0x3a27b4['signal']};return _0x147495&&(_0x2eb01b['body']=_0x5e379c?_0x147495:JSON['stringify'](_0x147495)),{'request':fetch(''+this['_apiUrl']+_0x4fc8d2,_0x2eb01b)['catch'](_0x3a5f39=>{this['_handleError'](_0x3a5f39);})['then'](_0x1b4538=>{if(!_0x1b4538['ok'])throw new _0x29f184('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x4fc8d2,'method':_0x3b11f6,'body':_0x147495,'status':(_0x1b4538||{})['status'],'statusText':(_0x1b4538||{})['statusText']});return _0x1b4538;}),'abortController':_0x3a27b4};}async*['_getStreamReader'](_0x4d00d5){const _0x53573b=[],_0x463cfe=_0x4d00d5['getReader'](),_0x5ed130=wt({'onError':_0x4e5c2f=>{this['_handleError'](_0x4e5c2f);},'onEvent':_0x382e0b=>{_0x382e0b['data']=JSON['parse'](_0x382e0b['data']),_0x53573b['push'](_0x382e0b);}});try{let _0xc5b35=!0x1;for(;!_0xc5b35;){const {done:_0x5bc776,value:_0x473200}=await _0x463cfe['read']();_0x5bc776&&(_0xc5b35=!0x0),_0x5ed130['feed'](this['_decoder']['decode'](_0x473200,{'stream':!0x0})),yield*_0x53573b,_0x53573b['length']=0x0;}}catch(_0x592f59){this['_handleError'](_0x592f59);}finally{_0x463cfe['releaseLock'](),_0x5ed130['reset']();}}['_handleError'](_0x1d6c0d){if(_0x1d6c0d instanceof _0x29f184)throw _0x1d6c0d;if(_0x1d6c0d instanceof Error&&'AbortError'===_0x1d6c0d['name'])throw new _0x29f184('ai-request-aborted',this,{'originalError':_0x1d6c0d});throw new _0x29f184('ai-request-failed',this,{'originalError':_0x1d6c0d});}}function C(_0xcab497,_0x5ac55d,_0xafb028){const t=_0xcab497['t'];switch(_0x5ac55d){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'},_0xafb028);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_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});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_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\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});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_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.'},_0xafb028);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.'},_0xafb028);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_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_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.'},_0xafb028);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_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_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0xafb028);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0xafb028);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0xafb028);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0xafb028);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0xafb028);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0xafb028);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0xafb028);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.'},_0xafb028);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.'},_0xafb028);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.'},_0xafb028);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.'},_0xafb028);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'},_0xafb028);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_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','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_MODEL_DESCRIPTION_AUTO':return t({'id':'AI_MODEL_DESCRIPTION_AUTO','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU','string':'Cost-efficient\x20model\x20for\x20quick\x20interactions\x20with\x20improved\x20reasoning'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET','string':'Advanced\x20model\x20with\x20improved\x20creativity,\x20reliability,\x20and\x20reasoning'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});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.'},_0xafb028);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_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_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_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'});default:return _0x5ac55d;}}function Cs(_0x43d349,_0x3413a8){const _0x1e567a=new _0x14ee0a(_0x43d349),_0x5a68ba=C(_0x43d349,'AI_TABS_LABEL_MINIMIZE'),_0x103c80=C(_0x43d349,'AI_TABS_LABEL_MAXIMIZE');return _0x1e567a['set']({'withText':!0x1,'icon':_0x2e7c4e,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x1e567a['bind']('label')['to'](_0x3413a8,'isMaximized',_0x3643ba=>_0x3643ba?_0x5a68ba:_0x103c80),_0x1e567a['bind']('icon')['to'](_0x3413a8,'isMaximized',_0x38de5a=>_0x38de5a?to:_0x2e7c4e),_0x1e567a['bind']('isOn')['to'](_0x3413a8,'isMaximized'),_0x1e567a['on']('execute',()=>{_0x3413a8['fire']('resizeTabs');}),_0x1e567a;}function Ye(_0x4ca1de){return _0x2817be(_0x4ca1de);}function ut(_0x4555e3){return _0xec369b(_0x4555e3);}function ft(_0x487375,_0xd98b6c,_0xfb0d8a){const _0x1da462=null!==_0xd98b6c?_0x43c2ca=>_0x43c2ca['attribs'][_0x487375]===_0xd98b6c:_0x508175=>Boolean(_0x508175['attribs'][_0x487375]);return gt(_0xe6126d=>_0x41757a(_0xe6126d)&&_0x1da462(_0xe6126d),_0xfb0d8a);}function Be(_0x56055e,_0x44b0c2,_0xaba9ed){const _0x18df7f=null!==_0x44b0c2?_0xd32ec0=>_0xd32ec0['attribs'][_0x56055e]===_0x44b0c2:_0x5e6ec0=>Boolean(_0x5e6ec0['attribs'][_0x56055e]);return _0x23a287(_0xca1a0a=>_0x41757a(_0xca1a0a)&&_0x18df7f(_0xca1a0a),_0xaba9ed);}function pt(_0x1991af,_0x2a6b3c){return _0x1991af&&_0x41757a(_0x1991af)?_0x1991af['attribs'][_0x2a6b3c]:null;}function Qe(_0x43e6d9,_0x323295,_0x3143d8){_0x41757a(_0x43e6d9)&&(null===_0x3143d8?delete _0x43e6d9['attribs'][_0x323295]:_0x43e6d9['attribs'][_0x323295]=_0x3143d8);}function ze(_0x2cc288,_0x4d0fd4,_0xcb9e27){const _0x1431d4=_0x4d0fd4['cloneNode'](!0x0);'beforebegin'===_0xcb9e27?_0x53ea51(_0x2cc288,_0x1431d4):'afterbegin'===_0xcb9e27?_0x51c386(_0x2cc288,_0x1431d4):'beforeend'===_0xcb9e27?_0x54c92e(_0x2cc288,_0x1431d4):'afterend'===_0xcb9e27&&_0x2b81f1(_0x2cc288,_0x1431d4);}function Ae(_0x1aaecd){const _0x55cc1f=[];let _0x30bab1=_0x1aaecd;for(;_0x30bab1;)_0x30bab1=_0xb3e946(_0x30bab1),_0x30bab1&&_0x55cc1f['push'](_0x30bab1);return _0x55cc1f;}function Jn(_0x59bc75){return _0x59bc75['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ze(_0x1924d3){let _0x548e07=0x0;for(;_0x1924d3['parentNode'];)_0x1924d3=_0x1924d3['parentNode'],_0x548e07++;return _0x548e07;}function Is(_0x15d8cc){const _0x43d17c=[];let _0x22a61a=_0x15d8cc['nextSibling'];for(;_0x22a61a;)_0x43d17c['push'](_0x22a61a),_0x22a61a=_0x22a61a['nextSibling'];_0x43d17c['forEach'](_0x1483d1=>{_0x33c6d9(_0x1483d1);});}class Oe extends/* #__PURE__ -- @preserve */
|
|
25
|
-
|
|
26
|
-
_0x4572ab(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x5dec53){super(),this['_generateUid']=_0x5dec53||_0x223274;}['merge'](_0x5651a7,_0x1ab9d8,_0x58cc19){const _0x1dbaa5=_0x5651a7['cloneNode'](!0x0);if(0x0===_0x1ab9d8['childNodes']['length']){const _0x443d60=[];return Be('data-id','new-element',_0x1dbaa5)['forEach'](_0x404c07=>{const _0x49f5b8=this['_generateUid']();Qe(_0x404c07,'data-id',_0x49f5b8),_0x443d60['push'](_0x49f5b8);}),this['_removeSpecialComments'](_0x1dbaa5),{'parsedContent':_0x1dbaa5,'newNodeIds':_0x443d60,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x58cc19&&_0x58cc19['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1dbaa5),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Be('data-id',null,_0x1ab9d8)['map'](_0xa606fd=>pt(_0xa606fd,'data-id'))['filter'](_0x102b7d=>!!_0x102b7d));let _0x37fc13=-0x1,_0x12e09c=!0x1;const _0xdb1d36=_0x1dbaa5['childNodes'],_0x1fba2a=Array['from'](_0xdb1d36)['filter'](_0x1f78a5=>!(0x3===_0x1f78a5['nodeType']&&''===ut(_0x1f78a5)['trim']())),_0x43a782=_0x1fba2a['length'];for(let _0x24e5f5=0x0;_0x24e5f5<_0x43a782;_0x24e5f5++){const _0x4d5de3=_0x1fba2a[_0x24e5f5],_0x5e01d8=_0x1fba2a[_0x24e5f5+0x1];if(this['_isNewNode'](_0x4d5de3)){if(-0x1===_0x37fc13&&(_0x37fc13=_0x24e5f5),this['_markWrappedElements'](_0x4d5de3),!this['_isNewNode'](_0x5e01d8)){const [_0x42269f,_0x4461ac]=this['_findReferenceNode'](_0x4d5de3,_0x12e09c,_0x1ab9d8);if(_0x42269f){const _0x3f4feb=Array['from'](_0x1fba2a)['slice'](_0x37fc13,_0x24e5f5+0x1);this['_insertNodes'](_0x42269f,_0x3f4feb,_0x4461ac),_0x37fc13=-0x1;}}}else{if(this['_isExistingContentComment'](_0x4d5de3))_0x12e09c=!0x0;else{if(this['_isExistingNode'](_0x4d5de3)){const _0x290eaa=pt(_0x4d5de3,'data-id');if(_0x290eaa&&this['_existingDataIds']['has'](_0x290eaa)){const _0x1cd6f8=ft('data-id',_0x290eaa,_0x1ab9d8);this['_replaceNode'](_0x1cd6f8,_0x4d5de3);}if(this['_touchedNodesState']['removedIds']['includes'](_0x290eaa)){const _0x48fe3f=this['_touchedNodesState']['removedIds']['indexOf'](_0x290eaa);this['_touchedNodesState']['removedIds']['splice'](_0x48fe3f,0x1);}}else{if(this['_isDelNode'](_0x4d5de3)){const _0x4f13c0=pt(_0x4d5de3,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x4f13c0)||this['_storeDeletedElementIds'](_0x4d5de3);}}}}}for(const _0x59c4e4 of this['_touchedNodesState']['removedIds']){const _0x18902d=ft('data-id',_0x59c4e4,_0x1ab9d8);if(_0x18902d){if(_0x58cc19&&_0x58cc19['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x59c4e4;const _0x1bf9a4=_0x58cc19['replaceRemovedWith']['cloneNode'](!0x0);Qe(_0x1bf9a4,'data-id',_0x59c4e4),Qe(_0x1bf9a4,'data-removed','true'),_0x173cd4(_0x18902d,_0x1bf9a4);}else _0x33c6d9(_0x18902d);}}if(Be('data-wrapped-id',null,_0x1ab9d8)['forEach'](_0x36588c=>{const _0x31da1e=ft('data-id',pt(_0x36588c,'data-wrapped-id'),_0x1ab9d8);var _0xd66e82,_0x62b597;_0x31da1e&&(_0x62b597=_0x36588c,_0x33c6d9(_0xd66e82=_0x31da1e),_0x173cd4(_0x62b597,_0xd66e82));}),Be('data-id','new-element',_0x1ab9d8)['forEach'](_0x3a764c=>{const _0x52eaa0=this['_getUid'](_0x3a764c);Qe(_0x3a764c,'data-id',_0x52eaa0),this['_touchedNodesState']['newIds']['push'](_0x52eaa0);}),this['_removeSpecialComments'](_0x1ab9d8),_0x58cc19&&_0x58cc19['markUnstableElements']&&this['_markUnstableElements'](_0x1ab9d8,_0x58cc19['markUnstableElementsDepth']||0x0),_0x58cc19&&_0x58cc19['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x59c29b=ft('data-id',this['_touchedNodesState']['lastTouchedId'],_0x1ab9d8);for(;_0x59c29b;)Is(_0x59c29b),_0x59c29b=_0x59c29b['parentNode'];}return{'parsedContent':_0x1ab9d8,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0xddd4f1,_0x35a86c,_0x3a7554){for(const _0x3eedc0 of _0x35a86c){const _0x51662a=this['_getUid'](_0x3eedc0);Qe(_0x3eedc0,'data-id',_0x51662a),this['_touchedNodesState']['newIds']['push'](_0x51662a),this['_touchedNodesState']['lastTouchedId']=_0x51662a;}const _0x3d128c='afterbegin'===_0x3a7554||'afterend'===_0x3a7554?_0x35a86c['reverse']():_0x35a86c;for(const _0x549b2e of _0x3d128c)ze(_0xddd4f1,_0x549b2e,_0x3a7554);}['_replaceNode'](_0x5a19ac,_0x1c3781){if(!_0x5a19ac)return;if(_0x3ca5c5=_0x1c3781,Jn(ut(_0x5a19ac))===Jn(ut(_0x3ca5c5)))return;var _0x3ca5c5;const _0x56df65=this['_getUid'](_0x5a19ac);Qe(_0x1c3781,'data-id',_0x56df65),this['_touchedNodesState']['modifiedIds']['push'](_0x56df65),this['_touchedNodesState']['lastTouchedId']=_0x56df65,_0x173cd4(_0x5a19ac,_0x1c3781['cloneNode'](!0x0));}['_findReferenceNode'](_0x129490,_0x17c2d8,_0x1846a4){const _0x406394=this['_findPrevElementWithDataId'](_0x129490,!0x1);if(_0x406394){const _0x975e82=this['_getNodeDataId'](_0x406394),_0x2f06c0=ft('data-id',_0x975e82,_0x1846a4);if(_0x2f06c0)return[_0x2f06c0,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x975e82);}const _0x167e88=this['_findNextElementWithDataId'](_0x129490,!0x1);if(_0x167e88){const _0x5695e1=this['_getNodeDataId'](_0x167e88),_0xdb82ea=ft('data-id',_0x5695e1,_0x1846a4);if(_0xdb82ea)return[_0xdb82ea,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x5695e1);}return _0x17c2d8?_0x129490['nextSibling']?this['_findFallbackReferenceNode'](_0x129490,_0x1846a4):[_0x1846a4['childNodes'][_0x1846a4['childNodes']['length']-0x1],'afterend']:[_0x1846a4['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x114241,_0x4a0769){const _0x4e6323=[],_0x377def=this['_findPrevElementWithDataId'](_0x114241,!0x0);if(_0x377def){const _0x6c29c6=ft('data-id',this['_getNodeDataId'](_0x377def),_0x4a0769);_0x6c29c6&&_0x4e6323['push']([_0x6c29c6,'afterend']);}const _0x29ffd0=this['_findNextElementWithDataId'](_0x114241,!0x0);if(_0x29ffd0){const _0x5b67ee=ft('data-id',this['_getNodeDataId'](_0x29ffd0),_0x4a0769);_0x5b67ee&&_0x4e6323['push']([_0x5b67ee,'beforebegin']);}if(_0x4e6323['length']>0x1)return Ze(_0x4e6323[0x0][0x0])<=Ze(_0x4e6323[0x1][0x0])?_0x4e6323[0x0]:_0x4e6323[0x1];return 0x1===_0x4e6323['length']?_0x4e6323[0x0]:[_0x4a0769['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x587197,_0x3d0967){let _0x32ecbf=_0x587197['nextSibling'],_0x1af09f=null,_0x9ede4c=!0x1;for(;_0x32ecbf;){if(_0x5581e1(_0x32ecbf)){if(this['_isDelNode'](_0x32ecbf)&&(_0x1af09f=_0x32ecbf),this['_isExistingContentComment'](_0x32ecbf)&&_0x3d0967&&!_0x9ede4c){_0x9ede4c=!0x0,_0x32ecbf=_0x32ecbf['nextSibling'];continue;}break;}const _0x6dc487=pt(_0x32ecbf,'data-id');if(_0x6dc487&&'new-element'!==_0x6dc487&&this['_existingDataIds']['has'](_0x6dc487)){_0x1af09f=_0x32ecbf;break;}_0x32ecbf=_0x32ecbf['nextSibling'];}return _0x1af09f;}['_findPrevElementWithDataId'](_0x1596ea,_0xf9f2f6){let _0x222e84=_0x1596ea['previousSibling'],_0x51182c=null,_0x2b81bf=!0x1;for(;_0x222e84;){if(_0x5581e1(_0x222e84)){if(this['_isDelNode'](_0x222e84)&&(_0x51182c=_0x222e84),this['_isExistingContentComment'](_0x222e84)&&_0xf9f2f6&&!_0x2b81bf){_0x2b81bf=!0x0,_0x222e84=_0x222e84['previousSibling'];continue;}break;}const _0xee7392=pt(_0x222e84,'data-id');if(_0xee7392&&'new-element'!==_0xee7392&&this['_existingDataIds']['has'](_0xee7392)){_0x51182c=_0x222e84;break;}_0x222e84=_0x222e84['previousSibling'];}return _0x51182c;}['_markWrappedElements'](_0x5c4cd3){_0x41757a(_0x5c4cd3)&&Be('data-id',null,_0x5c4cd3)['forEach'](_0x113a44=>{this['_isExistingNode'](_0x113a44)&&!this['_hasWrappedParent'](_0x113a44)&&(Qe(_0x113a44,'data-wrapped-id',pt(_0x113a44,'data-id')),Qe(_0x113a44,'data-id',null));});}['_getNodeDataId'](_0x1f481c){if(!_0x1f481c)return null;if(_0x41757a(_0x1f481c))return pt(_0x1f481c,'data-id');if(_0x5581e1(_0x1f481c)){const _0x4b67e2=ut(_0x1f481c)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4b67e2&&_0x4b67e2[0x1])return _0x4b67e2[0x1];}return null;}['_storeDeletedElementIds'](_0x4042a6){if(_0x5581e1(_0x4042a6)){const _0x5afada=ut(_0x4042a6)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x5afada&&_0x5afada[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x5afada[0x1]);}}['_getUid'](_0x1945ea){return this['_isExistingNode'](_0x1945ea)?pt(_0x1945ea,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x4936f7){(function(_0x4382c6){return _0x3bb1ba(_0x4a7d5d=>_0x5581e1(_0x4a7d5d),_0x4382c6,!0x0,0x1/0x0);}(_0x4936f7)['filter'](_0x498975=>this['_isDelNode'](_0x498975)||this['_isExistingContentComment'](_0x498975))['forEach'](_0x4bc022=>{_0x33c6d9(_0x4bc022);}));}['_markLastTagElementUnstable'](_0x130f8d){const _0x2e4ef0=_0x130f8d['childNodes'],_0x1cc900=_0x2e4ef0[_0x2e4ef0['length']-0x1];_0x1cc900&&_0x41757a(_0x1cc900)&&Qe(_0x1cc900,'data-unstable','true');}['_markUnstableElements'](_0x4ac0,_0x3b8bc7){const _0x407670=ft('data-unstable','true',_0x4ac0);if(!_0x407670)return;const _0x5be2d9=Ae(_0x407670)['slice'](0x0,-0x1),_0x5182fa=_0x5be2d9['length'];let _0x3a4a0a=_0x407670;if(_0x5182fa>_0x3b8bc7){let _0x2f45fd=_0x5182fa,_0x4c148f=null;for(;_0x2f45fd>_0x3b8bc7&&_0x2f45fd>=0x0;)_0x2f45fd--,_0x4c148f=_0x5be2d9[_0x2f45fd];_0x4c148f&&(_0x3a4a0a=_0x4c148f,Qe(_0x407670,'data-unstable',null),Qe(_0x4c148f,'data-unstable','true'));}else{if(_0x5182fa<_0x3b8bc7){let _0x4019b4=_0x5182fa,_0x1a517e=_0x407670;for(;_0x4019b4<_0x3b8bc7;){const _0x1e7505=_0x1a517e['childNodes']['filter'](_0x4aa731=>_0x41757a(_0x4aa731));if(0x0===_0x1e7505['length'])break;_0x4019b4++,_0x1a517e=_0x1e7505[_0x1e7505['length']-0x1];}_0x1a517e&&(_0x3a4a0a=_0x1a517e,Qe(_0x407670,'data-unstable',null),Qe(_0x1a517e,'data-unstable','true'));}}let _0x110721=_0x3a4a0a;for(;_0x110721;){for(;_0x110721['nextSibling'];)_0x110721=_0x110721['nextSibling'],_0x41757a(_0x110721)&&Qe(_0x110721,'data-unstable','true');_0x110721=_0x110721['parentNode'];}}['_isNewNode'](_0x363935){return Boolean('new-element'===pt(_0x363935,'data-id'));}['_isExistingNode'](_0x3ebe46){return Boolean((pt(_0x3ebe46,'data-id')||'')['length']>0x0&&'new-element'!==pt(_0x3ebe46,'data-id'));}['_isDelNode'](_0x3e0fc9){return!!_0x3e0fc9&&Boolean(_0x5581e1(_0x3e0fc9)&&ut(_0x3e0fc9)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x1a8edb){let _0x42b23d=_0x1a8edb['parentNode'];for(;_0x42b23d;){if(pt(_0x42b23d,'data-wrapped-id'))return!0x0;_0x42b23d=_0x42b23d['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x37bc88){return Boolean(_0x5581e1(_0x37bc88)&&ut(_0x37bc88)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function y({editor:_0x24a2ad,changeGroups:_0x31474f,documentContextContent:_0x3405e7,showDiff:_0x3a80a4,trimUnchanged:_0x56a39d=!0x0}){return _0x31474f['map'](_0x48d3e6=>{const _0x38bd01=new mt([]),_0x14bc6d=new mt([]);for(const _0x21ad09 of _0x48d3e6['changes'])if(_0x3a80a4&&'removed'==_0x21ad09['type']||_0x14bc6d['children']['push'](_0x21ad09['node']['cloneNode'](!0x0)),'new'!=_0x21ad09['type']&&(_0x3a80a4||'removed'!=_0x21ad09['type'])){const _0x529b3d=gt(_0x206fc7=>pt(_0x206fc7,'data-id')==_0x21ad09['id'],_0x3405e7,!0x0);_0x529b3d&&_0x38bd01['children']['push'](_0x529b3d['cloneNode'](!0x0));}const {content:_0x125b98,hasChanges:_0x26ce35}=function(_0x28750f,_0x25da10,_0x356491,_0x3dfb27,_0x15fe0a=!0x0){const _0x465226=_0x28750f['plugins']['get']('DocumentCompare'),_0x4612a4=ut(_0x25da10),_0x27952d=ut(_0x356491),_0x9e2af8=_0x28750f['data']['parse'](_0x4612a4,'$root'),_0xcde9a3=_0x28750f['model']['createPositionAt'](_0x9e2af8,0x0),_0x585e9d=_0x465226['getDiff'](_0x4612a4,_0x27952d,{'anchor':_0xcde9a3,'markDeletions':_0x3dfb27}),_0x4f897b=_0x585e9d['getOperations']();if(0x0==_0x4f897b['length'])return{'content':_0x25da10['cloneNode'](!0x0),'hasChanges':!0x1};_0x3dfb27?function(_0x238e97,_0x2e5db1,_0x5c47f8){if(0x0==_0x238e97['length'])return;const _0x3d37b9=_0x5c47f8['plugins']['get']('DocumentCompare'),_0x2785f7=_0x5c47f8['plugins']['get']('SuggestionsConversion');_0x5c47f8['model']['change'](_0x2ced09=>{const _0xd0721b=new Set();for(let _0x11bb8d=0x0;_0x11bb8d<_0x238e97['length'];_0x11bb8d++){const _0x4ad7b8=_0x238e97[_0x11bb8d];if(_0x4ad7b8['baseVersion']=null,_0x4ad7b8['isDocumentOperation']=!0x1,_0x3d37b9['isMarkedRemoveOperation'](_0x4ad7b8)){const _0x641127=_0xf3fa2c(_0x4ad7b8['newRange'],_0x5c47f8['model']),_0x202707='suggestion:deletion:'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x202707,_0x641127);}else switch(_0x4ad7b8['type']){case'rename':{if(_0x4ad7b8['oldName']==_0x4ad7b8['newName'])break;_0x2ced09['batch']['addOperation'](_0x4ad7b8),_0x5c47f8['model']['applyOperation'](_0x4ad7b8);const _0x34264a='$elementName',_0x5e9c0a=_0x4ad7b8['position'],_0x5e19cf=_0x5c47f8['model']['createRange'](_0x5e9c0a,_0x5c47f8['model']['createPositionAt'](_0x5e9c0a['nodeAfter'],'end')),_0x22a228='suggestion:attribute:'+_0x34264a+':'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x22a228,_0x5e19cf);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x4ad7b8['oldValue']==_0x4ad7b8['newValue'])break;_0x2ced09['batch']['addOperation'](_0x4ad7b8),_0x5c47f8['model']['applyOperation'](_0x4ad7b8);const _0x349975=_0x4ad7b8['key'];if(!_0x2785f7['isRegisteredAttribute'](_0x349975))break;const _0x2e94ec=_0xf3fa2c(_0x4ad7b8['range'],_0x5c47f8['model']),_0x1ee536='suggestion:attribute:'+_0x349975+':'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x1ee536,_0x2e94ec);break;}case'insert':{_0x2ced09['batch']['addOperation'](_0x4ad7b8),_0x5c47f8['model']['applyOperation'](_0x4ad7b8);if(_0x238e97[_0x11bb8d+0x1]&&'move'==_0x238e97[_0x11bb8d+0x1]['type']){ro(_0x2e5db1,_0x4ad7b8);break;}const _0x5537ed=_0x4ad7b8['position'],_0x2d9e59=_0x4ad7b8['howMany'],_0xa76c2d=_0xf3fa2c(_0x5c47f8['model']['createRange'](_0x5537ed,_0x5537ed['getShiftedBy'](_0x2d9e59)),_0x5c47f8['model']),_0x2375a9='suggestion:insertion:'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x2375a9,_0xa76c2d);break;}case'split':{_0x2ced09['batch']['addOperation'](_0x4ad7b8),_0x5c47f8['model']['applyOperation'](_0x4ad7b8);const _0x4327d2=_0x4ad7b8['splitPosition'],_0x57fe49=_0x4ad7b8['moveTargetPosition'],_0x365dff=_0x5c47f8['model']['createRange'](_0x4327d2,_0x57fe49),_0x306998='suggestion:insertion:'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x306998,_0x365dff);break;}case'move':{_0x2ced09['batch']['addOperation'](_0x4ad7b8),_0x5c47f8['model']['applyOperation'](_0x4ad7b8),_0x238e97[_0x11bb8d-0x1]&&'insert'==_0x238e97[_0x11bb8d-0x1]['type']&&ro(_0x2e5db1,_0x4ad7b8);const _0x85608e=_0x4ad7b8['getMovedRangeStart'](),_0x4a5560=_0x4ad7b8['howMany'];for(let _0x1e21c0=0x0;_0x1e21c0<_0x4a5560;_0x1e21c0++){const _0x236650=_0x85608e['getShiftedBy'](_0x1e21c0)['nodeAfter'];_0xd0721b['add'](_0x236650);}break;}case'remove':{const _0x44c724=_0x4ad7b8['sourcePosition'],_0x1bfa7e=_0x4ad7b8['howMany'],_0x1c9186=new _0x1609ec(_0x44c724,_0x1bfa7e);_0x2ced09['batch']['addOperation'](_0x1c9186),_0x5c47f8['model']['applyOperation'](_0x1c9186);break;}}}for(const _0x4a24d7 of _0xd0721b){const _0x439bf9=_0x5c47f8['model']['createRangeOn'](_0x4a24d7),_0x5c28ce='suggestion:formatBlock:$fakeWrap:'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x5c28ce,_0xf3fa2c(_0x439bf9,_0x5c47f8['model']));}});}(_0x4f897b,_0x9e2af8,_0x28750f):_0x28750f['model']['change'](_0x4c84d0=>{for(const _0x5aafa7 of _0x4f897b)if('remove'==_0x5aafa7['type']){const _0x10fe92=_0x5aafa7['sourcePosition'],_0x4e3bd3=_0x5aafa7['howMany'],_0x4f3177=new _0x1609ec(_0x10fe92,_0x4e3bd3);_0x4c84d0['batch']['addOperation'](_0x4f3177),_0x28750f['model']['applyOperation'](_0x4f3177);}else{if('marker'==_0x5aafa7['type']){const _0x5eab5e=_0x5aafa7['name'],_0x8dd74e=_0x5aafa7['newRange'];_0x9e2af8['markers']['set'](_0x5eab5e,_0x8dd74e);}else _0x5aafa7['baseVersion']=null,_0x5aafa7['isDocumentOperation']=!0x1,_0x4c84d0['batch']['addOperation'](_0x5aafa7),_0x28750f['model']['applyOperation'](_0x5aafa7);}});if(_0x15fe0a){const _0x2f2c04=lt(_0x28750f,_0x4f897b,_0x9e2af8);dt(_0x28750f['model'],_0x2f2c04),function(_0x413495,_0x4c91d4){const _0xa7aad2=_0x4c91d4['getFirstRange']()['start'];let _0x5738c6=_0x4c91d4['getFirstRange']()['end'];const _0x488b9d=_0xa7aad2['root'];(_0x5738c6['textNode']||_0x5738c6['nodeAfter']&&_0x5738c6['nodeAfter']['is']('$text'))&&(_0x5c757f(_0x5738c6,'...'),_0x5738c6=_0x5738c6['getShiftedBy'](0x3)),(_0xa7aad2['textNode']||_0xa7aad2['nodeBefore']&&_0xa7aad2['nodeBefore']['is']('$text'))&&(_0x5c757f(_0xa7aad2,'...'),function(_0x575b21,_0x16735f,_0xca4473){for(let [_0x23d1fe,_0x564877]of _0x575b21['markers']){const _0x5d6e20=_0x564877['_getTransformedByInsertion'](_0x16735f,_0xca4473,!0x1);_0x564877=_0x5d6e20[0x0],_0x575b21['markers']['set'](_0x23d1fe,_0x564877);}}(_0x488b9d,_0xa7aad2,0x3),_0xa7aad2['parent']==_0x5738c6['parent']&&(_0x5738c6=_0x5738c6['getShiftedBy'](0x3)));const _0x5b68dc=_0x413495['createRange'](_0x413495['createPositionAt'](_0x488b9d,0x0),_0xa7aad2),_0x3fe19e=_0x413495['createRange'](_0x5738c6,_0x413495['createPositionAt'](_0x488b9d,'end')),_0x554530=[..._0x5b68dc['getMinimalFlatRanges'](),..._0x3fe19e['getMinimalFlatRanges']()];_0x554530['reverse']();for(const _0x4e7225 of _0x554530)_0x41016b(_0x4e7225),Zn(_0x488b9d,_0x4e7225);}(_0x28750f['model'],_0x2f2c04);}const _0x452a89=_0x28750f['data']['stringify'](_0x9e2af8,{'showSuggestionHighlights':!0x0});return{'content':Ye(_0x452a89),'hasChanges':!0x0};}(_0x24a2ad,_0x38bd01,_0x14bc6d,_0x3a80a4,_0x56a39d);return{'type':_0x48d3e6['changes'][0x0]['type'],'index':_0x48d3e6['index'],'content':_0x125b98,'hasChanges':_0x26ce35};});}function ro(_0x265132,_0x3ae5d9){for(const [_0xc4cebf,_0x1e8db1]of _0x265132['markers']){const _0x49e46a=_0x59485f['_createFromRanges'](_0x1e8db1['getTransformedByOperation'](_0x3ae5d9));_0x265132['markers']['set'](_0xc4cebf,_0x49e46a);}}function lt(_0x4a999d,_0x46a736,_0x4835cf){const _0xc9f90e=_0x4a999d['plugins']['get']('DocumentCompare');let _0x3db96a=_0x4a999d['model']['createPositionAt'](_0x4835cf,Number['POSITIVE_INFINITY']),_0x5bcb9e=_0x4a999d['model']['createPositionAt'](_0x4835cf,0x0);for(const _0xf6d93f of _0x46a736){let _0x2da51c,_0x4704ea;if(_0xc9f90e['isMarkedRemoveOperation'](_0xf6d93f))_0x2da51c=_0xf6d93f['newRange']['start'],_0x4704ea=_0xf6d93f['newRange']['end'];else switch(_0x3db96a=_0x3db96a['getTransformedByOperation'](_0xf6d93f),_0x5bcb9e=_0x5bcb9e['getTransformedByOperation'](_0xf6d93f),_0xf6d93f['type']){case'rename':_0x2da51c=_0xf6d93f['position'],_0x4704ea=_0x2da51c['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x2da51c=_0xf6d93f['range']['start'],_0x4704ea=_0xf6d93f['range']['end'];break;case'insert':_0x2da51c=_0xf6d93f['position'],_0x4704ea=_0x2da51c['getShiftedBy'](_0xf6d93f['howMany']);break;case'split':_0x2da51c=_0xf6d93f['splitPosition'],_0x4704ea=_0xf6d93f['moveTargetPosition'];break;case'merge':{const _0x45c5b2=_0xf6d93f['targetPosition']['path']['slice'](0x0,-0x1);_0x2da51c=_0x4a999d['model']['createPositionFromPath'](_0x4835cf,_0x45c5b2),_0x4704ea=_0x2da51c['getShiftedBy'](0x1);break;}case'remove':{const _0x2af53=_0xf6d93f['howMany'],_0x4bee9b=_0xf6d93f['sourcePosition']['_getTransformedByInsertion'](_0xf6d93f['targetPosition'],_0x2af53),_0x2be519=_0xf6d93f['getMovedRangeStart']();'remove'==_0xf6d93f['type']?(_0x2da51c=_0x4bee9b,_0x4704ea=_0x4bee9b):(_0x2da51c=_0x2be519,_0x4704ea=_0x2be519['getShiftedBy'](_0x2af53));break;}}_0x2da51c&&_0x2da51c['isBefore'](_0x3db96a)&&(_0x3db96a=_0x2da51c['clone'](),_0x3db96a['stickiness']='toNone'),_0x4704ea&&_0x4704ea['isAfter'](_0x5bcb9e)&&(_0x5bcb9e=_0x4704ea['clone'](),_0x5bcb9e['stickiness']='toNone');}return _0x4a999d['model']['createSelection'](_0x4a999d['model']['createRange'](_0x3db96a,_0x5bcb9e));}function dt(_0x10b3be,_0x3da522){so(_0x10b3be,_0x3da522,'forward');const _0xa260a6=_0x3da522['getFirstRange']();_0x3da522['setTo']([]),_0x3da522['setTo'](_0xa260a6,{'backward':!0x0}),so(_0x10b3be,_0x3da522,'backward');}function so(_0x5b8dd4,_0x39f3c5,_0x480295){let _0x35f092=0x14;for(;_0x35f092;){_0x5b8dd4['modifySelection'](_0x39f3c5,{'unit':'word','direction':_0x480295}),_0x35f092--;const _0x53dbf0=_0x39f3c5['focus']['forward'==_0x480295?'nodeBefore':'nodeAfter'];if(_0x53dbf0&&_0x53dbf0['is']('element')&&_0x5b8dd4['schema']['isBlock'](_0x53dbf0)&&_0x5b8dd4['schema']['isObject'](_0x53dbf0))break;}}function Zn(_0x4e0691,_0x25d558){for(const [_0x359bd4,_0x59edde]of _0x4e0691['markers']){const _0x6fbec6=_0x59edde['_getTransformedByDeletion'](_0x25d558['start'],_0x25d558['end']['offset']-_0x25d558['start']['offset']);null!=_0x6fbec6?_0x4e0691['markers']['set'](_0x359bd4,_0x6fbec6):_0x4e0691['markers']['delete'](_0x359bd4);}}const Ur=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class de extends _0x4572ab(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new mt([]);['parsedMergedContent']=new mt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x517560,content:_0x37e398='',isDone:_0x3e57bc=!0x1,interactionId:_0x207a7b,areActionsDisabled:_0x54056e,documentContextContent:_0x19fd5b,editor:_0x1b9880,id:_0x5c3441}){super(),this['id']=_0x5c3441||_0x223274(),this['interactionId']=_0x207a7b,this['type']=_0x517560,this['areActionsDisabled']=!!_0x54056e,this['editor']=_0x1b9880,this['aiResponseParser']=new Oe(),this['aiResponseApplier']=new Ne(),this['documentContextContent']=Ye(_0x19fd5b||''),this['set']('isDone',_0x3e57bc),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x37e398);}['appendContent'](_0x12a5c0){this['set']('content',this['content']+_0x12a5c0);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x1cb6bb,_0x3bc45a){this['changeGroups'][_0x1cb6bb]['state']=_0x3bc45a,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x1cb6bb,'state':_0x3bc45a});}['getContentParts']({showDiff:_0xf4ad0e,groupIndex:_0x534eda}){if(!this['editor'])throw new _0x29f184('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x104549=this['_getCachedContentParts'](_0xf4ad0e,_0x534eda);if(_0x104549)return _0x104549;let _0x41f001=[];if(void 0x0===_0x534eda)_0x41f001=this['changeGroups'];else{const _0x1a604e=this['changeGroups']['find'](({index:_0x38b661})=>_0x38b661===_0x534eda);if(!_0x1a604e)throw new _0x29f184('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x534eda});_0x41f001=[_0x1a604e];}const _0x318426=y({'editor':this['editor'],'showDiff':_0xf4ad0e,'changeGroups':_0x41f001,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0xf4ad0e,_0x318426),_0x318426;}['_getCachedContentParts'](_0x4eb0e4,_0x30481e){const _0x4915fd=_0x4eb0e4?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x4915fd]['length'])return null;const _0x5ed114=this['cachedSuggestionContentParts'][_0x4915fd];if(void 0x0===_0x30481e)return _0x5e9a78(_0x5ed114);{const _0x3d50f1=_0x5ed114['find'](({index:_0x57700d})=>_0x57700d===_0x30481e);if(_0x3d50f1)return[_0x5e9a78(_0x3d50f1)];}return null;}['_setCachedContentParts'](_0x2e9260,_0x2f7b93){const _0x5e6de1=_0x2e9260?'withDiff':'withoutDiff';_0x2f7b93['forEach'](_0x3f100a=>{const _0x191e70=this['cachedSuggestionContentParts'][_0x5e6de1],_0x5b982d=_0x191e70['find'](({index:_0x241fbf})=>_0x241fbf===_0x3f100a['index']);if(_0x5b982d){const _0x4a907e=_0x191e70['indexOf'](_0x5b982d);_0x191e70['splice'](_0x4a907e,0x1,_0x3f100a);}else _0x191e70['push'](_0x3f100a);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x47bb13=this['changeGroups'];this['updateChangeGroups']();const _0x325679=this['_getDifferentChangeGroups'](_0x47bb13,this['changeGroups']);(_0x325679['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x325679),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x299a4c,_0xef219){const _0x4571a5=[];for(const _0x5eed2d of _0xef219){const _0x1c506c=_0x299a4c[_0x5eed2d['index']];_0x1c506c?_0x1c506c['changes']['length']!==_0x5eed2d['changes']['length']?_0x4571a5['push'](_0x5eed2d):_0x1c506c['changes']['forEach']((_0x14ce42,_0x2dbbc4)=>{const _0x124523=_0x5eed2d['changes'][_0x2dbbc4];_0x14ce42['id']!==_0x124523['id']&&_0x4571a5['push'](_0x5eed2d);}):_0x4571a5['push'](_0x5eed2d);}return _0x4571a5;}['updateChangeGroups'](){const _0x8aa3aa=new _0x2c5bc4('p',{},[new _0x2c5bc4('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x2e2b16(C(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x145e6e=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x8aa3aa,'cutAfterLastChange':!this['isDone']});if(!_0x145e6e['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x145e6e['parsedContent'];let _0xc1627a=[];if(_0x23a287(_0x388c15=>{const _0xfa379f=pt(_0x388c15,'data-id');if(!_0xfa379f||!_0x3ccbce(_0xfa379f))return!0x1;const _0x4d0447=[_0x388c15,...Ae(_0x388c15)]['at'](-0x2);if(_0x388c15!=_0x4d0447){const _0x100da2=pt(_0x4d0447,'data-id');_0x3ccbce(_0x100da2)||(_0xc1627a['push']({'node':_0x4d0447,'id':_0x100da2,'type':'modified'}),_0x145e6e['modifiedNodeIds']['push'](_0x100da2));}else _0x145e6e['modifiedNodeIds']['includes'](_0xfa379f)?_0xc1627a['push']({'node':_0x388c15,'type':'modified','id':_0xfa379f}):_0x145e6e['newNodeIds']['includes'](_0xfa379f)?_0xc1627a['push']({'node':_0x388c15,'type':'new','id':_0xfa379f,'anchorId':pt(_0x388c15['previousSibling'],'data-id')}):_0xc1627a['push']({'node':_0x388c15,'type':'removed','id':_0xfa379f});return!0x0;},this['parsedMergedContent']),_0xc1627a=_0xc1627a['filter'](({node:_0xc739b5})=>[...Ae(_0xc739b5),_0xc739b5]['every'](_0x49a958=>!pt(_0x49a958,'data-unstable'))),0x0==_0xc1627a['length'])return;const _0x37f52e=[[_0xc1627a[0x0]]];for(let _0x1b250d=0x1;_0x1b250d<_0xc1627a['length'];_0x1b250d++){const _0x12f186=_0x37f52e[_0x37f52e['length']-0x1],_0x36f95f=_0x12f186[_0x12f186['length']-0x1];_0xc1627a[_0x1b250d]['node']['previousSibling']==_0x36f95f['node']&&'modified'!=_0xc1627a[_0x1b250d]['type']&&'modified'!=_0x36f95f['type']?_0x12f186['push'](_0xc1627a[_0x1b250d]):_0x37f52e['push']([_0xc1627a[_0x1b250d]]);}for(const _0x1ae02d of _0x37f52e){const _0x3f189c=_0x1ae02d[0x0],_0x30a61c=_0x1ae02d[_0x1ae02d['length']-0x1],_0x353f4f=_0x24a957(_0x3f189c['node']['previousSibling']);_0x353f4f&&_0x1ae02d['unshift'](_0x353f4f);const _0x5b3767=_0x24a957(_0x30a61c['node']['nextSibling']);_0x5b3767&&_0x1ae02d['push'](_0x5b3767);}function _0x3ccbce(_0x8f06f2){return _0x145e6e['modifiedNodeIds']['includes'](_0x8f06f2)||_0x145e6e['newNodeIds']['includes'](_0x8f06f2)||_0x145e6e['removedNodeIds']['includes'](_0x8f06f2);}function _0x24a957(_0x505195){if(_0x505195&&pt(_0x505195,'data-id')&&!pt(_0x505195,'data-unstable')){const _0x24ae94=pt(_0x505195,'data-id');if(!_0x3ccbce(_0x24ae94))return{'node':_0x505195,'type':'context','id':_0x24ae94};}return null;}this['changeGroups']=_0x37f52e['map']((_0x1305fc,_0xc2c37f)=>({'changes':_0x1305fc,'state':'pending','index':_0xc2c37f}));}}function $i(_0x48358f){return Object['values'](Ur)['includes'](_0x48358f);}function Zi(_0x411e59){return Wr['includes'](_0x411e59);}function Ee(_0x407811){return'conversation-title'===_0x407811;}function Fe(_0x5efebc){return'source'===_0x5efebc;}const Vt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class Jt extends _0x135bec(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x2bd4c6,editor:_0x16ecbe}){super(),this['id']=_0x223274(),this['connector']=_0x2bd4c6,this['isStopped']=!0x0,this['editor']=_0x16ecbe;}async['start'](){let _0x142fa5;const _0x4356f7=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x482328=await this['currentRequest']['getStream']();for await(const _0x2091a9 of _0x482328){if(this['isStopped'])return;if('error'===_0x2091a9['event'])return void this['fire']('error',{'error':new _0x29f184('ai-chat-interaction-error',this)});if('message-metadata'!==_0x2091a9['event']){if('action-metadata'!==_0x2091a9['event']){if(Ee(_0x2091a9['event'])&&this['setConversationTitle'](_0x2091a9['data']['conversationTitle'],!0x0),Fe(_0x2091a9['event']))_0x4356f7['push'](_0x2091a9['data']['source']);else{if($i(_0x2091a9['event'])){if(_0x2091a9['event']!==_0x142fa5){if(_0x142fa5=_0x2091a9['event'],'web-search'===_0x2091a9['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x2091a9['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x2091a9['event'],'interactionId':this['id'],'id':_0x2091a9['data']?.['id']}),_0x4356f7['length']>0x0&&'modification-delta'===_0x2091a9['event']&&(this['currentReply']['sources']=_0x4356f7['splice'](0x0));}_0x2091a9['data']['textDelta']&&this['currentReply']['appendContent'](_0x2091a9['data']['textDelta']);}else Zi(_0x2091a9['event'])||_0xadd6c3('ai-interaction-invalid-event-type',{'chunk':_0x2091a9});}}else this['actionCallId']=_0x2091a9['data']['callId'];}else this['messageId']=_0x2091a9['data']['messageId'];}}finally{this['isStopped']||(_0x4356f7['length']>0x0&&(this['currentReply']['sources']=_0x4356f7['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x2ab42b){return this['replies']['find'](_0x59cc4b=>_0x59cc4b['id']===_0x2ab42b);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x5e2872=>_0x5e2872['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x367fa2){const _0x44c6ba=new de({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x367fa2});return this['replies']['push'](_0x44c6ba),_0x44c6ba['delegate'](...Vt)['to'](this),this['fire']('replyCreated',_0x44c6ba),_0x44c6ba;}['setConversationTitle'](_0x2d8737,_0x3280c3=!0x1){this['fire']('setConversationTitle',_0x2d8737,_0x3280c3);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Xt=function(_0x258123){return _0x258123['FILE']='file',_0x258123['DOCUMENT']='document',_0x258123['URL']='web-resource',_0x258123['TEXT']='text',_0x258123['SELECTION']='selection',_0x258123;}({}),Ie=function(_0x43d9f4){return _0x43d9f4['TEXT']='text',_0x43d9f4['MARKDOWN']='markdown',_0x43d9f4['HTML']='html',_0x43d9f4;}({});const xi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ci extends _0x4572ab(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x4e2976,config:_0x22e83d,ownerId:_0x2fb14e}){super(),this['_connector']=_0x4e2976,this['_config']=_0x22e83d,this['_ownerId']=_0x2fb14e;}['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'](_0xdb5f4){const _0x98706a=await this['_createContextItemFromContent'](_0xdb5f4);return this['_addToConversationContextItem'](_0x98706a),'current-document'===_0x98706a['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x98706a;}async['_createContextItemFromContent'](_0xedfb00){if(_0xedfb00['type']===Xt['DOCUMENT']){const _0x104da=await this['_connector']['fetchDocument'](this['_ownerId'],_0xedfb00['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0xedfb00['type'],'content':_0x104da['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x104da['attributes']?.['version'],'sessionId':_0x104da['attributes']?.['sessionId']};}return{'id':_0xedfb00['id'],'uiId':_0xedfb00['id'],'label':_0xedfb00['attributes']?.['label']||_0xedfb00['name']||_0xedfb00['url']||_0xedfb00['id'],'type':_0xedfb00['type'],..._0xedfb00?.['attributes']?.['resourceId']?{'resourceId':_0xedfb00['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0xa69160){const _0x27a29f=this['_pendingContextItems']['get'](_0xa69160);_0x27a29f?.['isReadOnly']||this['_removeContextItem'](_0xa69160);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x538074 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x538074['uiId']);const _0x1b6b1d=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x1b6b1d&&this['_addContextItem']({..._0x1b6b1d,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x11061b){for(const _0x52f7f0 of _0x11061b['values']())this['_addToConversationContextItem'](_0x52f7f0);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'](_0x32446f){return Array['from'](_0x32446f['values']())['map'](_0x497246=>this['_mapContextItemToRequestData'](_0x497246))['filter'](_0x5d3919=>null!==_0x5d3919);}async['addFilesToContext'](_0x599ec4,_0x3717e8,_0x1eb8c7=Xt['FILE']){const _0x2e0911='files-'+_0x223274();this['_startUploadOperation'](_0x2e0911);try{await Promise['all'](_0x599ec4['map'](async _0x3ea413=>{const _0x23e974='file-'+_0x223274(),_0x237289=_0x4e9308(_0x3ea413['name']);try{this['_addContextItem']({'type':_0x1eb8c7,'label':_0x3717e8?.['label']||_0x237289,'uiId':_0x23e974,'resourceId':_0x3717e8?.['resourceId']},!0x0);const _0x50c837=this['_connector']['uploadFile'](this['_ownerId'],_0x3ea413,_0x3717e8);this['_ongoingUploads']['set'](_0x23e974,_0x50c837['abortController']);const {id:_0xcd1980}=await _0x50c837['getId']();this['_ongoingUploads']['delete'](_0x23e974),this['_finishContextItemLoading']({'type':_0x1eb8c7,'id':_0xcd1980,'label':_0x3717e8?.['label']||_0x237289,'uiId':_0x23e974,'resourceId':_0x3717e8?.['resourceId']},!0x1);}catch(_0x27dce0){this['_ongoingUploads']['delete'](_0x23e974);if(!_0x27dce0['message']['startsWith']('ai-request-aborted')){const _0x27301d=new _0x29f184('ai-chat-file-upload-failed',null,{'fileName':_0x237289});_0x27301d['stack']=_0x27dce0['stack'],this['fire']('error',{'error':_0x27301d,'fileName':_0x237289});}this['_removeContextItem'](_0x23e974);}}));}finally{this['_finishUploadOperation'](_0x2e0911);}}['addCurrentDocumentToContext'](_0x1bc6fd){if(this['isCurrentDocumentInContext']())return;const _0x78d30f={'type':Xt['DOCUMENT'],'uiId':'current-document','label':_0x1bc6fd,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x78d30f);}async['updateCurrentDocument'](_0x35c8cc,_0x941b5f,_0x4d2251,_0x20affb){const _0x4e637c=this['_pendingContextItems']['get']('current-document');if(_0x4e637c&&_0x35c8cc){_0x4e637c['selection']=_0x20affb?_0x20affb['map'](_0x438efc=>({'start':_0x438efc['start'],'end':_0x438efc['end']})):[];try{if(_0x4e637c['version']===_0x941b5f)return;const {id:_0x59d296}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x35c8cc,{'version':_0x941b5f,'sessionId':_0x4d2251})['getId']();_0x4e637c['id']=_0x59d296,_0x4e637c['content']=_0x35c8cc,_0x4e637c['version']=_0x941b5f,_0x4e637c['sessionId']=_0x4d2251;}catch(_0x352df4){const _0x8b99ee=new _0x29f184('ai-chat-document-upload-failed',null);_0x8b99ee['stack']=_0x352df4['stack'],this['fire']('error',{'error':_0x8b99ee});}}}['addSelectionToContext'](_0x23b645){this['_addContextItem']({'type':Xt['SELECTION'],'label':_0x23b645,'uiId':'selection','content':_0x23b645});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x35f491,_0x3abee4){const _0x577cf8='url-'+_0x223274();this['_startUploadOperation'](_0x577cf8);const _0x642bf7='url-'+_0x223274();try{this['_addContextItem']({'type':Xt['URL'],'label':_0x3abee4?.['label']||_0x35f491,'uiId':_0x642bf7,'resourceId':_0x3abee4?.['resourceId']},!0x0);const _0x2d29fb=this['_connector']['uploadUrl'](this['_ownerId'],_0x35f491,_0x3abee4);this['_ongoingUploads']['set'](_0x642bf7,_0x2d29fb['abortController']);const {id:_0x46fa48}=await _0x2d29fb['getId']();this['_ongoingUploads']['delete'](_0x642bf7),this['_finishContextItemLoading']({'type':Xt['URL'],'id':_0x46fa48,'label':_0x3abee4?.['label']||_0x35f491,'uiId':_0x642bf7,'resourceId':_0x3abee4?.['resourceId']},!0x1);}catch(_0x1914ba){this['_ongoingUploads']['delete'](_0x642bf7),(_0x1914ba['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x29f184('ai-chat-url-upload-failed',this,{'url':_0x35f491,'originalError':_0x1914ba}),'url':_0x35f491}),this['_removeContextItem'](_0x642bf7));}finally{this['_finishUploadOperation'](_0x577cf8);}}async['loadSourceResources'](_0xf31d8a,_0x4933f1,_0x28e7c7){const _0x575567=this['_addContextOptionsState']['sources']['find'](_0x23159b=>_0x23159b['id']===_0xf31d8a);if(!_0x575567)return this['fire']('error',{'error':new _0x29f184('ai-chat-source-not-found',this,{'sourceId':_0xf31d8a}),'sourceId':_0xf31d8a}),[];try{const _0x5db05e=(await _0x575567['getResources'](_0x4933f1))['map'](_0x2ece56=>{const _0x4e14e8=this['_isResourceInContext'](_0x2ece56['id']);return{..._0x2ece56,'isInContext':_0x4e14e8};});return _0x575567['resources']=_0x5db05e,this['fire']('sourceResourcesLoaded',{'sourceId':_0xf31d8a,'source':_0x575567,'resources':_0x5db05e,'uid':_0x28e7c7}),_0x5db05e;}catch(_0x306d95){return this['fire']('error',{'error':new _0x29f184('ai-chat-source-resources-load-failed',this,{'sourceId':_0xf31d8a,'originalError':_0x306d95}),'sourceId':_0xf31d8a,'sourceLabel':_0x575567['label']}),[];}}async['addResourceToContext'](_0x27673c,_0x69167a){if(this['_isResourceInContext'](_0x69167a['id']))return;let _0x5424da=_0x69167a['data'];if(!_0x5424da&&_0x27673c['getData'])try{_0x5424da=await _0x27673c['getData'](_0x69167a['id']);}catch(_0x4cc727){return void this['fire']('error',{'error':new _0x29f184('ai-chat-resource-load-failed',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id'],'originalError':_0x4cc727}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});}if(_0x5424da)switch(_0x69167a['type']){case Xt['URL']:if('string'!=typeof _0x5424da)return void this['fire']('error',{'error':new _0x29f184('ai-chat-context-invalid-data',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id'],'expectedType':'string','actualType':typeof _0x5424da}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});await this['addUrlToContext'](_0x5424da,{'label':_0x69167a['label'],'resourceId':_0x69167a['id']});break;case Xt['FILE']:if(!(_0x5424da instanceof File))return void this['fire']('error',{'error':new _0x29f184('ai-chat-context-invalid-data',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id'],'expectedType':'File','actualType':typeof _0x5424da}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});await this['addFilesToContext']([_0x5424da],{'label':_0x69167a['label'],'resourceId':_0x69167a['id']});break;case Xt['TEXT']:if('object'!=typeof _0x5424da||!('content'in _0x5424da)||!('type'in _0x5424da))return void this['fire']('error',{'error':new _0x29f184('ai-chat-context-invalid-data',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x5424da}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});_0x5424da=Ci['_convertTextResourceToFile'](_0x5424da,_0x69167a['label']),await this['addFilesToContext']([_0x5424da],{'label':_0x69167a['label'],'resourceId':_0x69167a['id']},Xt['TEXT']);break;default:this['fire']('error',{'error':new _0x29f184('ai-chat-context-unsupported-type',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id'],'resourceType':_0x69167a['type']}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});}else this['fire']('error',{'error':new _0x29f184('ai-chat-resource-no-data',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});}static['_convertTextResourceToFile'](_0x16ea10,_0x20ef49){switch(_0x16ea10['type']){case Ie['MARKDOWN']:return new File([_0x16ea10['content']],_0x20ef49,{'type':'text/markdown'});case Ie['HTML']:return new File([_0x16ea10['content']],_0x20ef49,{'type':'text/html'});default:return new File([_0x16ea10['content']],_0x20ef49,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x35bd43){switch(_0x35bd43['type']){case Xt['FILE']:return{'type':Xt['FILE'],'id':_0x35bd43['id']};case Xt['URL']:return{'type':Xt['URL'],'id':_0x35bd43['id']};case Xt['DOCUMENT']:return{'type':Xt['DOCUMENT'],'id':_0x35bd43['id'],..._0x35bd43['selection']?.['length']&&{'selection':_0x35bd43['selection']}};case Xt['TEXT']:return{'type':Xt['FILE'],'id':_0x35bd43['id']};default:return null;}}['_addContextItem'](_0x18c739,_0x4cfcd1=!0x1){if(this['_pendingContextItems']['set'](_0x18c739['uiId'],_0x18c739),_0x18c739['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x18c739,'isLoading':_0x4cfcd1}),'current-document'===_0x18c739['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x18c739['resourceId']){const _0x35bcc6=this['_findSourceIdsByResourceId'](_0x18c739['resourceId']);_0x35bcc6&&_0x35bcc6['forEach'](_0x3ae0b3=>{this['_updateResourceInContextState'](_0x3ae0b3,_0x18c739['resourceId'],!0x0);});}}['_removeContextItem'](_0x29625f){const _0x5c84f1=this['_pendingContextItems']['get'](_0x29625f),_0x51a5a5=this['_ongoingUploads']['get'](_0x29625f);if(_0x51a5a5&&(_0x51a5a5['abort'](),this['_ongoingUploads']['delete'](_0x29625f)),_0x5c84f1?.['resourceId']){const _0x10b738=this['_findSourceIdsByResourceId'](_0x5c84f1['resourceId']);_0x10b738&&_0x10b738['forEach'](_0x2f82a0=>{this['_updateResourceInContextState'](_0x2f82a0,_0x5c84f1['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x29625f),this['fire']('contextItemRemoved',{'uiId':_0x29625f,'type':_0x5c84f1?.['type']}),'current-document'===_0x29625f&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x2b1cd7,_0x1f297e){if(this['_pendingContextItems']['has'](_0x2b1cd7['uiId'])&&(this['_pendingContextItems']['set'](_0x2b1cd7['uiId'],_0x2b1cd7),this['fire']('contextItemLoadingEnded',{'contextItem':_0x2b1cd7,'isLoading':_0x1f297e}),_0x2b1cd7['resourceId'])){const _0x4cfc7b=this['_findSourceIdsByResourceId'](_0x2b1cd7['resourceId']);_0x4cfc7b&&_0x4cfc7b['forEach'](_0x273344=>{this['_updateResourceInContextState'](_0x273344,_0x2b1cd7['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x4b1276){this['_conversationContextItems']['set'](_0x4b1276['uiId'],_0x4b1276);}['_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']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x1dcad7=>({..._0x1dcad7,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x165d7e=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x165d7e,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x228802){for(const _0x653dda of this['_pendingContextItems']['values']())if(_0x653dda['resourceId']===_0x228802)return!0x0;for(const _0x4f53e7 of this['_conversationContextItems']['values']())if(_0x4f53e7['resourceId']===_0x228802)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x3a5964){const _0x4b396a=[];for(const _0x66861b of this['_addContextOptionsState']['sources']){_0x66861b['resources']['find'](_0x44463e=>_0x44463e['id']===_0x3a5964)&&_0x4b396a['push'](_0x66861b['id']);}return 0x0===_0x4b396a['length']?null:_0x4b396a;}['_updateResourceInContextState'](_0x26b6ad,_0x17cfc7,_0x1d675b){const _0x42fa6f=this['_addContextOptionsState']['sources']['find'](_0x56e0df=>_0x56e0df['id']===_0x26b6ad);if(!_0x42fa6f)return;const _0x405383=_0x42fa6f['resources']['find'](_0x4acda5=>_0x4acda5['id']===_0x17cfc7);_0x405383&&(_0x405383['isInContext']=_0x1d675b,this['fire']('resourceStateChanged',{'sourceId':_0x26b6ad,'resourceId':_0x17cfc7,'isInContext':_0x1d675b}));}['_startUploadOperation'](_0x46727e){this['_ongoingUploadOperations']['set'](_0x46727e,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x1d55b0){this['_ongoingUploadOperations']['delete'](_0x1d55b0),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Mi=['capabilitiesUpdated'];class Di extends _0x135bec(){['_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'](_0x40e2e4){const _0x208e5e={};return _0x40e2e4&&_0x40e2e4['isWebSearchEnabled']&&(_0x208e5e['webSearch']={}),_0x40e2e4&&_0x40e2e4['isReasoningEnabled']&&(_0x208e5e['reasoning']={}),_0x208e5e;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0xab7bdc){_0xab7bdc!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0xab7bdc,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x403803){_0x403803!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x403803,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Si extends Jt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x2e71fc){super(_0x2e71fc),this['conversationId']=_0x2e71fc['conversationId'],this['contextItems']=_0x2e71fc['contextItems'],this['capabilities']=_0x2e71fc['capabilities'],this['userMessage']=_0x2e71fc['userMessage'],this['model']=_0x2e71fc['model'],this['quickActionData']=_0x2e71fc['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ci['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Di['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class nt extends _0x135bec(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x2c0d81){super(),this['options']=_0x2c0d81,this['connector']=_0x2c0d81['connector'],this['chatModels']=_0x2c0d81['chatModels'],this['id']=_0x2c0d81['conversationId'];}async['init'](_0xd8158e){try{this['chatContext']=new Ci({'connector':this['connector'],'config':_0xd8158e,'ownerId':this['id']}),this['chatContext']['delegate'](...xi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Di(),this['chatCapabilities']['delegate'](...Mi)['to'](this),this['chatCapabilities']['init']();const _0x58510b=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x58510b});const _0x3d0bea=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x3d0bea&&await this['setModel'](_0x3d0bea);}catch(_0x296481){const _0x32b936=new _0x29f184('ai-chat-conversation-init-failed',null,{'message':_0x296481['message']});_0x32b936['stack']=_0x296481['stack'],this['fire']('error',{'error':_0x32b936});}}async['start'](){if(this['isStarted'])throw new _0x29f184('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x29f184('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x2cd1a7}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x2cd1a7,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x3b4398){const _0x1e7ea2=new _0x29f184('ai-chat-conversation-start-failed',null,{'message':_0x3b4398['message']});_0x1e7ea2['stack']=_0x3b4398['stack'],this['fire']('error',{'error':_0x1e7ea2});}}async['load'](_0x3146b5,_0x116f43){try{const _0x1047a6=await this['connector']['fetchConversation'](_0x3146b5)['getConversation'](),_0xe5047b=await this['connector']['fetchConversationMessages'](_0x3146b5)['getMessages'](),_0xfef690=_0xe5047b[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x1047a6['id'],'title'in _0x1047a6?this['fire']('setConversationTitle',_0x1047a6['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x124c4c=(await this['chatModels']['getAll']())['find'](_0x303807=>_0x303807['id']['toLowerCase']()===_0xfef690['toLowerCase']());return this['selectedModel']=_0x124c4c,this['fire']('modelSelected',{'selectedModel':_0x124c4c,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xe5047b,_0x116f43,_0xfef690),this['currentInteraction']=void 0x0,this;}catch(_0xe2206f){const _0x3ad55f=new _0x29f184('ai-chat-conversation-init-from-id-failed',null,{'message':_0xe2206f['message'],'conversationId':_0x3146b5});throw _0x3ad55f['stack']=_0xe2206f['stack'],this['fire']('error',{'error':_0x3ad55f}),_0x3ad55f;}}async['_processMessagesToInteractions'](_0x31495a,_0x42ae9b,_0x18f6ea){let _0x3ed384;for(const _0x8d4e8a of _0x31495a)if('user'===_0x8d4e8a['role']){const _0x222ef7=await this['_extractContextItems'](_0x8d4e8a),_0x37cc7b={'isReasoningEnabled':Object['hasOwn'](_0x8d4e8a['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x8d4e8a['capabilities'],'webSearch')};_0x3ed384=this['createInteraction']({'userMessage':_0x8d4e8a['prompt'],'contextItems':_0x222ef7,'capabilities':_0x37cc7b,'modelId':_0x18f6ea,'quickActionData':_0x8d4e8a['attributes']?.['quickActionData']}),this['currentInteraction']=_0x3ed384,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x8d4e8a['role']&&_0x3ed384)for(const _0x23a38e of _0x8d4e8a['content']){const _0x2632b3='text'===_0x23a38e['type']?'text-delta':'modification-delta',_0x23c768=_0x3ed384['getDocumentContext']()?.['sessionId']!==_0x42ae9b;_0x3ed384['currentReply']=_0x3ed384['createReply']({'type':_0x2632b3,'isDone':!0x0,'interactionId':_0x3ed384['id'],'areActionsDisabled':_0x23c768}),_0x3ed384['currentReply']['appendContent'](_0x23a38e['content']);}}}async['_extractContextItems'](_0x26c9ba){const _0x5df8fe=new Map();if(!_0x26c9ba['content'])return _0x5df8fe;for(const _0xf70e61 of _0x26c9ba['content']){const _0x52e093=await this['chatContext']['populateFromMessage'](_0xf70e61);_0x52e093&&_0x5df8fe['set'](_0x52e093['id'],_0x52e093);}return _0x5df8fe;}async['handleUserInteraction']({userMessage:_0x266c2a,quickActionData:_0x13dabc}){if(!this['isStarted'])throw new _0x29f184('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x29f184('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x2e9427=this['chatContext']['getPendingContextItems'](),_0x248a12=this['chatCapabilities']['getCapabilitiesConfig'](),_0x514142=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x266c2a,'contextItems':_0x2e9427,'capabilities':_0x248a12,'modelId':_0x514142,'quickActionData':_0x13dabc}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0xdb8d22){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0xdb8d22});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x10b899,contextItems:_0x3448d3,capabilities:_0x38f3eb,modelId:_0x5e64c2,quickActionData:_0x5e6441}){const _0x1d3dcc=new Si({'userMessage':_0x10b899,'contextItems':_0x3448d3,'capabilities':_0x38f3eb,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x5e64c2,'quickActionData':_0x5e6441});return _0x1d3dcc['delegate'](...Vt)['to'](this),this['interactions']['push'](_0x1d3dcc),this['fire']('interactionCreated',_0x1d3dcc),_0x1d3dcc;}['getInteraction'](_0x33d852){return this['interactions']['find'](_0x26f0cd=>_0x26f0cd['id']===_0x33d852);}['removeInteraction'](_0x418569){const _0x29c3be=this['getInteraction'](_0x418569);_0x29c3be&&(_0x29c3be['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x29c3be),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x5f41c6){this['chatContext']['addCurrentDocumentToContext'](_0x5f41c6);}async['updateCurrentDocumentInContext']({content:_0x537781,version:_0x52ab69,sessionId:_0x365678,selections:_0xba3522}){await this['chatContext']['updateCurrentDocument'](_0x537781,_0x52ab69,_0x365678,_0xba3522);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x377ff5){this['chatContext']['addSelectionToContext'](_0x377ff5);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x248a8e){this['chatContext']['addFilesToContext'](_0x248a8e);}['addUrlToContext'](_0x4b3197){this['chatContext']['addUrlToContext'](_0x4b3197);}['addResourceToContext'](_0x92a8fb,_0x9f8ee1){this['chatContext']['addResourceToContext'](_0x92a8fb,_0x9f8ee1);}['loadSourceResources'](_0xf3991a,_0x1ca647,_0x2a6edd){return this['chatContext']['loadSourceResources'](_0xf3991a,_0x1ca647,_0x2a6edd);}['removeFromContext'](_0xc1e4e7){this['chatContext']['removeFromContext'](_0xc1e4e7);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x952157){_0x952157?!0x1===await this['chatModels']['isAvailable'](_0x952157)&&(_0xadd6c3('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x952157}),_0x952157=(await this['chatModels']['getAvailableModels']())[0x0]):(_0xadd6c3('ai-chat-conversation-set-model-null',{'conversation':this}),_0x952157=(await this['chatModels']['getAvailableModels']())[0x0]),_0x952157['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x952157,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x952157}));}}function P(_0x6cd75c){if(_0x6cd75c instanceof st)return _0x6cd75c;if(_0x6cd75c?.['editors']&&_0x6cd75c['editors']['get'](0x0))return _0x6cd75c['editors']['length']>0x1&&console['warn']('AIChat:\x20Multiple\x20editor\x20instances\x20detected.\x20Only\x20the\x20first\x20editor\x20instance\x20will\x20be\x20used\x20for\x20AI\x20operations.\x20This\x20configuration\x20is\x20not\x20fully\x20supported\x20and\x20may\x20lead\x20to\x20unexpected\x20behavior.'),_0x6cd75c['editors']['get'](0x0);throw new _0x29f184('ai-get-editor-from-context-no-editor');}const rt='ai-selection';class c extends _0x171820{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x30e6c1=P(this['context']),_0x405781=_0x30e6c1['plugins']['has']('RealTimeCollaborationClient')&&_0x30e6c1['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x405781||_0x223274();}return this['_sessionId'];}['getDocumentData'](){const _0x4b15a8=P(this['context']),_0x44dbe3=_0x4b15a8['model'],_0x3e3be3=_0x4b15a8['data']['toView'](_0x44dbe3['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x53b317=new kt(_0x4b15a8['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x3e3be3,_0x53b317);let _0x3a3c93=_0x4b15a8['data']['processor']['toData'](_0x3e3be3);const _0xf09f4e=this['_getMarkersInDocumentOrder'](),_0x108596=[];for(const _0x13a14b of _0xf09f4e){const _0x5bc2e1='<'+_0x13a14b['name']+':start></'+_0x13a14b['name']+':start>',_0x46427c=_0x3a3c93['indexOf'](_0x5bc2e1);_0x3a3c93=_0x3a3c93['substring'](0x0,_0x46427c)+_0x3a3c93['substring'](_0x46427c+_0x5bc2e1['length']);const _0x57ce82='<'+_0x13a14b['name']+':end></'+_0x13a14b['name']+':end>',_0x6137d5=_0x3a3c93['indexOf'](_0x57ce82);_0x3a3c93=_0x3a3c93['substring'](0x0,_0x6137d5)+_0x3a3c93['substring'](_0x6137d5+_0x57ce82['length']),_0x108596['push']({'markerName':_0x13a14b['name'],'start':_0x46427c,'end':_0x6137d5,'htmlFragment':_0x3a3c93['substring'](_0x46427c,_0x6137d5)});}return{'content':_0x3a3c93,'version':_0x4b15a8['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x108596};}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x7cbdd0,_0x4a2ed3)=>{_0x4a2ed3['on']('ready',()=>{this['_integrateEditor'](_0x4a2ed3);});});}['_integrateEditor'](_0x24b2e2){_0x24b2e2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':rt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x24b2e2['conversion']['for']('dataDowncast')['markerToElement']({'model':rt,'view':(_0x28649b,{writer:_0x4839f7,options:_0x4f6bc2})=>_0x4f6bc2['convertAiChatSelectionMarker']?_0x4839f7['createUIElement'](_0x28649b['markerName']+':'+(_0x28649b['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1a27e5,_0x33c5ed,_0x1957d8=!0x1,_0xe9002a=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0xe9002a)return!0x1;const _0x38201b=P(this['context'])['model'];return _0x38201b['change'](_0x2b3691=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x33c5ed,this['_displayedFakeSelectionLocked']=_0x1957d8;let _0x3bbd57=0x0;for(let _0x56b718 of _0x1a27e5){const _0x202dba=rt+':'+_0x3bbd57;if(_0x56b718['start']['isAtEnd']){const _0x1ed6a7=_0x56b718['start']['getLastMatchingPosition'](({item:_0x2505e9})=>!_0x38201b['schema']['isContent'](_0x2505e9),{'boundaries':_0x56b718});_0x56b718=_0x2b3691['createRange'](_0x1ed6a7,_0x56b718['end']);}_0x2b3691['addMarker'](_0x202dba,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x56b718}),_0x3bbd57++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x20a83f){if(this['_displayedFakeSelectionId']!=_0x20a83f)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x4d61bb=P(this['context']),_0x466825=_0x4d61bb['model']['markers']['getMarkersGroup'](rt);return _0x4d61bb['model']['change'](_0x391918=>{for(const _0x1105a8 of _0x466825)_0x391918['removeMarker'](_0x1105a8);}),!0x0;}['modelToViewWithIds'](_0x572abe){const _0xd77f0b=P(this['context']),_0x4fea0c=_0xd77f0b['data']['toView'](_0x572abe),_0x34f24a=new kt(_0xd77f0b['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x4fea0c,_0x34f24a),_0x4fea0c;}['_setDataIdsOnChildren'](_0xbd64f5,_0x1f5f0f){let _0x14e39d=!0x1;const _0x25cf6c=new Set();for(const _0x245a29 of _0xbd64f5['getChildren']()){const _0x4b1b99=_0x245a29['is']('emptyElement')||_0x245a29['is']('containerElement');if(!_0x245a29['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x245a29,_0x1f5f0f)||_0x4b1b99)&&(_0x1f5f0f['setAttribute']('data-id',this['_nextDataId'](_0x25cf6c),_0x245a29),_0x14e39d=!0x0);}return _0x14e39d;}['_nextDataId'](_0x23ff43){let _0x32ef94;do{_0x32ef94='';for(let _0x308abc=0x0;_0x308abc<0x4;_0x308abc++)_0x32ef94+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x23ff43['has'](_0x32ef94));return _0x23ff43['add'](_0x32ef94),_0x32ef94;}['getSelectionText'](){const {model:_0x488f55}=P(this['context']),_0x4624ae=_0x488f55['document']['selection'],_0x22b37d=_0x488f55['getSelectedContent'](_0x4624ae),_0x48f446=[],_0x137b96=_0x488f55['createRangeIn'](_0x22b37d)['getWalker']();for(const {item:_0x5963b3}of _0x137b96)_0x5963b3['is']('$textProxy')?_0x48f446['push'](_0x5963b3['data']):_0x5963b3['is']('element')&&_0x48f446['length']>0x0&&'\x20'!==_0x48f446[_0x48f446['length']-0x1]&&_0x48f446['push']('\x20');return'\x22'+_0x48f446['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x46174c=P(this['context'])['model'];return Array['from'](_0x46174c['markers']['getMarkersGroup'](rt))['sort']((_0x56b862,_0x2cb29f)=>_0x56b862['getStart']()['isBefore'](_0x2cb29f['getStart']())?-0x1:_0x56b862['getStart']()['isAfter'](_0x2cb29f['getStart']())?0x1:0x0);}}const k=['applySuggestion','insertSuggestion','showChangeInText'];class nh extends _0x19a8c6{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x1db654,_0x37daf7){super(_0x1db654),this['_dropdownOriginalConfig']=_0x37daf7||[...k],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x237c40=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x3cd526({'label':Hn('applySuggestion',_0x1db654,this['_partsCount']),'icon':_0x547952,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x3cd526({'label':Hn('showChangeInText',_0x1db654,this['_partsCount']),'icon':_0x13603c,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x3cd526({'label':Hn('insertSuggestion',_0x1db654,this['_partsCount']),'icon':_0x4c5817,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x1db654),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x237c40['if']('isVisible','ck-hidden',_0x3c42d7=>!_0x3c42d7)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x353cb6=>'applySuggestion'!==_0x353cb6):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x1db654);});}['_updateDropdownActions'](_0x490612){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x490612),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x2c08ac){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0xf81ae8=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x2c08ac):this['_createActionsDropdown'](_0x2c08ac),_0xe84bed=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0xf81ae8['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x2c08ac,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x2c08ac,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0xe84bed});for(const _0x4002e1 of this['_dropdownCurrentConfig'])_0xf81ae8['on'](_0x4002e1,()=>{this['fire'](_0x4002e1);});return this['_firstRender']=!0x1,_0xf81ae8;}['_createActionsButton'](_0x2fee22){const _0x3f42d4=new _0x14ee0a(_0x2fee22);return _0x3f42d4['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x3f42d4['on']('execute',()=>{_0x3f42d4['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x3f42d4;}['_createActionsDropdown'](_0x5a1559){const _0x448147=new Gn(_0x5a1559,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x1adc51=>{switch(_0x1adc51){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x448147['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x5a1559,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x5a1559,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x448147['bind']('isEnabled')['to'](this),_0x448147;}['updateLabels'](_0x2f82ed){const _0x1e9be4=this['locale'];this['_partsCount']=_0x2f82ed||this['_partsCount'],this['actionsButton']['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x1e9be4,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x1e9be4,this['_partsCount'])}),this['applySuggestionModel']['label']=Hn('applySuggestion',_0x1e9be4,this['_partsCount']),this['showChangeInTextModel']['label']=Hn('showChangeInText',_0x1e9be4,this['_partsCount']),this['insertSuggestionModel']['label']=Hn('insertSuggestion',_0x1e9be4,this['_partsCount']);}}class Gn extends _0x37ad52{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x4989b2,_0x3e9f29){super(_0x4989b2),this['balloonPanelView']=new _0x500981(this['locale']),this['bodyCollection']=new qt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x3e9f29['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',C(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0xa1456=_0x3e9f29['listItemModels'][0x0]['actionName'];this['fire'](_0xa1456),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?yn:Pn]}),this['listView']['focus']());}),_0x29a34e({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x183ee3){const _0x1d7fe4=this['locale'],_0x178dcc=new _0x556745(_0x1d7fe4);for(const _0x1ae12a of _0x183ee3){const _0x11305e=new _0x2269a3(_0x1d7fe4),_0x3c541f=new _0x8cd418(_0x1d7fe4);_0x3c541f['bind'](...Object['keys'](_0x1ae12a))['to'](_0x1ae12a),_0x3c541f['delegate']('execute')['to'](_0x178dcc),_0x11305e['children']['add'](_0x3c541f),_0x178dcc['items']['add'](_0x11305e);}return _0x178dcc['items']['delegate']('execute')['to'](this),_0x178dcc['on']('execute',_0x389815=>{const _0x12609a=_0x389815['source'];this['fire'](_0x12609a['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x178dcc;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x1f1bc5(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x47c2bd,_0x4aea26)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x4aea26();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function yn(_0x4bc876){return{'top':_0x4bc876['bottom'],'left':_0x4bc876['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x14c26e,_0x57975d){return{'top':_0x14c26e['bottom'],'left':_0x14c26e['left']-(_0x57975d['width']-_0x14c26e['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Hn(_0x3eef8a,_0x582d2b,_0x5f6c3f){switch(_0x3eef8a){case'applySuggestion':return C(_0x582d2b,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x5f6c3f);case'showChangeInText':return C(_0x582d2b,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x5f6c3f);case'insertSuggestion':return C(_0x582d2b,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x5f6c3f);}}function Ln(_0x46e82f,_0x11776f,_0x261435){switch(_0x46e82f){case'applySuggestion':return C(_0x11776f,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x261435);case'showChangeInText':return C(_0x11776f,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x261435);case'insertSuggestion':return C(_0x11776f,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x261435);}}class ki extends _0x135bec(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x374a44,availableModels:_0x189db8,defaultModelId:_0x2504e8}){super(),this['_connector']=_0x374a44,this['_availableModels']=_0x189db8,this['_defaultModelId']=_0x2504e8;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x413cf9=this['_connector']['getModels'](),_0xdf76f0=await _0x413cf9['list']();this['_modelList']=_0xdf76f0['items'];}catch(_0x310f2d){throw new _0x29f184('ai-models-unable-to-retrieve',null,{'error':_0x310f2d});}return[...this['_modelList']];}async['getAvailableModels'](){const _0x11f304=await this['getAll']();return this['_filterModels'](_0x11f304,this['_availableModels']);}async['getModel'](_0x1e41a8){const _0x3ae725=await this['getAll']();if(!_0x3ae725['length'])return null;if(_0x1e41a8){const _0x2b51dc=this['_getModelById'](_0x3ae725,_0x1e41a8);if(_0x2b51dc)return _0x2b51dc;_0xadd6c3('ai-chat-model-id-unrecognized',{'modelId':_0x1e41a8,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x5cfde2=await this['getAvailableModels']();if(!_0x5cfde2['length'])return null;if(this['_defaultModelId']){const _0x5cddca=this['_getModelById'](_0x5cfde2,this['_defaultModelId']);if(_0x5cddca)return _0x5cddca;_0xadd6c3('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x5cfde2[0x0]['id']});}return _0x5cfde2[0x0];}async['isAvailable'](_0x3b8ea0){return(await this['getAvailableModels']())['some'](_0x19d37b=>_0x19d37b['name']===_0x3b8ea0['name']&&_0x19d37b['provider']===_0x3b8ea0['provider']);}['_filterModels'](_0xbbcbe8,_0x5530b4){let _0x4ec7f5;if(_0x5530b4){_0x4ec7f5=[];const _0x1284a6='string'==typeof _0x5530b4?[_0x5530b4['toLocaleLowerCase']()]:_0x5530b4['map'](_0x45591f=>_0x45591f['toLocaleLowerCase']());for(const _0x49cdaf of _0x1284a6)for(const _0xb3b676 of _0xbbcbe8)(_0xb3b676['id']['toLocaleLowerCase']()===_0x49cdaf||_0xb3b676['name']['toLocaleLowerCase']()===_0x49cdaf||Me(_0xb3b676)&&'auto'===_0x49cdaf||_0xb3b676['provider']['toLocaleLowerCase']()===_0x49cdaf||_0xb3b676['id']['toLocaleLowerCase']()['startsWith'](_0x49cdaf))&&_0x4ec7f5['push'](_0xb3b676);}else _0x4ec7f5=_0xbbcbe8;return _0x4ec7f5;}['_getModelById'](_0x126bdb,_0x579ab8){return _0x126bdb['find'](_0x31eda5=>Me(_0x31eda5)&&'auto'===_0x579ab8?_0x31eda5:_0x31eda5['id']===_0x579ab8)||null;}static['getLocalized'](_0x29488c,_0xe3da35){return _0xe3da35['map'](_0x3a48d3=>{if(Me(_0x3a48d3))_0x3a48d3['name']=C(_0x29488c,'AI_MODEL_NAME_AUTO'),_0x3a48d3['description']=C(_0x29488c,'AI_MODEL_DESCRIPTION_AUTO');else C(_0x29488c,'AI_MODEL_DESCRIPTION_'+_0x3a48d3['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x3a48d3['description']=C(_0x29488c,'AI_MODEL_DESCRIPTION_'+_0x3a48d3['id']['toUpperCase']()));return _0x3a48d3;});}}function Me(_0x337d03){return _0x337d03['id']['startsWith']('agent');}class ht extends ki{async['getAll'](){return(await super['getAll']())['sort']((_0x377c9c,_0x4b3e46)=>{const _0x53f642=Object['values'](_0x377c9c['capabilities'])['filter'](_0x4cf1b9=>_0x4cf1b9['enabled'])['length'];return Object['values'](_0x4b3e46['capabilities'])['filter'](_0x53e745=>_0x53e745['enabled'])['length']-_0x53f642;});}}function v({editor:_0xef13da,interaction:_0x3497f9,reply:_0x36000b,groups:_0xbff433,transform:_0x3bc4ba,documentCompare:_0x4a516c,documentCompareOptions:_0x29438d}){const _0x53760f=_0x3497f9['getDocumentContext']();if(!_0x53760f)return[];const _0x19108f=_0x53760f['content'],_0x487147=_0x53760f['version'],_0x43e1ea=_0x36000b['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x329661}of _0xbff433){const _0x2490a0=_0x329661['filter'](_0x5ad617=>'new'!=_0x5ad617['type'])['map'](_0x525470=>ft('data-id',_0x525470['id'],_0x43e1ea)),_0x2bcdda=_0x329661['filter'](_0x12d037=>'removed'!=_0x12d037['type'])['map'](_0x73079c=>_0x73079c['node']['cloneNode'](!0x0));let _0x5dc0fe=null;if(_0x2490a0['length']){_0x5dc0fe=_0x2490a0[0x0]['previousSibling'];for(let _0x37a78d=0x0;_0x37a78d<_0x2490a0['length'];_0x37a78d++)_0x33c6d9(_0x2490a0[_0x37a78d]);}if(_0x2bcdda['length']){_0x5dc0fe||(_0x329661[0x0]['anchorId']?_0x5dc0fe=ft('data-id',_0x329661[0x0]['anchorId'],_0x43e1ea):(_0x5dc0fe=_0x2bcdda['shift'](),_0x51c386(_0x43e1ea,_0x5dc0fe)));for(let _0x4c62b8=0x0;_0x4c62b8<_0x2bcdda['length'];_0x4c62b8++)_0x2b81f1(_0x5dc0fe,_0x2bcdda[_0x4c62b8]),_0x5dc0fe=_0x2bcdda[_0x4c62b8];}}const _0x194986=ut(_0x43e1ea),_0x2f3ffd=_0x4a516c['getDiff'](_0x19108f,_0x194986,_0x29438d)['getOperations']();if(_0x3bc4ba){const _0x1ad245=_0xef13da['model']['document']['history']['getOperations'](_0x487147),_0x6f9987={'document':_0xef13da['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x33bff0(_0x2f3ffd,_0x1ad245,_0x6f9987)['operationsA'];}return _0x2f3ffd;}function b(_0x2752ed,_0x294dcc){if('marker'!=_0x294dcc['type'])return;const _0x32e6aa=_0x2752ed['model']['markers']['get'](_0x294dcc['name']);_0x32e6aa&&(_0x294dcc['oldRange']=_0x32e6aa['getRange']());}class Vr extends _0x541968{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x51bc72,_0x868022={},_0x5502ac){super(_0x51bc72),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x868022};const _0x38d8cb=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x38d8cb?'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'](_0x5502ac),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']);}['_setupRatingButtons'](){this['likeButton']=new _0x14ee0a(this['locale']),this['likeButton']['set']({'icon':_0x3e3995,'label':C(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x13e749=>!_0x13e749),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x14ee0a(this['locale']),this['dislikeButton']['set']({'icon':_0x51e959,'label':C(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5bc822=>!_0x5bc822),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x14ee0a(this['locale']),this['copyButton']['set']({'icon':_0x4a0fe1,'label':C(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x7a7a09=>!_0x7a7a09);const _0x4a30b3=new _0x50b9df();_0x4a30b3['set']({'content':_0x270303}),_0x4a30b3['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',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x4a30b3);}['_setupShowChangesButton'](_0x387ddf){this['showChangesButton']=new _0x14ee0a(this['locale']),this['showChangesButton']['set']({'icon':_0x490482,'label':C(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x387ddf}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x55aeb8=>!_0x55aeb8),this['showChangesButton']['on']('execute',()=>{const _0x185a31=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x185a31,'icon':_0x185a31?_0x11ea32:_0x490482}),this['fire']('toggleShowChanges',_0x185a31);});}}class Lr extends _0x19a8c6{['showChangesToggleView'];constructor(_0x2c2382,_0x19de1c){super(_0x2c2382),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0x2c2382),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':C(_0x2c2382,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x19de1c['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x248413=>_0x248413?_0xe9dd5d:_0x41d5a1),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x51ddf9=new _0x50b9df();_0x51ddf9['content']=_0x391967,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x19de1c['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x51ddf9,{'tag':'span','children':[C(_0x2c2382,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0x14ee0a{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x14c1f1){this['options']={'delay':_0x14c1f1['delay']??0x14,'textNodeStyle':_0x14c1f1['textNodeStyle'],'onStreamUpdate':_0x14c1f1['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x3e029f,targetElement:_0x7dd7b6,abortSignal:_0x52f3bd}){this['isStreaming']&&this['stop'](),_0x52f3bd?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x54d7fb(_0x3e029f,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0xadd6c3('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x56c930=0x0;_0x56c930<this['currentIndex'];_0x56c930++)this['nodesList'][_0x56c930]['shouldBeStreamed']=!0x0;let _0x53eda1=0x0;for(let _0x115489=this['currentIndex'];_0x115489<this['nodesList']['length'];_0x115489++){const _0x5f072b=Date['now'](),_0x16ec59=this['nodesList'][_0x115489],_0xf92c70=_0x5f072b-_0x53eda1;_0x16ec59['shouldBeStreamed']=!0x0;let _0x5da324=_0x16ec59['parent'];for(;_0x5da324;)_0x5da324['shouldBeStreamed']=!0x0,_0x5da324=_0x5da324['parent'];if(_0xf92c70<this['options']['delay'])try{const {promise:_0x18b148,abortController:_0x30a716}=pr(this['options']['delay']-_0xf92c70);this['timeoutAbortController']=_0x30a716,await _0x18b148;}catch(_0x15ff16){return;}_0x556937(_0x7dd7b6,'<'+_0x7dd7b6['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x7dd7b6['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x115489,_0x53eda1=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x35a61f}){Array['from'](_0x35a61f['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x33da46=>{_0x33da46['replaceWith'](_0x33da46['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x2464f3){let _0x1b9bbe='';if(function(_0xd3bae3){return _0x25fa62(_0xd3bae3);}(_0x2464f3)){for(const _0x538e4c of _0x2464f3['children'])_0x1b9bbe+=this['renderNode'](_0x538e4c);}else{if(dr(_0x2464f3)){if(!_0x2464f3['shouldBeStreamed'])return'';const _0x2b1cf7=_0x2464f3,_0x424f1c=Object['entries'](_0x2b1cf7['attribs'])['map'](([_0x5c9920,_0x51d4e8])=>_0x5c9920+'=\x22'+_0x51d4e8+'\x22')['join']('\x20');_0x1b9bbe+='<'+_0x2b1cf7['tagName']+(_0x424f1c?'\x20'+_0x424f1c:'')+'>';for(const _0x51c58c of _0x119327(_0x2b1cf7))_0x1b9bbe+=this['renderNode'](_0x51c58c);_0x1b9bbe+='</'+_0x2b1cf7['tagName']+'>';}else{if(!ar(_0x2464f3))return'';if(!_0x2464f3['shouldBeStreamed'])return'';!function(_0x61a7b2){if(!_0x61a7b2['parent']||!dr(_0x61a7b2['parent']))return!0x1;if(!cr['includes'](_0x61a7b2['parent']['tagName']))return!0x1;return!_0x54cfdd(_0x61a7b2)['match'](/^\s*[<>]\s*$/);}(_0x2464f3)?_0x1b9bbe+=_0xec369b(_0x2464f3):_0x1b9bbe+=_0xec369b(new _0x2c5bc4('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x2464f3]));}}return _0x1b9bbe;}['getParsedDocumentNodeList'](){const _0x53c44a=[];return function(_0x3e3065,_0x5177a6){const _0x37a026=_0x244de4=>{if(_0x5177a6(_0x244de4),_0x244de4 instanceof _0x4b2d52)for(let _0x244b19=0x0;_0x244b19<_0x244de4['children']['length'];_0x244b19++){const _0xbbe8ce=_0x244de4['children'][_0x244b19];_0x37a026(_0xbbe8ce);}};for(let _0x17f211=0x0;_0x17f211<_0x3e3065['children']['length'];_0x17f211++)_0x37a026(_0x3e3065['children'][_0x17f211]);}(this['document'],_0x52e0fd=>{if(ar(_0x52e0fd)){const _0x282c14=this['splitTextNodeIntoWordNodes'](_0x52e0fd);_0x282c14['length']&&_0x53c44a['push'](..._0x282c14);}_0x52e0fd['isWordSplitSource']||_0x52e0fd['isWordSplitResult']||_0x53c44a['push'](_0x52e0fd);}),_0x53c44a;}['splitTextNodeIntoWordNodes'](_0x33b941){if(_0x33b941['isWordSplitSource']||_0x33b941['isWordSplitResult'])return[];const _0x11686d=_0x54cfdd(_0x33b941)['match'](/(?:\s*\S+\s*)/g),_0xa0c8b9=[];if(_0x11686d&&_0x11686d['length']>0x1){for(const _0x5e9eb0 of _0x11686d){const _0x28ff8c=new _0x2e2b16(_0x5e9eb0);_0x28ff8c['isWordSplitResult']=!0x0,_0x53ea51(_0x33b941,_0x28ff8c),_0xa0c8b9['push'](_0x28ff8c);}_0x33b941['isWordSplitSource']=!0x0,_0x33c6d9(_0x33b941);}return _0xa0c8b9;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0x6fc3e5){return _0x23320c(_0x6fc3e5);}function dr(_0x42012f){return _0x41757a(_0x42012f);}function pr(_0x251845){const _0x2dc171=new AbortController();return{'promise':new Promise((_0x1e820d,_0x9cc7cd)=>{const _0x195101=setTimeout(_0x1e820d,_0x251845);_0x2dc171['signal']['addEventListener']('abort',()=>{clearTimeout(_0x195101),_0x9cc7cd();});}),'abortController':_0x2dc171};}const Te=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x19a8c6{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x4ec6b9,{part:_0x3c4f99,uiIndex:_0x9dd9a7,areActionsDisabled:_0x3d2708,availableActions:_0x130aa6}){super(_0x4ec6b9),this['set']('partDefinition',_0x3c4f99),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x6b6da0=>'pending'==_0x6b6da0&&!_0x3d2708),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x4ec6b9,{'part':_0x3c4f99,'uiIndex':_0x9dd9a7,'availableActions':_0x130aa6}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Te)['to'](this);const _0xb454bd=this['bindTemplate'];this['contentView']=new _0x19a8c6(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0xb454bd['to']('state',_0x59cf08=>'ck-ai-suggestion__body__content-part_'+_0x59cf08),_0xb454bd['to']('isEnabled',_0x12fd15=>_0x12fd15?'ck-ai-suggestion__body__content-part_active':void 0x0),_0xb454bd['if']('isVisible','ck-hidden',_0x2a74e8=>!_0x2a74e8)]},'children':this['children'],'on':{'mouseenter':_0xb454bd['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3c4f99['index']});}),'mouseleave':_0xb454bd['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3c4f99['index']});})}});}async['updateContent']({part:_0x58843a,renderingStrategy:_0x4ec509,showUnchangedParts:_0x5437d8=!0x1,abortSignal:_0x41a335}){this['partDefinition']=_0x58843a,this['isVisible']=this['partDefinition']['hasChanges']||_0x5437d8,this['isVisible']&&('streaming'===_0x4ec509?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x41a335}):this['contentView']['element']['innerHTML']=ut(this['partDefinition']['content']));}['toggleHeader'](_0x52f041){_0x52f041?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x19a8c6{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0xc9921,{part:_0x35b324,uiIndex:_0x504279,availableActions:_0x87f1cc}){super(_0xc9921),this['set']('partDefinition',_0x35b324),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x58e676=new _0x50b9df();_0x58e676['content']=_0xa2a32e,_0x58e676['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x4f460d=[];if(_0x87f1cc['includes']('showChangeInText')){const _0x30af3f=new _0x14ee0a(_0xc9921);_0x30af3f['set']({'label':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x13603c}),_0x30af3f['bind']('isEnabled')['to'](this),_0x30af3f['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x35b324['index']});}),_0x4f460d['push'](_0x30af3f);}if(_0x87f1cc['includes']('insertSuggestion')){const _0xcc43be=new _0x14ee0a(_0xc9921);_0xcc43be['set']({'label':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4c5817}),_0xcc43be['bind']('isEnabled')['to'](this),_0xcc43be['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x35b324['index']});}),_0x4f460d['push'](_0xcc43be);}const _0x505ff1=new _0x14ee0a(_0xc9921);_0x505ff1['set']({'label':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0xdc18ef}),_0x505ff1['bind']('isEnabled')['to'](this),_0x505ff1['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x35b324['index']});}),_0x4f460d['push'](_0x505ff1),this['_toolbarView']=new _0x541968(_0xc9921),this['_toolbarView']['items']['addMany'](_0x4f460d),this['_iconStateAccepted']=new _0x50b9df(),this['_iconStateAccepted']['content']=_0x368b6c,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x50b9df(),this['_iconStateRejected']['content']=_0x43e783,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x50b9df(),this['_iconStateOutdated']['content']=_0x43e783,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x58c48d=new _0x19a8c6(_0xc9921);_0x58c48d['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x504279['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x58e676,_0x58c48d,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',(_0xa4beb7,_0xe0079a,_0x5f6e7,_0xddc3e)=>{switch(_0xddc3e){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x5f6e7){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class _ extends _0x135bec(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x550b16){const _0x3dd81f=this['createTask'](_0x550b16);return this['queue']['push'](_0x3dd81f),this['_processQueue'](),_0x3dd81f['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(_0x47b428=>{this['once']('_queueEmpty',()=>{_0x47b428();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x10b7e0=this['queue']['shift']();try{await _0x10b7e0['callback'](this['_abortController']['signal']),_0x10b7e0['resolve']();}catch(_0x2c84e1){_0x10b7e0['reject'](_0x2c84e1);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x1a3209){let _0x66bf4c,_0x3e7d3c;const _0x32366e=new Promise((_0x12cda6,_0x3063ea)=>{_0x66bf4c=_0x12cda6,_0x3e7d3c=_0x3063ea;});return{'callback':_0x1a3209,'resolve':_0x66bf4c,'reject':_0x3e7d3c,'completePromise':_0x32366e};}}class jr extends _0x19a8c6{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x7dc0b8){super();const _0x6bd62c=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x7dc0b8,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x6bd62c['if']('isDone','ck-ai-chat__feed__item_done'),_0x6bd62c['if']('isVisible','ck-hidden',_0x202175=>!_0x202175),'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'](_0x105f5f=>{_0x105f5f['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x1e9184,_0x2edc5e,_0x9f4823){await this['htmlStreamer']['stream']({'document':_0x1e9184,'targetElement':_0x2edc5e,'abortSignal':_0x9f4823});}}class _e extends jr{constructor(_0xedaaf7){super(_0xedaaf7),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0xedaaf7['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x36fdcb){this['element']['innerHTML']=_0x36fdcb;}}class Dr extends _0x19a8c6{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x49b4d8,_0x436a9a){super(_0x49b4d8);const {areActionsDisabled:_0x5ee65a,showUnchangedParts:_0x163a76,availableActions:_0x56f3dd}=_0x436a9a;this['_areActionsDisabled']=_0x5ee65a,this['_showUnchangedParts']=_0x163a76,this['_availableActions']=_0x56f3dd,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _(),this['_emptyPartsWarningView']=new _e({'id':'empty-parts-warning','initialContent':C(_0x49b4d8,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,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']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x2d51d1,renderingStrategy:_0x1e6e48,abortSignal:_0xf141c6}){this['_children']['length']?_0x2d51d1['forEach'](_0x39eaa3=>{const _0x4a8df2=this['_cachedContentParts']['findIndex'](_0x4af2b2=>_0x4af2b2['index']==_0x39eaa3['index']);-0x1===_0x4a8df2?this['_cachedContentParts']['push'](_0x39eaa3):this['_cachedContentParts'][_0x4a8df2]=_0x39eaa3;}):this['_cachedContentParts']=_0x2d51d1;for(const _0x149636 of _0x2d51d1['filter'](_0x1316d1=>_0x1316d1['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x37b5dd=>{let _0x2db011=this['getPartView'](_0x149636['index']);_0x2db011||(_0x2db011=new na(this['locale'],{'part':_0x149636,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x2db011['delegate'](...Te)['to'](this),this['_children']['add'](_0x2db011),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x2db011['toggleHeader'](this['_children']['length']>0x1),await _0x2db011['updateContent']({'part':_0x149636,'renderingStrategy':_0x1e6e48,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x37b5dd});});return _0xf141c6?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x3e5c33,_0x3144be){const _0x5c2df4=this['getPartView'](_0x3e5c33);_0x5c2df4&&(_0x5c2df4['state']=_0x3144be),this['hasPendingParts']='pending'==_0x3144be||Array['from'](this['_children'])['some'](_0x4e9bea=>'pending'==_0x4e9bea['state']);}['getPartView'](_0x576e28){return this['_children']['find'](_0x4ccee6=>_0x4ccee6['partDefinition']['index']==_0x576e28)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x59e8be=!this['_cachedContentParts']['find'](({hasChanges:_0x2d810a})=>_0x2d810a),_0x1c8a22=!!this['_cachedContentParts']['find'](({hasChanges:_0x363873})=>!_0x363873);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x1c8a22,_0x59e8be?this['_emptyPartsWarningView']['setContent'](C(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](C(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x3fe1b7=>_0x3fe1b7['partDefinition']['hasChanges']);}}class Le extends _0x577daf{constructor(_0x1c282e=void 0x0){super();const _0x21af3e=_0x1c282e?'ck-ai-spinner_'+_0x1c282e:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x21af3e]}});}}class e extends _0x19a8c6{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x5cf0cc,_0x273b21){super(_0x5cf0cc);const {showDiff:_0x3b6e2a,areActionsDisabled:_0x4c32f5,miniToolbarConfig:_0x10e1d8,hideHeader:_0x6b32a,showLoader:_0x3645c2,showUnchangedParts:_0x259e55,availableActions:_0x13f772}=_0x273b21;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x3645c2),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x6b32a||(this['headerView']=new Lr(_0x5cf0cc,{'showDiff':_0x3b6e2a}),this['headerView']['on']('toggleShowChanges',(_0x5d3617,_0xac51bd)=>{this['areChangesVisible']=_0xac51bd['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0xac51bd['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x5cf0cc,{'areActionsDisabled':_0x4c32f5,'showUnchangedParts':!!_0x259e55,'availableActions':_0x13f772}),this['bodyView']['delegate'](...Te)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Vr(_0x5cf0cc,_0x10e1d8,_0x3b6e2a),this['miniToolbarView']['delegate'](...Te)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x3420ad,_0x371823)=>{this['areChangesVisible']=_0x371823,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x371823});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new Sr(this['locale']),this['children']['add'](this['sourcesView']),_0x3645c2&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x2d6afc){await this['bodyView']['updateContentParts'](_0x2d6afc);}['updateSources'](_0x4e51c8){this['sourcesView']['children']['addMany'](_0x4e51c8['map'](_0x5d0c13=>new Fr(this['locale'],_0x5d0c13))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x178bb8){if(this['errorView']){const _0x46744b=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x46744b&&(_0x46744b['textContent']=_0x178bb8),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x59fe52){this['miniToolbarView']['items']['add'](_0x59fe52);}['removeNavigationItem'](_0x1f0b34){this['miniToolbarView']['items']['remove'](_0x1f0b34);}['_createLoaderView'](){const _0x230673=new _0x19a8c6(this['locale']),_0x49a690=new Le('small');_0x49a690['isVisible']=!0x0;const _0x43e1a1=new _0x19a8c6(this['locale']);return _0x43e1a1['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[C(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x230673['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x5c59ba=>!_0x5c59ba)]},'children':[_0x49a690,_0x43e1a1]}),_0x230673;}['_createErrorView'](){const _0x4b37b8=new _0x19a8c6(this['locale']),_0x3a97f1=new _0x19a8c6(this['locale']);return _0x3a97f1['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[C(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x4b37b8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x2d0662=>!_0x2d0662)]},'children':[_0x3a97f1]}),_0x4b37b8;}}class Sr extends _0x19a8c6{['children'];constructor(_0x4a79fc){super(_0x4a79fc),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',_0x5a5f56=>!_0x5a5f56)]},'children':this['children']});const _0x214135=new _0x19a8c6(this['locale']),_0x80de2c=new _0x50b9df();_0x80de2c['content']=_0x2870b9,_0x214135['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x80de2c,{'tag':'span','children':[{'text':C(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x214135);}}class Fr extends _0x14ee0a{constructor(_0x47a290,_0x543f64){super(_0x47a290),this['set']({'label':_0x543f64['title'],'tooltip':_0x543f64['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x16b9de=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x16b9de['to'](()=>{window['open'](_0x543f64['url'],'_blank');})}}),_0x543f64['favicon']){const _0x342856=new _0x19a8c6(_0x47a290);_0x342856['setTemplate']({'tag':'img','attributes':{'src':_0x543f64['favicon']||_0x2870b9,'alt':_0x543f64['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x342856);}else this['set']('icon',_0x2870b9);}}class es extends _0x541968{constructor(_0x446b73,_0x4c7b5c=!0x0,_0x2dcdaa=!0x0){super(_0x446b73),this['set']('isLoading',!0x1),_0x4c7b5c&&(this['applyButton']=this['_createButton'](C(_0x446b73,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0xc47651=>!_0xc47651),this['items']['add'](this['applyButton'])),_0x2dcdaa&&(this['suggestButton']=this['_createButton'](C(_0x446b73,'AI_BALLOON_SUGGEST_BUTTON'),_0x4c7b5c?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x19cd79=>!_0x19cd79),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0xb75ed7,_0x141f14){const _0x73ced0=new _0x14ee0a(this['locale']);return _0x73ced0['set']({'label':_0xb75ed7,'class':_0x141f14||'','isVisible':!0x0,'withText':!0x0}),_0x73ced0;}}class os extends _0x19a8c6{constructor(_0x152be1){super(_0x152be1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':C(_0x152be1,'AI_DISCLAIMER_TEXT')}]}]});}}const O=['applySuggestion','insertSuggestion','showNext','showPrevious'];class R extends _0x19a8c6{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];constructor(_0x4d6c9d,_0x5ccdb9,_0x139030,_0x552b2b){super(_0x4d6c9d),this['_availableActions']=_0x139030,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x552b2b),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new ts(),this['keystrokes']=new _0x1f1bc5(),this['_focusables']=this['createCollection'](),this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0xf07a6b(),this['_addContentView'](_0x5ccdb9['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x5ccdb9['showApplyButton'],_0x5ccdb9['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x5ccdb9['showApplyButton'],_0x5ccdb9['showSuggestButton']);});}['render'](){super['render']();for(const _0x32b93d of this['_focusables'])this['focusTracker']['add'](_0x32b93d['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x5df067){-0x1===_0x5df067?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x43605c){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x43605c,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x256192){this['showError'](_0x256192);}['showBlockingError'](_0x2d4ac3){this['showError'](_0x2d4ac3),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x5217eb){const _0x1bf722=this['_createNextButtonView'](),_0xcdedf1=this['_createPreviousButtonView']();_0x5217eb['view']['headerView']['children']['add'](_0x1bf722,0x2),_0x5217eb['view']['headerView']['children']['add'](_0xcdedf1,0x0),this['_focusables']['addMany']([_0x1bf722,_0xcdedf1]),this['focusTracker']['add'](_0x1bf722['element']),this['focusTracker']['add'](_0xcdedf1['element']);}['_addContentView'](_0x500ad5){this['_mainView']=_0x500ad5,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0xe7e130){const _0x237a1c=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0xe7e130,this['_dialogContent']['add'](this['_mainView'],_0x237a1c),this['hideError']();}['_addDisclaimerView'](){this['disclaimerView']=new os(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x3983a7=!0x0,_0x1c26b1=!0x0){_0x3983a7=_0x3983a7&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x1c26b1=_0x1c26b1&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new es(this['locale'],_0x3983a7,_0x1c26b1),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x3c822b=new _0x14ee0a(this['locale']);return _0x3c822b['set']({'icon':_0x346a5d,'tooltip':C(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x3c822b['on']('execute',()=>{this['fire']('showNext');}),_0x3c822b;}['_createPreviousButtonView'](){const _0x17fbb5=new _0x14ee0a(this['locale']);return _0x17fbb5['set']({'icon':_0x25d049,'tooltip':C(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x17fbb5['on']('execute',()=>{this['fire']('showPrevious');}),_0x17fbb5;}['_createErrorView'](){const _0x5ec967=new _0x19a8c6(this['locale']),_0x2b4998=new _0x19a8c6(this['locale']);return _0x2b4998['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x5ec967['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x47c91d=>!_0x47c91d)]},'children':[_0x2b4998]}),_0x5ec967;}}const x=0xa;class w extends _0x171820{static get['requires'](){return[s,c];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x33dfaa){const _0x3f2deb=P(this['context']);if(this['_config']=_0x33dfaa,this['isOpen'])return void this['_updateBalloon'](_0x33dfaa);const _0x1e4213=this['context']['config']['get']('ai.availableReplyActions')||[...k],_0x20e818=_0x3f2deb?.['commands']['get']('trackChanges'),_0x17175e=_0x20e818?.['value'];this['balloonView']=new R(_0x3f2deb['locale'],_0x33dfaa,_0x1e4213,!!_0x17175e),this['balloonView']['delegate'](...O)['to'](this),_0x20e818&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x20e818,'value'),this['_showDialog'](_0x33dfaa);}['close'](){P(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateBalloon'](_0x565204){const _0x3c0247=P(this['context']),_0x2bb23d=_0x3c0247['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x3c0247['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x2bb23d['view']?.['headerView']&&(_0x2bb23d['view']['headerView']['label']=_0x565204['title'],_0x2bb23d['view']['headerView']['iconView']&&_0x565204['icon']&&(_0x2bb23d['view']['headerView']['iconView']['content']=_0x565204['icon'])),this['balloonView']['updateContent'](_0x565204['mainView']),this['_setupVisualSelection'](_0x565204['ranges'],_0x565204['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x2bb23d['view']&&_0x2bb23d['view']['updatePosition']();},_0x3c0247['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x4e561f,_0x389b5c){this['context']['plugins']['get'](c)['showFakeVisualSelection'](_0x4e561f,'ai-balloon-'+_0x389b5c,!0x0,!0x0);}['_showDialog'](_0x4c9469){const _0xa54556=P(this['context']);this['_setupVisualSelection'](_0x4c9469['ranges'],_0x4c9469['index']);const _0x97faa8=this['_getSelectionElements']();_0x97faa8&&_0x97faa8[0x0]&&_0x2992c3({'target':_0x97faa8[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0xa54556['plugins']['get']('Dialog')['show']({'title':_0x4c9469['title'],'icon':_0x4c9469['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x4c9469['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x125148=>{_0x4c9469['showRotator']&&this['balloonView']['setupRotator'](_0x125148),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x278659,_0xc029cf){if(!_0xc029cf)return null;const _0x46d9fa=this['_getSelectionElements']();if(!_0x46d9fa||0x0===_0x46d9fa['length'])return{'left':Math['round'](_0xc029cf['left']+_0xc029cf['width']/0x2-_0x278659['width']/0x2),'top':Math['round'](_0xc029cf['top']+_0xc029cf['height']/0x2-_0x278659['height']/0x2)};const _0x49a804=Math['round'](_0xc029cf['left']+_0xc029cf['width']/0x2-_0x278659['width']/0x2),_0x1bd9b1=new _0x31eb3f(_0x46d9fa[0x0]),_0x54ae21=new _0x31eb3f(_0x46d9fa[_0x46d9fa['length']-0x1]),_0x419c79=_0x278659['height'],_0x28edd7=this['_config']['showRotator']?0x8:0x0;return{'left':_0x49a804,'top':this['_calculateOptimalTopPosition'](_0x1bd9b1,_0x54ae21,_0x419c79,_0x28edd7,_0xc029cf)};}['_calculateOptimalTopPosition'](_0x433cf7,_0x3424e5,_0x258691,_0x2cdc3f=0x0,_0x4f6360){const _0x3d892e=_0x258691+_0x2cdc3f,_0x5514ae=new _0x31eb3f(_0x110318['window']),_0x4e4011=[_0x433cf7['getVisible'](),_0x3424e5['getVisible']()]['filter'](_0x3d0824=>_0x3d0824),_0x21ae7a=_0x31eb3f['getBoundingRect'](_0x4e4011);if(!_0x21ae7a)return Math['round'](_0x4f6360['top']+_0x4f6360['height']/0x2);const _0x2526bd=_0x5514ae['getIntersection'](_0x21ae7a);if(!_0x2526bd)return Math['round'](_0x4f6360['top']+_0x4f6360['height']/0x2);const _0x4596b8=_0x4f6360['getVisible'](),_0x1b122b=_0x4596b8&&_0x21ae7a['height']>_0x4596b8['height'],_0x543be3=_0x2526bd['top'],_0x2ef8ba=_0x2526bd['bottom'];if(_0x1b122b){const _0x1a8e0c=(_0x4596b8||_0x5514ae)['height']/0x2-_0x3d892e/0x2,_0x46f16e=_0x543be3-x-_0x4f6360['top'],_0x32cb02=_0x4f6360['bottom']-_0x2ef8ba-x;return _0x46f16e>=_0x3d892e?Math['max'](x,_0x543be3-_0x3d892e-x):_0x32cb02>=_0x3d892e?_0x2ef8ba+x:Math['max'](x,_0x1a8e0c);}const _0x17c49a=_0x543be3-_0x3d892e,_0x27e308=_0x4f6360['bottom']-_0x2ef8ba-x,_0x87d7d4=_0x543be3-x-_0x4f6360['top'];let _0x5e897a;if(_0x27e308>=_0x3d892e)_0x5e897a=_0x2ef8ba+x;else{if(_0x87d7d4>=_0x3d892e)_0x5e897a=_0x17c49a-x;else _0x5e897a=_0x543be3+_0x21ae7a['height']/0x2-_0x3d892e/0x2;}return _0x5e897a;}['_setupMarkerRemovalListener'](){const _0x3876a9=P(this['context']);this['listenTo'](_0x3876a9['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x3bb7e5,data:{newRange:_0x30d302}}of _0x3876a9['model']['document']['differ']['getChangedMarkers']())if(_0x3bb7e5['startsWith']('ai-selection:')&&(_0x30d302&&(_0x30d302['start']['isEqual'](_0x30d302['end'])||'$graveyard'==_0x30d302['root']['rootName'])||null==_0x30d302)){const _0x5d5bf1=C(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x5d5bf1),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x68a96d=P(this['context']);this['stopListening'](_0x68a96d['model']['document']);}['_getSelectionElements'](){const _0x50778b=P(this['context']);return _0x1bb7e4(_0x50778b['editing'],[..._0x50778b['model']['markers']['getMarkersGroup']('ai-selection'),..._0x50778b['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class tt extends _0x171820{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[s,w,_0x2b3cb3];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new ht({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x9b819e=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x46c152,_0x115cbd)=>{this['_handleUIUserMessage']({'userMessage':_0x115cbd});}),this['listenTo'](_0x9b819e,'resizedTabs',(_0x42cd36,_0x1f167b)=>{this['_setIsMaximized'](_0x1f167b);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x9b819e['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x1c2b52,_0x3afbe1)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x3afbe1));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x3722f5,_0x2b96f1)=>{this['activeConversation']?.['addUrlToContext'](_0x2b96f1);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x8f8db4,_0x1b33cf)=>{this['activeConversation']?.['addResourceToContext'](_0x1b33cf['source'],_0x1b33cf['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x4a20c4,_0xcfc6a4)=>{this['_removeFromContext'](_0xcfc6a4);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x14438d,_0xd9c35c)=>{this['activeConversation']?.['loadSourceResources'](_0xd9c35c['sourceId'],_0xd9c35c['query'],_0xd9c35c['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x2b09a9,_0x15f4b1)=>{this['activeConversation']?.['setModel'](_0x15f4b1);}),this['listenTo'](this['_aiChatUi'],'like',(_0x3b2262,{replyId:_0x133969})=>{console['log']('Liked\x20response',_0x133969);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x4ccfc6,{replyId:_0x3527b0})=>{console['log']('Disliked\x20response',_0x3527b0);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0xbe0e5f,_0x5e343e)=>{this['context']['plugins']['get'](w)['close'](),this['_insertSuggestion'](_0x5e343e);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x59adc5,{replyId:_0x3e8230,partIndex:_0x2890fc})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x3e8230,_0x2890fc);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x39bbf7,{replyId:_0x2d30a0,partIndex:_0x5ad317})=>{const _0x39651c=this['_getDocumentRangeForReplyChanges'](_0x2d30a0,_0x5ad317);_0x39651c&&'$graveyard'!=_0x39651c['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x39651c['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x8a3451,_0x5af701)=>{this['context']['plugins']['get'](w)['close'](),this['_applySuggestion'](_0x5af701);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x59b4a1,{replyId:_0x4d1ceb,showDiff:_0xc52dbb})=>{const {reply:_0x1fb09b}=this['getInteractionAndReplyById'](_0x4d1ceb),_0x242db0=_0x1fb09b['getContentParts']({'showDiff':_0xc52dbb});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1fb09b['id'],'parts':_0x242db0,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x2315ae,{replyId:_0xf8c846,partIndex:_0x1b01ce})=>{this['_previewedChangeGroup']?.['replyId']==_0xf8c846&&this['_previewedChangeGroup']?.['partIndex']==_0x1b01ce&&this['context']['plugins']['get'](w)['close']();const {reply:_0x40ca1e}=this['getInteractionAndReplyById'](_0xf8c846);_0x40ca1e['setChangeGroupState'](_0x1b01ce,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x41c96f,_0x49be6a)=>{_0x49be6a['on']('ready',()=>{this['_integrateEditor'](_0x49be6a);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x474f38){const _0x3e7865=P(this['context']);if(!_0x3e7865['plugins']['has']('TrackChanges'))throw new _0x29f184('ai-no-track-changes',null);const _0x10d9c2=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x2de679,interaction:_0x8f28e8}=this['getInteractionAndReplyById'](_0x474f38['replyId']),_0x6b6f35=this['_getDocumentRangeForReplyChanges'](_0x474f38['replyId'],_0x474f38['partIndex']),_0x5596b7=void 0x0!==_0x474f38['partIndex']?[_0x2de679['changeGroups'][_0x474f38['partIndex']]]:_0x2de679['changeGroups']['filter'](_0x12f3cc=>'pending'==_0x12f3cc['state']),_0x187d43=_0x5596b7['map'](_0x2d8dc7=>_0x2de679['changeGroups']['indexOf'](_0x2d8dc7));if(!_0x6b6f35||'$graveyard'==_0x6b6f35['range']['root']['rootName'])return void _0x187d43['forEach'](_0x225067=>_0x2de679['setChangeGroupState'](_0x225067,'outdated'));_0x187d43['forEach'](_0x16c27a=>_0x2de679['setChangeGroupState'](_0x16c27a,'accepted'));const _0x42983c=v({'editor':_0x3e7865,'reply':_0x2de679,'interaction':_0x8f28e8,'groups':_0x5596b7,'transform':!0x0,'documentCompare':_0x10d9c2,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x367f74;_0x6b6f35&&this['_scrollToSuggestionRange'](_0x6b6f35['range']),_0x3e7865['model']['change'](_0x540ecd=>{_0x367f74=_0x540ecd['batch'],_0x3e7865['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x42983c),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x367f74,{'interactionId':_0x8f28e8['id'],'replyId':_0x2de679['id'],'indexes':_0x187d43['slice']()}),this['_updateRatings'](_0x2de679);}['_applySuggestion'](_0xba1317){const _0x4bceb1=P(this['context']),_0x2c4aab=this['context']['plugins']['get'](_0x2b3cb3),{reply:_0x18b567,interaction:_0x5a99f4}=this['getInteractionAndReplyById'](_0xba1317['replyId']),_0x3d7772=this['_getDocumentRangeForReplyChanges'](_0xba1317['replyId'],_0xba1317['partIndex']),_0x193070=void 0x0!==_0xba1317['partIndex']?[_0x18b567['changeGroups'][_0xba1317['partIndex']]]:_0x18b567['changeGroups']['filter'](_0x524153=>'pending'==_0x524153['state']),_0x3daad5=_0x193070['map'](_0x4d997c=>_0x18b567['changeGroups']['indexOf'](_0x4d997c));if(!_0x3d7772||'$graveyard'==_0x3d7772['range']['root']['rootName'])return void _0x3daad5['forEach'](_0x53483c=>_0x18b567['setChangeGroupState'](_0x53483c,'outdated'));_0x3daad5['forEach'](_0x448880=>_0x18b567['setChangeGroupState'](_0x448880,'accepted'));const _0x94a68e=v({'editor':_0x4bceb1,'reply':_0x18b567,'interaction':_0x5a99f4,'groups':_0x193070,'transform':!0x0,'documentCompare':_0x2c4aab,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x2c79d0;_0x3d7772&&this['_scrollToSuggestionRange'](_0x3d7772['range']),_0x4bceb1['model']['change'](_0x46017b=>{_0x2c79d0=_0x46017b['batch'];for(const _0x4cbb01 of _0x94a68e)_0x4cbb01['baseVersion']=_0x4bceb1['model']['document']['version'],b(_0x4bceb1,_0x4cbb01),_0x46017b['batch']['addOperation'](_0x4cbb01),_0x4bceb1['model']['applyOperation'](_0x4cbb01);}),this['_batchToChanges']['set'](_0x2c79d0,{'interactionId':_0x5a99f4['id'],'replyId':_0x18b567['id'],'indexes':_0x3daad5['slice']()}),this['_updateRatings'](_0x18b567);}['_openBalloonFor'](_0x40ca4d,_0x30efa0){const _0x30a888=P(this['context']),_0x238292=this['_getDocumentRangeForReplyChanges'](_0x40ca4d,_0x30efa0),_0x1ebef1=this['context']['plugins']['get'](w);if(!_0x238292)return void _0x1ebef1['close']();const {range:_0x12a62e,currentIndex:_0x28d7b6}=_0x238292;if('$graveyard'==_0x12a62e['root']['rootName']){const {reply:_0x579200}=this['getInteractionAndReplyById'](_0x40ca4d);return _0x579200['setChangeGroupState'](_0x28d7b6,'outdated'),void _0x1ebef1['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x40ca4d&&this['_previewedChangeGroup']?.['partIndex']==_0x28d7b6)return;this['stopListening'](_0x1ebef1),this['_previewedChangeGroup']={'replyId':_0x40ca4d,'partIndex':_0x28d7b6};let _0x26d08d=_0x30a888['config']['get']('ai.availableReplyActions')||[...k];_0x30a888['plugins']['has']('TrackChanges')||(_0x26d08d=_0x26d08d['filter'](_0x1666b9=>'insertSuggestion'!=_0x1666b9));const _0x3f06e1=new e(_0x30a888['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x26d08d});this['stopListening'](_0x3f06e1);const {reply:_0x5a962c}=this['getInteractionAndReplyById'](_0x40ca4d),_0x1ab365=_0x5a962c['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x5d7561=>_0x5d7561['hasChanges']),_0x2d0c36=_0x1ab365['findIndex'](_0x1c96c8=>_0x1c96c8['index']==_0x28d7b6);if(-0x1==_0x2d0c36)return;const _0x4aa67b=_0x1ab365[_0x2d0c36],_0x4d5220=_0x1ab365['at']((_0x2d0c36-0x1)%_0x1ab365['length'])?.['index'],_0x4a7016=_0x1ab365['at']((_0x2d0c36+0x1)%_0x1ab365['length'])?.['index'];_0x3f06e1['updateContent']({'parts':[_0x4aa67b],'renderingStrategy':'static'});const _0x2c0c71=_0x28d7b6!==_0x4d5220;this['_scrollToSuggestionRange'](_0x12a62e,!0x0),_0x1ebef1['open']({'index':_0x28d7b6,'title':C(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x2d0c36+0x1)['toString']()),'icon':Ct,'mainView':_0x3f06e1,'showRotator':_0x2c0c71,'showApplyButton':!0x0,'showSuggestButton':_0x30a888['plugins']['has']('TrackChanges'),'ranges':[_0x12a62e]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x40ca4d,_0x28d7b6),this['listenTo'](_0x3f06e1,'toggleSuggestionDisplayMode',(_0x2cd176,{showDiff:_0x448985})=>{this['_balloonShowDiff']=_0x448985;const {reply:_0x25f80e}=this['getInteractionAndReplyById'](_0x40ca4d),_0x10e01e=_0x25f80e['getContentParts']({'showDiff':_0x448985,'groupIndex':_0x28d7b6});_0x3f06e1['updateContent']({'parts':_0x10e01e,'renderingStrategy':'static'});}),this['listenTo'](_0x1ebef1,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x40ca4d,'partIndex':_0x28d7b6}),_0x2c0c71?this['_openBalloonFor'](_0x40ca4d,_0x4a7016):_0x1ebef1['close']();}),this['listenTo'](_0x1ebef1,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x40ca4d,'partIndex':_0x28d7b6}),_0x2c0c71?this['_openBalloonFor'](_0x40ca4d,_0x4a7016):_0x1ebef1['close']();}),_0x2c0c71&&(this['listenTo'](_0x1ebef1,'showNext',()=>{this['_openBalloonFor'](_0x40ca4d,_0x4a7016);}),this['listenTo'](_0x1ebef1,'showPrevious',()=>{this['_openBalloonFor'](_0x40ca4d,_0x4d5220);})),this['listenTo'](_0x1ebef1,'dialogClosed',()=>{this['stopListening'](_0x1ebef1),this['stopListening'](_0x3f06e1),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x453e09,_0x3ce7a5){const _0x431cb0=P(this['context']),{reply:_0x31ac0a,interaction:_0x5e78a3}=this['getInteractionAndReplyById'](_0x453e09),_0x13c3b0=_0x31ac0a['changeGroups']['filter'](_0x18d2df=>'pending'==_0x18d2df['state']),_0x4aa017=_0x13c3b0['map'](_0x17e9af=>_0x31ac0a['changeGroups']['indexOf'](_0x17e9af));void 0x0===_0x3ce7a5&&(_0x3ce7a5=_0x4aa017[0x0]);const _0x2a4ea5=_0x4aa017['indexOf'](_0x3ce7a5);if(-0x1==_0x2a4ea5)return null;const _0x4301bc=_0x13c3b0[_0x2a4ea5],_0x332856=new mt([]),_0x384182=new mt([]);for(const _0x3064f7 of _0x4301bc['changes'])if('removed'!=_0x3064f7['type']&&_0x384182['children']['push'](_0x3064f7['node']['cloneNode'](!0x0)),'new'!=_0x3064f7['type']){const _0x5737d7=gt(_0x28dc66=>pt(_0x28dc66,'data-id')==_0x3064f7['id'],_0x31ac0a['documentContextContent'],!0x0);_0x332856['children']['push'](_0x5737d7['cloneNode'](!0x0));}if(0x0==_0x332856['children']['length']){if(_0x4301bc['changes'][0x0]['anchorId']){const _0x424264=ft('data-id',_0x4301bc['changes'][0x0]['anchorId'],_0x31ac0a['documentContextContent']);_0x332856['children']['unshift'](_0x424264['cloneNode'](!0x0)),_0x384182['children']['unshift'](_0x424264['cloneNode'](!0x0)),_0x424264['nextSibling']&&(_0x332856['children']['push'](_0x424264['nextSibling']['cloneNode'](!0x0)),_0x384182['children']['push'](_0x424264['nextSibling']['cloneNode'](!0x0)));}else{const _0x5334f9=_0x31ac0a['documentContextContent']['children'][0x0];if(!_0x5334f9)return null;_0x332856['children']['push'](_0x5334f9['cloneNode'](!0x0)),_0x384182['children']['push'](_0x5334f9['cloneNode'](!0x0));}}const _0x22faf8=_0x5e78a3['getDocumentContext'](),_0xf9850c=_0x431cb0['data']['parse'](_0x22faf8['content']),_0x1dba5b=ut(_0x332856),_0x2ecfc7=_0x431cb0['data']['parse'](_0x1dba5b),_0x11b166=_0x431cb0['data']['parse'](_0x1dba5b),_0x485949=_0x431cb0['model']['createPositionAt'](_0x2ecfc7,0x0),_0x5e9a4c=ut(_0x384182),_0xde13c3={'anchor':_0x485949,'markDeletions':!0x1},_0x462b5e=_0x431cb0['plugins']['get'](_0x2b3cb3)['getDiff'](_0x1dba5b,_0x5e9a4c,_0xde13c3)['getOperations']();if(!_0x462b5e['length'])return null;_0x431cb0['model']['change'](_0x5310dc=>{for(const _0x368e15 of _0x462b5e)if('remove'==_0x368e15['type']){const _0x5a2201=_0x368e15['sourcePosition'],_0x25468f=_0x368e15['howMany'],_0x91a752=new _0x1609ec(_0x5a2201,_0x25468f);_0x5310dc['batch']['addOperation'](_0x91a752),_0x431cb0['model']['applyOperation'](_0x91a752);}else'marker'!==_0x368e15['type']&&(_0x368e15['baseVersion']=null,_0x368e15['isDocumentOperation']=!0x1,_0x5310dc['batch']['addOperation'](_0x368e15),_0x431cb0['model']['applyOperation'](_0x368e15));});const _0x1e533c=lt(_0x431cb0,_0x462b5e,_0x2ecfc7);dt(_0x431cb0['model'],_0x1e533c);const _0x1a8088=_0x1e533c['getFirstRange']()['start']['path']['slice'](),_0x2f3d89=_0x1e533c['getFirstRange']()['end']['path']['slice'](),_0x4833e4=[];let _0x58d988=_0x2ecfc7,_0x2e449f=_0x11b166;for(let _0x58bb49=0x0;_0x58bb49<_0x2f3d89['length'];_0x58bb49++){const _0x10f3e0=_0x58d988['maxOffset']-_0x2f3d89[_0x58bb49];_0x4833e4[_0x58bb49]=_0x2e449f['maxOffset']-_0x10f3e0,_0x58d988=_0x58d988['getChildAtOffset'](_0x2f3d89[_0x58bb49]),_0x2e449f=_0x2e449f['getChildAtOffset'](_0x4833e4[_0x58bb49]);}const _0x34242d=_0x431cb0['model']['createRange'](_0x431cb0['model']['createPositionFromPath'](_0x11b166,_0x1a8088),_0x431cb0['model']['createPositionFromPath'](_0x11b166,_0x4833e4)),_0xf97a30=_0x11b166['getChild'](0x0)['getAttribute'](ct),_0x1ec0c4=Array['from'](_0xf9850c['getChildren']())['find'](_0x5003a7=>_0x5003a7['getAttribute'](ct)==_0xf97a30)['getPath'](),_0x2e7d46=_0x34242d['start']['path']['slice'](),_0x153994=_0x34242d['end']['path']['slice']();_0x2e7d46[0x0]=_0x1ec0c4[0x0]+_0x2e7d46[0x0],_0x153994[0x0]=_0x1ec0c4[0x0]+_0x153994[0x0];let _0xb6b3a0=_0x431cb0['model']['createRange'](_0x431cb0['model']['createPositionFromPath'](_0x431cb0['model']['document']['getRoot'](),_0x2e7d46),_0x431cb0['model']['createPositionFromPath'](_0x431cb0['model']['document']['getRoot'](),_0x153994));const _0x23b745=_0x431cb0['model']['document']['history']['getOperations'](_0x22faf8['version']);for(const _0xcf040a of _0x23b745)_0xb6b3a0=_0x59485f['_createFromRanges'](_0xb6b3a0['getTransformedByOperation'](_0xcf040a));return{'range':_0xb6b3a0,'currentIndex':_0x3ce7a5};}['_integrateEditor'](_0x147664){if(!_0x147664['plugins']['has']('Undo'))return;const _0x2d9043=_0x147664['commands']['get']('undo'),_0x5df0a8=_0x147664['commands']['get']('redo');this['listenTo'](_0x2d9043,'revert',(_0x206388,_0x38b12a,_0x5809a1)=>{const _0x792068=this['_batchToChanges']['get'](_0x38b12a);if(!_0x792068)return;const _0x4237f5=this['activeConversation']['getInteraction'](_0x792068['interactionId'])['getReply'](_0x792068['replyId']);_0x792068['indexes']['forEach'](_0x27c352=>_0x4237f5['setChangeGroupState'](_0x27c352,'pending')),this['_batchToChanges']['delete'](_0x38b12a),this['_batchToChanges']['set'](_0x5809a1,_0x792068);}),this['listenTo'](_0x5df0a8,'revert',(_0x5cd782,_0x366446,_0x51b0c1)=>{const _0xe5f4d0=this['_batchToChanges']['get'](_0x366446);if(!_0xe5f4d0)return;const _0x1c74bc=this['activeConversation']['getInteraction'](_0xe5f4d0['interactionId'])['getReply'](_0xe5f4d0['replyId']);_0xe5f4d0['indexes']['forEach'](_0x5072d7=>_0x1c74bc['setChangeGroupState'](_0x5072d7,'accepted')),this['_batchToChanges']['delete'](_0x366446),this['_batchToChanges']['set'](_0x51b0c1,_0xe5f4d0);});}async['loadConversation'](_0x5d148c){this['context']['plugins']['get'](w)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x365079=this['context']['plugins']['get'](at);this['updateConversationTitle']('\x20'),_0x365079['view']['activateTab']('chat'),await this['_startConversationSafely'](_0x5d148c);const {sessionId:_0x49f0b0}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x5d148c,_0x49f0b0),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x235f71){console['error']('Failed\x20to\x20load\x20conversation',_0x235f71);}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x819943){this['activeConversation']['id']===_0x819943&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x55d412=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x55d412),this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x21a615,quickActionData:_0x19fa52}){await this['_handleUIUserMessage']({'userMessage':_0x21a615,'quickActionData':_0x19fa52});}['getGroupId'](){const _0x28381a=this['context']['config']['get']('collaboration.channelId');if(!_0x28381a)throw new _0x29f184('ai-chat-missing-channel-id',this);return _0x28381a;}async['_startConversationSafely'](_0x153a5a){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x153a5a);}catch(_0x41025c){ot('ai-chat-conversation-start-failed',_0x41025c),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x3171a5){const _0x33fe8b=this['context']['plugins']['get'](w);let _0x441457;_0x33fe8b['isOpen']&&_0x33fe8b['close'](),_0x3171a5||!this['activeConversation']?_0x441457=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x441457=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x28f908=this['getGroupId'](),_0x1fa388=_0x3171a5||_0x223274();this['activeConversation']=new nt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x441457,'conversationId':_0x1fa388,'group':_0x28f908,'getEditor':()=>P(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x1681be,_0x3e94aa)=>{this['_aiChatUi']['createConversation'](_0x3e94aa),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x3171a5||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x34f9d4,_0xf9cb79)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xf9cb79['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x2b177a,_0x15cd43)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x15cd43);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x2747b0,_0x4088bb)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4088bb,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x5495ce,_0x387f0a)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x387f0a,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x9a72b9,_0x9fb2fd)=>{this['_aiChatUi']['removeFeedInteraction'](_0x9fb2fd['id']);}),this['activeConversation']['on']('setConversationTitle',(_0xc76af,_0x49326c,_0x1ea676)=>{this['updateConversationTitle'](_0x49326c,_0x1ea676);}),this['activeConversation']['on']('replyCreated',(_0x97817,_0x5cdf53)=>{'text-delta'===_0x5cdf53['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x5cdf53):this['_aiChatUi']['addFeedItemAISuggestion'](_0x5cdf53);}),this['activeConversation']['on']('replyContentUpdated',async(_0x143bcf,_0x60fe06)=>{await this['_updateReplyContent']({'reply':_0x60fe06});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x3cf803,{reply:_0x3debd4,index:_0x383c9b,state:_0x5df72a})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x3debd4['id'],'index':_0x383c9b,'state':_0x5df72a});}),this['activeConversation']['on']('contextItemAdded',(_0x2eed9a,_0x4a70d8)=>{if(this['_aiChatUi']['addContextItem'](_0x4a70d8['contextItem'],_0x4a70d8['isLoading']),'selection'===_0x4a70d8['contextItem']['type']){const _0x219c30=[...P(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x219c30,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x4d4827,_0x4e167b)=>{this['_aiChatUi']['removeContextItem'](_0x4e167b['uiId']),'current-document'==_0x4e167b['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x4e167b['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x520fad,_0x44ca90)=>{this['_aiChatUi']['setContextItemLoading'](_0x44ca90['contextItem']['uiId'],_0x44ca90['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x5799bc,_0x4d53e0)=>{this['_aiChatUi']['setConversationContext'](_0x4d53e0['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x54ae42,_0x2ce9fd)=>{this['_aiChatUi']['setAddContextOptions'](_0x2ce9fd['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x2ebd42,_0x5cbdf7)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x5cbdf7['sourceId'],_0x5cbdf7['source'],_0x5cbdf7['resources'],_0x5cbdf7['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x443569,_0x273d7c)=>{this['_aiChatUi']['updateResourceState'](_0x273d7c['sourceId'],_0x273d7c['resourceId'],_0x273d7c['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x3a9919,_0x381e7c)=>{this['_aiChatUi']['updateCapabilities'](_0x381e7c);}),this['activeConversation']['on']('modelSelected',(_0x40ce8f,_0x1ef93d)=>{this['_aiChatUi']['setSelectedModel'](_0x1ef93d['selectedModel'],_0x1ef93d['isDisabled']);}),this['activeConversation']['on']('error',(_0x3e5f3e,{error:_0x5a6d83,interactionId:_0x50c2a0,fileName:_0x41a828,url:_0x25fddf,sourceId:_0x3aa024,sourceLabel:_0x2e59ac})=>{const _0x257928=_0x50c2a0?_0x50c2a0+':'+_0x223274():_0x223274();_0x5a6d83['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':C(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x257928}):_0x5a6d83['message']['startsWith']('ai-chat-conversation-init-failed')||_0x5a6d83['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x257928}),this['_logError'](_0x5a6d83)):_0x5a6d83['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x41a828),'id':_0x257928}):_0x5a6d83['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x25fddf),'id':_0x257928}):_0x5a6d83['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x257928}):_0x5a6d83['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x257928}):_0x5a6d83['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x3aa024&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x3aa024),this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x2e59ac||'source'),'id':_0x257928}),this['_logError'](_0x5a6d83)):_0x5a6d83['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x257928}),this['_logError'](_0x5a6d83)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x257928}),this['_logError'](_0x5a6d83));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x3171a5||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0xe69143,quickActionData:_0x5a6fa8}){if(!this['activeConversation'])throw new _0x29f184('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0xe69143,'quickActionData':_0x5a6fa8}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x568932=P(this['context'])['model'],_0x2f6d7e=Array['from'](_0x568932['markers']['getMarkersGroup'](rt));_0x568932['change'](_0x95124a=>{_0x2f6d7e['forEach'](_0xa61141=>_0x95124a['removeMarker'](_0xa61141));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x170a49){this['_aiChatUi']['setIsMaximized'](_0x170a49);}['_logError'](_0xb7d713){ot(_0xb7d713['message']);}['_removeFromContext'](_0x5cb363){this['activeConversation']?.['removeFromContext'](_0x5cb363);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x3768d0){const [_0x14d993,_0x8b75c4]=_0x3768d0['split'](':'),_0x52044e=this['activeConversation']['getInteraction'](_0x14d993),_0x4b0b33=_0x52044e['getReply'](_0x8b75c4);return{'interaction':_0x52044e,'reply':_0x4b0b33};}['_scrollToSuggestionRange'](_0x2b4e1f,_0x305a09=!0x1){const _0x29c2c2=P(this['context']),_0x40b6f0={'target':_0x29c2c2['editing']['view']['domConverter']['viewRangeToDom'](_0x29c2c2['editing']['mapper']['toViewRange'](_0x2b4e1f)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x305a09};_0x305a09&&(_0x40b6f0['alignToTop']=!0x0),_0x2992c3(_0x40b6f0);}['updateConversationTitle'](_0x521b69,_0x340aad=!0x1){this['_aiChatUi']['setConversationTitle'](_0x521b69||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x340aad);}async['_updateReplyContent']({reply:_0x5a4310,renderingStrategy:_0x46839c}){const {id:_0xf20fd5,isDone:_0x528663,type:_0x45b010,parsedContent:_0x3ed136}=_0x5a4310;if('modification-delta'===_0x45b010){const _0x1424b2=_0x5a4310['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xf20fd5,'parts':_0x1424b2,'renderingStrategy':_0x46839c,'isDone':_0x528663});}else'text-delta'===_0x45b010&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0xf20fd5,'parsedContent':_0x3ed136,'renderingStrategy':_0x46839c,'isDone':_0x528663});_0x528663&&_0x5a4310['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0xf20fd5,_0x5a4310['sources']);}async['_stopLastInteraction'](){const _0x2ac8b4=this['activeConversation']?.['lastInteraction'];_0x2ac8b4&&(_0x2ac8b4['stop'](),this['_aiChatUi']['stopInteraction'](_0x2ac8b4));}async['_flushLastInteractionUI'](){const _0xce8f2b=this['activeConversation']?.['lastInteraction'];if(_0xce8f2b){for await(const _0x599d8e of _0xce8f2b['replies'])await this['_updateReplyContent']({'reply':_0x599d8e,'renderingStrategy':'static'});}}['_updateRatings'](_0x401eaa){const _0x26f35d={'positiveCount':_0x401eaa['changeGroups']['filter'](_0x17760d=>'accepted'===_0x17760d['state'])['length'],'totalCount':_0x401eaa['changeGroups']['length'],'modificationId':_0x401eaa['id']},_0xe4111b=this['activeConversation']['getInteraction'](_0x401eaa['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0xe4111b,_0x26f35d);}}const St=[...Te,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ge extends jr{['containerView'];['actionsView'];constructor(_0x4b57ae,_0xe8f36a){super(_0xe8f36a),this['set']('isTrackChangesOn',!0x1),this['containerView']=new e(_0x4b57ae,{'showDiff':_0xe8f36a['showDiff'],'areActionsDisabled':_0xe8f36a['areActionsDisabled'],'availableActions':_0xe8f36a['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x1027d9,_0x4e9ca2)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4e9ca2['showDiff']});}),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',(_0xdcf016,{index:_0x18dbbc})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x18dbbc});}),this['containerView']['on']('insertSuggestion',(_0x5634e2,{index:_0x267496})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x267496});}),this['containerView']['on']('rejectSuggestion',(_0x1c2488,{index:_0x114c17})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x114c17});}),this['containerView']['on']('mouseOverSuggestion',(_0x5844a9,{index:_0x2f174a})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2f174a});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x913ea9,{index:_0x409436})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x409436});}),this['actionsView']=new nh(_0x4b57ae,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0xe8f36a['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x16d3ce){await this['containerView']['updateContent'](_0x16d3ce),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x37e4d2,_0x55b9f9){this['containerView']['bodyView']['updatePartState'](_0x37e4d2,_0x55b9f9);}['updateSources'](_0x123e32){this['containerView']['updateSources'](_0x123e32);}['getPartView'](_0x1ed6c6){return this['containerView']['bodyView']['getPartView'](_0x1ed6c6);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class ke extends jr{['replyContainer'];constructor(_0x44adff,_0x6540ec){super(_0x6540ec),this['locale']=_0x44adff,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x19a8c6(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Ye(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x3fd9d8,renderingStrategy:_0xdb27b7,abortSignal:_0x283d32}){'streaming'===_0xdb27b7?await this['streamIntoElement'](_0x3fd9d8,this['replyContainer']['element'],_0x283d32):this['replyContainer']['element']['innerHTML']=_0xec369b(_0x3fd9d8);}['updateSources'](_0x53632f){const _0x425711=new Sr(this['locale']);_0x425711['children']['addMany'](_0x53632f['map'](_0x1f9088=>new Fr(this['locale'],_0x1f9088))),_0x425711['isVisible']=!0x0,this['children']['add'](_0x425711);}}const xn={'file':_0x5b8c8e,'document':_0x776ddc,'web-resource':_0x339b47,'text':_0x5b8c8e,'selection':_0x4d97da},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Jr='ck-ai-chat-context-chip_document',Zr='ck-ai-chat-context-chip__label',ra='ck-ai-chat-context-chip__type-icon',oa='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class bo extends _0x14ee0a{constructor(_0xd4a1ed,_0x175da4,_0x5b4305,_0x5da634,_0x21660d=!0x1){super(_0xd4a1ed),this['_isAnimationOnEnterEnabled']=_0x5da634,this['_initializeProperties'](_0x175da4,_0x5b4305,_0x21660d),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'](_0x5afbac,_0x3981c7,_0x127cfb){this['set']('label',_0x5afbac['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x5afbac['type']),this['set']('id',_0x5afbac['uiId']),this['set']('readonly',_0x3981c7),this['set']('isLoading',_0x127cfb);}['_setupTemplate'](){const _0x5b2132=this['_createIconView'](),_0x375d3e=this['_createRemoveButton'](),_0x2b8fa8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x2b8fa8),'children':this['_createTemplateChildren'](_0x5b2132,_0x375d3e,_0x2b8fa8)});}['_createTemplateAttributes'](_0x495a6e){return{'class':[$r,_0x495a6e['if']('itemType',Jr,_0x313f9b=>'document'==_0x313f9b),_0x495a6e['if']('itemType',Qr,_0x52cd25=>'selection'==_0x52cd25)],'data-cke-tooltip-text':_0x495a6e['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':oa};}['_createTemplateChildren'](_0x12301c,_0x5efe5b,_0x28c214){const _0x3c4164=this['_createLabelElement'](_0x28c214),_0x3bdeaf=this['_createLoaderIcon']();return this['readonly']?[_0x12301c,_0x3c4164]:[_0x12301c,_0x3bdeaf,_0x3c4164,_0x5efe5b];}['_createLabelElement'](_0x48d8bf){return{'tag':'span','attributes':{'class':Zr},'children':[{'text':_0x48d8bf['to']('label')}]};}['_createRemoveButton'](){const _0x1c6a8b=new _0x14ee0a(this['locale']);return _0x1c6a8b['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x5e2897}),this['_setupRemoveButtonEvent'](_0x1c6a8b),_0x1c6a8b;}['_setupRemoveButtonEvent'](_0x43d7db){_0x43d7db['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x4b1fef=this['bindTemplate'],_0xa8ecca=new _0x50b9df();return _0xa8ecca['content']=xn[this['itemType']],_0xa8ecca['extendTemplate']({'attributes':{'class':[ra,_0x4b1fef['if']('isLoading','ck-hidden',_0x3f97c6=>_0x3f97c6)]}}),_0xa8ecca;}['_handleAnimationEndOnce'](_0x269a2d,_0x551f2a){if(!_0x269a2d)return;const _0x450054=()=>{_0x551f2a(),_0x269a2d['removeEventListener']('animationend',_0x450054),_0x269a2d['removeEventListener']('webkitAnimationEnd',_0x450054);};_0x269a2d['addEventListener']('animationend',_0x450054),_0x269a2d['addEventListener']('webkitAnimationEnd',_0x450054);}['_createLoaderIcon'](){const _0x308aa3=new Le('small');return _0x308aa3['bind']('isVisible')['to'](this,'isLoading',_0x24e123=>_0x24e123),_0x308aa3;}}function In(_0x557043){if(!_0x557043)return _0x557043;if(_0x557043['length']<=0x78)return _0x557043;const _0x5a6564=_0x557043['slice'](0x0,0x78),_0x1173a9=_0x5a6564['lastIndexOf']('\x20');return(_0x1173a9>0x0?_0x5a6564['slice'](0x0,_0x1173a9):_0x5a6564)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ao{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x4d1f54,_0x2d2f93,_0x47c15f,_0x479bfb,_0x4d320c){this['_locale']=_0x4d1f54,this['_visibleChips']=_0x2d2f93,this['_config']={...hn,..._0x47c15f,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x47c15f['cssClasses']}},this['_overflowChips']=new _0x5d69ef(),this['_bodyCollection']=_0x479bfb,this['_parentView']=_0x4d320c||null;}['setContainerElement'](_0x489046){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x489046,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 _0x3213bb=[...this['_visibleChips'],...this['_overflowChips']],_0x2959b6=this['_createCalculationContainer'](),_0x610e9a=this['_calculateOverflowInContainer'](_0x2959b6,_0x3213bb),_0x364cfb=_0x2959b6['_ancestorsToRestore'];_0x364cfb&&this['_restoreAncestorVisibility'](_0x364cfb),_0x2959b6['remove'](),this['_applyOverflowResults'](_0x3213bb,_0x610e9a);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x29a34e({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x5c5ecd=new _0x14ee0a(this['_locale']);_0x5c5ecd['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x16e1d3=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x16e1d3['push'](this['_config']['cssClasses']['controlsButton']),_0x5c5ecd['extendTemplate']({'attributes':{'class':_0x16e1d3}}),_0x5c5ecd;}['_createShowMoreBalloonPanelView'](){const _0x3b0db1=new _0x500981(this['_locale']);return _0x3b0db1['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x3b0db1),_0x3b0db1;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x401c6a=>{_0x401c6a['disableAnimationOnEnter']();});const _0x596f77=new _0x19a8c6(this['_locale']);_0x596f77['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x596f77);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x856b3b=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x856b3b?'':'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'](_0x22a927){const _0x4039a6=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2449a6=this['_containerElement']?.['classList'];if(_0x2449a6){const _0x164303=_0x2449a6[0x0]||'',_0xbedf2=_0x22a927['querySelector']('.'+_0x164303),_0x365af9=_0x22a927['querySelector'](_0x4039a6);return _0xbedf2||_0x365af9||_0x22a927;}return _0x22a927['querySelector'](_0x4039a6)||_0x22a927;}['_calculateContainerWidth'](){const _0x498ca2=this['_parentView']?.['element']||this['_containerElement'];if(!_0x498ca2)return an;const _0x16d180=window['getComputedStyle'](_0x498ca2)['width'];if('auto'===_0x16d180||'0px'===_0x16d180||!_0x16d180){const _0x5ac163=_0x498ca2['parentElement'];if(_0x5ac163){const _0x4eddda=window['getComputedStyle'](_0x5ac163);return'auto'!==_0x4eddda['width']?_0x4eddda['width']:an;}return an;}return _0x16d180;}['_applyCalculationStyles'](_0x445ec6,_0x51c1f7){this['_config']['cssClasses']['calculationContainer']&&_0x445ec6['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x445ec6['style']['width']=_0x51c1f7,_0x445ec6['style']['position']='absolute',_0x445ec6['style']['top']='-9999px',_0x445ec6['style']['left']='-9999px',_0x445ec6['style']['opacity']='0',_0x445ec6['style']['pointerEvents']='none',_0x445ec6['style']['zIndex']='-1',_0x445ec6['style']['visibility']='visible\x20!important',_0x445ec6['style']['display']='block\x20!important',_0x445ec6['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x39d157){_0x39d157['forEach'](({element:_0x2fe5ce,originalDisplay:_0x44d1f1,originalVisibility:_0x4178b0})=>{_0x2fe5ce['style']['display']=_0x44d1f1,_0x2fe5ce['style']['visibility']=_0x4178b0;});}['_makeAncestorsVisible'](_0x3d8357){const _0x3e7cfb=[];let _0x41aecc=_0x3d8357;for(;_0x41aecc&&_0x41aecc!==document['body'];){const _0x286a97=window['getComputedStyle'](_0x41aecc);'none'!==_0x286a97['display']&&'hidden'!==_0x286a97['visibility']||(_0x3e7cfb['push']({'element':_0x41aecc,'originalDisplay':_0x41aecc['style']['display'],'originalVisibility':_0x41aecc['style']['visibility']}),_0x41aecc['style']['display']='block',_0x41aecc['style']['visibility']='visible'),_0x41aecc=_0x41aecc['parentElement'];}return _0x3e7cfb;}['_createContainerElements'](){let _0x3a0227,_0x54fa49;return this['_parentView']?.['element']?(_0x3a0227=this['_parentView']['element']['cloneNode'](!0x0),_0x54fa49=this['_findTargetContainer'](_0x3a0227)):(_0x3a0227=document['createElement']('div'),_0x54fa49=_0x3a0227),{'calculationContainer':_0x3a0227,'targetContainer':_0x54fa49};}['_createCalculationContainer'](){const {calculationContainer:_0x27d82c,targetContainer:_0x2d7ef7}=this['_createContainerElements'](),_0x57c766=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x27d82c,_0x57c766);const _0x2d343c=this['_parentView']?.['element']||this['_containerElement'],_0x270ac7=_0x2d343c?.['parentElement'];_0x270ac7?_0x270ac7['appendChild'](_0x27d82c):document['body']['appendChild'](_0x27d82c),_0x27d82c['_targetContainer']=_0x2d7ef7;const _0x49a3fa=this['_makeAncestorsVisible'](_0x270ac7||null);return _0x27d82c['offsetWidth'],_0x27d82c['_ancestorsToRestore']=_0x49a3fa,_0x27d82c;}['_calculateOverflowInContainer'](_0x485370,_0x4a88cf){const _0x3ec540=_0x485370['_targetContainer']||_0x485370,_0x14cab3=[],{rowCount:_0x564d35}=this['_renderChipsAndCountRows'](_0x3ec540,_0x4a88cf);if(_0x564d35<=this['_config']['maxVisibleRows'])return _0x14cab3;const _0x5723b7=_0x4a88cf['slice']();for(;_0x5723b7['length']>0x0;){if(this['_testButtonFit'](_0x485370,_0x3ec540,_0x5723b7)){const _0x5a9ed0=_0x4a88cf['filter'](_0x72ba5a=>!_0x5723b7['includes'](_0x72ba5a));_0x14cab3['push'](..._0x5a9ed0);break;}if(!_0x5723b7['pop']())break;}return _0x14cab3;}['_renderChipsAndCountRows'](_0x2d5427,_0x3d51c5){_0x2d5427['innerHTML']='',_0x3d51c5['forEach'](_0x145a5d=>{if(_0x145a5d['element']){const _0x444a3f=_0x145a5d['element']['cloneNode'](!0x0);_0x2d5427['appendChild'](_0x444a3f);}}),_0x2d5427['offsetWidth'];const _0x204bd3=_0x2d5427['children'],_0x556c70=[];return Array['from'](_0x204bd3)['forEach'](_0xa6e373=>{const _0x54a055=_0xa6e373['getBoundingClientRect']()['top'];_0x556c70['some'](_0x7e4639=>Math['abs'](_0x7e4639-_0x54a055)<this['_config']['rowDetectionTolerance'])||_0x556c70['push'](_0x54a055);}),{'rowCount':_0x556c70['length']};}['_createMockButton'](){const _0x5614ca=document['createElement']('button');return _0x5614ca['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x5614ca['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x5614ca['textContent']='+\x201',_0x5614ca;}['_testButtonFit'](_0x1418ac,_0x292074,_0x48970d){this['_renderChipsAndCountRows'](_0x292074,_0x48970d);const _0x5b9781=this['_createMockButton']();_0x1418ac['appendChild'](_0x5b9781),_0x1418ac['offsetWidth'];const _0x21925b=[..._0x292074['children'],_0x5b9781],_0x259cd5=[];_0x21925b['forEach'](_0x3245c4=>{const _0x30e9b2=_0x3245c4['getBoundingClientRect']()['top'];_0x259cd5['some'](_0x4d0b4f=>Math['abs'](_0x4d0b4f-_0x30e9b2)<this['_config']['rowDetectionTolerance'])||_0x259cd5['push'](_0x30e9b2);});const _0x18d83f=_0x259cd5['length'];return _0x5b9781['remove'](),_0x18d83f<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x3683e1,_0x34301b){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x3683e1['forEach'](_0x3b544a=>{_0x34301b['includes'](_0x3b544a)?this['_overflowChips']['add'](_0x3b544a):this['_visibleChips']['add'](_0x3b544a);});}['_updateOverflowUI'](_0xeae082){if(_0xeae082>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0xeae082>0x0&&this['_showMoreButtonView']){const _0xb93e54=''+this['_config']['showMoreLabelPrefix']+(_0xeae082<0x63?_0xeae082:'99');this['_showMoreButtonView']['label']=_0xb93e54;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x284954,_0x3c146e){this['_distributeChips'](_0x284954,_0x3c146e),this['_updateOverflowUI'](_0x3c146e['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x11479f=>{_0x11479f[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 _0x3abbeb=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x3abbeb['width']||0x0===_0x3abbeb['height'])return!0x1;const _0x49af58=window['innerHeight']||document['documentElement']['clientHeight'],_0xc0931d=window['innerWidth']||document['documentElement']['clientWidth'],_0x195492=0xc8;return _0x3abbeb['bottom']>=-0xc8&&_0x3abbeb['top']<=_0x49af58+_0x195492&&_0x3abbeb['right']>=-0xc8&&_0x3abbeb['left']<=_0xc0931d+_0x195492;}}const ca='ck-ai-chat__feed__context-chips',la='ck-ai-chat-context-chips-wrapper',da='ck-ai-chat-context-chips-wrapper-balloon',ua='ck-ai-chat-controls-button',_a='ck-ai-chat-controls_context_show-more-button',Ia='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x19a8c6{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x186edd,_0x3e8763,_0x6ece7a){super(_0x186edd),this['_bodyCollection']=_0x6ece7a,this['_createContextChips'](_0x3e8763);const _0x598a70={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Ia,'overflowContainer':da,'controlsButton':ua}};this['_overflowManager']=new Ao(_0x186edd,this['_contextChips'],_0x598a70,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[ca,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':la},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x1b6311=this['element']['querySelector']('.'+la);_0x1b6311&&(this['_overflowManager']['setContainerElement'](_0x1b6311),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x1a2ac0){for(const _0x47b550 of _0x1a2ac0){const _0xf1d93b=new bo(this['locale'],_0x47b550,!0x0,!0x1);this['_contextChips']['add'](_0xf1d93b);}}}class ve extends jr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x35f769,_0x20d4b1,_0x2c4343){super(_0x20d4b1),this['_locale']=_0x35f769,this['_bodyCollection']=_0x2c4343,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 ah(this['_locale'],this['options']['contextItems']['filter'](_0x238d8c=>!_0x238d8c['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x19a8c6(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Et extends jr{['capabilities'];constructor(_0x5e03f7,_0x52f761){super(_0x52f761);const {isWebSearchEnabled:_0x5b924c,isReasoningEnabled:_0x306fbc}=_0x52f761['capabilities'],_0xc14e0f=[];let _0x4f9698='';_0x5b924c&&_0x306fbc?(_0x4f9698=C(_0x5e03f7,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0xc14e0f['push'](aa(_0x2870b9)),_0xc14e0f['push'](aa(_0x49c2da))):_0x5b924c?(_0x4f9698=C(_0x5e03f7,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0xc14e0f['push'](aa(_0x2870b9))):_0x306fbc&&(_0x4f9698=C(_0x5e03f7,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0xc14e0f['push'](aa(_0x49c2da))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x4f9698?'':'ck-hidden']}});const _0x44fbbf=new _0x19a8c6();_0x44fbbf['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0xc14e0f,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x4f9698]}]}),this['children']['add'](_0x44fbbf),this['capabilities']=_0x52f761['capabilities'];}}function aa(_0x3220cc){const _0x5dba1f=new _0x50b9df();return _0x5dba1f['content']=_0x3220cc,_0x5dba1f;}const ws=['wheel','touchstart','pointerdown','keydown'],fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class be{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x400822){this['element']=_0x400822,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x5123f3 of ws){const _0x360b9c='keydown'!==_0x5123f3;this['element']['addEventListener'](_0x5123f3,this['_onUserEvent']['bind'](this),{'passive':_0x360b9c,'signal':this['abortController']['signal']});}}['start'](){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,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'](_0x272ab5){if(this['isRunning']){if('keydown'===_0x272ab5['type']){const _0x3cb6c6=_0x272ab5['key'];if(!fs['includes'](_0x3cb6c6))return;}_0x272ab5 instanceof WheelEvent?_0x272ab5['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x1ae269,scrollHeight:_0x6252ce,clientHeight:_0x519895}=this['element'];return _0x6252ce-_0x1ae269-_0x519895<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class je extends _0x19a8c6{constructor(_0x28a8cf,_0x2e520f){super(_0x28a8cf),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2e520f)});}['_createSkeletonItems'](_0x39ec33){const _0x237d7b=['ck','ck-ai-skeleton__item'];return _0x39ec33['map'](_0x1a8361=>{let _0x15808b='';switch(_0x1a8361['attributes']['align']){case'right':_0x15808b='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x15808b='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x15808b='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x1a8361['tag'],'attributes':{'class':[..._0x237d7b,_0x1a8361['attributes']['class']?_0x1a8361['attributes']['class']:''],'style':'width:\x20'+_0x1a8361['attributes']['width']+';\x20height:\x20'+_0x1a8361['attributes']['height']+';'+_0x15808b}};});}}const Ce={'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':ta(0x5,'100%','44px','right'),'aiChatResources':ta(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 ta(_0xbc4bc8,_0x17bee6,_0x5499d4,_0x41c3f1){return new Array(_0xbc4bc8)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x17bee6,'height':_0x5499d4,'align':_0x41c3f1}}));}class ji extends _0x19a8c6{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x14377b,_0x5da7aa){super(_0x14377b),this['_bodyCollection']=_0x5da7aa,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...St)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new be(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x5b1593,_0xe5afd6){let _0x5a0cad;'ai-reply'===_0x5b1593?_0x5a0cad=new ke(this['locale'],_0xe5afd6):'ai-suggestion-reply'===_0x5b1593?(_0x5a0cad=new ge(this['locale'],_0xe5afd6),_0x5a0cad['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x5a0cad='user-message'===_0x5b1593?new ve(this['locale'],_0xe5afd6,this['_bodyCollection']):'interaction-header'===_0x5b1593?new Et(this['locale'],_0xe5afd6):new _e(_0xe5afd6),this['children']['add'](_0x5a0cad);}async['updateReplyItem']({id:_0x12d096,parsedContent:_0x21aa13,renderingStrategy:_0x4c38ef,abortSignal:_0x1606a3}){const _0x18f429=this['getItemById'](_0x12d096);if(!(_0x18f429 instanceof ke))throw new _0x29f184('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x18f429,'id':_0x12d096,'parsedContent':_0x21aa13});await _0x18f429['updateContent']({'parsedContent':_0x21aa13,'renderingStrategy':_0x4c38ef,'abortSignal':_0x1606a3});}async['updateWebSources'](_0x3e28cc,_0x5aa837){const _0x23d4b6=this['getItemById'](_0x3e28cc);if(_0x23d4b6 instanceof ge)_0x23d4b6['updateSources'](_0x5aa837);else{if(!(_0x23d4b6 instanceof ke))throw new _0x29f184('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x23d4b6,'id':_0x3e28cc,'sources':_0x5aa837});_0x23d4b6['updateSources'](_0x5aa837);}}async['updateSuggestionItem']({id:_0x2d71e4,parts:_0x2c3707,renderingStrategy:_0x3b730b,abortSignal:_0x88068d}){const _0x221dce=this['getItemById'](_0x2d71e4);if(!(_0x221dce instanceof ge))throw new _0x29f184('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x221dce,'id':_0x2d71e4,'parts':_0x2c3707});await _0x221dce['updateContent']({'parts':_0x2c3707,'renderingStrategy':_0x3b730b,'abortSignal':_0x88068d});}['updateSuggestionPartState']({id:_0x1f01d6,index:_0x338001,state:_0x32dbe5}){const _0x1c4dbd=this['getItemById'](_0x1f01d6);if(!(_0x1c4dbd instanceof ge))throw new _0x29f184('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1f01d6});_0x1c4dbd['updatePartState'](_0x338001,_0x32dbe5);}['markItemAsDone'](_0x2a286b){this['getItemById'](_0x2a286b)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x284f00=>_0x284f00['options']['id']);}['removeItem'](_0x1c9836){this['children']['remove'](this['getItemById'](_0x1c9836));}['scrollToSuggestion'](_0x1a490a,_0xe379a9){const _0x511f5e=this['getItemById'](_0x1a490a);if(!(_0x511f5e instanceof ge))return void _0xadd6c3('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x1a490a,'partIndex':_0xe379a9});const _0x1be1a0=_0x511f5e['getPartView'](_0xe379a9);_0x1be1a0?_0x2992c3({'target':_0x1be1a0['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0xadd6c3('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x1a490a,'partIndex':_0xe379a9});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x5a67aa=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x5a67aa,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x1895d9=new je(this['locale'],Ce['aiFeed']);return _0x1895d9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x579dcb=>!_0x579dcb)]}}),_0x1895d9;}['_createFeedItems'](){const _0x5eab5f=new _0x19a8c6(this['locale']);return _0x5eab5f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x5eab5f;}['_createFeedLoader'](){const _0x4d8ce5=new _0x19a8c6(this['locale']);return _0x4d8ce5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x4474ae=>!_0x4474ae)]},'children':this['_createLoaderChildren']()}),_0x4d8ce5;}['_createLoaderChildren'](){const _0x41cb5a=new Le();return _0x41cb5a['isVisible']=!0x0,[_0x41cb5a,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4112db){const _0x25b7d9=this['children']['find'](_0x5378d9=>_0x5378d9['options']['id']['includes'](_0x4112db));if(!_0x25b7d9)throw new _0x29f184('ai-chat-feed-view-item-not-found',this,{'id':_0x4112db});return _0x25b7d9;}['setLoadingMessage'](_0x13bc0b){this['set']('loadingMessage',_0x13bc0b);}['toggleLoadingSkeleton'](_0x2cb937){this['set']('isLoadingSkeletonVisible',_0x2cb937);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x556745{['filter'](){let _0x395972=0x0;for(const _0x14bbf2 of this['items'])_0x395972+=_0x14bbf2['items']['length'];return{'resultsCount':_0x395972,'totalItemsCount':_0x395972};}}class ds extends _0x4dc60c{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x547ee1,_0x168cb6){super(_0x547ee1,{'queryView':{'label':'','creator':_0x5c1a66,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x547ee1),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x168cb6,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ds['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ds['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',(_0x880bc2,_0x1ca06d)=>!_0x880bc2&&!_0x1ca06d),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x238fc6,_0x4421b1)=>{this['isUploadInProgress']||this['isEmpty']||_0x238fc6['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4421b1());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x1277aa=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x1277aa)return this['queryView']['errorText']=C(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x161f8f=_0x4e9308(_0x1277aa);this['fire']('sendUserMessage',_0x161f8f),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x2d119b){this['queryView']['fieldView']['set']('placeholder',_0x2d119b);}['_createSubmitButton'](){const _0xee0d2f=new _0x14ee0a(this['locale']);return _0xee0d2f['set']({'icon':_0x2a3f1e,'label':C(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0xee0d2f['on']('execute',()=>{this['submit']();}),_0xee0d2f;}['setIsUploadInProgress'](_0x249422){this['isUploadInProgress']=_0x249422;}['_setUpAddContextButtonPositioning'](){const _0xe7dca3=this['locale'],_0x1d8404=()=>{_0x110318['window']['requestAnimationFrame'](()=>{if(_0x4b2614(this['element'])){const _0x159df3=new _0x31eb3f(this['queryView']['fieldView']['element']),_0x59c04e=new _0x31eb3f(this['_addContextButtonView']['element']),_0x1ec5b5=_0x159df3['width'],_0x5d08f5='rtl'===_0xe7dca3['uiLanguageDirection']?'right':'left';_0x159df3['excludeScrollbarsAndBorders']();const _0x563108=_0x1ec5b5-_0x159df3['width']+0x1;this['_addContextButtonView']['element']['style'][_0x5d08f5]='calc('+(_0x1ec5b5-_0x59c04e['width']-_0x563108)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x1d8404),this['on']('render',()=>{_0x1d8404(),this['_queryViewResizeObserver']=new _0x474d80(this['queryView']['fieldView']['element'],()=>{_0x1d8404();});});}}const Aa='ck-ai-chat__prompt-capabilities',ga='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls-button--commands',ma='ck-ai-chat-controls__model-selection',pa='ck-ai-chat-controls__model-selection__item-name',Ta='ck-ai-chat-controls__model-selection__item-description',Ca='ck-ai-chat-controls__model-selection__item-capabilities',wa='n';class ps extends _0x19a8c6{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0xaab24f){super(_0xaab24f),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),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,'modelSelectorVisible',_0x146eb2=>_0x146eb2),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x458e19=>_0x458e19?this['_modelSelectionDropdown']['buttonView']['label']:C(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x37d67c=>_0x37d67c),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x3c4c7b=>_0x3c4c7b),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x5f5aab=>!_0x5f5aab),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x513bc1=>C(this['locale'],_0x513bc1?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0xfbb6cf=>_0xfbb6cf),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x322ec7=>!_0x322ec7),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1a9590=>C(this['locale'],_0x1a9590?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Aa]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x5d69ef(),_0x21ea2c(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x55b6d9,_0x4593a3){if(this['set']('modelSelectorVisible',!(_0x4593a3&&_0x55b6d9['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x55b6d9?.['length']){const _0x156a37=ki['getLocalized'](this['locale'],_0x55b6d9);for(const _0x578770 of _0x156a37){const _0x3deb51=new _0x3cd526({'label':_0x578770['name'],'withText':!0x0,'role':'menuitemradio','id':_0x578770['id'],'model':_0x578770});_0x3deb51['bind']('isOn')['to'](this,'activeModelId',_0x27622b=>_0x27622b===_0x578770['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x3deb51,'labelView':new fa(this['locale'],_0x578770)});}}}['setWebSearch'](_0x572b32){this['set']('webSearchActive',_0x572b32);}['setReasoning'](_0x4401d3){this['set']('reasoningActive',_0x4401d3);}['setModel'](_0x3105bc){if(!_0x3105bc)return;this['activeModelId']=_0x3105bc['id'],this['activeModelName']=_0x3105bc['name']||_0x3105bc['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x3105bc['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x3105bc['name']);const _0x20801a=_0x3105bc['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x20801a),this['_webSearchButton']['set']('isVisible',_0x20801a);const _0x167de8=_0x3105bc['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x167de8),this['_reasoningButton']['set']('isVisible',_0x167de8);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x4ae748){this['set']('modelSelectorEnabled',!0x1),_0x4ae748&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x47b5c7=new _0x14ee0a();return _0x47b5c7['set']({'label':C(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x2870b9,'class':ga,'isToggleable':!0x0,'tooltipPosition':wa}),_0x47b5c7['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x47b5c7;}['_createReasoningButton'](){const _0xf07d17=new _0x14ee0a();return _0xf07d17['set']({'label':C(this['locale'],'AI_CHAT_REASONING'),'icon':_0x49c2da,'class':ga,'isToggleable':!0x0,'tooltipPosition':wa}),_0xf07d17['on']('execute',()=>{this['fire']('toggleReasoning');}),_0xf07d17;}['_createCommandsButton'](){const _0x5675f3=new _0x14ee0a();return _0x5675f3['set']({'label':C(this['locale'],'AI_CHAT_COMMANDS'),'icon':Ct,'withText':!0x0,'class':ga,'isToggleable':!0x0,'tooltip':C(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':wa}),_0x5675f3['extendTemplate']({'attributes':{'class':[Ea]}}),_0x5675f3['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x5675f3;}['_createModelSelectionDropdown'](){const _0x30618d=_0x10d828(this['locale']);return _0x30618d['set']({'panelPosition':'ne','class':[ma]}),_0x30618d['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':wa}),this['listenTo'](_0x30618d,'execute',_0x150916=>{this['fire']('selectModel',_0x150916['source']['model']);}),_0x30618d;}['_createModelNameView'](){const _0x1e9d05=new Ko(this['locale']);return _0x1e9d05['bind']('text')['to'](this,'activeModelName',_0x519213=>_0x519213??''),_0x1e9d05['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x5242d8,_0x51a0ad)=>!_0x5242d8&&!_0x51a0ad?.['toLowerCase']()['startsWith']('agent')),_0x1e9d05;}}let fa=class extends _0x53816d{constructor(_0x3f9862,_0x4120f3){super();const _0x1268d5=this['bindTemplate'],_0x4cd2c3=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1268d5['to']('style'),'id':_0x1268d5['to']('id')},'children':[{'tag':'div','attributes':{'class':[pa]},'children':[{'text':_0x1268d5['to']('text')}]},{'tag':'div','attributes':{'class':[Ta]},'children':[{'tag':'span','children':[{'text':_0x4120f3['description']}]}]},{'tag':'div','attributes':{'class':[Ca]},'children':_0x4cd2c3}]}),_0x4cd2c3['addMany'](this['_getCapabilityParts'](_0x3f9862,_0x2870b9,'AI_CHAT_SEARCH_WEB',_0x4120f3['capabilities']['webSearch']?.['enabled']??!0x1)),_0x4cd2c3['addMany'](this['_getCapabilityParts'](_0x3f9862,_0x49c2da,'AI_CHAT_REASONING',_0x4120f3['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x47a321,_0xb626ce,_0x134b48,_0x1be93a){const _0x3dba87=new _0x50b9df();_0x3dba87['content']=_0xb626ce;const _0xf12eb9=new _0x19a8c6(_0x47a321);_0xf12eb9['setTemplate']({'tag':'span','children':[{'text':C(_0x47a321,_0x134b48)+':\x20'}]});const _0x4932eb=new _0x19a8c6(_0x47a321);return _0x4932eb['setTemplate']({'tag':'span','children':[{'text':C(_0x47a321,_0x1be93a?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3dba87,_0xf12eb9,_0x4932eb];}};class Ko extends _0x19a8c6{constructor(_0x2b853b){super(_0x2b853b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x663d68=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x663d68['if']('isVisible','ck-hidden',_0x21aa3a=>!_0x21aa3a)]},'children':[{'text':_0x663d68['to']('text')}]});}}const Sa='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class To extends _0x19a8c6{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x35207f){super(_0x35207f),this['focusTracker']=new ts(),this['keystrokes']=new _0x1f1bc5(),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 $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x3c4593=>{this['focusTracker']['add'](_0x3c4593['element']),this['keystrokes']['listenTo'](_0x3c4593['element']);}),_0x1e2b1f({'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'](_0x514b7c){this['urlInputField']['errorText']=_0x514b7c,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x3cbbfb=new _0x14ee0a(this['locale']);return _0x3cbbfb['set']({'icon':_0x25d049,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x3cbbfb;}['_createUrlInputField'](){const _0x4f035e=new _0x5cba56(this['locale'],th);return _0x4f035e['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x4f035e['fieldView']['set']({'placeholder':C(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x4f035e;}['_createConfirmButton'](){const _0x58d4ee=new _0x14ee0a(this['locale']);return _0x58d4ee['set']({'icon':_0x270303,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x58d4ee;}['_setupTemplate'](){const _0x6f04d5=new _0x5720b1(this['locale'],{'label':C(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x6f04d5['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Sa,'tabindex':'-1'},'children':[_0x6f04d5,{'tag':'div','attributes':{'class':Oa},'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',_0x180d8b=>{_0x180d8b['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x1bc2a3,_0x24c5be)=>{this['clear'](),this['fire']('cancel'),_0x24c5be();});}['_handleSubmit'](){const _0x96f346=this['getValue']()['trim']();_0x96f346?this['_isValidUrl'](_0x96f346)?(this['clearError'](),this['fire']('submitUrl',_0x96f346)):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x30a2b1=this['getValue']()['trim'](),_0x5cf220=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x30a2b1['length']>0x0&&!_0x5cf220;}['_isValidUrl'](_0x31689d){try{return!!new URL(_0x31689d);}catch{return!0x1;}}}const Ra='ck-ai-chat-resources__item',ba='ck-ai-chat-resources__item--in-context',Na='ck-ai-chat-resources__item-title',ka='ck-ai-chat-resources__item__icon';class tc extends _0x2269a3{['resource'];['_titleView'];['_iconView'];constructor(_0x2f88a9,_0x44ee66){super(_0x2f88a9),this['resource']=_0x44ee66,this['set']('isInContext',!!_0x44ee66['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x3d3ff7){if(_0x3d3ff7['isInContext'])return _0x270303;switch(_0x3d3ff7['type']){case Xt['DOCUMENT']:return _0x776ddc;case Xt['URL']:return _0x339b47;case Xt['FILE']:case Xt['TEXT']:return _0x5b8c8e;default:return _0x625012;}}['highlightText'](_0x59faaf){if(!_0x59faaf||''===_0x59faaf['trim']())return void this['_titleView']['highlightText'](null);const _0x22d2c1=new RegExp(_0x418237(_0x59faaf),'gi');this['_titleView']['highlightText'](_0x22d2c1);}['updateResourceState'](_0x332df8){this['resource']['isInContext']=_0x332df8,this['isInContext']=_0x332df8,this['_updateIcon']();}['_createTitleView'](){const _0x54ceb5=new _0x39d67c();return _0x54ceb5['text']=this['resource']['label'],_0x54ceb5['extendTemplate']({'tag':'span','attributes':{'class':[Na]}}),_0x54ceb5;}['_createIconView'](){const _0x590715=new _0x50b9df();return _0x590715['content']=this['getResourceIcon'](this['resource']),_0x590715;}['_setupTemplate'](){const _0x5f0ed4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ra,_0x5f0ed4['if']('isVisible','ck-hidden',_0x2c295=>!_0x2c295),_0x5f0ed4['if']('isInContext',ba)]},'children':[{'tag':'div','attributes':{'class':[ka]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x5f0ed4['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const ya='ck-ai-chat-resources__list';class Rr extends _0x556745{['_source'];constructor(_0x799932,_0x176893){super(_0x799932),this['_source']=_0x176893,this['extendTemplate']({'attributes':{'class':[ya]}});}['setResources'](_0x4f032c,_0x430642){this['items']['clear']();let _0x12ba75=_0x4f032c;if(this['_source']['useDefaultFiltering']&&_0x430642&&''!==_0x430642['trim']()){const _0x5ef366=new RegExp(_0x430642['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x12ba75=_0x4f032c['filter'](_0x3378c1=>_0x5ef366['test'](_0x3378c1['label']));}for(const _0xb1e195 of _0x12ba75){const _0x3ccc33=new tc(this['locale'],_0xb1e195);_0x3ccc33['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0xb1e195);}),this['items']['add'](_0x3ccc33);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x430642);}['highlightText'](_0x22fc90){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x518a3f=>{_0x518a3f['highlightText'](_0x22fc90);});}['updateResourceState'](_0x244585,_0x4d1ad1){for(const _0x544cae of this['items']){const _0x15ea72=_0x544cae;_0x15ea72['resource']['id']===_0x244585&&_0x15ea72['updateResourceState'](_0x4d1ad1);}}['_handleResourceSelection'](_0x213eda,_0xb755f5){this['fire']('addResourceToContext',{'source':_0x213eda,'resource':_0xb755f5});}}class qr extends _0x5cba56{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x3e6d57){const t=_0x3e6d57['t'],_0xcbf35e={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':C(_0x3e6d57,'AI_CHAT_SEARCH_RESOURCES')};super(_0x3e6d57,_0xcbf35e['creator']),this['label']=_0xcbf35e['label'],this['_viewConfig']=_0xcbf35e,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x3e6d57,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x302d7b){this['fire']('search',_0x302d7b);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x50b9df(),this['iconView']['content']=_0x5a0eff,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x2b7a72,t){this['resetButtonView']=new _0x14ee0a(_0x2b7a72),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x510307,'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',_0x19ba7e=>!_0x19ba7e),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 Or extends _0x19a8c6{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x18c56c,_0x3dcfba){super(_0x18c56c),this['_source']=_0x3dcfba['source'],this['_searchInputVisibleFrom']=_0x3dcfba['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 _0xf07a6b([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new qr(this['locale']);}['_createSearchSection'](){const _0x46d15c=new _0x19a8c6(this['locale']);return _0x46d15c['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1318c9,_0x4bab4e)=>{this['loadResources'](_0x4bab4e),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x4bab4e);}),_0x46d15c;}['_createResourcesListView'](){const _0xdfa8=new Rr(this['locale'],this['_source']);return _0xdfa8['delegate']('addResourceToContext')['to'](this),_0xdfa8['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0xdfa8;}['_createSkeletonView'](){const _0xa23d64=new je(this['locale'],Ce['aiChatResources']);return _0xa23d64['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xa944e4=>!_0xa944e4)]}}),_0xa23d64;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x380672){const _0x459f1e=_0x223274();this['_latestLoadResourcesUid']=_0x459f1e,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x380672,'uid':_0x459f1e}),this['isLoading']=!0x0;}['setResources'](_0x173421,_0x5cefb9){if(_0x5cefb9&&_0x5cefb9!==this['_latestLoadResourcesUid'])return;const _0x5a6de3=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x173421,_0x5a6de3),_0x173421['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x59569b,_0x2df02f){this['_resourcesListView']['updateResourceState'](_0x59569b,_0x2df02f);}}const va='ck-ai-chat-context-controls__source-balloon-panel',xa='ck-button-icon\x20ck-button-back',La='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class ko{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x4a1b82,_0x1521ba,_0x1b3414){this['_locale']=_0x4a1b82,this['_bodyCollection']=_0x1521ba,this['_config']=_0x1b3414;}['showSourceResourcesBalloon'](_0x56394d){let _0x3a9939=this['_sourceResourceBalloons']['get'](_0x56394d['id']);_0x3a9939||(_0x3a9939=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x56394d['id'],_0x3a9939),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x3a9939)),this['_addSourceResourceContent'](_0x3a9939,_0x56394d),_0x3a9939['show']();const _0x28a5b2=this['_config']['getTargetElement']();_0x28a5b2&&_0x3a9939['pin']({'target':_0x28a5b2,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x4eff3c,_0x13accc,_0x2c158a){const _0x1edd87=this['_sourceResourceBalloons']['get'](_0x4eff3c);if(!_0x1edd87)return;const _0x12de0b=this['_getResourcesViewFromBalloon'](_0x1edd87);_0x12de0b&&(_0x12de0b['setResources'](_0x13accc,_0x2c158a),_0x12de0b['once']('change:isLoading',()=>{_0x1edd87['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x5194cc){const _0x246ce0=this['_sourceResourceBalloons']['get'](_0x5194cc);_0x246ce0&&requestAnimationFrame(()=>{_0x246ce0['hide'](),this['_sourceResourceBalloons']['delete'](_0x5194cc),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0xf06264 of this['_sourceResourceBalloons']['values']())if(_0xf06264['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x8e3aa8,_0x9c123a,_0x5acf5a){const _0x59284b=this['_sourceResourceBalloons']['get'](_0x8e3aa8);if(!_0x59284b||!_0x59284b['isVisible'])return;const _0x4c4937=this['_config']['getTargetElement']();if(!_0x4c4937)return;_0x59284b['pin']({'target':_0x4c4937,'limiter':this['_config']['getLimiterElement']()});const _0x4205f4=this['_getResourcesViewFromBalloon'](_0x59284b);_0x4205f4&&_0x4205f4['updateResourceState'](_0x9c123a,_0x5acf5a);}['destroy'](){for(const _0x59f1a7 of this['_sourceResourceBalloons']['values']())_0x59f1a7['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0xdd7c2c=new _0x500981(this['_locale']);return _0xdd7c2c['extendTemplate']({'attributes':{'class':va}}),this['_bodyCollection']['add'](_0xdd7c2c),_0xdd7c2c;}['_addSourceResourceContent'](_0x5669fd,_0x3a06b3){_0x5669fd['content']['clear']();const _0x194d39=this['_createBalloonHeader'](_0x5669fd,_0x3a06b3);_0x5669fd['content']['add'](_0x194d39);const _0x519dd5=this['_createBalloonResourcesView'](_0x3a06b3);_0x5669fd['content']['add'](_0x519dd5);}['_createBalloonHeader'](_0x46854d,_0x2f5c89){const _0x495277=this['_createBackButton'](_0x46854d),_0x2a0e39=new _0x5720b1(this['_locale'],{'label':_0x2f5c89['label'],'class':La});return _0x2a0e39['children']['add'](_0x495277,0x0),_0x2a0e39;}['_createBackButton'](_0x55e9ca){const _0x25dea8=new _0x14ee0a(this['_locale']);return _0x25dea8['set']({'icon':_0x25d049,'tooltip':C(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':xa}),_0x25dea8['on']('execute',()=>{_0x55e9ca['hide'](),this['_config']['onBackToContext']();}),_0x25dea8;}['_createBalloonResourcesView'](_0x33d8b1){const _0x17103b=new Or(this['_locale'],{'source':_0x33d8b1,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x17103b['on']('loadSourceResources',(_0x33ca74,_0x37fe6f)=>{this['_config']['onLoadSourceResources'](_0x37fe6f);}),_0x17103b['on']('addResourceToContext',(_0x1d4858,_0x3de587)=>{this['_config']['onResourceSelected'](_0x3de587['source'],_0x3de587['resource']),this['closeSourceResourceBalloon'](_0x33d8b1['id']);}),_0x17103b;}['_getResourcesViewFromBalloon'](_0x14555d){const _0x29a4d8=_0x14555d['content']['get'](0x1);return _0x29a4d8 instanceof Or?_0x29a4d8:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x5be58d){_0x29a34e({'emitter':_0x5be58d,'contextElements':[_0x5be58d['element']],'callback':()=>{_0x5be58d['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x5be58d['isVisible']});}}const ms=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],Eo='ck-ai-chat-context-controls',vo='ck-ai-chat-context-controls__pending-contexts',Vo='ck-ai-chat-context-controls__add-context-balloon-panel',Io='ck-ai-chat-context-controls__add-context-button',Po='ck-ai-chat-context-controls__url-balloon-panel',Ro='ck-ai-chat-context-controls__balloon-button',Uo='ck-ai-chat-context-controls__balloon-button-source',Lo='ck-ai-chat-controls-button',No='ck-ai-chat-context-chips-wrapper-balloon',Oo='ck-ai-chat-controls_context_show-more-button',Mo='ck-ai-chat-context-controls__show-more-balloon-panel',Ho='ck-ai-chat',jo=[_0x500981['defaultPositions']['northArrowSouthWest'],_0x500981['defaultPositions']['northArrowSouth'],_0x500981['defaultPositions']['northArrowSouthEast'],_0x500981['defaultPositions']['southArrowNorthWest'],_0x500981['defaultPositions']['southArrowNorth'],_0x500981['defaultPositions']['southArrowNorthEast']];class us extends _0x19a8c6{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x13636d,_0x42f690){super(_0x13636d),this['bodyCollection']=_0x42f690['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x13636d),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x13636d),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x13636d),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x13636d,_0x42f690);const _0x3e6f8a={'cssClasses':{'showMoreButton':Oo,'showMoreBalloon':Mo,'overflowContainer':No,'controlsButton':Lo}};this['_overflowManager']=new Ao(_0x13636d,this['_currentContextsChips'],_0x3e6f8a,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'](_0x26a8e4,_0x294d1b){const _0x6098df=this['_createContextButton'](_0x26a8e4,'current',!0x0,_0x294d1b);this['_addContextToCollection'](_0x6098df,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x40ad61){this['_removeContextFromCollection'](_0x40ad61,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x40ad61,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x4227c8,_0x266501){let _0x2924c0=this['_currentContextsChips']['find'](_0x474007=>_0x474007['id']===_0x4227c8);_0x2924c0||(_0x2924c0=this['_overflowManager']['overflowChips']['find'](_0x115778=>_0x115778['id']===_0x4227c8)),_0x2924c0&&(_0x2924c0['isLoading']=_0x266501);}['setConversationContext'](_0x18d181){this['_conversationContextsChips']['clear']();for(const _0x3ea7c9 of _0x18d181){const _0x55ce80=this['_createContextButton'](_0x3ea7c9,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x55ce80,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x4afa5c,_0xdc0e7f,_0x5a9d4b){this['_resourcesBalloonView']['updateResourceState'](_0x4afa5c,_0xdc0e7f,_0x5a9d4b);}['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;}['_showSourceResourcesBalloon'](_0x9c4e83){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x9c4e83),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x544be5,_0x5ca372,_0x2a28cc,_0x458053){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x544be5,_0x2a28cc,_0x458053);}['closeSourceResourceBalloon'](_0x15d32d){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x15d32d),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x1d9f31){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x1d9f31),this['_setAddContextButtonEnabled'](_0x1d9f31);}['_setAddContextButtonEnabled'](_0x179542){const _0x58961d=!_0x179542['document']['isHidden']&&_0x179542['document']['enabled'],_0x339d45=_0x179542['urls']['enabled'],_0x164676=_0x179542['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x58961d||_0x339d45||_0x164676;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Eo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':vo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x243ca2){const _0x46a5c9=new _0x14ee0a(_0x243ca2);return _0x46a5c9['set']({'label':C(_0x243ca2,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Lo+'\x20'+Io,'icon':_0x3725c8,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x46a5c9;}['_createAddContextBalloonPanelView'](_0x3d79ad){return this['_createBaseBalloonPanel'](_0x3d79ad,Vo);}['_createUrlBalloonPanelView'](_0x221855){const _0x312e61=this['_createBaseBalloonPanel'](_0x221855,Po);return this['_addUrlContent'](_0x312e61,_0x221855),_0x312e61;}['_createResourcesBalloonView'](_0x21d430,_0x3d2f2d){const _0x1c5c1b={'searchInputVisibleFrom':_0x3d2f2d['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});},'onResourceSelected':(_0x1972e1,_0xf030f0)=>{this['fire']('addResourceToContext',{'source':_0x1972e1,'resource':_0xf030f0});},'onLoadSourceResources':_0xaedb7b=>{this['fire']('loadSourceResources',_0xaedb7b);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new ko(_0x21d430,_0x3d2f2d['bodyCollection'],_0x1c5c1b);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ho)||document['body'];}['_createBaseBalloonPanel'](_0x59fc6a,_0x30cfe1){const _0x4a5716=new _0x500981(_0x59fc6a);return _0x4a5716['extendTemplate']({'attributes':{'class':_0x30cfe1}}),this['bodyCollection']['add'](_0x4a5716),_0x4a5716;}['_setBalloonPanelContent'](_0x25f1de,_0x11452f,_0x16b131){if(_0x25f1de['content']['clear'](),!_0x16b131['document']['isHidden']&&_0x16b131['document']['enabled']){const _0xbc8436=this['_createBalloonButton'](_0x11452f,{'label':C(_0x11452f,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x776ddc});_0xbc8436['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x25f1de['content']['add'](_0xbc8436);}if(_0x16b131['urls']['enabled']){const _0x5212e0=this['_createBalloonButton'](_0x11452f,{'label':C(_0x11452f,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x339b47});_0x5212e0['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}),this['_urlInputView']['focus']();}),_0x25f1de['content']['add'](_0x5212e0);}if(_0x16b131['files']['enabled']){const _0x29e96f=new _0xbecc3f(_0x11452f);_0x29e96f['set']({'label':C(_0x11452f,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x44b793,'withText':!0x0,'tooltip':!0x0,'class':Ro,'allowMultipleFiles':!0x0}),_0x29e96f['on']('done',(_0x378296,_0x2f95ec)=>{this['fire']('addFileToContext',_0x2f95ec),this['hideAddContextBalloonPanel']();}),_0x29e96f['tooltip']=!0x0,_0x25f1de['content']['add'](_0x29e96f);}for(const _0x394ef8 of _0x16b131['sources']){const _0x96a74b=this['_createBalloonButton'](_0x11452f,{'label':_0x394ef8['label'],'icon':_0x394ef8['icon']||_0x625012,'type':'source'});_0x25f1de['content']['add'](_0x96a74b),_0x96a74b['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x394ef8);});}}['_addUrlContent'](_0x13d5be,_0x39a990){this['_urlInputView']=new To(_0x39a990),this['_urlInputView']['on']('submitUrl',(_0x31c1c7,_0x7ea80a)=>{this['_handleUrlSubmit'](_0x7ea80a);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});}),_0x13d5be['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x519237,_0x58d143){const _0x1fd6aa='source'===_0x58d143['type']?new Da(_0x519237):new _0x14ee0a(_0x519237);return _0x1fd6aa['set']({'label':_0x58d143['label'],'icon':_0x58d143['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ro}),_0x1fd6aa;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x29a34e({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x20d781){const _0x231cd6=this['_addContextBalloonConfig'];_0x231cd6['buttonView']['isOn']=_0x20d781,_0x20d781?_0x231cd6['balloonView']['show']():_0x231cd6['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x22ed01,buttonView:_0x2226f3,hideMethod:_0x56dbf3}=this['_addContextBalloonConfig'];_0x29a34e({'emitter':_0x22ed01,'contextElements':[_0x22ed01['element'],_0x2226f3['element']],'callback':()=>{_0x56dbf3();},'activator':()=>_0x2226f3['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x45fcbe,_0x463a61,_0x43b1d9=!0x1,_0x32474a=!0x1){const _0x59d47a='conversation'===_0x463a61||!0x0===_0x45fcbe['isReadOnly'],_0x43596a=new bo(this['locale'],_0x45fcbe,_0x59d47a,_0x43b1d9,_0x32474a);return _0x59d47a||_0x43596a['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x43596a['id']);}),_0x43596a;}['_addContextToCollection'](_0x227a33,_0x247d03){_0x247d03['add'](_0x227a33,0x0);}['_removeContextFromCollection'](_0x342561,_0x4b8667){const _0x574d63=_0x4b8667['find'](_0xbacc7c=>_0xbacc7c['id']===_0x342561);_0x574d63&&_0x4b8667['remove'](_0x574d63);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}));}['_handleUrlSubmit'](_0x49d9a8){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x49d9a8);}}class Da extends _0x14ee0a{['arrowView'];constructor(_0x52239e){super(_0x52239e),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Uo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x570a0c=new _0x50b9df();return _0x570a0c['content']=_0xf874d9,_0x570a0c['extendTemplate']({'attributes':{'class':Uo+'__arrow'}}),_0x570a0c;}}class bs extends _0x19a8c6{['_cancelButtonView'];['_loaderView'];constructor(_0x3b2ea1){super(_0x3b2ea1),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 _0xc70e2e=new _0x14ee0a(this['locale']);return _0xc70e2e['set']({'label':C(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x4c89d2}),_0xc70e2e['on']('execute',()=>{this['fire']('abortPromptStream');}),_0xc70e2e;}['_createLoaderView'](){const _0x5ec841=new _0x19a8c6(this['locale']);return _0x5ec841['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':C(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x5ec841;}}class Bi extends _0x19a8c6{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x3b1e1e,_0x32beb6){super(_0x3b1e1e),this['_contextPanelView']=this['_createContextPanelView'](_0x3b1e1e,{'bodyCollection':_0x32beb6['bodyCollection'],'searchInputVisibleFrom':_0x32beb6['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x3b1e1e),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x3b1e1e),this['_loaderView']=this['_createLoaderView'](_0x3b1e1e),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x3b1e1e),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),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'](...ms)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x11ba23=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x11ba23['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x11ba23['if']('isLoading','ck-hidden',_0x1e61f5=>_0x1e61f5||!this['isModelAvailable']),_0x11ba23['if']('isModelAvailable','ck-hidden',_0x488756=>!_0x488756||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x11ba23['if']('isLoading','ck-hidden',_0x35f4f2=>!_0x35f4f2)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x11ba23['if']('isModelAvailable','ck-hidden',_0x52b17c=>_0x52b17c)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x29a34e({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x4df9db,_0x497191){return new us(_0x4df9db,_0x497191);}['_createPromptInputView'](_0x392209){return new ds(_0x392209,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x4f29a5){return new ps(_0x4f29a5);}['_createLoaderView'](_0x592e8f){return new bs(_0x592e8f);}['_createModelUnavailableMessageView'](_0x425ba9){const _0x585090=new gs(_0x425ba9);return _0x585090['delegate']('startConversation')['to'](this),_0x585090;}['_handlePromptInputFocus'](_0x377684,_0x2c999c,_0x2a106a){_0x2a106a?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3c1b0e,_0x34467d){this['_contextPanelView']['addContextItem'](_0x3c1b0e,_0x34467d);}['removeContextItem'](_0x2f3ef6){this['_contextPanelView']['removeContextItem'](_0x2f3ef6);}['setContextItemLoading'](_0x2734ca,_0x16a323){this['_contextPanelView']['setContextItemLoading'](_0x2734ca,_0x16a323);}['setIsUploadInProgress'](_0x357a2d){this['_promptInputView']['setIsUploadInProgress'](_0x357a2d);}['setConversationContext'](_0x364c29){this['_contextPanelView']['setConversationContext'](_0x364c29);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x2adef2,_0x49611a,_0x3e44bf){this['_contextPanelView']['updateResourceState'](_0x2adef2,_0x49611a,_0x3e44bf);}['setWebSearch'](_0x2152cc){this['_promptCapabilitiesView']['setWebSearch'](_0x2152cc);}['setReasoning'](_0x31785a){this['_promptCapabilitiesView']['setReasoning'](_0x31785a);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x491e93){this['_contextPanelView']['setAddContextOptions'](_0x491e93);}['setInputPlaceholder'](_0x15f4dd){this['_promptInputView']['setPlaceholderText'](_0x15f4dd);}['setModelList'](_0x3738ec,_0x2a12ff){this['_displayedModels']=_0x3738ec,this['_promptCapabilitiesView']['setModelList'](_0x3738ec,_0x2a12ff);}['setModel'](_0x3efc78){(_0x3efc78?this['_displayedModels']['find'](_0x214dcd=>_0x214dcd['id']===_0x3efc78['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3efc78)):_0x3efc78?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x24d4b2){this['_promptCapabilitiesView']['disableModelSelector'](_0x24d4b2);}['populateSourceResourceBalloon'](_0x5a5e93,_0x4b1eca,_0x940c8e,_0x555f72){this['_contextPanelView']['populateSourceResourceBalloon'](_0x5a5e93,_0x4b1eca,_0x940c8e,_0x555f72);}['closeSourceResourceBalloon'](_0x3470a1){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3470a1);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class gs extends _0x19a8c6{constructor(_0x555aea){super(_0x555aea);const _0x38daaf=new _0x14ee0a(_0x555aea);_0x38daaf['set']({'label':C(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x38daaf['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':C(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x38daaf]}]});}}class Fi extends _0x5720b1{['conversationStartButton'];['resizeButton'];constructor(_0x4a95b9,_0x56c60d){super(_0x4a95b9,{'label':C(_0x4a95b9,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_t}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x4a95b9),this['children']['add'](this['conversationStartButton']),_0x56c60d&&(this['resizeButton']=Cs(_0x4a95b9,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x92779f){const _0x48edee=new _0x14ee0a(_0x92779f);return _0x48edee['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5c1cc1,'class':'ck-ai-chat__start-conversation'}),_0x48edee['on']('execute',()=>{this['fire']('startConversation');}),_0x48edee;}}class Vi extends _0x19a8c6{constructor(_0x1c2ebc){super(_0x1c2ebc),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':C(_0x1c2ebc,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0x19a8c6{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x1912d0,_0x11d67a){super(_0x1912d0),this['_bodyCollection']=new qt(_0x1912d0),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Fi(_0x1912d0,_0x11d67a['showResizeButton']),this['chatHeader']['delegate'](...St)['to'](this),this['chatFeed']=new ji(_0x1912d0,this['_bodyCollection']),this['chatFeed']['delegate'](...St)['to'](this),this['chatControls']=new Bi(_0x1912d0,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x11d67a['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...St)['to'](this),this['chatDisclaimer']=new Vi(_0x1912d0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x1912d0['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x258ead,_0x2bf621,_0x112c68,_0x2d3cb8){this['chatControls']['populateSourceResourceBalloon'](_0x258ead,_0x2bf621,_0x112c68,_0x2d3cb8);}['closeSourceResourceBalloon'](_0x3f6ad1){this['chatControls']['closeSourceResourceBalloon'](_0x3f6ad1);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class et extends _0x171820{static get['requires'](){return[at];}['_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(_0x9012b8){super(_0x9012b8);const _0x515254=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x515254['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...St)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x1f42a3,{showDiff:_0xdec8ba})=>{this['showDiff']=_0xdec8ba;}),_0x515254['view']['addTab']({'id':'chat','buttonLabel':C(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_t,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0xee490e=>_0xee490e),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x10c012=>_0x10c012),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x527b45){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x527b45['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':C(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x263b81,staticMessage:_0x19289a}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x263b81,'initialContent':'<p>'+_0x19289a+'</p>'});}['addFeedItemUserMessage'](_0x501962){const _0x34ff07=_0x501962['quickActionData']?.['displayedPrompt']||_0x501962['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x501962['contextItems']['values']()),'initialContent':'<p>'+_0x34ff07+'</p>','id':_0x501962['id']});}['addFeedItemError']({errorMessage:_0x21c5de,id:_0x13962b}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x21c5de+'</p>','id':_0x13962b});}['addFeedItemAIReply'](_0xc545e7){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xc545e7['interactionId']+':'+_0xc545e7['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x466e36){const _0x304f86=P(this['context']);let _0x5bc02a=_0x304f86['config']['get']('ai.availableReplyActions')||[...k];if(_0x304f86['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x592b67=_0x304f86['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x592b67,'value');}}else _0x5bc02a=_0x5bc02a['filter'](_0x4bbedd=>'insertSuggestion'!=_0x4bbedd);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x466e36['interactionId']+':'+_0x466e36['id'],'areActionsDisabled':_0x466e36['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x5bc02a}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x2d937f,_0x20f644){const _0x351a14=this['_view']['chatFeed']['children']['last'];if(_0x351a14 instanceof Et)return this['_view']['chatFeed']['children']['remove'](_0x351a14),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x2d937f['id'],'capabilities':{'isWebSearchEnabled':_0x351a14['capabilities']['isWebSearchEnabled']||_0x20f644['isWebSearchEnabled'],'isReasoningEnabled':_0x351a14['capabilities']['isReasoningEnabled']||_0x20f644['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x2d937f['id'],'capabilities':_0x20f644});}['updateFeedInteractionHeader'](_0x2ec047){const _0x39b4c8=this['_view']['chatFeed']['children']['find'](_0xfb580b=>_0xfb580b['options']['id']==_0x2ec047['id']&&_0xfb580b instanceof Et);_0x39b4c8&&_0x39b4c8['set']('isVisible',_0x2ec047['isVisible']);}async['updateFeedItemAIReplyContent'](_0x595a40){const _0x1f36e6=_0x595a40['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1c54a8=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x595a40,'abortSignal':_0x1c54a8,'renderingStrategy':_0x1f36e6}),_0x595a40['isDone']&&this['markFeedItemAsDone'](_0x595a40['id']);});}['updateFeedItemAIReplySources'](_0x5397b7,_0x57f57e){this['_view']['chatFeed']['updateWebSources'](_0x5397b7,_0x57f57e);}async['updateFeedItemAIReplySuggestionContent'](_0x1f1a2d){const _0x118034=_0x1f1a2d['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x27b7a0=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x1f1a2d,'abortSignal':_0x27b7a0,'renderingStrategy':_0x118034}),_0x1f1a2d['isDone']&&this['markFeedItemAsDone'](_0x1f1a2d['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x508df7){this['_view']['chatFeed']['updateSuggestionPartState'](_0x508df7);}['markFeedItemAsDone'](_0x17e82c){this['_view']['chatFeed']['markItemAsDone'](_0x17e82c);}['removeFeedInteraction'](_0x392a97){this['_view']['chatFeed']['getItemIds']()['filter'](_0x35c2f8=>_0x35c2f8['startsWith'](_0x392a97))['forEach'](_0x1d16f9=>this['_view']['chatFeed']['removeItem'](_0x1d16f9));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x90f4e4){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x8c3a53=>_0x8c3a53['startsWith'](_0x90f4e4['id']))['forEach'](_0x3d0418=>this['markFeedItemAsDone'](_0x3d0418)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0xddbbbd,_0x5cc186){this['_view']['chatControls']['addContextItem'](_0xddbbbd,_0x5cc186);}['removeContextItem'](_0x420647){this['_view']['chatControls']['removeContextItem'](_0x420647);}['setContextItemLoading'](_0x5b70ab,_0x3d3adc){this['_view']['chatControls']['setContextItemLoading'](_0x5b70ab,_0x3d3adc);}['setIsUploadInProgress'](_0x65efa6){this['_view']['chatControls']['setIsUploadInProgress'](_0x65efa6);}['setConversationContext'](_0x3caa85){this['_view']['chatControls']['setConversationContext'](_0x3caa85);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x1c6f22,_0x3a6dc7,_0x2a5adb){this['_view']['chatControls']['updateResourceState'](_0x1c6f22,_0x3a6dc7,_0x2a5adb);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x130986){this['_view']['chatControls']['setAddContextOptions'](_0x130986);}['updateCapabilities'](_0x5d079e){this['_view']['chatControls']['setWebSearch'](_0x5d079e['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x5d079e['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x5d079e));}['setSelectedModel'](_0x244d2a,_0x45ca37){this['_view']['chatControls']['setModel'](_0x244d2a),_0x45ca37&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x109172){this['feedItemRenderingStrategy']=_0x109172;}['toggleLoadingSkeleton'](_0x50970c){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x50970c);}['resetConversationTitle'](){this['setConversationTitle'](C(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x1c9149,_0x40868d=!0x1){if(_0x40868d&&!It()&&_0x1c9149['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x1c9149);this['_view']['chatHeader']['label']=_0x1c9149;}['setLoadingMessage'](_0x375d92){const _0x3b5340=this['_getLoadingMessage'](_0x375d92);this['_view']['chatFeed']['setLoadingMessage'](_0x3b5340);}['_animateConversationTitle'](_0x2f3ba0){let _0x47d925=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x2f3ba0[_0x47d925],_0x47d925++,_0x47d925===_0x2f3ba0['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x516b84){this['_view']['chatHeader']['isMaximized']=_0x516b84;}['_getLoadingMessage'](_0x3e16a8){return _0x3e16a8?_0x3e16a8['isWebSearchEnabled']&&_0x3e16a8['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x3e16a8['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x3e16a8['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x1a9b41){return _0x1a9b41?_0x1a9b41['isWebSearchEnabled']&&_0x1a9b41['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x1a9b41['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x1a9b41['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x24b0ae,_0x21a851,_0x46be25,_0x3219ee){this['_view']['populateSourceResourceBalloon'](_0x24b0ae,_0x21a851,_0x46be25,_0x3219ee);}['closeSourceResourceBalloon'](_0x5c6d68){this['_view']['closeSourceResourceBalloon'](_0x5c6d68);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x127baf,_0x33f95a){this['_view']['chatFeed']['scrollToSuggestion'](_0x127baf,_0x33f95a);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Ji extends _0x556745{['sections'];constructor(_0xd7a5a,_0xe69186){super(_0xd7a5a),this['sections']=_0xe69186,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x391af4){let _0x463364=0x0,_0x806d82=0x0;for(const _0x773f33 of this['sections']){const {resultsCount:_0x358c06,totalItemsCount:_0x50cc76}=_0x773f33['filter'](_0x391af4);_0x463364+=_0x358c06,_0x806d82+=_0x50cc76;}return{'resultsCount':_0x463364,'totalItemsCount':_0x806d82};}}class Ki extends _0x2269a3{['title'];['itemsViews'];['_itemsListView'];constructor(_0x5d4d33,{title:_0x43de46,items:_0x4eebe9}){super(_0x5d4d33);const _0x595413=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x43de46,this['itemsViews']=_0x4eebe9;const _0x45a078=new _0x19a8c6(_0x5d4d33);_0x45a078['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x556745(_0x5d4d33),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x595413['if']('isVisible','ck-hidden',_0x4f9a20=>!_0x4f9a20)]},'children':[_0x45a078,this['_itemsListView']]});}['filter'](_0x1ca0cb){const _0x3e309b=this['itemsViews']['length'];let _0xdf09e2=0x0;for(const _0x589441 of this['itemsViews']){if(_0x1ca0cb){const _0x1cbe34=_0x589441['isMatching'](_0x1ca0cb);_0x589441['isVisible']=!!_0x1cbe34,_0x589441['highlightText'](_0x1ca0cb);}else _0x589441['isVisible']=!0x0,_0x589441['highlightText'](null);_0x589441['isVisible']&&_0xdf09e2++;}return this['isVisible']=_0xdf09e2>0x0,{'resultsCount':_0xdf09e2,'totalItemsCount':_0x3e309b};}['getItem'](_0x20451a){return this['itemsViews']['find'](_0x1b8211=>_0x1b8211['id']===_0x20451a);}['removeItem'](_0x2ad9d5){const _0x44e5b5=this['itemsViews']['indexOf'](_0x2ad9d5);-0x1!==_0x44e5b5&&(this['itemsViews']['splice'](_0x44e5b5,0x1),this['_itemsListView']['items']['remove'](_0x2ad9d5));}}class Qi extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x36aabc(_0x2269a3){['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(_0x3907e9,_0x5a41a5){super(_0x3907e9);const _0x56404b=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x5a41a5['pinned']),this['set']('loadingState',null),this['id']=_0x5a41a5['id'];const {title:_0x1e76db,createdAt:_0x52bd33,active:_0x58baa2=!0x1}=_0x5a41a5;this['_titleView']=new _0x39d67c(),this['_titleView']['text']=_0x1e76db,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x479aa5=this['_createCheckView'](),_0x25b351=this['_createPinButtonView'](_0x3907e9),_0x48d8d4=this['_createMenuDropdownView'](),_0x68e6a5=this['_createEditInputView'](_0x3907e9,_0x1e76db),_0x2215ad=this['_createAcceptEditButtonView'](_0x3907e9,_0x68e6a5),_0x207d84=this['_createCancelEditButtonView'](_0x3907e9,_0x68e6a5);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x25b351),this['actions']['add'](_0x48d8d4),this['on']('change:isEdit',(_0x5c4e2a,_0x1a1bba,_0x46d682)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x46d682?(this['actions']['add'](_0x2215ad),this['actions']['add'](_0x207d84),this['mainContent']['add'](_0x68e6a5),_0x68e6a5['element']['focus']()):(this['actions']['add'](_0x25b351),this['actions']['add'](_0x48d8d4),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x58baa2?'ck-ai-chat-history__item--active':'',_0x56404b['if']('isVisible','ck-hidden',_0x738dff=>!_0x738dff),_0x56404b['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',_0x56404b['if']('loadingState','ck-hidden',_0x2cfaf3=>!!_0x2cfaf3)]},'children':_0x58baa2?[_0x479aa5]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x56404b['if']('loadingState','ck-hidden',_0x4f8718=>!_0x4f8718)]},'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',_0x56404b['if']('loadingState','ck-hidden',_0x2e6874=>!!_0x2e6874)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x56404b['if']('loadingState','ck-hidden',_0x54356b=>!_0x54356b)]},'children':[{'text':_0x56404b['to']('loadingState',_0x1e473e=>_0x1e473e?C(this['locale'],Qi['LOADING_LABELS'][_0x1e473e]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x52bd33]}]},{'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'](_0x1199cc){this['_titleView']['text']=_0x4e9308(_0x1199cc);}['updateLoadingState'](_0x415a82,_0x25fbbd){this['set']('loadingState',_0x25fbbd?_0x415a82:null);}['_createCheckView'](){const _0x5eca09=new _0x50b9df();return _0x5eca09['set']({'content':_0x547952}),_0x5eca09;}['_createPinButtonView'](_0x27b200){const _0x3fec88=new _0x14ee0a(_0x27b200);return _0x3fec88['set']({'label':C(_0x27b200,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x324381,'withText':!0x1,'tooltip':!0x0}),_0x3fec88['bind']('isOn')['to'](this,'pinned'),_0x3fec88['on']('execute',()=>{const _0x303bd3=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x303bd3});}),_0x3fec88;}['_createMenuDropdownView'](){const _0x57ecc0=_0x10d828(this['locale'],_0xfe9b05),_0x5d95f5=_0x57ecc0['panelView']['children'];_0x57ecc0['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x56f15d}),_0x57ecc0['panelPosition']='sw';const _0x3c76f1=new _0x14ee0a(this['locale']);_0x3c76f1['label']=C(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x3c76f1['withText']=!0x0,_0x3c76f1['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3b003f=new _0x14ee0a(this['locale']);_0x3b003f['label']=C(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3b003f['withText']=!0x0,_0x3b003f['on']('execute',()=>{this['showConfirm'](C(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5b8790=new _0x556745(this['locale']),_0x12f656=new _0x2269a3(this['locale']);_0x12f656['children']['add'](_0x3c76f1);const _0x4841f9=new _0x2269a3(this['locale']);return _0x4841f9['children']['add'](_0x3b003f),_0x5b8790['items']['addMany']([_0x12f656,_0x4841f9]),_0x5d95f5['add'](_0x5b8790),_0x57ecc0;}['_createEditInputView'](_0x1566dd,_0x45c2ed){const _0x54b331=new _0x2efa28(_0x1566dd),_0x9423df=_0x54b331['bindTemplate'];return _0x54b331['value']=_0x45c2ed,_0x54b331['extendTemplate']({'on':{'keydown':_0x9423df['to'](_0x4761ec=>{'Enter'==_0x4761ec['key']&&this['_commitEditInputValue'](_0x54b331);})}}),_0x54b331;}['_createAcceptEditButtonView'](_0xcc0391,_0x926359){const _0xe55d1b=new _0x14ee0a(_0xcc0391);return _0xe55d1b['set']({'icon':_0x547952,'withText':!0x1,'tooltip':C(_0xcc0391,'AI_CHAT_HISTORY_ACCEPT')}),_0xe55d1b['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0xe55d1b['on']('execute',()=>{this['_commitEditInputValue'](_0x926359);}),_0xe55d1b;}['_commitEditInputValue'](_0x56d9c3){const _0x508201=_0x56d9c3['element']['value']||'';this['_titleView']['text']=_0x508201,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x508201});}['_createCancelEditButtonView'](_0x59db9b,_0x57af83){const _0xbb8164=new _0x14ee0a(_0x59db9b);return _0xbb8164['set']({'icon':_0x510307,'withText':!0x1,'tooltip':C(_0x59db9b,'AI_CHAT_HISTORY_CANCEL')}),_0xbb8164['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0xbb8164['on']('execute',()=>{this['isEdit']=!0x1,_0x57af83['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0xbb8164;}['_createSpinnerView'](){const _0x5b5229=new Le('tiny');return _0x5b5229['isVisible']=!0x0,_0x5b5229;}['isMatching'](_0x2fea35){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x2fea35)?{'title':!0x0}:null;}['highlightText'](_0x21ecf0){this['_titleView']['highlightText'](_0x21ecf0);}}class vt extends _0x19a8c6{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x407c9e,_0x9c5e63){super(_0x407c9e),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x40367b=new _0x5720b1(_0x407c9e,{'label':C(_0x407c9e,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x9c5e63&&(this['resizeButton']=Cs(_0x407c9e,this),_0x40367b['children']['add'](this['resizeButton'])),this['sectionsView']=new Ji(_0x407c9e,[]),this['sectionsView']['delegate'](...Xi)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),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':[_0x40367b,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x20286a=new _0x3bb44f(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5f3b70=>C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5f3b70),'secondary':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x20286a['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x20286a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x22cb9b=>!_0x22cb9b)]}}),_0x20286a;}['_createSkeletonView'](){const _0x91cad2=new je(this['locale'],Ce['aiHistory']);return _0x91cad2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3f8bdb=>!_0x3f8bdb)]}}),_0x91cad2;}['_createErrorView'](){const _0x1b372e=new _0x19a8c6(this['locale']),_0x22bc58=new _0x14ee0a(this['locale']);return _0x22bc58['set']({'withText':!0x1,'icon':_0x510307,'class':'ck-ai-chat-error__dismiss-button'}),_0x22bc58['bind']('isVisible')['to'](this,'hasItems',_0x1f2b61=>!!_0x1f2b61),_0x22bc58['on']('execute',()=>{this['errorMessage']='';}),_0x1b372e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x7fb3f0=>!_0x7fb3f0)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x22bc58]}),_0x1b372e;}['_createEmptyStateView'](){const _0x358611=new _0x14ee0a(this['locale']);_0x358611['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5c1cc1,'class':'ck-ai-chat__start-conversation'}),_0x358611['on']('execute',()=>{this['fire']('openChat');});const _0x3458d5=new _0x19a8c6(this['locale']);return _0x3458d5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x2f2f5e=>!_0x2f2f5e)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[C(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x358611]}),_0x3458d5;}['_createListItemViews'](_0x5cb095,_0x201de9){const _0x22efc4=[];for(const _0x30a330 of _0x5cb095){const _0x14e338=new Qi(_0x201de9,_0x30a330);_0x14e338['delegate'](...Xi)['to'](this),_0x22efc4['push'](_0x14e338);}return _0x22efc4;}['updateHistoryItemsWithCategories'](_0x2c0329){const _0x42907e=this['locale']||'en',_0x5efdbb=[];for(const _0x1666f5 of _0x2c0329){const _0x1f8f01=this['_createListItemViews'](_0x1666f5['items'],_0x42907e);_0x5efdbb['push'](new Ki(_0x42907e,{'title':_0x1666f5['title'],'items':_0x1f8f01}));}this['sectionsView']['sections']=_0x5efdbb,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x5efdbb),this['hasItems']=_0x2c0329['some'](_0x3eba2d=>_0x3eba2d['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x37c4f4){for(const _0x41c8dd of this['sectionsView']['sections']){const _0x124266=_0x41c8dd['getItem'](_0x37c4f4);if(_0x124266){if(_0x41c8dd['removeItem'](_0x124266),0x0===_0x41c8dd['itemsViews']['length']){const _0x2e9c08=this['sectionsView']['sections']['indexOf'](_0x41c8dd);-0x1!==_0x2e9c08&&(this['sectionsView']['sections']['splice'](_0x2e9c08,0x1),this['sectionsView']['items']['remove'](_0x41c8dd));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x128e1e,_0x337c99){for(const _0x5f0f9d of this['sectionsView']['sections']){const _0x4331b8=_0x5f0f9d['getItem'](_0x128e1e);if(_0x4331b8){_0x4331b8['updateTitle'](_0x337c99);break;}}}['updateItemLoadingState'](_0x3351b6,_0x2e6b62,_0x3b69c6){for(const _0xb3839b of this['sectionsView']['sections']){const _0x3ecc3a=_0xb3839b['getItem'](_0x3351b6);if(_0x3ecc3a){_0x3ecc3a['updateLoadingState'](_0x2e6b62,_0x3b69c6);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x2505da=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x2505da);}}}const Xi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class jt extends _0x171820{static get['requires'](){return[at];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x46ab7c){super(_0x46ab7c);const _0x2c07c3=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x2c07c3['showResizeButton']),this['_historyView']['delegate'](...Xi)['to'](this),_0x2c07c3['view']['addTab']({'id':'history','buttonLabel':C(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x120ac7){this['_historyView']['removeHistoryItem'](_0x120ac7);}['updateItems'](_0x3346e3){this['_historyView']['updateHistoryItemsWithCategories'](_0x3346e3);}['updateItemTitle'](_0x18cf03,_0x3bdc9a){this['_historyView']['updateItemTitle'](_0x18cf03,_0x3bdc9a);}['updateItemLoadingState'](_0x4b9a5b,_0x141002,_0x12520b){this['_historyView']['updateItemLoadingState'](_0x4b9a5b,_0x141002,_0x12520b);}['setLoadingSkeleton'](_0x5c48f7){this['_historyView']['isLoading']=_0x5c48f7;}['showError'](_0x3e3659){this['_historyView']['errorMessage']=_0x3e3659;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x534b79){this['_historyView']['isMaximized']=_0x534b79;}}class De extends _0x4572ab(){['id'];['createdAt'];constructor({id:_0x504071,title:_0xdfdfd3,createdAt:_0x16edcc,updatedAt:_0x5d7083,pinned:_0x3ccf4c}){super(),this['id']=_0x504071,this['createdAt']=new Date(_0x16edcc),this['set']('title',_0xdfdfd3),this['set']('updatedAt',_0x5d7083?new Date(_0x5d7083):null),this['set']('pinned',_0x3ccf4c||!0x1);}['updateTitle'](_0x2cc687){this['set']('title',_0x4e9308(_0x2cc687)),this['updatedAt']=new Date();}['updatePinned'](_0x144ae0){this['set']('pinned',_0x144ae0),this['updatedAt']=new Date();}}class Tt extends _0x135bec(){['items']=[];['connector'];['group'];constructor({connector:_0x569805,group:_0x822aee}){super(),this['connector']=_0x569805,this['group']=_0x822aee;}async['init'](){try{const _0x3a7a89=this['connector']['fetchConversations'](this['group']),_0x13c593=await _0x3a7a89['getConversations']();this['loadItems'](_0x13c593);}catch(_0x3aaa34){this['fire']('error',{'error':_0x3aaa34,'operation':'init'});}}['addItem'](_0x65cd47){this['items']['push'](_0x65cd47);}async['removeItem'](_0x3e9e0c){const _0x25db53=this['items']['findIndex'](_0x418b2e=>_0x418b2e['id']===_0x3e9e0c);if(-0x1===_0x25db53)return!0x1;try{return await this['connector']['deleteConversation'](_0x3e9e0c)['execute'](),this['items']['splice'](_0x25db53,0x1),this['fire']('itemRemoved',{'itemId':_0x3e9e0c}),!0x0;}catch(_0x339cbb){return this['fire']('error',{'error':_0x339cbb,'operation':'removeItem','itemId':_0x3e9e0c}),!0x1;}}['getItem'](_0x37cca7){return this['items']['find'](_0x25177c=>_0x25177c['id']===_0x37cca7);}async['updateItemTitle'](_0x1c878a,_0x249aa4){const _0x54b766=this['getItem'](_0x1c878a);if(!_0x54b766)return!0x1;try{return await this['connector']['updateConversation'](_0x1c878a,{'title':_0x249aa4})['getResult'](),_0x54b766['updateTitle'](_0x249aa4),this['fire']('itemUpdated',{'itemId':_0x1c878a,'updates':{'title':_0x249aa4}}),!0x0;}catch(_0x18aed1){return this['fire']('error',{'error':_0x18aed1,'operation':'updateItemTitle','itemId':_0x1c878a}),!0x1;}}async['updateItemPinned'](_0x3b9c5c,_0x262002){const _0x379347=this['getItem'](_0x3b9c5c);if(!_0x379347)return!0x1;try{return await this['connector']['updateConversation'](_0x3b9c5c,{'pinned':_0x262002})['getResult'](),_0x379347['updatePinned'](_0x262002),this['fire']('itemUpdated',{'itemId':_0x3b9c5c,'updates':{'pinned':_0x262002}}),!0x0;}catch(_0x3331b7){return this['fire']('error',{'error':_0x3331b7,'operation':'updateItemPinned','itemId':_0x3b9c5c}),!0x1;}}['loadItems'](_0x52f6ab){try{this['items']=[],_0x52f6ab['map'](_0x43cfa3=>{this['addItem'](new De(_0x43cfa3));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x397fb6){this['fire']('error',{'error':_0x397fb6,'operation':'loadItems'});}}['getItems'](_0x26c1b5={}){const _0x393ced=void 0x0!==_0x26c1b5['pinned']&&_0x26c1b5['pinned'],_0x167d7e=_0x26c1b5['from']?new Date(_0x26c1b5['from']['getFullYear'](),_0x26c1b5['from']['getMonth'](),_0x26c1b5['from']['getDate']()):null,_0x44fb68=_0x26c1b5['to']?new Date(_0x26c1b5['to']['getFullYear'](),_0x26c1b5['to']['getMonth'](),_0x26c1b5['to']['getDate']()):null;return this['items']['filter'](_0x4b8beb=>{if(_0x4b8beb['pinned']!==_0x393ced)return!0x1;if(_0x44fb68){const _0x33f29a=new Date(_0x4b8beb['createdAt']['getFullYear'](),_0x4b8beb['createdAt']['getMonth'](),_0x4b8beb['createdAt']['getDate']());return _0x167d7e?_0x167d7e['getTime']()===_0x44fb68['getTime']()?_0x33f29a['getTime']()===_0x167d7e['getTime']():_0x33f29a<_0x44fb68&&_0x33f29a>=_0x167d7e:_0x33f29a<_0x44fb68;}return!0x0;});}}class yt extends _0x171820{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[s,tt,jt,at];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](s),this['_aiChatHistoryUi']=this['context']['plugins']['get'](jt),this['_aiChatController']=this['context']['plugins']['get'](tt);const _0xbba085=this['context']['plugins']['get'](at),_0x36c65d=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x36c65d}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x26ac45,_0x577c13)=>{this['_setItemLoading'](_0x577c13['id'],'remove'),this['_handleRemove'](_0x577c13['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0xfd69db,_0xd1759e)=>{this['_setItemLoading'](_0xd1759e['id'],'rename'),this['_handleEditTitle'](_0xd1759e['id'],_0xd1759e['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x2a2fdb,_0x10a925)=>{void 0x0!==_0x10a925['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x10a925['itemId'],_0x10a925['updates']['title']),void 0x0!==_0x10a925['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x10a925['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x2b3eed,_0x2f4c62)=>{this['_aiChatController']['handleRemovedConversation'](_0x2f4c62['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x2f4c62['itemId']),this['_clearItemLoading'](_0x2f4c62['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x5679da,_0x1e34ba)=>{this['_handleHistoryErrorUI'](_0x1e34ba['error'],_0x1e34ba['operation'],_0x1e34ba['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x11280a,_0x138356)=>{this['_handleSelectConversation'](_0x138356['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x420da4,_0x2d116a)=>{const _0x2e346b=_0x2d116a['pinned']?'pin':'unpin';this['_setItemLoading'](_0x2d116a['id'],_0x2e346b),this['_handleTogglePin'](_0x2d116a['id'],_0x2d116a['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0xbba085['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0xbba085['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0xbba085,'resizedTabs',(_0x1f94ab,_0x29c39e)=>{this['_setIsMaximized'](_0x29c39e);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0xbba085['resize']();});}async['_handleEditTitle'](_0x36b7cb,_0x5d57ad){await this['history']['updateItemTitle'](_0x36b7cb,_0x5d57ad);}async['_handleTogglePin'](_0xfd71dd,_0x29d424){await this['history']['updateItemPinned'](_0xfd71dd,_0x29d424);}async['_handleRemove'](_0x25b21f){await this['history']['removeItem'](_0x25b21f);}async['_handleSelectConversation'](_0x11defa){await this['_aiChatController']['loadConversation'](_0x11defa);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x1131ce=this['_aiChatController']['activeConversation']?.['id'],_0x1fd4ed=this['_getCategorizedItems']()['map'](_0x352d27=>({'title':_0x352d27['title'],'items':_0x352d27['items']['map'](_0x874cb9=>({'id':_0x874cb9['id'],'title':_0x874cb9['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x874cb9['createdAt'])['toLocaleDateString'](),'active':_0x874cb9['id']===_0x1131ce,'pinned':_0x874cb9['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x1fd4ed);}['_setItemLoading'](_0x4149b6,_0x1dd968){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4149b6,_0x1dd968,!0x0);}['_clearItemLoading'](_0x1b203d){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1b203d,null,!0x1);}['_handleHistoryErrorUI'](_0x7205e0,_0x3e6710,_0x5d233f){const _0x1b7aa3=this['_generateErrorMessage'](_0x3e6710,_0x5d233f);this['_aiChatHistoryUi']['showError'](_0x1b7aa3),_0x5d233f&&this['_clearItemLoading'](_0x5d233f),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x38d2ab,_0x288d11){const _0xbecaf7=_0x288d11?this['history']['getItem'](_0x288d11):null,_0x3803a0=_0xbecaf7?.['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x38d2ab){case'updateItemTitle':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3803a0);case'updateItemPinned':{const _0x585687=C(this['context']['locale'],_0xbecaf7?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x585687,_0x3803a0]);}case'removeItem':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3803a0);case'init':case'loadItems':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x2cd49e=new Date(),_0x459b2e=new Date(_0x2cd49e['getFullYear'](),_0x2cd49e['getMonth'](),_0x2cd49e['getDate']()),_0x2cc678=new Date(_0x459b2e);_0x2cc678['setDate'](_0x2cc678['getDate']()-0x1);const _0x351091=new Date(_0x459b2e);_0x351091['setDate'](_0x351091['getDate']()-0xe);const _0x1b1bb2=this['history']['getItems']({'pinned':!0x0}),_0x54c73e=this['history']['getItems']({'from':_0x459b2e,'to':_0x459b2e}),_0x290284=this['history']['getItems']({'from':_0x2cc678,'to':_0x2cc678}),_0x45e7c=this['history']['getItems']({'from':_0x351091,'to':_0x2cc678}),_0x4cb8a7=this['history']['getItems']({'to':_0x351091}),_0x134a32=[];return _0x1b1bb2['length']>0x0&&_0x134a32['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x1b1bb2}),_0x54c73e['length']>0x0&&_0x134a32['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x54c73e}),_0x290284['length']>0x0&&_0x134a32['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x290284}),_0x45e7c['length']>0x0&&_0x134a32['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x45e7c}),_0x4cb8a7['length']>0x0&&_0x134a32['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x4cb8a7}),_0x134a32;}['_setIsMaximized'](_0x2e88ec){this['_aiChatHistoryUi']['setIsMaximized'](_0x2e88ec);}}class it extends _0x171820{static get['requires'](){return[yt,jt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Pa extends _0x171820{static get['requires'](){return[tt,c,et,it];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x278904){super(_0x278904),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](tt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](tt)['startConversation']();}async['sendMessage']({message:_0x4ecc8d,quickActionData:_0x291724}){await this['context']['plugins']['get'](tt)['sendMessage']({'message':_0x4ecc8d,'quickActionData':_0x291724});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](tt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](tt)['focusPromptInput']();}}class go extends Nt{constructor(_0x9f1866){super(_0x9f1866);const _0x4235e5=_0x9f1866['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4235e5,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0xc9c6e4=this['editor']['plugins']['get']('AITabs')['view'];_0xc9c6e4['isVisible']=!_0xc9c6e4['isVisible'];}}class bt extends _0x5f3288{static get['requires'](){return[at];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x46b4af=this['editor'];_0x46b4af['commands']['add']('toggleAi',new go(_0x46b4af)),_0x46b4af['ui']['componentFactory']['add']('toggleAi',()=>{const _0x2c9cd2=this['_createAIUIButton'](_0x14ee0a);return _0x2c9cd2['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x2c9cd2;}),_0x46b4af['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x496514=this['_createAIUIButton'](_0x5b3955);return _0x496514['set']({'role':'menuitemcheckbox'}),_0x496514;});}['_createAIUIButton'](_0x1d465b){const _0x475b3b=this['editor'],_0x534c60=_0x475b3b['commands']['get']('toggleAi'),_0x66739a=new _0x1d465b(_0x475b3b['locale']);return _0x66739a['set']({'label':C(_0x475b3b['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x9ba23f,'isToggleable':!0x0}),_0x66739a['bind']('isEnabled')['to'](_0x534c60),_0x66739a['bind']('isOn')['to'](_0x534c60,'value',_0xc91052=>!!_0xc91052),this['listenTo'](_0x66739a,'execute',()=>{_0x534c60['execute']();}),_0x66739a;}}class Ha extends _0x5f3288{static get['requires'](){return[bt,Pt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Gt(_0xb28d37,_0x5e841c,_0x51078a=!0x1,_0x45237c=!0x0,_0x287659=!0x0){return()=>{const _0x18176b=_0xb28d37['locale'],_0x169f77=new _0x14ee0a(_0x18176b),_0x4d1f75=_0x169f77['bindTemplate'];_0x287659&&_0x169f77['extendTemplate']({'on':{'mouseenter':_0x4d1f75['to'](()=>{_0x169f77['focus']();})}});const _0x5a4c92=_0x5e841c['icon']??_0x5e841c['parent']?.['icon'];return _0x169f77['set']({'label':_0x5e841c['displayedPrompt'],'withText':_0x51078a,'role':'menuitem','icon':_0x45237c?_0x5a4c92??_0x32dec3:void 0x0,'tooltip':!_0x51078a,'class':'ck-ai-quick-actions-button'}),_0x169f77['on']('execute',()=>{_0xb28d37['editing']['view']['focus'](),_0xb28d37['commands']['execute']('aiQuickAction',_0x5e841c);}),_0x169f77;};}const Ls='menu',Ns='menuitem';class co extends _0x19a8c6{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x55f861,_0x50edb4,_0x2529c8,_0x3b2909){const _0x367422=_0x55f861['locale'];super(_0x367422),this['_bodyCollection']=_0x3b2909;const _0x4c92f5=this['_createListItems'](_0x55f861,_0x50edb4,_0x2529c8);this['optionsListView']=new _0x556745(_0x367422),this['optionsListView']['role']=Ls,this['optionsListView']['items']['addMany'](_0x4c92f5),this['focusTracker']=new ts(),this['keystrokes']=new _0x1f1bc5(),this['_focusables']=_0x4c92f5,this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x367422['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x471fc7,_0x140d09,_0x3486e0){const _0xa875c9=new _0xf07a6b();return _0x140d09['forEach'](_0x203b03=>{'actions'in _0x203b03?_0xa875c9['add'](this['_createActionGroupButton'](_0x471fc7,_0x203b03,_0x3486e0)):_0xa875c9['add'](this['_createActionButton'](_0x471fc7,_0x203b03));}),_0xa875c9;}['_createActionButton'](_0x43914b,_0x2ab9de){const _0x43c729=new _0x2269a3(this['locale']),_0x1dc20e=Gt(_0x43914b,_0x2ab9de,!0x0,void 0x0!==_0x2ab9de['icon'])();return _0x43c729['children']['add'](_0x1dc20e),_0x43c729;}['_createActionGroupButton'](_0x5ae9b5,_0x5e985f,_0x3312f6){const _0x3333da=new _0x2269a3(this['locale']),_0x30d18e=new _0x36e81a(this['locale']),_0x5312b2=_0x30d18e['bindTemplate'],_0x10ea4d='rtl'===_0x3312f6['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x14eba8=this['_createGroupActionsList'](_0x5ae9b5,_0x5e985f['actions'],_0x3312f6);_0x30d18e['set']({'label':_0x5e985f['label'],'withText':!0x0,'role':Ns,'icon':_0x5e985f['icon']??_0x32dec3}),_0x30d18e['extendTemplate']({'on':{'mouseenter':_0x5312b2['to'](()=>{_0x30d18e['focus']();})}});const _0x499c42=new _0x500981(this['locale']);return _0x499c42['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x5312b2['to'](_0xe4e219=>{_0xe4e219['key']==_0x10ea4d&&(_0x30d18e['focus'](),this['_hideNestedPanel'](_0x499c42));})}}),_0x30d18e['bind']('isOn')['to'](_0x499c42,'isVisible'),this['_bodyCollection']['add'](_0x499c42),_0x499c42['content']['add'](_0x14eba8),this['_setupGroupMenuBehavior'](_0x30d18e,_0x499c42),_0x3333da['children']['add'](_0x30d18e),_0x3333da;}['_createGroupActionsList'](_0x51e181,_0x349d54,_0x475b83){const _0x4303f4=new _0x556745(this['locale']);return _0x4303f4['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x349d54['forEach'](_0xb0b8f9=>{const _0x51192e=new _0x2269a3(this['locale']),_0x35e74f=Gt(_0x51e181,_0xb0b8f9,!0x0,!0x1)();_0x51192e['children']['add'](_0x35e74f),_0x475b83['focusTracker']['add'](_0x35e74f),_0x4303f4['items']['add'](_0x51192e);}),_0x4303f4;}['_setupGroupMenuBehavior'](_0x3c9aaa,_0x1e93ff){const _0x137d7b=_0x3c9aaa['bindTemplate'],_0x4798d1='rtl'===_0x3c9aaa['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x3c9aaa['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x137d7b['to'](()=>{this['_showNestedPanel'](_0x1e93ff,_0x3c9aaa);}),'mouseleave':_0x137d7b['to'](_0xd72d89=>{const _0x31b1de=_0xd72d89['relatedTarget'];this['_isMovingToNestedMenu'](_0x31b1de,_0x1e93ff)||this['_hideNestedPanel'](_0x1e93ff);}),'keydown':_0x137d7b['to'](_0x4d3f2d=>{_0x4d3f2d['key']==_0x4798d1&&(this['_showNestedPanel'](_0x1e93ff,_0x3c9aaa),_0x1e93ff['content']['get'](0x0)['focus']());})}}),_0x1e93ff['on']('render',()=>{_0x1e93ff['element']?.['addEventListener']('mouseleave',_0x8b5d4d=>{const _0x8d6caf=_0x8b5d4d['relatedTarget'];_0x3c9aaa['element']?.['contains'](_0x8d6caf)||this['_isMovingToNestedMenu'](_0x8d6caf,_0x1e93ff)||this['_hideNestedPanel'](_0x1e93ff);});});}['_showNestedPanel'](_0x33ca3e,_0x456e8a){this['_openNestedPanels']['forEach'](_0x33d15b=>{_0x33d15b!==_0x33ca3e&&_0x33d15b['isVisible']&&_0x33d15b['hide']();}),_0x33ca3e['show'](),_0x33ca3e['pin']({'positions':[_0x3e8342['eastSouth']],'target':_0x456e8a['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x33ca3e);}['_hideNestedPanel'](_0x13c036){_0x13c036['hide'](),this['_openNestedPanels']['delete'](_0x13c036);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x502e97=>_0x502e97['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0xae9f98,_0x4d4815){if(!_0xae9f98)return!0x1;if(_0x4d4815['element']?.['contains'](_0xae9f98))return!0x0;const _0x50b4b1=_0xae9f98;return _0x50b4b1['closest']&&(null!==_0x50b4b1['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x50b4b1['closest']('.ck-ai-quick-actions-group-list')||null!==_0x50b4b1['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Yt(_0x3d3123,_0x244d3e,_0x630bc8,_0x35797e){return()=>{const _0x5628c1=_0x3d3123['locale'],_0x345763=_0x10d828(_0x5628c1);_0x345763['buttonView']['set']({'icon':_0x630bc8['icon']??_0x32dec3,'label':_0x630bc8['label'],'tooltip':!0x0}),_0x345763['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x398085=new co(_0x3d3123,_0x244d3e,_0x345763,_0x35797e);return _0x345763['panelView']['children']['add'](_0x398085),_0x345763;};}const Ft='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\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).Avoid\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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Wt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Bt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Ot=function(_0x4f6815){return _0x4f6815['CHAT']='CHAT',_0x4f6815['ACTION']='ACTION',_0x4f6815['REVIEW']='REVIEW',_0x4f6815;}({}),Ma=function(_0x3c88a7){return _0x3c88a7['CHAT']='AIChat',_0x3c88a7['ACTION']='AIActions',_0x3c88a7['REVIEW']='AIReviewMode',_0x3c88a7;}({});class ui extends _0x5f3288{static get['requires'](){return[zt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x368928){return function(_0xc30915){const _0x2c38fa=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0xc30915['uiLanguage']),_0x12f660=_0x2c38fa||'English',_0x59f84f=[{'id':'ask-ai','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Ut},{'id':'chat-commands','label':C(_0xc30915,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Ut,'actions':[{'id':'explain','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ft['replace']('%0',_0x12f660),'type':'CHAT'},{'id':'summarize','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Wt['replace']('%0',_0x12f660),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Bt['replace']('%0',_0x12f660),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Mt},{'id':'continue','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Kt},{'id':'fix-grammar','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Rt},{'id':'adjust-length','label':C(_0xc30915,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':C(_0xc30915,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':xt,'actions':[{'id':'make-tone-casual','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Dt,'actions':[{'id':'translate-to-english','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':C(_0xc30915,'AI_QUICK_ACTIONS_OTHER'),'icon':Lt,'actions':[]}];return _0x59f84f;}(_0x368928);}['_getDefaultAndCustomActions'](){const _0x3a4102=ui['getDefaultQuickActions'](this['editor']['locale']),_0x15bafe=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x156c4b=>({..._0x156c4b,'icon':void 0x0}));return _0x3a4102['find'](_0x2fbb98=>'other'===_0x2fbb98['id'])['actions']['push'](..._0x15bafe),_0x3a4102;}['_initializeQuickActionsComponentsAndCommands'](){const _0x3fbbce=new qt(this['editor']['locale']);_0x3fbbce['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x3fbbce),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x3fbbce);}['_initializeQuickActionsDropdown'](_0x42ced7){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Yt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x32dec3,'label':C(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x42ced7));}['_prepareQuickActionsDefinition'](_0x2712e1){this['_quickActionsDefinition']=_0x2712e1['map'](_0x5903f5=>{if('actions'in _0x5903f5){const _0xdb9027=_0x5903f5;return{..._0xdb9027,'actions':_0xdb9027['actions']['map'](_0x5a09aa=>{const {actions:_0x58bfc1,..._0x1a46aa}=_0xdb9027;return{..._0x5a09aa,'parent':_0x1a46aa};})['filter'](_0x48a1eb=>this['_shouldIncludeAction'](_0x48a1eb))};}return _0x5903f5;})['filter'](_0x117acc=>'actions'in _0x117acc?_0x117acc['actions']['length']>0x0:this['_shouldIncludeAction'](_0x117acc));}['_shouldIncludeAction'](_0x57d4d1){const _0xc7edb8=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ma[_0x57d4d1['type']])&&!_0xc7edb8['includes'](_0x57d4d1['id']);}['_initializeQuickActionsComponents'](_0xbf3f1d){this['_quickActionsDefinition']['forEach'](_0x5f31d1=>{if('actions'in _0x5f31d1){const _0x1febb6=Yt(this['editor'],_0x5f31d1['actions'],_0x5f31d1,_0xbf3f1d);this['editor']['ui']['componentFactory']['add'](_0x5f31d1['id'],_0x1febb6),_0x5f31d1['actions']['forEach'](_0x197537=>{const _0x293bdd=Gt(this['editor'],_0x197537);this['editor']['ui']['componentFactory']['add'](_0x197537['id'],_0x293bdd);});}else{const _0x3c4b97=Gt(this['editor'],_0x5f31d1,!0x1,!0x0,!0x1);this['editor']['ui']['componentFactory']['add'](_0x5f31d1['id'],_0x3c4b97);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x43bef9=>{const _0xdca5ee=new _0x38710d(_0x43bef9),_0x5a8456=C(_0x43bef9,'AI_QUICK_ACTIONS_HEADING');_0xdca5ee['buttonView']['set']({'label':_0x5a8456,'icon':_0x32dec3});const _0xc1d65c=new ti(_0x43bef9);_0xc1d65c['set']({'ariaLabel':_0x5a8456,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0xafd129=>{if('actions'in _0xafd129){const _0x14ef04=_0xafd129,_0xdbda4e=new _0x44e2e2(_0x43bef9,_0xdca5ee),_0xe7b6d7=new _0x38710d(_0x43bef9),_0x103682=new ti(_0x43bef9);_0xe7b6d7['buttonView']['set']({'label':_0x14ef04['label'],'icon':_0x14ef04['icon']}),_0x14ef04['actions']['forEach'](_0x4691d2=>{const _0xa82915=new _0x44e2e2(_0x43bef9,_0xe7b6d7),_0x4400d9=new _0x5b3955(_0x43bef9);_0x4400d9['set']({'label':_0x4691d2['displayedPrompt'],'icon':_0x4691d2['icon'],'role':'menuitem'}),_0x4400d9['on']('execute',()=>{this['_executeQuickAction'](_0x4691d2);}),_0x4400d9['delegate']('execute')['to'](_0xe7b6d7),_0xa82915['children']['add'](_0x4400d9),_0x103682['items']['add'](_0xa82915);}),_0xe7b6d7['panelView']['children']['add'](_0x103682),_0xdbda4e['children']['add'](_0xe7b6d7),_0xc1d65c['items']['add'](_0xdbda4e);}else{const _0x5ee48a=_0xafd129,_0x332ccc=new _0x44e2e2(_0x43bef9,_0xdca5ee),_0x3d7044=new _0x5b3955(_0x43bef9);_0x3d7044['set']({'label':_0x5ee48a['displayedPrompt'],'icon':_0x5ee48a['icon'],'role':'menuitem'}),_0x3d7044['on']('execute',()=>{this['_executeQuickAction'](_0x5ee48a);}),_0x3d7044['delegate']('execute')['to'](_0xdca5ee),_0x332ccc['children']['add'](_0x3d7044),_0xc1d65c['items']['add'](_0x332ccc);}});const _0x196128=Object['values'](Ma)['some'](_0x5bc13b=>this['editor']['plugins']['has'](_0x5bc13b));return _0xdca5ee['set']({'isEnabled':_0x196128}),_0xdca5ee['panelView']['children']['add'](_0xc1d65c),_0xdca5ee;});}['_executeQuickAction'](_0x2139f2){const _0x14f710=this['editor'];_0x14f710['editing']['view']['focus'](),_0x14f710['commands']['execute']('aiQuickAction',_0x2139f2);const _0x5ee1c8=_0x14f710['ui']['view']['menuBarView'];_0x5ee1c8&&_0x5ee1c8['close']&&_0x5ee1c8['close']();}}class Ai extends Nt{['execute'](_0x3bd511){switch(this['_expandSelectionIfCollapsed'](),_0x3bd511['type']){case Ot['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x4298c=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x29f184('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4298c});}this['_handleAIChatAction'](_0x3bd511);break;case Ot['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x284687=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x29f184('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x284687});}this['_handleAIActionsAction'](_0x3bd511);break;case Ot['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x7f7343=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x29f184('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x7f7343});}this['_handleAIReviewAction'](_0x3bd511);}}async['_handleAIChatAction'](_0x17abea){const _0x3b16fa=this['editor']['plugins']['get']('AIChat'),_0x212eee=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x17abea['id'])_0x212eee['removeSelectionFromChatContext'](),await _0x3b16fa['addSelectionToChatContext'](),_0x3b16fa['focusPromptInput']();else await _0x3b16fa['startConversation'](),_0x212eee['removeSelectionFromChatContext'](),await _0x3b16fa['addSelectionToChatContext'](),_0x3b16fa['focusPromptInput'](),await _0x3b16fa['sendMessage']({'message':_0x17abea['prompt']||_0x17abea['displayedPrompt'],'quickActionData':{'id':_0x17abea['id'],'displayedPrompt':_0x17abea['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x112163=this['editor'],_0x357f8c=_0x112163['model']['document']['selection'];if(!_0x357f8c['isCollapsed'])return;const _0x4c1492=_0x592c76(_0x357f8c['getSelectedBlocks']())||_0x112163['model']['schema']['getLimitElement'](_0x357f8c);_0x112163['model']['change'](_0x220761=>{_0x220761['setSelection'](_0x4c1492,'in');});}['_handleAIActionsActionLabel'](_0x334692){return _0x334692['parent']?.['label']&&'other'!==_0x334692['parent']?.['id']?_0x334692['parent']['label']+':\x20'+_0x334692['displayedPrompt']:_0x334692['displayedPrompt'];}async['_handleAIActionsAction'](_0x3e7f83){const _0x1e56ca=this['editor']['plugins']['get']('AIActions'),_0xde5189=_0x3e7f83['prompt']?{'userMessage':_0x3e7f83['prompt'],'model':_0x3e7f83['model']}:{'actionName':_0x3e7f83['actionName']||_0x3e7f83['id'],'args':_0x3e7f83['args']},_0x1f20bd=this['_handleAIActionsActionLabel'](_0x3e7f83);await _0x1e56ca['executeAction'](_0xde5189,_0x1f20bd,_0x3e7f83['icon']);}async['_handleAIReviewAction'](_0x548fbd){console['log']('handleAIReviewAction',_0x548fbd);}}class gi extends _0x5f3288{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x506c74=this['editor'],_0x3603a1=new Ai(this['editor']);if(_0x506c74['commands']['add']('aiQuickAction',_0x3603a1),_0x506c74['plugins']['has']('AIChat')){const _0xb1a846=this['editor']['plugins']['get']('AIChat');_0x506c74['model']['document']['selection']['on']('change:range',(_0x4acfdf,_0x1803fd)=>{_0x1803fd['directChange']&&_0xb1a846['removeSelectionFromChatContext']();});}}}class Zt extends de{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x46f31e=this['documentContextContent']['children']['map'](_0x50ea74=>({'node':_0x50ea74,'id':pt(_0x50ea74,'data-id')})),_0x434161=this['parsedMergedContent']['children']['map'](_0x4b0857=>({'node':_0x4b0857,'id':pt(_0x4b0857,'data-id')||_0x223274()})),_0x2e8125=_0x1896dd(_0x46f31e,_0x434161,{'comparator':(_0x368203,_0x1cda25)=>_0x368203['id']==_0x1cda25['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x2e8125['length']&&_0x2e8125[_0x2e8125['length']-0x1]['removed'];)_0x2e8125['pop']();}const _0x42e692=_0x2e8125['map'](_0x99b5ae=>{const _0x5f0cb8=_0x99b5ae['added']?'new':_0x99b5ae['removed']?'removed':'modified';return{'node':_0x99b5ae['value'][0x0]['node'],'type':_0x5f0cb8,'id':_0x99b5ae['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x42e692,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x558206,_0xc4d5c7){return _0xc4d5c7;}}class l extends Jt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x3eb616){super(_0x3eb616),this['content']=_0x3eb616['content'],this['version']=_0x3eb616['version'],this['actionName']=_0x3eb616['actionName'],this['args']=_0x3eb616['args'],this['userMessage']=_0x3eb616['userMessage'],this['model']=_0x3eb616['model'];}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':Xt['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x1469a6){const _0x2c9509=new Zt({'editor':this['editor'],'documentContextContent':this['content'],..._0x1469a6});return this['replies']['push'](_0x2c9509),_0x2c9509['delegate'](...Vt)['to'](this),this['fire']('replyCreated',_0x2c9509),_0x2c9509;}}class pi extends _0x5f3288{static get['requires'](){return[s,_0x10183e,c,w,_0x2b3cb3];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0xf07a6b();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0xc2f132){super(_0xc2f132),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x2d6d78,_0x4676c7,_0x51209a){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x500c83,anchorData:_0x2f4590}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x2d6d78,_0x500c83,_0x2f4590,_0x4676c7,_0x51209a);}}const {modelFragment:_0x123b00,anchorData:_0x476c54}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x2d6d78,_0x123b00,_0x476c54,_0x4676c7,_0x51209a);}['_getExecuteDataRegular'](){const _0x3e6ab0=this['editor']['model']['document']['selection'];if(_0x3e6ab0['isCollapsed']){const _0x2bbe8a=_0x592c76(_0x3e6ab0['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x3e6ab0);this['editor']['model']['change'](_0x3ada20=>{_0x3ada20['setSelection'](_0x2bbe8a,'in');});}const _0x14d706=_0x3e6ab0['getFirstRange'](),_0x4ebd2c=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x3e6ab0),_0x14d706['start'],_0x14d706['end']),_0x540fcc=_0x3e6ab0['getFirstRange']()['start'],_0x5218f8=new Map();let _0x1a5ea8=_0x4ebd2c;for(let _0xb6cb68=0x0;_0xb6cb68<_0x540fcc['path']['length'];_0xb6cb68++)_0x5218f8['set'](_0x1a5ea8,_0x540fcc['path'][_0xb6cb68]),_0x1a5ea8=_0x1a5ea8['getChild'](0x0);return{'modelFragment':_0x4ebd2c,'anchorData':_0x5218f8};}['_getExecuteDataInTable'](){const _0x336b60=this['editor']['model']['document']['selection'],_0x25f1bd=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x173a40=_0x336b60['getFirstRange']()['start']['parent']['parent'],_0x290c13=this['_wrapWithCommonAncestors'](_0x25f1bd,this['editor']['model']['createPositionBefore'](_0x173a40),this['editor']['model']['createPositionAfter'](_0x173a40)),_0x3fa390=_0x336b60['getFirstRange']()['start'],_0x5175c0=new Map();let _0x2d59e3=_0x290c13;for(let _0x51330c=0x0;_0x51330c<_0x3fa390['path']['length'];_0x51330c++)if(_0x5175c0['set'](_0x2d59e3,_0x3fa390['path'][_0x51330c]),_0x51330c<_0x3fa390['path']['length']-0x1)_0x2d59e3=_0x2d59e3['getChild'](0x0);else{let _0x20dd89=_0x2d59e3['nextSibling'];for(;_0x20dd89;)_0x5175c0['set'](_0x20dd89,_0x3fa390['path'][_0x51330c]),_0x20dd89=_0x20dd89['nextSibling'];}return{'modelFragment':_0x290c13,'anchorData':_0x5175c0};}['_executeAction'](_0x18af41,_0x14e436,_0x40d82f,_0x4cfb7f,_0x1b21c3){const _0x508654=this['editor']['plugins']['get'](c),_0x53d312=this['editor']['plugins']['get'](w),_0xb91983=this['editor']['model']['document']['selection'],_0x28b4bc=_0x508654['modelToViewWithIds'](_0x14e436),_0xb3a052=this['editor']['data']['processor']['toData'](_0x28b4bc),_0x474153=this['editor']['model']['document']['version'],_0x488fff=[..._0xb91983['getRanges']()];let _0x4c7e71=this['editor']['config']['get']('ai.availableReplyActions')||[...k];this['editor']['plugins']['has']('TrackChanges')||(_0x4c7e71=_0x4c7e71['filter'](_0x46c8d4=>'insertSuggestion'!=_0x46c8d4));const _0x1ba078=new e(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x4c7e71});return _0x53d312['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x4cfb7f,'icon':_0x1b21c3||_0x32dec3,'mainView':_0x1ba078,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x488fff}),this['_setLoadingState'](_0x1ba078,_0x53d312),this['listenTo'](_0x53d312,'applySuggestion',()=>{this['_applyChanges'](_0x14e436,_0x40d82f,!0x1);}),this['listenTo'](_0x53d312,'insertSuggestion',()=>{this['_applyChanges'](_0x14e436,_0x40d82f,!0x0);}),this['listenTo'](_0x53d312,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x53d312,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x4455d4=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x2afb9a=_0x4455d4['changeGroups'][0x0];_0x2afb9a&&'pending'===_0x2afb9a['state']&&_0x4455d4['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x53d312);}),this['_createInteraction'](_0xb3a052,_0x474153,_0x1ba078,_0x53d312,_0x18af41);}['_wrapWithCommonAncestors'](_0x2450b3,_0x2b9187,_0xafaa14){const _0x25a784=this['editor']['model']['createRange'](_0x2b9187,_0xafaa14)['getCommonAncestor'](),_0x6cfb32=_0x25a784['is']('documentFragment')?[]:_0x25a784['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x6cfb32['length']){const _0x579381=_0x6cfb32['map'](_0x542225=>_0x542225['_clone'](!0x1));for(let _0x4bca0b=0x1;_0x4bca0b<_0x579381['length'];_0x4bca0b++)_0x579381[_0x4bca0b-0x1]['_appendChild'](_0x579381[_0x4bca0b]);return _0x579381[_0x579381['length']-0x1]['_appendChild'](_0x2450b3),new _0x25eb17(_0x579381[0x0]);}return _0x2450b3;}async['_createInteraction'](_0x5cdec9,_0x46fd09,_0x47fce7,_0x1ed781,_0x2199ba){const _0x3cb234=this['editor'];this['_interactionParams']={'action':_0x2199ba,'content':_0x5cdec9,'version':_0x46fd09,'mainView':_0x47fce7,'aiBalloon':_0x1ed781};const _0x222b80=new l({'connector':this['_aiConnector'],'editor':_0x3cb234,'content':_0x5cdec9,'version':_0x46fd09,..._0x2199ba});this['_interactions']['push'](_0x222b80),_0x47fce7['hideError']();const _0x45f612=(_0x2a5fa0,_0x4084bf,_0x15f93f=!0x1,_0x195062='streaming')=>this['_promiseQueue']['enqueue'](async _0x163909=>{try{const _0x508273=y({'editor':_0x3cb234,'changeGroups':_0x2a5fa0['changeGroups'],'documentContextContent':_0x2a5fa0['documentContextContent'],'showDiff':_0x15f93f,'trimUnchanged':!0x1});await _0x4084bf['updateContent']({'parts':_0x508273,'renderingStrategy':_0x195062,'abortSignal':_0x163909});}catch(_0x1bbd34){if(this['_isAbortError'](_0x1bbd34))return;throw _0x1bbd34;}});this['_interaction']['on']('replyCreated',(_0x376cf3,_0x3eb5ab)=>{_0x47fce7['hideLoader'](),_0x45f612(_0x3eb5ab,_0x47fce7)['catch'](_0x64deac=>{this['_isAbortError'](_0x64deac)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x64deac),this['_setErrorState'](_0x222b80,_0x47fce7));});}),this['_interaction']['on']('replyContentUpdated',(_0x209e52,_0x348a65)=>{_0x45f612(_0x348a65,_0x47fce7)['catch'](_0x59d939=>{this['_isAbortError'](_0x59d939)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x59d939),this['_setErrorState'](_0x222b80,_0x47fce7));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x47fce7,_0x1ed781),this['_updateNavigationUI']();}catch(_0x31b7ca){this['_isAbortError'](_0x31b7ca)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x31b7ca),this['_setErrorState'](_0x222b80,_0x47fce7));}}),this['listenTo'](_0x47fce7,'toggleSuggestionDisplayMode',(_0x176008,{showDiff:_0xcc8155})=>{this['_balloonShowDiff']=_0xcc8155;const _0x430533=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x430533&&_0x45f612(_0x430533,_0x47fce7,_0xcc8155,'static')['catch'](_0x425fa0=>{this['_isAbortError'](_0x425fa0)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x425fa0),this['_setErrorState'](_0x222b80,_0x47fce7));});}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0xb91d7f,{reply:_0x3f99b5})=>{const _0x493bb4={'positiveCount':_0x3f99b5['changeGroups']['filter'](_0x5077bd=>'accepted'===_0x5077bd['state'])['length'],'totalCount':_0x3f99b5['changeGroups']['length']},_0x16c248=this['_interaction']['actionCallId'],_0x21cc32=this['_interaction']['actionName'];_0x21cc32?this['_aiConnector']['upsertAIActionRating'](_0x21cc32,_0x16c248,_0x493bb4):this['_aiConnector']['upsertCustomAIActionRating'](_0x16c248,_0x493bb4);}),this['_setLoadingState'](_0x47fce7,_0x1ed781);try{const _0x2bb5eb=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x2bb5eb;}catch(_0x2610ea){if(this['_isAbortError'](_0x2610ea))return;_0x47fce7['hideLoader'](),this['_setErrorState'](_0x222b80,_0x47fce7);}}['_applyChanges'](_0x3d41af,_0x3cb409,_0x58403b){const _0x5985ef=this['editor'];if(_0x58403b&&!_0x5985ef['plugins']['has']('TrackChanges'))throw new _0x29f184('ai-no-track-changes',null);const _0x56dfdb=this['editor']['plugins']['get'](_0x2b3cb3),_0x92ae5a=this['_interaction'],_0x1026cc=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x556119=_0x1026cc['changeGroups'];_0x1026cc['setChangeGroupState'](0x0,'accepted');let _0xdcec46=v({'editor':_0x5985ef,'reply':_0x1026cc,'interaction':_0x92ae5a,'groups':_0x556119,'transform':!0x1,'documentCompare':_0x56dfdb,'documentCompareOptions':{'anchor':_0x5985ef['model']['createPositionAt'](_0x3d41af,0x0),'markDeletions':_0x58403b}});_0xdcec46=this['_filterOperationsOutsideRange'](_0xdcec46,_0x3cb409);for(const _0x4d0218 of _0xdcec46)this['_anchorOperation'](_0x3cb409,_0x4d0218,_0x5985ef['model']['document']['getRoot']());const _0x43fea1=_0x92ae5a['getDocumentContext']()['version'],_0x267abc=_0x5985ef['model']['document']['history']['getOperations'](_0x43fea1),_0x121acf={'document':_0x5985ef['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4567fd=_0x33bff0(_0xdcec46,_0x267abc,_0x121acf)['operationsA'];_0x5985ef['model']['change'](_0x285647=>{if(_0x285647['setSelection'](_0x5985ef['model']['document']['selection']['focus']),_0x58403b)_0x5985ef['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4567fd);else{for(const _0x472181 of _0x4567fd)_0x472181['baseVersion']=_0x5985ef['model']['document']['version'],b(_0x5985ef,_0x472181),_0x285647['batch']['addOperation'](_0x472181),_0x5985ef['model']['applyOperation'](_0x472181);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x32019f,_0x589ab0){return _0x32019f['filter'](_0x220c4f=>{if('rename'==_0x220c4f['type']){const _0x3a09df=_0x220c4f['position']['nodeAfter'];return!_0x589ab0['has'](_0x3a09df);}if(_0x220c4f['type']['indexOf']('Attribute')>-0x1){const _0x1ae608=_0x220c4f['range']['start']['nodeAfter'];return!_0x589ab0['has'](_0x1ae608);}return!0x0;});}['_anchorOperation'](_0x16841c,_0x58f242,_0x3851b2){const _0x2f5837=_0x58f242['clone']();for(const _0x2badb6 in _0x58f242){const _0x35a664=_0x58f242[_0x2badb6];_0x35a664 instanceof _0x59485f?_0x58f242[_0x2badb6]=new _0x59485f(_0x333021(_0x35a664['start']),_0x333021(_0x35a664['end'])):_0x35a664 instanceof _0x58772b&&(_0x58f242[_0x2badb6]=_0x333021(_0x35a664));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x2f5837['type'])){if(_0x2f5837['isDocumentOperation']=!0x1,_0x2f5837['baseVersion']=null,'remove'==_0x2f5837['type']){const _0x4d4cb7=_0x2f5837['sourcePosition'],_0x4dc4c4=_0x2f5837['howMany'];new _0x1609ec(_0x4d4cb7,_0x4dc4c4)['_execute']();}else _0x2f5837['_execute']();}function _0x333021(_0x247a2c){if('$graveyard'==_0x247a2c['root']['rootName'])return _0x247a2c;const _0x4477af=[];let _0x97c14=_0x247a2c['root'];for(let _0x5ead60=0x0;_0x5ead60<_0x247a2c['path']['length'];_0x5ead60++){const _0x4ee36c=_0x16841c['get'](_0x97c14)||0x0;_0x4477af[_0x5ead60]=_0x247a2c['path'][_0x5ead60]+_0x4ee36c,_0x97c14=_0x97c14['getChildAtOffset'](_0x247a2c['path'][_0x5ead60]);}return new _0x58772b(_0x3851b2,_0x4477af,_0x247a2c['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x5972cc,content:_0x558bf6,version:_0x5eb322,mainView:_0x4f20a3,aiBalloon:_0x12e1b8}=this['_interactionParams'];_0x4f20a3['areChangesVisible']=!0x1,_0x4f20a3['hideError'](),this['_clearErrorState'](_0x4f20a3,_0x12e1b8);const _0x590482=_0x4f20a3;_0x590482['miniToolbarView']&&_0x590482['miniToolbarView']['showChangesButton']&&_0x590482['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x490482}),this['_clearSuggestionContent'](_0x4f20a3),_0x4f20a3['showLoader'](),this['_updateNavigationUI'](),this['_createInteraction'](_0x558bf6,_0x5eb322,_0x4f20a3,_0x12e1b8,_0x5972cc)['catch'](_0x302ae6=>{this['_isAbortError'](_0x302ae6)||console['error']('Error\x20refreshing\x20interaction:',_0x302ae6);});}['_clearSuggestionContent'](_0x4ac120){const _0x3756c0=_0x4ac120['bodyView']['_children'];for(;_0x3756c0['length']>0x0;)_0x3756c0['remove'](_0x3756c0['first']);_0x4ac120['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x3484ff){return!!_0x3484ff['message']&&_0x3484ff['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0x2b40e5=new _0x14ee0a(this['editor']['locale']),_0x2fc2b1=new _0x14ee0a(this['editor']['locale']),_0x292fe2=new _0x19a8c6(this['editor']['locale']),_0x104381=new _0x14ee0a(this['editor']['locale']);_0x2b40e5['set']({'icon':_0x395185,'label':C(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x2fc2b1['set']({'icon':_0x25d049,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x292fe2['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x104381['set']({'icon':_0x346a5d,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x2b40e5['bind']('isEnabled')['to'](this,'isBusy',_0x462f79=>!_0x462f79),_0x2b40e5['on']('execute',()=>{this['_refreshInteraction']();}),_0x2fc2b1['bind']('isEnabled')['to'](this,'isBusy',_0x353aa1=>!_0x353aa1),_0x2fc2b1['on']('execute',()=>{this['_navigateToPrevious']();}),_0x104381['bind']('isEnabled')['to'](this,'isBusy',_0x53912f=>!_0x53912f),_0x104381['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x2fc2b1,this['_navigationCounter']=_0x292fe2,this['_navigationNextButton']=_0x104381,this['_customViews']['add'](_0x2b40e5);}['_navigateToPrevious'](){const _0x1959c8=this['_interactions']['length'];this['_currentInteractionIndex']<_0x1959c8-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x2e9038){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x2e9038;const {mainView:_0x218e80}=this['_interactionParams'],_0x3bbdb3=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3bbdb3)return;if(_0x3bbdb3['hasError'])return this['_setErrorState'](_0x3bbdb3,_0x218e80),void this['_updateNavigationUI']();if(!_0x3bbdb3['replies']['length'])return;_0x218e80['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x218e80,this['_interactionParams']['aiBalloon']);const _0x1ddb3c=_0x3bbdb3['replies'][_0x3bbdb3['replies']['length']-0x1];if(_0x1ddb3c){const _0x24055a=this['editor'];this['_clearSuggestionContent'](_0x218e80);try{const _0x6d3dab=y({'editor':_0x24055a,'changeGroups':_0x1ddb3c['changeGroups'],'documentContextContent':_0x1ddb3c['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x218e80),await new Promise(_0x5872d0=>setTimeout(_0x5872d0,0x32)),await _0x218e80['updateContent']({'parts':_0x6d3dab,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x9c0346){this['_isAbortError'](_0x9c0346)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x9c0346);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x54da31=this['_interactions']['length'],_0x282e97=_0x54da31>0x1,_0x57cd15=this['_interactionParams']?.['mainView'];if(_0x282e97){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x57cd15?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x57cd15?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x57cd15?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x371e62=_0x54da31-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x371e62+'/'+_0x54da31),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x54da31-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x57cd15?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x57cd15?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x57cd15?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x3224f2,_0xca019b){_0x3224f2['setLoading'](),_0xca019b['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x919333,_0x5b92e2){const _0x1530a7=C(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x5b92e2['showError'](_0x1530a7),_0x919333['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x5b92e2['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x14201c,_0x3e900e){_0x14201c['clearErrorState'](),_0x3e900e['balloonView']['toolbar']&&(_0x3e900e['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x2579bd,_0x2169be){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x2579bd['clearLoading'](),_0x2169be['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x2216a4=>{'isEnabled'in _0x2216a4&&(_0x2216a4['isEnabled']=!0x1);});}}class Ua extends _0x5f3288{static get['requires'](){return[ui,gi,pi];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x264528){super(_0x264528),_0x264528['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class xs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x85a8ff,title:_0x13d2d3,description:_0x5e5aa3,isParameterized:_0x46d633,useArgs:_0x5ba465,options:_0x3de931}){this['id']=_0x85a8ff,this['title']=_0x13d2d3,this['description']=_0x5e5aa3,this['isParameterized']=_0x46d633,this['useArgs']=_0x5ba465,this['options']=_0x3de931;}}class kr extends xs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x26db74){this['_models']=_0x26db74;}}class wi extends _0x4572ab(){['_checks'];constructor(_0x3aef3c){super(),this['_checks']=this['_mapCheckDefinitions'](_0x3aef3c);}get['checks'](){return this['_checks'];}['getCheckById'](_0xbf80eb){return this['checks']['find'](_0x1db580=>_0x1db580['id']===_0xbf80eb);}['_mapCheckDefinitions'](_0x2f1385){return _0x2f1385['map'](_0x44abde=>'custom'===_0x44abde['id']?new kr(_0x44abde):new xs(_0x44abde));}}class Rs extends _0x135bec(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x1f7c08,contentNew:_0x21004d,contentInitial:_0x26d93b,documentVersion:_0x3ff5f2}){super(),this['id']=_0x1f7c08,this['contentNew']=_0x21004d,this['contentInitial']=_0x26d93b,this['documentVersion']=_0x3ff5f2;}}class js extends _0x4572ab(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x45a090,_0x5b15a3,_0x3d70cb){super(),this['id']=_0x45a090,this['parent']=_0x3d70cb,this['_data']=_0x5b15a3,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 Ts extends _0x4572ab(){['id']=_0x223274();['callId'];['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x335a20,_0x3e43c6,_0x36212c,_0x2c8549,_0x5ab266){super(),this['_documentData']=_0x335a20,this['_sourceCheck']=_0x3e43c6,this['_aiConnector']=_0x36212c,this['_reviewParams']=_0x2c8549,this['_reviewArgs']=_0x5ab266,this['on']('change:status',(_0x384024,_0x5b7d81,_0x487872)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x487872,'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'](_0x4c564c=>'pending'===_0x4c564c['status']);}get['currentError'](){return this['_currentError'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x537f1c=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x3fb3ca of _0x537f1c)'unmodified'!==_0x3fb3ca['data']['operation']&&('error'!==_0x3fb3ca['data']['operation']?'review-metadata'!==_0x3fb3ca['event']?this['_addReviewCheckResult'](_0x3fb3ca['data']['dataId'],_0x3fb3ca['data']['textDelta']):this['callId']=_0x3fb3ca['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0xf574d8){this['_currentError']=_0xf574d8,_0xf574d8 instanceof Error&&_0xf574d8['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'](_0x29c197,_0x2731f0){const _0x1b570b=this['_results']['get'](_0x29c197);if(!_0x1b570b)return;const _0x602686=[];_0x2731f0['forEach']((_0x37082a,_0x43424f)=>{const _0x1e7fff=new js(_0x1b570b['id']+'-'+_0x43424f,_0x37082a,_0x1b570b);_0x1e7fff['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x1e7fff,'status':_0x1e7fff['status']});}),_0x1e7fff['on']('change:isActivated',()=>{_0x1e7fff['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1e7fff}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1e7fff});}),this['_changes']['push'](_0x1e7fff),_0x602686['push'](_0x1e7fff);}),this['fire']('reviewCheckResultReady',{'changes':_0x602686,'result':_0x1b570b,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x3f89da){const _0x285774=this['_changes']['find'](_0x574be8=>_0x574be8['id']===_0x3f89da);return!(!_0x285774||'pending'!==_0x285774['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x42eca3=>'pending'===_0x42eca3['status']);}['markAllChangesAsAccepted'](){for(const _0x8a6799 of this['_changes'])'pending'===_0x8a6799['status']&&(_0x8a6799['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x48b8e1){const _0x3b796b=this['_changes']['find'](_0x1e44ee=>_0x1e44ee['id']===_0x48b8e1);_0x3b796b&&'pending'===_0x3b796b['status']&&(_0x3b796b['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x3e6ad1){const _0x232bfb=this['_changes']['find'](_0x339389=>_0x339389['id']===_0x3e6ad1);_0x232bfb&&'pending'===_0x232bfb['status']&&(_0x232bfb['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x2a817a){const _0x4e1bc8=this['_changes']['find'](_0xd5a8b2=>_0xd5a8b2['id']===_0x2a817a);_0x4e1bc8&&'pending'===_0x4e1bc8['status']&&(_0x4e1bc8['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x2dc900){const _0x27e61c=this['_changes']['find'](_0x30b6fb=>_0x30b6fb['id']===_0x2dc900);_0x27e61c&&'outdated'===_0x27e61c['status']&&(_0x27e61c['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x53365d){this['_changes']['filter'](_0x59d42c=>_0x59d42c['isActivated']&&_0x59d42c['id']!==_0x53365d)['forEach'](_0x1c13ca=>{_0x1c13ca['isActivated']=!0x1;});const _0x1c2d2e=this['_changes']['find'](_0x599cd5=>_0x599cd5['id']===_0x53365d);_0x1c2d2e&&'pending'===_0x1c2d2e['status']&&(_0x1c2d2e['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x10e4a8=>_0x10e4a8['isActivated'])['forEach'](_0x908062=>{_0x908062['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x343733){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x49b2eb;if(_0x343733){const _0xddaa12=this['_changes']['find'](_0x51f00d=>_0x51f00d['id']===_0x343733);if(_0xddaa12&&_0xddaa12['isRated'])return;_0xddaa12&&(_0x49b2eb=_0xddaa12['parent']['id'],_0xddaa12['isRated']=!0x0);}const _0x3b675b={'positiveCount':this['_changes']['filter'](_0x1ee9ab=>'accepted'===_0x1ee9ab['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x3b675b,this['callId'],_0x49b2eb);}['_addReviewCheckResult'](_0x154fb5,_0xf69893){const _0x5d08a3=this['_documentData']['elements']['get'](_0x154fb5);if(!_0x5d08a3)return;const _0x2cc480=_0x5d08a3['getContent']();if(_0x2cc480===_0xf69893)return;const _0x5de76b=new Rs({'id':_0x154fb5,'contentInitial':_0x2cc480,'contentNew':_0xf69893,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x5de76b['id'],_0x5de76b),this['fire']('reviewCheckResultAdded',{'result':_0x5de76b,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x24d1aa=>'pending'===_0x24d1aa['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x53fda9=>'pending'===_0x53fda9['status'])['length']&&(this['status']='finished'));}}class vi extends Ts{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x2e26f0=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x670e57=0x0;_0x670e57<this['_reviewParams']['length'];_0x670e57++){if(!this['_reviewParams'][_0x670e57]||!this['_sourceCheck']['options'][_0x670e57])continue;const _0x220b3c=this['_sourceCheck']['options'][_0x670e57],_0x4d0cca=_0x220b3c['data']?.['find'](_0x123557=>_0x123557['id']===this['_reviewParams'][_0x670e57]);_0x4d0cca&&_0x2e26f0['push'](_0x4d0cca['label']);}return _0x2e26f0['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x273852,_0x3ca7f2,_0x599c7){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x3ca7f2,_0x273852,_0x599c7);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class fi extends Ts{['_prompt'];['_model'];constructor(_0x112dc2,_0x461219,_0x9578cd,_0x3c3a86,_0x18b940){super(_0x9578cd,_0x3c3a86,_0x18b940),this['_prompt']=_0x112dc2,this['_model']=_0x461219;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x5c2866,_0x548223,_0x44b512){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x548223,_0x5c2866,_0x44b512);}}const Ri=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'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':'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'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'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 ee extends _0x171820{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[s];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x2bb262=this['context']['config']['get']('ai.reviewMode.translations');if(_0x2bb262){for(const _0x3c6549 of Ri)'translate'===_0x3c6549['id']&&(_0x3c6549['options'][0x0]['data']=_0x2bb262);}const _0x45f180=this['_translateReviewChecks'](Ri);this['_aiReviewCheckList']=new wi(_0x45f180);const _0x5b1b0b=this['_aiReviewCheckList']['checks']['find'](_0x47f2ea=>'custom'===_0x47f2ea['id']);if(_0x5b1b0b){const _0x455c56=await new ki({'connector':this['_aiConnector']})['getAll']();_0x5b1b0b['models']=_0x455c56['map'](_0xff4629=>({..._0xff4629,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0xff4629['id']['toUpperCase'](),_0xff4629['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x150574,_0x10ec78)=>{const _0x37252b=this['_aiReviewCheckList']['getCheckById'](_0x10ec78['id']);if(_0x37252b){this['_onDiffChange'](this['_isDiffOn']),_0x10ec78['isCustom']?this['_currentReviewCheckRun']=new fi(_0x10ec78['args']['prompt'],_0x10ec78['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x37252b,this['_aiConnector']):this['_currentReviewCheckRun']=new vi(this['_aiReviewModeEditing']['getDocumentData'](),_0x37252b,this['_aiConnector'],_0x10ec78['params'],_0x10ec78['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x56db6e,_0x215a99)=>{'data'===_0x215a99['status']||'loading'===_0x215a99['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x215a99)):'finished'===_0x215a99['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x215a99['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x215a99['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x215a99['status']?(this['_aiReviewModeUi']['showGeneralErrorView'](),this['_logError'](new _0x29f184('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x215a99['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x29f184('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x215a99['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x215a99['status']&&'error-chunk'!==_0x215a99['status']&&'error-general'!==_0x215a99['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x1ea6fb,_0x20743d)=>{if(!this['_currentReviewCheckRun'])throw new _0x29f184('ai-review-mode-no-current-check-run',this);const _0x13a1fa=this['_aiReviewModeEditing']['diffContent'](_0x20743d['result']['contentInitial'],_0x20743d['result']['contentNew']);_0x20743d['source']['addResultChanges'](_0x20743d['result']['id'],_0x13a1fa);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x2683dc,_0x473be8)=>{for(const _0x1f36ad of _0x473be8['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x1f36ad);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x473be8['changes'],_0x473be8['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x83f6ee,_0x5a642a)=>{this['_aiReviewModeUi']['updateChangeState'](_0x5a642a['change']['id'],_0x5a642a['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x18c675,_0x7a2bf1)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x7a2bf1['change']['id']);const _0x58e5b8=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x7a2bf1['change']['id']);if(_0x58e5b8){if('content'===this['_changeActivationSource']){const _0x45a90f=this['_aiReviewModeUi']['getChangeElement'](_0x7a2bf1['change']['id']);_0x45a90f&&_0x38bec5(_0x45a90f['closest']('.ck-ai-review-mode__check-run-result')||_0x45a90f);}else{if('panel'===this['_changeActivationSource']){const _0x3b1b1a={'target':_0x58e5b8['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x2992c3(_0x3b1b1a);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x7a2bf1['change'],_0x58e5b8['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x5eb9ca){_0x5eb9ca instanceof Error&&_0x5eb9ca['message']['includes']('ai-request-aborted')||(_0x5eb9ca instanceof _0x29f184?this['_logError'](_0x5eb9ca):this['_logError'](new _0x29f184('ai-review-mode-check-run-failed',this,{'error':_0x5eb9ca})));}}else this['_logError'](new _0x29f184('ai-review-mode-source-check-not-found',this,{'checkId':_0x10ec78['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x4472e8=this['_currentReviewCheckRun']['getActiveChanges']();_0x4472e8['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x4472e8['map'](_0x196bf1=>_0x196bf1['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x59fd06,_0x2ed67e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x2ed67e['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x2ed67e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x2ed67e['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x2ed67e['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x1eff32,_0x86ed24)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x86ed24['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x86ed24['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x86ed24['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x86ed24['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x211d70,_0x27f829)=>{this['_isDiffOn']=_0x27f829['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x42fd02,_0x59d63c)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x59d63c['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0xfb272e,_0x2a5c1e)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2a5c1e['changeId']));}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x510be4,_0x4d8d55)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4d8d55['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x90521d,_0x6d3c22)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x6d3c22['changeId']);});}['_onReviewModeRunLeave'](_0x2d949a=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x2d949a&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x267311=this['_aiReviewModeEditing']['getEditor']();_0x267311&&_0x267311['editing']['view']['change'](_0x26dc76=>{const _0x42e4a2=_0x267311['editing']['view']['document']['getRoot']();_0x26dc76['removeClass']('ck-ai-review-mode-diff',_0x42e4a2),_0x26dc76['removeClass']('ck-ai-review-mode-highlights',_0x42e4a2);});}['_onDiffChange'](_0x598ee0){const _0x52f083=this['_aiReviewModeEditing']['getEditor']();_0x598ee0?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x52f083&&_0x52f083['editing']['view']['change'](_0x5a1d1d=>{const _0x23aad0=_0x52f083['editing']['view']['document']['getRoot']();_0x5a1d1d['removeClass']('ck-ai-review-mode-diff',_0x23aad0),_0x5a1d1d['removeClass']('ck-ai-review-mode-highlights',_0x23aad0),_0x5a1d1d['addClass'](_0x598ee0?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x23aad0);});}['_translateReviewChecks'](_0x4fed63){return _0x4fed63['map'](_0x1911c0=>{const _0x373823='AI_REVIEW_CHECK_'+_0x1911c0['id']['toUpperCase']()['replaceAll']('-','_'),_0x59dea6={..._0x1911c0,'title':this['_getTranslationWithDefault'](_0x373823+'_TITLE',_0x1911c0['title']),'description':this['_getTranslationWithDefault'](_0x373823+'_DESCRIPTION',_0x1911c0['description'])};return _0x1911c0['options']&&(_0x59dea6['options']=_0x1911c0['options']['map'](_0x24d216=>({..._0x24d216,'label':this['_getTranslationWithDefault'](_0x373823+'_OPTIONS_LABEL',_0x24d216['label']||''),'data':_0x24d216['data']?_0x24d216['data']['map'](_0x4a9c80=>({..._0x4a9c80,'label':this['_getTranslationWithDefault'](_0x373823+'_OPTIONS_DATA_'+_0x4a9c80['id']['toUpperCase'](),_0x4a9c80['label'])})):void 0x0}))),_0x59dea6;});}['_getTranslationWithDefault'](_0x444cad,_0x208711){const _0x20a859=C(this['context']['locale'],_0x444cad);return _0x20a859===_0x444cad?_0x208711:_0x20a859;}['_logError'](_0x40dc39){ot(_0x40dc39['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x19a8c6{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x1957f5,_0x4d4f15){super(_0x1957f5),this['_defaultValue']=_0x4d4f15['default']||(_0x4d4f15['data']['length']>0x0?_0x4d4f15['data'][0x0]['id']:''),this['_defaultLabel']=_0x4d4f15['data']['find'](_0x218c2a=>_0x218c2a['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x10d828(this['locale']);const _0x1c816e=this['_prepareListOptions'](_0x4d4f15['data']);_0x21ea2c(this['_dropdownView'],_0x1c816e,{'role':'menu','ariaLabel':_0x4d4f15['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2a28f2=>{_0x2a28f2['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x2b84e0=>{this['formValue']=_0x2b84e0['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x2b84e0['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x32bdcc=[]){const _0x305a92=new _0x5d69ef();this['resetToDefault']();for(const _0x3a0b95 of _0x32bdcc){const _0x3e723f=new _0x3cd526({'label':_0x3a0b95['label'],'withText':!0x0,'role':'menuitemradio','id':_0x3a0b95['id'],'model':_0x3a0b95});_0x3e723f['bind']('isOn')['to'](this,'formValue',_0x4af85d=>_0x4af85d===_0x3e723f['id']);const _0x1690ab={'type':'button','model':_0x3e723f};_0x305a92['add'](_0x1690ab);}return _0x305a92;}}class Ys extends _0x2269a3{['_formItem']=null;constructor(_0x5c99db,_0x117b00,_0x564f79){super(_0x5c99db),this['argsKey']=_0x117b00?.['argsKey'];if('dropdown'===_0x117b00['formType'])this['_formItem']=new Mr(this['locale'],_0x117b00);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x21abb0=new _0x222658(this['locale'],{'children':[this['_formItem']],'class':[_0x564f79?'ck-form__row_with-submit':'']});_0x564f79&&_0x21abb0['children']['add'](_0x564f79),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x21abb0]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Hs extends _0xf80c43{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x5a9009){super(_0x5a9009),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x1f1bc5(),this['minRows']=Hs['MIN_ROWS'],this['maxRows']=Hs['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class Zs extends _0x19a8c6{['focusTracker']=new ts();['keystrokes']=new _0x1f1bc5();['focusCycler'];['_focusables']=new _0xf07a6b();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x3634d2,_0x1da501){super(_0x3634d2),this['_check']=_0x1da501,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x1da501['models']&&_0x1da501['models']['length']>0x0?_0x1da501['models'][0x0]['id']:'',this['_defaultLabel']=_0x1da501['models']&&_0x1da501['models']['length']>0x0?_0x1da501['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x5cba56(this['locale'],()=>new Hs(_0x3634d2)),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 _0x5d69ef(),this['_setModelList'](),_0x21ea2c(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x222658(this['locale'],{'children':[this['promptInputView']]}),new _0x222658(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x51af3d,_0xdecc87)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0xdecc87()):_0xdecc87();}),this['focusCycler']=new $t({'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'](_0x15597b=>{this['_focusables']['add'](_0x15597b),this['focusTracker']['add'](_0x15597b['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 _0x307bed of this['_getFormValidators']()){const _0x541176=_0x307bed();if(_0x541176)return this['promptInputView']['errorText']=_0x541176,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return C(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x3a1c77=new _0x14ee0a(this['locale']),t=this['locale']['t'];return _0x3a1c77['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3a1c77['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x3a1c77;}['_createCancelButtonView'](){const _0x5c7f21=new _0x14ee0a(this['locale']),t=this['locale']['t'];return _0x5c7f21['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x5c7f21['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x28795e=>{_0x28795e['stopPropagation']();})}}),_0x5c7f21['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x5c7f21;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x458763=this['_check']['models'];if(this['resetToDefault'](),_0x458763?.['length']){const _0x4e3df8=ki['getLocalized'](this['locale'],_0x458763);for(const _0x34e520 of _0x4e3df8){const _0x4e1f36=new _0x3cd526({'label':_0x34e520['name'],'withText':!0x0,'role':'menuitemradio','id':_0x34e520['id'],'model':_0x34e520});_0x4e1f36['bind']('isOn')['to'](this,'modelId',_0x365199=>_0x365199===_0x34e520['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4e1f36,'labelView':new Ws(this['locale'],_0x34e520)});}}}['_createModelSelectionDropdown'](){const _0x44b6e0=_0x10d828(this['locale']);return _0x44b6e0['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x44b6e0['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x44b6e0,'execute',_0x28c15d=>{this['modelId']=_0x28c15d['source']['model']['id'],_0x44b6e0['buttonView']['label']=_0x28c15d['source']['label'];}),_0x44b6e0;}['_createActionsFooterView'](){const _0x2093af=new _0x19a8c6(this['locale']);return _0x2093af['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x2093af;}}class Ws extends _0x53816d{constructor(_0x5321cd,_0x36351e){super();const _0x2b165b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2b165b['to']('style'),'id':_0x2b165b['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x2b165b['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x36351e['description']||'']}]}]});}}class Gs extends _0x2269a3{['_formItemsCollection']=new _0xf07a6b();['_customCheckView']=null;constructor(_0x5c8c50,_0x1ca9d6,_0x4d72f2){super(_0x5c8c50),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1ca9d6['isParameterized']);const _0x1a9fb2=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x21d58f=>_0x21d58f),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x13de4b=>_0x13de4b)],'style':{'--ck-ai-review-check-list-item-index':_0x4d72f2}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x1ca9d6['title']}]},_0x1a9fb2]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x1ca9d6['description']}]}]}]},..._0x1ca9d6['isParameterized']?[this['_createParameterizedView'](_0x1ca9d6)]:[],...'custom'===_0x1ca9d6['id']?[this['_createCustomView'](_0x1ca9d6)]:[]]}),this['on']('click',()=>{_0x1ca9d6['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1ca9d6['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x29a34e({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x1f5d89=>{_0x1f5d89['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x4fb93d=new _0x50b9df();return _0x4fb93d['content']=_0x3ced14,_0x4fb93d['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x4fb93d;}['_createParameterizedView'](_0xc8e62c){const _0x53934e=new _0x19a8c6(),_0x24a2ea=this['_createFormView'](_0xc8e62c);return _0x53934e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x28f1b4=>!_0x28f1b4)]},'children':[_0x24a2ea]}),_0x53934e;}['_createFormView'](_0x347453){const _0x4e937e=new _0x19a8c6(),_0x6f4ab4=Array['isArray'](_0x347453['options'])?_0x347453['options']:[],_0x124f86=new _0x14ee0a(this['locale']),t=this['locale']['t'];_0x124f86['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x124f86['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x512a48=>{_0x512a48['stopPropagation']();})}}),_0x124f86['on']('execute',()=>{const _0x4c6a99=[],_0x1dd57b={};this['_formItemsCollection']['forEach'](_0x299b56=>{_0x4c6a99['push'](_0x299b56['value']),_0x347453['useArgs']&&_0x347453['options']&&(_0x1dd57b[_0x299b56['argsKey']]=_0x299b56['value']);}),this['fire']('runReviewCheck',{'id':_0x347453['id'],'params':_0x4c6a99['length']?_0x4c6a99:void 0x0,'args':Object['keys'](_0x1dd57b)['length']?_0x1dd57b:void 0x0});});const _0x57ca49=_0x6f4ab4['length'];return _0x6f4ab4['forEach']((_0x567fca,_0x6ffebc)=>{const _0x14c232=_0x6ffebc===_0x57ca49-0x1;this['_formItemsCollection']['add'](new Ys(this['locale'],_0x567fca,_0x14c232?_0x124f86:null));}),_0x4e937e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x4e937e;}['_createCustomView'](_0x496f8d){return this['_customCheckView']=new Zs(this['locale'],_0x496f8d),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0xe979d5=>!_0xe979d5)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x286c9a,_0x36e099,_0x4fbf54)=>{_0x4fbf54||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class $s extends _0x2269a3{['_checkViews'];constructor(_0x4382d8){super(_0x4382d8),this['_checkViews']=new _0xf07a6b();const _0x4efbca=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x4efbca['if']('isVisible','ck-hidden',_0x474e3b=>!_0x474e3b)]},'children':this['_checkViews']});}['setChecks'](_0x569016){this['_checkViews']['clear']();for(const [_0x5cbfbc,_0x18f28a]of _0x569016['entries']()){const _0x1d29a4=new Gs(this['locale'],_0x18f28a,_0x5cbfbc);_0x1d29a4['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x1d29a4);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x1158ae of this['_checkViews'])_0x1158ae instanceof Gs&&_0x1158ae['resetToDefault']();}}class Bs extends _0x19a8c6{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0x1b4678,_0x2369c9){super(_0x1b4678),this['id']=_0x2369c9,this['set']('status','pending'),this['set']('changeId',_0x2369c9),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['statusButtonView']=this['_createStatusButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['statusButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x2369c9,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4869fb=new _0x19a8c6(this['locale']);return _0x4869fb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x5220b0=>!_0x5220b0)]}}),_0x4869fb;}['_createAcceptButtonView'](){const _0x3118c6=new _0x14ee0a(this['locale']);return _0x3118c6['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x3118c6['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xc55a8c=>{this['fire']('acceptChange',{'id':this['changeId']}),_0xc55a8c['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x354536=>'pending'!==_0x354536)]}}),_0x3118c6;}['_createDismissButtonView'](){const _0x111c98=new _0x14ee0a(this['locale']);return _0x111c98['set']({'label':C(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x111c98['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5473a8=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x5473a8['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x825054=>'pending'!==_0x825054)]}}),_0x111c98;}['_createInfoButtonView'](){const _0x2c2625=new _0x14ee0a(this['locale']);return _0x2c2625['set']({'label':C(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x136575,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x2c2625['bind']('isOn')['to'](this,'isInfoToggleOn',_0x1464be=>_0x1464be),_0x2c2625['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x2c2625;}['_createStatusButtonView'](){const _0x4d1b2d=new _0x14ee0a(this['locale']);return _0x4d1b2d['set']({'withText':!0x0,'isEnabled':!0x1}),_0x4d1b2d['bind']('label')['to'](this,'status',_0x1e1d80=>C(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x1e1d80['toUpperCase']())),_0x4d1b2d['bind']('icon')['to'](this,'status',_0x2788ae=>'ACCEPTED'===_0x2788ae['toUpperCase']()?_0x547952:'REJECTED'===_0x2788ae['toUpperCase']()?_0x510307:_0x50e8a9),_0x4d1b2d['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x2833dd=>'pending'===_0x2833dd)],'disabled':'disabled'}}),_0x4d1b2d;}}class Js extends _0x14ee0a{constructor(_0x2b0dd8){super(_0x2b0dd8),this['set']({'label':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class sh extends _0x2269a3{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x5bb03c){super(_0x5bb03c),this['_resultViews']=new _0xf07a6b(),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['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Vi(_0x5bb03c),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 _0x29c60c=this['_createCombinedSkeletonLoader'](),_0x39493d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x39493d['if']('isVisible','ck-hidden',_0x58cdab=>!_0x58cdab)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2271df=>_0x2271df)]},'children':this['_resultViews']},_0x29c60c]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x355f59){const _0x28f823=new Bs(this['locale'],_0x355f59['id']);_0x28f823['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x28f823),_0x28f823['resultResponseView']['element']['innerHTML']=_0x355f59['contentDiffed'];}['hideResult'](_0x19323b,_0x59a7e1){if('pending'===_0x59a7e1)return;const _0x2b4fe8=this['_resultViews']['find'](_0x43fa32=>_0x43fa32['id']===_0x19323b);_0x2b4fe8&&(_0x2b4fe8['status']=_0x59a7e1,_0x2b4fe8['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0xb120ea,_0x5af33e){if('pending'!==_0x5af33e)return;const _0x5d6b1c=this['_resultViews']['find'](_0x31d1a1=>_0x31d1a1['id']===_0xb120ea);_0x5d6b1c&&(_0x5d6b1c['status']=_0x5af33e,_0x5d6b1c['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x556ae3,_0x2e7954){this['headerTitle']=_0x556ae3,this['headerSubtitle']=_0x2e7954||'';}['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 je(this['locale'],Ce['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x20ef48=new _0x19a8c6(this['locale']),_0x1ec749=[];for(let _0x4c0ebe=0x0;_0x4c0ebe<0x10;_0x4c0ebe++){const _0x11948a=this['_createSkeletonLoader']();_0x11948a['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x1ec749['push'](_0x11948a);}return _0x20ef48['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x15158f=>!_0x15158f)]},'children':_0x1ec749}),_0x20ef48;}['_createErrorView'](){const _0x298eb5=new _0x19a8c6(this['locale']),_0x1be1eb=new _0x14ee0a(this['locale']),t=this['locale']['t'];return _0x298eb5['delegate']('retryReview')['to'](this),_0x1be1eb['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x1be1eb['on']('execute',()=>{this['fire']('retryReview');}),_0x298eb5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x3e688a=>!_0x3e688a),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x466d46=>'chunk'===_0x466d46)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x34ca7b=>'chunk'===_0x34ca7b)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x125b6c=>'general'!==_0x125b6c)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1f6b73=>'chunk'!==_0x1f6b73)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x1be1eb]}),_0x298eb5;}['_createCancelButtonView'](){const _0x4d9875=new _0x14ee0a(this['locale']);return _0x4d9875['set']({'label':C(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x4c89d2}),_0x4d9875['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0xcd5b89=>_0xcd5b89),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x37afaa=>_0x37afaa)]}}),_0x4d9875['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x4d9875;}['_createToggleDiffButtonView'](){const _0x39638e=new _0x14ee0a(this['locale']);_0x39638e['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x39638e['bind']('isEnabled')['to'](this,'isError',_0x58d859=>!_0x58d859),_0x39638e['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xb3824d=>!_0xb3824d),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x439593=>_0x439593)]}});const _0x32bbcd=C(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x166eda=C(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x39638e['bind']('isOn')['to'](this,'isToggleDiffOn',_0x314603=>_0x314603),_0x39638e['bind']('icon')['to'](this,'isToggleDiffOn',_0x1a6c55=>_0x1a6c55?_0x58391f:_0x3b8dda),_0x39638e['bind']('label')['to'](this,'isToggleDiffOn',_0x9b7e20=>_0x9b7e20?_0x32bbcd:_0x166eda),_0x39638e['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x39638e;}['_createAcceptAllButtonView'](){const _0x28591e=new _0x14ee0a(this['locale']);return _0x28591e['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x28591e['bind']('isEnabled')['to'](this,'isError',_0x59eea5=>!_0x59eea5),_0x28591e['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x110ac0=>!_0x110ac0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x395c8f=>_0x395c8f)]}}),_0x28591e['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x28591e;}['_createExitReviewButtonView'](){const _0x46bdd2=new _0x14ee0a(this['locale']);return _0x46bdd2['set']({'label':C(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x46bdd2['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4fe648=>!_0x4fe648),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3ec01d=>_0x3ec01d)]}}),_0x46bdd2['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x46bdd2;}['_createResultHeaderView'](){const _0x5f2685=new _0x19a8c6(this['locale']),_0x1476d7=this['_createTitleView']();return _0x5f2685['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x2f1ca6=>_0x2f1ca6)]},'children':[_0x1476d7,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x5f2685;}['_createTitleView'](){const _0x4ad145=new _0x19a8c6(this['locale']),_0x50fdc9=new Le();return _0x50fdc9['bind']('isVisible')['to'](this,'isResultReady',_0x2de9ad=>!_0x2de9ad),_0x4ad145['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x50fdc9,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2b7d51=>_0x2b7d51)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x17cf74=>!_0x17cf74)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x4ad145;}['_createFinishReviewButtonView'](){const _0x3cb6fe=new Js(this['locale']);return _0x3cb6fe['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x199677=>!_0x199677)]}}),_0x3cb6fe['delegate']('finishReview')['to'](this),_0x3cb6fe;}}class eh extends _0x2269a3{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x44c54a){super(_0x44c54a),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x17b08a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x17b08a['if']('isVisible','ck-hidden',_0x3c5628=>!_0x3c5628)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':C(_0x44c54a,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x37e71b=new Js(this['locale']);return _0x37e71b['delegate']('finishReview')['to'](this),_0x37e71b;}['_createResultHeaderView'](){const _0x4eb9bf=new _0x19a8c6(this['locale']);return _0x4eb9bf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x4eb9bf;}}class le extends _0x19a8c6{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x5a62cc){super(_0x5a62cc),this['reviewModeHeader']=new _0x5720b1(_0x5a62cc,{'label':C(_0x5a62cc,'AI_REVIEW_MODE'),'icon':_0x3451c9,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new $s(_0x5a62cc),this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=new sh(_0x5a62cc),this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=new eh(_0x5a62cc),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-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],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'](_0x194c80){this['reviewCheckResultsView']['addResult'](_0x194c80),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;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class we extends _0x500981{['resultItemView'];constructor(_0x10ef21,_0x73ab6f){super(_0x10ef21),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x73ab6f['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x33e1c5){this['resultItemView']['changeId']=_0x33e1c5['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x33e1c5['contentDiffed'];}['showBalloon'](_0xf85883,_0x2db3f9){this['updateContent'](_0xf85883),this['show'](),this['pin']({'target':()=>this['_getBestRectPosition'](_0x2db3f9)});}['hideBalloon'](){this['hide'](),this['unpin']();}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_setupClickOutsideHandler'](){_0x29a34e({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['_createContentView'](){const _0xf0377f=new _0x19a8c6();return this['resultItemView']=new Bs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0xf0377f['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0xf0377f;}['_getBestRectPosition'](_0x429832){const _0x3fec5c=Array['from'](_0x429832['getClientRects']());return _0x3fec5c['find'](_0x51b43f=>_0x51b43f['width']>0x0)||_0x3fec5c[0x0];}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x171820{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[at];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e6fef){super(_0x1e6fef),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new le(this['context']['locale']),this['_reviewModeView']['delegate'](...ih)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new we(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x50e6c6=this['context']['plugins']['get']('AITabs');_0x50e6c6['view']['on']('activateTab',(_0x14f1a,_0x188dff)=>{'reviewMode'===_0x188dff?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x50e6c6['view']['addTab']({'id':'reviewMode','buttonLabel':C(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x3451c9,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x3b8d72){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x3b8d72),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x3236dc){_0x3236dc&&('error-general'!==_0x3236dc['status']?'error-chunk'!==_0x3236dc['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x2eadc0){this['_reviewModeView']['addCheckRunResult'](_0x2eadc0);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x12b2c6,_0x4e3ad1){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x12b2c6,_0x4e3ad1);}['setActiveStateInResults'](_0x39975e){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x502340=>{_0x502340['id']===_0x39975e&&_0x502340['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3bbef7=>_0x3bbef7['setItemAsInactive']());}['updateChangeState'](_0x411ca3,_0x2f787b){'accepted'===_0x2f787b||'rejected'===_0x2f787b||'outdated'===_0x2f787b?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x411ca3,_0x2f787b):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x411ca3,_0x2f787b);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x491de9,_0x2fa96f){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x491de9,_0x2fa96f);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x3610af){const _0x2d6fa5=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x517cc9=>_0x517cc9['id']===_0x3610af);return _0x2d6fa5?_0x2d6fa5['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const me='reviewmode-';class re extends _0x171820{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x2b3cb3,c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x3b681a){super(_0x3b681a),this['_domEmitter']=new(_0x556252())(),this['_eventEmitter']=new(_0x135bec())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x55bf98=P(this['context']);_0x55bf98['conversion']['for']('editingDowncast')['markerToElement']({'model':me+'insert','view':(_0xae9265,{writer:_0xd03cc5})=>{const _0xddfcce=this['_markers']['get'](_0xae9265['markerName']),_0x396b79={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0xae9265['markerName']};return _0xd03cc5['createUIElement']('span',_0x396b79,function(_0x37c29f){const _0x816d71=this['toDomElement'](_0x37c29f);return _0x816d71['innerHTML']=_0xddfcce?.['text']||'',_0x816d71;});}}),_0x55bf98['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-only','view':_0x1a1cb9=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x1a1cb9['markerName']}})}),_0x55bf98['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-context','view':_0x285b99=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x285b99['markerName']}})}),_0x55bf98['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-text','view':_0x108803=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x108803['markerName']}})}),_0x55bf98['conversion']['for']('dataDowncast')['markerToElement']({'model':me+'suggestion-context','view':(_0x162baf,{writer:_0x2ae745})=>_0x2ae745['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x162baf['isOpening']?'start':'end')})}),_0x55bf98['conversion']['for']('downcast')['attributeToAttribute']({'model':ct,'view':_0x413d9f}),this['_domEmitter']['listenTo'](document,'click',(_0x5cb69a,_0x24499a)=>{const _0xeb6efb=_0x24499a['target'],_0x22f692=this['_findMarkerElement'](_0xeb6efb);if(!_0x22f692)return;const _0x24ba2d=_0x22f692['getAttribute']('data-marker-id'),_0x44d4db=_0x24ba2d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x24ba2d,'changeId':_0x44d4db});}),_0x55bf98['model']['document']['registerPostFixer'](_0x301d29=>this['_validateMarkers'](_0x55bf98,_0x301d29)),_0x55bf98['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x55bf98));}['getDocumentData'](){const _0x2cafc5=this['context']['plugins']['get']('AIEditing'),_0xae11a8=P(this['context']),_0x3ae283=_0xae11a8['model'],_0x2f9fb8=new _0x25eb17();for(const _0x3d25f2 of _0x3ae283['document']['getRoot']()['getChildren']()){const _0x42704c=_0x3d25f2['_clone'](!0x0);_0x2f9fb8['_appendChild'](_0x42704c);}for(const _0x45b8e0 of _0x3ae283['markers'])_0x2f9fb8['markers']['set'](_0x45b8e0['name'],this['_changeRangeOwnerDocument'](_0x45b8e0['getRange']()['clone'](),_0x2f9fb8));const _0x9d6e07=new _0x1fbb34({'ignoreElementEnd':!0x0,'startPosition':_0x3ae283['createPositionAt'](_0x2f9fb8,0x0)}),_0x224845=new Set(),_0x5407ed=new Map();for(const {item:_0x568007}of _0x9d6e07){if(!_0x568007['is']('$textProxy'))continue;const _0x3561c4=_0x568007['parent'];if((!_0x3561c4||!_0x3561c4['is']('element','caption'))&&(_0x3561c4&&_0x3561c4['is']('element'))){let _0x23f796=_0x3561c4['getAttribute'](ct);_0x23f796||(_0x23f796=_0x2cafc5['_nextDataId'](_0x224845),_0x3561c4['_setAttribute'](ct,_0x23f796)),_0x224845['add'](_0x23f796);let _0x3f6c0b=_0x3561c4;for(;_0x3f6c0b['parent']&&!_0x3f6c0b['parent']['is']('documentFragment');)_0x3f6c0b=_0x3f6c0b['parent'],_0x3f6c0b['hasAttribute'](ct)&&_0x3f6c0b['_removeAttribute'](ct);_0x5407ed['set'](_0x23f796,{'path':_0x3561c4['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x3f6c0b['_clone'](!0x0),_0x23f796,_0xae11a8['data'])}),_0x9d6e07['jumpTo'](_0x3ae283['createPositionAfter'](_0x3561c4));}}return{'content':_0xae11a8['data']['processor']['toData'](_0xae11a8['data']['toView'](_0x2f9fb8)),'version':_0xae11a8['model']['document']['version'],'elements':_0x5407ed};}['diffContent'](_0x5b788f,_0xc1a2d7){const _0xcdc26a=[],_0x2621a5=P(this['context']),_0x10dc81=_0x2621a5['data']['parse'](_0x5b788f,'$documentFragment'),_0x253e5e=_0x2621a5['model']['createPositionAt'](_0x10dc81,0x0),_0x4ba283=_0x2621a5['data']['parse'](_0xc1a2d7,'$documentFragment');if(!this['_hasSameTopLevelElement'](_0x10dc81,_0x4ba283))return _0xcdc26a;const _0x1cc6ed=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5b788f,_0xc1a2d7,{'anchor':_0x253e5e,'markDeletions':!0x0})['getOperations']()['filter'](_0x30a3c0=>'insert'===_0x30a3c0['type']||'marker'===_0x30a3c0['type']&&_0x30a3c0['name']['startsWith']('$markedRemove')),_0x4fcf4f=this['_groupAdjacentOperations'](_0x1cc6ed);let _0x122214=0x0;return _0x2621a5['model']['change'](_0xd3008d=>{for(let _0x5d1532=0x0;_0x5d1532<_0x4fcf4f['length'];_0x5d1532++){const _0x1a99be=_0x4fcf4f[_0x5d1532],_0x3e6eee=_0xd3008d['createDocumentFragment']();for(const _0x64a461 of _0x10dc81['getChildren']())_0xd3008d['append'](_0x64a461['_clone'](!0x0),_0x3e6eee);for(const _0x55f2e5 of _0x1a99be['operationsIsolated'])if('insert'===_0x55f2e5['type']){const _0x23f4e5=_0x55f2e5;_0x23f4e5['baseVersion']=null,_0x23f4e5['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x23f4e5,_0x3e6eee),_0xd3008d['batch']['addOperation'](_0x55f2e5),_0x2621a5['model']['applyOperation'](_0x55f2e5);const _0x4cc64e='suggestion:insertion:id:authorId:'+_0x122214++,_0x2cf22e=_0x2621a5['model']['createRange'](_0x23f4e5['position'],_0x23f4e5['position']['getShiftedBy'](_0x23f4e5['howMany']));_0x3e6eee['markers']['set'](_0x4cc64e,_0x2cf22e);}else{if('marker'===_0x55f2e5['type']&&_0x55f2e5['name']['startsWith']('$markedRemove')){const _0x26a5ae=_0x55f2e5,_0x316fbf='suggestion:deletion:id:authorId:'+_0x122214++;this['_changeOperationOwnerDocument'](_0x26a5ae,_0x3e6eee),_0x3e6eee['markers']['set'](_0x316fbf,_0x26a5ae['newRange']);}}const _0x348e6b=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1a99be['operationsIsolated'][0x0]),_0x3e6eee),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1a99be['operationsIsolated'][_0x1a99be['operationsIsolated']['length']-0x1]),_0x3e6eee));_0x3e6eee['markers']['set'](me+'suggestion-context',new _0x59485f(_0x348e6b['start'],_0x348e6b['end'])),_0xcdc26a['push']({..._0x1a99be,'context':this['_createGetContextFn'](_0x3e6eee,_0x2621a5['data'],{'ellipsisBefore':_0x348e6b['hasContentBefore'],'ellipsisAfter':_0x348e6b['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3e6eee,_0x2621a5['data'])});}}),_0xcdc26a;}['markChangePositionInEditorContent'](_0x301168,_0x3c33be){if(!_0x301168['length'])return;const _0x10302b=_0x301168[0x0]['parent']['id'],_0x258761=_0x3c33be['elements']['get'](_0x10302b);if(!_0x258761)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x10302b);const _0x2fed6b=_0x258761['path'],_0x43a8c0=P(this['context']),_0x3fcec0=_0x43a8c0['model']['document']['history']['getOperations'](_0x3c33be['version']),_0x5a996f=[];for(const _0xb2b023 of _0x301168){const _0x114321=_0xb2b023['operationsIsolated']['map'](_0x51f784=>this['_translateOperationToEditorContent'](_0x51f784,_0x2fed6b,_0x43a8c0['model']['document']['getRoots']()[0x0]));if(!_0x114321||!_0x114321['length'])continue;const _0x20c45a=_0x114321['every'](_0x11eb8b=>'marker'===_0x11eb8b['type']&&_0x11eb8b['name']['startsWith']('$markedRemove')),_0x5728fb={'document':_0x43a8c0['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x31b30f=_0x33bff0(_0x114321,_0x3fcec0,_0x5728fb)['operationsA'];for(const _0x17a1ff of _0x31b30f)if('insert'===_0x17a1ff['type']){const _0x57f028=_0x17a1ff,_0x8cce3d=_0x57f028['nodes'];let _0x59e9ae='';for(const _0x5de245 of _0x8cce3d)_0x5de245&&_0x5de245['is']('model:$text')&&(_0x59e9ae+=_0x5de245['data']);_0x5a996f['push']({'start':_0x57f028['position'],'end':_0x57f028['position'],'type':'insert','groupId':_0xb2b023['id'],'text':_0x59e9ae});}else{if('marker'===_0x17a1ff['type']&&_0x17a1ff['name']['startsWith']('$markedRemove')){const _0x2f0e28=_0x17a1ff;let _0x240065='remove-text';if(_0x20c45a){const _0x225d5b=this['_findAdjacentContextDistance'](_0x2f0e28['newRange']['start'],'backward',_0x43a8c0['model']['schema']),_0x11e82d=this['_findAdjacentContextDistance'](_0x2f0e28['newRange']['end'],'forward',_0x43a8c0['model']['schema']);if(_0x225d5b||_0x11e82d){const _0x381d01=_0x2f0e28['newRange']['start']['getShiftedBy'](-_0x225d5b),_0x4c29b3=_0x2f0e28['newRange']['end']['getShiftedBy'](_0x11e82d);_0x5a996f['push']({'start':_0x381d01,'end':_0x4c29b3,'groupId':_0xb2b023['id'],'type':'remove-context'});}else _0x240065='remove-only';}_0x5a996f['push']({'start':_0x2f0e28['newRange']['start'],'end':_0x2f0e28['newRange']['end'],'groupId':_0xb2b023['id'],'type':_0x240065});}}}this['_insertMarkers'](_0x5a996f);}['clearAllMarkers'](){const _0x39284f=P(this['context']);_0x39284f['model']['change'](_0x575aec=>{for(const _0x5c8b05 of this['_markers']['keys']())_0x39284f['model']['markers']['get'](_0x5c8b05)&&_0x575aec['removeMarker'](_0x5c8b05);}),this['_markers']['clear']();}['switchToReadOnly'](){P(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){P(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x56d76c){const _0x16c7a7=P(this['context']),_0x59c90a=_0x16c7a7['model'],_0x161588=_0x56d76c['map'](_0x2408e1=>this['_getMarkersDataForGroup'](_0x2408e1))['flat']();_0x59c90a['change'](_0x53d23b=>{for(const _0x127fff of _0x161588){const _0x79ec0c=_0x16c7a7['model']['markers']['get'](_0x127fff['id']);_0x79ec0c&&('insert'===_0x127fff['type']?_0x59c90a['insertContent'](_0x53d23b['createText'](_0x127fff['text']||''),_0x79ec0c['getRange']()['start']):'remove-text'!==_0x127fff['type']&&'remove-only'!==_0x127fff['type']||_0x59c90a['deleteContent'](_0x59c90a['createSelection'](_0x79ec0c['getRange']())),_0x53d23b['removeMarker'](_0x127fff['id']),this['_markers']['delete'](_0x127fff['id']));}});}['rejectChange'](_0x2eb0df){const _0x2ac28c=P(this['context']),_0x29b262=this['_getMarkersDataForGroup'](_0x2eb0df);_0x2ac28c['model']['change'](_0x2c4eef=>{for(const _0x45ad58 of _0x29b262)_0x2c4eef['removeMarker'](_0x45ad58['id']),this['_markers']['delete'](_0x45ad58['id']);});}['getEditor'](){return P(this['context']);}['getMarkerElementForChange'](_0x304dff){const _0x32aa02=Array['from'](this['_markers']['values']())['filter'](_0x42ba7c=>_0x42ba7c['groupId']===_0x304dff);if(!_0x32aa02['length'])return null;const _0x3fab96=0x1===_0x32aa02['length']?_0x32aa02[0x0]:this['_sortMarkers'](_0x32aa02)[0x0],_0x1af10b=P(this['context']),_0x5bcee4=_0x1af10b['model']['markers']['get'](_0x3fab96['id']);if(!_0x5bcee4)return null;const _0x3f69ef=_0x5bcee4['getRange'](),_0x329524=_0x1af10b['editing']['view']['getDomRoot']();if(!_0x329524||!_0x3f69ef)return null;const _0x322234=_0x329524['querySelector']('[data-marker-id=\x22'+_0x3fab96['id']+'\x22]');return _0x322234?{'modelRange':_0x3f69ef,'domElement':_0x322234}:null;}['_validateMarkers'](_0x4fda35,_0x9fde50){const _0x272bcc=Array['from'](this['_markers']['keys']()),_0x14b37b=new Map();for(const _0x3988a4 of _0x272bcc){const _0x50802d=_0x4fda35['model']['markers']['get'](_0x3988a4);if(!_0x50802d)continue;const _0x50c2f0=_0x50802d['getStart']()['path'][0x0];_0x14b37b['has'](_0x50c2f0)||_0x14b37b['set'](_0x50c2f0,[]),_0x14b37b['get'](_0x50c2f0)['push'](_0x50802d);}const _0x1321a0=new Set();for(const _0x4cf4fa of _0x4fda35['model']['document']['differ']['getChanges']()){let _0x58f2df=-0x1,_0x345555=null;if('insert'===_0x4cf4fa['type'])_0x345555=new _0x59485f(_0x4cf4fa['position'],_0x4cf4fa['position']['getShiftedBy'](_0x4cf4fa['length'])),_0x58f2df=_0x4cf4fa['position']['path'][0x0];else{if('remove'!==_0x4cf4fa['type'])continue;_0x345555=new _0x59485f(_0x4cf4fa['position']),_0x58f2df=_0x4cf4fa['position']['path'][0x0];}const _0x3ea484=_0x14b37b['get'](_0x58f2df)||[];if(_0x3ea484['length']){for(const _0x2e2d46 of _0x3ea484)if(_0x345555['root']['rootName']===_0x2e2d46['getRange']()['root']['rootName']&&('insert'!==_0x4cf4fa['type']||!_0x345555['containsRange'](_0x2e2d46['getRange']()))&&(_0x345555['isIntersecting'](_0x2e2d46['getRange']())||_0x345555['start']['isTouching'](_0x2e2d46['getRange']()['end'])||_0x345555['end']['isTouching'](_0x2e2d46['getRange']()['start']))){const _0x53298c=this['_parseMarkerName'](_0x2e2d46['name']);Array['from'](this['_markers']['values']())['filter'](_0x59dff7=>_0x59dff7['groupId']===_0x53298c['groupId'])['forEach'](_0x2f2468=>_0x1321a0['add'](_0x2f2468['id']));}}}if(_0x1321a0['size']){for(const _0x9d4253 of _0x1321a0)_0x9fde50['removeMarker'](_0x9d4253);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xd52e9c){for(const {name:_0x209958,data:_0x29a5e4}of _0xd52e9c['model']['document']['differ']['getChangedMarkers']()){if(!_0x209958['startsWith'](me))continue;const _0x731844=_0x29a5e4['oldRange'],_0x17c1f1=_0x29a5e4['newRange'],_0x563ef2=_0x731844&&'$graveyard'===_0x731844['root']['rootName'],_0x4b55ae=_0x17c1f1&&'$graveyard'===_0x17c1f1['root']['rootName'];if(_0x563ef2&&_0x4b55ae)continue;const _0x2be676=this['_parseMarkerName'](_0x209958);this['_markers']['get'](_0x209958)&&(_0x4b55ae||!_0x17c1f1?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x209958,'changeId':_0x2be676['groupId']}):_0x563ef2&&_0x17c1f1&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x209958,'changeId':_0x2be676['groupId']}));}}['_parseMarkerName'](_0x5bf50a){const _0x35ca78=_0x5bf50a['split'](':'),_0x12c6ed=(_0x35ca78[0x1]||'')['split']('_');return{'prefix':_0x35ca78[0x0],'groupId':_0x12c6ed[0x0],'suffix':_0x12c6ed[0x1]};}['_translateOperationToEditorContent'](_0x4a1f2f,_0x1050b5,_0xee5f8b){if('insert'===_0x4a1f2f['type']){const _0x2fc642=_0x4a1f2f;return new te(this['_changePosition'](_0x1050b5['concat'](_0x2fc642['position']['offset']),_0xee5f8b),_0x2fc642['nodes'],_0x2fc642['baseVersion']);}if('marker'===_0x4a1f2f['type']&&_0x4a1f2f['name']['startsWith']('$markedRemove')){const _0x397a36=_0x4a1f2f;return new _0x339507(_0x397a36['name'],_0x397a36['oldRange'],this['_changeRange'](_0x397a36['newRange'],_0x1050b5['concat'](_0x397a36['newRange']['start']['offset']),_0x1050b5['concat'](_0x397a36['newRange']['end']['offset']),_0xee5f8b),_0x397a36['_markers'],_0x397a36['affectsData'],_0x397a36['baseVersion']);}return _0x4a1f2f;}['_groupAdjacentOperations'](_0x50d7c7){if(!_0x50d7c7['length'])return[];const _0x4e7d41=[];let _0x426c42=0x0,_0x562ed7=0x0,_0x1c5567=[];for(let _0x4a15f6=0x0;_0x4a15f6<=_0x50d7c7['length'];_0x4a15f6++){const _0x1d673f=_0x50d7c7[_0x4a15f6],_0x3d6d9b=_0x50d7c7[_0x4a15f6-0x1];!_0x1d673f||_0x3d6d9b&&!this['_getOperationEnd'](_0x3d6d9b)['isTouching'](this['_getOperationStart'](_0x1d673f))?(_0x4e7d41['push']({'operations':_0x1c5567,'operationsIsolated':_0x1c5567['map'](_0x3e0485=>this['_shiftOperation'](_0x3e0485['clone'](),-_0x562ed7)),'groupOffset':_0x426c42}),_0x1c5567=_0x1d673f?[_0x1d673f]:[],_0x562ed7+=_0x426c42,_0x426c42=0x0):_0x1c5567['push'](_0x1d673f),_0x1d673f&&'insert'===_0x1d673f['type']&&(_0x426c42+=_0x1d673f['howMany']);}return _0x4e7d41;}['_findAdjacentContextDistance'](_0x11b9a1,_0x1b69f1,_0x55ae5e,_0x5aed41=0x1){const _0x2f7a57=new _0x1fbb34({'startPosition':_0x11b9a1,'direction':_0x1b69f1});let _0x1c7f8d=0x0;for(let _0x4b791d=0x0;_0x4b791d<_0x5aed41;_0x4b791d++){let _0xc2c8a3=0x0,_0xb7a75c=!0x1,_0x461603='forward'===_0x1b69f1?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x2f3685}of _0x2f7a57)if(_0x2f3685['is']('$textProxy')){const _0x40e4a2=_0x461603['exec'](_0x2f3685['data']);if(_0x40e4a2&&_0x40e4a2['length']){if(_0xc2c8a3+='forward'===_0x1b69f1?_0x40e4a2['index']+_0x40e4a2[0x0]['length']:_0x2f3685['data']['length']-_0x40e4a2['index'],_0x40e4a2[0x0]['length']!==_0x2f3685['data']['length'])break;_0xb7a75c=!0x0,_0x461603='forward'===_0x1b69f1?/^\w+/:/\w+$/;}else{if(_0xb7a75c)break;_0xc2c8a3+=_0x2f3685['offsetSize'];}}else{if(_0x2f3685['is']('element')){_0x55ae5e['isInline'](_0x2f3685)&&!_0xb7a75c&&(_0xc2c8a3+=0x1);break;}}_0x1c7f8d+=_0xc2c8a3,_0x2f7a57['jumpTo'](_0x11b9a1['getShiftedBy']('forward'===_0x1b69f1?_0x1c7f8d:-_0x1c7f8d));}return _0x1c7f8d;}['_getChangeContext'](_0x2fcaad,_0x1d3673){const _0x36b76e=P(this['context'])['model']['schema'],_0x424566=this['_findAdjacentContextDistance'](_0x2fcaad,'backward',_0x36b76e,0x6),_0x982b21=this['_findAdjacentContextDistance'](_0x1d3673,'forward',_0x36b76e,0x6),_0xd1d6dc=_0x2fcaad['getShiftedBy'](-_0x424566),_0x25ab9c=_0x1d3673['getShiftedBy'](_0x982b21);return{'start':_0xd1d6dc,'end':_0x25ab9c,'hasContentBefore':!_0xd1d6dc['isAtStart'],'hasContentAfter':!_0x25ab9c['isAtEnd']};}['_insertMarkers'](_0x325972){const _0x583366=this['context']['plugins']['get']('AIEditing'),_0x586508=new Set();P(this['context'])['model']['change'](_0x328363=>{for(const _0xd6d9ee of _0x325972){const _0x473731=''+me+_0xd6d9ee['type']+':'+_0xd6d9ee['groupId']+'_'+_0x583366['_nextDataId'](_0x586508);this['_markers']['set'](_0x473731,{'id':_0x473731,'groupId':_0xd6d9ee['groupId'],'type':_0xd6d9ee['type'],'text':_0xd6d9ee['text']}),_0x328363['addMarker'](_0x473731,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x328363['createRange'](_0xd6d9ee['start'],_0xd6d9ee['end'])});}});}['_createGetContextFn'](_0x508151,_0xd0cc71,_0x4a5a3c){let _0x33867a='';return()=>{if(!_0x33867a){const _0x3b890e=_0xd0cc71['toView'](_0x508151,{'showSuggestionHighlights':!0x0}),_0x29a1a6=_0x3b890e['getChild'](0x0);if(!_0x29a1a6)return'';let _0x56a833=!0x1;const _0x95b459=[];for(const _0x3aad54 of _0x29a1a6['getChildren']())_0x3aad54['is']('element','span')&&_0x3aad54['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x56a833=!0x1),_0x56a833&&_0x95b459['push'](_0x3aad54),_0x3aad54['is']('element','span')&&_0x3aad54['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x56a833=!0x0);_0x29a1a6['_removeChildren'](0x0,_0x29a1a6['childCount']),_0x4a5a3c?.['ellipsisBefore']&&_0x29a1a6['_appendChild']('…'),_0x29a1a6['_appendChild'](_0x95b459),_0x4a5a3c?.['ellipsisAfter']&&_0x29a1a6['_appendChild']('…');const _0x291ac0=_0xd0cc71['htmlProcessor']['domConverter']['viewToDom'](_0x3b890e),_0x1a64e4=_0xd0cc71['htmlProcessor']['htmlWriter']['getHtml'](_0x291ac0);_0x33867a=_0x1a64e4;}return _0x33867a;};}['_createGetContentFn'](_0x1b3ba6,_0x3654dc){let _0x5950e3='';return()=>(_0x5950e3||(_0x5950e3=_0x3654dc['stringify'](_0x1b3ba6,{'showSuggestionHighlights':!0x0})),_0x5950e3);}['_createGetContentUsingDataIdFn'](_0x6d13a4,_0x1f08a5,_0x237dfd){let _0x1bc5e1='';return()=>{if(!_0x1bc5e1){const _0x340063=_0x237dfd['toView'](new _0x25eb17(_0x6d13a4)),_0x5f1eff=_0x237dfd['htmlProcessor']['domConverter']['viewToDom'](_0x340063)['querySelector']('[data-id=\x22'+_0x1f08a5+'\x22]');_0x1bc5e1=_0x5f1eff?.['outerHTML']||'';}return _0x1bc5e1;};}['_findMarkerElement'](_0x481b65,_0x2edb38=0x5){let _0x308fdc=_0x481b65,_0x52dea1=null;for(let _0x426451=0x0;_0x426451<_0x2edb38&&_0x308fdc;_0x426451++){if(!_0x308fdc['className']){_0x308fdc=_0x308fdc['parentElement'];continue;}if(!(''+_0x308fdc['className'])['includes']('ck-ai_review-mode-marker_')){_0x308fdc=_0x308fdc['parentElement'];continue;}if(!_0x308fdc['getAttribute']('data-marker-id'))break;_0x52dea1=_0x308fdc;break;}return _0x52dea1;}['_getMarkersDataForGroup'](_0x5359d9){return Array['from'](this['_markers']['values']())['filter'](_0x16d5f6=>_0x16d5f6['groupId']===_0x5359d9);}['_getOperationStart'](_0x882538){return'insert'===_0x882538['type']?_0x882538['position']:_0x882538['newRange']['start'];}['_getOperationEnd'](_0x33ad31,_0x25eb76=!0x1){return'insert'===_0x33ad31['type']?_0x25eb76?_0x33ad31['position']:_0x33ad31['position']['getShiftedBy'](_0x33ad31['howMany']):_0x33ad31['newRange']['end'];}['_shiftOperation'](_0xeff67,_0x4152ff){return'insert'===_0xeff67['type']?_0xeff67['position']=_0xeff67['position']['getShiftedBy'](_0x4152ff):'marker'===_0xeff67['type']&&_0xeff67['newRange']&&(_0xeff67['newRange']=new _0x59485f(_0xeff67['newRange']['start']['getShiftedBy'](_0x4152ff),_0xeff67['newRange']['end']['getShiftedBy'](_0x4152ff))),_0xeff67;}['_changeOperationOwnerDocument'](_0x4e6aab,_0x43d135){'insert'===_0x4e6aab['type']?_0x4e6aab['position']=this['_changePositionOwnerDocument'](_0x4e6aab['position'],_0x43d135):'marker'===_0x4e6aab['type']&&_0x4e6aab['newRange']&&(_0x4e6aab['newRange']=this['_changeRangeOwnerDocument'](_0x4e6aab['newRange'],_0x43d135));}['_changePositionOwnerDocument'](_0x26cb94,_0x58009d){return new _0x58772b(_0x58009d,_0x26cb94['path']);}['_changeRangeOwnerDocument'](_0x1cfd48,_0x2136db){return new _0x59485f(this['_changePositionOwnerDocument'](_0x1cfd48['start'],_0x2136db),this['_changePositionOwnerDocument'](_0x1cfd48['end'],_0x2136db));}['_changePosition'](_0x476332,_0x8c067b){return new _0x58772b(_0x8c067b,[..._0x476332]);}['_changeRange'](_0x5d013b,_0x51d8ee,_0x226ffb,_0x4abd55){return new _0x59485f(this['_changePosition'](_0x51d8ee,_0x4abd55),this['_changePosition'](_0x226ffb,_0x4abd55));}['_sortMarkers'](_0x4d9cd1){const _0x1dae78=_0xa0cdcd=>{switch(_0xa0cdcd){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x4d9cd1['sort']((_0x47acbc,_0x2f77ed)=>_0x1dae78(_0x47acbc['type'])-_0x1dae78(_0x2f77ed['type']));}['_hasSameTopLevelElement'](_0xd6ee3a,_0x1b4d3d){const _0x170070=_0xd6ee3a['getChild'](0x0),_0x25a4c7=_0x1b4d3d['getChild'](0x0);return!(!_0x170070||!_0x25a4c7)&&((!_0x170070['is']('element')||!_0x25a4c7['is']('element')||_0x170070['name']===_0x25a4c7['name'])&&!(_0x170070['is']('element')&&!_0x25a4c7['is']('element')||!_0x170070['is']('element')&&_0x25a4c7['is']('element')));}}class Va extends _0x171820{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{pi as AIActions,ni as AIAdapter,qn as AIAssistant,G as AIAssistantUI,w as AIBalloon,Pa as AIChat,tt as AIChatController,it as AIChatHistory,yt as AIChatHistoryController,jt as AIChatHistoryUI,et as AIChatUI,s as AIConnector,c as AIEditing,Ha as AIEditorIntegration,Ot as AIQuickActionType,Ua as AIQuickActions,ui as AIQuickActionsUI,tr as AIRequestError,xs as AIReviewCheck,Rs as AIReviewCheckResult,Ts as AIReviewCheckRun,Va as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,at as AITabs,ue as AITextAdapter,bt as AIToggleButtonUI,zn as AWSTextAdapter,Xn as OpenAITextAdapter,ai as ShowAIAssistantCommand,go as ToggleAICommand,Cs as createResizeButton,Qn as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x50e8f9,Command as At,ContextPlugin as _0x5cd1ee,Editor as _0x5a47f7}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x4a8ce3,IconCheck as _0x54d1a3,IconError as _0x205a83,IconSubmit as _0xe8cbc0,IconAIHistory as It,IconMagicWand as _0x45b611,IconRobotPencil as ti,IconMaximize as _0x32aee0,IconMinimize as to,IconDocumentWithLoupe as _0x27829e,IconAddComment as _0x1689df,IconShowChangesOn as _0x5b97b9,IconShowChangesOff as _0x487ad3,IconDocument as _0x20b8a8,IconThreeStars as _0x1e775e,IconRemove as _0x3a8a02,IconDocumentWithCheckmark as _0x126600,IconDocumentWithCross as _0x9d2521,IconLoupe as _0x4f426d,IconCancel as _0x458488,IconStop as _0x1ddcb4,IconAIChat as ot,IconPlus as _0x2acb03,IconPin as _0x5b13c5,IconThreeHorizontalDots as _0x35163a,IconChevronRight as _0x3435cf,IconInfo as _0x3b66f9,IconOutdated as _0x3f37c2,IconEye as _0x1b9236,IconEyeCrossedOut as _0x28ba8c,IconAIReview as _0x1f8f54}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x4fd5c3,CKEditorError as _0x2e27f1,ObservableMixin as $t,global as _0x1b71f4,isVisible as _0x3153d8,Rect as _0x425b57,Collection as _0x17acab,FocusTracker as Bt,KeystrokeHandler as jt,first as _0x494347,toArray as _0x3ce14b,EmitterMixin as _0xd790fa,logWarning as Yt,scrollViewportToShowTarget as _0x10ba32,logError as _0x454609,ResizeObserver as _0x5f3c0f,_isMotionReduced as at,scrollAncestorsToShowTarget as _0x39e5ec,DomEmitterMixin as _0x12806d}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x2e57c2,ButtonView as _0x2cae14,View as _0x40a2ba,SpinnerView as _0x5a3d4e,IconView as _0x5a991c,AutocompleteView as _0x4ad3c7,ListView as _0x4c2bff,ListItemGroupView as _0x14ed6f,ListItemView as _0x4e528a,ButtonLabelView as _0x8234dc,FocusCycler as Vt,createLabeledTextarea as _0x2bde2b,Dialog as _0x32f076,createDropdown as _0x51b8c3,addMenuToDropdown as _0x589ce4,MenuBarMenuView as _0x12b236,MenuBarMenuListItemButtonView as _0x1ba614,DialogViewPosition as _0x19f4a9,MenuBarMenuListView as _0x56a913,MenuBarMenuListItemView as _0x4d0048,UIModel as _0x3c45c3,SplitButtonView as _0x598472,BalloonPanelView as _0x1c3e7b,BodyCollection as Kt,clickOutsideHandler as ts,ListItemButtonView as _0x16380c,ViewCollection as _0x23b83b,addListToDropdown as _0x4f0e71,submitHandler as _0x2993ae,LabeledFieldView as _0x5abff3,createLabeledInputText as th,FormHeaderView as _0x2be5f1,HighlightedTextView as _0x341a83,FileDialogButtonView as _0x4af15e,InputTextView as _0x3049f6,SearchTextView as _0x593c18,DropdownMenuButtonView as _0x2db1a8,DropdownMenuPanelPositioningFunctions as _0x5b7d26,BalloonToolbar as Rt,FormRowView as _0x477ff1,TextareaView as _0x5ea2f2}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as lt,ClipboardMarkersUtils as _0xac0125}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as wt,ViewDataTransfer as ft,ViewUpcastWriter as _0x411444,Matcher as _0x2c8a5e,_DetachOperation as _0x93a95,_insertIntoModelNodeList as _0x588c85,_removeFromModelNodeList as _0x4f5143,ModelRange as _0x3ceedb,ViewDowncastWriter as gt,transformOperationSets as _0x461ccc,ModelDocumentFragment as _0x9a8814,ModelPosition as _0x110b0b,ModelTreeWalker as _0xa9e3f4,InsertOperation as _0x5e4fdf,MarkerOperation as _0x387f51}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0xf1d197,escape as Jt,escapeRegExp as _0x33cfc5}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x52fce2,InvokeModelWithResponseStreamCommand as _0x4aac3a,InvokeModelCommand as _0x24064e}from'@aws-sdk/client-bedrock-runtime';import{createParser as Ct}from'eventsource-parser';import{parseDocument as _0x5320fe}from'htmlparser2';import{isTag as _0xa8223f,findOne as _0x41539f,getParent as _0xf74c50,findAll as _0x38638f,removeElement as _0x112be1,replaceElement as _0x4998ec,prepend as _0x53e16f,prependChild as _0x5d90f3,appendChild as _0x47d205,append as _0x1dde25,find as _0x2cafdb,isComment as _0x227d7e,getChildren as _0x518743,textContent as _0x7ea36f}from'domutils';import _0x57c50a from'dom-serializer';import{Document as it,Element as _0x43f7b3,Text as _0x423c6f,cloneNode as _0x2ca0b1,isDocument as _0x5c8f3c,isText as _0x1d8d35,NodeWithChildren as _0x4b8570}from'domhandler';import{MarkdownGfmMdToHtml as _0x54f549}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x4564cc,getAllMarkersDomElementsSorted as _0x34855f,DocumentCompare as _0x5f0575,DATA_ID_MODEL_ATTRIBUTE as _0x556091,ConfirmMixin as _0x32275d,LateFocusDropdownButtonView as _0x3dbbac,DATA_ID_VIEW_ATTRIBUTE as _0x32abca}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x507f53}from'es-toolkit';import{IconThumbUp as _0x3c4e01,IconThumbDown as _0x29365b,IconCopy as _0x4e4795,IconCheck as _0x5cc13d,IconShowChangesOff as _0x275968,IconShowChangesOn as _0x44535c,IconWeb as _0x44b8c6,IconNextArrow as _0x446b5b,IconPreviousArrow as _0x4618d9,IconAI as et,IconClose as _0x234981,IconSelection as _0x3173ed,IconFileUpload as _0xb62b4b,IconLink as _0x362632,IconDocument as _0x59a974,IconBulb as _0x3b730e,IconDocumentOutline as _0x15b233,IconPaperClip as _0x4fc7f3,IconBrowseFiles as _0x1f813b,IconDropdownArrow as _0x23fb66,IconAIAskAI as _0x5cc373,IconAIQuickActions as _0x287cd1,IconAIChatCommands as Qt,IconAIImproveWriting as Ot,IconAIContinueWriting as St,IconAIGrammarCheck as xt,IconAIAdjustLength as yt,IconAIChangeTone as Tt,IconAITranslate as Ut,IconAIOther as Et,IconRefresh as _0x296b5e}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x55110b from'morphdom';import{SuggestionsConversion as kt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x572818}from'diff';const mi='_ungrouppedCommands';function ne(_0x1c74e3,_0x2150b9){const _0x5a00b5=(0x0,_0x2150b9['t'])('Other');return _0x1c74e3['length']?'groupId'in _0x1c74e3[0x0]?_0x1c74e3:[{'groupId':mi,'groupLabel':_0x5a00b5,'order':0x1/0x0,'commands':_0x1c74e3}]:[{'groupId':mi,'groupLabel':_0x5a00b5,'order':0x1/0x0,'commands':[]}];}const Fn=globalThis['DataTransfer'],pt='ai-ui';class te extends _0x50e8f9{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3025ce}=this,_0x483f53=['ck-fake-ai-selection'];_0x3025ce['config']['get']('ai.assistant.useTheme')&&_0x483f53['push']('ck-ai-assistant-ui_theme'),_0x3025ce['conversion']['for']('editingDowncast')['markerToHighlight']({'model':pt,'view':{'classes':_0x483f53,'priority':0xc}}),_0x3025ce['conversion']['for']('editingDowncast')['markerToElement']({'model':pt,'view':(_0x411a46,{writer:_0x4d767b})=>{if(!_0x411a46['markerRange']['isCollapsed'])return null;const _0x3fe758=_0x4d767b['createUIElement']('span');return _0x4d767b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3fe758),_0x3fe758;}});}['afterInit'](){!async function(_0x133a5f){const _0x4a276f=_0x85b086([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]),_0x581512=0x3dffc4e1,_0x1bce16=0x3df8b311^_0x581512,_0x315523=window[_0x85b086([0x44,0x61,0x74,0x65])][_0x85b086([0x6e,0x6f,0x77])](),_0x206688=_0x133a5f[_0x85b086([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x23aaca=new window[(_0x85b086([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3f337c=>{_0x206688[_0x85b086([0x6f,0x6e,0x63,0x65])](_0x85b086([0x72,0x65,0x61,0x64,0x79]),_0x3f337c);}),_0x20ac6a={[_0x85b086([0x6b,0x74,0x79])]:_0x85b086([0x45,0x43]),[_0x85b086([0x75,0x73,0x65])]:_0x85b086([0x73,0x69,0x67]),[_0x85b086([0x63,0x72,0x76])]:_0x85b086([0x50,0x2d,0x32,0x35,0x36]),[_0x85b086([0x78])]:_0x85b086([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]),[_0x85b086([0x79])]:_0x85b086([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]),[_0x85b086([0x61,0x6c,0x67])]:_0x85b086([0x45,0x53,0x32,0x35,0x36])},_0x387376=_0x206688[_0x85b086([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x85b086([0x67,0x65,0x74])](_0x85b086([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x57e4a0(){let _0x3f980c,_0x1d440=null,_0x3811a5=null;try{if(_0x387376==_0x85b086([0x47,0x50,0x4c]))return _0x85b086([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3f980c=_0x4c429a(),!_0x3f980c)return _0x85b086([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3f980c[_0x85b086([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3811a5=_0x4ec167(_0x3f980c[_0x85b086([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3f980c[_0x85b086([0x6a,0x74,0x69])])),await _0x5aad1a()?_0x594412()?_0x3dfcbd()?_0x85b086([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x5765f2()?(_0x3f980c[_0x85b086([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x85b086([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1d440=_0x191b97(_0x85b086([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x3f980c[_0x85b086([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x85b086([0x74,0x72,0x69,0x61,0x6c])&&(_0x1d440=_0x191b97(_0x85b086([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x574f78()):_0x85b086([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x85b086([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x85b086([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x85b086([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3dfcbd(){const _0x4b6ab0=[_0x85b086([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x85b086([0x74,0x72,0x69,0x61,0x6c])][_0x85b086([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3f980c[_0x85b086([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x315523/0x3e8:0xe10*_0x1bce16;return _0x3f980c[_0x85b086([0x65,0x78,0x70])]<_0x4b6ab0;}function _0x594412(){const _0x3f06d9=_0x3f980c[_0x85b086([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3f06d9&&(!!_0x3f06d9[_0x85b086([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x85b086([0x2a]))||!!_0x3f06d9[_0x85b086([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x85b086([0x41,0x49])));}function _0x5765f2(){const _0x2b5098=_0x3f980c[_0x85b086([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2b5098||0x0==_0x2b5098[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2441c9}=new URL(window[_0x85b086([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2b5098[_0x85b086([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2441c9))return!0x0;const _0x3f1b75=_0x2441c9[_0x85b086([0x73,0x70,0x6c,0x69,0x74])](_0x85b086([0x2e]));return _0x2b5098[_0x85b086([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5f0a5d=>_0x5f0a5d[_0x85b086([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x85b086([0x2a])))[_0x85b086([0x6d,0x61,0x70])](_0x4bf0ce=>_0x4bf0ce[_0x85b086([0x73,0x70,0x6c,0x69,0x74])](_0x85b086([0x2e])))[_0x85b086([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x318116=>_0x318116[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x3f1b75[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x85b086([0x6d,0x61,0x70])](_0x5581f4=>Array(_0x3f1b75[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5581f4[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x85b086([0x66,0x69,0x6c,0x6c])](_0x5581f4[0x0]===_0x85b086([0x2a])?_0x85b086([0x2a]):'')[_0x85b086([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5581f4))[_0x85b086([0x73,0x6f,0x6d,0x65])](_0x3eec5b=>_0x3f1b75[_0x85b086([0x65,0x76,0x65,0x72,0x79])]((_0x370008,_0x26d5ff)=>_0x3eec5b[_0x26d5ff]===_0x370008||_0x3eec5b[_0x26d5ff]===_0x85b086([0x2a])));}function _0x574f78(){return _0x1d440&&_0x3811a5?new window[(_0x85b086([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1c978f,_0x57aa4c)=>{_0x1d440[_0x85b086([0x74,0x68,0x65,0x6e])](_0x1c978f,_0x57aa4c),_0x3811a5[_0x85b086([0x74,0x68,0x65,0x6e])](_0x57d520=>{_0x57d520!=_0x85b086([0x56,0x61,0x6c,0x69,0x64])&&_0x1c978f(_0x57d520);},_0x57aa4c);}):_0x1d440||_0x3811a5||_0x85b086([0x56,0x61,0x6c,0x69,0x64]);}}function _0x4ec167(_0x40c5da,_0x1f55f4){return new window[(_0x85b086([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xc687c4=>{if(_0x5d422e())return _0xc687c4(_0x85b086([0x56,0x61,0x6c,0x69,0x64]));_0x213d15(),_0x206688[_0x85b086([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x85b086([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3be304=!0x1;const _0x3272ba=_0x4fd5c3();function _0x165665(_0x5157d2){return!!_0x5157d2&&(typeof _0x5157d2===_0x85b086([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5157d2===_0x85b086([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5157d2[_0x85b086([0x74,0x68,0x65,0x6e])]===_0x85b086([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5157d2[_0x85b086([0x63,0x61,0x74,0x63,0x68])]===_0x85b086([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x339d66(_0x2b68ac){_0x17f3c7(_0x2b68ac)[_0x85b086([0x74,0x68,0x65,0x6e])](_0x3038bf=>{if(!_0x3038bf||_0x3038bf[_0x85b086([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x85b086([0x6f,0x6b]))return _0x85b086([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x18c73d(_0x69b43e(_0x3272ba+_0x1f55f4))!=_0x3038bf[_0x85b086([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x85b086([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x85b086([0x56,0x61,0x6c,0x69,0x64]);})[_0x85b086([0x74,0x68,0x65,0x6e])](_0x3a14bf=>(_0x24fbf1(),_0x3a14bf),()=>{const _0x3edc9d=_0x140d82();return null==_0x3edc9d?(_0x24fbf1(),_0x85b086([0x56,0x61,0x6c,0x69,0x64])):_0x85b086(_0x315523-_0x3edc9d>(0x19f340e1^_0x581512)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x85b086([0x74,0x68,0x65,0x6e])](_0xc687c4)[_0x85b086([0x63,0x61,0x74,0x63,0x68])](()=>{_0xc687c4(_0x85b086([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x367db4=0x3dc92a61^_0x581512;function _0x24fbf1(){const _0x37a411=_0x85b086([0x6c,0x6c,0x63,0x74,0x2d])+_0x18c73d(_0x69b43e(_0x40c5da)),_0xd168ee=_0x179f15(_0x18c73d(window[_0x85b086([0x4d,0x61,0x74,0x68])][_0x85b086([0x63,0x65,0x69,0x6c])](_0x315523/_0x367db4)));window[_0x85b086([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x85b086([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x37a411,_0xd168ee);}function _0x140d82(){const _0x469eee=_0x85b086([0x6c,0x6c,0x63,0x74,0x2d])+_0x18c73d(_0x69b43e(_0x40c5da)),_0x393988=window[_0x85b086([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x85b086([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x469eee);return _0x393988?window[_0x85b086([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x179f15(_0x393988),0x10)*_0x367db4:null;}function _0x17f3c7(_0x5dd688){return new window[(_0x85b086([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4a9b89,_0x5f2df2)=>{_0x5dd688[_0x85b086([0x74,0x68,0x65,0x6e])](_0x4a9b89,_0x5f2df2),window[_0x85b086([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5f2df2,0x3dfe1021^_0x581512);});}}_0x206688[_0x85b086([0x6f,0x6e])](_0x85b086([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x418a14,_0xc667fb)=>{if(_0xc667fb[0x0]!=_0x40c5da)return _0xc687c4(_0x85b086([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xc667fb[0x1]={..._0xc667fb[0x1],[_0x85b086([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3272ba};},{[_0x85b086([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x85b086([0x68,0x69,0x67,0x68])}),_0x206688[_0x85b086([0x6f,0x6e])](_0x85b086([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x26011b=>{_0x165665(_0x26011b[_0x85b086([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3be304=!0x0,_0x339d66(_0x26011b[_0x85b086([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x85b086([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x85b086([0x6c,0x6f,0x77])}),_0x23aaca[_0x85b086([0x74,0x68,0x65,0x6e])](()=>{_0x3be304||_0xc687c4(_0x85b086([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5d422e(){return _0x206688[_0x85b086([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x85b086([0x76,0x69,0x65,0x77])][_0x85b086([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x85b086([0x61,0x75,0x74,0x6f]);}function _0x213d15(){_0x206688[_0x85b086([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x85b086([0x76,0x69,0x65,0x77])][_0x85b086([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x85b086([0x61,0x75,0x74,0x6f]);}}function _0x191b97(_0x45859c){const _0x4bcbc4=[new window[(_0x85b086([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xd69b8c=>setTimeout(_0xd69b8c,0x3df6fa2d^_0x581512)),_0x23aaca[_0x85b086([0x74,0x68,0x65,0x6e])](()=>new window[(_0x85b086([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x49e4b9=>{let _0x586303=0x0;_0x206688[_0x85b086([0x6d,0x6f,0x64,0x65,0x6c])][_0x85b086([0x6f,0x6e])](_0x85b086([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xaeca6e,_0x1757ab)=>{_0x1757ab[0x0][_0x85b086([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x586303++,_0x586303==(0x3dffc519^_0x581512)&&(_0x49e4b9(),_0xaeca6e[_0x85b086([0x6f,0x66,0x66])]());});}))];return window[_0x85b086([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x85b086([0x72,0x61,0x63,0x65])](_0x4bcbc4)[_0x85b086([0x74,0x68,0x65,0x6e])](()=>_0x45859c);}async function _0x254a84(){await _0x23aaca,_0x206688[_0x85b086([0x6d,0x6f,0x64,0x65,0x6c])][_0x85b086([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5dd2f5,_0x206688[_0x85b086([0x6d,0x6f,0x64,0x65,0x6c])][_0x85b086([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5dd2f5,_0x206688[_0x85b086([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x85b086([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5a7cab(_0x53f2ae){const _0x392052=_0x4e60c1();_0x206688[_0x392052]=_0x85b086([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x53f2ae,_0x53f2ae!=_0x85b086([0x56,0x61,0x6c,0x69,0x64])&&_0x254a84();}function _0x4e60c1(){const _0x39013f=window[_0x85b086([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x85b086([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x85b086([0x6e,0x6f,0x77])]())[_0x85b086([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x85b086([0x2e]),'');let _0x450610=_0x85b086([0x6e]);for(let _0x27174c=0x0;_0x27174c<_0x39013f[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x27174c+=0x2){let _0x2d0401=window[_0x85b086([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x39013f[_0x85b086([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x27174c,_0x27174c+0x2));_0x2d0401>=_0x4a276f[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2d0401-=_0x4a276f[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x450610+=_0x4a276f[_0x2d0401];}return _0x450610;}function _0x4c429a(){const _0x49930a=_0x387376[_0x85b086([0x73,0x70,0x6c,0x69,0x74])](_0x85b086([0x2e]));if(0x3!=_0x49930a[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x369844(_0x49930a[0x1]);function _0x369844(_0x282036){const _0xa6b944=_0x4921be(_0x282036);return _0xa6b944&&_0x588b33()?_0xa6b944:null;function _0x588b33(){const _0x65b76e=_0xa6b944[_0x85b086([0x6a,0x74,0x69])],_0x592807=window[_0x85b086([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x65b76e[_0x85b086([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x65b76e[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x43efdf={..._0xa6b944,[_0x85b086([0x6a,0x74,0x69])]:_0x65b76e[_0x85b086([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x65b76e[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x43efdf[_0x85b086([0x76,0x63])],_0x69b43e(_0x43efdf)==_0x592807;}}}async function _0x5aad1a(){let _0x5f071c=!0x0;try{const _0x35830d=_0x387376[_0x85b086([0x73,0x70,0x6c,0x69,0x74])](_0x85b086([0x2e])),[_0x304967,_0x13e86a,_0x513b76]=_0x35830d;return _0x3b0de0(_0x304967),await _0x1e1a47(_0x304967,_0x13e86a,_0x513b76),_0x5f071c;}catch{return!0x1;}function _0x3b0de0(_0x1da620){const _0x1fce34=_0x4921be(_0x1da620);_0x1fce34&&_0x1fce34[_0x85b086([0x61,0x6c,0x67])]==_0x85b086([0x45,0x53,0x32,0x35,0x36])||(_0x5f071c=!0x1);}async function _0x1e1a47(_0x28506c,_0x4f1ffa,_0x152b00){const _0x160bbf=window[_0x85b086([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x85b086([0x66,0x72,0x6f,0x6d])](_0x4ecfbb(_0x152b00),_0x105fa1=>_0x105fa1[_0x85b086([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5c5676=new window[(_0x85b086([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x85b086([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x28506c+_0x85b086([0x2e])+_0x4f1ffa),_0x3fd01d=window[_0x85b086([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x85b086([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3fd01d)return;const _0x5933b3=await _0x3fd01d[_0x85b086([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x85b086([0x6a,0x77,0x6b]),_0x20ac6a,{[_0x85b086([0x6e,0x61,0x6d,0x65])]:_0x85b086([0x45,0x43,0x44,0x53,0x41]),[_0x85b086([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x85b086([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x85b086([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3fd01d[_0x85b086([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x85b086([0x6e,0x61,0x6d,0x65])]:_0x85b086([0x45,0x43,0x44,0x53,0x41]),[_0x85b086([0x68,0x61,0x73,0x68])]:{[_0x85b086([0x6e,0x61,0x6d,0x65])]:_0x85b086([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5933b3,_0x160bbf,_0x5c5676)||(_0x5f071c=!0x1);}}function _0x4921be(_0x5090a6){return _0x5090a6[_0x85b086([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x85b086([0x65,0x79]))?JSON[_0x85b086([0x70,0x61,0x72,0x73,0x65])](_0x4ecfbb(_0x5090a6)):null;}function _0x4ecfbb(_0x1ac962){return window[_0x85b086([0x61,0x74,0x6f,0x62])](_0x1ac962[_0x85b086([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x85b086([0x2b]))[_0x85b086([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x85b086([0x2f])));}function _0x69b43e(_0x23f33c){let _0xc45617=0x1505;function _0x12db30(_0x94ef95){for(let _0x5063e4=0x0;_0x5063e4<_0x94ef95[_0x85b086([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5063e4++){const _0x79a723=_0x94ef95[_0x85b086([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5063e4);_0xc45617=(_0xc45617<<0x5)+_0xc45617+_0x79a723,_0xc45617&=_0xc45617;}}function _0x555fd1(_0x50b2b7){Array[_0x85b086([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x50b2b7)?_0x50b2b7[_0x85b086([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x555fd1):_0x50b2b7&&typeof _0x50b2b7==_0x85b086([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x85b086([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x50b2b7)[_0x85b086([0x73,0x6f,0x72,0x74])]()[_0x85b086([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x319730,_0x22c6a5])=>{_0x12db30(_0x319730),_0x555fd1(_0x22c6a5);}):_0x12db30(window[_0x85b086([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x50b2b7));}return _0x555fd1(_0x23f33c),_0xc45617>>>0x0;}function _0x18c73d(_0x76d026){return _0x76d026[_0x85b086([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x85b086([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x85b086([0x30]));}function _0x179f15(_0x33ac4d){return _0x33ac4d[_0x85b086([0x73,0x70,0x6c,0x69,0x74])]('')[_0x85b086([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x85b086([0x6a,0x6f,0x69,0x6e])]('');}function _0x5dd2f5(){}function _0x85b086(_0x4eb67a){return _0x4eb67a['map'](_0x17201d=>String['fromCharCode'](_0x17201d))['join']('');}_0x5a7cab(await _0x57e4a0());}(this);}['showFakeVisualSelection'](){const _0x55deab=this['editor']['model'];_0x55deab['change'](_0x517674=>{const _0x297831=_0x55deab['document']['selection']['getRanges']();let _0x111030=0x0;for(const _0x4846b3 of _0x297831){const _0x142a5e=pt+':'+_0x111030;if(_0x55deab['markers']['has'](_0x142a5e))_0x517674['updateMarker'](_0x142a5e,{'range':_0x4846b3});else{if(_0x4846b3['start']['isAtEnd']){const _0x2fb101=_0x4846b3['start']['getLastMatchingPosition'](({item:_0x3ae738})=>!_0x55deab['schema']['isContent'](_0x3ae738),{'boundaries':_0x4846b3});_0x517674['addMarker'](_0x142a5e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x517674['createRange'](_0x2fb101,_0x4846b3['end'])});}else _0x517674['addMarker'](_0x142a5e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4846b3});}_0x111030++;}});}['hideFakeVisualSelection'](){const _0x134a9e=this['editor']['model'],_0x2f7a4c=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](pt));_0x2f7a4c['length']&&_0x134a9e['change'](_0x4a93a3=>{_0x2f7a4c['forEach'](_0x429dd0=>{_0x4a93a3['removeMarker'](_0x429dd0);});});}['insertContent'](_0xdc87fe,_0x335d33){const _0x43f85c=this['_getAISelection'](),_0x1e6237=_0x335d33||_0x43f85c['getFirstRange']();this['editor']['model']['canEditAt'](_0x1e6237)&&this['editor']['model']['change'](_0x221663=>{this['hideFakeVisualSelection'](),_0x335d33||this['_resetContentOfSelectedTableCells'](_0x221663,_0x43f85c),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1e6237,'writer':_0x221663,'html':_0xdc87fe});});}['insertContentBelow'](_0x51f176){const {model:_0x1992e5}=this['editor'],_0x312cbc=this['_getAISelection']();_0x1992e5['change'](()=>{const _0x4221be=this['_prepareTableInsertBelowPosition'](_0x51f176,_0x312cbc)||this['_getDefaultInsertBelowPosition'](_0x312cbc);this['insertContent'](_0x51f176,_0x4221be);});}['_getAISelection'](){const _0x1af519=this['editor']['model'],_0x443458=Array['from'](_0x1af519['markers']['getMarkersGroup'](pt))['map'](_0xcaf78d=>_0xcaf78d['getRange']());return _0x1af519['createSelection'](_0x443458);}['_pasteHTMLUsingClipboard']({writer:_0xf8ff92,html:_0x5cc9ff,insertAt:_0x5bfd30}){const {view:_0x5077b3}=this['editor']['editing'],_0x7bdcee=this['editor']['plugins']['get'](lt),_0x5b480b=new Fn();_0x5b480b['setData']('text/html',_0x5cc9ff);const _0x18bdc2=new ClipboardEvent('paste',{'clipboardData':_0x5b480b}),_0x44fc2f=new wt(_0x5077b3,_0x18bdc2,{'dataTransfer':new ft(_0x5b480b)});_0xf8ff92['setSelection'](_0x5bfd30);const _0x944511=(_0x3ef3c5,_0x36d1f4)=>{_0x36d1f4['resultRange']&&_0xf8ff92['setSelection'](_0x36d1f4['resultRange']);};_0x7bdcee['once']('contentInsertion',_0x944511,{'priority':'lowest'}),_0x5077b3['document']['fire']('paste',_0x44fc2f),_0x7bdcee['off']('contentInsertion',_0x944511);}['_getDefaultInsertBelowPosition'](_0x2cde5e){const {model:_0x1e3f41}=this['editor'],_0x3c0183=Array['from'](_0x2cde5e['getSelectedBlocks']());return _0x3c0183['length']?_0x1e3f41['createPositionAfter'](_0x3c0183['pop']()):_0x2cde5e['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x30595c,_0x587738){const {model:_0x59d355,plugins:_0x4a9a0f}=this['editor'];if(_0x4a9a0f['has']('TableUtils')){const _0x21c7e1=_0x4a9a0f['get']('TableUtils')['getSelectedTableCells'](_0x587738);if(_0x21c7e1['length']){const _0x585c05=this['_getTableRowCountFromContent'](_0x30595c),_0x237630=this['_createEmptyTableRows'](_0x21c7e1,_0x585c05);return _0x59d355['createPositionAt'](_0x237630,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2dcff9){const _0x34ee72=this['editor']['plugins']['get']('TableUtils'),_0x261e93=this['editor']['data']['parse'](_0x2dcff9),_0x38e26f=Array['from'](_0x261e93['getChildren']())['filter'](_0x5c7ba5=>_0x5c7ba5['is']('element','table'));let _0x1be1b7=0x0;return _0x38e26f['forEach'](_0x3d7c7a=>{_0x1be1b7+=_0x34ee72['getRows'](_0x3d7c7a);}),_0x1be1b7;}['_createEmptyTableRows'](_0x2d3aa4,_0x348ee0){const _0x216637=this['editor']['plugins']['get']('TableUtils'),_0x25e984=_0x216637['getRowIndexes'](_0x2d3aa4),_0x53ba14=_0x216637['getColumnIndexes'](_0x2d3aa4),_0x3c5f80=_0x25e984['last']+0x1,_0x19af48=_0x53ba14['first'],_0x371e2e=_0x2d3aa4[0x0]['findAncestor']('table');for(let _0x5f47da=0x0;_0x5f47da<_0x348ee0;_0x5f47da++)_0x216637['insertRows'](_0x371e2e,{'at':_0x3c5f80});return _0x371e2e['getChild'](_0x3c5f80)['getChild'](_0x19af48);}['_resetContentOfSelectedTableCells'](_0x31ff99,_0x3f4e5f){const {plugins:_0x445294}=this['editor'],{model:_0x34e57b}=_0x31ff99;if(!_0x445294['has']('TableUtils'))return;_0x445294['get']('TableUtils')['getSelectedTableCells'](_0x3f4e5f)['length']&&_0x34e57b['deleteContent'](_0x3f4e5f);}}class li extends _0x50e8f9{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x2e27f1('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x13e062){super(_0x13e062),this['name']='AIRequestError';}}function Yn(_0x4f2d6f,_0x59a0e3,_0x429eb9){const t=_0x4f2d6f['t'];switch(_0x59a0e3){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',_0x429eb9);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x429eb9);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'},_0x429eb9);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_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x59a0e3;}}class hi extends At{['_commandDefinitions'];constructor(_0x779676,_0x275be6){super(_0x779676),this['_commandDefinitions']=_0x275be6,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1d53ea,_0x4a4cd0,_0x52745a)=>{this['isEnabled']&&(this['enabledCommandsIds']=Cs(this['_commandDefinitions'],_0x52745a));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x569092,_0x307f3d,_0xe1dfc4)=>{this['enabledCommandsIds']=_0xe1dfc4?Cs(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x40eca4=this['editor']['model'];this['_hasContext']=function(_0x23aee0){const _0x12ca0b=_0x23aee0['document']['selection'];return _0x12ca0b['isCollapsed']?0x0!==[..._0x12ca0b['getSelectedBlocks']()]['length']&&![..._0x12ca0b['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x23aee0['hasContent'](_0x12ca0b['getFirstRange']());}(_0x40eca4);const _0x5a2845=_0x40eca4['document']['selection'],_0x2ff1d1=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x3c17b4 of _0x5a2845['getRanges']())for(const _0x19b0e6 of _0x3c17b4['getItems']())if(_0x19b0e6['is']('element')&&_0x2ff1d1['includes'](_0x19b0e6['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x36ae57='',_0x163d00='',_0x5b93e3='custom'){this['editor']['plugins']['get'](ee)['showUI'](_0x36ae57,_0x163d00,_0x5b93e3);}}function Cs(_0x281061,_0x578064){const _0x2c51b8=new Set();for(const _0x5d65c0 of _0x281061['values']())(_0x578064||!0x1===_0x5d65c0['requiresContent'])&&_0x2c51b8['add'](_0x5d65c0['id']);return Array['from'](_0x2c51b8);}const xs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class di extends/* #__PURE__ -- @preserve */
|
|
24
|
+
$t(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x54a6f5,_0x3d8ed0,_0x195fa9){super(),this['editor']=_0x54a6f5,this['textAdapter']=_0x3d8ed0,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x195fa9,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0xe1ea29,_0x180660,_0x5d1930)=>{this['view']['value']=this['_sanitizeHTML'](_0x5d1930);}),this['listenTo'](this['view'],'submitPrompt',(_0x4232b0,_0x13bcc8)=>{const _0x597b7f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x13bcc8,_0x597b7f,'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:_0x14843f,query:_0x590b51,htmlContent:_0x54aa44,label:_0x50f7ce,mainActionLabel:_0x51668b}){this['view']['prompt']=_0x50f7ce,this['view']['mainAction']=_0x51668b,this['initialContext']=_0x54aa44,_0x590b51&&(this['view']['isRendered']?this['_handleQuery'](_0x590b51,_0x54aa44,_0x14843f,_0x50f7ce):this['view']['once']('render',()=>{this['_handleQuery'](_0x590b51,_0x54aa44,_0x14843f,_0x50f7ce);}));}['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'](_0x4f381d,_0x3d163c,_0x33862a,_0x208dc7){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3d163c,this['previousQuery']=_0x4f381d,this['previousLabel']=_0x208dc7||_0x4f381d,this['previousActionId']=_0x33862a,new Promise(_0x4612f8=>{this['textAdapter']['makeRequest']({'query':_0x4f381d,'context':_0x3d163c,'onData':_0x1478d3=>{this['currentResponse']=_0x1478d3,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x33862a})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x15c955=>{_0x15c955 instanceof tr?this['view']['handleError'](_0x15c955['message']):this['view']['handleError'](),_0x4612f8();})['finally'](()=>{this['stopProcessing'](),_0x4612f8();});});}['_parseAndNormalizeContent'](_0x255099,_0x1031e5=!0x1){const _0xcbf2ff=xs['exec'](_0x255099);_0x255099=_0xcbf2ff?_0x255099['substring'](_0xcbf2ff[0x1]['length']):_0x255099['length']<0x64&&!_0x1031e5?'':this['_stripMarkdownSyntax'](_0x255099);const _0x3d0d7e=this['_domParser']['parseFromString'](_0x255099,'text/html');if(_0xcbf2ff){const _0x3226e8=Array['from'](_0x3d0d7e['body']['childNodes']);_0x3226e8['reverse']();for(const _0x396ffd of _0x3226e8){if(_0x396ffd['nodeType']==Node['ELEMENT_NODE'])break;_0x396ffd['remove']();}}const _0x142b27=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3d0d7e['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x142b27);const _0xa7c1d=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x5ec53e=this['editor']['data']['toModel'](_0x142b27);return _0xa7c1d||_0x5ec53e['markers']['clear'](),this['editor']['data']['stringify'](_0x5ec53e);}['_normalizeResponseHeadings'](_0x1d2d9c){const _0x36693c=new _0x411444(this['editor']['editing']['view']['document']),_0x4e7238=new _0x2c8a5e({'name':/^h[1-5]$/}),_0x152aa1=[];let _0x1328f9=!0x1;for(const _0x41bca5 of _0x1d2d9c)_0x41bca5['is']('element')&&_0x4e7238['match'](_0x41bca5)&&(_0x152aa1['push'](_0x41bca5),'h1'==_0x41bca5['name']&&(_0x1328f9=!0x0));if(_0x1328f9){for(const _0x180c96 of _0x152aa1)_0x36693c['rename']('h'+(parseInt(_0x180c96['name'][0x1])+0x1),_0x180c96);}}['_isH1TagSupportEnabled'](){const {data:_0x450e41,editing:_0x5daee4}=this['editor'],_0xb0db3b=_0x450e41['htmlProcessor']['toView']('<h1></h1>'),_0x3fae5d=_0x450e41['toView'](_0x450e41['toModel'](_0xb0db3b));return!!_0x5daee4['view']['domConverter']['viewToDom'](_0x3fae5d)['querySelector']('h1');}['_sanitizeHTML'](_0x128b35){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x128b35),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x200700){const _0x4304b1=_0x200700['trim']();return _0x4304b1['startsWith']('```html')?_0x4304b1['endsWith']('```')?_0x4304b1['substring'](0x7,_0x4304b1['length']-0x3):_0x4304b1['substring'](0x7):_0x200700;}}const pi={'REPLACE':'replace','INSERT':'insert'};class Er extends _0x2e57c2{constructor(_0x3fe043){super(_0x3fe043),this['set']('isVisible',!0x1),this['set']('mainAction',pi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3e8eb5=>Yn(_0x3fe043,'AI_'+_0x3e8eb5['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0x3fe043,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0x3fe043,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0x3fe043,'Stop'));const _0x466b74=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x466b74['if']('isVisible','ck-hidden',_0x5208ad=>!_0x5208ad)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x19a670,_0xee04f0){const _0x22c38d=new _0x2cae14(this['locale']);return _0x22c38d['set']({'label':_0x19a670,'class':_0xee04f0||'','isVisible':!0x0,'withText':!0x0}),_0x22c38d;}}class vr extends _0x40a2ba{['contentFieldView'];['copyButtonView'];constructor(_0x3cfe38,_0x57fc87=''){super(_0x3cfe38),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1f2c92=this['bindTemplate'];this['contentFieldView']=new $n(_0x3cfe38,_0x57fc87),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1f2c92['if']('isVisible','ck-hidden',_0x243381=>!_0x243381)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1f2c92['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 _0x255098=!0x1;this['on']('change:value',(_0x301852,_0xd9e7ed,_0x4ddee1)=>{const _0x295195=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4ddee1),this['isProcessing']&&_0x295195&&!_0x255098&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x23c4d6,_0xe1263,_0x214d70)=>{_0x255098=!0x1,_0x214d70?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x255098=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x255098=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x202fd6=this['locale'],_0x5a7884=new _0x2cae14(this['locale']),_0x5d0c3c='ck-ai-form__copy-button';return _0x5a7884['set']({'label':Yn(_0x202fd6,'Copy'),'icon':_0x4a8ce3,'class':_0x5d0c3c,'tooltip':!0x0}),_0x5a7884['bind']('isVisible')['to'](this,'value',_0x571f09=>!!_0x571f09),_0x5a7884['bind']('isEnabled')['to'](this,'isProcessing',_0x31f9fe=>!_0x31f9fe),_0x5a7884['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5a7884['icon']=_0x54d1a3,_0x5a7884['class']=_0x5d0c3c+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5a7884['icon']=_0x4a8ce3,_0x5a7884['class']=_0x5d0c3c;},0x3e8);}),_0x5a7884;}['_copyHTMLToClipboard'](_0x1a6c37){const {window:_0x21cb54,document:_0x5bb225}=_0x1b71f4;if(_0x21cb54['ClipboardItem']){const {Blob:_0x3c6cf4,ClipboardItem:_0x3b7885}=_0x21cb54,_0x1db739=[new _0x3b7885({'text/html':new _0x3c6cf4([_0x1a6c37['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3c6cf4([_0x1a6c37['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1db739);}else{const _0xff58a6=_0x5bb225['createElement']('div');_0xff58a6['style']['position']='absolute',_0xff58a6['style']['left']='-9999px',_0xff58a6['innerHTML']='<span>[</span>'+_0x1a6c37['innerHTML']+'<span>]</span>',_0x5bb225['body']['appendChild'](_0xff58a6);const _0x45820b=_0x5bb225['createRange']();_0x45820b['setStartAfter'](_0xff58a6['firstElementChild']),_0x45820b['setEndBefore'](_0xff58a6['lastElementChild']);const _0x328a45=_0x21cb54['getSelection']();_0x328a45['removeAllRanges'](),_0x328a45['addRange'](_0x45820b),_0x5bb225['execCommand']('copy'),_0xff58a6['remove']();}}}class $n extends _0x40a2ba{constructor(_0x26fc86,_0x3f74e6=''){super(_0x26fc86),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x3f74e6,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x5d84f0){this['element']['innerHTML']=_0x5d84f0;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2c2c83=new _0x40a2ba(),_0x59c24a=this['locale'],_0x5c698e=new _0x5a3d4e();return _0x5c698e['isVisible']=!0x0,_0x2c2c83['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x5c698e,{'text':Yn(_0x59c24a,'AI\x20is\x20writing...')}]}),_0x2c2c83['render'](),_0x2c2c83;}}class jr extends _0x40a2ba{constructor(_0x3015eb,_0x2307fb=''){super(_0x3015eb);const _0x48948c=new _0x5a991c(),_0x4bb78a=this['bindTemplate'];this['set']('text',_0x2307fb),_0x48948c['content']=_0x205a83,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x48948c,{'text':_0x4bb78a['to']('text')}]});}}class Vr extends _0x4ad3c7{['submitButtonView'];['showHistoryButtonView'];constructor(_0x24e5c4,_0x121e5a){super(_0x24e5c4,_0x121e5a),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',(_0x64cac9,_0x427c55)=>{_0x64cac9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x427c55());});}['_createSubmitButton'](){const _0x490da4=new _0x2cae14(this['locale']),_0x5ccbc6=this['locale'];return _0x490da4['set']({'icon':_0xe8cbc0,'label':Yn(_0x5ccbc6,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x490da4['on']('execute',()=>{this['submit']();}),_0x490da4['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4bacac,_0x45c086)=>!_0x4bacac&&_0x45c086),_0x490da4;}['_createShowHistoryButton'](){const _0x7dea13=new _0x2cae14(this['locale']),_0x4319cd=this['resultsView'],_0x15735=this['locale'];_0x7dea13['set']({'label':Yn(_0x15735,'History'),'withText':!0x1,'icon':It,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x7dea13['bind']('isOn')['to'](_0x4319cd,'isVisible'),_0x7dea13['bind']('isEnabled')['to'](this,'isEnabled'),_0x7dea13['on']('execute',()=>{_0x4319cd['isVisible']=!_0x4319cd['isVisible'],_0x4319cd['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x19ff27=()=>{_0x1b71f4['window']['requestAnimationFrame'](()=>{if(_0x3153d8(this['element'])){const _0x5d2af3=new _0x425b57(this['queryView']['fieldView']['element']),_0x2234d6=_0x5d2af3['width'],_0x57051e='rtl'===_0x15735['uiLanguageDirection']?'left':'right';_0x5d2af3['excludeScrollbarsAndBorders'](),_0x7dea13['element']['style'][_0x57051e]=_0x2234d6-_0x5d2af3['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x19ff27),this['on']('render',_0x19ff27),_0x7dea13;}['submit'](){const _0x1988d0=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1988d0);}['focus'](_0x2b6d5c){-0x1===_0x2b6d5c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x4c2bff{['historyGroupView'];['clearHistoryButton'];constructor(_0x5405c3){super(_0x5405c3),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x14ed6f(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x5405c3,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x1547b6=0x0;for(const _0x38a829 of this['items'])_0x1547b6+=_0x38a829['items']['length'];return{'resultsCount':_0x1547b6,'totalItemsCount':_0x1547b6};}['_createClearHistoryButton'](){const _0x25f1d7=this['locale'],_0x1694a5=new _0x2cae14(this['locale']);return _0x1694a5['set']({'label':'('+Yn(_0x25f1d7,'Clear')+')','withText':!0x0}),_0x1694a5['on']('execute',()=>this['fire']('clearHistory')),_0x1694a5;}}class Rr extends _0x4e528a{constructor(_0x95efcc){super();const _0xafe834=new _0x8234dc(),_0x312a35=new _0x2cae14(this['locale'],_0xafe834);this['children']['add'](_0x312a35),_0x312a35['set']({'label':_0x95efcc['prompt'],'withText':!0x0}),_0x312a35['on']('execute',()=>{this['fire']('execute',{'value':_0xf1d197(_0x95efcc['prompt'])});});}}const Ko='CKEditor/AIFormView/PromptHistory';class Br extends _0x17acab{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x36dd54,_0x3c6473)=>{const _0x20a8cf=Qo(_0x3c6473['prompt']);for(const _0x4ca4cb of this)if(_0x4ca4cb!=_0x3c6473&&Qo(_0x4ca4cb['prompt'])===_0x20a8cf){this['remove'](_0x4ca4cb);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x33390e=sessionStorage['getItem'](Ko)||'[]';this['addMany'](JSON['parse'](_0x33390e));}['_saveToSessionStorage'](){sessionStorage['setItem'](Ko,JSON['stringify'](this['map'](_0xa5f804=>_0xa5f804)));}}function Qo(_0x2e80b7){return _0x2e80b7['toLowerCase']()['trim']();}class ui extends _0x40a2ba{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4be04a,_0x23f93c,_0x36c94e=''){super(_0x4be04a),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',pi['REPLACE']),this['_promptHistory']=new Br(),this['errorView']=new jr(_0x4be04a),this['contentArea']=new vr(_0x4be04a,_0x36c94e),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 Bt(),this['keystrokes']=new jt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Vt({'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 _0x4f43fe=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x23f93c],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4f43fe['if']('isError','ck-hidden',_0x499ed1=>!_0x499ed1)]},'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'](_0x14ae85=0x1){-0x1===_0x14ae85?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 _0x5b6bc6=this['locale'],_0x783cfd=new Vr(_0x5b6bc6,{'queryView':{'label':Yn(_0x5b6bc6,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2bde2b,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x5b6bc6,'Empty\x20history'),'secondary':Yn(_0x5b6bc6,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x783cfd['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x25db3f,_0x524b8a)=>_0x25db3f&&!_0x524b8a),this['listenTo'](_0x783cfd,'submit',(_0x1ad6ff,_0x2cece5)=>{this['prompt']=_0x2cece5;const _0x1f067e=Jt(_0x2cece5);this['fire']('submitPrompt',_0x1f067e),_0x2cece5['trim']()&&this['_promptHistory']['add']({'prompt':_0x1f067e},0x0);},{'priority':'high'}),_0x783cfd;}['_createHistoryView'](){const _0x320703=new Hr(this['locale']);return _0x320703['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x320703['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x320703;}['_createToolbar'](){const _0x1329f4=new Er(this['locale']);return _0x1329f4['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xcaf483,_0x3f3312,_0x5cbc08)=>_0xcaf483&&!_0x3f3312&&!!_0x5cbc08),_0x1329f4['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1329f4['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x11d61c,_0x4209d1,_0x40a3a8)=>_0x11d61c&&!_0x4209d1&&!!_0x40a3a8),_0x1329f4['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1329f4['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x536b03,_0x38781c)=>_0x536b03&&!_0x38781c),_0x1329f4['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1329f4['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1329f4['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1329f4;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x383ed1=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x383ed1,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x509ebb){const _0x1b0830=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x509ebb||Yn(_0x1b0830,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const dt=globalThis['DataTransfer'];class ee extends _0x50e8f9{['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[_0xac0125,te,li,_0x32f076];}constructor(_0x3e31b3){super(_0x3e31b3),_0x3e31b3['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3e31b3['config']['define']('ai.assistant.contentAreaCssClass',''),_0x3e31b3['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3e31b3['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x33dd90}=this;this['_aiAdapter']=_0x33dd90['plugins']['get'](li),this['_dialog']=_0x33dd90['plugins']['get'](_0x32f076),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0xd7ef02=new hi(_0x33dd90,Array['from'](this['_commandDefinitions']['values']()));_0x33dd90['commands']['add']('showAIAssistant',_0xd7ef02),_0x33dd90['ui']['componentFactory']['add']('aiCommands',_0x46de10=>{const _0x4b786d=_0x51b8c3(_0x46de10);return _0x4b786d['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4b786d['buttonView']['set']({'label':Yn(_0x46de10,'AI\x20Commands'),'icon':_0x45b611,'tooltip':!0x0}),_0x4b786d['on']('execute',_0x53bf61=>this['_onExecute'](_0x53bf61['source']['id'])),_0x589ce4(_0x4b786d,_0x33dd90['ui']['view']['body'],function(_0x46b85f){const _0x2a0c21=ne(_0x46b85f['config']['get']('ai.assistant.commands'),_0x46b85f['locale']),_0x4b8534=wi(_0x46b85f,_0x2a0c21)['filter'](_0x6e865d=>_0x6e865d['commands']['length']);if(0x1===_0x4b8534['length'])return wi(_0x46b85f,_0x4b8534[0x0]['commands'])['map'](_0x33dba9=>({'id':_0x33dba9['id'],'label':_0x33dba9['label']}));return _0x4b8534['map'](_0x5c3f11=>{const {groupId:_0x45edb5,groupLabel:_0xfb6860,commands:_0x37e7e4}=_0x5c3f11,_0x386f7b=wi(_0x46b85f,_0x37e7e4)['map'](_0x143a1a=>({'id':_0x143a1a['id'],'label':_0x143a1a['label']}));return{'id':_0x45edb5,'menu':_0xfb6860||_0x45edb5,'children':_0x386f7b};});}(_0x33dd90),{'ariaLabel':Yn(_0x46de10,'AI\x20Commands')}),_0x4b786d['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0xd7ef02['on']('change:enabledCommandsIds',_0x579bb3),_0x4b786d['menuView']['once']('render',_0x579bb3),_0x4b786d;function _0x579bb3(){_0x4b786d['isEnabled']=_0xd7ef02['enabledCommandsIds']['length']>0x0;for(const _0xcf866f of _0x4b786d['menuView']['buttons'])_0xcf866f['isEnabled']=_0xd7ef02['enabledCommandsIds']['includes'](_0xcf866f['id']);}}),_0x33dd90['ui']['componentFactory']['add']('menuBar:aiCommands',_0x568a34=>{const _0x33ca40=new _0x12b236(_0x568a34);_0x33ca40['buttonView']['set']({'label':Yn(_0x568a34,'AI\x20Commands'),'icon':_0x45b611}),_0x33ca40['bind']('isEnabled')['to'](_0xd7ef02,'enabledCommandsIds',_0x2244d3=>_0x2244d3['length']>0x0);const _0x17c7d8=ne(_0x33dd90['config']['get']('ai.assistant.commands'),_0x568a34);return this['_populateMenuBarMenu'](_0xd7ef02,_0x33ca40,_0x17c7d8,_0x52bab5=>this['_onExecute'](_0x52bab5)),_0x33ca40;}),_0x33dd90['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x551c05=this['_createAIAssistantUIButton'](_0x2cae14);return _0x551c05['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x551c05;}),_0x33dd90['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x11fd06=this['_createAIAssistantUIButton'](_0x1ba614);return _0x11fd06['set']({'role':'menuitemcheckbox'}),_0x11fd06;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5c4cff=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x36adf6;for(const _0x3b1fda in _0x5c4cff){const _0x339bf7=_0x3b1fda,_0x4063ce=_0x5c4cff[_0x339bf7];if('aiLicenseKeyValid'==_0x4063ce||'aiLicenseKeyInvalid'==_0x4063ce||'aiLicenseKeyExpired'==_0x4063ce||'aiLicenseKeyDomainLimit'==_0x4063ce||'aiLicenseKeyNotAllowed'==_0x4063ce||'aiLicenseKeyEvaluationLimit'==_0x4063ce||'aiLicenseKeyTrialLimit'==_0x4063ce||'aiLicenseKeyUsageLimit'==_0x4063ce){delete _0x5c4cff[_0x339bf7],_0x36adf6=_0x4063ce,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x36adf6&&_0x5c4cff['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x36adf6&&_0x5c4cff['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x36adf6&&_0x5c4cff['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x36adf6&&_0x5c4cff['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x36adf6&&_0x5c4cff['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x36adf6&&_0x5c4cff['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x36adf6&&_0x5c4cff['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x434525='',_0x2f6dc8='',_0x2907bc='custom'){const _0xc024d0=this['editor'],_0x362355=_0xc024d0['editing']['view'],_0x39f417=_0xc024d0['plugins']['get'](te),_0x5c8f35=_0xc024d0['plugins']['get'](_0xac0125);_0x39f417['showFakeVisualSelection']();const _0x456458=new dt(),_0x1fb6b4=new ClipboardEvent('copy',{'clipboardData':_0x456458}),_0x29aaa4=new ft(_0x456458),_0x39fdb4=new wt(_0x362355,_0x1fb6b4,{'dataTransfer':_0x29aaa4});_0x5c8f35['_forceMarkersCopy']('comment',()=>{_0x362355['document']['fire']('copy',_0x39fdb4);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new di(_0xc024d0,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x485337=_0x29aaa4['getData']('text/html');const _0x55f33a=_0xc024d0['model']['document']['selection'],_0x27aba9=Array['from'](_0x55f33a['getRanges']());0x1===_0x27aba9['length']&&_0x27aba9[0x0]['isFlat']&&!_0x55f33a['getSelectedElement']()&&''!==_0x485337['replace'](/ /g,'')['trim']()&&(_0x485337='<p>'+_0x485337+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2907bc,'query':_0x434525,'htmlContent':_0x485337,'label':_0x2f6dc8,'mainActionLabel':pi[_0xc024d0['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ti,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x19f4a9['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x39f417['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x59e811=new Map(),_0x1e8e6d=ne(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x3a5e8b of _0x1e8e6d)for(const _0x478062 of _0x3a5e8b['commands'])_0x59e811['set'](_0x478062['id'],{..._0x478062,'groupId':_0x3a5e8b['groupId'],'groupLabel':_0x3a5e8b['groupLabel']||_0x3a5e8b['groupId']});return _0x59e811;}['_createAIAssistantUIButton'](_0x454cff){const _0x2b6673=this['editor'],_0x1904de=_0x2b6673['commands']['get']('showAIAssistant'),_0x5e2d08=new _0x454cff(_0x2b6673['locale']);return _0x5e2d08['set']({'label':Yn(_0x2b6673['locale'],'AI\x20Assistant'),'icon':ti,'isToggleable':!0x0}),_0x5e2d08['bind']('isEnabled')['to'](_0x1904de),_0x5e2d08['bind']('isOn')['to'](this['_dialog'],'id',_0x2519b9=>'aiAssistant'===_0x2519b9),this['listenTo'](_0x5e2d08,'execute',()=>{_0x5e2d08['isOn']?this['hideUI']():_0x1904de['execute']();}),_0x5e2d08;}['_initView'](){const _0x26ea52=this['editor']['plugins']['get'](te);this['_formView']=new ui(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',()=>{_0x26ea52['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x26ea52['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x5ca7c4,ui:{ariaLiveAnnouncer:_0x56c2e9}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1d90ed,_0x3f6333,_0x4af0f9)=>{const _0x942eb6=this['_aiAssistantController']['currentContext'];_0x4af0f9?_0x56c2e9['announce'](Yn(_0x5ca7c4,'AI\x20is\x20writing')):_0x942eb6&&_0x56c2e9['announce'](Yn(_0x5ca7c4,'Generated\x20content:\x20%0',_0x942eb6),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x30f069,_0x5e46b0,_0x5abf38)=>{if(_0x5abf38){const _0x33d631=this['_formView']['errorView']['text'];_0x56c2e9['announce'](Yn(_0x5ca7c4,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x33d631));}});}['_onExecute'](_0x5acd91){const _0x321cbb=this['_commandDefinitions']['get'](_0x5acd91),_0x404592=this['editor'],_0x929022=_0x404592['model']['document']['selection'],_0x10b6b2=_0x404592['commands']['get']('showAIAssistant'),_0x556709=_0x404592['plugins']['get'](te),_0x3aa16d=''+(_0x321cbb['groupId']!==mi?_0x321cbb['groupLabel']+':\x20':'')+_0x321cbb['label'];if(!0x1!==_0x321cbb['requiresContent']&&_0x929022['isCollapsed']){const _0x54a3ec=_0x494347(_0x929022['getSelectedBlocks']())||_0x404592['model']['schema']['getLimitElement'](_0x929022);_0x404592['model']['change'](_0x444f30=>{_0x444f30['setSelection'](_0x54a3ec,'in');});}_0x556709['showFakeVisualSelection'](),_0x10b6b2['execute'](_0x321cbb['prompt'],_0x3aa16d,'command:'+_0x5acd91);}['_populateMenuBarMenu'](_0x89b064,_0x692f09,_0x23df35,_0x2687c){const _0x51d2ee=this['editor'],_0x325d5f=_0x51d2ee['locale'],_0x5a54c9=new _0x56a913(_0x325d5f),_0x66047b=wi(_0x51d2ee,_0x23df35)['filter'](_0x363a2c=>_0x363a2c['commands']['length']);0x1===_0x66047b['length']?this['_getMenuBarGroupButtons']({'command':_0x89b064,'commands':_0x66047b[0x0]['commands'],'parentMenuView':_0x692f09,'onExecute':_0x2687c})['forEach'](_0x4a6895=>_0x5a54c9['items']['add'](_0x4a6895)):_0x66047b['forEach'](({groupId:_0x3616dc,groupLabel:_0x423daf,commands:_0x5bc208})=>{const _0x583c9d=new _0x4d0048(_0x325d5f,_0x692f09),_0x3ba3d2=new _0x12b236(_0x325d5f),_0x26d932=new _0x56a913(_0x325d5f),_0x2708b1=this['_getMenuBarGroupButtons']({'command':_0x89b064,'commands':_0x5bc208,'parentMenuView':_0x3ba3d2,'onExecute':_0x2687c});_0x3ba3d2['buttonView']['set']({'label':_0x423daf||_0x3616dc}),_0x3ba3d2['delegate']('execute')['to'](_0x692f09),_0x26d932['items']['addMany'](_0x2708b1),_0x3ba3d2['panelView']['children']['add'](_0x26d932),_0x583c9d['children']['add'](_0x3ba3d2),_0x5a54c9['items']['add'](_0x583c9d);}),_0x692f09['panelView']['children']['add'](_0x5a54c9);}['_getMenuBarGroupButtons']({command:_0x361847,commands:_0x426569,parentMenuView:_0x26902e,onExecute:_0xaaf7af}){const _0x54a82e=this['editor'],_0x13e2dc=_0x54a82e['locale'];return wi(_0x54a82e,_0x426569)['map'](_0x51601b=>{const _0x45b4dd=new _0x4d0048(_0x13e2dc,_0x26902e),_0x4a71e2=new _0x1ba614(_0x13e2dc);return _0x4a71e2['set']({'label':_0x51601b['label']}),_0x4a71e2['delegate']('execute')['to'](_0x26902e),_0x4a71e2['on']('execute',()=>_0xaaf7af(_0x51601b['id'])),_0x4a71e2['bind']('isEnabled')['to'](_0x361847,'enabledCommandsIds',_0x35940b=>_0x35940b['includes'](_0x51601b['id'])),_0x45b4dd['children']['add'](_0x4a71e2),_0x45b4dd;});}}function Ai(_0x1b2574,_0x9fe5a3){return void 0x0!==_0x1b2574['order']&&void 0x0===_0x9fe5a3['order']?0x1:void 0x0===_0x1b2574['order']&&void 0x0!==_0x9fe5a3['order']?-0x1:void 0x0!==_0x1b2574['order']&&void 0x0!==_0x9fe5a3['order']?_0x1b2574['order']-_0x9fe5a3['order']:0x0;}function wi(_0x35e3ad,_0x1d7f27){_0x1d7f27['sort'](Ai);const _0xe836b7={},_0x1fc5f1=[];for(const _0x59960e of _0x1d7f27)if(void 0x0!==_0x59960e['order']){if(_0x59960e['order']in _0xe836b7)throw new _0x2e27f1('ai-commands-config-order-collision',_0x35e3ad,{'conflictingDefinitions':[_0x59960e,_0xe836b7[_0x59960e['order']]]});_0xe836b7[_0x59960e['order']]=_0x59960e,_0x1fc5f1['splice'](_0x59960e['order'],0x0,_0x59960e);}else _0x1fc5f1['push'](_0x59960e);return _0x1fc5f1;}class qn extends _0x50e8f9{static get['requires'](){return[ee,te];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3e4c4b){super(_0x3e4c4b);const _0x46ea1b=_0x3e4c4b['config'],_0x493ec7=_0x3e4c4b['locale'];_0x46ea1b['define']('ai.assistant.preserveComments',!0x0),_0x46ea1b['define']('ai.assistant.commands',Qn(_0x493ec7)),_0x46ea1b['define']('ai.assistant.extraCommandGroups',[]),_0x46ea1b['define']('ai.assistant.removeCommands',[]);let _0x273a32=ne(_0x46ea1b['get']('ai.assistant.commands'),_0x493ec7);const _0xd9fa58=_0x46ea1b['get']('ai.assistant.extraCommandGroups'),_0x4ac00f=_0x46ea1b['get']('ai.assistant.removeCommands');_0xd9fa58['forEach'](_0x553428=>{const _0x397bf0=_0x273a32['find'](_0x13cbea=>_0x13cbea['groupId']===_0x553428['groupId']);_0x397bf0?_0x397bf0['commands']=_0x397bf0['commands']['concat'](_0x553428['commands']):_0x273a32['push'](_0x553428);}),_0x273a32=_0x273a32['filter'](_0x2db9a7=>!_0x4ac00f['includes'](_0x2db9a7['groupId'])),_0x273a32['forEach'](_0x2ae55d=>{_0x2ae55d['commands']=_0x2ae55d['commands']['filter'](_0x3b2a2f=>!_0x4ac00f['includes'](_0x3b2a2f['id']));}),_0x46ea1b['set']('ai.assistant.commands',_0x273a32);}}function Qn(_0x272e22){return[{'groupId':'editOrReview','groupLabel':Yn(_0x272e22,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x272e22,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x272e22,'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':Yn(_0x272e22,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x272e22,'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':Yn(_0x272e22,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x272e22,'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':Yn(_0x272e22,'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':Yn(_0x272e22,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x272e22,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x272e22,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x272e22,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x272e22,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x272e22,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x272e22,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x272e22,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x272e22,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x272e22,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x272e22,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x272e22,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x272e22,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x272e22,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x272e22,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x272e22,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x272e22,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x272e22,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x272e22,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x272e22,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Te extends _0x50e8f9{['abortController'];static get['requires'](){return[li];}constructor(_0x272fff){super(_0x272fff),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](li)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0xdb9906){return this['sendRequest'](_0xdb9906)['catch'](_0x23a7d9=>{if(_0x23a7d9 instanceof tr)return Promise['reject'](_0x23a7d9);if('AbortError'==_0x23a7d9['name'])return Promise['resolve']();throw console['error'](_0x23a7d9),new _0x2e27f1('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3dc9f8,_0x417c38){const _0x5e95fa=this['editor']['locale'],_0x24af4d={'Content-Type':'application/json'};if('object'==typeof _0x3dc9f8)Object['assign'](_0x24af4d,_0x3dc9f8);else{if(_0x3dc9f8)try{const _0x476c4f=await _0x3dc9f8(_0x417c38);Object['assign'](_0x24af4d,_0x476c4f);}catch{return Promise['reject'](new tr(Yn(_0x5e95fa,'AI_ERROR_GET_HEADERS')));}}return _0x24af4d;}async['_prepareRequestParameters'](_0x1c9cdf,_0x5f5522){const _0x12513b=this['editor']['locale'];if('object'==typeof _0x1c9cdf)return _0x1c9cdf;try{return await _0x1c9cdf(_0x5f5522);}catch{return Promise['reject'](new tr(Yn(_0x12513b,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends Te{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4b6775){super(_0x4b6775),_0x4b6775['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4b6775['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4b6775['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4b6775['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4b6775['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4b6775['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x3cee48,context:_0xfeb903,onData:_0x55f217,actionId:_0x24e107}){const _0x22ae66=this['editor']['locale'],_0x1e14de=await this['prepareMessages'](_0x3cee48,_0xfeb903,_0x24e107),_0x536c8b=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x24e107),_0x1f03c4=await this['_prepareRequestParameters'](this['_requestParameters'],_0x24e107),_0x3bd763={'messages':_0x1e14de,..._0x1f03c4},_0x2cab19={'method':'POST','headers':_0x536c8b,'body':JSON['stringify'](_0x3bd763),'signal':this['abortController']['signal']},_0x26c809=await fetch(this['_apiUrl'],_0x2cab19);if(_0x26c809['ok'])return _0x1f03c4['stream']?await this['_readStreamableResponse'](_0x26c809,_0x55f217):await this['_readStaticResponse'](_0x26c809,_0x55f217),Promise['resolve']();{const _0x3fc93a=await _0x26c809['text']();return _0x3fc93a['includes']('context_length_exceeded')?Promise['reject'](new tr(Yn(_0x22ae66,'AI_ERROR_CONTEXT_LENGTH'))):_0x3fc93a['includes']('Moderation')?Promise['reject'](new tr(Yn(_0x22ae66,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3fc93a));}}async['prepareMessages'](_0x4162db,_0x47eb67,_0x39d559){let _0x1ccf45,_0x40f4e2;return _0x47eb67?(_0x1ccf45='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.',_0x40f4e2='Instruction:\x0a'+_0x4162db+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x47eb67):(_0x1ccf45='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.',_0x40f4e2=_0x4162db),[{'role':'system','content':_0x1ccf45},{'role':'user','content':_0x40f4e2}];}async['_readStreamableResponse'](_0x2ed0fc,_0x274b8b){const _0x3ad694=_0x2ed0fc['body']['getReader'](),_0x286539=new TextDecoder();let _0xc1c963='',_0xbe2025='',_0x3ebcbb='',_0x2d982f=!0x1;for(;!_0x2d982f;){const {done:_0x2e113e,value:_0x1b46a9}=await _0x3ad694['read'](),_0x1f414a=_0xc1c963+_0x286539['decode'](_0x1b46a9);let _0x220d2d='';_0x2d982f=_0x2e113e;try{_0x220d2d=this['_cleanUpData'](_0x1f414a),_0xc1c963='';}catch{_0xc1c963=_0x1f414a;continue;}_0xbe2025+=_0x220d2d,!_0x2d982f&&this['_isBufferIncomplete'](_0xbe2025)||_0xbe2025&&(_0x3ebcbb+=_0xbe2025,_0xbe2025='',_0x274b8b(_0x3ebcbb));}return Promise['resolve']();}async['_readStaticResponse'](_0x10c6e6,_0x319e5c){return _0x319e5c((await _0x10c6e6['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4e071c){const _0x40ff34=_0x4e071c['split']('<')['length']!==_0x4e071c['split']('>')['length'],_0x3023c4=_0x4e071c['length']<0x1e;return _0x40ff34&&_0x3023c4;}['_cleanUpData'](_0x8aecdb){return _0x8aecdb['split'](/\n(?![^{]*\})/g)['map'](_0xf518c7=>_0xf518c7['replace']('data:\x20',''))['filter'](_0x3510db=>_0x3510db&&_0x3510db['length']>0x0&&'[DONE]'!==_0x3510db)['map'](_0x2425af=>{const {choices:_0x38dd33}=JSON['parse'](_0x2425af);if(_0x38dd33[0x0]?.['delta']?.['content'])return _0x38dd33[0x0]['delta']['content'];})['filter'](_0x5d5a52=>_0x5d5a52)['join']('');}}class zn extends Te{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x37ec21){super(_0x37ec21),_0x37ec21['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x37ec21['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x37ec21['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x37ec21['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x37ec21['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x37ec21['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x148a33,context:_0x1893d7,onData:_0x4f6cea,actionId:_0x40f27f}){const {model:_0xfb9c6b,stream:_0x215a2a,..._0x20194d}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x40f27f),_0x2bd75f={'prompt':await this['preparePrompt'](_0x148a33,_0x1893d7,_0xfb9c6b,_0x40f27f),..._0x20194d};this['_apiUrl']?await this['_processProxyRequest'](_0x2bd75f,_0xfb9c6b,_0x215a2a,_0x4f6cea,_0x40f27f):await this['_processAWSRequest'](_0x2bd75f,_0xfb9c6b,_0x215a2a,_0x4f6cea);}async['preparePrompt'](_0x1a3a5f,_0xed22a1,_0x391cce,_0x52797f){let _0x413f09,_0x561505;return _0xed22a1?(_0x413f09='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.',_0x561505='Instruction:\x0a'+_0x1a3a5f+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xed22a1):(_0x413f09='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.',_0x561505=_0x1a3a5f),'meta.llama'==this['getModelFamily'](_0x391cce)?'<<SYS>>\x0a'+_0x413f09+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x561505+'\x0a[/INST]':'Human:\x0a'+_0x413f09+'\x0a'+_0x561505+'\x0a\x0aAssistant:';}['getModelFamily'](_0x818c0d){if(/^anthropic\.claude/['test'](_0x818c0d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x818c0d))return'ai21.j2';if(/^cohere\.command/['test'](_0x818c0d))return'cohere.command';if(/^meta\.llama/['test'](_0x818c0d))return'meta.llama';throw new tr(Yn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x818c0d));}async['_processProxyRequest'](_0x39b481,_0x4cdb94,_0x144ba4,_0x14da98,_0x4bf105){const _0x64d9b9={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4bf105),'body':JSON['stringify']({..._0x39b481,'model':_0x4cdb94,'stream':_0x144ba4}),'signal':this['abortController']['signal']},_0x181234=await fetch(this['_apiUrl'],_0x64d9b9);_0x144ba4?await this['_readStreamableResponse'](_0x181234,_0x4cdb94,_0x14da98):await this['_readStaticResponse'](_0x181234,_0x4cdb94,_0x14da98);}async['_processAWSRequest'](_0x440a18,_0x32da2c,_0x2aef27,_0x3f7ea5){const _0x3ea2b1=new _0x52fce2(this['_bedrockClientConfig']),_0x158ab8={'body':JSON['stringify'](_0x440a18),'contentType':'application/json','accept':'application/json','modelId':_0x32da2c};let _0x1690b7;if(_0x2aef27){const _0x560389=new _0x4aac3a(_0x158ab8);_0x1690b7=await _0x3ea2b1['send'](_0x560389,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x1690b7,_0x32da2c,_0x3f7ea5);}else{const _0x560924=new _0x24064e(_0x158ab8);_0x1690b7=await _0x3ea2b1['send'](_0x560924,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x1690b7,_0x32da2c,_0x3f7ea5);}}async['_readAsyncIterableResponse'](_0x265960,_0x431c0c,_0x82de64){const _0x94180b=_0x265960['body'],_0x4f5366=new TextDecoder('utf-8');let _0x1eecf7='';for await(const _0x39a560 of _0x94180b)if(_0x39a560['chunk']){const _0x36e8a5=_0x4f5366['decode'](_0x39a560['chunk']['bytes']),_0x46ff39=JSON['parse'](_0x36e8a5);_0x1eecf7+=this['_getGeneratedText'](_0x46ff39,_0x431c0c),_0x82de64(_0x1eecf7);}return Promise['resolve']();}async['_readStreamableResponse'](_0x51465a,_0x563b41,_0x2e6ec2){const _0x358e04=_0x51465a['body'],_0x33d4d4=new TextDecoder('utf-8'),_0x3b80ae=_0x358e04['getReader']();let _0x118255='',_0x215c99='',_0x84d294=!0x1;for(;!_0x84d294;){const {done:_0x4fb3e5,value:_0x4b8b4e}=await _0x3b80ae['read']();if(_0x84d294=_0x4fb3e5,_0x84d294)break;const _0x420dbd=(_0x118255+_0x33d4d4['decode'](_0x4b8b4e))['split']('\x0a')['map'](_0x286c0d=>{try{return _0x118255='',JSON['parse'](_0x286c0d);}catch{return _0x118255=_0x286c0d,null;}})['filter'](_0x3d8dd8=>null!==_0x3d8dd8);_0x420dbd['length']&&(_0x215c99+=_0x420dbd['map'](_0x4c75d8=>this['_getGeneratedText'](_0x4c75d8,_0x563b41))['join'](''),_0x2e6ec2(_0x215c99));}return Promise['resolve']();}async['_readStaticResponse'](_0xd1fa96,_0x16caa3,_0x10ebce){let _0x156756;return _0x156756=_0xd1fa96 instanceof Response?await _0xd1fa96['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0xd1fa96['body'])),(_0x10ebce(this['_getGeneratedText'](_0x156756,_0x16caa3)),Promise['resolve']());}['_getGeneratedText'](_0x4fb097,_0x3fa57b){switch(this['getModelFamily'](_0x3fa57b)){case'anthropic.claude':return _0x4fb097['completion'];case'ai21.j2':return _0x4fb097['completions'][0x0]['data']['text'];case'cohere.command':return _0x4fb097['generations'][0x0]['text'];case'meta.llama':return _0x4fb097['generation'];}}}class ia extends _0x2cae14{constructor(_0x20d80a,_0x35c716={}){super(_0x20d80a),this['isToggleable']=!0x0,this['set']('side',_0x35c716['side']||'top');const _0x302b84=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x3ce14b(_0x35c716['class']||[]),_0x302b84['to']('side',_0x3f0742=>'ck-tab-button_'+_0x3f0742),_0x302b84['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x40a2ba{['children'];constructor(_0x4d9880,_0x965999={}){super(_0x4d9880);const _0x1424b7=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x3ce14b(_0x965999['class']||[]),_0x1424b7['to']('class'),_0x1424b7['if']('isVisible','ck-hidden',_0x2cf615=>!_0x2cf615)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x40a2ba{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x3eba2b,_0x1e4f5e={}){super(_0x3eba2b),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x1e4f5e['side']||'top'),this['set']('isMaximized',!0x1);const _0x5a3f95=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x3ce14b(_0x1e4f5e['class']||[]),_0x5a3f95['to']('side',_0x52361f=>'ck-tabs_'+_0x52361f),_0x5a3f95['to']('class'),_0x5a3f95['to']('isMaximized',_0x3a091f=>_0x3a091f?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x5a3f95['to']('side',_0x35deb3=>'ck-tabs__buttons-container_'+_0x35deb3)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x5a3f95['to']('side',_0x2538c9=>'ck-tabs__panels-container_'+_0x2538c9)]},'children':this['panelViews']},..._0x3ce14b(_0x1e4f5e['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x4e41f6){const _0x5afa44=this['_tabs']['get'](_0x4e41f6);return _0x5afa44||null;}['addTab'](_0x4527f6){const _0x1fc156=this['_setupButton']({'id':_0x4527f6['id'],'label':_0x4527f6['buttonLabel'],'icon':_0x4527f6['buttonIcon'],'order':_0x4527f6['order']}),_0x4b133e=new ea(this['locale']);return _0x4b133e['render'](),_0x4527f6['content']&&_0x4b133e['children']['add'](_0x4527f6['content']),this['panelViews']['add'](_0x4b133e),this['_tabs']['set'](_0x4527f6['id'],{'button':_0x1fc156,'panel':_0x4b133e,'order':void 0x0!==_0x4527f6['order']?_0x4527f6['order']:null}),this['fire']('addTab:'+_0x4527f6['id'],{'id':_0x4527f6['id'],'button':_0x1fc156,'panel':_0x4b133e}),null===this['activeTab']?this['activateTab'](_0x4527f6['id']):this['_hidePanel'](_0x4527f6['id']),{'button':_0x1fc156,'panel':_0x4b133e};}['activateTab'](_0x12508f){if(null!==_0x12508f&&!this['getTab'](_0x12508f))throw new _0x2e27f1('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x12508f});this['activeTab']!==_0x12508f&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x12508f,_0x12508f&&this['_showPanel'](_0x12508f),this['fire']('activateTab:'+_0x12508f,_0x12508f));}['showTab'](_0x208d9f){if(!this['getTab'](_0x208d9f))throw new _0x2e27f1('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x208d9f});this['_showPanel'](_0x208d9f),this['_showButton'](_0x208d9f),this['fire']('show:'+_0x208d9f,_0x208d9f);}['hideTab'](_0x50d0ff){if(!this['getTab'](_0x50d0ff))throw new _0x2e27f1('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x50d0ff});const _0x104ab6=this['activeTab'];this['_hidePanel'](_0x50d0ff),this['_hideButton'](_0x50d0ff);const _0x279a61=this['getTabIds']();_0x104ab6===_0x50d0ff&&_0x279a61['length']>0x1&&this['activateTab'](_0x279a61['find'](_0x2e22f2=>_0x2e22f2!==_0x50d0ff)),this['fire']('hide:'+_0x50d0ff,_0x50d0ff);}['_getPanel'](_0x35dd19){const _0x3b7e97=this['_tabs']['get'](_0x35dd19);return _0x3b7e97?_0x3b7e97['panel']:null;}['_showPanel'](_0x13a68d){null!==this['activeTab']&&this['activeTab']!==_0x13a68d||this['_getPanel'](_0x13a68d)['show']();}['_hidePanel'](_0x10871d){const _0x8293c5=this['_getPanel'](_0x10871d);_0x8293c5['isVisible']&&(this['activeTab']===_0x10871d&&(this['activeTab']=null),_0x8293c5['hide']());}['_getButton'](_0x485527){const _0x17c392=this['_tabs']['get'](_0x485527);return _0x17c392?_0x17c392['button']:null;}['_showButton'](_0x102ad8){this['_getButton'](_0x102ad8)['show']();}['_hideButton'](_0x3aaa38){this['_getButton'](_0x3aaa38)['hide']();}['_setupButton'](_0x44437e){const _0x1e1751=new ia(this['locale'],{'side':this['side']}),_0x5202c6=this['buttonViews'];if(_0x1e1751['set']({'label':_0x44437e['label'],'icon':_0x44437e['icon'],'tooltip':!0x0,'withText':!0x0}),_0x1e1751['bind']('isOn')['to'](this,'activeTab',_0x47c4c0=>_0x47c4c0===_0x44437e['id']),_0x1e1751['bind']('side')['to'](this,'side'),_0x44437e['order']){const _0x50e575=[...this['_tabs']]['reduce']((_0x2a99cb,_0x2cf460)=>{const _0x397b02=_0x2cf460[0x0],{order:_0x58a7af}=_0x2cf460[0x1];return!_0x58a7af||_0x58a7af>_0x44437e['order']?_0x2a99cb:_0x58a7af>=_0x2a99cb['order']?{'id':_0x397b02,'order':_0x58a7af}:_0x2a99cb;},{'id':'','order':0x0}),_0x5f56ae=_0x5202c6['getIndex'](this['_getButton'](_0x50e575['id']));_0x5202c6['add'](_0x1e1751,_0x5f56ae+0x1);}else _0x5202c6['add'](_0x1e1751);return _0x1e1751['on']('execute',()=>{this['activateTab'](_0x44437e['id']);}),_0x1e1751;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends ss{constructor(_0x56beed,_0x1d752f={}){super(_0x56beed,_0x1d752f),this['set']('type',_0x1d752f['type']||'sidebar'),this['set']('side',_0x1d752f['side']||'right'),this['set']('isVisible',_0x1d752f['visibleByDefault']??!0x0);const _0x960228=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x960228['if']('type','ck-ai-tabs__overlay',_0x45786f=>'overlay'===_0x45786f),_0x960228['if']('type','ck-ai-tabs__sidebar',_0x359b08=>'sidebar'===_0x359b08),_0x960228['if']('isVisible','ck-hidden',_0x4f5e9d=>!_0x4f5e9d)]}}),this['buttonViews']['on']('add',(_0x2f5cb3,_0x6a2e1c)=>{_0x6a2e1c['set']('withText',!0x1);});}}class $ extends _0x5cd1ee{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x13196a){super(_0x13196a);const _0x1e6271=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x1e6271)throw new _0x2e27f1('ai-tabs-configuration-not-found');if(void 0x0!==_0x1e6271['showResizeButton']&&(this['showResizeButton']=_0x1e6271['showResizeButton']),'sidebar'!==_0x1e6271['type']&&'overlay'!==_0x1e6271['type']||_0x1e6271['side']&&(this['side']=_0x1e6271['side']),'sidebar'===_0x1e6271['type']){if(this['container']=_0x1e6271['element'],this['set']('type','sidebar'),!this['container'])throw new _0x2e27f1('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x1e6271['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new bi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x1e6271['visibleByDefault']||_0x1e6271['visibleByDefault']}),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 _0x5a47f7&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x1e13e5){if(_0x1e13e5&&this['type']!==_0x1e13e5){if(!Ti['includes'](_0x1e13e5))throw new _0x2e27f1('ai-tabs-unsupported-ui-type');this['type']=_0x1e13e5;}}['switchSide'](_0x2270aa){if(_0x2270aa&&this['side']!==_0x2270aa){if(!yi['includes'](_0x2270aa))throw new _0x2e27f1('ai-tabs-unsupported-ui-side');this['side']=_0x2270aa;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class o extends _0x5cd1ee{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5c2224){super(_0x5c2224),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x3906d9=this['context']['plugins']['get']('CloudServices');if(!_0x3906d9['token'])throw new _0x2e27f1('ai-missing-token',this);this['_token']=_0x3906d9['token'];}['startConversation'](_0x22e7ca,_0x4ecb78){const _0x4d10dc=this['_sendApiRequest']('/conversations','POST',{'id':_0x22e7ca,'group':_0x4ecb78});return{'getConversation':async()=>(await _0x4d10dc['request'])['json'](),'abortController':_0x4d10dc['abortController']};}['queryAssistant']({message:_0x41087d,conversationId:_0x535dd0,parts:_0x1ffbea,capabilities:_0x55542e,model:_0x3f7d77,quickActionData:_0x463042}){const _0x3ed4cc={..._0x463042&&{'quickActionData':_0x463042}},_0x47f145={'prompt':_0x41087d,'content':_0x1ffbea,'model':_0x3f7d77,..._0x55542e&&{'capabilities':_0x55542e},...Object['keys'](_0x3ed4cc)['length']>0x0&&{'attributes':_0x3ed4cc}},_0x4e0695=this['_sendApiRequest']('/conversations/'+_0x535dd0+'/messages','POST',_0x47f145);return{'getStream':async()=>{const _0x1a1a33=(await _0x4e0695['request'])['body'];return this['_getStreamReader'](_0x1a1a33);},'abortController':_0x4e0695['abortController']};}['executeCustomAction']({content:_0x2c6ec9,message:_0x469604,model:_0x4ae900,outputFormat:_0x1bac1e}){const _0x4c6216={'content':[{'type':'text','content':_0x2c6ec9}],'prompt':_0x469604,'model':_0x4ae900,'outputFormat':_0x1bac1e},_0x2cc562=this['_sendApiRequest']('/actions/custom/calls','POST',_0x4c6216);return{'getStream':async()=>{const _0x288d49=(await _0x2cc562['request'])['body'];return this['_getStreamReader'](_0x288d49);},'abortController':_0x2cc562['abortController']};}['executeAction']({actionName:_0x211805,content:_0x17432e,args:_0x38ac57}){const _0x267ca9={'content':[{'type':'text','content':_0x17432e}],'args':_0x38ac57},_0x1deea2=this['_sendApiRequest']('/actions/system/'+_0x211805+'/calls','POST',_0x267ca9);return{'getStream':async()=>{const _0x1e3985=(await _0x1deea2['request'])['body'];return this['_getStreamReader'](_0x1e3985);},'abortController':_0x1deea2['abortController']};}['uploadFile'](_0x36fb2d,_0x426075,_0x55447d){const _0x337e65=new FormData();_0x337e65['append']('file',_0x426075,_0x426075['name']),_0x55447d&&_0x337e65['append']('attributes',JSON['stringify'](_0x55447d));const _0x5956e0=this['_sendApiRequest']('/conversations/'+_0x36fb2d+'/files','POST',_0x337e65);return{'getId':async()=>(await _0x5956e0['request'])['json'](),'abortController':_0x5956e0['abortController']};}['fetchDocument'](_0x7a7907,_0x43480b){const _0x5d83c4=this['_sendApiRequest']('/conversations/'+_0x7a7907+'/documents/'+_0x43480b,'GET');return{'getDocument':async()=>(await _0x5d83c4['request'])['json'](),'abortController':_0x5d83c4['abortController']};}['uploadDocument'](_0x3689d5,_0x29d34b,_0x5df031){const _0x31e854={'content':_0x29d34b};_0x5df031&&(_0x31e854['attributes']=_0x5df031);const _0x22d27e=this['_sendApiRequest']('/conversations/'+_0x3689d5+'/documents','POST',_0x31e854);return{'getId':async()=>(await _0x22d27e['request'])['json'](),'abortController':_0x22d27e['abortController']};}['fetchConversations'](_0x42b272,_0x39b443){const _0x24afd1=new URLSearchParams();_0x24afd1['append']('excludeEmpty','true'),_0x24afd1['append']('limit','100'),_0x24afd1['append']('group',_0x42b272),_0x39b443&&_0x24afd1['append']('search',_0x39b443);const _0x53b2d6=this['_sendApiRequest']('/conversations?'+_0x24afd1['toString'](),'GET');return{'getConversations':async()=>{const _0x3ae1d0=await _0x53b2d6['request'];return(await _0x3ae1d0['json']())['items'];},'abortController':_0x53b2d6['abortController']};}['deleteConversation'](_0x99abb2){const _0x4ddc9c=this['_sendApiRequest']('/conversations/'+_0x99abb2,'DELETE');return{'execute':async()=>{await _0x4ddc9c['request'];},'abortController':_0x4ddc9c['abortController']};}['updateConversation'](_0x4a5a9b,_0x2aed90){const _0x3117a4=this['_sendApiRequest']('/conversations/'+_0x4a5a9b,'PATCH',_0x2aed90);return{'getResult':async()=>(await _0x3117a4['request'],_0x2aed90),'abortController':_0x3117a4['abortController']};}['fetchConversation'](_0x38915c){const _0x2ca674=this['_sendApiRequest']('/conversations/'+_0x38915c,'GET');return{'getConversation':async()=>(await _0x2ca674['request'])['json'](),'abortController':_0x2ca674['abortController']};}['fetchConversationMessages'](_0x131394){const _0x16b08e=this['_sendApiRequest']('/conversations/'+_0x131394+'/messages','GET');return{'getMessages':async()=>{const _0x396aea=await _0x16b08e['request'];return(await _0x396aea['json']())['items'];},'abortController':_0x16b08e['abortController']};}['uploadUrl'](_0xb2b23a,_0x155902,_0x1abf03){const _0x4a093b=this['_sendApiRequest']('/conversations/'+_0xb2b23a+'/web-resources','POST',{'url':_0x155902,'attributes':_0x1abf03});return{'getId':async()=>(await _0x4a093b['request'])['json'](),'abortController':_0x4a093b['abortController']};}['getModels'](){const _0x18a6f7=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x18a6f7['request'])['json'](),'abortController':_0x18a6f7['abortController']};}['deleteFile'](_0xfac73f,_0x4e83a5){const _0x66855d=this['_sendApiRequest']('/conversations/'+_0xfac73f+'/files/'+_0x4e83a5,'DELETE');return{'execute':async()=>{await _0x66855d['request'];},'abortController':_0x66855d['abortController']};}['deleteDocument'](_0x127f00,_0x43e897){const _0x117bdc=this['_sendApiRequest']('/conversations/'+_0x127f00+'/documents/'+_0x43e897,'DELETE');return{'execute':async()=>{await _0x117bdc['request'];},'abortController':_0x117bdc['abortController']};}['deleteWebResource'](_0x3a3819,_0x1c0d13){const _0x185709=this['_sendApiRequest']('/conversations/'+_0x3a3819+'/web-resources/'+_0x1c0d13,'DELETE');return{'execute':async()=>{await _0x185709['request'];},'abortController':_0x185709['abortController']};}['callSystemReview']({reviewName:_0xbff381,content:_0x34fadb,args:_0x22caa7}){const _0x3a2821=this['_sendApiRequest']('/reviews/system/'+_0xbff381+'/calls','POST',{'content':[{'type':'text','content':_0x34fadb}],'args':_0x22caa7});return{'getStream':async()=>{const _0x34d391=(await _0x3a2821['request'])['body'];return this['_getStreamReader'](_0x34d391);},'abortController':_0x3a2821['abortController']};}['callCustomReview']({content:_0x5ac160,prompt:_0x20b98d,model:_0x3907e7}){const _0x4b57f2=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x5ac160}],'prompt':_0x20b98d,'model':_0x3907e7});return{'getStream':async()=>{const _0x5d16bc=(await _0x4b57f2['request'])['body'];return this['_getStreamReader'](_0x5d16bc);},'abortController':_0x4b57f2['abortController']};}['upsertAIChatRating'](_0x1fec90,_0x314b2c,_0x495a0d){const _0x3b0cea=this['_sendApiRequest']('/conversations/'+_0x1fec90+'/messages/'+_0x314b2c+'/ratings','PUT',{'positiveCount':_0x495a0d['positiveCount'],'totalCount':_0x495a0d['totalCount'],'modificationId':_0x495a0d['modificationId']});return{'execute':async()=>{await _0x3b0cea['request'];},'abortController':_0x3b0cea['abortController']};}['upsertAIActionRating'](_0x36a01d,_0x37b252,_0x3b20ef){const _0x437eb8=this['_sendApiRequest']('/actions/system/'+_0x36a01d+'/calls/'+_0x37b252+'/ratings','PUT',{'positiveCount':_0x3b20ef['positiveCount'],'totalCount':_0x3b20ef['totalCount']});return{'execute':async()=>{await _0x437eb8['request'];},'abortController':_0x437eb8['abortController']};}['upsertCustomAIActionRating'](_0x335a15,_0x5137ce){const _0x50fa57=this['_sendApiRequest']('/actions/custom/calls/'+_0x335a15+'/ratings','PUT',{'positiveCount':_0x5137ce['positiveCount'],'totalCount':_0x5137ce['totalCount']});return{'execute':async()=>{await _0x50fa57['request'];},'abortController':_0x50fa57['abortController']};}['upsertAIReviewRating'](_0x5c9ca5,_0x2f63a7,_0x215068,_0x2fd080){const _0x322500=this['_sendApiRequest']('/reviews/system/'+_0x5c9ca5+'/calls/'+_0x2f63a7+'/ratings','PUT',{'positiveCount':_0x215068['positiveCount'],'totalCount':_0x215068['totalCount'],'dataId':_0x2fd080});return{'execute':async()=>{await _0x322500['request'];},'abortController':_0x322500['abortController']};}['upsertCustomAIReviewRating'](_0x2fdce5,_0x1743cf,_0x2ea9de){const _0x42a69c=this['_sendApiRequest']('/reviews/custom/calls/'+_0x2fdce5+'/ratings','PUT',{'positiveCount':_0x1743cf['positiveCount'],'totalCount':_0x1743cf['totalCount'],'dataId':_0x2ea9de});return{'execute':async()=>{await _0x42a69c['request'];},'abortController':_0x42a69c['abortController']};}['_sendApiRequest'](_0x456e2e,_0x1edf0f,_0x3f29c8){const _0x5d3b19=new AbortController(),_0x2c8dce=_0x3f29c8 instanceof FormData,_0x4844a5={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x3f29c8&&!_0x2c8dce&&(_0x4844a5['Content-Type']='application/json');const _0x25d4b2={'method':_0x1edf0f,'headers':_0x4844a5,'signal':_0x5d3b19['signal']};return _0x3f29c8&&(_0x25d4b2['body']=_0x2c8dce?_0x3f29c8:JSON['stringify'](_0x3f29c8)),{'request':fetch(''+this['_apiUrl']+_0x456e2e,_0x25d4b2)['catch'](_0x33a843=>{this['_handleError'](_0x33a843);})['then'](_0x2636f5=>{if(!_0x2636f5['ok'])throw new _0x2e27f1('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x456e2e,'method':_0x1edf0f,'body':_0x3f29c8,'status':(_0x2636f5||{})['status'],'statusText':(_0x2636f5||{})['statusText']});return _0x2636f5;}),'abortController':_0x5d3b19};}async*['_getStreamReader'](_0x56a1ec){const _0x4e8b0f=[],_0xfa1e26=_0x56a1ec['getReader'](),_0xe0325=Ct({'onError':_0x3d010d=>{this['_handleError'](_0x3d010d);},'onEvent':_0x2fa11e=>{_0x2fa11e['data']=JSON['parse'](_0x2fa11e['data']),_0x4e8b0f['push'](_0x2fa11e);}});try{let _0x166754=!0x1;for(;!_0x166754;){const {done:_0x2b26ae,value:_0x2e7b25}=await _0xfa1e26['read']();_0x2b26ae&&(_0x166754=!0x0),_0xe0325['feed'](this['_decoder']['decode'](_0x2e7b25,{'stream':!0x0})),yield*_0x4e8b0f,_0x4e8b0f['length']=0x0;}}catch(_0x2aad16){this['_handleError'](_0x2aad16);}finally{_0xfa1e26['releaseLock'](),_0xe0325['reset']();}}['_handleError'](_0x541e3d){if(_0x541e3d instanceof _0x2e27f1)throw _0x541e3d;if(_0x541e3d instanceof Error&&'AbortError'===_0x541e3d['name'])throw new _0x2e27f1('ai-request-aborted',this,{'originalError':_0x541e3d});throw new _0x2e27f1('ai-request-failed',this,{'originalError':_0x541e3d});}}function f(_0x2c5093,_0x59c78a,_0x2a5440){const t=_0x2c5093['t'];switch(_0x59c78a){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'},_0x2a5440);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_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});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_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\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});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_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.'},_0x2a5440);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.'},_0x2a5440);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_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_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.'},_0x2a5440);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_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_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x2a5440);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x2a5440);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x2a5440);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x2a5440);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x2a5440);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x2a5440);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x2a5440);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.'},_0x2a5440);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.'},_0x2a5440);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.'},_0x2a5440);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.'},_0x2a5440);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'},_0x2a5440);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_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','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_MODEL_DESCRIPTION_AUTO':return t({'id':'AI_MODEL_DESCRIPTION_AUTO','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU','string':'Cost-efficient\x20model\x20for\x20quick\x20interactions\x20with\x20improved\x20reasoning'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET','string':'Advanced\x20model\x20with\x20improved\x20creativity,\x20reliability,\x20and\x20reasoning'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});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.'},_0x2a5440);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_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_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_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'});default:return _0x59c78a;}}function ms(_0x1e32a0,_0x4557d8){const _0x457ebf=new _0x2cae14(_0x1e32a0),_0x1fc480=f(_0x1e32a0,'AI_TABS_LABEL_MINIMIZE'),_0x178e50=f(_0x1e32a0,'AI_TABS_LABEL_MAXIMIZE');return _0x457ebf['set']({'withText':!0x1,'icon':_0x32aee0,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x457ebf['bind']('label')['to'](_0x4557d8,'isMaximized',_0x634710=>_0x634710?_0x1fc480:_0x178e50),_0x457ebf['bind']('icon')['to'](_0x4557d8,'isMaximized',_0x4eb3db=>_0x4eb3db?to:_0x32aee0),_0x457ebf['bind']('isOn')['to'](_0x4557d8,'isMaximized'),_0x457ebf['on']('execute',()=>{_0x4557d8['fire']('resizeTabs');}),_0x457ebf;}function Ne(_0x3d3d79){return _0x5320fe(_0x3d3d79);}function tt(_0x562bc1){return _0x57c50a(_0x562bc1);}function st(_0x19f86f,_0x4dd4ce,_0x1ede65){const _0x761523=null!==_0x4dd4ce?_0x46a9a0=>_0x46a9a0['attribs'][_0x19f86f]===_0x4dd4ce:_0x20e1f7=>Boolean(_0x20e1f7['attribs'][_0x19f86f]);return _0x41539f(_0x46e02f=>_0xa8223f(_0x46e02f)&&_0x761523(_0x46e02f),_0x1ede65);}function Be(_0x423385,_0x41b3cf,_0x2c633c){const _0x20208d=null!==_0x41b3cf?_0x36ee86=>_0x36ee86['attribs'][_0x423385]===_0x41b3cf:_0x4d4d0c=>Boolean(_0x4d4d0c['attribs'][_0x423385]);return _0x38638f(_0x190d4b=>_0xa8223f(_0x190d4b)&&_0x20208d(_0x190d4b),_0x2c633c);}function Z(_0x88c47f,_0x415b3a){return _0x88c47f&&_0xa8223f(_0x88c47f)?_0x88c47f['attribs'][_0x415b3a]:null;}function Ze(_0x2d2f29,_0x1e46b2,_0x405431){_0xa8223f(_0x2d2f29)&&(null===_0x405431?delete _0x2d2f29['attribs'][_0x1e46b2]:_0x2d2f29['attribs'][_0x1e46b2]=_0x405431);}function Je(_0x1a258d,_0x2997f7,_0xd32425){const _0x105c4b=_0x2997f7['cloneNode'](!0x0);'beforebegin'===_0xd32425?_0x53e16f(_0x1a258d,_0x105c4b):'afterbegin'===_0xd32425?_0x5d90f3(_0x1a258d,_0x105c4b):'beforeend'===_0xd32425?_0x47d205(_0x1a258d,_0x105c4b):'afterend'===_0xd32425&&_0x1dde25(_0x1a258d,_0x105c4b);}function Le(_0x4470c2){const _0x2de1a8=[];let _0x5b3de5=_0x4470c2;for(;_0x5b3de5;)_0x5b3de5=_0xf74c50(_0x5b3de5),_0x5b3de5&&_0x2de1a8['push'](_0x5b3de5);return _0x2de1a8;}function Jn(_0x3b1fb8){return _0x3b1fb8['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Is(_0x4ada3a){let _0xc26abe=0x0;for(;_0x4ada3a['parentNode'];)_0x4ada3a=_0x4ada3a['parentNode'],_0xc26abe++;return _0xc26abe;}function ws(_0x3fc2b9){const _0x7733a2=[];let _0x446cf6=_0x3fc2b9['nextSibling'];for(;_0x446cf6;)_0x7733a2['push'](_0x446cf6),_0x446cf6=_0x446cf6['nextSibling'];_0x7733a2['forEach'](_0xb05ae2=>{_0x112be1(_0xb05ae2);});}class Ve extends/* #__PURE__ -- @preserve */
|
|
25
|
+
$t(){['_m2html'];constructor(){super(),this['_m2html']=new _0x54f549();}['convertMarkdownToHTML'](_0x20445c){const _0x1b99ae=this['_m2html']['parse'](_0x20445c);return this['parseAndNormalizeHTML'](_0x1b99ae);}['parseAndNormalizeHTML'](_0x4dffc4){return this['_parseHTML'](_0x4dffc4);}['_parseHTML'](_0x5de003){const _0x5d9b10=Ne('<dummy>'+_0x5de003['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x5d9b10['children']=_0x5d9b10['children'][0x0]['children'],_0x5d9b10;}}class We extends/* #__PURE__ -- @preserve */
|
|
26
|
+
$t(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x47eb3a){super(),this['_generateUid']=_0x47eb3a||_0x4fd5c3;}['merge'](_0x44aebf,_0x2ca491,_0x255f9b){const _0x47b506=_0x44aebf['cloneNode'](!0x0);if(0x0===_0x2ca491['childNodes']['length']){const _0x3c09e7=[];return Be('data-id','new-element',_0x47b506)['forEach'](_0x4e37c4=>{const _0x754481=this['_generateUid']();Ze(_0x4e37c4,'data-id',_0x754481),_0x3c09e7['push'](_0x754481);}),this['_removeSpecialComments'](_0x47b506),{'parsedContent':_0x47b506,'newNodeIds':_0x3c09e7,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x255f9b&&_0x255f9b['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x47b506),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Be('data-id',null,_0x2ca491)['map'](_0x5c3c06=>Z(_0x5c3c06,'data-id'))['filter'](_0x4b9bd1=>!!_0x4b9bd1));let _0x3ce361=-0x1,_0x1d854c=!0x1;const _0x2bfcf3=_0x47b506['childNodes'],_0x504d46=Array['from'](_0x2bfcf3)['filter'](_0x9560ae=>!(0x3===_0x9560ae['nodeType']&&''===tt(_0x9560ae)['trim']())),_0x537831=_0x504d46['length'];for(let _0xe19bad=0x0;_0xe19bad<_0x537831;_0xe19bad++){const _0x127795=_0x504d46[_0xe19bad],_0x1fa951=_0x504d46[_0xe19bad+0x1];if(this['_isNewNode'](_0x127795)){if(-0x1===_0x3ce361&&(_0x3ce361=_0xe19bad),this['_markWrappedElements'](_0x127795),!this['_isNewNode'](_0x1fa951)){const [_0x52fc17,_0x1d2e3d]=this['_findReferenceNode'](_0x127795,_0x1d854c,_0x2ca491);if(_0x52fc17){const _0x15ce79=Array['from'](_0x504d46)['slice'](_0x3ce361,_0xe19bad+0x1);this['_insertNodes'](_0x52fc17,_0x15ce79,_0x1d2e3d),_0x3ce361=-0x1;}}}else{if(this['_isExistingContentComment'](_0x127795))_0x1d854c=!0x0;else{if(this['_isExistingNode'](_0x127795)){const _0x1d4505=Z(_0x127795,'data-id');if(_0x1d4505&&this['_existingDataIds']['has'](_0x1d4505)){const _0x5f4377=st('data-id',_0x1d4505,_0x2ca491);this['_replaceNode'](_0x5f4377,_0x127795);}if(this['_touchedNodesState']['removedIds']['includes'](_0x1d4505)){const _0x3e86dc=this['_touchedNodesState']['removedIds']['indexOf'](_0x1d4505);this['_touchedNodesState']['removedIds']['splice'](_0x3e86dc,0x1);}}else{if(this['_isDelNode'](_0x127795)){const _0x8a7c49=Z(_0x127795,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x8a7c49)||this['_storeDeletedElementIds'](_0x127795);}}}}}for(const _0x1ffa64 of this['_touchedNodesState']['removedIds']){const _0x1d1462=st('data-id',_0x1ffa64,_0x2ca491);if(_0x1d1462){if(_0x255f9b&&_0x255f9b['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x1ffa64;const _0x1b68f9=_0x255f9b['replaceRemovedWith']['cloneNode'](!0x0);Ze(_0x1b68f9,'data-id',_0x1ffa64),Ze(_0x1b68f9,'data-removed','true'),_0x4998ec(_0x1d1462,_0x1b68f9);}else _0x112be1(_0x1d1462);}}if(Be('data-wrapped-id',null,_0x2ca491)['forEach'](_0x14137f=>{const _0x501e73=st('data-id',Z(_0x14137f,'data-wrapped-id'),_0x2ca491);var _0x2a9755,_0x24c78d;_0x501e73&&(_0x24c78d=_0x14137f,_0x112be1(_0x2a9755=_0x501e73),_0x4998ec(_0x24c78d,_0x2a9755));}),Be('data-id','new-element',_0x2ca491)['forEach'](_0x55c4ea=>{const _0x13a54c=this['_getUid'](_0x55c4ea);Ze(_0x55c4ea,'data-id',_0x13a54c),this['_touchedNodesState']['newIds']['push'](_0x13a54c);}),this['_removeSpecialComments'](_0x2ca491),_0x255f9b&&_0x255f9b['markUnstableElements']&&this['_markUnstableElements'](_0x2ca491,_0x255f9b['markUnstableElementsDepth']||0x0),_0x255f9b&&_0x255f9b['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x1bd205=st('data-id',this['_touchedNodesState']['lastTouchedId'],_0x2ca491);for(;_0x1bd205;)ws(_0x1bd205),_0x1bd205=_0x1bd205['parentNode'];}return{'parsedContent':_0x2ca491,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0xda576d,_0x58badc,_0x117d22){for(const _0x4eab61 of _0x58badc){const _0x59b22b=this['_getUid'](_0x4eab61);Ze(_0x4eab61,'data-id',_0x59b22b),this['_touchedNodesState']['newIds']['push'](_0x59b22b),this['_touchedNodesState']['lastTouchedId']=_0x59b22b;}const _0x4626d9='afterbegin'===_0x117d22||'afterend'===_0x117d22?_0x58badc['reverse']():_0x58badc;for(const _0x4f9e16 of _0x4626d9)Je(_0xda576d,_0x4f9e16,_0x117d22);}['_replaceNode'](_0x5be366,_0x36f39a){if(!_0x5be366)return;if(_0x290f37=_0x36f39a,Jn(tt(_0x5be366))===Jn(tt(_0x290f37)))return;var _0x290f37;const _0x162db1=this['_getUid'](_0x5be366);Ze(_0x36f39a,'data-id',_0x162db1),this['_touchedNodesState']['modifiedIds']['push'](_0x162db1),this['_touchedNodesState']['lastTouchedId']=_0x162db1,_0x4998ec(_0x5be366,_0x36f39a['cloneNode'](!0x0));}['_findReferenceNode'](_0xd6f49a,_0x488aa9,_0x36518c){const _0x4f2010=this['_findPrevElementWithDataId'](_0xd6f49a,!0x1);if(_0x4f2010){const _0x5d2548=this['_getNodeDataId'](_0x4f2010),_0x976918=st('data-id',_0x5d2548,_0x36518c);if(_0x976918)return[_0x976918,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x5d2548);}const _0x1c6c6b=this['_findNextElementWithDataId'](_0xd6f49a,!0x1);if(_0x1c6c6b){const _0x4361be=this['_getNodeDataId'](_0x1c6c6b),_0xeaf11f=st('data-id',_0x4361be,_0x36518c);if(_0xeaf11f)return[_0xeaf11f,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x4361be);}return _0x488aa9?_0xd6f49a['nextSibling']?this['_findFallbackReferenceNode'](_0xd6f49a,_0x36518c):[_0x36518c['childNodes'][_0x36518c['childNodes']['length']-0x1],'afterend']:[_0x36518c['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x5c907e,_0x48bafc){const _0x47f4d4=[],_0x400e76=this['_findPrevElementWithDataId'](_0x5c907e,!0x0);if(_0x400e76){const _0x273d0a=st('data-id',this['_getNodeDataId'](_0x400e76),_0x48bafc);_0x273d0a&&_0x47f4d4['push']([_0x273d0a,'afterend']);}const _0x359b42=this['_findNextElementWithDataId'](_0x5c907e,!0x0);if(_0x359b42){const _0x46b763=st('data-id',this['_getNodeDataId'](_0x359b42),_0x48bafc);_0x46b763&&_0x47f4d4['push']([_0x46b763,'beforebegin']);}if(_0x47f4d4['length']>0x1)return Is(_0x47f4d4[0x0][0x0])<=Is(_0x47f4d4[0x1][0x0])?_0x47f4d4[0x0]:_0x47f4d4[0x1];return 0x1===_0x47f4d4['length']?_0x47f4d4[0x0]:[_0x48bafc['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x308540,_0x20d7b3){let _0x31f8e1=_0x308540['nextSibling'],_0x384e40=null,_0x3d2131=!0x1;for(;_0x31f8e1;){if(_0x227d7e(_0x31f8e1)){if(this['_isDelNode'](_0x31f8e1)&&(_0x384e40=_0x31f8e1),this['_isExistingContentComment'](_0x31f8e1)&&_0x20d7b3&&!_0x3d2131){_0x3d2131=!0x0,_0x31f8e1=_0x31f8e1['nextSibling'];continue;}break;}const _0x2efd0b=Z(_0x31f8e1,'data-id');if(_0x2efd0b&&'new-element'!==_0x2efd0b&&this['_existingDataIds']['has'](_0x2efd0b)){_0x384e40=_0x31f8e1;break;}_0x31f8e1=_0x31f8e1['nextSibling'];}return _0x384e40;}['_findPrevElementWithDataId'](_0x23b1c7,_0x352b8b){let _0x5c7c47=_0x23b1c7['previousSibling'],_0x40f260=null,_0x1561aa=!0x1;for(;_0x5c7c47;){if(_0x227d7e(_0x5c7c47)){if(this['_isDelNode'](_0x5c7c47)&&(_0x40f260=_0x5c7c47),this['_isExistingContentComment'](_0x5c7c47)&&_0x352b8b&&!_0x1561aa){_0x1561aa=!0x0,_0x5c7c47=_0x5c7c47['previousSibling'];continue;}break;}const _0x5f08d8=Z(_0x5c7c47,'data-id');if(_0x5f08d8&&'new-element'!==_0x5f08d8&&this['_existingDataIds']['has'](_0x5f08d8)){_0x40f260=_0x5c7c47;break;}_0x5c7c47=_0x5c7c47['previousSibling'];}return _0x40f260;}['_markWrappedElements'](_0x30a136){_0xa8223f(_0x30a136)&&Be('data-id',null,_0x30a136)['forEach'](_0x78f8b5=>{this['_isExistingNode'](_0x78f8b5)&&!this['_hasWrappedParent'](_0x78f8b5)&&(Ze(_0x78f8b5,'data-wrapped-id',Z(_0x78f8b5,'data-id')),Ze(_0x78f8b5,'data-id',null));});}['_getNodeDataId'](_0x1608e8){if(!_0x1608e8)return null;if(_0xa8223f(_0x1608e8))return Z(_0x1608e8,'data-id');if(_0x227d7e(_0x1608e8)){const _0x2a8858=tt(_0x1608e8)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x2a8858&&_0x2a8858[0x1])return _0x2a8858[0x1];}return null;}['_storeDeletedElementIds'](_0x508b1c){if(_0x227d7e(_0x508b1c)){const _0x256980=tt(_0x508b1c)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x256980&&_0x256980[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x256980[0x1]);}}['_getUid'](_0x3f2c53){return this['_isExistingNode'](_0x3f2c53)?Z(_0x3f2c53,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0xc5ba12){(function(_0x644e84){return _0x2cafdb(_0x430f83=>_0x227d7e(_0x430f83),_0x644e84,!0x0,0x1/0x0);}(_0xc5ba12)['filter'](_0x272bcb=>this['_isDelNode'](_0x272bcb)||this['_isExistingContentComment'](_0x272bcb))['forEach'](_0xdca6ed=>{_0x112be1(_0xdca6ed);}));}['_markLastTagElementUnstable'](_0x5a532b){const _0x3f8ff4=_0x5a532b['childNodes'],_0x5bf5ba=_0x3f8ff4[_0x3f8ff4['length']-0x1];_0x5bf5ba&&_0xa8223f(_0x5bf5ba)&&Ze(_0x5bf5ba,'data-unstable','true');}['_markUnstableElements'](_0x21525f,_0x15aff9){const _0x1d58d8=st('data-unstable','true',_0x21525f);if(!_0x1d58d8)return;const _0x184f05=Le(_0x1d58d8)['slice'](0x0,-0x1),_0x4a7f5d=_0x184f05['length'];let _0x1dc45b=_0x1d58d8;if(_0x4a7f5d>_0x15aff9){let _0x1b4f00=_0x4a7f5d,_0x8a7971=null;for(;_0x1b4f00>_0x15aff9&&_0x1b4f00>=0x0;)_0x1b4f00--,_0x8a7971=_0x184f05[_0x1b4f00];_0x8a7971&&(_0x1dc45b=_0x8a7971,Ze(_0x1d58d8,'data-unstable',null),Ze(_0x8a7971,'data-unstable','true'));}else{if(_0x4a7f5d<_0x15aff9){let _0x268d13=_0x4a7f5d,_0x11fc35=_0x1d58d8;for(;_0x268d13<_0x15aff9;){const _0x5dc523=_0x11fc35['childNodes']['filter'](_0x557f89=>_0xa8223f(_0x557f89));if(0x0===_0x5dc523['length'])break;_0x268d13++,_0x11fc35=_0x5dc523[_0x5dc523['length']-0x1];}_0x11fc35&&(_0x1dc45b=_0x11fc35,Ze(_0x1d58d8,'data-unstable',null),Ze(_0x11fc35,'data-unstable','true'));}}let _0x34923a=_0x1dc45b;for(;_0x34923a;){for(;_0x34923a['nextSibling'];)_0x34923a=_0x34923a['nextSibling'],_0xa8223f(_0x34923a)&&Ze(_0x34923a,'data-unstable','true');_0x34923a=_0x34923a['parentNode'];}}['_isNewNode'](_0x2a108e){return Boolean('new-element'===Z(_0x2a108e,'data-id'));}['_isExistingNode'](_0x5f5570){return Boolean((Z(_0x5f5570,'data-id')||'')['length']>0x0&&'new-element'!==Z(_0x5f5570,'data-id'));}['_isDelNode'](_0x424d89){return!!_0x424d89&&Boolean(_0x227d7e(_0x424d89)&&tt(_0x424d89)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x25766c){let _0x27be12=_0x25766c['parentNode'];for(;_0x27be12;){if(Z(_0x27be12,'data-wrapped-id'))return!0x0;_0x27be12=_0x27be12['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x439861){return Boolean(_0x227d7e(_0x439861)&&tt(_0x439861)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function x({editor:_0x6d751b,changeGroups:_0x2be58e,documentContextContent:_0x59dc26,showDiff:_0x1c16c7,trimUnchanged:_0x3a907d=!0x0}){return _0x2be58e['map'](_0x1af705=>{const _0x229b4e=new it([]),_0x89f045=new it([]);for(const _0x1a1494 of _0x1af705['changes'])if(_0x1c16c7&&'removed'==_0x1a1494['type']||_0x89f045['children']['push'](_0x1a1494['node']['cloneNode'](!0x0)),'new'!=_0x1a1494['type']&&(_0x1c16c7||'removed'!=_0x1a1494['type'])){const _0x2f4737=_0x41539f(_0x4c979a=>Z(_0x4c979a,'data-id')==_0x1a1494['id'],_0x59dc26,!0x0);_0x2f4737&&_0x229b4e['children']['push'](_0x2f4737['cloneNode'](!0x0));}const {content:_0x131369,hasChanges:_0x3dd5fe}=function(_0x45c644,_0x428784,_0x4bd8a7,_0x11e6f5,_0x56300b=!0x0){const _0x5bf216=_0x45c644['plugins']['get']('DocumentCompare'),_0x1facb8=tt(_0x428784),_0x3600de=tt(_0x4bd8a7),_0x413fd0=_0x45c644['data']['parse'](_0x1facb8,'$root'),_0x42bc83=_0x45c644['model']['createPositionAt'](_0x413fd0,0x0),_0x48cbc9=_0x5bf216['getDiff'](_0x1facb8,_0x3600de,{'anchor':_0x42bc83,'markDeletions':_0x11e6f5}),_0x571d71=_0x48cbc9['getOperations']();if(0x0==_0x571d71['length'])return{'content':_0x428784['cloneNode'](!0x0),'hasChanges':!0x1};_0x11e6f5?function(_0x32975f,_0x5d0d6c,_0x45915e){if(0x0==_0x32975f['length'])return;const _0x5f29dc=_0x45915e['plugins']['get']('DocumentCompare'),_0xcc856=_0x45915e['plugins']['get']('SuggestionsConversion');_0x45915e['model']['change'](_0x41081b=>{const _0x2ed67a=new Set();for(let _0x521d04=0x0;_0x521d04<_0x32975f['length'];_0x521d04++){const _0x237af2=_0x32975f[_0x521d04];if(_0x237af2['baseVersion']=null,_0x237af2['isDocumentOperation']=!0x1,_0x5f29dc['isMarkedRemoveOperation'](_0x237af2)){const _0xe38e2e=_0x4564cc(_0x237af2['newRange'],_0x45915e['model']),_0x33a383='suggestion:deletion:'+_0x4fd5c3()+':$aiSuggestion';_0x5d0d6c['markers']['set'](_0x33a383,_0xe38e2e);}else switch(_0x237af2['type']){case'rename':{if(_0x237af2['oldName']==_0x237af2['newName'])break;_0x41081b['batch']['addOperation'](_0x237af2),_0x45915e['model']['applyOperation'](_0x237af2);const _0x5650e6='$elementName',_0x363de2=_0x237af2['position'],_0x3693a0=_0x45915e['model']['createRange'](_0x363de2,_0x45915e['model']['createPositionAt'](_0x363de2['nodeAfter'],'end')),_0x5907e3='suggestion:attribute:'+_0x5650e6+':'+_0x4fd5c3()+':$aiSuggestion';_0x5d0d6c['markers']['set'](_0x5907e3,_0x3693a0);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x237af2['oldValue']==_0x237af2['newValue'])break;_0x41081b['batch']['addOperation'](_0x237af2),_0x45915e['model']['applyOperation'](_0x237af2);const _0x2d22ad=_0x237af2['key'];if(!_0xcc856['isRegisteredAttribute'](_0x2d22ad))break;const _0x40005d=_0x4564cc(_0x237af2['range'],_0x45915e['model']),_0x620f83='suggestion:attribute:'+_0x2d22ad+':'+_0x4fd5c3()+':$aiSuggestion';_0x5d0d6c['markers']['set'](_0x620f83,_0x40005d);break;}case'insert':{_0x41081b['batch']['addOperation'](_0x237af2),_0x45915e['model']['applyOperation'](_0x237af2);if(_0x32975f[_0x521d04+0x1]&&'move'==_0x32975f[_0x521d04+0x1]['type']){ro(_0x5d0d6c,_0x237af2);break;}const _0x4d0940=_0x237af2['position'],_0xdfd365=_0x237af2['howMany'],_0x21cfd2=_0x4564cc(_0x45915e['model']['createRange'](_0x4d0940,_0x4d0940['getShiftedBy'](_0xdfd365)),_0x45915e['model']),_0x375a28='suggestion:insertion:'+_0x4fd5c3()+':$aiSuggestion';_0x5d0d6c['markers']['set'](_0x375a28,_0x21cfd2);break;}case'split':{_0x41081b['batch']['addOperation'](_0x237af2),_0x45915e['model']['applyOperation'](_0x237af2);const _0x1fbe9e=_0x237af2['splitPosition'],_0x5d328b=_0x237af2['moveTargetPosition'],_0x583103=_0x45915e['model']['createRange'](_0x1fbe9e,_0x5d328b),_0x13225d='suggestion:insertion:'+_0x4fd5c3()+':$aiSuggestion';_0x5d0d6c['markers']['set'](_0x13225d,_0x583103);break;}case'move':{_0x41081b['batch']['addOperation'](_0x237af2),_0x45915e['model']['applyOperation'](_0x237af2),_0x32975f[_0x521d04-0x1]&&'insert'==_0x32975f[_0x521d04-0x1]['type']&&ro(_0x5d0d6c,_0x237af2);const _0x2fbdff=_0x237af2['getMovedRangeStart'](),_0x125fb9=_0x237af2['howMany'];for(let _0x2e963e=0x0;_0x2e963e<_0x125fb9;_0x2e963e++){const _0x190c31=_0x2fbdff['getShiftedBy'](_0x2e963e)['nodeAfter'];_0x2ed67a['add'](_0x190c31);}break;}case'remove':{const _0x48d5f7=_0x237af2['sourcePosition'],_0x368d8a=_0x237af2['howMany'],_0x908b57=new _0x93a95(_0x48d5f7,_0x368d8a);_0x41081b['batch']['addOperation'](_0x908b57),_0x45915e['model']['applyOperation'](_0x908b57);break;}}}for(const _0x7bec2b of _0x2ed67a){const _0x490b82=_0x45915e['model']['createRangeOn'](_0x7bec2b),_0x217dc8='suggestion:formatBlock:$fakeWrap:'+_0x4fd5c3()+':$aiSuggestion';_0x5d0d6c['markers']['set'](_0x217dc8,_0x4564cc(_0x490b82,_0x45915e['model']));}});}(_0x571d71,_0x413fd0,_0x45c644):_0x45c644['model']['change'](_0x5ea5fc=>{for(const _0x6266d4 of _0x571d71)if('remove'==_0x6266d4['type']){const _0x5b36f3=_0x6266d4['sourcePosition'],_0xe408e8=_0x6266d4['howMany'],_0x16488b=new _0x93a95(_0x5b36f3,_0xe408e8);_0x5ea5fc['batch']['addOperation'](_0x16488b),_0x45c644['model']['applyOperation'](_0x16488b);}else{if('marker'==_0x6266d4['type']){const _0x14fe3f=_0x6266d4['name'],_0x12c3ca=_0x6266d4['newRange'];_0x413fd0['markers']['set'](_0x14fe3f,_0x12c3ca);}else _0x6266d4['baseVersion']=null,_0x6266d4['isDocumentOperation']=!0x1,_0x5ea5fc['batch']['addOperation'](_0x6266d4),_0x45c644['model']['applyOperation'](_0x6266d4);}});if(_0x56300b){const _0x18f669=K(_0x45c644,_0x571d71,_0x413fd0);J(_0x45c644['model'],_0x18f669),function(_0x3b2433,_0x35ccd8){const _0x4b89d8=_0x35ccd8['getFirstRange']()['start'];let _0x43598d=_0x35ccd8['getFirstRange']()['end'];const _0xb4b24d=_0x4b89d8['root'];(_0x43598d['textNode']||_0x43598d['nodeAfter']&&_0x43598d['nodeAfter']['is']('$text'))&&(_0x588c85(_0x43598d,'...'),_0x43598d=_0x43598d['getShiftedBy'](0x3)),(_0x4b89d8['textNode']||_0x4b89d8['nodeBefore']&&_0x4b89d8['nodeBefore']['is']('$text'))&&(_0x588c85(_0x4b89d8,'...'),function(_0x5ed038,_0x179b10,_0x2de468){for(let [_0x1e4dd5,_0x3fea1b]of _0x5ed038['markers']){const _0x32c45d=_0x3fea1b['_getTransformedByInsertion'](_0x179b10,_0x2de468,!0x1);_0x3fea1b=_0x32c45d[0x0],_0x5ed038['markers']['set'](_0x1e4dd5,_0x3fea1b);}}(_0xb4b24d,_0x4b89d8,0x3),_0x4b89d8['parent']==_0x43598d['parent']&&(_0x43598d=_0x43598d['getShiftedBy'](0x3)));const _0x29210c=_0x3b2433['createRange'](_0x3b2433['createPositionAt'](_0xb4b24d,0x0),_0x4b89d8),_0x513bf1=_0x3b2433['createRange'](_0x43598d,_0x3b2433['createPositionAt'](_0xb4b24d,'end')),_0x33f2fb=[..._0x29210c['getMinimalFlatRanges'](),..._0x513bf1['getMinimalFlatRanges']()];_0x33f2fb['reverse']();for(const _0x340f43 of _0x33f2fb)_0x4f5143(_0x340f43),Zn(_0xb4b24d,_0x340f43);}(_0x45c644['model'],_0x18f669);}const _0x3869d3=_0x45c644['data']['stringify'](_0x413fd0,{'showSuggestionHighlights':!0x0});return{'content':Ne(_0x3869d3),'hasChanges':!0x0};}(_0x6d751b,_0x229b4e,_0x89f045,_0x1c16c7,_0x3a907d);return{'type':_0x1af705['changes'][0x0]['type'],'index':_0x1af705['index'],'content':_0x131369,'hasChanges':_0x3dd5fe};});}function ro(_0x50fdc2,_0x2318b8){for(const [_0x43d82d,_0x50d807]of _0x50fdc2['markers']){const _0xe6e4ca=_0x3ceedb['_createFromRanges'](_0x50d807['getTransformedByOperation'](_0x2318b8));_0x50fdc2['markers']['set'](_0x43d82d,_0xe6e4ca);}}function K(_0x228bdb,_0x5c5b9d,_0x5c7676){const _0x1304b2=_0x228bdb['plugins']['get']('DocumentCompare');let _0x5889b2=_0x228bdb['model']['createPositionAt'](_0x5c7676,Number['POSITIVE_INFINITY']),_0x351162=_0x228bdb['model']['createPositionAt'](_0x5c7676,0x0);for(const _0x5519e1 of _0x5c5b9d){let _0x584e77,_0x402e6c;if(_0x1304b2['isMarkedRemoveOperation'](_0x5519e1))_0x584e77=_0x5519e1['newRange']['start'],_0x402e6c=_0x5519e1['newRange']['end'];else switch(_0x5889b2=_0x5889b2['getTransformedByOperation'](_0x5519e1),_0x351162=_0x351162['getTransformedByOperation'](_0x5519e1),_0x5519e1['type']){case'rename':_0x584e77=_0x5519e1['position'],_0x402e6c=_0x584e77['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x584e77=_0x5519e1['range']['start'],_0x402e6c=_0x5519e1['range']['end'];break;case'insert':_0x584e77=_0x5519e1['position'],_0x402e6c=_0x584e77['getShiftedBy'](_0x5519e1['howMany']);break;case'split':_0x584e77=_0x5519e1['splitPosition'],_0x402e6c=_0x5519e1['moveTargetPosition'];break;case'merge':{const _0x50c29c=_0x5519e1['targetPosition']['path']['slice'](0x0,-0x1);_0x584e77=_0x228bdb['model']['createPositionFromPath'](_0x5c7676,_0x50c29c),_0x402e6c=_0x584e77['getShiftedBy'](0x1);break;}case'remove':{const _0x51219d=_0x5519e1['howMany'],_0x1facfb=_0x5519e1['sourcePosition']['_getTransformedByInsertion'](_0x5519e1['targetPosition'],_0x51219d),_0x2ed0db=_0x5519e1['getMovedRangeStart']();'remove'==_0x5519e1['type']?(_0x584e77=_0x1facfb,_0x402e6c=_0x1facfb):(_0x584e77=_0x2ed0db,_0x402e6c=_0x2ed0db['getShiftedBy'](_0x51219d));break;}}_0x584e77&&_0x584e77['isBefore'](_0x5889b2)&&(_0x5889b2=_0x584e77['clone'](),_0x5889b2['stickiness']='toNone'),_0x402e6c&&_0x402e6c['isAfter'](_0x351162)&&(_0x351162=_0x402e6c['clone'](),_0x351162['stickiness']='toNone');}return _0x228bdb['model']['createSelection'](_0x228bdb['model']['createRange'](_0x5889b2,_0x351162));}function J(_0x2f05c6,_0x1e4fdb){so(_0x2f05c6,_0x1e4fdb,'forward');const _0x314add=_0x1e4fdb['getFirstRange']();_0x1e4fdb['setTo']([]),_0x1e4fdb['setTo'](_0x314add,{'backward':!0x0}),so(_0x2f05c6,_0x1e4fdb,'backward');}function so(_0x427414,_0x5d0e6b,_0x56259f){let _0x18f994=0x14;for(;_0x18f994;){_0x427414['modifySelection'](_0x5d0e6b,{'unit':'word','direction':_0x56259f}),_0x18f994--;const _0x28eb10=_0x5d0e6b['focus']['forward'==_0x56259f?'nodeBefore':'nodeAfter'];if(_0x28eb10&&_0x28eb10['is']('element')&&_0x427414['schema']['isBlock'](_0x28eb10)&&_0x427414['schema']['isObject'](_0x28eb10))break;}}function Zn(_0x4fa99c,_0x1b980b){for(const [_0x561b44,_0x4be010]of _0x4fa99c['markers']){const _0x29cbe2=_0x4be010['_getTransformedByDeletion'](_0x1b980b['start'],_0x1b980b['end']['offset']-_0x1b980b['start']['offset']);null!=_0x29cbe2?_0x4fa99c['markers']['set'](_0x561b44,_0x29cbe2):_0x4fa99c['markers']['delete'](_0x561b44);}}const Wr=['modification-delta','text-delta','web-search','reasoning'],Yr=['conversation-title'];class pe extends $t(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new it([]);['parsedMergedContent']=new it([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x43c50a,content:_0x10a968='',isDone:_0x86dfb7=!0x1,interactionId:_0x5492de,areActionsDisabled:_0x5b37f4,documentContextContent:_0x19fffb,editor:_0x15a537,id:_0x534ab5}){super(),this['id']=_0x534ab5||_0x4fd5c3(),this['interactionId']=_0x5492de,this['type']=_0x43c50a,this['areActionsDisabled']=!!_0x5b37f4,this['editor']=_0x15a537,this['aiResponseParser']=new Ve(),this['aiResponseApplier']=new We(),this['documentContextContent']=Ne(_0x19fffb||''),this['set']('isDone',_0x86dfb7),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x10a968);}['appendContent'](_0x4a9e77){this['set']('content',this['content']+_0x4a9e77);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x3dda20,_0xa7b788){this['changeGroups'][_0x3dda20]['state']=_0xa7b788,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x3dda20,'state':_0xa7b788});}['getContentParts']({showDiff:_0x169a00,groupIndex:_0x393041}){if(!this['editor'])throw new _0x2e27f1('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x419588=this['_getCachedContentParts'](_0x169a00,_0x393041);if(_0x419588)return _0x419588;let _0x2044ba=[];if(void 0x0===_0x393041)_0x2044ba=this['changeGroups'];else{const _0x34e32e=this['changeGroups']['find'](({index:_0x435b85})=>_0x435b85===_0x393041);if(!_0x34e32e)throw new _0x2e27f1('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x393041});_0x2044ba=[_0x34e32e];}const _0x1342ab=x({'editor':this['editor'],'showDiff':_0x169a00,'changeGroups':_0x2044ba,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x169a00,_0x1342ab),_0x1342ab;}['_getCachedContentParts'](_0x5d7048,_0x1cfafb){const _0x3feb06=_0x5d7048?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x3feb06]['length'])return null;const _0x2f3a0d=this['cachedSuggestionContentParts'][_0x3feb06];if(void 0x0===_0x1cfafb)return _0x507f53(_0x2f3a0d);{const _0x236951=_0x2f3a0d['find'](({index:_0x551705})=>_0x551705===_0x1cfafb);if(_0x236951)return[_0x507f53(_0x236951)];}return null;}['_setCachedContentParts'](_0x46380a,_0x9586a){const _0x1551fa=_0x46380a?'withDiff':'withoutDiff';_0x9586a['forEach'](_0x31818c=>{const _0x2063fa=this['cachedSuggestionContentParts'][_0x1551fa],_0x77de47=_0x2063fa['find'](({index:_0x40fbb3})=>_0x40fbb3===_0x31818c['index']);if(_0x77de47){const _0x325db0=_0x2063fa['indexOf'](_0x77de47);_0x2063fa['splice'](_0x325db0,0x1,_0x31818c);}else _0x2063fa['push'](_0x31818c);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0xf2b856=this['changeGroups'];this['updateChangeGroups']();const _0x1cd00a=this['_getDifferentChangeGroups'](_0xf2b856,this['changeGroups']);(_0x1cd00a['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x1cd00a),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x577307,_0x3ddfca){const _0x26957b=[];for(const _0x71a6a0 of _0x3ddfca){const _0x27625a=_0x577307[_0x71a6a0['index']];_0x27625a?_0x27625a['changes']['length']!==_0x71a6a0['changes']['length']?_0x26957b['push'](_0x71a6a0):_0x27625a['changes']['forEach']((_0x2282ba,_0x5e63bf)=>{const _0x23a206=_0x71a6a0['changes'][_0x5e63bf];_0x2282ba['id']!==_0x23a206['id']&&_0x26957b['push'](_0x71a6a0);}):_0x26957b['push'](_0x71a6a0);}return _0x26957b;}['updateChangeGroups'](){const _0x2740f2=new _0x43f7b3('p',{},[new _0x43f7b3('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x423c6f(f(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x48ccd2=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x2740f2,'cutAfterLastChange':!this['isDone']});if(!_0x48ccd2['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x48ccd2['parsedContent'];let _0x5568a7=[];if(_0x38638f(_0x211275=>{const _0x598c1e=Z(_0x211275,'data-id');if(!_0x598c1e||!_0x31d488(_0x598c1e))return!0x1;const _0xfa19d2=[_0x211275,...Le(_0x211275)]['at'](-0x2);if(_0x211275!=_0xfa19d2){const _0x18f5ca=Z(_0xfa19d2,'data-id');_0x31d488(_0x18f5ca)||(_0x5568a7['push']({'node':_0xfa19d2,'id':_0x18f5ca,'type':'modified'}),_0x48ccd2['modifiedNodeIds']['push'](_0x18f5ca));}else _0x48ccd2['modifiedNodeIds']['includes'](_0x598c1e)?_0x5568a7['push']({'node':_0x211275,'type':'modified','id':_0x598c1e}):_0x48ccd2['newNodeIds']['includes'](_0x598c1e)?_0x5568a7['push']({'node':_0x211275,'type':'new','id':_0x598c1e,'anchorId':Z(_0x211275['previousSibling'],'data-id')}):_0x5568a7['push']({'node':_0x211275,'type':'removed','id':_0x598c1e});return!0x0;},this['parsedMergedContent']),_0x5568a7=_0x5568a7['filter'](({node:_0x33ecf7})=>[...Le(_0x33ecf7),_0x33ecf7]['every'](_0x87332f=>!Z(_0x87332f,'data-unstable'))),0x0==_0x5568a7['length'])return;const _0x2ab3d7=[[_0x5568a7[0x0]]];for(let _0x1f53a5=0x1;_0x1f53a5<_0x5568a7['length'];_0x1f53a5++){const _0x2a3296=_0x2ab3d7[_0x2ab3d7['length']-0x1],_0x2f576b=_0x2a3296[_0x2a3296['length']-0x1];_0x5568a7[_0x1f53a5]['node']['previousSibling']==_0x2f576b['node']&&'modified'!=_0x5568a7[_0x1f53a5]['type']&&'modified'!=_0x2f576b['type']?_0x2a3296['push'](_0x5568a7[_0x1f53a5]):_0x2ab3d7['push']([_0x5568a7[_0x1f53a5]]);}for(const _0x3b627a of _0x2ab3d7){const _0x1d659a=_0x3b627a[0x0],_0x2440f6=_0x3b627a[_0x3b627a['length']-0x1],_0x1032ec=_0x4a54ab(_0x1d659a['node']['previousSibling']);_0x1032ec&&_0x3b627a['unshift'](_0x1032ec);const _0x37286b=_0x4a54ab(_0x2440f6['node']['nextSibling']);_0x37286b&&_0x3b627a['push'](_0x37286b);}function _0x31d488(_0xa0b874){return _0x48ccd2['modifiedNodeIds']['includes'](_0xa0b874)||_0x48ccd2['newNodeIds']['includes'](_0xa0b874)||_0x48ccd2['removedNodeIds']['includes'](_0xa0b874);}function _0x4a54ab(_0x3c8d80){if(_0x3c8d80&&Z(_0x3c8d80,'data-id')&&!Z(_0x3c8d80,'data-unstable')){const _0x1488f1=Z(_0x3c8d80,'data-id');if(!_0x31d488(_0x1488f1))return{'node':_0x3c8d80,'type':'context','id':_0x1488f1};}return null;}this['changeGroups']=_0x2ab3d7['map']((_0x27ee2a,_0x2d2192)=>({'changes':_0x27ee2a,'state':'pending','index':_0x2d2192}));}}function Fe(_0x13e010){return Object['values'](Wr)['includes'](_0x13e010);}function Ee(_0x107196){return Yr['includes'](_0x107196);}function Ae(_0x316fdb){return'conversation-title'===_0x316fdb;}function Me(_0x3fcbc2){return'source'===_0x3fcbc2;}const Ft=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class qt extends _0xd790fa(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x5743b8,editor:_0x2cd5f6}){super(),this['id']=_0x4fd5c3(),this['connector']=_0x5743b8,this['isStopped']=!0x0,this['editor']=_0x2cd5f6;}async['start'](){let _0x3d6784;const _0x3e4188=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x2fbd43=await this['currentRequest']['getStream']();for await(const _0x377e09 of _0x2fbd43){if(this['isStopped'])return;if('error'===_0x377e09['event'])return void this['fire']('error',{'error':new _0x2e27f1('ai-chat-interaction-error',this)});if('message-metadata'!==_0x377e09['event']){if('action-metadata'!==_0x377e09['event']){if(Ae(_0x377e09['event'])&&this['setConversationTitle'](_0x377e09['data']['conversationTitle'],!0x0),Me(_0x377e09['event']))_0x3e4188['push'](_0x377e09['data']['source']);else{if(Fe(_0x377e09['event'])){if(_0x377e09['event']!==_0x3d6784){if(_0x3d6784=_0x377e09['event'],'web-search'===_0x377e09['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x377e09['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x377e09['event'],'interactionId':this['id'],'id':_0x377e09['data']?.['id']}),_0x3e4188['length']>0x0&&'modification-delta'===_0x377e09['event']&&(this['currentReply']['sources']=_0x3e4188['splice'](0x0));}_0x377e09['data']['textDelta']&&this['currentReply']['appendContent'](_0x377e09['data']['textDelta']);}else Ee(_0x377e09['event'])||Yt('ai-interaction-invalid-event-type',{'chunk':_0x377e09});}}else this['actionCallId']=_0x377e09['data']['callId'];}else this['messageId']=_0x377e09['data']['messageId'];}}finally{this['isStopped']||(_0x3e4188['length']>0x0&&(this['currentReply']['sources']=_0x3e4188['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x279e19){return this['replies']['find'](_0x261e70=>_0x261e70['id']===_0x279e19);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x21789f=>_0x21789f['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0xdc8b6b){const _0x552861=new pe({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0xdc8b6b});return this['replies']['push'](_0x552861),_0x552861['delegate'](...Ft)['to'](this),this['fire']('replyCreated',_0x552861),_0x552861;}['setConversationTitle'](_0x2583ff,_0x4c6a24=!0x1){this['fire']('setConversationTitle',_0x2583ff,_0x4c6a24);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var zt=function(_0x273022){return _0x273022['FILE']='file',_0x273022['DOCUMENT']='document',_0x273022['URL']='web-resource',_0x273022['TEXT']='text',_0x273022['SELECTION']='selection',_0x273022;}({}),Xt=function(_0x4ffc9e){return _0x4ffc9e['TEXT']='text',_0x4ffc9e['MARKDOWN']='markdown',_0x4ffc9e['HTML']='html',_0x4ffc9e;}({});const xi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Zt extends $t(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x2c475b,config:_0x48f439,ownerId:_0x1cf54e}){super(),this['_connector']=_0x2c475b,this['_config']=_0x48f439,this['_ownerId']=_0x1cf54e;}['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'](_0x1be1c6){const _0x2e2c30=await this['_createContextItemFromContent'](_0x1be1c6);return this['_addToConversationContextItem'](_0x2e2c30),'current-document'===_0x2e2c30['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x2e2c30;}async['_createContextItemFromContent'](_0x3fb9b0){if(_0x3fb9b0['type']===zt['DOCUMENT']){const _0x48ef1f=await this['_connector']['fetchDocument'](this['_ownerId'],_0x3fb9b0['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x3fb9b0['type'],'content':_0x48ef1f['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x48ef1f['attributes']?.['version'],'sessionId':_0x48ef1f['attributes']?.['sessionId']};}return{'id':_0x3fb9b0['id'],'uiId':_0x3fb9b0['id'],'label':_0x3fb9b0['attributes']?.['label']||_0x3fb9b0['name']||_0x3fb9b0['url']||_0x3fb9b0['id'],'type':_0x3fb9b0['type'],..._0x3fb9b0?.['attributes']?.['resourceId']?{'resourceId':_0x3fb9b0['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0xa4d496){const _0x127f9f=this['_pendingContextItems']['get'](_0xa4d496);_0x127f9f?.['isReadOnly']||this['_removeContextItem'](_0xa4d496);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x4acf7c of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x4acf7c['uiId']);const _0x2ec01f=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x2ec01f&&this['_addContextItem']({..._0x2ec01f,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0xe8da2f){for(const _0x3fad17 of _0xe8da2f['values']())this['_addToConversationContextItem'](_0x3fad17);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'](_0x48f567){return Array['from'](_0x48f567['values']())['map'](_0x2216c5=>this['_mapContextItemToRequestData'](_0x2216c5))['filter'](_0x48fefd=>null!==_0x48fefd);}async['addFilesToContext'](_0x28a989,_0x13d4a0,_0x4848d7=zt['FILE']){const _0x372a39='files-'+_0x4fd5c3();this['_startUploadOperation'](_0x372a39);try{await Promise['all'](_0x28a989['map'](async _0x2553fc=>{const _0x1a4290='file-'+_0x4fd5c3(),_0x39f49b=Jt(_0x2553fc['name']);try{this['_addContextItem']({'type':_0x4848d7,'label':_0x13d4a0?.['label']||_0x39f49b,'uiId':_0x1a4290,'resourceId':_0x13d4a0?.['resourceId']},!0x0);const _0x31fd11=this['_connector']['uploadFile'](this['_ownerId'],_0x2553fc,_0x13d4a0);this['_ongoingUploads']['set'](_0x1a4290,_0x31fd11['abortController']);const {id:_0x52cfa9}=await _0x31fd11['getId']();this['_ongoingUploads']['delete'](_0x1a4290),this['_finishContextItemLoading']({'type':_0x4848d7,'id':_0x52cfa9,'label':_0x13d4a0?.['label']||_0x39f49b,'uiId':_0x1a4290,'resourceId':_0x13d4a0?.['resourceId']},!0x1);}catch(_0x41e8c6){this['_ongoingUploads']['delete'](_0x1a4290);if(!_0x41e8c6['message']['startsWith']('ai-request-aborted')){const _0x436e98=new _0x2e27f1('ai-chat-file-upload-failed',null,{'fileName':_0x39f49b});_0x436e98['stack']=_0x41e8c6['stack'],this['fire']('error',{'error':_0x436e98,'fileName':_0x39f49b});}this['_removeContextItem'](_0x1a4290);}}));}finally{this['_finishUploadOperation'](_0x372a39);}}['addCurrentDocumentToContext'](_0x5d6a28){if(this['isCurrentDocumentInContext']())return;const _0x53451b={'type':zt['DOCUMENT'],'uiId':'current-document','label':_0x5d6a28,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x53451b);}async['updateCurrentDocument'](_0x2baed0,_0x5122dc,_0x1dfdd1,_0x5b952f){const _0x2e7c16=this['_pendingContextItems']['get']('current-document');if(_0x2e7c16&&_0x2baed0){_0x2e7c16['selection']=_0x5b952f?_0x5b952f['map'](_0xe96324=>({'start':_0xe96324['start'],'end':_0xe96324['end']})):[];try{if(_0x2e7c16['version']===_0x5122dc)return;const {id:_0x26dcc7}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x2baed0,{'version':_0x5122dc,'sessionId':_0x1dfdd1})['getId']();_0x2e7c16['id']=_0x26dcc7,_0x2e7c16['content']=_0x2baed0,_0x2e7c16['version']=_0x5122dc,_0x2e7c16['sessionId']=_0x1dfdd1;}catch(_0x4deca7){const _0x2ed540=new _0x2e27f1('ai-chat-document-upload-failed',null);_0x2ed540['stack']=_0x4deca7['stack'],this['fire']('error',{'error':_0x2ed540});}}}['addSelectionToContext'](_0x54be1e){this['_addContextItem']({'type':zt['SELECTION'],'label':_0x54be1e,'uiId':'selection','content':_0x54be1e});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x22cfdd,_0xb7f00f){const _0x145a14='url-'+_0x4fd5c3();this['_startUploadOperation'](_0x145a14);const _0x15b99b='url-'+_0x4fd5c3();try{this['_addContextItem']({'type':zt['URL'],'label':_0xb7f00f?.['label']||_0x22cfdd,'uiId':_0x15b99b,'resourceId':_0xb7f00f?.['resourceId']},!0x0);const _0x28f69d=this['_connector']['uploadUrl'](this['_ownerId'],_0x22cfdd,_0xb7f00f);this['_ongoingUploads']['set'](_0x15b99b,_0x28f69d['abortController']);const {id:_0x20fcb3}=await _0x28f69d['getId']();this['_ongoingUploads']['delete'](_0x15b99b),this['_finishContextItemLoading']({'type':zt['URL'],'id':_0x20fcb3,'label':_0xb7f00f?.['label']||_0x22cfdd,'uiId':_0x15b99b,'resourceId':_0xb7f00f?.['resourceId']},!0x1);}catch(_0x3c2f13){this['_ongoingUploads']['delete'](_0x15b99b),(_0x3c2f13['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x2e27f1('ai-chat-url-upload-failed',this,{'url':_0x22cfdd,'originalError':_0x3c2f13}),'url':_0x22cfdd}),this['_removeContextItem'](_0x15b99b));}finally{this['_finishUploadOperation'](_0x145a14);}}async['loadSourceResources'](_0xc6650b,_0x1be18c,_0x4e5af8){const _0x4a10de=this['_addContextOptionsState']['sources']['find'](_0x2d06df=>_0x2d06df['id']===_0xc6650b);if(!_0x4a10de)return this['fire']('error',{'error':new _0x2e27f1('ai-chat-source-not-found',this,{'sourceId':_0xc6650b}),'sourceId':_0xc6650b}),[];try{const _0xa91de0=(await _0x4a10de['getResources'](_0x1be18c))['map'](_0x545968=>{const _0x2aef19=this['_isResourceInContext'](_0x545968['id']);return{..._0x545968,'isInContext':_0x2aef19};});return _0x4a10de['resources']=_0xa91de0,this['fire']('sourceResourcesLoaded',{'sourceId':_0xc6650b,'source':_0x4a10de,'resources':_0xa91de0,'uid':_0x4e5af8}),_0xa91de0;}catch(_0x41cf33){return this['fire']('error',{'error':new _0x2e27f1('ai-chat-source-resources-load-failed',this,{'sourceId':_0xc6650b,'originalError':_0x41cf33}),'sourceId':_0xc6650b,'sourceLabel':_0x4a10de['label']}),[];}}async['addResourceToContext'](_0x4025d2,_0x27dba0){if(this['_isResourceInContext'](_0x27dba0['id']))return;let _0x2eacde=_0x27dba0['data'];if(!_0x2eacde&&_0x4025d2['getData'])try{_0x2eacde=await _0x4025d2['getData'](_0x27dba0['id']);}catch(_0x45fdd7){return void this['fire']('error',{'error':new _0x2e27f1('ai-chat-resource-load-failed',this,{'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id'],'originalError':_0x45fdd7}),'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id']});}if(_0x2eacde)switch(_0x27dba0['type']){case zt['URL']:if('string'!=typeof _0x2eacde)return void this['fire']('error',{'error':new _0x2e27f1('ai-chat-context-invalid-data',this,{'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id'],'expectedType':'string','actualType':typeof _0x2eacde}),'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id']});await this['addUrlToContext'](_0x2eacde,{'label':_0x27dba0['label'],'resourceId':_0x27dba0['id']});break;case zt['FILE']:if(!(_0x2eacde instanceof File))return void this['fire']('error',{'error':new _0x2e27f1('ai-chat-context-invalid-data',this,{'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id'],'expectedType':'File','actualType':typeof _0x2eacde}),'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id']});await this['addFilesToContext']([_0x2eacde],{'label':_0x27dba0['label'],'resourceId':_0x27dba0['id']});break;case zt['TEXT']:if('object'!=typeof _0x2eacde||!('content'in _0x2eacde)||!('type'in _0x2eacde))return void this['fire']('error',{'error':new _0x2e27f1('ai-chat-context-invalid-data',this,{'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x2eacde}),'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id']});_0x2eacde=Zt['_convertTextResourceToFile'](_0x2eacde,_0x27dba0['label']),await this['addFilesToContext']([_0x2eacde],{'label':_0x27dba0['label'],'resourceId':_0x27dba0['id']},zt['TEXT']);break;default:this['fire']('error',{'error':new _0x2e27f1('ai-chat-context-unsupported-type',this,{'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id'],'resourceType':_0x27dba0['type']}),'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id']});}else this['fire']('error',{'error':new _0x2e27f1('ai-chat-resource-no-data',this,{'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id']}),'resourceId':_0x27dba0['id'],'sourceId':_0x4025d2['id']});}static['_convertTextResourceToFile'](_0xa7301b,_0x37e7f3){switch(_0xa7301b['type']){case Xt['MARKDOWN']:return new File([_0xa7301b['content']],_0x37e7f3,{'type':'text/markdown'});case Xt['HTML']:return new File([_0xa7301b['content']],_0x37e7f3,{'type':'text/html'});default:return new File([_0xa7301b['content']],_0x37e7f3,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x557e62){switch(_0x557e62['type']){case zt['FILE']:return{'type':zt['FILE'],'id':_0x557e62['id']};case zt['URL']:return{'type':zt['URL'],'id':_0x557e62['id']};case zt['DOCUMENT']:return{'type':zt['DOCUMENT'],'id':_0x557e62['id'],..._0x557e62['selection']?.['length']&&{'selection':_0x557e62['selection']}};case zt['TEXT']:return{'type':zt['FILE'],'id':_0x557e62['id']};default:return null;}}['_addContextItem'](_0x3c2e61,_0x3faa0a=!0x1){if(this['_pendingContextItems']['set'](_0x3c2e61['uiId'],_0x3c2e61),_0x3c2e61['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x3c2e61,'isLoading':_0x3faa0a}),'current-document'===_0x3c2e61['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3c2e61['resourceId']){const _0x1f187e=this['_findSourceIdsByResourceId'](_0x3c2e61['resourceId']);_0x1f187e&&_0x1f187e['forEach'](_0x58556b=>{this['_updateResourceInContextState'](_0x58556b,_0x3c2e61['resourceId'],!0x0);});}}['_removeContextItem'](_0x2968b2){const _0x32e4f2=this['_pendingContextItems']['get'](_0x2968b2),_0x21da6e=this['_ongoingUploads']['get'](_0x2968b2);if(_0x21da6e&&(_0x21da6e['abort'](),this['_ongoingUploads']['delete'](_0x2968b2)),_0x32e4f2?.['resourceId']){const _0x586440=this['_findSourceIdsByResourceId'](_0x32e4f2['resourceId']);_0x586440&&_0x586440['forEach'](_0x13db85=>{this['_updateResourceInContextState'](_0x13db85,_0x32e4f2['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2968b2),this['fire']('contextItemRemoved',{'uiId':_0x2968b2,'type':_0x32e4f2?.['type']}),'current-document'===_0x2968b2&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x5dd895,_0x12d6f8){if(this['_pendingContextItems']['has'](_0x5dd895['uiId'])&&(this['_pendingContextItems']['set'](_0x5dd895['uiId'],_0x5dd895),this['fire']('contextItemLoadingEnded',{'contextItem':_0x5dd895,'isLoading':_0x12d6f8}),_0x5dd895['resourceId'])){const _0x193aa8=this['_findSourceIdsByResourceId'](_0x5dd895['resourceId']);_0x193aa8&&_0x193aa8['forEach'](_0x5e15e=>{this['_updateResourceInContextState'](_0x5e15e,_0x5dd895['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x411dc1){this['_conversationContextItems']['set'](_0x411dc1['uiId'],_0x411dc1);}['_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']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x4d0c4a=>({..._0x4d0c4a,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x3b5300=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x3b5300,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1842e2){for(const _0x2cb7ad of this['_pendingContextItems']['values']())if(_0x2cb7ad['resourceId']===_0x1842e2)return!0x0;for(const _0x546ede of this['_conversationContextItems']['values']())if(_0x546ede['resourceId']===_0x1842e2)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x575967){const _0xc13a5=[];for(const _0x4eaa60 of this['_addContextOptionsState']['sources']){_0x4eaa60['resources']['find'](_0xbca453=>_0xbca453['id']===_0x575967)&&_0xc13a5['push'](_0x4eaa60['id']);}return 0x0===_0xc13a5['length']?null:_0xc13a5;}['_updateResourceInContextState'](_0x5f31b9,_0x3ee22c,_0x3ba904){const _0xabcbdd=this['_addContextOptionsState']['sources']['find'](_0x44c147=>_0x44c147['id']===_0x5f31b9);if(!_0xabcbdd)return;const _0x1f514d=_0xabcbdd['resources']['find'](_0x4a45dd=>_0x4a45dd['id']===_0x3ee22c);_0x1f514d&&(_0x1f514d['isInContext']=_0x3ba904,this['fire']('resourceStateChanged',{'sourceId':_0x5f31b9,'resourceId':_0x3ee22c,'isInContext':_0x3ba904}));}['_startUploadOperation'](_0x5b25f4){this['_ongoingUploadOperations']['set'](_0x5b25f4,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x1dfcd9){this['_ongoingUploadOperations']['delete'](_0x1dfcd9),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Si=['capabilitiesUpdated'];class Di extends _0xd790fa(){['_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'](_0x36251e){const _0x219c16={};return _0x36251e&&_0x36251e['isWebSearchEnabled']&&(_0x219c16['webSearch']={}),_0x36251e&&_0x36251e['isReasoningEnabled']&&(_0x219c16['reasoning']={}),_0x219c16;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x3c7ac9){_0x3c7ac9!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x3c7ac9,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x29d4fb){_0x29d4fb!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x29d4fb,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class qi extends qt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x24b0ae){super(_0x24b0ae),this['conversationId']=_0x24b0ae['conversationId'],this['contextItems']=_0x24b0ae['contextItems'],this['capabilities']=_0x24b0ae['capabilities'],this['userMessage']=_0x24b0ae['userMessage'],this['model']=_0x24b0ae['model'],this['quickActionData']=_0x24b0ae['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Zt['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Di['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class W extends _0xd790fa(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x1c8ae1){super(),this['options']=_0x1c8ae1,this['connector']=_0x1c8ae1['connector'],this['chatModels']=_0x1c8ae1['chatModels'],this['id']=_0x1c8ae1['conversationId'];}async['init'](_0x2a1ab5){try{this['chatContext']=new Zt({'connector':this['connector'],'config':_0x2a1ab5,'ownerId':this['id']}),this['chatContext']['delegate'](...xi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Di(),this['chatCapabilities']['delegate'](...Si)['to'](this),this['chatCapabilities']['init']();const _0x55e232=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x55e232});const _0x135e59=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x135e59&&await this['setModel'](_0x135e59);}catch(_0x3a4c74){const _0x26deed=new _0x2e27f1('ai-chat-conversation-init-failed',null,{'message':_0x3a4c74['message']});_0x26deed['stack']=_0x3a4c74['stack'],this['fire']('error',{'error':_0x26deed});}}async['start'](){if(this['isStarted'])throw new _0x2e27f1('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x2e27f1('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x3a185a}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x3a185a,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x1f8b50){const _0x39ddf6=new _0x2e27f1('ai-chat-conversation-start-failed',null,{'message':_0x1f8b50['message']});_0x39ddf6['stack']=_0x1f8b50['stack'],this['fire']('error',{'error':_0x39ddf6});}}async['load'](_0x141a96,_0xfc162d){try{const _0x1c880f=await this['connector']['fetchConversation'](_0x141a96)['getConversation'](),_0x491e85=await this['connector']['fetchConversationMessages'](_0x141a96)['getMessages'](),_0x27f781=_0x491e85[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x1c880f['id'],'title'in _0x1c880f?this['fire']('setConversationTitle',_0x1c880f['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x5cf554=(await this['chatModels']['getAll']())['find'](_0x5b0c55=>_0x5b0c55['id']['toLowerCase']()===_0x27f781['toLowerCase']());return this['selectedModel']=_0x5cf554,this['fire']('modelSelected',{'selectedModel':_0x5cf554,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x491e85,_0xfc162d,_0x27f781),this['currentInteraction']=void 0x0,this;}catch(_0x1b71ae){const _0x4de2c3=new _0x2e27f1('ai-chat-conversation-init-from-id-failed',null,{'message':_0x1b71ae['message'],'conversationId':_0x141a96});throw _0x4de2c3['stack']=_0x1b71ae['stack'],this['fire']('error',{'error':_0x4de2c3}),_0x4de2c3;}}async['_processMessagesToInteractions'](_0x339b67,_0x4533a6,_0x24f46e){let _0xd6d688;for(const _0x11d5f1 of _0x339b67)if('user'===_0x11d5f1['role']){const _0x2242be=await this['_extractContextItems'](_0x11d5f1),_0x5480e4={'isReasoningEnabled':Object['hasOwn'](_0x11d5f1['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x11d5f1['capabilities'],'webSearch')};_0xd6d688=this['createInteraction']({'userMessage':_0x11d5f1['prompt'],'contextItems':_0x2242be,'capabilities':_0x5480e4,'modelId':_0x24f46e,'quickActionData':_0x11d5f1['attributes']?.['quickActionData']}),this['currentInteraction']=_0xd6d688,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x11d5f1['role']&&_0xd6d688)for(const _0x5cbbaf of _0x11d5f1['content']){const _0x23b04b='text'===_0x5cbbaf['type']?'text-delta':'modification-delta',_0x2dadb6=_0xd6d688['getDocumentContext']()?.['sessionId']!==_0x4533a6;_0xd6d688['currentReply']=_0xd6d688['createReply']({'type':_0x23b04b,'isDone':!0x0,'interactionId':_0xd6d688['id'],'areActionsDisabled':_0x2dadb6}),_0xd6d688['currentReply']['appendContent'](_0x5cbbaf['content']);}}}async['_extractContextItems'](_0xc49607){const _0x3592ca=new Map();if(!_0xc49607['content'])return _0x3592ca;for(const _0x242487 of _0xc49607['content']){const _0x3ec3d6=await this['chatContext']['populateFromMessage'](_0x242487);_0x3ec3d6&&_0x3592ca['set'](_0x3ec3d6['id'],_0x3ec3d6);}return _0x3592ca;}async['handleUserInteraction']({userMessage:_0x4dbc07,quickActionData:_0x4a49fb}){if(!this['isStarted'])throw new _0x2e27f1('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x2e27f1('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x452285=this['chatContext']['getPendingContextItems'](),_0x4e9503=this['chatCapabilities']['getCapabilitiesConfig'](),_0xa6a397=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x4dbc07,'contextItems':_0x452285,'capabilities':_0x4e9503,'modelId':_0xa6a397,'quickActionData':_0x4a49fb}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x8699e3){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x8699e3});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x18e77e,contextItems:_0x2b7aaa,capabilities:_0x5ce1c5,modelId:_0x414add,quickActionData:_0x475a4f}){const _0x3b9b7c=new qi({'userMessage':_0x18e77e,'contextItems':_0x2b7aaa,'capabilities':_0x5ce1c5,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x414add,'quickActionData':_0x475a4f});return _0x3b9b7c['delegate'](...Ft)['to'](this),this['interactions']['push'](_0x3b9b7c),this['fire']('interactionCreated',_0x3b9b7c),_0x3b9b7c;}['getInteraction'](_0x47da11){return this['interactions']['find'](_0x524e3a=>_0x524e3a['id']===_0x47da11);}['removeInteraction'](_0x5552ed){const _0x4a7859=this['getInteraction'](_0x5552ed);_0x4a7859&&(_0x4a7859['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4a7859),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x2367a9){this['chatContext']['addCurrentDocumentToContext'](_0x2367a9);}async['updateCurrentDocumentInContext']({content:_0x199150,version:_0x3e7d12,sessionId:_0x56d1f2,selections:_0x2a015b}){await this['chatContext']['updateCurrentDocument'](_0x199150,_0x3e7d12,_0x56d1f2,_0x2a015b);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x41c624){this['chatContext']['addSelectionToContext'](_0x41c624);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0xa1d3b3){this['chatContext']['addFilesToContext'](_0xa1d3b3);}['addUrlToContext'](_0x1215f8){this['chatContext']['addUrlToContext'](_0x1215f8);}['addResourceToContext'](_0x1165bf,_0x99a5e6){this['chatContext']['addResourceToContext'](_0x1165bf,_0x99a5e6);}['loadSourceResources'](_0x3a6832,_0x41d60f,_0x3ef4a5){return this['chatContext']['loadSourceResources'](_0x3a6832,_0x41d60f,_0x3ef4a5);}['removeFromContext'](_0x36cacd){this['chatContext']['removeFromContext'](_0x36cacd);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x1e5c76){_0x1e5c76?!0x1===await this['chatModels']['isAvailable'](_0x1e5c76)&&(Yt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x1e5c76}),_0x1e5c76=(await this['chatModels']['getAvailableModels']())[0x0]):(Yt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x1e5c76=(await this['chatModels']['getAvailableModels']())[0x0]),_0x1e5c76['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x1e5c76,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x1e5c76}));}}function u(_0x100ee4){if(_0x100ee4 instanceof _0x5a47f7)return _0x100ee4;if(_0x100ee4?.['editors']&&_0x100ee4['editors']['get'](0x0))return _0x100ee4['editors']['length']>0x1&&console['warn']('AIChat:\x20Multiple\x20editor\x20instances\x20detected.\x20Only\x20the\x20first\x20editor\x20instance\x20will\x20be\x20used\x20for\x20AI\x20operations.\x20This\x20configuration\x20is\x20not\x20fully\x20supported\x20and\x20may\x20lead\x20to\x20unexpected\x20behavior.'),_0x100ee4['editors']['get'](0x0);throw new _0x2e27f1('ai-get-editor-from-context-no-editor');}const G='ai-selection';class s extends _0x5cd1ee{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x17432c=u(this['context']),_0x42c342=_0x17432c['plugins']['has']('RealTimeCollaborationClient')&&_0x17432c['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x42c342||_0x4fd5c3();}return this['_sessionId'];}['getDocumentData'](){const _0x50dccf=u(this['context']),_0x51ac5e=_0x50dccf['model'],_0x250160=_0x50dccf['data']['toView'](_0x51ac5e['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x1822c0=new gt(_0x50dccf['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x250160,_0x1822c0);let _0x17f77f=_0x50dccf['data']['processor']['toData'](_0x250160);const _0x1f4b16=this['_getMarkersInDocumentOrder'](),_0x2f6941=[];for(const _0x193844 of _0x1f4b16){const _0x52594e='<'+_0x193844['name']+':start></'+_0x193844['name']+':start>',_0x418f29=_0x17f77f['indexOf'](_0x52594e);_0x17f77f=_0x17f77f['substring'](0x0,_0x418f29)+_0x17f77f['substring'](_0x418f29+_0x52594e['length']);const _0x274bbe='<'+_0x193844['name']+':end></'+_0x193844['name']+':end>',_0x18efc0=_0x17f77f['indexOf'](_0x274bbe);_0x17f77f=_0x17f77f['substring'](0x0,_0x18efc0)+_0x17f77f['substring'](_0x18efc0+_0x274bbe['length']),_0x2f6941['push']({'markerName':_0x193844['name'],'start':_0x418f29,'end':_0x18efc0,'htmlFragment':_0x17f77f['substring'](_0x418f29,_0x18efc0)});}return{'content':_0x17f77f,'version':_0x50dccf['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x2f6941};}async['afterInit'](){this['context']instanceof _0x5a47f7?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x5c69ae,_0x24cc61)=>{_0x24cc61['on']('ready',()=>{this['_integrateEditor'](_0x24cc61);});});}['_integrateEditor'](_0x4d5764){_0x4d5764['conversion']['for']('editingDowncast')['markerToHighlight']({'model':G,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x4d5764['conversion']['for']('dataDowncast')['markerToElement']({'model':G,'view':(_0x2246f6,{writer:_0x59cc32,options:_0x5b5fa1})=>_0x5b5fa1['convertAiChatSelectionMarker']?_0x59cc32['createUIElement'](_0x2246f6['markerName']+':'+(_0x2246f6['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x4ffbc,_0x9c8c14,_0x522e63=!0x1,_0x340ef7=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x340ef7)return!0x1;const _0x3694d3=u(this['context'])['model'];return _0x3694d3['change'](_0x38ffa3=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x9c8c14,this['_displayedFakeSelectionLocked']=_0x522e63;let _0x1f2dfc=0x0;for(let _0x39ac2e of _0x4ffbc){const _0x2cb361=G+':'+_0x1f2dfc;if(_0x39ac2e['start']['isAtEnd']){const _0x2f570a=_0x39ac2e['start']['getLastMatchingPosition'](({item:_0x2ce8b3})=>!_0x3694d3['schema']['isContent'](_0x2ce8b3),{'boundaries':_0x39ac2e});_0x39ac2e=_0x38ffa3['createRange'](_0x2f570a,_0x39ac2e['end']);}_0x38ffa3['addMarker'](_0x2cb361,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x39ac2e}),_0x1f2dfc++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x136eb4){if(this['_displayedFakeSelectionId']!=_0x136eb4)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x4c12a8=u(this['context']),_0x38dd60=_0x4c12a8['model']['markers']['getMarkersGroup'](G);return _0x4c12a8['model']['change'](_0x202e60=>{for(const _0xc85640 of _0x38dd60)_0x202e60['removeMarker'](_0xc85640);}),!0x0;}['modelToViewWithIds'](_0x184894){const _0x1dde4a=u(this['context']),_0x5d28bc=_0x1dde4a['data']['toView'](_0x184894),_0x675bca=new gt(_0x1dde4a['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x5d28bc,_0x675bca),_0x5d28bc;}['_setDataIdsOnChildren'](_0x267129,_0x3ac59c){let _0x554556=!0x1;const _0x28ad38=new Set();for(const _0x34a2d5 of _0x267129['getChildren']()){const _0x52f8a8=_0x34a2d5['is']('emptyElement')||_0x34a2d5['is']('containerElement');if(!_0x34a2d5['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x34a2d5,_0x3ac59c)||_0x52f8a8)&&(_0x3ac59c['setAttribute']('data-id',this['_nextDataId'](_0x28ad38),_0x34a2d5),_0x554556=!0x0);}return _0x554556;}['_nextDataId'](_0x58843b){let _0xaf48b9;do{_0xaf48b9='';for(let _0x4852ef=0x0;_0x4852ef<0x4;_0x4852ef++)_0xaf48b9+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x58843b['has'](_0xaf48b9));return _0x58843b['add'](_0xaf48b9),_0xaf48b9;}['getSelectionText'](){const {model:_0x56526b}=u(this['context']),_0x433cc0=_0x56526b['document']['selection'],_0x130a4f=_0x56526b['getSelectedContent'](_0x433cc0),_0x330f7c=[],_0x59ce71=_0x56526b['createRangeIn'](_0x130a4f)['getWalker']();for(const {item:_0x238028}of _0x59ce71)_0x238028['is']('$textProxy')?_0x330f7c['push'](_0x238028['data']):_0x238028['is']('element')&&_0x330f7c['length']>0x0&&'\x20'!==_0x330f7c[_0x330f7c['length']-0x1]&&_0x330f7c['push']('\x20');return'\x22'+_0x330f7c['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x1675f7=u(this['context'])['model'];return Array['from'](_0x1675f7['markers']['getMarkersGroup'](G))['sort']((_0x446375,_0x6390a)=>_0x446375['getStart']()['isBefore'](_0x6390a['getStart']())?-0x1:_0x446375['getStart']()['isAfter'](_0x6390a['getStart']())?0x1:0x0);}}const m=['applySuggestion','insertSuggestion','showChangeInText'];class nh extends _0x40a2ba{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x48fae5,_0x14207d){super(_0x48fae5),this['_dropdownOriginalConfig']=_0x14207d||[...m],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x2af7e6=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x3c45c3({'label':Hn('applySuggestion',_0x48fae5,this['_partsCount']),'icon':_0x54d1a3,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x3c45c3({'label':Hn('showChangeInText',_0x48fae5,this['_partsCount']),'icon':_0x27829e,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x3c45c3({'label':Hn('insertSuggestion',_0x48fae5,this['_partsCount']),'icon':_0x1689df,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x48fae5),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x2af7e6['if']('isVisible','ck-hidden',_0x26e890=>!_0x26e890)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x2ac72e=>'applySuggestion'!==_0x2ac72e):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x48fae5);});}['_updateDropdownActions'](_0x89df47){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x89df47),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x385ec1){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x1615dd=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x385ec1):this['_createActionsDropdown'](_0x385ec1),_0x2a495e=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x1615dd['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x385ec1,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x385ec1,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x2a495e});for(const _0x3d66dc of this['_dropdownCurrentConfig'])_0x1615dd['on'](_0x3d66dc,()=>{this['fire'](_0x3d66dc);});return this['_firstRender']=!0x1,_0x1615dd;}['_createActionsButton'](_0x29ade8){const _0xbccdcb=new _0x2cae14(_0x29ade8);return _0xbccdcb['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0xbccdcb['on']('execute',()=>{_0xbccdcb['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0xbccdcb;}['_createActionsDropdown'](_0x5cc3cb){const _0x204b9f=new Gn(_0x5cc3cb,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x3a2c8a=>{switch(_0x3a2c8a){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x204b9f['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x5cc3cb,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x5cc3cb,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x204b9f['bind']('isEnabled')['to'](this),_0x204b9f;}['updateLabels'](_0x2b6002){const _0x40109a=this['locale'];this['_partsCount']=_0x2b6002||this['_partsCount'],this['actionsButton']['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x40109a,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x40109a,this['_partsCount'])}),this['applySuggestionModel']['label']=Hn('applySuggestion',_0x40109a,this['_partsCount']),this['showChangeInTextModel']['label']=Hn('showChangeInText',_0x40109a,this['_partsCount']),this['insertSuggestionModel']['label']=Hn('insertSuggestion',_0x40109a,this['_partsCount']);}}class Gn extends _0x598472{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x467519,_0x20ca92){super(_0x467519),this['balloonPanelView']=new _0x1c3e7b(this['locale']),this['bodyCollection']=new Kt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x20ca92['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',f(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x4eb508=_0x20ca92['listItemModels'][0x0]['actionName'];this['fire'](_0x4eb508),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?yn:Pn]}),this['listView']['focus']());}),ts({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x52aafe){const _0x2e1817=this['locale'],_0x191031=new _0x4c2bff(_0x2e1817);for(const _0x3571b9 of _0x52aafe){const _0x483534=new _0x4e528a(_0x2e1817),_0x5a603b=new _0x16380c(_0x2e1817);_0x5a603b['bind'](...Object['keys'](_0x3571b9))['to'](_0x3571b9),_0x5a603b['delegate']('execute')['to'](_0x191031),_0x483534['children']['add'](_0x5a603b),_0x191031['items']['add'](_0x483534);}return _0x191031['items']['delegate']('execute')['to'](this),_0x191031['on']('execute',_0x21a641=>{const _0x11cfa4=_0x21a641['source'];this['fire'](_0x11cfa4['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x191031;}['_setUpKeystrokes'](){this['keystrokeHandler']=new jt(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x4e727f,_0x22284a)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x22284a();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function yn(_0xcea6e5){return{'top':_0xcea6e5['bottom'],'left':_0xcea6e5['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x4d72c9,_0x4a13cb){return{'top':_0x4d72c9['bottom'],'left':_0x4d72c9['left']-(_0x4a13cb['width']-_0x4d72c9['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Hn(_0x113fd3,_0x129501,_0x27fd54){switch(_0x113fd3){case'applySuggestion':return f(_0x129501,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x27fd54);case'showChangeInText':return f(_0x129501,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x27fd54);case'insertSuggestion':return f(_0x129501,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x27fd54);}}function Ln(_0x2f81a7,_0x29a5e1,_0x4400a9){switch(_0x2f81a7){case'applySuggestion':return f(_0x29a5e1,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x4400a9);case'showChangeInText':return f(_0x29a5e1,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x4400a9);case'insertSuggestion':return f(_0x29a5e1,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x4400a9);}}class Mi extends _0xd790fa(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x10c793,availableModels:_0x370397,defaultModelId:_0x294078}){super(),this['_connector']=_0x10c793,this['_availableModels']=_0x370397,this['_defaultModelId']=_0x294078;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x452f39=this['_connector']['getModels'](),_0x4fdcec=await _0x452f39['list']();this['_modelList']=_0x4fdcec['items'];}catch(_0x41be67){throw new _0x2e27f1('ai-models-unable-to-retrieve',null,{'error':_0x41be67});}return[...this['_modelList']];}async['getAvailableModels'](){const _0x38fd59=await this['getAll']();return this['_filterModels'](_0x38fd59,this['_availableModels']);}async['getModel'](_0xfea842){const _0x4c401c=await this['getAll']();if(!_0x4c401c['length'])return null;if(_0xfea842){const _0x107232=this['_getModelById'](_0x4c401c,_0xfea842);if(_0x107232)return _0x107232;Yt('ai-chat-model-id-unrecognized',{'modelId':_0xfea842,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x2c7f28=await this['getAvailableModels']();if(!_0x2c7f28['length'])return null;if(this['_defaultModelId']){const _0x2cc8fc=this['_getModelById'](_0x2c7f28,this['_defaultModelId']);if(_0x2cc8fc)return _0x2cc8fc;Yt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x2c7f28[0x0]['id']});}return _0x2c7f28[0x0];}async['isAvailable'](_0x1553e7){return(await this['getAvailableModels']())['some'](_0x154f4b=>_0x154f4b['name']===_0x1553e7['name']&&_0x154f4b['provider']===_0x1553e7['provider']);}['_filterModels'](_0x54f3bd,_0x3d79b2){let _0x2155d;if(_0x3d79b2){_0x2155d=[];const _0x59bb3c='string'==typeof _0x3d79b2?[_0x3d79b2['toLocaleLowerCase']()]:_0x3d79b2['map'](_0x7e3aff=>_0x7e3aff['toLocaleLowerCase']());for(const _0x13376c of _0x59bb3c)for(const _0x2eeb75 of _0x54f3bd)(_0x2eeb75['id']['toLocaleLowerCase']()===_0x13376c||_0x2eeb75['name']['toLocaleLowerCase']()===_0x13376c||Oe(_0x2eeb75)&&'auto'===_0x13376c||_0x2eeb75['provider']['toLocaleLowerCase']()===_0x13376c||_0x2eeb75['id']['toLocaleLowerCase']()['startsWith'](_0x13376c))&&_0x2155d['push'](_0x2eeb75);}else _0x2155d=_0x54f3bd;return _0x2155d;}['_getModelById'](_0x2a6248,_0x40f55d){return _0x2a6248['find'](_0x160dc3=>Oe(_0x160dc3)&&'auto'===_0x40f55d?_0x160dc3:_0x160dc3['id']===_0x40f55d)||null;}static['getLocalized'](_0x18673f,_0x51ee48){return _0x51ee48['map'](_0x36f531=>{if(Oe(_0x36f531))_0x36f531['name']=f(_0x18673f,'AI_MODEL_NAME_AUTO'),_0x36f531['description']=f(_0x18673f,'AI_MODEL_DESCRIPTION_AUTO');else f(_0x18673f,'AI_MODEL_DESCRIPTION_'+_0x36f531['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x36f531['description']=f(_0x18673f,'AI_MODEL_DESCRIPTION_'+_0x36f531['id']['toUpperCase']()));return _0x36f531;});}}function Oe(_0x474bde){return _0x474bde['id']['startsWith']('agent');}class z extends Mi{async['getAll'](){return(await super['getAll']())['sort']((_0x481da3,_0x48df31)=>{const _0xad586c=Object['values'](_0x481da3['capabilities'])['filter'](_0x4d0ac1=>_0x4d0ac1['enabled'])['length'];return Object['values'](_0x48df31['capabilities'])['filter'](_0x40fa62=>_0x40fa62['enabled'])['length']-_0xad586c;});}}function O({editor:_0x598f23,interaction:_0x3fa7a2,reply:_0x23d367,groups:_0x5386b5,transform:_0x27f8ea,documentCompare:_0x2ce494,documentCompareOptions:_0x477946}){const _0x37e3af=_0x3fa7a2['getDocumentContext']();if(!_0x37e3af)return[];const _0x1e2e31=_0x37e3af['content'],_0x493ebd=_0x37e3af['version'],_0x2672fa=_0x23d367['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x5505ed}of _0x5386b5){const _0x33f82b=_0x5505ed['filter'](_0x49c4d6=>'new'!=_0x49c4d6['type'])['map'](_0x32796c=>st('data-id',_0x32796c['id'],_0x2672fa)),_0x118cbb=_0x5505ed['filter'](_0xe29ca8=>'removed'!=_0xe29ca8['type'])['map'](_0x2b3db2=>_0x2b3db2['node']['cloneNode'](!0x0));let _0x4a5283=null;if(_0x33f82b['length']){_0x4a5283=_0x33f82b[0x0]['previousSibling'];for(let _0x4464dc=0x0;_0x4464dc<_0x33f82b['length'];_0x4464dc++)_0x112be1(_0x33f82b[_0x4464dc]);}if(_0x118cbb['length']){_0x4a5283||(_0x5505ed[0x0]['anchorId']?_0x4a5283=st('data-id',_0x5505ed[0x0]['anchorId'],_0x2672fa):(_0x4a5283=_0x118cbb['shift'](),_0x5d90f3(_0x2672fa,_0x4a5283)));for(let _0x25961a=0x0;_0x25961a<_0x118cbb['length'];_0x25961a++)_0x1dde25(_0x4a5283,_0x118cbb[_0x25961a]),_0x4a5283=_0x118cbb[_0x25961a];}}const _0x36778a=tt(_0x2672fa),_0x5c8040=_0x2ce494['getDiff'](_0x1e2e31,_0x36778a,_0x477946)['getOperations']();if(_0x27f8ea){const _0x4cfd32=_0x598f23['model']['document']['history']['getOperations'](_0x493ebd),_0x7a25b8={'document':_0x598f23['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x461ccc(_0x5c8040,_0x4cfd32,_0x7a25b8)['operationsA'];}return _0x5c8040;}function D(_0x109599,_0x17f883){if('marker'!=_0x17f883['type'])return;const _0x19474f=_0x109599['model']['markers']['get'](_0x17f883['name']);_0x19474f&&(_0x17f883['oldRange']=_0x19474f['getRange']());}class Sr extends _0x2e57c2{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x19d4f3,_0x49ee80={},_0x4c4583){super(_0x19d4f3),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x49ee80};const _0x3d6ec6=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3d6ec6?'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'](_0x4c4583),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']);}['_setupRatingButtons'](){this['likeButton']=new _0x2cae14(this['locale']),this['likeButton']['set']({'icon':_0x3c4e01,'label':f(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x374c21=>!_0x374c21),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x2cae14(this['locale']),this['dislikeButton']['set']({'icon':_0x29365b,'label':f(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x41910b=>!_0x41910b),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x2cae14(this['locale']),this['copyButton']['set']({'icon':_0x4e4795,'label':f(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x59cbd4=>!_0x59cbd4);const _0x1a6c26=new _0x5a991c();_0x1a6c26['set']({'content':_0x5cc13d}),_0x1a6c26['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',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x1a6c26);}['_setupShowChangesButton'](_0x5aee01){this['showChangesButton']=new _0x2cae14(this['locale']),this['showChangesButton']['set']({'icon':_0x275968,'label':f(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x5aee01}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0xa4225c=>!_0xa4225c),this['showChangesButton']['on']('execute',()=>{const _0x42e6f8=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x42e6f8,'icon':_0x42e6f8?_0x44535c:_0x275968}),this['fire']('toggleShowChanges',_0x42e6f8);});}}class Lr extends _0x40a2ba{['showChangesToggleView'];constructor(_0x4a39bf,_0x16a306){super(_0x4a39bf),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new $r(_0x4a39bf),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':f(_0x4a39bf,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x16a306['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x24d8b6=>_0x24d8b6?_0x5b97b9:_0x487ad3),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x37a6c8=new _0x5a991c();_0x37a6c8['content']=_0x20b8a8,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x16a306['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x37a6c8,{'tag':'span','children':[f(_0x4a39bf,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class $r extends _0x2cae14{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x181fd6){this['options']={'delay':_0x181fd6['delay']??0x14,'textNodeStyle':_0x181fd6['textNodeStyle'],'onStreamUpdate':_0x181fd6['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x340d87,targetElement:_0x5f3127,abortSignal:_0x2b74c0}){this['isStreaming']&&this['stop'](),_0x2b74c0?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x2ca0b1(_0x340d87,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(Yt('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x25f016=0x0;_0x25f016<this['currentIndex'];_0x25f016++)this['nodesList'][_0x25f016]['shouldBeStreamed']=!0x0;let _0x49d6cb=0x0;for(let _0x407a5c=this['currentIndex'];_0x407a5c<this['nodesList']['length'];_0x407a5c++){const _0x53d049=Date['now'](),_0x34e48a=this['nodesList'][_0x407a5c],_0x4abd3a=_0x53d049-_0x49d6cb;_0x34e48a['shouldBeStreamed']=!0x0;let _0xd41711=_0x34e48a['parent'];for(;_0xd41711;)_0xd41711['shouldBeStreamed']=!0x0,_0xd41711=_0xd41711['parent'];if(_0x4abd3a<this['options']['delay'])try{const {promise:_0x44a691,abortController:_0x4ecec0}=pr(this['options']['delay']-_0x4abd3a);this['timeoutAbortController']=_0x4ecec0,await _0x44a691;}catch(_0x151958){return;}_0x55110b(_0x5f3127,'<'+_0x5f3127['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x5f3127['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x407a5c,_0x49d6cb=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x205540}){Array['from'](_0x205540['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x4e53bc=>{_0x4e53bc['replaceWith'](_0x4e53bc['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x1b6b14){let _0x140cea='';if(function(_0x26ae39){return _0x5c8f3c(_0x26ae39);}(_0x1b6b14)){for(const _0x82ee9 of _0x1b6b14['children'])_0x140cea+=this['renderNode'](_0x82ee9);}else{if(dr(_0x1b6b14)){if(!_0x1b6b14['shouldBeStreamed'])return'';const _0x544396=_0x1b6b14,_0x19c12d=Object['entries'](_0x544396['attribs'])['map'](([_0x467f49,_0x55aea1])=>_0x467f49+'=\x22'+_0x55aea1+'\x22')['join']('\x20');_0x140cea+='<'+_0x544396['tagName']+(_0x19c12d?'\x20'+_0x19c12d:'')+'>';for(const _0x566097 of _0x518743(_0x544396))_0x140cea+=this['renderNode'](_0x566097);_0x140cea+='</'+_0x544396['tagName']+'>';}else{if(!ar(_0x1b6b14))return'';if(!_0x1b6b14['shouldBeStreamed'])return'';!function(_0x4e1f44){if(!_0x4e1f44['parent']||!dr(_0x4e1f44['parent']))return!0x1;if(!cr['includes'](_0x4e1f44['parent']['tagName']))return!0x1;return!_0x7ea36f(_0x4e1f44)['match'](/^\s*[<>]\s*$/);}(_0x1b6b14)?_0x140cea+=_0x57c50a(_0x1b6b14):_0x140cea+=_0x57c50a(new _0x43f7b3('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x1b6b14]));}}return _0x140cea;}['getParsedDocumentNodeList'](){const _0x1b78ad=[];return function(_0x5b996b,_0x1428a1){const _0x14d119=_0x4eac9e=>{if(_0x1428a1(_0x4eac9e),_0x4eac9e instanceof _0x4b8570)for(let _0x5207ca=0x0;_0x5207ca<_0x4eac9e['children']['length'];_0x5207ca++){const _0x100beb=_0x4eac9e['children'][_0x5207ca];_0x14d119(_0x100beb);}};for(let _0x2fb9d6=0x0;_0x2fb9d6<_0x5b996b['children']['length'];_0x2fb9d6++)_0x14d119(_0x5b996b['children'][_0x2fb9d6]);}(this['document'],_0x2339d1=>{if(ar(_0x2339d1)){const _0x18d053=this['splitTextNodeIntoWordNodes'](_0x2339d1);_0x18d053['length']&&_0x1b78ad['push'](..._0x18d053);}_0x2339d1['isWordSplitSource']||_0x2339d1['isWordSplitResult']||_0x1b78ad['push'](_0x2339d1);}),_0x1b78ad;}['splitTextNodeIntoWordNodes'](_0x9e1487){if(_0x9e1487['isWordSplitSource']||_0x9e1487['isWordSplitResult'])return[];const _0x1baf8f=_0x7ea36f(_0x9e1487)['match'](/(?:\s*\S+\s*)/g),_0x259f6f=[];if(_0x1baf8f&&_0x1baf8f['length']>0x1){for(const _0x50a6aa of _0x1baf8f){const _0x48421a=new _0x423c6f(_0x50a6aa);_0x48421a['isWordSplitResult']=!0x0,_0x53e16f(_0x9e1487,_0x48421a),_0x259f6f['push'](_0x48421a);}_0x9e1487['isWordSplitSource']=!0x0,_0x112be1(_0x9e1487);}return _0x259f6f;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0x1344b8){return _0x1d8d35(_0x1344b8);}function dr(_0x21e2a6){return _0xa8223f(_0x21e2a6);}function pr(_0x4d5a5e){const _0x3c16b8=new AbortController();return{'promise':new Promise((_0x276cc7,_0x51846c)=>{const _0x250f64=setTimeout(_0x276cc7,_0x4d5a5e);_0x3c16b8['signal']['addEventListener']('abort',()=>{clearTimeout(_0x250f64),_0x51846c();});}),'abortController':_0x3c16b8};}const Ce=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x40a2ba{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x1366f8,{part:_0x5a495b,uiIndex:_0x33352f,areActionsDisabled:_0x44600b,availableActions:_0x16b22a}){super(_0x1366f8),this['set']('partDefinition',_0x5a495b),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x35dbd3=>'pending'==_0x35dbd3&&!_0x44600b),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x1366f8,{'part':_0x5a495b,'uiIndex':_0x33352f,'availableActions':_0x16b22a}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ce)['to'](this);const _0x2f0040=this['bindTemplate'];this['contentView']=new _0x40a2ba(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x2f0040['to']('state',_0x14987b=>'ck-ai-suggestion__body__content-part_'+_0x14987b),_0x2f0040['to']('isEnabled',_0x13a618=>_0x13a618?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x2f0040['if']('isVisible','ck-hidden',_0x35966c=>!_0x35966c)]},'children':this['children'],'on':{'mouseenter':_0x2f0040['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x5a495b['index']});}),'mouseleave':_0x2f0040['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x5a495b['index']});})}});}async['updateContent']({part:_0x398755,renderingStrategy:_0x418bd3,showUnchangedParts:_0x1027c3=!0x1,abortSignal:_0x3e2925}){this['partDefinition']=_0x398755,this['isVisible']=this['partDefinition']['hasChanges']||_0x1027c3,this['isVisible']&&('streaming'===_0x418bd3?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x3e2925}):this['contentView']['element']['innerHTML']=tt(this['partDefinition']['content']));}['toggleHeader'](_0x2b8028){_0x2b8028?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x40a2ba{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x1d8104,{part:_0x2f6eca,uiIndex:_0x4abb0b,availableActions:_0x1b100f}){super(_0x1d8104),this['set']('partDefinition',_0x2f6eca),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x20cca6=new _0x5a991c();_0x20cca6['content']=_0x1e775e,_0x20cca6['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x28082a=[];if(_0x1b100f['includes']('showChangeInText')){const _0x3a143f=new _0x2cae14(_0x1d8104);_0x3a143f['set']({'label':f(_0x1d8104,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x27829e}),_0x3a143f['bind']('isEnabled')['to'](this),_0x3a143f['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x2f6eca['index']});}),_0x28082a['push'](_0x3a143f);}if(_0x1b100f['includes']('insertSuggestion')){const _0x25372f=new _0x2cae14(_0x1d8104);_0x25372f['set']({'label':f(_0x1d8104,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x1689df}),_0x25372f['bind']('isEnabled')['to'](this),_0x25372f['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x2f6eca['index']});}),_0x28082a['push'](_0x25372f);}const _0x3261a5=new _0x2cae14(_0x1d8104);_0x3261a5['set']({'label':f(_0x1d8104,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x3a8a02}),_0x3261a5['bind']('isEnabled')['to'](this),_0x3261a5['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x2f6eca['index']});}),_0x28082a['push'](_0x3261a5),this['_toolbarView']=new _0x2e57c2(_0x1d8104),this['_toolbarView']['items']['addMany'](_0x28082a),this['_iconStateAccepted']=new _0x5a991c(),this['_iconStateAccepted']['content']=_0x126600,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':f(_0x1d8104,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x5a991c(),this['_iconStateRejected']['content']=_0x9d2521,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':f(_0x1d8104,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x5a991c(),this['_iconStateOutdated']['content']=_0x9d2521,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':f(_0x1d8104,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x37be4c=new _0x40a2ba(_0x1d8104);_0x37be4c['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[f(_0x1d8104,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x4abb0b['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x20cca6,_0x37be4c,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',(_0x404a95,_0x512eb6,_0x387706,_0x57abdf)=>{switch(_0x57abdf){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x387706){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class k extends _0xd790fa(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x2a0167){const _0x13a968=this['createTask'](_0x2a0167);return this['queue']['push'](_0x13a968),this['_processQueue'](),_0x13a968['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(_0x2b94e9=>{this['once']('_queueEmpty',()=>{_0x2b94e9();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x5060cc=this['queue']['shift']();try{await _0x5060cc['callback'](this['_abortController']['signal']),_0x5060cc['resolve']();}catch(_0x29f158){_0x5060cc['reject'](_0x29f158);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x380f96){let _0x3ce926,_0x48fb23;const _0x14fe04=new Promise((_0x188fa5,_0x120b42)=>{_0x3ce926=_0x188fa5,_0x48fb23=_0x120b42;});return{'callback':_0x380f96,'resolve':_0x3ce926,'reject':_0x48fb23,'completePromise':_0x14fe04};}}class gr extends _0x40a2ba{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x18f39a){super();const _0x5228ca=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x18f39a,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x5228ca['if']('isDone','ck-ai-chat__feed__item_done'),_0x5228ca['if']('isVisible','ck-hidden',_0x46e11c=>!_0x46e11c),'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'](_0x5dd690=>{_0x5dd690['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x55a5c5,_0x192fcb,_0x227269){await this['htmlStreamer']['stream']({'document':_0x55a5c5,'targetElement':_0x192fcb,'abortSignal':_0x227269});}}class ye extends gr{constructor(_0x3e4ebd){super(_0x3e4ebd),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x3e4ebd['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x5412f7){this['element']['innerHTML']=_0x5412f7;}}class Dr extends _0x40a2ba{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0xc1ecaa,_0x1fb29c){super(_0xc1ecaa);const {areActionsDisabled:_0x2c5951,showUnchangedParts:_0x5ede5e,availableActions:_0x3b792d}=_0x1fb29c;this['_areActionsDisabled']=_0x2c5951,this['_showUnchangedParts']=_0x5ede5e,this['_availableActions']=_0x3b792d,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new k(),this['_emptyPartsWarningView']=new ye({'id':'empty-parts-warning','initialContent':f(_0xc1ecaa,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,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']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x13e767,renderingStrategy:_0x54aded,abortSignal:_0x4088c4}){this['_children']['length']?_0x13e767['forEach'](_0x594171=>{const _0x129506=this['_cachedContentParts']['findIndex'](_0x118ef7=>_0x118ef7['index']==_0x594171['index']);-0x1===_0x129506?this['_cachedContentParts']['push'](_0x594171):this['_cachedContentParts'][_0x129506]=_0x594171;}):this['_cachedContentParts']=_0x13e767;for(const _0x40c9b3 of _0x13e767['filter'](_0x13f0b9=>_0x13f0b9['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x5ab454=>{let _0x217ca0=this['getPartView'](_0x40c9b3['index']);_0x217ca0||(_0x217ca0=new na(this['locale'],{'part':_0x40c9b3,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x217ca0['delegate'](...Ce)['to'](this),this['_children']['add'](_0x217ca0),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x217ca0['toggleHeader'](this['_children']['length']>0x1),await _0x217ca0['updateContent']({'part':_0x40c9b3,'renderingStrategy':_0x54aded,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x5ab454});});return _0x4088c4?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x42c087,_0x13d46b){const _0x3f91a8=this['getPartView'](_0x42c087);_0x3f91a8&&(_0x3f91a8['state']=_0x13d46b),this['hasPendingParts']='pending'==_0x13d46b||Array['from'](this['_children'])['some'](_0x3103ef=>'pending'==_0x3103ef['state']);}['getPartView'](_0xefe41f){return this['_children']['find'](_0x2f7338=>_0x2f7338['partDefinition']['index']==_0xefe41f)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x3adf60=!this['_cachedContentParts']['find'](({hasChanges:_0x3545db})=>_0x3545db),_0x2d6a2f=!!this['_cachedContentParts']['find'](({hasChanges:_0x5cfd23})=>!_0x5cfd23);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x2d6a2f,_0x3adf60?this['_emptyPartsWarningView']['setContent'](f(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](f(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x2ecec6=>_0x2ecec6['partDefinition']['hasChanges']);}}class je extends _0x5a3d4e{constructor(_0x591980=void 0x0){super();const _0x557f1b=_0x591980?'ck-ai-spinner_'+_0x591980:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x557f1b]}});}}class p extends _0x40a2ba{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x240b5a,_0x249764){super(_0x240b5a);const {showDiff:_0x100bc4,areActionsDisabled:_0xaa2d1,miniToolbarConfig:_0x256338,hideHeader:_0x456ab8,showLoader:_0x27c387,showUnchangedParts:_0x38501c,availableActions:_0x459a88}=_0x249764;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x27c387),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x456ab8||(this['headerView']=new Lr(_0x240b5a,{'showDiff':_0x100bc4}),this['headerView']['on']('toggleShowChanges',(_0x1d50d1,_0x2beb28)=>{this['areChangesVisible']=_0x2beb28['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x2beb28['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x240b5a,{'areActionsDisabled':_0xaa2d1,'showUnchangedParts':!!_0x38501c,'availableActions':_0x459a88}),this['bodyView']['delegate'](...Ce)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Sr(_0x240b5a,_0x256338,_0x100bc4),this['miniToolbarView']['delegate'](...Ce)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x2cf9e3,_0x5e69d7)=>{this['areChangesVisible']=_0x5e69d7,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x5e69d7});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new yr(this['locale']),this['children']['add'](this['sourcesView']),_0x27c387&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x3521bc){await this['bodyView']['updateContentParts'](_0x3521bc);}['updateSources'](_0x45bf8f){this['sourcesView']['children']['addMany'](_0x45bf8f['map'](_0x18b9af=>new Cr(this['locale'],_0x18b9af))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x4cd720){if(this['errorView']){const _0x40aa88=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x40aa88&&(_0x40aa88['textContent']=_0x4cd720),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0xefa8e){this['miniToolbarView']['items']['add'](_0xefa8e);}['removeNavigationItem'](_0x160c88){this['miniToolbarView']['items']['remove'](_0x160c88);}['_createLoaderView'](){const _0x67fa69=new _0x40a2ba(this['locale']),_0x4de816=new je('small');_0x4de816['isVisible']=!0x0;const _0x275f53=new _0x40a2ba(this['locale']);return _0x275f53['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[f(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x67fa69['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x2317aa=>!_0x2317aa)]},'children':[_0x4de816,_0x275f53]}),_0x67fa69;}['_createErrorView'](){const _0x1a209c=new _0x40a2ba(this['locale']),_0x1c9822=new _0x40a2ba(this['locale']);return _0x1c9822['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[f(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x1a209c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x2047ad=>!_0x2047ad)]},'children':[_0x1c9822]}),_0x1a209c;}}class yr extends _0x40a2ba{['children'];constructor(_0x466023){super(_0x466023),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',_0x21a2e7=>!_0x21a2e7)]},'children':this['children']});const _0x2f4776=new _0x40a2ba(this['locale']),_0x556f7b=new _0x5a991c();_0x556f7b['content']=_0x44b8c6,_0x2f4776['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x556f7b,{'tag':'span','children':[{'text':f(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x2f4776);}}class Cr extends _0x2cae14{constructor(_0x1bd4fb,_0x164cd1){super(_0x1bd4fb),this['set']({'label':_0x164cd1['title'],'tooltip':_0x164cd1['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0xa57686=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0xa57686['to'](()=>{window['open'](_0x164cd1['url'],'_blank');})}}),_0x164cd1['favicon']){const _0x3b42c3=new _0x40a2ba(_0x1bd4fb);_0x3b42c3['setTemplate']({'tag':'img','attributes':{'src':_0x164cd1['favicon']||_0x44b8c6,'alt':_0x164cd1['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x3b42c3);}else this['set']('icon',_0x44b8c6);}}class Ht extends _0x2e57c2{constructor(_0x53a022,_0x183e84=!0x0,_0x1d8457=!0x0){super(_0x53a022),this['set']('isLoading',!0x1),_0x183e84&&(this['applyButton']=this['_createButton'](f(_0x53a022,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5ed2bf=>!_0x5ed2bf),this['items']['add'](this['applyButton'])),_0x1d8457&&(this['suggestButton']=this['_createButton'](f(_0x53a022,'AI_BALLOON_SUGGEST_BUTTON'),_0x183e84?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5bb544=>!_0x5bb544),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x5a7e3f,_0x34105c){const _0x399630=new _0x2cae14(this['locale']);return _0x399630['set']({'label':_0x5a7e3f,'class':_0x34105c||'','isVisible':!0x0,'withText':!0x0}),_0x399630;}}class Wt extends _0x40a2ba{constructor(_0x3411a4){super(_0x3411a4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':f(_0x3411a4,'AI_DISCLAIMER_TEXT')}]}]});}}const e=['applySuggestion','insertSuggestion','showNext','showPrevious'];class n extends _0x40a2ba{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];constructor(_0x114aaa,_0x9e581e,_0x1c603,_0x328b26){super(_0x114aaa),this['_availableActions']=_0x1c603,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x328b26),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new Bt(),this['keystrokes']=new jt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Vt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x23b83b(),this['_addContentView'](_0x9e581e['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x9e581e['showApplyButton'],_0x9e581e['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x9e581e['showApplyButton'],_0x9e581e['showSuggestButton']);});}['render'](){super['render']();for(const _0x4cebfd of this['_focusables'])this['focusTracker']['add'](_0x4cebfd['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x4a41c1){-0x1===_0x4a41c1?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x423a32){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x423a32,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x2c78c3){this['showError'](_0x2c78c3);}['showBlockingError'](_0x3d6384){this['showError'](_0x3d6384),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x3568e6){const _0x5482d6=this['_createNextButtonView'](),_0x17339e=this['_createPreviousButtonView']();_0x3568e6['view']['headerView']['children']['add'](_0x5482d6,0x2),_0x3568e6['view']['headerView']['children']['add'](_0x17339e,0x0),this['_focusables']['addMany']([_0x5482d6,_0x17339e]),this['focusTracker']['add'](_0x5482d6['element']),this['focusTracker']['add'](_0x17339e['element']);}['_addContentView'](_0x20617c){this['_mainView']=_0x20617c,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x33dc7b){const _0x3fcb15=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x33dc7b,this['_dialogContent']['add'](this['_mainView'],_0x3fcb15),this['hideError']();}['_addDisclaimerView'](){this['disclaimerView']=new Wt(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x326a6a=!0x0,_0x254daf=!0x0){_0x326a6a=_0x326a6a&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x254daf=_0x254daf&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new Ht(this['locale'],_0x326a6a,_0x254daf),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x1ce232=new _0x2cae14(this['locale']);return _0x1ce232['set']({'icon':_0x446b5b,'tooltip':f(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x1ce232['on']('execute',()=>{this['fire']('showNext');}),_0x1ce232;}['_createPreviousButtonView'](){const _0x199665=new _0x2cae14(this['locale']);return _0x199665['set']({'icon':_0x4618d9,'tooltip':f(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x199665['on']('execute',()=>{this['fire']('showPrevious');}),_0x199665;}['_createErrorView'](){const _0x27f23b=new _0x40a2ba(this['locale']),_0x908f1c=new _0x40a2ba(this['locale']);return _0x908f1c['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x27f23b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x2c8472=>!_0x2c8472)]},'children':[_0x908f1c]}),_0x27f23b;}}const g=0xa;class N extends _0x5cd1ee{static get['requires'](){return[o,s];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x2ef188){const _0x896cac=u(this['context']);if(this['_config']=_0x2ef188,this['isOpen'])return void this['_updateBalloon'](_0x2ef188);const _0x42bb7c=this['context']['config']['get']('ai.availableReplyActions')||[...m],_0x20e06c=_0x896cac?.['commands']['get']('trackChanges'),_0x30aa3c=_0x20e06c?.['value'];this['balloonView']=new n(_0x896cac['locale'],_0x2ef188,_0x42bb7c,!!_0x30aa3c),this['balloonView']['delegate'](...e)['to'](this),_0x20e06c&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x20e06c,'value'),this['_showDialog'](_0x2ef188);}['close'](){u(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateBalloon'](_0x275be3){const _0x28f519=u(this['context']),_0x4480bf=_0x28f519['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x28f519['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x4480bf['view']?.['headerView']&&(_0x4480bf['view']['headerView']['label']=_0x275be3['title'],_0x4480bf['view']['headerView']['iconView']&&_0x275be3['icon']&&(_0x4480bf['view']['headerView']['iconView']['content']=_0x275be3['icon'])),this['balloonView']['updateContent'](_0x275be3['mainView']),this['_setupVisualSelection'](_0x275be3['ranges'],_0x275be3['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x4480bf['view']&&_0x4480bf['view']['updatePosition']();},_0x28f519['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x2b3301,_0x1491ca){this['context']['plugins']['get'](s)['showFakeVisualSelection'](_0x2b3301,'ai-balloon-'+_0x1491ca,!0x0,!0x0);}['_showDialog'](_0x583081){const _0xf5580=u(this['context']);this['_setupVisualSelection'](_0x583081['ranges'],_0x583081['index']);const _0x50d7f4=this['_getSelectionElements']();_0x50d7f4&&_0x50d7f4[0x0]&&_0x10ba32({'target':_0x50d7f4[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0xf5580['plugins']['get']('Dialog')['show']({'title':_0x583081['title'],'icon':_0x583081['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x583081['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x5881be=>{_0x583081['showRotator']&&this['balloonView']['setupRotator'](_0x5881be),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x331239,_0xc0b437){if(!_0xc0b437)return null;const _0x4c6727=this['_getSelectionElements']();if(!_0x4c6727||0x0===_0x4c6727['length'])return{'left':Math['round'](_0xc0b437['left']+_0xc0b437['width']/0x2-_0x331239['width']/0x2),'top':Math['round'](_0xc0b437['top']+_0xc0b437['height']/0x2-_0x331239['height']/0x2)};const _0x3abbe6=Math['round'](_0xc0b437['left']+_0xc0b437['width']/0x2-_0x331239['width']/0x2),_0x5ad007=new _0x425b57(_0x4c6727[0x0]),_0x3e564a=new _0x425b57(_0x4c6727[_0x4c6727['length']-0x1]),_0x51cb59=_0x331239['height'],_0x21a15f=this['_config']['showRotator']?0x8:0x0;return{'left':_0x3abbe6,'top':this['_calculateOptimalTopPosition'](_0x5ad007,_0x3e564a,_0x51cb59,_0x21a15f,_0xc0b437)};}['_calculateOptimalTopPosition'](_0x51bfd8,_0x34dbc0,_0x17b1df,_0x641e23=0x0,_0x5bd5b1){const _0x2b535f=_0x17b1df+_0x641e23,_0x39ae92=new _0x425b57(_0x1b71f4['window']),_0x47cc6b=[_0x51bfd8['getVisible'](),_0x34dbc0['getVisible']()]['filter'](_0x1aa1e7=>_0x1aa1e7),_0x21fc9f=_0x425b57['getBoundingRect'](_0x47cc6b);if(!_0x21fc9f)return Math['round'](_0x5bd5b1['top']+_0x5bd5b1['height']/0x2);const _0x2ded25=_0x39ae92['getIntersection'](_0x21fc9f);if(!_0x2ded25)return Math['round'](_0x5bd5b1['top']+_0x5bd5b1['height']/0x2);const _0x5e658a=_0x5bd5b1['getVisible'](),_0x21eaa4=_0x5e658a&&_0x21fc9f['height']>_0x5e658a['height'],_0xa41eb8=_0x2ded25['top'],_0x238812=_0x2ded25['bottom'];if(_0x21eaa4){const _0x317ba7=(_0x5e658a||_0x39ae92)['height']/0x2-_0x2b535f/0x2,_0x667e0=_0xa41eb8-g-_0x5bd5b1['top'],_0x493e52=_0x5bd5b1['bottom']-_0x238812-g;return _0x667e0>=_0x2b535f?Math['max'](g,_0xa41eb8-_0x2b535f-g):_0x493e52>=_0x2b535f?_0x238812+g:Math['max'](g,_0x317ba7);}const _0x836638=_0xa41eb8-_0x2b535f,_0x22f5aa=_0x5bd5b1['bottom']-_0x238812-g,_0x11d7e7=_0xa41eb8-g-_0x5bd5b1['top'];let _0x5d87ae;if(_0x22f5aa>=_0x2b535f)_0x5d87ae=_0x238812+g;else{if(_0x11d7e7>=_0x2b535f)_0x5d87ae=_0x836638-g;else _0x5d87ae=_0xa41eb8+_0x21fc9f['height']/0x2-_0x2b535f/0x2;}return _0x5d87ae;}['_setupMarkerRemovalListener'](){const _0x1f3831=u(this['context']);this['listenTo'](_0x1f3831['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x1570af,data:{newRange:_0x482514}}of _0x1f3831['model']['document']['differ']['getChangedMarkers']())if(_0x1570af['startsWith']('ai-selection:')&&(_0x482514&&(_0x482514['start']['isEqual'](_0x482514['end'])||'$graveyard'==_0x482514['root']['rootName'])||null==_0x482514)){const _0xcf62d6=f(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0xcf62d6),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x1089b7=u(this['context']);this['stopListening'](_0x1089b7['model']['document']);}['_getSelectionElements'](){const _0x17b445=u(this['context']);return _0x34855f(_0x17b445['editing'],[..._0x17b445['model']['markers']['getMarkersGroup']('ai-selection'),..._0x17b445['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class q extends _0x5cd1ee{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[o,N,_0x5f0575];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new z({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x69fd3=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x164c4d,_0x141703)=>{this['_handleUIUserMessage']({'userMessage':_0x141703});}),this['listenTo'](_0x69fd3,'resizedTabs',(_0x2b3ff9,_0x59975a)=>{this['_setIsMaximized'](_0x59975a);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x69fd3['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](f(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x1752d3,_0x2457b7)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x2457b7));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0xe9e7cf,_0x4631f5)=>{this['activeConversation']?.['addUrlToContext'](_0x4631f5);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x4e2ff5,_0x3d5b10)=>{this['activeConversation']?.['addResourceToContext'](_0x3d5b10['source'],_0x3d5b10['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2cf671,_0x147831)=>{this['_removeFromContext'](_0x147831);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x52cc04,_0x37374)=>{this['activeConversation']?.['loadSourceResources'](_0x37374['sourceId'],_0x37374['query'],_0x37374['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0xfc0015,_0x39450a)=>{this['activeConversation']?.['setModel'](_0x39450a);}),this['listenTo'](this['_aiChatUi'],'like',(_0x22a4f8,{replyId:_0x365290})=>{console['log']('Liked\x20response',_0x365290);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x5aa0ba,{replyId:_0x4e6f5c})=>{console['log']('Disliked\x20response',_0x4e6f5c);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x3756a2,_0xccfc9f)=>{this['context']['plugins']['get'](N)['close'](),this['_insertSuggestion'](_0xccfc9f);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x360db1,{replyId:_0x7c2769,partIndex:_0x2f9af3})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x7c2769,_0x2f9af3);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0xabfb20,{replyId:_0x5caa0a,partIndex:_0xd2b1b3})=>{const _0x583426=this['_getDocumentRangeForReplyChanges'](_0x5caa0a,_0xd2b1b3);_0x583426&&'$graveyard'!=_0x583426['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x583426['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x31018b,_0xa6638b)=>{this['context']['plugins']['get'](N)['close'](),this['_applySuggestion'](_0xa6638b);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x5d62db,{replyId:_0x300f99,showDiff:_0xc04a21})=>{const {reply:_0x1beba0}=this['getInteractionAndReplyById'](_0x300f99),_0x101b42=_0x1beba0['getContentParts']({'showDiff':_0xc04a21});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1beba0['id'],'parts':_0x101b42,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x28312b,{replyId:_0x10a038,partIndex:_0x4b9122})=>{this['_previewedChangeGroup']?.['replyId']==_0x10a038&&this['_previewedChangeGroup']?.['partIndex']==_0x4b9122&&this['context']['plugins']['get'](N)['close']();const {reply:_0x177f71}=this['getInteractionAndReplyById'](_0x10a038);_0x177f71['setChangeGroupState'](_0x4b9122,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof _0x5a47f7?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xd6431e,_0x507917)=>{_0x507917['on']('ready',()=>{this['_integrateEditor'](_0x507917);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x4d3bfe){const _0x36b488=u(this['context']);if(!_0x36b488['plugins']['has']('TrackChanges'))throw new _0x2e27f1('ai-no-track-changes',null);const _0x429577=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x18b16a,interaction:_0x485e18}=this['getInteractionAndReplyById'](_0x4d3bfe['replyId']),_0x2f52f5=this['_getDocumentRangeForReplyChanges'](_0x4d3bfe['replyId'],_0x4d3bfe['partIndex']),_0x4c4169=void 0x0!==_0x4d3bfe['partIndex']?[_0x18b16a['changeGroups'][_0x4d3bfe['partIndex']]]:_0x18b16a['changeGroups']['filter'](_0x3765fb=>'pending'==_0x3765fb['state']),_0x182f5c=_0x4c4169['map'](_0x36b487=>_0x18b16a['changeGroups']['indexOf'](_0x36b487));if(!_0x2f52f5||'$graveyard'==_0x2f52f5['range']['root']['rootName'])return void _0x182f5c['forEach'](_0x567f89=>_0x18b16a['setChangeGroupState'](_0x567f89,'outdated'));_0x182f5c['forEach'](_0x537fb1=>_0x18b16a['setChangeGroupState'](_0x537fb1,'accepted'));const _0x1d520b=O({'editor':_0x36b488,'reply':_0x18b16a,'interaction':_0x485e18,'groups':_0x4c4169,'transform':!0x0,'documentCompare':_0x429577,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x5a24b5;_0x2f52f5&&this['_scrollToSuggestionRange'](_0x2f52f5['range']),_0x36b488['model']['change'](_0x206df5=>{_0x5a24b5=_0x206df5['batch'],_0x36b488['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x1d520b),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x5a24b5,{'interactionId':_0x485e18['id'],'replyId':_0x18b16a['id'],'indexes':_0x182f5c['slice']()}),this['_updateRatings'](_0x18b16a);}['_applySuggestion'](_0x33b304){const _0x52bbfb=u(this['context']),_0x1a4cb2=this['context']['plugins']['get'](_0x5f0575),{reply:_0x1335b6,interaction:_0x1c88bc}=this['getInteractionAndReplyById'](_0x33b304['replyId']),_0x14d7e4=this['_getDocumentRangeForReplyChanges'](_0x33b304['replyId'],_0x33b304['partIndex']),_0x5b0430=void 0x0!==_0x33b304['partIndex']?[_0x1335b6['changeGroups'][_0x33b304['partIndex']]]:_0x1335b6['changeGroups']['filter'](_0x40fd23=>'pending'==_0x40fd23['state']),_0x3a1a4f=_0x5b0430['map'](_0x4cd309=>_0x1335b6['changeGroups']['indexOf'](_0x4cd309));if(!_0x14d7e4||'$graveyard'==_0x14d7e4['range']['root']['rootName'])return void _0x3a1a4f['forEach'](_0x1cebd6=>_0x1335b6['setChangeGroupState'](_0x1cebd6,'outdated'));_0x3a1a4f['forEach'](_0x5495fd=>_0x1335b6['setChangeGroupState'](_0x5495fd,'accepted'));const _0x457fde=O({'editor':_0x52bbfb,'reply':_0x1335b6,'interaction':_0x1c88bc,'groups':_0x5b0430,'transform':!0x0,'documentCompare':_0x1a4cb2,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x3523de;_0x14d7e4&&this['_scrollToSuggestionRange'](_0x14d7e4['range']),_0x52bbfb['model']['change'](_0x5e57b4=>{_0x3523de=_0x5e57b4['batch'];for(const _0x3ee840 of _0x457fde)_0x3ee840['baseVersion']=_0x52bbfb['model']['document']['version'],D(_0x52bbfb,_0x3ee840),_0x5e57b4['batch']['addOperation'](_0x3ee840),_0x52bbfb['model']['applyOperation'](_0x3ee840);}),this['_batchToChanges']['set'](_0x3523de,{'interactionId':_0x1c88bc['id'],'replyId':_0x1335b6['id'],'indexes':_0x3a1a4f['slice']()}),this['_updateRatings'](_0x1335b6);}['_openBalloonFor'](_0x2c5938,_0x20cda6){const _0x2c27fb=u(this['context']),_0x5dcbc7=this['_getDocumentRangeForReplyChanges'](_0x2c5938,_0x20cda6),_0x1e6bc4=this['context']['plugins']['get'](N);if(!_0x5dcbc7)return void _0x1e6bc4['close']();const {range:_0x35377e,currentIndex:_0x5c7802}=_0x5dcbc7;if('$graveyard'==_0x35377e['root']['rootName']){const {reply:_0x1f7a6c}=this['getInteractionAndReplyById'](_0x2c5938);return _0x1f7a6c['setChangeGroupState'](_0x5c7802,'outdated'),void _0x1e6bc4['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x2c5938&&this['_previewedChangeGroup']?.['partIndex']==_0x5c7802)return;this['stopListening'](_0x1e6bc4),this['_previewedChangeGroup']={'replyId':_0x2c5938,'partIndex':_0x5c7802};let _0x57b3bb=_0x2c27fb['config']['get']('ai.availableReplyActions')||[...m];_0x2c27fb['plugins']['has']('TrackChanges')||(_0x57b3bb=_0x57b3bb['filter'](_0x245cdf=>'insertSuggestion'!=_0x245cdf));const _0x51c910=new p(_0x2c27fb['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x57b3bb});this['stopListening'](_0x51c910);const {reply:_0xeaf7c0}=this['getInteractionAndReplyById'](_0x2c5938),_0x49ef5e=_0xeaf7c0['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x3368fc=>_0x3368fc['hasChanges']),_0x3972f2=_0x49ef5e['findIndex'](_0x2143fc=>_0x2143fc['index']==_0x5c7802);if(-0x1==_0x3972f2)return;const _0xb2aa84=_0x49ef5e[_0x3972f2],_0x305785=_0x49ef5e['at']((_0x3972f2-0x1)%_0x49ef5e['length'])?.['index'],_0x1de2bb=_0x49ef5e['at']((_0x3972f2+0x1)%_0x49ef5e['length'])?.['index'];_0x51c910['updateContent']({'parts':[_0xb2aa84],'renderingStrategy':'static'});const _0x11710c=_0x5c7802!==_0x305785;this['_scrollToSuggestionRange'](_0x35377e,!0x0),_0x1e6bc4['open']({'index':_0x5c7802,'title':f(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x3972f2+0x1)['toString']()),'icon':et,'mainView':_0x51c910,'showRotator':_0x11710c,'showApplyButton':!0x0,'showSuggestButton':_0x2c27fb['plugins']['has']('TrackChanges'),'ranges':[_0x35377e]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x2c5938,_0x5c7802),this['listenTo'](_0x51c910,'toggleSuggestionDisplayMode',(_0x352e17,{showDiff:_0x5c4de5})=>{this['_balloonShowDiff']=_0x5c4de5;const {reply:_0x6c5aa1}=this['getInteractionAndReplyById'](_0x2c5938),_0x65690c=_0x6c5aa1['getContentParts']({'showDiff':_0x5c4de5,'groupIndex':_0x5c7802});_0x51c910['updateContent']({'parts':_0x65690c,'renderingStrategy':'static'});}),this['listenTo'](_0x1e6bc4,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x2c5938,'partIndex':_0x5c7802}),_0x11710c?this['_openBalloonFor'](_0x2c5938,_0x1de2bb):_0x1e6bc4['close']();}),this['listenTo'](_0x1e6bc4,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x2c5938,'partIndex':_0x5c7802}),_0x11710c?this['_openBalloonFor'](_0x2c5938,_0x1de2bb):_0x1e6bc4['close']();}),_0x11710c&&(this['listenTo'](_0x1e6bc4,'showNext',()=>{this['_openBalloonFor'](_0x2c5938,_0x1de2bb);}),this['listenTo'](_0x1e6bc4,'showPrevious',()=>{this['_openBalloonFor'](_0x2c5938,_0x305785);})),this['listenTo'](_0x1e6bc4,'dialogClosed',()=>{this['stopListening'](_0x1e6bc4),this['stopListening'](_0x51c910),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x2169e7,_0x20aefa){const _0x11d62a=u(this['context']),{reply:_0x1ca1e9,interaction:_0xa844a3}=this['getInteractionAndReplyById'](_0x2169e7),_0x1aa35f=_0x1ca1e9['changeGroups']['filter'](_0x3fade1=>'pending'==_0x3fade1['state']),_0x2af10a=_0x1aa35f['map'](_0x406a07=>_0x1ca1e9['changeGroups']['indexOf'](_0x406a07));void 0x0===_0x20aefa&&(_0x20aefa=_0x2af10a[0x0]);const _0x6cb847=_0x2af10a['indexOf'](_0x20aefa);if(-0x1==_0x6cb847)return null;const _0x369415=_0x1aa35f[_0x6cb847],_0x1c77ed=new it([]),_0x24917b=new it([]);for(const _0xd6d3ec of _0x369415['changes'])if('removed'!=_0xd6d3ec['type']&&_0x24917b['children']['push'](_0xd6d3ec['node']['cloneNode'](!0x0)),'new'!=_0xd6d3ec['type']){const _0x2a065c=_0x41539f(_0x2f809a=>Z(_0x2f809a,'data-id')==_0xd6d3ec['id'],_0x1ca1e9['documentContextContent'],!0x0);_0x1c77ed['children']['push'](_0x2a065c['cloneNode'](!0x0));}if(0x0==_0x1c77ed['children']['length']){if(_0x369415['changes'][0x0]['anchorId']){const _0x2898a1=st('data-id',_0x369415['changes'][0x0]['anchorId'],_0x1ca1e9['documentContextContent']);_0x1c77ed['children']['unshift'](_0x2898a1['cloneNode'](!0x0)),_0x24917b['children']['unshift'](_0x2898a1['cloneNode'](!0x0)),_0x2898a1['nextSibling']&&(_0x1c77ed['children']['push'](_0x2898a1['nextSibling']['cloneNode'](!0x0)),_0x24917b['children']['push'](_0x2898a1['nextSibling']['cloneNode'](!0x0)));}else{const _0x51870a=_0x1ca1e9['documentContextContent']['children'][0x0];if(!_0x51870a)return null;_0x1c77ed['children']['push'](_0x51870a['cloneNode'](!0x0)),_0x24917b['children']['push'](_0x51870a['cloneNode'](!0x0));}}const _0x43a185=_0xa844a3['getDocumentContext'](),_0x4039c8=_0x11d62a['data']['parse'](_0x43a185['content']),_0x1210ae=tt(_0x1c77ed),_0x306808=_0x11d62a['data']['parse'](_0x1210ae),_0x28395a=_0x11d62a['data']['parse'](_0x1210ae),_0x42afc6=_0x11d62a['model']['createPositionAt'](_0x306808,0x0),_0x5d92a9=tt(_0x24917b),_0x30f430={'anchor':_0x42afc6,'markDeletions':!0x1},_0x9a0cc9=_0x11d62a['plugins']['get'](_0x5f0575)['getDiff'](_0x1210ae,_0x5d92a9,_0x30f430)['getOperations']();if(!_0x9a0cc9['length'])return null;_0x11d62a['model']['change'](_0x854256=>{for(const _0x2c811c of _0x9a0cc9)if('remove'==_0x2c811c['type']){const _0xf0a1c2=_0x2c811c['sourcePosition'],_0x1ae145=_0x2c811c['howMany'],_0x2e40c7=new _0x93a95(_0xf0a1c2,_0x1ae145);_0x854256['batch']['addOperation'](_0x2e40c7),_0x11d62a['model']['applyOperation'](_0x2e40c7);}else'marker'!==_0x2c811c['type']&&(_0x2c811c['baseVersion']=null,_0x2c811c['isDocumentOperation']=!0x1,_0x854256['batch']['addOperation'](_0x2c811c),_0x11d62a['model']['applyOperation'](_0x2c811c));});const _0x53d9a8=K(_0x11d62a,_0x9a0cc9,_0x306808);J(_0x11d62a['model'],_0x53d9a8);const _0x451a57=_0x53d9a8['getFirstRange']()['start']['path']['slice'](),_0x7cc38d=_0x53d9a8['getFirstRange']()['end']['path']['slice'](),_0x2d609d=[];let _0xabf812=_0x306808,_0x1c7c12=_0x28395a;for(let _0x3f7407=0x0;_0x3f7407<_0x7cc38d['length'];_0x3f7407++){const _0x7c2645=_0xabf812['maxOffset']-_0x7cc38d[_0x3f7407];_0x2d609d[_0x3f7407]=_0x1c7c12['maxOffset']-_0x7c2645,_0xabf812=_0xabf812['getChildAtOffset'](_0x7cc38d[_0x3f7407]),_0x1c7c12=_0x1c7c12['getChildAtOffset'](_0x2d609d[_0x3f7407]);}const _0x5e5057=_0x11d62a['model']['createRange'](_0x11d62a['model']['createPositionFromPath'](_0x28395a,_0x451a57),_0x11d62a['model']['createPositionFromPath'](_0x28395a,_0x2d609d)),_0x44006d=_0x28395a['getChild'](0x0)['getAttribute'](_0x556091),_0xf37d6b=Array['from'](_0x4039c8['getChildren']())['find'](_0x29208b=>_0x29208b['getAttribute'](_0x556091)==_0x44006d)['getPath'](),_0xd70609=_0x5e5057['start']['path']['slice'](),_0x3d50a8=_0x5e5057['end']['path']['slice']();_0xd70609[0x0]=_0xf37d6b[0x0]+_0xd70609[0x0],_0x3d50a8[0x0]=_0xf37d6b[0x0]+_0x3d50a8[0x0];let _0x1e508a=_0x11d62a['model']['createRange'](_0x11d62a['model']['createPositionFromPath'](_0x11d62a['model']['document']['getRoot'](),_0xd70609),_0x11d62a['model']['createPositionFromPath'](_0x11d62a['model']['document']['getRoot'](),_0x3d50a8));const _0x5d11d3=_0x11d62a['model']['document']['history']['getOperations'](_0x43a185['version']);for(const _0x2e5a1a of _0x5d11d3)_0x1e508a=_0x3ceedb['_createFromRanges'](_0x1e508a['getTransformedByOperation'](_0x2e5a1a));return{'range':_0x1e508a,'currentIndex':_0x20aefa};}['_integrateEditor'](_0x28b456){if(!_0x28b456['plugins']['has']('Undo'))return;const _0x41e49b=_0x28b456['commands']['get']('undo'),_0x49ad53=_0x28b456['commands']['get']('redo');this['listenTo'](_0x41e49b,'revert',(_0x266acd,_0xecee76,_0x15f82f)=>{const _0x52ccbb=this['_batchToChanges']['get'](_0xecee76);if(!_0x52ccbb)return;const _0x51859f=this['activeConversation']['getInteraction'](_0x52ccbb['interactionId'])['getReply'](_0x52ccbb['replyId']);_0x52ccbb['indexes']['forEach'](_0x20e509=>_0x51859f['setChangeGroupState'](_0x20e509,'pending')),this['_batchToChanges']['delete'](_0xecee76),this['_batchToChanges']['set'](_0x15f82f,_0x52ccbb);}),this['listenTo'](_0x49ad53,'revert',(_0x464e04,_0x1b2134,_0x32047b)=>{const _0x5240fa=this['_batchToChanges']['get'](_0x1b2134);if(!_0x5240fa)return;const _0x511bf6=this['activeConversation']['getInteraction'](_0x5240fa['interactionId'])['getReply'](_0x5240fa['replyId']);_0x5240fa['indexes']['forEach'](_0x114176=>_0x511bf6['setChangeGroupState'](_0x114176,'accepted')),this['_batchToChanges']['delete'](_0x1b2134),this['_batchToChanges']['set'](_0x32047b,_0x5240fa);});}async['loadConversation'](_0x5bc372){this['context']['plugins']['get'](N)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x274840=this['context']['plugins']['get']($);this['updateConversationTitle']('\x20'),_0x274840['view']['activateTab']('chat'),await this['_startConversationSafely'](_0x5bc372);const {sessionId:_0x4b0f3e}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x5bc372,_0x4b0f3e),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](f(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x5a9d5c){console['error']('Failed\x20to\x20load\x20conversation',_0x5a9d5c);}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x545825){this['activeConversation']['id']===_0x545825&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x33304f=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x33304f),this['activeConversation']?.['addCurrentDocumentToContext'](f(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x1a96e0,quickActionData:_0x115992}){await this['_handleUIUserMessage']({'userMessage':_0x1a96e0,'quickActionData':_0x115992});}['getGroupId'](){const _0x3bbce5=this['context']['config']['get']('collaboration.channelId');if(!_0x3bbce5)throw new _0x2e27f1('ai-chat-missing-channel-id',this);return _0x3bbce5;}async['_startConversationSafely'](_0x5d5025){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x5d5025);}catch(_0x2fd346){_0x454609('ai-chat-conversation-start-failed',_0x2fd346),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x538ee0){const _0x2e4e37=this['context']['plugins']['get'](N);let _0x56885b;_0x2e4e37['isOpen']&&_0x2e4e37['close'](),_0x538ee0||!this['activeConversation']?_0x56885b=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x56885b=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x3f364c=this['getGroupId'](),_0x2aaeac=_0x538ee0||_0x4fd5c3();this['activeConversation']=new W({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x56885b,'conversationId':_0x2aaeac,'group':_0x3f364c,'getEditor':()=>u(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x37eb8f,_0x56b159)=>{this['_aiChatUi']['createConversation'](_0x56b159),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x538ee0||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](f(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x41c28b,_0x1d6883)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x1d6883['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x1c9f93,_0x477250)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x477250);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x425b9d,_0x1c2182)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1c2182,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x47ea9e,_0x473dad)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x473dad,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x205302,_0x37eafc)=>{this['_aiChatUi']['removeFeedInteraction'](_0x37eafc['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x1cae50,_0x56a1cc,_0x592a7d)=>{this['updateConversationTitle'](_0x56a1cc,_0x592a7d);}),this['activeConversation']['on']('replyCreated',(_0x3e4452,_0x34519f)=>{'text-delta'===_0x34519f['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x34519f):this['_aiChatUi']['addFeedItemAISuggestion'](_0x34519f);}),this['activeConversation']['on']('replyContentUpdated',async(_0x3f75fd,_0x17774a)=>{await this['_updateReplyContent']({'reply':_0x17774a});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x12d204,{reply:_0x4c153e,index:_0x4000b5,state:_0x2ac553})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x4c153e['id'],'index':_0x4000b5,'state':_0x2ac553});}),this['activeConversation']['on']('contextItemAdded',(_0x58545c,_0x37bebd)=>{if(this['_aiChatUi']['addContextItem'](_0x37bebd['contextItem'],_0x37bebd['isLoading']),'selection'===_0x37bebd['contextItem']['type']){const _0x1d5ae2=[...u(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x1d5ae2,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x4f8538,_0x1eb303)=>{this['_aiChatUi']['removeContextItem'](_0x1eb303['uiId']),'current-document'==_0x1eb303['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x1eb303['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x11879f,_0x2531e2)=>{this['_aiChatUi']['setContextItemLoading'](_0x2531e2['contextItem']['uiId'],_0x2531e2['isLoading']);}),this['activeConversation']['on']('contextSent',(_0xbbdd08,_0x307d78)=>{this['_aiChatUi']['setConversationContext'](_0x307d78['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x4f7671,_0x3db329)=>{this['_aiChatUi']['setAddContextOptions'](_0x3db329['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x4fdf43,_0x57c508)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x57c508['sourceId'],_0x57c508['source'],_0x57c508['resources'],_0x57c508['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x522eee,_0x447b59)=>{this['_aiChatUi']['updateResourceState'](_0x447b59['sourceId'],_0x447b59['resourceId'],_0x447b59['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x585c4f,_0x59b3bc)=>{this['_aiChatUi']['updateCapabilities'](_0x59b3bc);}),this['activeConversation']['on']('modelSelected',(_0x5f4d76,_0x2b5531)=>{this['_aiChatUi']['setSelectedModel'](_0x2b5531['selectedModel'],_0x2b5531['isDisabled']);}),this['activeConversation']['on']('error',(_0x2433ee,{error:_0xb225f6,interactionId:_0x342dc3,fileName:_0x52c2a6,url:_0x4dccf4,sourceId:_0x12c4df,sourceLabel:_0x3dfa13})=>{const _0x31f023=_0x342dc3?_0x342dc3+':'+_0x4fd5c3():_0x4fd5c3();_0xb225f6['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':f(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x31f023}):_0xb225f6['message']['startsWith']('ai-chat-conversation-init-failed')||_0xb225f6['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':f(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x31f023}),this['_logError'](_0xb225f6)):_0xb225f6['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':f(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x52c2a6),'id':_0x31f023}):_0xb225f6['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':f(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x4dccf4),'id':_0x31f023}):_0xb225f6['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':f(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x31f023}):_0xb225f6['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':f(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x31f023}):_0xb225f6['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x12c4df&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x12c4df),this['_aiChatUi']['addFeedItemError']({'errorMessage':f(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x3dfa13||'source'),'id':_0x31f023}),this['_logError'](_0xb225f6)):_0xb225f6['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':f(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x31f023}),this['_logError'](_0xb225f6)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':f(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x31f023}),this['_logError'](_0xb225f6));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x538ee0||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x292733,quickActionData:_0x549947}){if(!this['activeConversation'])throw new _0x2e27f1('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x292733,'quickActionData':_0x549947}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0xdf6c91=u(this['context'])['model'],_0x51b636=Array['from'](_0xdf6c91['markers']['getMarkersGroup'](G));_0xdf6c91['change'](_0x23c120=>{_0x51b636['forEach'](_0x1cbd4b=>_0x23c120['removeMarker'](_0x1cbd4b));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x21cc0c){this['_aiChatUi']['setIsMaximized'](_0x21cc0c);}['_logError'](_0x94594b){_0x454609(_0x94594b['message']);}['_removeFromContext'](_0xde8b3a){this['activeConversation']?.['removeFromContext'](_0xde8b3a);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x3a3456){const [_0x482c47,_0x142ecc]=_0x3a3456['split'](':'),_0x28ac0a=this['activeConversation']['getInteraction'](_0x482c47),_0x4de06c=_0x28ac0a['getReply'](_0x142ecc);return{'interaction':_0x28ac0a,'reply':_0x4de06c};}['_scrollToSuggestionRange'](_0x5961e9,_0x27717a=!0x1){const _0x420956=u(this['context']),_0x615d2f={'target':_0x420956['editing']['view']['domConverter']['viewRangeToDom'](_0x420956['editing']['mapper']['toViewRange'](_0x5961e9)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x27717a};_0x27717a&&(_0x615d2f['alignToTop']=!0x0),_0x10ba32(_0x615d2f);}['updateConversationTitle'](_0x142a63,_0x28a90d=!0x1){this['_aiChatUi']['setConversationTitle'](_0x142a63||f(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x28a90d);}async['_updateReplyContent']({reply:_0x50b51c,renderingStrategy:_0x1d3914}){const {id:_0x422b2b,isDone:_0x5bae60,type:_0x58ff31,parsedContent:_0x4ee5de}=_0x50b51c;if('modification-delta'===_0x58ff31){const _0x21c1d1=_0x50b51c['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x422b2b,'parts':_0x21c1d1,'renderingStrategy':_0x1d3914,'isDone':_0x5bae60});}else'text-delta'===_0x58ff31&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x422b2b,'parsedContent':_0x4ee5de,'renderingStrategy':_0x1d3914,'isDone':_0x5bae60});_0x5bae60&&_0x50b51c['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x422b2b,_0x50b51c['sources']);}async['_stopLastInteraction'](){const _0x4c0b2c=this['activeConversation']?.['lastInteraction'];_0x4c0b2c&&(_0x4c0b2c['stop'](),this['_aiChatUi']['stopInteraction'](_0x4c0b2c));}async['_flushLastInteractionUI'](){const _0xe81337=this['activeConversation']?.['lastInteraction'];if(_0xe81337){for await(const _0x22719f of _0xe81337['replies'])await this['_updateReplyContent']({'reply':_0x22719f,'renderingStrategy':'static'});}}['_updateRatings'](_0x4623ad){const _0x1d6190={'positiveCount':_0x4623ad['changeGroups']['filter'](_0x1fea0b=>'accepted'===_0x1fea0b['state'])['length'],'totalCount':_0x4623ad['changeGroups']['length'],'modificationId':_0x4623ad['id']},_0x3b31ae=this['activeConversation']['getInteraction'](_0x4623ad['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x3b31ae,_0x1d6190);}}const ht=[...Ce,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ke extends gr{['containerView'];['actionsView'];constructor(_0x3a5b15,_0x1fbe81){super(_0x1fbe81),this['set']('isTrackChangesOn',!0x1),this['containerView']=new p(_0x3a5b15,{'showDiff':_0x1fbe81['showDiff'],'areActionsDisabled':_0x1fbe81['areActionsDisabled'],'availableActions':_0x1fbe81['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x3388b9,_0x3da789)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3da789['showDiff']});}),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',(_0x5d855e,{index:_0x5c38c9})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x5c38c9});}),this['containerView']['on']('insertSuggestion',(_0x5d637c,{index:_0x466da3})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x466da3});}),this['containerView']['on']('rejectSuggestion',(_0x263432,{index:_0x34746d})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x34746d});}),this['containerView']['on']('mouseOverSuggestion',(_0x14a8a1,{index:_0x1bcac0})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1bcac0});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x91051,{index:_0x5f4092})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5f4092});}),this['actionsView']=new nh(_0x3a5b15,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x1fbe81['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x3e720d){await this['containerView']['updateContent'](_0x3e720d),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x26adbd,_0xaef3b4){this['containerView']['bodyView']['updatePartState'](_0x26adbd,_0xaef3b4);}['updateSources'](_0xb52123){this['containerView']['updateSources'](_0xb52123);}['getPartView'](_0x279591){return this['containerView']['bodyView']['getPartView'](_0x279591);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Se extends gr{['replyContainer'];constructor(_0xd119ba,_0x334b8c){super(_0x334b8c),this['locale']=_0xd119ba,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x40a2ba(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Ne(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x289137,renderingStrategy:_0x1e8854,abortSignal:_0x5867b9}){'streaming'===_0x1e8854?await this['streamIntoElement'](_0x289137,this['replyContainer']['element'],_0x5867b9):this['replyContainer']['element']['innerHTML']=_0x57c50a(_0x289137);}['updateSources'](_0x4ab6b1){const _0x59faf6=new yr(this['locale']);_0x59faf6['children']['addMany'](_0x4ab6b1['map'](_0x234316=>new Cr(this['locale'],_0x234316))),_0x59faf6['isVisible']=!0x0,this['children']['add'](_0x59faf6);}}const xn={'file':_0xb62b4b,'document':_0x59a974,'web-resource':_0x362632,'text':_0xb62b4b,'selection':_0x3173ed},Zr='ck-ai-chat-context-chip',ra='ck-ai-chat-context-chip_wide',oa='ck-ai-chat-context-chip_document',ca='ck-ai-chat-context-chip__label',la='ck-ai-chat-context-chip__type-icon',da='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class xo extends _0x2cae14{constructor(_0x1f5d0f,_0x52e9de,_0x2bbc84,_0xeb1b33,_0x40dc0e=!0x1){super(_0x1f5d0f),this['_isAnimationOnEnterEnabled']=_0xeb1b33,this['_initializeProperties'](_0x52e9de,_0x2bbc84,_0x40dc0e),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'](_0x1589c8,_0x567c3c,_0x367d3f){this['set']('label',_0x1589c8['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x1589c8['type']),this['set']('id',_0x1589c8['uiId']),this['set']('readonly',_0x567c3c),this['set']('isLoading',_0x367d3f);}['_setupTemplate'](){const _0x2ce896=this['_createIconView'](),_0x161b60=this['_createRemoveButton'](),_0x57df80=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x57df80),'children':this['_createTemplateChildren'](_0x2ce896,_0x161b60,_0x57df80)});}['_createTemplateAttributes'](_0x4e3fe4){return{'class':[Zr,_0x4e3fe4['if']('itemType',oa,_0x5aa355=>'document'==_0x5aa355),_0x4e3fe4['if']('itemType',ra,_0x33220c=>'selection'==_0x33220c)],'data-cke-tooltip-text':_0x4e3fe4['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':da};}['_createTemplateChildren'](_0x3a179a,_0x3d3f26,_0x2a2d9d){const _0x52e20f=this['_createLabelElement'](_0x2a2d9d),_0x5c9499=this['_createLoaderIcon']();return this['readonly']?[_0x3a179a,_0x52e20f]:[_0x3a179a,_0x5c9499,_0x52e20f,_0x3d3f26];}['_createLabelElement'](_0x160733){return{'tag':'span','attributes':{'class':ca},'children':[{'text':_0x160733['to']('label')}]};}['_createRemoveButton'](){const _0x1260ec=new _0x2cae14(this['locale']);return _0x1260ec['set']({'label':f(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x234981}),this['_setupRemoveButtonEvent'](_0x1260ec),_0x1260ec;}['_setupRemoveButtonEvent'](_0x28937a){_0x28937a['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x88fc89=this['bindTemplate'],_0x5c000d=new _0x5a991c();return _0x5c000d['content']=xn[this['itemType']],_0x5c000d['extendTemplate']({'attributes':{'class':[la,_0x88fc89['if']('isLoading','ck-hidden',_0x4ceb9d=>_0x4ceb9d)]}}),_0x5c000d;}['_handleAnimationEndOnce'](_0xcf419e,_0xf561a3){if(!_0xcf419e)return;const _0x52d266=()=>{_0xf561a3(),_0xcf419e['removeEventListener']('animationend',_0x52d266),_0xcf419e['removeEventListener']('webkitAnimationEnd',_0x52d266);};_0xcf419e['addEventListener']('animationend',_0x52d266),_0xcf419e['addEventListener']('webkitAnimationEnd',_0x52d266);}['_createLoaderIcon'](){const _0xe7ff76=new je('small');return _0xe7ff76['bind']('isVisible')['to'](this,'isLoading',_0x15282f=>_0x15282f),_0xe7ff76;}}function In(_0x1ca391){if(!_0x1ca391)return _0x1ca391;if(_0x1ca391['length']<=0x78)return _0x1ca391;const _0x4cdea2=_0x1ca391['slice'](0x0,0x78),_0x5aa8c6=_0x4cdea2['lastIndexOf']('\x20');return(_0x5aa8c6>0x0?_0x4cdea2['slice'](0x0,_0x5aa8c6):_0x4cdea2)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class wo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x142125,_0x5b8704,_0x23d023,_0x361f23,_0x2df42f){this['_locale']=_0x142125,this['_visibleChips']=_0x5b8704,this['_config']={...hn,..._0x23d023,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x23d023['cssClasses']}},this['_overflowChips']=new _0x17acab(),this['_bodyCollection']=_0x361f23,this['_parentView']=_0x2df42f||null;}['setContainerElement'](_0x2ed98e){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x2ed98e,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 _0x53d163=[...this['_visibleChips'],...this['_overflowChips']],_0x4f57a2=this['_createCalculationContainer'](),_0x5b8f72=this['_calculateOverflowInContainer'](_0x4f57a2,_0x53d163),_0x33193d=_0x4f57a2['_ancestorsToRestore'];_0x33193d&&this['_restoreAncestorVisibility'](_0x33193d),_0x4f57a2['remove'](),this['_applyOverflowResults'](_0x53d163,_0x5b8f72);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),ts({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x7a28fc=new _0x2cae14(this['_locale']);_0x7a28fc['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x10c47f=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x10c47f['push'](this['_config']['cssClasses']['controlsButton']),_0x7a28fc['extendTemplate']({'attributes':{'class':_0x10c47f}}),_0x7a28fc;}['_createShowMoreBalloonPanelView'](){const _0x3be489=new _0x1c3e7b(this['_locale']);return _0x3be489['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x3be489),_0x3be489;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x3e9652=>{_0x3e9652['disableAnimationOnEnter']();});const _0x2edfd0=new _0x40a2ba(this['_locale']);_0x2edfd0['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x2edfd0);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x4461f5=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x4461f5?'':'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'](_0x5cdd73){const _0x4ea4fa=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x5cf0d6=this['_containerElement']?.['classList'];if(_0x5cf0d6){const _0x151eb4=_0x5cf0d6[0x0]||'',_0x20d538=_0x5cdd73['querySelector']('.'+_0x151eb4),_0x19c80a=_0x5cdd73['querySelector'](_0x4ea4fa);return _0x20d538||_0x19c80a||_0x5cdd73;}return _0x5cdd73['querySelector'](_0x4ea4fa)||_0x5cdd73;}['_calculateContainerWidth'](){const _0x464d56=this['_parentView']?.['element']||this['_containerElement'];if(!_0x464d56)return an;const _0x547133=window['getComputedStyle'](_0x464d56)['width'];if('auto'===_0x547133||'0px'===_0x547133||!_0x547133){const _0x346693=_0x464d56['parentElement'];if(_0x346693){const _0x2f0c72=window['getComputedStyle'](_0x346693);return'auto'!==_0x2f0c72['width']?_0x2f0c72['width']:an;}return an;}return _0x547133;}['_applyCalculationStyles'](_0x4ae935,_0x87b8fb){this['_config']['cssClasses']['calculationContainer']&&_0x4ae935['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4ae935['style']['width']=_0x87b8fb,_0x4ae935['style']['position']='absolute',_0x4ae935['style']['top']='-9999px',_0x4ae935['style']['left']='-9999px',_0x4ae935['style']['opacity']='0',_0x4ae935['style']['pointerEvents']='none',_0x4ae935['style']['zIndex']='-1',_0x4ae935['style']['visibility']='visible\x20!important',_0x4ae935['style']['display']='block\x20!important',_0x4ae935['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x394737){_0x394737['forEach'](({element:_0x2fa9e8,originalDisplay:_0x5bb110,originalVisibility:_0x2b4014})=>{_0x2fa9e8['style']['display']=_0x5bb110,_0x2fa9e8['style']['visibility']=_0x2b4014;});}['_makeAncestorsVisible'](_0xf873e7){const _0x2ffd90=[];let _0x383a2f=_0xf873e7;for(;_0x383a2f&&_0x383a2f!==document['body'];){const _0x37dc18=window['getComputedStyle'](_0x383a2f);'none'!==_0x37dc18['display']&&'hidden'!==_0x37dc18['visibility']||(_0x2ffd90['push']({'element':_0x383a2f,'originalDisplay':_0x383a2f['style']['display'],'originalVisibility':_0x383a2f['style']['visibility']}),_0x383a2f['style']['display']='block',_0x383a2f['style']['visibility']='visible'),_0x383a2f=_0x383a2f['parentElement'];}return _0x2ffd90;}['_createContainerElements'](){let _0x4e284f,_0x379b88;return this['_parentView']?.['element']?(_0x4e284f=this['_parentView']['element']['cloneNode'](!0x0),_0x379b88=this['_findTargetContainer'](_0x4e284f)):(_0x4e284f=document['createElement']('div'),_0x379b88=_0x4e284f),{'calculationContainer':_0x4e284f,'targetContainer':_0x379b88};}['_createCalculationContainer'](){const {calculationContainer:_0x16653b,targetContainer:_0x48c943}=this['_createContainerElements'](),_0x8867df=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x16653b,_0x8867df);const _0x41091e=this['_parentView']?.['element']||this['_containerElement'],_0x2ff7ef=_0x41091e?.['parentElement'];_0x2ff7ef?_0x2ff7ef['appendChild'](_0x16653b):document['body']['appendChild'](_0x16653b),_0x16653b['_targetContainer']=_0x48c943;const _0x3a625c=this['_makeAncestorsVisible'](_0x2ff7ef||null);return _0x16653b['offsetWidth'],_0x16653b['_ancestorsToRestore']=_0x3a625c,_0x16653b;}['_calculateOverflowInContainer'](_0xb93f1d,_0x5dc2de){const _0x4bfbf5=_0xb93f1d['_targetContainer']||_0xb93f1d,_0x52231d=[],{rowCount:_0x4149b1}=this['_renderChipsAndCountRows'](_0x4bfbf5,_0x5dc2de);if(_0x4149b1<=this['_config']['maxVisibleRows'])return _0x52231d;const _0x3ce46d=_0x5dc2de['slice']();for(;_0x3ce46d['length']>0x0;){if(this['_testButtonFit'](_0xb93f1d,_0x4bfbf5,_0x3ce46d)){const _0x7cc29a=_0x5dc2de['filter'](_0x993741=>!_0x3ce46d['includes'](_0x993741));_0x52231d['push'](..._0x7cc29a);break;}if(!_0x3ce46d['pop']())break;}return _0x52231d;}['_renderChipsAndCountRows'](_0x4707eb,_0x306a7b){_0x4707eb['innerHTML']='',_0x306a7b['forEach'](_0x487756=>{if(_0x487756['element']){const _0x4799e6=_0x487756['element']['cloneNode'](!0x0);_0x4707eb['appendChild'](_0x4799e6);}}),_0x4707eb['offsetWidth'];const _0x1f5ef1=_0x4707eb['children'],_0x382c4c=[];return Array['from'](_0x1f5ef1)['forEach'](_0x39b948=>{const _0x399b0b=_0x39b948['getBoundingClientRect']()['top'];_0x382c4c['some'](_0x4f5e30=>Math['abs'](_0x4f5e30-_0x399b0b)<this['_config']['rowDetectionTolerance'])||_0x382c4c['push'](_0x399b0b);}),{'rowCount':_0x382c4c['length']};}['_createMockButton'](){const _0x281d35=document['createElement']('button');return _0x281d35['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x281d35['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x281d35['textContent']='+\x201',_0x281d35;}['_testButtonFit'](_0x8146e0,_0x541885,_0x1e0e14){this['_renderChipsAndCountRows'](_0x541885,_0x1e0e14);const _0x553b28=this['_createMockButton']();_0x8146e0['appendChild'](_0x553b28),_0x8146e0['offsetWidth'];const _0x594279=[..._0x541885['children'],_0x553b28],_0x8df855=[];_0x594279['forEach'](_0x30716f=>{const _0x41529d=_0x30716f['getBoundingClientRect']()['top'];_0x8df855['some'](_0x2c0a56=>Math['abs'](_0x2c0a56-_0x41529d)<this['_config']['rowDetectionTolerance'])||_0x8df855['push'](_0x41529d);});const _0x177b9e=_0x8df855['length'];return _0x553b28['remove'](),_0x177b9e<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x309999,_0x4c583e){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x309999['forEach'](_0x46c276=>{_0x4c583e['includes'](_0x46c276)?this['_overflowChips']['add'](_0x46c276):this['_visibleChips']['add'](_0x46c276);});}['_updateOverflowUI'](_0x5976b5){if(_0x5976b5>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x5976b5>0x0&&this['_showMoreButtonView']){const _0x4fc0e7=''+this['_config']['showMoreLabelPrefix']+(_0x5976b5<0x63?_0x5976b5:'99');this['_showMoreButtonView']['label']=_0x4fc0e7;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x3d29f7,_0x18b15d){this['_distributeChips'](_0x3d29f7,_0x18b15d),this['_updateOverflowUI'](_0x18b15d['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x2317a4=>{_0x2317a4[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 _0x2b9bc7=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x2b9bc7['width']||0x0===_0x2b9bc7['height'])return!0x1;const _0x1509bb=window['innerHeight']||document['documentElement']['clientHeight'],_0xc569b7=window['innerWidth']||document['documentElement']['clientWidth'],_0x204e6a=0xc8;return _0x2b9bc7['bottom']>=-0xc8&&_0x2b9bc7['top']<=_0x1509bb+_0x204e6a&&_0x2b9bc7['right']>=-0xc8&&_0x2b9bc7['left']<=_0xc569b7+_0x204e6a;}}const ua='ck-ai-chat__feed__context-chips',_a='ck-ai-chat-context-chips-wrapper',Ia='ck-ai-chat-context-chips-wrapper-balloon',Aa='ck-ai-chat-controls-button',ga='ck-ai-chat-controls_context_show-more-button',Ea='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x40a2ba{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x9981a3,_0x3c0096,_0x151300){super(_0x9981a3),this['_bodyCollection']=_0x151300,this['_createContextChips'](_0x3c0096);const _0xba94a5={'cssClasses':{'showMoreButton':ga,'showMoreBalloon':Ea,'overflowContainer':Ia,'controlsButton':Aa}};this['_overflowManager']=new wo(_0x9981a3,this['_contextChips'],_0xba94a5,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[ua,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':_a},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x3717cd=this['element']['querySelector']('.'+_a);_0x3717cd&&(this['_overflowManager']['setContainerElement'](_0x3717cd),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x4b90ad){for(const _0x48c139 of _0x4b90ad){const _0x5a3770=new xo(this['locale'],_0x48c139,!0x0,!0x1);this['_contextChips']['add'](_0x5a3770);}}}class ve extends gr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x20af25,_0x22a4f6,_0x168138){super(_0x22a4f6),this['_locale']=_0x20af25,this['_bodyCollection']=_0x168138,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 ah(this['_locale'],this['options']['contextItems']['filter'](_0x589755=>!_0x589755['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x40a2ba(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class rt extends gr{['capabilities'];constructor(_0x395ad8,_0x1c509a){super(_0x1c509a);const {isWebSearchEnabled:_0x15b09f,isReasoningEnabled:_0x11ebb2}=_0x1c509a['capabilities'],_0x28aa82=[];let _0x2ebaa4='';_0x15b09f&&_0x11ebb2?(_0x2ebaa4=f(_0x395ad8,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x28aa82['push'](aa(_0x44b8c6)),_0x28aa82['push'](aa(_0x3b730e))):_0x15b09f?(_0x2ebaa4=f(_0x395ad8,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x28aa82['push'](aa(_0x44b8c6))):_0x11ebb2&&(_0x2ebaa4=f(_0x395ad8,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x28aa82['push'](aa(_0x3b730e))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x2ebaa4?'':'ck-hidden']}});const _0x4de727=new _0x40a2ba();_0x4de727['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x28aa82,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x2ebaa4]}]}),this['children']['add'](_0x4de727),this['capabilities']=_0x1c509a['capabilities'];}}function aa(_0x1da806){const _0x468fa1=new _0x5a991c();return _0x468fa1['content']=_0x1da806,_0x468fa1;}const ls=['wheel','touchstart','pointerdown','keydown'],us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class _e{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x36c393){this['element']=_0x36c393,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x2c1e7a of ls){const _0x563d9c='keydown'!==_0x2c1e7a;this['element']['addEventListener'](_0x2c1e7a,this['_onUserEvent']['bind'](this),{'passive':_0x563d9c,'signal':this['abortController']['signal']});}}['start'](){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,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'](_0x2fe127){if(this['isRunning']){if('keydown'===_0x2fe127['type']){const _0x4c9304=_0x2fe127['key'];if(!us['includes'](_0x4c9304))return;}_0x2fe127 instanceof WheelEvent?_0x2fe127['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x14c1ec,scrollHeight:_0x30c9c6,clientHeight:_0x16cfba}=this['element'];return _0x30c9c6-_0x14c1ec-_0x16cfba<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class be extends _0x40a2ba{constructor(_0x408751,_0x21a6d6){super(_0x408751),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x21a6d6)});}['_createSkeletonItems'](_0x17975e){const _0x2db78d=['ck','ck-ai-skeleton__item'];return _0x17975e['map'](_0x162e3d=>{let _0x1999cf='';switch(_0x162e3d['attributes']['align']){case'right':_0x1999cf='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x1999cf='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x1999cf='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x162e3d['tag'],'attributes':{'class':[..._0x2db78d,_0x162e3d['attributes']['class']?_0x162e3d['attributes']['class']:''],'style':'width:\x20'+_0x162e3d['attributes']['width']+';\x20height:\x20'+_0x162e3d['attributes']['height']+';'+_0x1999cf}};});}}const Ie={'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':ta(0x5,'100%','44px','right'),'aiChatResources':ta(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 ta(_0x239da4,_0x46c5ec,_0x15423b,_0x9b0e2a){return new Array(_0x239da4)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x46c5ec,'height':_0x15423b,'align':_0x9b0e2a}}));}class Bi extends _0x40a2ba{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x50d438,_0x37990e){super(_0x50d438),this['_bodyCollection']=_0x37990e,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...ht)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new _e(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x5d9b99,_0x3f4280){let _0xc43b5;'ai-reply'===_0x5d9b99?_0xc43b5=new Se(this['locale'],_0x3f4280):'ai-suggestion-reply'===_0x5d9b99?(_0xc43b5=new ke(this['locale'],_0x3f4280),_0xc43b5['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0xc43b5='user-message'===_0x5d9b99?new ve(this['locale'],_0x3f4280,this['_bodyCollection']):'interaction-header'===_0x5d9b99?new rt(this['locale'],_0x3f4280):new ye(_0x3f4280),this['children']['add'](_0xc43b5);}async['updateReplyItem']({id:_0x2a87b9,parsedContent:_0x596367,renderingStrategy:_0x2c5a40,abortSignal:_0x107e04}){const _0xc477df=this['getItemById'](_0x2a87b9);if(!(_0xc477df instanceof Se))throw new _0x2e27f1('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0xc477df,'id':_0x2a87b9,'parsedContent':_0x596367});await _0xc477df['updateContent']({'parsedContent':_0x596367,'renderingStrategy':_0x2c5a40,'abortSignal':_0x107e04});}async['updateWebSources'](_0x23b612,_0x3e3161){const _0x859801=this['getItemById'](_0x23b612);if(_0x859801 instanceof ke)_0x859801['updateSources'](_0x3e3161);else{if(!(_0x859801 instanceof Se))throw new _0x2e27f1('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x859801,'id':_0x23b612,'sources':_0x3e3161});_0x859801['updateSources'](_0x3e3161);}}async['updateSuggestionItem']({id:_0x407cec,parts:_0x5a9cd1,renderingStrategy:_0x49fd6e,abortSignal:_0x226940}){const _0x2d8971=this['getItemById'](_0x407cec);if(!(_0x2d8971 instanceof ke))throw new _0x2e27f1('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x2d8971,'id':_0x407cec,'parts':_0x5a9cd1});await _0x2d8971['updateContent']({'parts':_0x5a9cd1,'renderingStrategy':_0x49fd6e,'abortSignal':_0x226940});}['updateSuggestionPartState']({id:_0x1fdbd4,index:_0x4875fc,state:_0x4666b5}){const _0x4b6840=this['getItemById'](_0x1fdbd4);if(!(_0x4b6840 instanceof ke))throw new _0x2e27f1('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1fdbd4});_0x4b6840['updatePartState'](_0x4875fc,_0x4666b5);}['markItemAsDone'](_0x2dcbb0){this['getItemById'](_0x2dcbb0)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x438d86=>_0x438d86['options']['id']);}['removeItem'](_0xe5c625){this['children']['remove'](this['getItemById'](_0xe5c625));}['scrollToSuggestion'](_0x1feb63,_0x351e37){const _0x51f4a3=this['getItemById'](_0x1feb63);if(!(_0x51f4a3 instanceof ke))return void Yt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x1feb63,'partIndex':_0x351e37});const _0x1a0327=_0x51f4a3['getPartView'](_0x351e37);_0x1a0327?_0x10ba32({'target':_0x1a0327['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):Yt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x1feb63,'partIndex':_0x351e37});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4c65f7=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4c65f7,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0xffde4c=new be(this['locale'],Ie['aiFeed']);return _0xffde4c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x8d2953=>!_0x8d2953)]}}),_0xffde4c;}['_createFeedItems'](){const _0x20cbcb=new _0x40a2ba(this['locale']);return _0x20cbcb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x20cbcb;}['_createFeedLoader'](){const _0x385188=new _0x40a2ba(this['locale']);return _0x385188['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x38a33c=>!_0x38a33c)]},'children':this['_createLoaderChildren']()}),_0x385188;}['_createLoaderChildren'](){const _0x2bcf34=new je();return _0x2bcf34['isVisible']=!0x0,[_0x2bcf34,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x601792){const _0x48bc2c=this['children']['find'](_0x34c031=>_0x34c031['options']['id']['includes'](_0x601792));if(!_0x48bc2c)throw new _0x2e27f1('ai-chat-feed-view-item-not-found',this,{'id':_0x601792});return _0x48bc2c;}['setLoadingMessage'](_0x562106){this['set']('loadingMessage',_0x562106);}['toggleLoadingSkeleton'](_0xe368ea){this['set']('isLoadingSkeletonVisible',_0xe368ea);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ar extends _0x4c2bff{['filter'](){let _0x19d4f1=0x0;for(const _0xcfc827 of this['items'])_0x19d4f1+=_0xcfc827['items']['length'];return{'resultsCount':_0x19d4f1,'totalItemsCount':_0x19d4f1};}}class es extends _0x4ad3c7{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x5111b4,_0x20d5f2){super(_0x5111b4,{'queryView':{'label':'','creator':_0x2bde2b,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ar(_0x5111b4),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x20d5f2,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=es['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=es['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',(_0x22808b,_0x274f40)=>!_0x22808b&&!_0x274f40),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x551fc4,_0x1144bb)=>{this['isUploadInProgress']||this['isEmpty']||_0x551fc4['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1144bb());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x12f7bb=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x12f7bb)return this['queryView']['errorText']=f(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x119ead=Jt(_0x12f7bb);this['fire']('sendUserMessage',_0x119ead),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x59836a){this['queryView']['fieldView']['set']('placeholder',_0x59836a);}['_createSubmitButton'](){const _0x2c4d36=new _0x2cae14(this['locale']);return _0x2c4d36['set']({'icon':_0xe8cbc0,'label':f(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x2c4d36['on']('execute',()=>{this['submit']();}),_0x2c4d36;}['setIsUploadInProgress'](_0x2d9225){this['isUploadInProgress']=_0x2d9225;}['_setUpAddContextButtonPositioning'](){const _0x3bd9f3=this['locale'],_0x511b02=()=>{_0x1b71f4['window']['requestAnimationFrame'](()=>{if(_0x3153d8(this['element'])){const _0x14b069=new _0x425b57(this['queryView']['fieldView']['element']),_0xc22e01=new _0x425b57(this['_addContextButtonView']['element']),_0x29ccce=_0x14b069['width'],_0x4cb175='rtl'===_0x3bd9f3['uiLanguageDirection']?'right':'left';_0x14b069['excludeScrollbarsAndBorders']();const _0x5d5865=_0x29ccce-_0x14b069['width']+0x1;this['_addContextButtonView']['element']['style'][_0x4cb175]='calc('+(_0x29ccce-_0xc22e01['width']-_0x5d5865)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x511b02),this['on']('render',()=>{_0x511b02(),this['_queryViewResizeObserver']=new _0x5f3c0f(this['queryView']['fieldView']['element'],()=>{_0x511b02();});});}}const ma='ck-ai-chat__prompt-capabilities',pa='ck-ai-chat-controls-button',Ta='ck-ai-chat-controls-button--commands',Ca='ck-ai-chat-controls__model-selection',wa='ck-ai-chat-controls__model-selection__item-name',fa='ck-ai-chat-controls__model-selection__item-description',Sa='ck-ai-chat-controls__model-selection__item-capabilities',Oa='n';class is extends _0x40a2ba{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x5d26cc){super(_0x5d26cc),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),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,'modelSelectorVisible',_0x466451=>_0x466451),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x3e2f1f=>_0x3e2f1f?this['_modelSelectionDropdown']['buttonView']['label']:f(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x1928db=>_0x1928db),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x234a25=>_0x234a25),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x392148=>!_0x392148),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x313f7a=>f(this['locale'],_0x313f7a?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x426ce4=>_0x426ce4),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x32cf3b=>!_0x32cf3b),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1ff201=>f(this['locale'],_0x1ff201?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ma]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x17acab(),_0x4f0e71(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x5e0817,_0xa98880){if(this['set']('modelSelectorVisible',!(_0xa98880&&_0x5e0817['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x5e0817?.['length']){const _0x6417a=Mi['getLocalized'](this['locale'],_0x5e0817);for(const _0x21ffab of _0x6417a){const _0x4b23ee=new _0x3c45c3({'label':_0x21ffab['name'],'withText':!0x0,'role':'menuitemradio','id':_0x21ffab['id'],'model':_0x21ffab});_0x4b23ee['bind']('isOn')['to'](this,'activeModelId',_0x21d888=>_0x21d888===_0x21ffab['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4b23ee,'labelView':new Ra(this['locale'],_0x21ffab)});}}}['setWebSearch'](_0x3bbff2){this['set']('webSearchActive',_0x3bbff2);}['setReasoning'](_0x2378a0){this['set']('reasoningActive',_0x2378a0);}['setModel'](_0x119477){if(!_0x119477)return;this['activeModelId']=_0x119477['id'],this['activeModelName']=_0x119477['name']||_0x119477['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x119477['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x119477['name']);const _0x5463c6=_0x119477['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x5463c6),this['_webSearchButton']['set']('isVisible',_0x5463c6);const _0x4591d9=_0x119477['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x4591d9),this['_reasoningButton']['set']('isVisible',_0x4591d9);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x16338b){this['set']('modelSelectorEnabled',!0x1),_0x16338b&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x4ce01e=new _0x2cae14();return _0x4ce01e['set']({'label':f(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x44b8c6,'class':pa,'isToggleable':!0x0,'tooltipPosition':Oa}),_0x4ce01e['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x4ce01e;}['_createReasoningButton'](){const _0x1109a1=new _0x2cae14();return _0x1109a1['set']({'label':f(this['locale'],'AI_CHAT_REASONING'),'icon':_0x3b730e,'class':pa,'isToggleable':!0x0,'tooltipPosition':Oa}),_0x1109a1['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x1109a1;}['_createCommandsButton'](){const _0x20f406=new _0x2cae14();return _0x20f406['set']({'label':f(this['locale'],'AI_CHAT_COMMANDS'),'icon':et,'withText':!0x0,'class':pa,'isToggleable':!0x0,'tooltip':f(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Oa}),_0x20f406['extendTemplate']({'attributes':{'class':[Ta]}}),_0x20f406['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x20f406;}['_createModelSelectionDropdown'](){const _0x321e16=_0x51b8c3(this['locale']);return _0x321e16['set']({'panelPosition':'ne','class':[Ca]}),_0x321e16['buttonView']['set']({'label':f(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Oa}),this['listenTo'](_0x321e16,'execute',_0x30a6c0=>{this['fire']('selectModel',_0x30a6c0['source']['model']);}),_0x321e16;}['_createModelNameView'](){const _0x9d82f7=new Go(this['locale']);return _0x9d82f7['bind']('text')['to'](this,'activeModelName',_0x1dfe77=>_0x1dfe77??''),_0x9d82f7['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x453b8e,_0x41bd05)=>!_0x453b8e&&!_0x41bd05?.['toLowerCase']()['startsWith']('agent')),_0x9d82f7;}}let Ra=class extends _0x8234dc{constructor(_0x4d1931,_0x4a07f7){super();const _0x5b5f7e=this['bindTemplate'],_0x4b8f7f=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5b5f7e['to']('style'),'id':_0x5b5f7e['to']('id')},'children':[{'tag':'div','attributes':{'class':[wa]},'children':[{'text':_0x5b5f7e['to']('text')}]},{'tag':'div','attributes':{'class':[fa]},'children':[{'tag':'span','children':[{'text':_0x4a07f7['description']}]}]},{'tag':'div','attributes':{'class':[Sa]},'children':_0x4b8f7f}]}),_0x4b8f7f['addMany'](this['_getCapabilityParts'](_0x4d1931,_0x44b8c6,'AI_CHAT_SEARCH_WEB',_0x4a07f7['capabilities']['webSearch']?.['enabled']??!0x1)),_0x4b8f7f['addMany'](this['_getCapabilityParts'](_0x4d1931,_0x3b730e,'AI_CHAT_REASONING',_0x4a07f7['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x59bccd,_0x331fb8,_0x16ebe9,_0x29db9c){const _0x4c1436=new _0x5a991c();_0x4c1436['content']=_0x331fb8;const _0x1d08f4=new _0x40a2ba(_0x59bccd);_0x1d08f4['setTemplate']({'tag':'span','children':[{'text':f(_0x59bccd,_0x16ebe9)+':\x20'}]});const _0xc089c7=new _0x40a2ba(_0x59bccd);return _0xc089c7['setTemplate']({'tag':'span','children':[{'text':f(_0x59bccd,_0x29db9c?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x4c1436,_0x1d08f4,_0xc089c7];}};class Go extends _0x40a2ba{constructor(_0x129b05){super(_0x129b05),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x53a89c=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x53a89c['if']('isVisible','ck-hidden',_0x149049=>!_0x149049)]},'children':[{'text':_0x53a89c['to']('text')}]});}}const ba='ck-ai-chat-context-controls__url-form',Na='ck-ai-chat-context-controls__url-input-section';class mo extends _0x40a2ba{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x47375c){super(_0x47375c),this['focusTracker']=new Bt(),this['keystrokes']=new jt(),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 Vt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x447f0d=>{this['focusTracker']['add'](_0x447f0d['element']),this['keystrokes']['listenTo'](_0x447f0d['element']);}),_0x2993ae({'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'](_0x78cd43){this['urlInputField']['errorText']=_0x78cd43,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x9a9ea1=new _0x2cae14(this['locale']);return _0x9a9ea1['set']({'icon':_0x4618d9,'tooltip':f(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x9a9ea1;}['_createUrlInputField'](){const _0x34bf34=new _0x5abff3(this['locale'],th);return _0x34bf34['set']({'label':f(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x34bf34['fieldView']['set']({'placeholder':f(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x34bf34;}['_createConfirmButton'](){const _0x4b5e7a=new _0x2cae14(this['locale']);return _0x4b5e7a['set']({'icon':_0x5cc13d,'tooltip':f(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x4b5e7a;}['_setupTemplate'](){const _0x33c8f9=new _0x2be5f1(this['locale'],{'label':f(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x33c8f9['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ba,'tabindex':'-1'},'children':[_0x33c8f9,{'tag':'div','attributes':{'class':Na},'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',_0x3c352c=>{_0x3c352c['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0xad6d20,_0x1e8f07)=>{this['clear'](),this['fire']('cancel'),_0x1e8f07();});}['_handleSubmit'](){const _0x911257=this['getValue']()['trim']();_0x911257?this['_isValidUrl'](_0x911257)?(this['clearError'](),this['fire']('submitUrl',_0x911257)):this['setError'](f(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](f(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x5cb59e=this['getValue']()['trim'](),_0x3c6e70=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x5cb59e['length']>0x0&&!_0x3c6e70;}['_isValidUrl'](_0x532ae4){try{return!!new URL(_0x532ae4);}catch{return!0x1;}}}const ka='ck-ai-chat-resources__item',ya='ck-ai-chat-resources__item--in-context',va='ck-ai-chat-resources__item-title',xa='ck-ai-chat-resources__item__icon';class Zo extends _0x4e528a{['resource'];['_titleView'];['_iconView'];constructor(_0x33050b,_0x1084b5){super(_0x33050b),this['resource']=_0x1084b5,this['set']('isInContext',!!_0x1084b5['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x2d570b){if(_0x2d570b['isInContext'])return _0x5cc13d;switch(_0x2d570b['type']){case zt['DOCUMENT']:return _0x59a974;case zt['URL']:return _0x362632;case zt['FILE']:case zt['TEXT']:return _0xb62b4b;default:return _0x15b233;}}['highlightText'](_0x40391){if(!_0x40391||''===_0x40391['trim']())return void this['_titleView']['highlightText'](null);const _0x29eeb5=new RegExp(_0x33cfc5(_0x40391),'gi');this['_titleView']['highlightText'](_0x29eeb5);}['updateResourceState'](_0x5c3da6){this['resource']['isInContext']=_0x5c3da6,this['isInContext']=_0x5c3da6,this['_updateIcon']();}['_createTitleView'](){const _0x26a1bd=new _0x341a83();return _0x26a1bd['text']=this['resource']['label'],_0x26a1bd['extendTemplate']({'tag':'span','attributes':{'class':[va]}}),_0x26a1bd;}['_createIconView'](){const _0x32dec1=new _0x5a991c();return _0x32dec1['content']=this['getResourceIcon'](this['resource']),_0x32dec1;}['_setupTemplate'](){const _0x15810a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ka,_0x15810a['if']('isVisible','ck-hidden',_0x411c83=>!_0x411c83),_0x15810a['if']('isInContext',ya)]},'children':[{'tag':'div','attributes':{'class':[xa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x15810a['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const La='ck-ai-chat-resources__list';class qr extends _0x4c2bff{['_source'];constructor(_0x49450a,_0x1879e7){super(_0x49450a),this['_source']=_0x1879e7,this['extendTemplate']({'attributes':{'class':[La]}});}['setResources'](_0x5a384a,_0x5931cb){this['items']['clear']();let _0x249c4f=_0x5a384a;if(this['_source']['useDefaultFiltering']&&_0x5931cb&&''!==_0x5931cb['trim']()){const _0x305e92=new RegExp(_0x5931cb['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x249c4f=_0x5a384a['filter'](_0x271b76=>_0x305e92['test'](_0x271b76['label']));}for(const _0x1cb8d9 of _0x249c4f){const _0x1e0d99=new Zo(this['locale'],_0x1cb8d9);_0x1e0d99['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x1cb8d9);}),this['items']['add'](_0x1e0d99);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x5931cb);}['highlightText'](_0x14f387){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x99051d=>{_0x99051d['highlightText'](_0x14f387);});}['updateResourceState'](_0x2648fd,_0xcee4ca){for(const _0x287869 of this['items']){const _0x2c4ff3=_0x287869;_0x2c4ff3['resource']['id']===_0x2648fd&&_0x2c4ff3['updateResourceState'](_0xcee4ca);}}['_handleResourceSelection'](_0x554920,_0x25f8d7){this['fire']('addResourceToContext',{'source':_0x554920,'resource':_0x25f8d7});}}class Fr extends _0x5abff3{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x303942){const t=_0x303942['t'],_0x295e9d={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':f(_0x303942,'AI_CHAT_SEARCH_RESOURCES')};super(_0x303942,_0x295e9d['creator']),this['label']=_0x295e9d['label'],this['_viewConfig']=_0x295e9d,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x303942,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x45fe80){this['fire']('search',_0x45fe80);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x5a991c(),this['iconView']['content']=_0x4f426d,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x290c23,t){this['resetButtonView']=new _0x2cae14(_0x290c23),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x458488,'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',_0x53bf2d=>!_0x53bf2d),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 Or extends _0x40a2ba{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x185844,_0x4e21a8){super(_0x185844),this['_source']=_0x4e21a8['source'],this['_searchInputVisibleFrom']=_0x4e21a8['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 _0x23b83b([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Fr(this['locale']);}['_createSearchSection'](){const _0x38a78b=new _0x40a2ba(this['locale']);return _0x38a78b['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1bce2c,_0x9f83c8)=>{this['loadResources'](_0x9f83c8),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x9f83c8);}),_0x38a78b;}['_createResourcesListView'](){const _0x1ebac9=new qr(this['locale'],this['_source']);return _0x1ebac9['delegate']('addResourceToContext')['to'](this),_0x1ebac9['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x1ebac9;}['_createSkeletonView'](){const _0x201514=new be(this['locale'],Ie['aiChatResources']);return _0x201514['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x9ea904=>!_0x9ea904)]}}),_0x201514;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x42c147){const _0x5447fa=_0x4fd5c3();this['_latestLoadResourcesUid']=_0x5447fa,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x42c147,'uid':_0x5447fa}),this['isLoading']=!0x0;}['setResources'](_0x775e63,_0x5659d2){if(_0x5659d2&&_0x5659d2!==this['_latestLoadResourcesUid'])return;const _0x428164=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x775e63,_0x428164),_0x775e63['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x47c3e3,_0x2b63e4){this['_resourcesListView']['updateResourceState'](_0x47c3e3,_0x2b63e4);}}const Da='ck-ai-chat-context-controls__source-balloon-panel',Pa='ck-button-icon\x20ck-button-back',Ha='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x191115,_0x46b801,_0x4e289d){this['_locale']=_0x191115,this['_bodyCollection']=_0x46b801,this['_config']=_0x4e289d;}['showSourceResourcesBalloon'](_0x1355c7){let _0x4bc8f8=this['_sourceResourceBalloons']['get'](_0x1355c7['id']);_0x4bc8f8||(_0x4bc8f8=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x1355c7['id'],_0x4bc8f8),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x4bc8f8)),this['_addSourceResourceContent'](_0x4bc8f8,_0x1355c7),_0x4bc8f8['show']();const _0x310d8a=this['_config']['getTargetElement']();_0x310d8a&&_0x4bc8f8['pin']({'target':_0x310d8a,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0xf72994,_0x35662d,_0x28bf20){const _0xcae844=this['_sourceResourceBalloons']['get'](_0xf72994);if(!_0xcae844)return;const _0x171368=this['_getResourcesViewFromBalloon'](_0xcae844);_0x171368&&(_0x171368['setResources'](_0x35662d,_0x28bf20),_0x171368['once']('change:isLoading',()=>{_0xcae844['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x304e7a){const _0xd3baba=this['_sourceResourceBalloons']['get'](_0x304e7a);_0xd3baba&&requestAnimationFrame(()=>{_0xd3baba['hide'](),this['_sourceResourceBalloons']['delete'](_0x304e7a),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x262c1e of this['_sourceResourceBalloons']['values']())if(_0x262c1e['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x67a2a7,_0x344604,_0x2117eb){const _0x6f8fa1=this['_sourceResourceBalloons']['get'](_0x67a2a7);if(!_0x6f8fa1||!_0x6f8fa1['isVisible'])return;const _0x52b6b1=this['_config']['getTargetElement']();if(!_0x52b6b1)return;_0x6f8fa1['pin']({'target':_0x52b6b1,'limiter':this['_config']['getLimiterElement']()});const _0x208706=this['_getResourcesViewFromBalloon'](_0x6f8fa1);_0x208706&&_0x208706['updateResourceState'](_0x344604,_0x2117eb);}['destroy'](){for(const _0x1fc917 of this['_sourceResourceBalloons']['values']())_0x1fc917['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x5c3f1e=new _0x1c3e7b(this['_locale']);return _0x5c3f1e['extendTemplate']({'attributes':{'class':Da}}),this['_bodyCollection']['add'](_0x5c3f1e),_0x5c3f1e;}['_addSourceResourceContent'](_0x51af27,_0x10cb76){_0x51af27['content']['clear']();const _0x2a9268=this['_createBalloonHeader'](_0x51af27,_0x10cb76);_0x51af27['content']['add'](_0x2a9268);const _0xea9ca2=this['_createBalloonResourcesView'](_0x10cb76);_0x51af27['content']['add'](_0xea9ca2);}['_createBalloonHeader'](_0x4d6470,_0x223e35){const _0x2ac2ae=this['_createBackButton'](_0x4d6470),_0x544529=new _0x2be5f1(this['_locale'],{'label':_0x223e35['label'],'class':Ha});return _0x544529['children']['add'](_0x2ac2ae,0x0),_0x544529;}['_createBackButton'](_0x3d466e){const _0x52d435=new _0x2cae14(this['_locale']);return _0x52d435['set']({'icon':_0x4618d9,'tooltip':f(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Pa}),_0x52d435['on']('execute',()=>{_0x3d466e['hide'](),this['_config']['onBackToContext']();}),_0x52d435;}['_createBalloonResourcesView'](_0x14cac6){const _0x5d467b=new Or(this['_locale'],{'source':_0x14cac6,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x5d467b['on']('loadSourceResources',(_0x2c18df,_0x58f295)=>{this['_config']['onLoadSourceResources'](_0x58f295);}),_0x5d467b['on']('addResourceToContext',(_0xca1e4e,_0x43fc54)=>{this['_config']['onResourceSelected'](_0x43fc54['source'],_0x43fc54['resource']),this['closeSourceResourceBalloon'](_0x14cac6['id']);}),_0x5d467b;}['_getResourcesViewFromBalloon'](_0x30ccb1){const _0x2f3166=_0x30ccb1['content']['get'](0x1);return _0x2f3166 instanceof Or?_0x2f3166:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x531af1){ts({'emitter':_0x531af1,'contextElements':[_0x531af1['element']],'callback':()=>{_0x531af1['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x531af1['isVisible']});}}const as=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],Bo='ck-ai-chat-context-controls',bo='ck-ai-chat-context-controls__pending-contexts',To='ck-ai-chat-context-controls__add-context-balloon-panel',Ao='ck-ai-chat-context-controls__add-context-button',ko='ck-ai-chat-context-controls__url-balloon-panel',Eo='ck-ai-chat-context-controls__balloon-button',vo='ck-ai-chat-context-controls__balloon-button-source',Vo='ck-ai-chat-controls-button',fo='ck-ai-chat-context-chips-wrapper-balloon',Io='ck-ai-chat-controls_context_show-more-button',Po='ck-ai-chat-context-controls__show-more-balloon-panel',Ro='ck-ai-chat',So=[_0x1c3e7b['defaultPositions']['northArrowSouthWest'],_0x1c3e7b['defaultPositions']['northArrowSouth'],_0x1c3e7b['defaultPositions']['northArrowSouthEast'],_0x1c3e7b['defaultPositions']['southArrowNorthWest'],_0x1c3e7b['defaultPositions']['southArrowNorth'],_0x1c3e7b['defaultPositions']['southArrowNorthEast']];class os extends _0x40a2ba{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x9867ba,_0x383f66){super(_0x9867ba),this['bodyCollection']=_0x383f66['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x9867ba),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x9867ba),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x9867ba),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x9867ba,_0x383f66);const _0x27141f={'cssClasses':{'showMoreButton':Io,'showMoreBalloon':Po,'overflowContainer':fo,'controlsButton':Vo}};this['_overflowManager']=new wo(_0x9867ba,this['_currentContextsChips'],_0x27141f,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'](_0xdb0bc4,_0xfedc70){const _0x3fd09a=this['_createContextButton'](_0xdb0bc4,'current',!0x0,_0xfedc70);this['_addContextToCollection'](_0x3fd09a,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x471946){this['_removeContextFromCollection'](_0x471946,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x471946,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x38a9c3,_0x205513){let _0x8051a5=this['_currentContextsChips']['find'](_0x3b3cd1=>_0x3b3cd1['id']===_0x38a9c3);_0x8051a5||(_0x8051a5=this['_overflowManager']['overflowChips']['find'](_0x24b15a=>_0x24b15a['id']===_0x38a9c3)),_0x8051a5&&(_0x8051a5['isLoading']=_0x205513);}['setConversationContext'](_0x4dba83){this['_conversationContextsChips']['clear']();for(const _0x16de92 of _0x4dba83){const _0x6a8d8d=this['_createContextButton'](_0x16de92,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x6a8d8d,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x7e37a9,_0x3bc14a,_0x45329c){this['_resourcesBalloonView']['updateResourceState'](_0x7e37a9,_0x3bc14a,_0x45329c);}['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;}['_showSourceResourcesBalloon'](_0x3ffa30){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x3ffa30),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x186075,_0x49d724,_0x375ba8,_0x194d49){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x186075,_0x375ba8,_0x194d49);}['closeSourceResourceBalloon'](_0x80aa02){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x80aa02),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x726443){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x726443),this['_setAddContextButtonEnabled'](_0x726443);}['_setAddContextButtonEnabled'](_0x32ee24){const _0x5ebaf5=!_0x32ee24['document']['isHidden']&&_0x32ee24['document']['enabled'],_0x4ca436=_0x32ee24['urls']['enabled'],_0x1ae454=_0x32ee24['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x5ebaf5||_0x4ca436||_0x1ae454;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Bo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':bo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x5d215b){const _0x18ff28=new _0x2cae14(_0x5d215b);return _0x18ff28['set']({'label':f(_0x5d215b,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Vo+'\x20'+Ao,'icon':_0x4fc7f3,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x18ff28;}['_createAddContextBalloonPanelView'](_0xcd93fa){return this['_createBaseBalloonPanel'](_0xcd93fa,To);}['_createUrlBalloonPanelView'](_0x141f0f){const _0x1bcedc=this['_createBaseBalloonPanel'](_0x141f0f,ko);return this['_addUrlContent'](_0x1bcedc,_0x141f0f),_0x1bcedc;}['_createResourcesBalloonView'](_0x280443,_0x5c6ad8){const _0x1d20ba={'searchInputVisibleFrom':_0x5c6ad8['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So});},'onResourceSelected':(_0x54d7ee,_0x2a852d)=>{this['fire']('addResourceToContext',{'source':_0x54d7ee,'resource':_0x2a852d});},'onLoadSourceResources':_0x4acd26=>{this['fire']('loadSourceResources',_0x4acd26);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new po(_0x280443,_0x5c6ad8['bodyCollection'],_0x1d20ba);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ro)||document['body'];}['_createBaseBalloonPanel'](_0x32b52d,_0x17dc2e){const _0x40bb50=new _0x1c3e7b(_0x32b52d);return _0x40bb50['extendTemplate']({'attributes':{'class':_0x17dc2e}}),this['bodyCollection']['add'](_0x40bb50),_0x40bb50;}['_setBalloonPanelContent'](_0x53f671,_0x97da99,_0x1dbc72){if(_0x53f671['content']['clear'](),!_0x1dbc72['document']['isHidden']&&_0x1dbc72['document']['enabled']){const _0x48d15c=this['_createBalloonButton'](_0x97da99,{'label':f(_0x97da99,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x59a974});_0x48d15c['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x53f671['content']['add'](_0x48d15c);}if(_0x1dbc72['urls']['enabled']){const _0x507c75=this['_createBalloonButton'](_0x97da99,{'label':f(_0x97da99,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x362632});_0x507c75['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So}),this['_urlInputView']['focus']();}),_0x53f671['content']['add'](_0x507c75);}if(_0x1dbc72['files']['enabled']){const _0x15d420=new _0x4af15e(_0x97da99);_0x15d420['set']({'label':f(_0x97da99,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x1f813b,'withText':!0x0,'tooltip':!0x0,'class':Eo,'allowMultipleFiles':!0x0}),_0x15d420['on']('done',(_0x21c7d1,_0x200c10)=>{this['fire']('addFileToContext',_0x200c10),this['hideAddContextBalloonPanel']();}),_0x15d420['tooltip']=!0x0,_0x53f671['content']['add'](_0x15d420);}for(const _0x4dec07 of _0x1dbc72['sources']){const _0x56fd0b=this['_createBalloonButton'](_0x97da99,{'label':_0x4dec07['label'],'icon':_0x4dec07['icon']||_0x15b233,'type':'source'});_0x53f671['content']['add'](_0x56fd0b),_0x56fd0b['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x4dec07);});}}['_addUrlContent'](_0x19b016,_0x44d40f){this['_urlInputView']=new mo(_0x44d40f),this['_urlInputView']['on']('submitUrl',(_0x3adc5c,_0x2d1e7a)=>{this['_handleUrlSubmit'](_0x2d1e7a);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So});}),_0x19b016['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x12f289,_0xa8ace8){const _0x3788b9='source'===_0xa8ace8['type']?new Ma(_0x12f289):new _0x2cae14(_0x12f289);return _0x3788b9['set']({'label':_0xa8ace8['label'],'icon':_0xa8ace8['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Eo}),_0x3788b9;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){ts({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x2afc90){const _0x5c1674=this['_addContextBalloonConfig'];_0x5c1674['buttonView']['isOn']=_0x2afc90,_0x2afc90?_0x5c1674['balloonView']['show']():_0x5c1674['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x47375f,buttonView:_0x28618f,hideMethod:_0x187ea8}=this['_addContextBalloonConfig'];ts({'emitter':_0x47375f,'contextElements':[_0x47375f['element'],_0x28618f['element']],'callback':()=>{_0x187ea8();},'activator':()=>_0x28618f['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0xe2a576,_0xad0fa,_0x4e1e8e=!0x1,_0x40225b=!0x1){const _0x478003='conversation'===_0xad0fa||!0x0===_0xe2a576['isReadOnly'],_0x10258b=new xo(this['locale'],_0xe2a576,_0x478003,_0x4e1e8e,_0x40225b);return _0x478003||_0x10258b['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x10258b['id']);}),_0x10258b;}['_addContextToCollection'](_0x591dbf,_0x4b6c1e){_0x4b6c1e['add'](_0x591dbf,0x0);}['_removeContextFromCollection'](_0xe60a30,_0x4d21fd){const _0x2797ad=_0x4d21fd['find'](_0xb05985=>_0xb05985['id']===_0xe60a30);_0x2797ad&&_0x4d21fd['remove'](_0x2797ad);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So}));}['_handleUrlSubmit'](_0x4994e9){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x4994e9);}}class Ma extends _0x2cae14{['arrowView'];constructor(_0x4a71cb){super(_0x4a71cb),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[vo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x5a32ca=new _0x5a991c();return _0x5a32ca['content']=_0x23fb66,_0x5a32ca['extendTemplate']({'attributes':{'class':vo+'__arrow'}}),_0x5a32ca;}}class rs extends _0x40a2ba{['_cancelButtonView'];['_loaderView'];constructor(_0x415e38){super(_0x415e38),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 _0x39cf83=new _0x2cae14(this['locale']);return _0x39cf83['set']({'label':f(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x1ddcb4}),_0x39cf83['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x39cf83;}['_createLoaderView'](){const _0x49e2d1=new _0x40a2ba(this['locale']);return _0x49e2d1['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':f(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x49e2d1;}}class Fi extends _0x40a2ba{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x4b5190,_0x2a449c){super(_0x4b5190),this['_contextPanelView']=this['_createContextPanelView'](_0x4b5190,{'bodyCollection':_0x2a449c['bodyCollection'],'searchInputVisibleFrom':_0x2a449c['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x4b5190),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x4b5190),this['_loaderView']=this['_createLoaderView'](_0x4b5190),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x4b5190),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),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'](...as)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x70525=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x70525['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x70525['if']('isLoading','ck-hidden',_0x37bece=>_0x37bece||!this['isModelAvailable']),_0x70525['if']('isModelAvailable','ck-hidden',_0x1c382a=>!_0x1c382a||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x70525['if']('isLoading','ck-hidden',_0x138ffc=>!_0x138ffc)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x70525['if']('isModelAvailable','ck-hidden',_0x2564c0=>_0x2564c0)]},'children':[this['_modelUnavailableMessageView']]}]}),ts({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x276c92,_0x3055ea){return new os(_0x276c92,_0x3055ea);}['_createPromptInputView'](_0x6f2637){return new es(_0x6f2637,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x2fa142){return new is(_0x2fa142);}['_createLoaderView'](_0xfbcc){return new rs(_0xfbcc);}['_createModelUnavailableMessageView'](_0x30637b){const _0x2a5927=new hs(_0x30637b);return _0x2a5927['delegate']('startConversation')['to'](this),_0x2a5927;}['_handlePromptInputFocus'](_0x35d1b6,_0xa8d62f,_0x39519b){_0x39519b?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x41f84b,_0x16531b){this['_contextPanelView']['addContextItem'](_0x41f84b,_0x16531b);}['removeContextItem'](_0x5c0f94){this['_contextPanelView']['removeContextItem'](_0x5c0f94);}['setContextItemLoading'](_0x1b596b,_0x24b1eb){this['_contextPanelView']['setContextItemLoading'](_0x1b596b,_0x24b1eb);}['setIsUploadInProgress'](_0x453207){this['_promptInputView']['setIsUploadInProgress'](_0x453207);}['setConversationContext'](_0x3d31a7){this['_contextPanelView']['setConversationContext'](_0x3d31a7);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x2a7a68,_0x568483,_0x31e56a){this['_contextPanelView']['updateResourceState'](_0x2a7a68,_0x568483,_0x31e56a);}['setWebSearch'](_0x3b0eb3){this['_promptCapabilitiesView']['setWebSearch'](_0x3b0eb3);}['setReasoning'](_0xe0379a){this['_promptCapabilitiesView']['setReasoning'](_0xe0379a);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x4bbe4f){this['_contextPanelView']['setAddContextOptions'](_0x4bbe4f);}['setInputPlaceholder'](_0xa24a11){this['_promptInputView']['setPlaceholderText'](_0xa24a11);}['setModelList'](_0xb1f85d,_0x32f699){this['_displayedModels']=_0xb1f85d,this['_promptCapabilitiesView']['setModelList'](_0xb1f85d,_0x32f699);}['setModel'](_0x2ddd57){(_0x2ddd57?this['_displayedModels']['find'](_0x2e9e63=>_0x2e9e63['id']===_0x2ddd57['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x2ddd57)):_0x2ddd57?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x329003){this['_promptCapabilitiesView']['disableModelSelector'](_0x329003);}['populateSourceResourceBalloon'](_0x39f404,_0x9e3390,_0x2b4607,_0x1c03ff){this['_contextPanelView']['populateSourceResourceBalloon'](_0x39f404,_0x9e3390,_0x2b4607,_0x1c03ff);}['closeSourceResourceBalloon'](_0x2d0ef4){this['_contextPanelView']['closeSourceResourceBalloon'](_0x2d0ef4);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class hs extends _0x40a2ba{constructor(_0x5e9375){super(_0x5e9375);const _0x5b908b=new _0x2cae14(_0x5e9375);_0x5b908b['set']({'label':f(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x5b908b['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':f(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x5b908b]}]});}}class Vi extends _0x2be5f1{['conversationStartButton'];['resizeButton'];constructor(_0x8d073f,_0x1ec213){super(_0x8d073f,{'label':f(_0x8d073f,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':ot}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x8d073f),this['children']['add'](this['conversationStartButton']),_0x1ec213&&(this['resizeButton']=ms(_0x8d073f,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x2f2dab){const _0x4edb13=new _0x2cae14(_0x2f2dab);return _0x4edb13['set']({'label':f(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x2acb03,'class':'ck-ai-chat__start-conversation'}),_0x4edb13['on']('execute',()=>{this['fire']('startConversation');}),_0x4edb13;}}class Hi extends _0x40a2ba{constructor(_0x4ecdae){super(_0x4ecdae),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':f(_0x4ecdae,'AI_DISCLAIMER_TEXT')}]}]});}}class nt extends _0x40a2ba{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x5b9fee,_0x262f1a){super(_0x5b9fee),this['_bodyCollection']=new Kt(_0x5b9fee),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Vi(_0x5b9fee,_0x262f1a['showResizeButton']),this['chatHeader']['delegate'](...ht)['to'](this),this['chatFeed']=new Bi(_0x5b9fee,this['_bodyCollection']),this['chatFeed']['delegate'](...ht)['to'](this),this['chatControls']=new Fi(_0x5b9fee,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x262f1a['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...ht)['to'](this),this['chatDisclaimer']=new Hi(_0x5b9fee),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x5b9fee['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x47046d,_0x33ef68,_0x2915c6,_0x532ec9){this['chatControls']['populateSourceResourceBalloon'](_0x47046d,_0x33ef68,_0x2915c6,_0x532ec9);}['closeSourceResourceBalloon'](_0x55c0f7){this['chatControls']['closeSourceResourceBalloon'](_0x55c0f7);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class M extends _0x5cd1ee{static get['requires'](){return[$];}['_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(_0x2cadac){super(_0x2cadac);const _0x5cd9af=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new k(),this['_view']=new nt(this['context']['locale'],{'showResizeButton':_0x5cd9af['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...ht)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x4cb219,{showDiff:_0x31ba67})=>{this['showDiff']=_0x31ba67;}),_0x5cd9af['view']['addTab']({'id':'chat','buttonLabel':f(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':ot,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x2ed541=>_0x2ed541),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x427b2f=>_0x427b2f),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x3f7204){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x3f7204['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':f(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x10ff95,staticMessage:_0x31088e}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x10ff95,'initialContent':'<p>'+_0x31088e+'</p>'});}['addFeedItemUserMessage'](_0x446364){const _0x36b3a3=_0x446364['quickActionData']?.['displayedPrompt']||_0x446364['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x446364['contextItems']['values']()),'initialContent':'<p>'+_0x36b3a3+'</p>','id':_0x446364['id']});}['addFeedItemError']({errorMessage:_0x3d3c91,id:_0x14950a}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x3d3c91+'</p>','id':_0x14950a});}['addFeedItemAIReply'](_0x152055){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x152055['interactionId']+':'+_0x152055['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x16d6ff){const _0x577091=u(this['context']);let _0x311b7d=_0x577091['config']['get']('ai.availableReplyActions')||[...m];if(_0x577091['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x3bbb4c=_0x577091['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x3bbb4c,'value');}}else _0x311b7d=_0x311b7d['filter'](_0x1fd7bb=>'insertSuggestion'!=_0x1fd7bb);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x16d6ff['interactionId']+':'+_0x16d6ff['id'],'areActionsDisabled':_0x16d6ff['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x311b7d}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x31a24f,_0x9c95e9){const _0x59fadb=this['_view']['chatFeed']['children']['last'];if(_0x59fadb instanceof rt)return this['_view']['chatFeed']['children']['remove'](_0x59fadb),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x31a24f['id'],'capabilities':{'isWebSearchEnabled':_0x59fadb['capabilities']['isWebSearchEnabled']||_0x9c95e9['isWebSearchEnabled'],'isReasoningEnabled':_0x59fadb['capabilities']['isReasoningEnabled']||_0x9c95e9['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x31a24f['id'],'capabilities':_0x9c95e9});}['updateFeedInteractionHeader'](_0x137a38){const _0x46ee4d=this['_view']['chatFeed']['children']['find'](_0x5caa39=>_0x5caa39['options']['id']==_0x137a38['id']&&_0x5caa39 instanceof rt);_0x46ee4d&&_0x46ee4d['set']('isVisible',_0x137a38['isVisible']);}async['updateFeedItemAIReplyContent'](_0x45748b){const _0x20454d=_0x45748b['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x47b003=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x45748b,'abortSignal':_0x47b003,'renderingStrategy':_0x20454d}),_0x45748b['isDone']&&this['markFeedItemAsDone'](_0x45748b['id']);});}['updateFeedItemAIReplySources'](_0x22b751,_0x16581e){this['_view']['chatFeed']['updateWebSources'](_0x22b751,_0x16581e);}async['updateFeedItemAIReplySuggestionContent'](_0x8799c7){const _0x5b254c=_0x8799c7['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1ef6e9=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x8799c7,'abortSignal':_0x1ef6e9,'renderingStrategy':_0x5b254c}),_0x8799c7['isDone']&&this['markFeedItemAsDone'](_0x8799c7['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x4d0aac){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4d0aac);}['markFeedItemAsDone'](_0x56c204){this['_view']['chatFeed']['markItemAsDone'](_0x56c204);}['removeFeedInteraction'](_0x66f9a5){this['_view']['chatFeed']['getItemIds']()['filter'](_0x5f29a8=>_0x5f29a8['startsWith'](_0x66f9a5))['forEach'](_0x16ab09=>this['_view']['chatFeed']['removeItem'](_0x16ab09));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x295e5e){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x390308=>_0x390308['startsWith'](_0x295e5e['id']))['forEach'](_0x41cbbf=>this['markFeedItemAsDone'](_0x41cbbf)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x3c72dd,_0x4715f6){this['_view']['chatControls']['addContextItem'](_0x3c72dd,_0x4715f6);}['removeContextItem'](_0x28488e){this['_view']['chatControls']['removeContextItem'](_0x28488e);}['setContextItemLoading'](_0x24ef39,_0x287e68){this['_view']['chatControls']['setContextItemLoading'](_0x24ef39,_0x287e68);}['setIsUploadInProgress'](_0x1427cb){this['_view']['chatControls']['setIsUploadInProgress'](_0x1427cb);}['setConversationContext'](_0x40706f){this['_view']['chatControls']['setConversationContext'](_0x40706f);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x1c668b,_0x2ed726,_0x43336b){this['_view']['chatControls']['updateResourceState'](_0x1c668b,_0x2ed726,_0x43336b);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x364ce6){this['_view']['chatControls']['setAddContextOptions'](_0x364ce6);}['updateCapabilities'](_0x579c85){this['_view']['chatControls']['setWebSearch'](_0x579c85['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x579c85['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x579c85));}['setSelectedModel'](_0x2185ef,_0x463fca){this['_view']['chatControls']['setModel'](_0x2185ef),_0x463fca&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x42fef8){this['feedItemRenderingStrategy']=_0x42fef8;}['toggleLoadingSkeleton'](_0x109504){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x109504);}['resetConversationTitle'](){this['setConversationTitle'](f(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x1c6df8,_0x27a23c=!0x1){if(_0x27a23c&&!at()&&_0x1c6df8['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x1c6df8);this['_view']['chatHeader']['label']=_0x1c6df8;}['setLoadingMessage'](_0x2385c6){const _0x90416=this['_getLoadingMessage'](_0x2385c6);this['_view']['chatFeed']['setLoadingMessage'](_0x90416);}['_animateConversationTitle'](_0x4370c5){let _0x418050=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x4370c5[_0x418050],_0x418050++,_0x418050===_0x4370c5['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x4e8596){this['_view']['chatHeader']['isMaximized']=_0x4e8596;}['_getLoadingMessage'](_0x5ad51f){return _0x5ad51f?_0x5ad51f['isWebSearchEnabled']&&_0x5ad51f['isReasoningEnabled']?f(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x5ad51f['isWebSearchEnabled']?f(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x5ad51f['isReasoningEnabled']?f(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):f(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x5040d8){return _0x5040d8?_0x5040d8['isWebSearchEnabled']&&_0x5040d8['isReasoningEnabled']?f(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x5040d8['isWebSearchEnabled']?f(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x5040d8['isReasoningEnabled']?f(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):f(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):f(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x2d0f4b,_0x5ded46,_0x1bf811,_0x25dc79){this['_view']['populateSourceResourceBalloon'](_0x2d0f4b,_0x5ded46,_0x1bf811,_0x25dc79);}['closeSourceResourceBalloon'](_0x127902){this['_view']['closeSourceResourceBalloon'](_0x127902);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x4f1f18,_0x36a12b){this['_view']['chatFeed']['scrollToSuggestion'](_0x4f1f18,_0x36a12b);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Zi extends _0x4c2bff{['sections'];constructor(_0x59ee83,_0x260615){super(_0x59ee83),this['sections']=_0x260615,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x203ea5){let _0x5609c6=0x0,_0x25e3c7=0x0;for(const _0x3dc556 of this['sections']){const {resultsCount:_0x428c21,totalItemsCount:_0x58135e}=_0x3dc556['filter'](_0x203ea5);_0x5609c6+=_0x428c21,_0x25e3c7+=_0x58135e;}return{'resultsCount':_0x5609c6,'totalItemsCount':_0x25e3c7};}}class $i extends _0x4e528a{['title'];['itemsViews'];['_itemsListView'];constructor(_0x194735,{title:_0x3e9da8,items:_0x3cf584}){super(_0x194735);const _0x24160f=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x3e9da8,this['itemsViews']=_0x3cf584;const _0x57da46=new _0x40a2ba(_0x194735);_0x57da46['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x4c2bff(_0x194735),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x24160f['if']('isVisible','ck-hidden',_0x142b26=>!_0x142b26)]},'children':[_0x57da46,this['_itemsListView']]});}['filter'](_0x4950ba){const _0x4a2750=this['itemsViews']['length'];let _0x4d4547=0x0;for(const _0x5575e9 of this['itemsViews']){if(_0x4950ba){const _0x256edb=_0x5575e9['isMatching'](_0x4950ba);_0x5575e9['isVisible']=!!_0x256edb,_0x5575e9['highlightText'](_0x4950ba);}else _0x5575e9['isVisible']=!0x0,_0x5575e9['highlightText'](null);_0x5575e9['isVisible']&&_0x4d4547++;}return this['isVisible']=_0x4d4547>0x0,{'resultsCount':_0x4d4547,'totalItemsCount':_0x4a2750};}['getItem'](_0x32b149){return this['itemsViews']['find'](_0x4e210c=>_0x4e210c['id']===_0x32b149);}['removeItem'](_0x322c12){const _0x54af2c=this['itemsViews']['indexOf'](_0x322c12);-0x1!==_0x54af2c&&(this['itemsViews']['splice'](_0x54af2c,0x1),this['_itemsListView']['items']['remove'](_0x322c12));}}class _s extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x32275d(_0x4e528a){['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(_0x411562,_0x1842bb){super(_0x411562);const _0x5d2dbb=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x1842bb['pinned']),this['set']('loadingState',null),this['id']=_0x1842bb['id'];const {title:_0x405b73,createdAt:_0x1e57ce,active:_0x27ec4e=!0x1}=_0x1842bb;this['_titleView']=new _0x341a83(),this['_titleView']['text']=_0x405b73,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x12defe=this['_createCheckView'](),_0x1fb708=this['_createPinButtonView'](_0x411562),_0x4d024e=this['_createMenuDropdownView'](),_0x1297df=this['_createEditInputView'](_0x411562,_0x405b73),_0x3de443=this['_createAcceptEditButtonView'](_0x411562,_0x1297df),_0x4bf38a=this['_createCancelEditButtonView'](_0x411562,_0x1297df);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x1fb708),this['actions']['add'](_0x4d024e),this['on']('change:isEdit',(_0x591704,_0x2a4db5,_0x2bd2d3)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x2bd2d3?(this['actions']['add'](_0x3de443),this['actions']['add'](_0x4bf38a),this['mainContent']['add'](_0x1297df),_0x1297df['element']['focus']()):(this['actions']['add'](_0x1fb708),this['actions']['add'](_0x4d024e),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x27ec4e?'ck-ai-chat-history__item--active':'',_0x5d2dbb['if']('isVisible','ck-hidden',_0x4c8753=>!_0x4c8753),_0x5d2dbb['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',_0x5d2dbb['if']('loadingState','ck-hidden',_0x1282f2=>!!_0x1282f2)]},'children':_0x27ec4e?[_0x12defe]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x5d2dbb['if']('loadingState','ck-hidden',_0x39ddad=>!_0x39ddad)]},'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',_0x5d2dbb['if']('loadingState','ck-hidden',_0x577764=>!!_0x577764)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x5d2dbb['if']('loadingState','ck-hidden',_0x977fd3=>!_0x977fd3)]},'children':[{'text':_0x5d2dbb['to']('loadingState',_0x51c028=>_0x51c028?f(this['locale'],_s['LOADING_LABELS'][_0x51c028]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1e57ce]}]},{'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'](_0x17e469){this['_titleView']['text']=Jt(_0x17e469);}['updateLoadingState'](_0x3ff892,_0x1db9fc){this['set']('loadingState',_0x1db9fc?_0x3ff892:null);}['_createCheckView'](){const _0x1fd74c=new _0x5a991c();return _0x1fd74c['set']({'content':_0x54d1a3}),_0x1fd74c;}['_createPinButtonView'](_0x1c981a){const _0x38708a=new _0x2cae14(_0x1c981a);return _0x38708a['set']({'label':f(_0x1c981a,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5b13c5,'withText':!0x1,'tooltip':!0x0}),_0x38708a['bind']('isOn')['to'](this,'pinned'),_0x38708a['on']('execute',()=>{const _0x2338cb=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x2338cb});}),_0x38708a;}['_createMenuDropdownView'](){const _0xb92620=_0x51b8c3(this['locale'],_0x3dbbac),_0x166f49=_0xb92620['panelView']['children'];_0xb92620['buttonView']['set']({'label':f(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x35163a}),_0xb92620['panelPosition']='sw';const _0x148519=new _0x2cae14(this['locale']);_0x148519['label']=f(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x148519['withText']=!0x0,_0x148519['on']('execute',()=>{this['isEdit']=!0x0;});const _0x555dfe=new _0x2cae14(this['locale']);_0x555dfe['label']=f(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x555dfe['withText']=!0x0,_0x555dfe['on']('execute',()=>{this['showConfirm'](f(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x11d58b=new _0x4c2bff(this['locale']),_0x45fba5=new _0x4e528a(this['locale']);_0x45fba5['children']['add'](_0x148519);const _0x47c93a=new _0x4e528a(this['locale']);return _0x47c93a['children']['add'](_0x555dfe),_0x11d58b['items']['addMany']([_0x45fba5,_0x47c93a]),_0x166f49['add'](_0x11d58b),_0xb92620;}['_createEditInputView'](_0x32c73d,_0x56aeb3){const _0x24f5ff=new _0x3049f6(_0x32c73d),_0x19563e=_0x24f5ff['bindTemplate'];return _0x24f5ff['value']=_0x56aeb3,_0x24f5ff['extendTemplate']({'on':{'keydown':_0x19563e['to'](_0x1b5cc5=>{'Enter'==_0x1b5cc5['key']&&this['_commitEditInputValue'](_0x24f5ff);})}}),_0x24f5ff;}['_createAcceptEditButtonView'](_0x1d457d,_0x59db93){const _0x1b0ab1=new _0x2cae14(_0x1d457d);return _0x1b0ab1['set']({'icon':_0x54d1a3,'withText':!0x1,'tooltip':f(_0x1d457d,'AI_CHAT_HISTORY_ACCEPT')}),_0x1b0ab1['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x1b0ab1['on']('execute',()=>{this['_commitEditInputValue'](_0x59db93);}),_0x1b0ab1;}['_commitEditInputValue'](_0x1a80e5){const _0xf9b58d=_0x1a80e5['element']['value']||'';this['_titleView']['text']=_0xf9b58d,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0xf9b58d});}['_createCancelEditButtonView'](_0x45f88e,_0x4459b5){const _0x442bf5=new _0x2cae14(_0x45f88e);return _0x442bf5['set']({'icon':_0x458488,'withText':!0x1,'tooltip':f(_0x45f88e,'AI_CHAT_HISTORY_CANCEL')}),_0x442bf5['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x442bf5['on']('execute',()=>{this['isEdit']=!0x1,_0x4459b5['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x442bf5;}['_createSpinnerView'](){const _0x53f1a2=new je('tiny');return _0x53f1a2['isVisible']=!0x0,_0x53f1a2;}['isMatching'](_0x46979e){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x46979e)?{'title':!0x0}:null;}['highlightText'](_0x4585f2){this['_titleView']['highlightText'](_0x4585f2);}}class ut extends _0x40a2ba{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x944089,_0x296b34){super(_0x944089),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x4efc3d=new _0x2be5f1(_0x944089,{'label':f(_0x944089,'AI_CHAT_HISTORY_HEADING'),'icon':It,'class':'ck-ai-header\x20ck-ai-header_history'});_0x296b34&&(this['resizeButton']=ms(_0x944089,this),_0x4efc3d['children']['add'](this['resizeButton'])),this['sectionsView']=new Zi(_0x944089,[]),this['sectionsView']['delegate'](...ds)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),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':[_0x4efc3d,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x35123f=new _0x593c18(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':f(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x4504f3=>f(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x4504f3),'secondary':f(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x35123f['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x35123f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x841483=>!_0x841483)]}}),_0x35123f;}['_createSkeletonView'](){const _0x5138e7=new be(this['locale'],Ie['aiHistory']);return _0x5138e7['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x1eaede=>!_0x1eaede)]}}),_0x5138e7;}['_createErrorView'](){const _0x4429e6=new _0x40a2ba(this['locale']),_0x31a9e5=new _0x2cae14(this['locale']);return _0x31a9e5['set']({'withText':!0x1,'icon':_0x458488,'class':'ck-ai-chat-error__dismiss-button'}),_0x31a9e5['bind']('isVisible')['to'](this,'hasItems',_0x9b626e=>!!_0x9b626e),_0x31a9e5['on']('execute',()=>{this['errorMessage']='';}),_0x4429e6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x1e44ab=>!_0x1e44ab)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x31a9e5]}),_0x4429e6;}['_createEmptyStateView'](){const _0x3c0220=new _0x2cae14(this['locale']);_0x3c0220['set']({'label':f(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x2acb03,'class':'ck-ai-chat__start-conversation'}),_0x3c0220['on']('execute',()=>{this['fire']('openChat');});const _0x3ca054=new _0x40a2ba(this['locale']);return _0x3ca054['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3beda9=>!_0x3beda9)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[f(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x3c0220]}),_0x3ca054;}['_createListItemViews'](_0x22e923,_0x159bad){const _0x47bb69=[];for(const _0x2ee74b of _0x22e923){const _0x1cedc5=new _s(_0x159bad,_0x2ee74b);_0x1cedc5['delegate'](...ds)['to'](this),_0x47bb69['push'](_0x1cedc5);}return _0x47bb69;}['updateHistoryItemsWithCategories'](_0x46f6c7){const _0x41ae9f=this['locale']||'en',_0x4aa61d=[];for(const _0x3eeb57 of _0x46f6c7){const _0x3bedd7=this['_createListItemViews'](_0x3eeb57['items'],_0x41ae9f);_0x4aa61d['push'](new $i(_0x41ae9f,{'title':_0x3eeb57['title'],'items':_0x3bedd7}));}this['sectionsView']['sections']=_0x4aa61d,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x4aa61d),this['hasItems']=_0x46f6c7['some'](_0x8abd1b=>_0x8abd1b['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x31d3ef){for(const _0x586e2c of this['sectionsView']['sections']){const _0x4850d9=_0x586e2c['getItem'](_0x31d3ef);if(_0x4850d9){if(_0x586e2c['removeItem'](_0x4850d9),0x0===_0x586e2c['itemsViews']['length']){const _0x567ce1=this['sectionsView']['sections']['indexOf'](_0x586e2c);-0x1!==_0x567ce1&&(this['sectionsView']['sections']['splice'](_0x567ce1,0x1),this['sectionsView']['items']['remove'](_0x586e2c));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x1dc12b,_0x3f6d43){for(const _0x4b37da of this['sectionsView']['sections']){const _0x5b6716=_0x4b37da['getItem'](_0x1dc12b);if(_0x5b6716){_0x5b6716['updateTitle'](_0x3f6d43);break;}}}['updateItemLoadingState'](_0x3c9ee2,_0xc12da2,_0x418604){for(const _0x50a9a2 of this['sectionsView']['sections']){const _0x35a541=_0x50a9a2['getItem'](_0x3c9ee2);if(_0x35a541){_0x35a541['updateLoadingState'](_0xc12da2,_0x418604);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x8f1df8=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x8f1df8);}}}const ds=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class mt extends _0x5cd1ee{static get['requires'](){return[$];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2c5876){super(_0x2c5876);const _0x5d7f5f=this['context']['plugins']['get']('AITabs');this['_historyView']=new ut(this['context']['locale'],_0x5d7f5f['showResizeButton']),this['_historyView']['delegate'](...ds)['to'](this),_0x5d7f5f['view']['addTab']({'id':'history','buttonLabel':f(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':It,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x14e81f){this['_historyView']['removeHistoryItem'](_0x14e81f);}['updateItems'](_0x3e7c64){this['_historyView']['updateHistoryItemsWithCategories'](_0x3e7c64);}['updateItemTitle'](_0xaf6df2,_0x371225){this['_historyView']['updateItemTitle'](_0xaf6df2,_0x371225);}['updateItemLoadingState'](_0x3496f1,_0x17b159,_0x4e095b){this['_historyView']['updateItemLoadingState'](_0x3496f1,_0x17b159,_0x4e095b);}['setLoadingSkeleton'](_0x3c7603){this['_historyView']['isLoading']=_0x3c7603;}['showError'](_0x3a2b1b){this['_historyView']['errorMessage']=_0x3a2b1b;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x206150){this['_historyView']['isMaximized']=_0x206150;}}class De extends $t(){['id'];['createdAt'];constructor({id:_0x506696,title:_0x57da1e,createdAt:_0x16eb97,updatedAt:_0x48b0bb,pinned:_0x250057}){super(),this['id']=_0x506696,this['createdAt']=new Date(_0x16eb97),this['set']('title',_0x57da1e),this['set']('updatedAt',_0x48b0bb?new Date(_0x48b0bb):null),this['set']('pinned',_0x250057||!0x1);}['updateTitle'](_0x375a6b){this['set']('title',Jt(_0x375a6b)),this['updatedAt']=new Date();}['updatePinned'](_0x39ad7a){this['set']('pinned',_0x39ad7a),this['updatedAt']=new Date();}}class _t extends _0xd790fa(){['items']=[];['connector'];['group'];constructor({connector:_0x43eb2b,group:_0x382c3d}){super(),this['connector']=_0x43eb2b,this['group']=_0x382c3d;}async['init'](){try{const _0x2e18e3=this['connector']['fetchConversations'](this['group']),_0x23bf26=await _0x2e18e3['getConversations']();this['loadItems'](_0x23bf26);}catch(_0x1310e8){this['fire']('error',{'error':_0x1310e8,'operation':'init'});}}['addItem'](_0x15f67b){this['items']['push'](_0x15f67b);}async['removeItem'](_0x34142e){const _0x5ae138=this['items']['findIndex'](_0x2071cc=>_0x2071cc['id']===_0x34142e);if(-0x1===_0x5ae138)return!0x1;try{return await this['connector']['deleteConversation'](_0x34142e)['execute'](),this['items']['splice'](_0x5ae138,0x1),this['fire']('itemRemoved',{'itemId':_0x34142e}),!0x0;}catch(_0x5c306f){return this['fire']('error',{'error':_0x5c306f,'operation':'removeItem','itemId':_0x34142e}),!0x1;}}['getItem'](_0xcf8995){return this['items']['find'](_0x41dbbe=>_0x41dbbe['id']===_0xcf8995);}async['updateItemTitle'](_0x38e441,_0x82b7ac){const _0x1eb62e=this['getItem'](_0x38e441);if(!_0x1eb62e)return!0x1;try{return await this['connector']['updateConversation'](_0x38e441,{'title':_0x82b7ac})['getResult'](),_0x1eb62e['updateTitle'](_0x82b7ac),this['fire']('itemUpdated',{'itemId':_0x38e441,'updates':{'title':_0x82b7ac}}),!0x0;}catch(_0x58b2f0){return this['fire']('error',{'error':_0x58b2f0,'operation':'updateItemTitle','itemId':_0x38e441}),!0x1;}}async['updateItemPinned'](_0x2b00e9,_0x4a0ffb){const _0x33cd05=this['getItem'](_0x2b00e9);if(!_0x33cd05)return!0x1;try{return await this['connector']['updateConversation'](_0x2b00e9,{'pinned':_0x4a0ffb})['getResult'](),_0x33cd05['updatePinned'](_0x4a0ffb),this['fire']('itemUpdated',{'itemId':_0x2b00e9,'updates':{'pinned':_0x4a0ffb}}),!0x0;}catch(_0x5dcd54){return this['fire']('error',{'error':_0x5dcd54,'operation':'updateItemPinned','itemId':_0x2b00e9}),!0x1;}}['loadItems'](_0x1b0897){try{this['items']=[],_0x1b0897['map'](_0x467a5a=>{this['addItem'](new De(_0x467a5a));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x9abde4){this['fire']('error',{'error':_0x9abde4,'operation':'loadItems'});}}['getItems'](_0x58b582={}){const _0x16145b=void 0x0!==_0x58b582['pinned']&&_0x58b582['pinned'],_0x307210=_0x58b582['from']?new Date(_0x58b582['from']['getFullYear'](),_0x58b582['from']['getMonth'](),_0x58b582['from']['getDate']()):null,_0x29a5af=_0x58b582['to']?new Date(_0x58b582['to']['getFullYear'](),_0x58b582['to']['getMonth'](),_0x58b582['to']['getDate']()):null;return this['items']['filter'](_0x31b844=>{if(_0x31b844['pinned']!==_0x16145b)return!0x1;if(_0x29a5af){const _0x4cb65b=new Date(_0x31b844['createdAt']['getFullYear'](),_0x31b844['createdAt']['getMonth'](),_0x31b844['createdAt']['getDate']());return _0x307210?_0x307210['getTime']()===_0x29a5af['getTime']()?_0x4cb65b['getTime']()===_0x307210['getTime']():_0x4cb65b<_0x29a5af&&_0x4cb65b>=_0x307210:_0x4cb65b<_0x29a5af;}return!0x0;});}}class ct extends _0x5cd1ee{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[o,q,mt,$];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](o),this['_aiChatHistoryUi']=this['context']['plugins']['get'](mt),this['_aiChatController']=this['context']['plugins']['get'](q);const _0x4325c6=this['context']['plugins']['get']($),_0x22751f=this['_aiChatController']['getGroupId']();this['history']=new _t({'connector':this['_aiConnector'],'group':_0x22751f}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x593397,_0x21f682)=>{this['_setItemLoading'](_0x21f682['id'],'remove'),this['_handleRemove'](_0x21f682['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x15fa01,_0x5aac1e)=>{this['_setItemLoading'](_0x5aac1e['id'],'rename'),this['_handleEditTitle'](_0x5aac1e['id'],_0x5aac1e['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x3ccabc,_0x48d976)=>{void 0x0!==_0x48d976['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x48d976['itemId'],_0x48d976['updates']['title']),void 0x0!==_0x48d976['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x48d976['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4ddd73,_0x1d9450)=>{this['_aiChatController']['handleRemovedConversation'](_0x1d9450['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x1d9450['itemId']),this['_clearItemLoading'](_0x1d9450['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x1b1a62,_0x3f49c7)=>{this['_handleHistoryErrorUI'](_0x3f49c7['error'],_0x3f49c7['operation'],_0x3f49c7['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x53df24,_0x3dc7f8)=>{this['_handleSelectConversation'](_0x3dc7f8['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0xee1015,_0x580f69)=>{const _0x338c24=_0x580f69['pinned']?'pin':'unpin';this['_setItemLoading'](_0x580f69['id'],_0x338c24),this['_handleTogglePin'](_0x580f69['id'],_0x580f69['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x4325c6['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x4325c6['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x4325c6,'resizedTabs',(_0x438f96,_0x5f35f0)=>{this['_setIsMaximized'](_0x5f35f0);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x4325c6['resize']();});}async['_handleEditTitle'](_0x17a4c6,_0x36a682){await this['history']['updateItemTitle'](_0x17a4c6,_0x36a682);}async['_handleTogglePin'](_0x2653e9,_0x1b6454){await this['history']['updateItemPinned'](_0x2653e9,_0x1b6454);}async['_handleRemove'](_0x9596af){await this['history']['removeItem'](_0x9596af);}async['_handleSelectConversation'](_0x30b00a){await this['_aiChatController']['loadConversation'](_0x30b00a);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x32f8d1=this['_aiChatController']['activeConversation']?.['id'],_0x5e190d=this['_getCategorizedItems']()['map'](_0x18c627=>({'title':_0x18c627['title'],'items':_0x18c627['items']['map'](_0x3aba80=>({'id':_0x3aba80['id'],'title':_0x3aba80['title']||f(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x3aba80['createdAt'])['toLocaleDateString'](),'active':_0x3aba80['id']===_0x32f8d1,'pinned':_0x3aba80['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x5e190d);}['_setItemLoading'](_0x49e00e,_0x4c358c){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x49e00e,_0x4c358c,!0x0);}['_clearItemLoading'](_0x2a0204){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2a0204,null,!0x1);}['_handleHistoryErrorUI'](_0x430bcd,_0x5d6a1c,_0x2a1fcc){const _0x49f9a8=this['_generateErrorMessage'](_0x5d6a1c,_0x2a1fcc);this['_aiChatHistoryUi']['showError'](_0x49f9a8),_0x2a1fcc&&this['_clearItemLoading'](_0x2a1fcc),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x17f6e8,_0x3d9f2a){const _0xfd78a0=_0x3d9f2a?this['history']['getItem'](_0x3d9f2a):null,_0x39ebf0=_0xfd78a0?.['title']||f(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x17f6e8){case'updateItemTitle':return f(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x39ebf0);case'updateItemPinned':{const _0x160d94=f(this['context']['locale'],_0xfd78a0?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return f(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x160d94,_0x39ebf0]);}case'removeItem':return f(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x39ebf0);case'init':case'loadItems':return f(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return f(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0xe0379c=new Date(),_0x3594aa=new Date(_0xe0379c['getFullYear'](),_0xe0379c['getMonth'](),_0xe0379c['getDate']()),_0x3b0d0c=new Date(_0x3594aa);_0x3b0d0c['setDate'](_0x3b0d0c['getDate']()-0x1);const _0x735708=new Date(_0x3594aa);_0x735708['setDate'](_0x735708['getDate']()-0xe);const _0x153c5a=this['history']['getItems']({'pinned':!0x0}),_0x53975b=this['history']['getItems']({'from':_0x3594aa,'to':_0x3594aa}),_0x179ded=this['history']['getItems']({'from':_0x3b0d0c,'to':_0x3b0d0c}),_0x352c4c=this['history']['getItems']({'from':_0x735708,'to':_0x3b0d0c}),_0x14b0bd=this['history']['getItems']({'to':_0x735708}),_0x567b52=[];return _0x153c5a['length']>0x0&&_0x567b52['push']({'title':f(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x153c5a}),_0x53975b['length']>0x0&&_0x567b52['push']({'title':f(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x53975b}),_0x179ded['length']>0x0&&_0x567b52['push']({'title':f(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x179ded}),_0x352c4c['length']>0x0&&_0x567b52['push']({'title':f(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x352c4c}),_0x14b0bd['length']>0x0&&_0x567b52['push']({'title':f(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x14b0bd}),_0x567b52;}['_setIsMaximized'](_0x2bb931){this['_aiChatHistoryUi']['setIsMaximized'](_0x2bb931);}}class F extends _0x5cd1ee{static get['requires'](){return[ct,mt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ua extends _0x5cd1ee{static get['requires'](){return[q,s,M,F];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3db152){super(_0x3db152),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](q)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](q)['startConversation']();}async['sendMessage']({message:_0x5bf526,quickActionData:_0xf3dd01}){await this['context']['plugins']['get'](q)['sendMessage']({'message':_0x5bf526,'quickActionData':_0xf3dd01});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](q)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](q)['focusPromptInput']();}}class co extends At{constructor(_0x4448f4){super(_0x4448f4);const _0x3b59d6=_0x4448f4['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x3b59d6,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0xabf3b3=this['editor']['plugins']['get']('AITabs')['view'];_0xabf3b3['isVisible']=!_0xabf3b3['isVisible'];}}class bt extends _0x50e8f9{static get['requires'](){return[$];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1790d5=this['editor'];_0x1790d5['commands']['add']('toggleAi',new co(_0x1790d5)),_0x1790d5['ui']['componentFactory']['add']('toggleAi',()=>{const _0x19f742=this['_createAIUIButton'](_0x2cae14);return _0x19f742['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x19f742;}),_0x1790d5['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x29346b=this['_createAIUIButton'](_0x1ba614);return _0x29346b['set']({'role':'menuitemcheckbox'}),_0x29346b;});}['_createAIUIButton'](_0x3903fe){const _0x17dddf=this['editor'],_0x28035c=_0x17dddf['commands']['get']('toggleAi'),_0x2a9945=new _0x3903fe(_0x17dddf['locale']);return _0x2a9945['set']({'label':f(_0x17dddf['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x5cc373,'isToggleable':!0x0}),_0x2a9945['bind']('isEnabled')['to'](_0x28035c),_0x2a9945['bind']('isOn')['to'](_0x28035c,'value',_0x389037=>!!_0x389037),this['listenTo'](_0x2a9945,'execute',()=>{_0x28035c['execute']();}),_0x2a9945;}}class Va extends _0x50e8f9{static get['requires'](){return[bt,kt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Pt(_0x37d344,_0x284b8e,_0x43f42d=!0x1,_0x4b2c91=!0x0,_0x12a53d=!0x0){return()=>{const _0x16c0fc=_0x37d344['locale'],_0x4b4b23=new _0x2cae14(_0x16c0fc),_0x3e1cfe=_0x4b4b23['bindTemplate'];_0x12a53d&&_0x4b4b23['extendTemplate']({'on':{'mouseenter':_0x3e1cfe['to'](()=>{_0x4b4b23['focus']();})}});const _0x227d49=_0x284b8e['icon']??_0x284b8e['parent']?.['icon'];return _0x4b4b23['set']({'label':_0x284b8e['displayedPrompt'],'withText':_0x43f42d,'role':'menuitem','icon':_0x4b2c91?_0x227d49??_0x287cd1:void 0x0,'tooltip':!_0x43f42d,'class':'ck-ai-quick-actions-button'}),_0x4b4b23['on']('execute',()=>{_0x37d344['editing']['view']['focus'](),_0x37d344['commands']['execute']('aiQuickAction',_0x284b8e);}),_0x4b4b23;};}const ys='menu',vs='menuitem';class ao extends _0x40a2ba{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x2b64b4,_0x475843,_0x24231e,_0x2c5154){const _0x2a7df2=_0x2b64b4['locale'];super(_0x2a7df2),this['_bodyCollection']=_0x2c5154;const _0x3426dd=this['_createListItems'](_0x2b64b4,_0x475843,_0x24231e);this['optionsListView']=new _0x4c2bff(_0x2a7df2),this['optionsListView']['role']=ys,this['optionsListView']['items']['addMany'](_0x3426dd),this['focusTracker']=new Bt(),this['keystrokes']=new jt(),this['_focusables']=_0x3426dd,this['focusCycler']=new Vt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x2a7df2['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x1b7655,_0x1d480a,_0x5376ff){const _0x50bcf0=new _0x23b83b();return _0x1d480a['forEach'](_0x4c622e=>{'actions'in _0x4c622e?_0x50bcf0['add'](this['_createActionGroupButton'](_0x1b7655,_0x4c622e,_0x5376ff)):_0x50bcf0['add'](this['_createActionButton'](_0x1b7655,_0x4c622e));}),_0x50bcf0;}['_createActionButton'](_0x25bc2a,_0x24742e){const _0x4e9e9d=new _0x4e528a(this['locale']),_0x15a1f7=Pt(_0x25bc2a,_0x24742e,!0x0,void 0x0!==_0x24742e['icon'])();return _0x4e9e9d['children']['add'](_0x15a1f7),_0x4e9e9d;}['_createActionGroupButton'](_0x1a8683,_0x346fc2,_0x546551){const _0x2f5561=new _0x4e528a(this['locale']),_0x2648bb=new _0x2db1a8(this['locale']),_0x54f238=_0x2648bb['bindTemplate'],_0x51241f='rtl'===_0x546551['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x2f64ac=this['_createGroupActionsList'](_0x1a8683,_0x346fc2['actions'],_0x546551);_0x2648bb['set']({'label':_0x346fc2['label'],'withText':!0x0,'role':vs,'icon':_0x346fc2['icon']??_0x287cd1}),_0x2648bb['extendTemplate']({'on':{'mouseenter':_0x54f238['to'](()=>{_0x2648bb['focus']();})}});const _0x4afc10=new _0x1c3e7b(this['locale']);return _0x4afc10['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x54f238['to'](_0x1fbd11=>{_0x1fbd11['key']==_0x51241f&&(_0x2648bb['focus'](),this['_hideNestedPanel'](_0x4afc10));})}}),_0x2648bb['bind']('isOn')['to'](_0x4afc10,'isVisible'),this['_bodyCollection']['add'](_0x4afc10),_0x4afc10['content']['add'](_0x2f64ac),this['_setupGroupMenuBehavior'](_0x2648bb,_0x4afc10),_0x2f5561['children']['add'](_0x2648bb),_0x2f5561;}['_createGroupActionsList'](_0x59e134,_0x4fa5b9,_0x10587c){const _0x2f21e8=new _0x4c2bff(this['locale']);return _0x2f21e8['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x4fa5b9['forEach'](_0x17d4bb=>{const _0x515da2=new _0x4e528a(this['locale']),_0x3c4de7=Pt(_0x59e134,_0x17d4bb,!0x0,!0x1)();_0x515da2['children']['add'](_0x3c4de7),_0x10587c['focusTracker']['add'](_0x3c4de7),_0x2f21e8['items']['add'](_0x515da2);}),_0x2f21e8;}['_setupGroupMenuBehavior'](_0x2e1b31,_0x2ef180){const _0x38e3ae=_0x2e1b31['bindTemplate'],_0x2e880e='rtl'===_0x2e1b31['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x2e1b31['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x38e3ae['to'](()=>{this['_showNestedPanel'](_0x2ef180,_0x2e1b31);}),'mouseleave':_0x38e3ae['to'](_0x5fe528=>{const _0x126e9a=_0x5fe528['relatedTarget'];this['_isMovingToNestedMenu'](_0x126e9a,_0x2ef180)||this['_hideNestedPanel'](_0x2ef180);}),'keydown':_0x38e3ae['to'](_0x32b953=>{_0x32b953['key']==_0x2e880e&&(this['_showNestedPanel'](_0x2ef180,_0x2e1b31),_0x2ef180['content']['get'](0x0)['focus']());})}}),_0x2ef180['on']('render',()=>{_0x2ef180['element']?.['addEventListener']('mouseleave',_0x4ed1fa=>{const _0xb7cb0a=_0x4ed1fa['relatedTarget'];_0x2e1b31['element']?.['contains'](_0xb7cb0a)||this['_isMovingToNestedMenu'](_0xb7cb0a,_0x2ef180)||this['_hideNestedPanel'](_0x2ef180);});});}['_showNestedPanel'](_0x2bce1f,_0x377f09){this['_openNestedPanels']['forEach'](_0x34c32e=>{_0x34c32e!==_0x2bce1f&&_0x34c32e['isVisible']&&_0x34c32e['hide']();}),_0x2bce1f['show'](),_0x2bce1f['pin']({'positions':[_0x5b7d26['eastSouth']],'target':_0x377f09['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2bce1f);}['_hideNestedPanel'](_0x51425e){_0x51425e['hide'](),this['_openNestedPanels']['delete'](_0x51425e);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x4c78ad=>_0x4c78ad['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x55e664,_0x58f977){if(!_0x55e664)return!0x1;if(_0x58f977['element']?.['contains'](_0x55e664))return!0x0;const _0x164ac1=_0x55e664;return _0x164ac1['closest']&&(null!==_0x164ac1['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x164ac1['closest']('.ck-ai-quick-actions-group-list')||null!==_0x164ac1['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function vt(_0x56e4cf,_0x453313,_0x2579a1,_0x579ddf){return()=>{const _0x4f285b=_0x56e4cf['locale'],_0x259645=_0x51b8c3(_0x4f285b);_0x259645['buttonView']['set']({'icon':_0x2579a1['icon']??_0x287cd1,'label':_0x2579a1['label'],'tooltip':!0x0}),_0x259645['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x45bccf=new ao(_0x56e4cf,_0x453313,_0x259645,_0x579ddf);return _0x259645['panelView']['children']['add'](_0x45bccf),_0x259645;};}const Mt='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\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).Avoid\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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Lt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Dt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Nt=function(_0x36eeea){return _0x36eeea['CHAT']='CHAT',_0x36eeea['ACTION']='ACTION',_0x36eeea['REVIEW']='REVIEW',_0x36eeea;}({}),Ga=function(_0x5a69bd){return _0x5a69bd['CHAT']='AIChat',_0x5a69bd['ACTION']='AIActions',_0x5a69bd['REVIEW']='AIReviewMode',_0x5a69bd;}({});class gi extends _0x50e8f9{static get['requires'](){return[Rt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x4f95b6){return function(_0x5caa56){const _0x1f0192=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x5caa56['uiLanguage']),_0x3ce73d=_0x1f0192||'English',_0x5df6d2=[{'id':'ask-ai','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Qt},{'id':'chat-commands','label':f(_0x5caa56,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Qt,'actions':[{'id':'explain','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Mt['replace']('%0',_0x3ce73d),'type':'CHAT'},{'id':'summarize','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Lt['replace']('%0',_0x3ce73d),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Dt['replace']('%0',_0x3ce73d),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Ot},{'id':'continue','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':St},{'id':'fix-grammar','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':xt},{'id':'adjust-length','label':f(_0x5caa56,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':yt,'actions':[{'id':'make-shorter','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':f(_0x5caa56,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Tt,'actions':[{'id':'make-tone-casual','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':f(_0x5caa56,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Ut,'actions':[{'id':'translate-to-english','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':f(_0x5caa56,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':f(_0x5caa56,'AI_QUICK_ACTIONS_OTHER'),'icon':Et,'actions':[]}];return _0x5df6d2;}(_0x4f95b6);}['_getDefaultAndCustomActions'](){const _0x560983=gi['getDefaultQuickActions'](this['editor']['locale']),_0x406183=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x30f9bb=>({..._0x30f9bb,'icon':void 0x0}));return _0x560983['find'](_0x4173fb=>'other'===_0x4173fb['id'])['actions']['push'](..._0x406183),_0x560983;}['_initializeQuickActionsComponentsAndCommands'](){const _0xb174e6=new Kt(this['editor']['locale']);_0xb174e6['attachToDom'](),this['_initializeQuickActionsDropdown'](_0xb174e6),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0xb174e6);}['_initializeQuickActionsDropdown'](_0x19ad89){this['editor']['ui']['componentFactory']['add']('aiQuickActions',vt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x287cd1,'label':f(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x19ad89));}['_prepareQuickActionsDefinition'](_0x105774){this['_quickActionsDefinition']=_0x105774['map'](_0x4fe806=>{if('actions'in _0x4fe806){const _0x29e184=_0x4fe806;return{..._0x29e184,'actions':_0x29e184['actions']['map'](_0x173124=>{const {actions:_0xf67f28,..._0x2094c7}=_0x29e184;return{..._0x173124,'parent':_0x2094c7};})['filter'](_0x3c416d=>this['_shouldIncludeAction'](_0x3c416d))};}return _0x4fe806;})['filter'](_0x4b63ab=>'actions'in _0x4b63ab?_0x4b63ab['actions']['length']>0x0:this['_shouldIncludeAction'](_0x4b63ab));}['_shouldIncludeAction'](_0x48a888){const _0x1f738e=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ga[_0x48a888['type']])&&!_0x1f738e['includes'](_0x48a888['id']);}['_initializeQuickActionsComponents'](_0x34b50f){this['_quickActionsDefinition']['forEach'](_0xe983df=>{if('actions'in _0xe983df){const _0x4eb4ee=vt(this['editor'],_0xe983df['actions'],_0xe983df,_0x34b50f);this['editor']['ui']['componentFactory']['add'](_0xe983df['id'],_0x4eb4ee),_0xe983df['actions']['forEach'](_0x39be67=>{const _0x6e1b79=Pt(this['editor'],_0x39be67);this['editor']['ui']['componentFactory']['add'](_0x39be67['id'],_0x6e1b79);});}else{const _0x57e02a=Pt(this['editor'],_0xe983df,!0x1,!0x0,!0x1);this['editor']['ui']['componentFactory']['add'](_0xe983df['id'],_0x57e02a);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x2fe84a=>{const _0x54261b=new _0x12b236(_0x2fe84a),_0x1f5271=f(_0x2fe84a,'AI_QUICK_ACTIONS_HEADING');_0x54261b['buttonView']['set']({'label':_0x1f5271,'icon':_0x287cd1});const _0x3e7940=new _0x56a913(_0x2fe84a);_0x3e7940['set']({'ariaLabel':_0x1f5271,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x229161=>{if('actions'in _0x229161){const _0x30cf9f=_0x229161,_0x103999=new _0x4d0048(_0x2fe84a,_0x54261b),_0x15a73b=new _0x12b236(_0x2fe84a),_0x11541c=new _0x56a913(_0x2fe84a);_0x15a73b['buttonView']['set']({'label':_0x30cf9f['label'],'icon':_0x30cf9f['icon']}),_0x30cf9f['actions']['forEach'](_0x88bb5e=>{const _0x284451=new _0x4d0048(_0x2fe84a,_0x15a73b),_0x3d9c9d=new _0x1ba614(_0x2fe84a);_0x3d9c9d['set']({'label':_0x88bb5e['displayedPrompt'],'icon':_0x88bb5e['icon'],'role':'menuitem'}),_0x3d9c9d['on']('execute',()=>{this['_executeQuickAction'](_0x88bb5e);}),_0x3d9c9d['delegate']('execute')['to'](_0x15a73b),_0x284451['children']['add'](_0x3d9c9d),_0x11541c['items']['add'](_0x284451);}),_0x15a73b['panelView']['children']['add'](_0x11541c),_0x103999['children']['add'](_0x15a73b),_0x3e7940['items']['add'](_0x103999);}else{const _0x14913f=_0x229161,_0x5c8f20=new _0x4d0048(_0x2fe84a,_0x54261b),_0x601b84=new _0x1ba614(_0x2fe84a);_0x601b84['set']({'label':_0x14913f['displayedPrompt'],'icon':_0x14913f['icon'],'role':'menuitem'}),_0x601b84['on']('execute',()=>{this['_executeQuickAction'](_0x14913f);}),_0x601b84['delegate']('execute')['to'](_0x54261b),_0x5c8f20['children']['add'](_0x601b84),_0x3e7940['items']['add'](_0x5c8f20);}});const _0x4d6703=Object['values'](Ga)['some'](_0x52a992=>this['editor']['plugins']['has'](_0x52a992));return _0x54261b['set']({'isEnabled':_0x4d6703}),_0x54261b['panelView']['children']['add'](_0x3e7940),_0x54261b;});}['_executeQuickAction'](_0x203337){const _0x1b8dc2=this['editor'];_0x1b8dc2['editing']['view']['focus'](),_0x1b8dc2['commands']['execute']('aiQuickAction',_0x203337);const _0x30cf4c=_0x1b8dc2['ui']['view']['menuBarView'];_0x30cf4c&&_0x30cf4c['close']&&_0x30cf4c['close']();}}class Ii extends At{['execute'](_0xf4dccb){switch(this['_expandSelectionIfCollapsed'](),_0xf4dccb['type']){case Nt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x337956=f(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x2e27f1('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x337956});}this['_handleAIChatAction'](_0xf4dccb);break;case Nt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x4f5fd1=f(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x2e27f1('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4f5fd1});}this['_handleAIActionsAction'](_0xf4dccb);break;case Nt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x5a2e56=f(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x2e27f1('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5a2e56});}this['_handleAIReviewAction'](_0xf4dccb);}}async['_handleAIChatAction'](_0x32a853){const _0xa266d1=this['editor']['plugins']['get']('AIChat'),_0xb74613=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x32a853['id'])_0xb74613['removeSelectionFromChatContext'](),await _0xa266d1['addSelectionToChatContext'](),_0xa266d1['focusPromptInput']();else await _0xa266d1['startConversation'](),_0xb74613['removeSelectionFromChatContext'](),await _0xa266d1['addSelectionToChatContext'](),_0xa266d1['focusPromptInput'](),await _0xa266d1['sendMessage']({'message':_0x32a853['prompt']||_0x32a853['displayedPrompt'],'quickActionData':{'id':_0x32a853['id'],'displayedPrompt':_0x32a853['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x4c0761=this['editor'],_0x231eb2=_0x4c0761['model']['document']['selection'];if(!_0x231eb2['isCollapsed'])return;const _0x504ecf=_0x494347(_0x231eb2['getSelectedBlocks']())||_0x4c0761['model']['schema']['getLimitElement'](_0x231eb2);_0x4c0761['model']['change'](_0x483cb5=>{_0x483cb5['setSelection'](_0x504ecf,'in');});}['_handleAIActionsActionLabel'](_0x5f2f6a){return _0x5f2f6a['parent']?.['label']&&'other'!==_0x5f2f6a['parent']?.['id']?_0x5f2f6a['parent']['label']+':\x20'+_0x5f2f6a['displayedPrompt']:_0x5f2f6a['displayedPrompt'];}async['_handleAIActionsAction'](_0x32ae56){const _0xa2650f=this['editor']['plugins']['get']('AIActions'),_0x47b24a=_0x32ae56['prompt']?{'userMessage':_0x32ae56['prompt'],'model':_0x32ae56['model']}:{'actionName':_0x32ae56['actionName']||_0x32ae56['id'],'args':_0x32ae56['args']},_0x57b5cd=this['_handleAIActionsActionLabel'](_0x32ae56);await _0xa2650f['executeAction'](_0x47b24a,_0x57b5cd,_0x32ae56['icon']);}async['_handleAIReviewAction'](_0x14d11b){console['log']('handleAIReviewAction',_0x14d11b);}}class ki extends _0x50e8f9{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xae97ce=this['editor'],_0x1533ea=new Ii(this['editor']);if(_0xae97ce['commands']['add']('aiQuickAction',_0x1533ea),_0xae97ce['plugins']['has']('AIChat')){const _0x5e2d31=this['editor']['plugins']['get']('AIChat');_0xae97ce['model']['document']['selection']['on']('change:range',(_0x36cefd,_0x3288a9)=>{_0x3288a9['directChange']&&_0x5e2d31['removeSelectionFromChatContext']();});}}}class Gt extends pe{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x1050d5=this['documentContextContent']['children']['map'](_0x146bfe=>({'node':_0x146bfe,'id':Z(_0x146bfe,'data-id')})),_0x5e2b5d=this['parsedMergedContent']['children']['map'](_0x39c93c=>({'node':_0x39c93c,'id':Z(_0x39c93c,'data-id')||_0x4fd5c3()})),_0x2c34a9=_0x572818(_0x1050d5,_0x5e2b5d,{'comparator':(_0x2afd7c,_0xcd6b2)=>_0x2afd7c['id']==_0xcd6b2['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x2c34a9['length']&&_0x2c34a9[_0x2c34a9['length']-0x1]['removed'];)_0x2c34a9['pop']();}const _0x2c0454=_0x2c34a9['map'](_0x3068aa=>{const _0x4fec74=_0x3068aa['added']?'new':_0x3068aa['removed']?'removed':'modified';return{'node':_0x3068aa['value'][0x0]['node'],'type':_0x4fec74,'id':_0x3068aa['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x2c0454,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x2b528b,_0x2f76e6){return _0x2f76e6;}}class I extends qt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x217d71){super(_0x217d71),this['content']=_0x217d71['content'],this['version']=_0x217d71['version'],this['actionName']=_0x217d71['actionName'],this['args']=_0x217d71['args'],this['userMessage']=_0x217d71['userMessage'],this['model']=_0x217d71['model'];}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':zt['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x54124f){const _0x1edd25=new Gt({'editor':this['editor'],'documentContextContent':this['content'],..._0x54124f});return this['replies']['push'](_0x1edd25),_0x1edd25['delegate'](...Ft)['to'](this),this['fire']('replyCreated',_0x1edd25),_0x1edd25;}}class ji extends _0x50e8f9{static get['requires'](){return[o,_0x32f076,s,N,_0x5f0575];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x23b83b();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x4460d5){super(_0x4460d5),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new k(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x3122f7,_0x3404dc,_0x461baf){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x202ee0,anchorData:_0x1ed994}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x3122f7,_0x202ee0,_0x1ed994,_0x3404dc,_0x461baf);}}const {modelFragment:_0x404feb,anchorData:_0x3a3412}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x3122f7,_0x404feb,_0x3a3412,_0x3404dc,_0x461baf);}['_getExecuteDataRegular'](){const _0x18eba7=this['editor']['model']['document']['selection'];if(_0x18eba7['isCollapsed']){const _0x7a762a=_0x494347(_0x18eba7['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x18eba7);this['editor']['model']['change'](_0x27a26e=>{_0x27a26e['setSelection'](_0x7a762a,'in');});}const _0x49f0ce=_0x18eba7['getFirstRange'](),_0x3a92d6=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x18eba7),_0x49f0ce['start'],_0x49f0ce['end']),_0x202f61=_0x18eba7['getFirstRange']()['start'],_0x4a87b9=new Map();let _0x46e902=_0x3a92d6;for(let _0x5ad56d=0x0;_0x5ad56d<_0x202f61['path']['length'];_0x5ad56d++)_0x4a87b9['set'](_0x46e902,_0x202f61['path'][_0x5ad56d]),_0x46e902=_0x46e902['getChild'](0x0);return{'modelFragment':_0x3a92d6,'anchorData':_0x4a87b9};}['_getExecuteDataInTable'](){const _0x4cc536=this['editor']['model']['document']['selection'],_0x17a407=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x2f32d6=_0x4cc536['getFirstRange']()['start']['parent']['parent'],_0x56baf3=this['_wrapWithCommonAncestors'](_0x17a407,this['editor']['model']['createPositionBefore'](_0x2f32d6),this['editor']['model']['createPositionAfter'](_0x2f32d6)),_0x1318d7=_0x4cc536['getFirstRange']()['start'],_0x5780cd=new Map();let _0x1d521e=_0x56baf3;for(let _0x1aa7dc=0x0;_0x1aa7dc<_0x1318d7['path']['length'];_0x1aa7dc++)if(_0x5780cd['set'](_0x1d521e,_0x1318d7['path'][_0x1aa7dc]),_0x1aa7dc<_0x1318d7['path']['length']-0x1)_0x1d521e=_0x1d521e['getChild'](0x0);else{let _0x186b00=_0x1d521e['nextSibling'];for(;_0x186b00;)_0x5780cd['set'](_0x186b00,_0x1318d7['path'][_0x1aa7dc]),_0x186b00=_0x186b00['nextSibling'];}return{'modelFragment':_0x56baf3,'anchorData':_0x5780cd};}['_executeAction'](_0x5c4f6a,_0x2803a1,_0x347648,_0x33268d,_0x2bb341){const _0x2eff7c=this['editor']['plugins']['get'](s),_0xc71a81=this['editor']['plugins']['get'](N),_0x5155d5=this['editor']['model']['document']['selection'],_0x710f29=_0x2eff7c['modelToViewWithIds'](_0x2803a1),_0x2393d4=this['editor']['data']['processor']['toData'](_0x710f29),_0x5e2047=this['editor']['model']['document']['version'],_0x16bee6=[..._0x5155d5['getRanges']()];let _0x1a7919=this['editor']['config']['get']('ai.availableReplyActions')||[...m];this['editor']['plugins']['has']('TrackChanges')||(_0x1a7919=_0x1a7919['filter'](_0x5aae1f=>'insertSuggestion'!=_0x5aae1f));const _0x513ad1=new p(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x1a7919});return _0xc71a81['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x33268d,'icon':_0x2bb341||_0x287cd1,'mainView':_0x513ad1,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x16bee6}),this['_setLoadingState'](_0x513ad1,_0xc71a81),this['listenTo'](_0xc71a81,'applySuggestion',()=>{this['_applyChanges'](_0x2803a1,_0x347648,!0x1);}),this['listenTo'](_0xc71a81,'insertSuggestion',()=>{this['_applyChanges'](_0x2803a1,_0x347648,!0x0);}),this['listenTo'](_0xc71a81,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0xc71a81,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x19f72b=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x519b1d=_0x19f72b['changeGroups'][0x0];_0x519b1d&&'pending'===_0x519b1d['state']&&_0x19f72b['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0xc71a81);}),this['_createInteraction'](_0x2393d4,_0x5e2047,_0x513ad1,_0xc71a81,_0x5c4f6a);}['_wrapWithCommonAncestors'](_0x35de6a,_0x44e500,_0x288108){const _0x517b44=this['editor']['model']['createRange'](_0x44e500,_0x288108)['getCommonAncestor'](),_0x2d005f=_0x517b44['is']('documentFragment')?[]:_0x517b44['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x2d005f['length']){const _0xbd0818=_0x2d005f['map'](_0x525e15=>_0x525e15['_clone'](!0x1));for(let _0x10fc0d=0x1;_0x10fc0d<_0xbd0818['length'];_0x10fc0d++)_0xbd0818[_0x10fc0d-0x1]['_appendChild'](_0xbd0818[_0x10fc0d]);return _0xbd0818[_0xbd0818['length']-0x1]['_appendChild'](_0x35de6a),new _0x9a8814(_0xbd0818[0x0]);}return _0x35de6a;}async['_createInteraction'](_0x195b57,_0x423cb6,_0x37fc0a,_0x3bbdd4,_0xcb5c25){const _0x5c0fc9=this['editor'];this['_interactionParams']={'action':_0xcb5c25,'content':_0x195b57,'version':_0x423cb6,'mainView':_0x37fc0a,'aiBalloon':_0x3bbdd4};const _0x478d53=new I({'connector':this['_aiConnector'],'editor':_0x5c0fc9,'content':_0x195b57,'version':_0x423cb6,..._0xcb5c25});this['_interactions']['push'](_0x478d53),_0x37fc0a['hideError']();const _0x12290b=(_0x375354,_0x223373,_0x34bff3=!0x1,_0x179415='streaming')=>this['_promiseQueue']['enqueue'](async _0x57b4c9=>{try{const _0x47c40b=x({'editor':_0x5c0fc9,'changeGroups':_0x375354['changeGroups'],'documentContextContent':_0x375354['documentContextContent'],'showDiff':_0x34bff3,'trimUnchanged':!0x1});await _0x223373['updateContent']({'parts':_0x47c40b,'renderingStrategy':_0x179415,'abortSignal':_0x57b4c9});}catch(_0x43d982){if(this['_isAbortError'](_0x43d982))return;throw _0x43d982;}});this['_interaction']['on']('replyCreated',(_0x41c56f,_0x57ebcd)=>{_0x37fc0a['hideLoader'](),_0x12290b(_0x57ebcd,_0x37fc0a)['catch'](_0x5ab72e=>{this['_isAbortError'](_0x5ab72e)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x5ab72e),this['_setErrorState'](_0x478d53,_0x37fc0a));});}),this['_interaction']['on']('replyContentUpdated',(_0x2a1f8c,_0xf90d16)=>{_0x12290b(_0xf90d16,_0x37fc0a)['catch'](_0x5cb3e1=>{this['_isAbortError'](_0x5cb3e1)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x5cb3e1),this['_setErrorState'](_0x478d53,_0x37fc0a));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x37fc0a,_0x3bbdd4),this['_updateNavigationUI']();}catch(_0x44351e){this['_isAbortError'](_0x44351e)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x44351e),this['_setErrorState'](_0x478d53,_0x37fc0a));}}),this['listenTo'](_0x37fc0a,'toggleSuggestionDisplayMode',(_0xc06e6d,{showDiff:_0x3ebebd})=>{this['_balloonShowDiff']=_0x3ebebd;const _0x353dc6=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x353dc6&&_0x12290b(_0x353dc6,_0x37fc0a,_0x3ebebd,'static')['catch'](_0x2a5dad=>{this['_isAbortError'](_0x2a5dad)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x2a5dad),this['_setErrorState'](_0x478d53,_0x37fc0a));});}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x46b80c,{reply:_0x3231bf})=>{const _0x4ec021={'positiveCount':_0x3231bf['changeGroups']['filter'](_0x3090a3=>'accepted'===_0x3090a3['state'])['length'],'totalCount':_0x3231bf['changeGroups']['length']},_0x5166ee=this['_interaction']['actionCallId'],_0x4f46ed=this['_interaction']['actionName'];_0x4f46ed?this['_aiConnector']['upsertAIActionRating'](_0x4f46ed,_0x5166ee,_0x4ec021):this['_aiConnector']['upsertCustomAIActionRating'](_0x5166ee,_0x4ec021);}),this['_setLoadingState'](_0x37fc0a,_0x3bbdd4);try{const _0x185241=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x185241;}catch(_0x12c5da){if(this['_isAbortError'](_0x12c5da))return;_0x37fc0a['hideLoader'](),this['_setErrorState'](_0x478d53,_0x37fc0a);}}['_applyChanges'](_0x2a5623,_0x1ef6d4,_0x5c2901){const _0x3547fe=this['editor'];if(_0x5c2901&&!_0x3547fe['plugins']['has']('TrackChanges'))throw new _0x2e27f1('ai-no-track-changes',null);const _0x2b608e=this['editor']['plugins']['get'](_0x5f0575),_0x508f2d=this['_interaction'],_0x1ebb6a=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x24aff9=_0x1ebb6a['changeGroups'];_0x1ebb6a['setChangeGroupState'](0x0,'accepted');let _0x5777c3=O({'editor':_0x3547fe,'reply':_0x1ebb6a,'interaction':_0x508f2d,'groups':_0x24aff9,'transform':!0x1,'documentCompare':_0x2b608e,'documentCompareOptions':{'anchor':_0x3547fe['model']['createPositionAt'](_0x2a5623,0x0),'markDeletions':_0x5c2901}});_0x5777c3=this['_filterOperationsOutsideRange'](_0x5777c3,_0x1ef6d4);for(const _0x19faee of _0x5777c3)this['_anchorOperation'](_0x1ef6d4,_0x19faee,_0x3547fe['model']['document']['getRoot']());const _0x23ffe6=_0x508f2d['getDocumentContext']()['version'],_0x48fd79=_0x3547fe['model']['document']['history']['getOperations'](_0x23ffe6),_0x366841={'document':_0x3547fe['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2805ec=_0x461ccc(_0x5777c3,_0x48fd79,_0x366841)['operationsA'];_0x3547fe['model']['change'](_0x16c126=>{if(_0x16c126['setSelection'](_0x3547fe['model']['document']['selection']['focus']),_0x5c2901)_0x3547fe['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2805ec);else{for(const _0x5518d3 of _0x2805ec)_0x5518d3['baseVersion']=_0x3547fe['model']['document']['version'],D(_0x3547fe,_0x5518d3),_0x16c126['batch']['addOperation'](_0x5518d3),_0x3547fe['model']['applyOperation'](_0x5518d3);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x19eb5d,_0x49f4dc){return _0x19eb5d['filter'](_0x33f724=>{if('rename'==_0x33f724['type']){const _0x21d6a6=_0x33f724['position']['nodeAfter'];return!_0x49f4dc['has'](_0x21d6a6);}if(_0x33f724['type']['indexOf']('Attribute')>-0x1){const _0x54d8fc=_0x33f724['range']['start']['nodeAfter'];return!_0x49f4dc['has'](_0x54d8fc);}return!0x0;});}['_anchorOperation'](_0xf83229,_0x203953,_0x19d313){const _0x4cb721=_0x203953['clone']();for(const _0x3ac74b in _0x203953){const _0x62cdfc=_0x203953[_0x3ac74b];_0x62cdfc instanceof _0x3ceedb?_0x203953[_0x3ac74b]=new _0x3ceedb(_0x5be66d(_0x62cdfc['start']),_0x5be66d(_0x62cdfc['end'])):_0x62cdfc instanceof _0x110b0b&&(_0x203953[_0x3ac74b]=_0x5be66d(_0x62cdfc));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x4cb721['type'])){if(_0x4cb721['isDocumentOperation']=!0x1,_0x4cb721['baseVersion']=null,'remove'==_0x4cb721['type']){const _0x5422ab=_0x4cb721['sourcePosition'],_0x48f322=_0x4cb721['howMany'];new _0x93a95(_0x5422ab,_0x48f322)['_execute']();}else _0x4cb721['_execute']();}function _0x5be66d(_0x5c4082){if('$graveyard'==_0x5c4082['root']['rootName'])return _0x5c4082;const _0x50d22e=[];let _0xaa728e=_0x5c4082['root'];for(let _0x45ae8f=0x0;_0x45ae8f<_0x5c4082['path']['length'];_0x45ae8f++){const _0x2f835b=_0xf83229['get'](_0xaa728e)||0x0;_0x50d22e[_0x45ae8f]=_0x5c4082['path'][_0x45ae8f]+_0x2f835b,_0xaa728e=_0xaa728e['getChildAtOffset'](_0x5c4082['path'][_0x45ae8f]);}return new _0x110b0b(_0x19d313,_0x50d22e,_0x5c4082['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x598e4a,content:_0x2635c1,version:_0x2fec93,mainView:_0x4a0af8,aiBalloon:_0x23b365}=this['_interactionParams'];_0x4a0af8['areChangesVisible']=!0x1,_0x4a0af8['hideError'](),this['_clearErrorState'](_0x4a0af8,_0x23b365);const _0x5da543=_0x4a0af8;_0x5da543['miniToolbarView']&&_0x5da543['miniToolbarView']['showChangesButton']&&_0x5da543['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x275968}),this['_clearSuggestionContent'](_0x4a0af8),_0x4a0af8['showLoader'](),this['_updateNavigationUI'](),this['_createInteraction'](_0x2635c1,_0x2fec93,_0x4a0af8,_0x23b365,_0x598e4a)['catch'](_0x290ca1=>{this['_isAbortError'](_0x290ca1)||console['error']('Error\x20refreshing\x20interaction:',_0x290ca1);});}['_clearSuggestionContent'](_0xb6d412){const _0x495c23=_0xb6d412['bodyView']['_children'];for(;_0x495c23['length']>0x0;)_0x495c23['remove'](_0x495c23['first']);_0xb6d412['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x71dfe6){return!!_0x71dfe6['message']&&_0x71dfe6['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0x2dca27=new _0x2cae14(this['editor']['locale']),_0x522952=new _0x2cae14(this['editor']['locale']),_0x139a1a=new _0x40a2ba(this['editor']['locale']),_0x3ba088=new _0x2cae14(this['editor']['locale']);_0x2dca27['set']({'icon':_0x296b5e,'label':f(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x522952['set']({'icon':_0x4618d9,'tooltip':f(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x139a1a['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x3ba088['set']({'icon':_0x446b5b,'tooltip':f(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x2dca27['bind']('isEnabled')['to'](this,'isBusy',_0x2d6ea3=>!_0x2d6ea3),_0x2dca27['on']('execute',()=>{this['_refreshInteraction']();}),_0x522952['bind']('isEnabled')['to'](this,'isBusy',_0x59a928=>!_0x59a928),_0x522952['on']('execute',()=>{this['_navigateToPrevious']();}),_0x3ba088['bind']('isEnabled')['to'](this,'isBusy',_0x4dbe0c=>!_0x4dbe0c),_0x3ba088['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x522952,this['_navigationCounter']=_0x139a1a,this['_navigationNextButton']=_0x3ba088,this['_customViews']['add'](_0x2dca27);}['_navigateToPrevious'](){const _0x493a28=this['_interactions']['length'];this['_currentInteractionIndex']<_0x493a28-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x5267ab){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x5267ab;const {mainView:_0x305919}=this['_interactionParams'],_0x3d5a78=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3d5a78)return;if(_0x3d5a78['hasError'])return this['_setErrorState'](_0x3d5a78,_0x305919),void this['_updateNavigationUI']();if(!_0x3d5a78['replies']['length'])return;_0x305919['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x305919,this['_interactionParams']['aiBalloon']);const _0xfbb213=_0x3d5a78['replies'][_0x3d5a78['replies']['length']-0x1];if(_0xfbb213){const _0x465fd6=this['editor'];this['_clearSuggestionContent'](_0x305919);try{const _0x4bd1a3=x({'editor':_0x465fd6,'changeGroups':_0xfbb213['changeGroups'],'documentContextContent':_0xfbb213['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x305919),await new Promise(_0x320f4e=>setTimeout(_0x320f4e,0x32)),await _0x305919['updateContent']({'parts':_0x4bd1a3,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x23aa00){this['_isAbortError'](_0x23aa00)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x23aa00);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x4a4b3d=this['_interactions']['length'],_0x288b94=_0x4a4b3d>0x1,_0x209f1a=this['_interactionParams']?.['mainView'];if(_0x288b94){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x209f1a?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x209f1a?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x209f1a?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x5738b2=_0x4a4b3d-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x5738b2+'/'+_0x4a4b3d),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x4a4b3d-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x209f1a?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x209f1a?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x209f1a?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x56be71,_0x43f862){_0x56be71['setLoading'](),_0x43f862['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x36297a,_0x11c6e1){const _0x5cab65=f(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x11c6e1['showError'](_0x5cab65),_0x36297a['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x11c6e1['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x20ed95,_0x29b09f){_0x20ed95['clearErrorState'](),_0x29b09f['balloonView']['toolbar']&&(_0x29b09f['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x1c54e9,_0x5c757a){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x1c54e9['clearLoading'](),_0x5c757a['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x412f2d=>{'isEnabled'in _0x412f2d&&(_0x412f2d['isEnabled']=!0x1);});}}class Ba extends _0x50e8f9{static get['requires'](){return[gi,ki,ji];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1a46a2){super(_0x1a46a2),_0x1a46a2['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class js{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x42a02f,title:_0x2a82a8,description:_0x374546,isParameterized:_0x1b73e1,useArgs:_0x25b54d,options:_0x47ee67}){this['id']=_0x42a02f,this['title']=_0x2a82a8,this['description']=_0x374546,this['isParameterized']=_0x1b73e1,this['useArgs']=_0x25b54d,this['options']=_0x47ee67;}}class kr extends js{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x5ed4a8){this['_models']=_0x5ed4a8;}}class Ri extends $t(){['_checks'];constructor(_0x3b75ab){super(),this['_checks']=this['_mapCheckDefinitions'](_0x3b75ab);}get['checks'](){return this['_checks'];}['getCheckById'](_0x1eece1){return this['checks']['find'](_0x25f805=>_0x25f805['id']===_0x1eece1);}['_mapCheckDefinitions'](_0x4e16e8){return _0x4e16e8['map'](_0x42e3c5=>'custom'===_0x42e3c5['id']?new kr(_0x42e3c5):new js(_0x42e3c5));}}class Rs extends _0xd790fa(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x1e1560,contentNew:_0x3442ca,contentInitial:_0x5cab1b,documentVersion:_0x4e1bc6}){super(),this['id']=_0x1e1560,this['contentNew']=_0x3442ca,this['contentInitial']=_0x5cab1b,this['documentVersion']=_0x4e1bc6;}}class Ds extends $t(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x49680f,_0x599838,_0x2d5208){super(),this['id']=_0x49680f,this['parent']=_0x2d5208,this['_data']=_0x599838,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 Ts extends $t(){['id']=_0x4fd5c3();['callId'];['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x4a8c25,_0x2fc250,_0x103256,_0x3b3ec7,_0x2e2f80){super(),this['_documentData']=_0x4a8c25,this['_sourceCheck']=_0x2fc250,this['_aiConnector']=_0x103256,this['_reviewParams']=_0x3b3ec7,this['_reviewArgs']=_0x2e2f80,this['on']('change:status',(_0x148a48,_0x4f6650,_0x111bf9)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x111bf9,'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'](_0x345dfd=>'pending'===_0x345dfd['status']);}get['currentError'](){return this['_currentError'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x46ea54=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x23a1ac of _0x46ea54)'unmodified'!==_0x23a1ac['data']['operation']&&('error'!==_0x23a1ac['data']['operation']?'review-metadata'!==_0x23a1ac['event']?this['_addReviewCheckResult'](_0x23a1ac['data']['dataId'],_0x23a1ac['data']['textDelta']):this['callId']=_0x23a1ac['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x103c9a){this['_currentError']=_0x103c9a,_0x103c9a instanceof Error&&_0x103c9a['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'](_0x105d98,_0x3805a3){const _0x324d3e=this['_results']['get'](_0x105d98);if(!_0x324d3e)return;const _0x35a63d=[];_0x3805a3['forEach']((_0x16802b,_0x19a8b3)=>{const _0x4b5afb=new Ds(_0x324d3e['id']+'-'+_0x19a8b3,_0x16802b,_0x324d3e);_0x4b5afb['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x4b5afb,'status':_0x4b5afb['status']});}),_0x4b5afb['on']('change:isActivated',()=>{_0x4b5afb['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x4b5afb}):this['fire']('reviewCheckResultDeactivated',{'change':_0x4b5afb});}),this['_changes']['push'](_0x4b5afb),_0x35a63d['push'](_0x4b5afb);}),this['fire']('reviewCheckResultReady',{'changes':_0x35a63d,'result':_0x324d3e,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x2d0814){const _0x2b28d9=this['_changes']['find'](_0x298da0=>_0x298da0['id']===_0x2d0814);return!(!_0x2b28d9||'pending'!==_0x2b28d9['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x2e51e2=>'pending'===_0x2e51e2['status']);}['markAllChangesAsAccepted'](){for(const _0xbb8de7 of this['_changes'])'pending'===_0xbb8de7['status']&&(_0xbb8de7['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x164cf1){const _0x2b3d80=this['_changes']['find'](_0x5e2c34=>_0x5e2c34['id']===_0x164cf1);_0x2b3d80&&'pending'===_0x2b3d80['status']&&(_0x2b3d80['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x546626){const _0x49cfcc=this['_changes']['find'](_0x351c53=>_0x351c53['id']===_0x546626);_0x49cfcc&&'pending'===_0x49cfcc['status']&&(_0x49cfcc['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0xfe3fe8){const _0x36968e=this['_changes']['find'](_0x37a017=>_0x37a017['id']===_0xfe3fe8);_0x36968e&&'pending'===_0x36968e['status']&&(_0x36968e['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x3886b6){const _0x1eccef=this['_changes']['find'](_0x5e2971=>_0x5e2971['id']===_0x3886b6);_0x1eccef&&'outdated'===_0x1eccef['status']&&(_0x1eccef['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0xf1172){this['_changes']['filter'](_0x2a17e3=>_0x2a17e3['isActivated']&&_0x2a17e3['id']!==_0xf1172)['forEach'](_0x399b30=>{_0x399b30['isActivated']=!0x1;});const _0x2c476=this['_changes']['find'](_0x479175=>_0x479175['id']===_0xf1172);_0x2c476&&'pending'===_0x2c476['status']&&(_0x2c476['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0xe257c5=>_0xe257c5['isActivated'])['forEach'](_0x4fccfc=>{_0x4fccfc['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x4cabd7){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x3baae0;if(_0x4cabd7){const _0xb8362c=this['_changes']['find'](_0x13538c=>_0x13538c['id']===_0x4cabd7);if(_0xb8362c&&_0xb8362c['isRated'])return;_0xb8362c&&(_0x3baae0=_0xb8362c['parent']['id'],_0xb8362c['isRated']=!0x0);}const _0x3ecff1={'positiveCount':this['_changes']['filter'](_0x362ae3=>'accepted'===_0x362ae3['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x3ecff1,this['callId'],_0x3baae0);}['_addReviewCheckResult'](_0x18f143,_0x3747a8){const _0x4b43ad=this['_documentData']['elements']['get'](_0x18f143);if(!_0x4b43ad)return;const _0x3f26d4=_0x4b43ad['getContent']();if(_0x3f26d4===_0x3747a8)return;const _0x4067f1=new Rs({'id':_0x18f143,'contentInitial':_0x3f26d4,'contentNew':_0x3747a8,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x4067f1['id'],_0x4067f1),this['fire']('reviewCheckResultAdded',{'result':_0x4067f1,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x4a7d1b=>'pending'===_0x4a7d1b['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x17df62=>'pending'===_0x17df62['status'])['length']&&(this['status']='finished'));}}class _i extends Ts{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x356a9c=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x4ba1a6=0x0;_0x4ba1a6<this['_reviewParams']['length'];_0x4ba1a6++){if(!this['_reviewParams'][_0x4ba1a6]||!this['_sourceCheck']['options'][_0x4ba1a6])continue;const _0x4c357e=this['_sourceCheck']['options'][_0x4ba1a6],_0x4e9517=_0x4c357e['data']?.['find'](_0x27f6c8=>_0x27f6c8['id']===this['_reviewParams'][_0x4ba1a6]);_0x4e9517&&_0x356a9c['push'](_0x4e9517['label']);}return _0x356a9c['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x2c1dee,_0x487e5a,_0x1b34cd){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x487e5a,_0x2c1dee,_0x1b34cd);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class Ci extends Ts{['_prompt'];['_model'];constructor(_0x128fa5,_0x420d4d,_0x52fbb9,_0x181125,_0x38a00d){super(_0x52fbb9,_0x181125,_0x38a00d),this['_prompt']=_0x128fa5,this['_model']=_0x420d4d;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x2441d7,_0x2beade,_0x113910){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x2beade,_0x2441d7,_0x113910);}}const Ei=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'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':'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'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'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 ie extends _0x5cd1ee{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[o];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0xd59e68=this['context']['config']['get']('ai.reviewMode.translations');if(_0xd59e68){for(const _0x65ddea of Ei)'translate'===_0x65ddea['id']&&(_0x65ddea['options'][0x0]['data']=_0xd59e68);}const _0x21365d=this['_translateReviewChecks'](Ei);this['_aiReviewCheckList']=new Ri(_0x21365d);const _0x19f3e4=this['_aiReviewCheckList']['checks']['find'](_0x5494bd=>'custom'===_0x5494bd['id']);if(_0x19f3e4){const _0x1be7dc=await new Mi({'connector':this['_aiConnector']})['getAll']();_0x19f3e4['models']=_0x1be7dc['map'](_0x4bad43=>({..._0x4bad43,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x4bad43['id']['toUpperCase'](),_0x4bad43['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x5c04bf,_0x47a4a7)=>{const _0xa0fb2b=this['_aiReviewCheckList']['getCheckById'](_0x47a4a7['id']);if(_0xa0fb2b){this['_onDiffChange'](this['_isDiffOn']),_0x47a4a7['isCustom']?this['_currentReviewCheckRun']=new Ci(_0x47a4a7['args']['prompt'],_0x47a4a7['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0xa0fb2b,this['_aiConnector']):this['_currentReviewCheckRun']=new _i(this['_aiReviewModeEditing']['getDocumentData'](),_0xa0fb2b,this['_aiConnector'],_0x47a4a7['params'],_0x47a4a7['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x5493f7,_0x5c12cb)=>{'data'===_0x5c12cb['status']||'loading'===_0x5c12cb['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x5c12cb)):'finished'===_0x5c12cb['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x5c12cb['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x5c12cb['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x5c12cb['status']?(this['_aiReviewModeUi']['showGeneralErrorView'](),this['_logError'](new _0x2e27f1('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x5c12cb['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x2e27f1('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x5c12cb['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x5c12cb['status']&&'error-chunk'!==_0x5c12cb['status']&&'error-general'!==_0x5c12cb['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x311e92,_0x4c4828)=>{if(!this['_currentReviewCheckRun'])throw new _0x2e27f1('ai-review-mode-no-current-check-run',this);const _0x1e6b2a=this['_aiReviewModeEditing']['diffContent'](_0x4c4828['result']['contentInitial'],_0x4c4828['result']['contentNew']);_0x4c4828['source']['addResultChanges'](_0x4c4828['result']['id'],_0x1e6b2a);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x38689e,_0x38ed7a)=>{for(const _0x5410e7 of _0x38ed7a['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x5410e7);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x38ed7a['changes'],_0x38ed7a['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x4f69ce,_0xaafad3)=>{this['_aiReviewModeUi']['updateChangeState'](_0xaafad3['change']['id'],_0xaafad3['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x3dfcc8,_0x2cb58e)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x2cb58e['change']['id']);const _0x4f995e=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x2cb58e['change']['id']);if(_0x4f995e){if('content'===this['_changeActivationSource']){const _0x368b7d=this['_aiReviewModeUi']['getChangeElement'](_0x2cb58e['change']['id']);_0x368b7d&&_0x39e5ec(_0x368b7d['closest']('.ck-ai-review-mode__check-run-result')||_0x368b7d);}else{if('panel'===this['_changeActivationSource']){const _0xe2bf09={'target':_0x4f995e['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x10ba32(_0xe2bf09);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x2cb58e['change'],_0x4f995e['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x1cfc11){_0x1cfc11 instanceof Error&&_0x1cfc11['message']['includes']('ai-request-aborted')||(_0x1cfc11 instanceof _0x2e27f1?this['_logError'](_0x1cfc11):this['_logError'](new _0x2e27f1('ai-review-mode-check-run-failed',this,{'error':_0x1cfc11})));}}else this['_logError'](new _0x2e27f1('ai-review-mode-source-check-not-found',this,{'checkId':_0x47a4a7['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x41f53d=this['_currentReviewCheckRun']['getActiveChanges']();_0x41f53d['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x41f53d['map'](_0x2c5413=>_0x2c5413['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x1730a3,_0x2abfdb)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x2abfdb['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x2abfdb['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x2abfdb['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x2abfdb['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x4f1243,_0x49a64d)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x49a64d['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x49a64d['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x49a64d['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x49a64d['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x1824c6,_0x2536a2)=>{this['_isDiffOn']=_0x2536a2['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x5a90b5,_0x23cdd8)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x23cdd8['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x343436,_0x4a916a)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4a916a['changeId']));}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x42d7e9,_0x1aba17)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x1aba17['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x30d30c,_0x141ee6)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x141ee6['changeId']);});}['_onReviewModeRunLeave'](_0xd03ac9=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0xd03ac9&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x36828d=this['_aiReviewModeEditing']['getEditor']();_0x36828d&&_0x36828d['editing']['view']['change'](_0x521a3c=>{const _0x292d89=_0x36828d['editing']['view']['document']['getRoot']();_0x521a3c['removeClass']('ck-ai-review-mode-diff',_0x292d89),_0x521a3c['removeClass']('ck-ai-review-mode-highlights',_0x292d89);});}['_onDiffChange'](_0x53be54){const _0x26de88=this['_aiReviewModeEditing']['getEditor']();_0x53be54?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x26de88&&_0x26de88['editing']['view']['change'](_0x35e310=>{const _0x183c8c=_0x26de88['editing']['view']['document']['getRoot']();_0x35e310['removeClass']('ck-ai-review-mode-diff',_0x183c8c),_0x35e310['removeClass']('ck-ai-review-mode-highlights',_0x183c8c),_0x35e310['addClass'](_0x53be54?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x183c8c);});}['_translateReviewChecks'](_0x2d4baa){return _0x2d4baa['map'](_0x4b6939=>{const _0x49c638='AI_REVIEW_CHECK_'+_0x4b6939['id']['toUpperCase']()['replaceAll']('-','_'),_0x531c0e={..._0x4b6939,'title':this['_getTranslationWithDefault'](_0x49c638+'_TITLE',_0x4b6939['title']),'description':this['_getTranslationWithDefault'](_0x49c638+'_DESCRIPTION',_0x4b6939['description'])};return _0x4b6939['options']&&(_0x531c0e['options']=_0x4b6939['options']['map'](_0x11c824=>({..._0x11c824,'label':this['_getTranslationWithDefault'](_0x49c638+'_OPTIONS_LABEL',_0x11c824['label']||''),'data':_0x11c824['data']?_0x11c824['data']['map'](_0x51c862=>({..._0x51c862,'label':this['_getTranslationWithDefault'](_0x49c638+'_OPTIONS_DATA_'+_0x51c862['id']['toUpperCase'](),_0x51c862['label'])})):void 0x0}))),_0x531c0e;});}['_getTranslationWithDefault'](_0x2d1026,_0x3637a2){const _0x37f0d0=f(this['context']['locale'],_0x2d1026);return _0x37f0d0===_0x2d1026?_0x3637a2:_0x37f0d0;}['_logError'](_0x58b819){_0x454609(_0x58b819['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x40a2ba{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x4cd5be,_0x4eb471){super(_0x4cd5be),this['_defaultValue']=_0x4eb471['default']||(_0x4eb471['data']['length']>0x0?_0x4eb471['data'][0x0]['id']:''),this['_defaultLabel']=_0x4eb471['data']['find'](_0x19385d=>_0x19385d['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x51b8c3(this['locale']);const _0x5084d9=this['_prepareListOptions'](_0x4eb471['data']);_0x4f0e71(this['_dropdownView'],_0x5084d9,{'role':'menu','ariaLabel':_0x4eb471['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x104c59=>{_0x104c59['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x55c3a4=>{this['formValue']=_0x55c3a4['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x55c3a4['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0xc250bf=[]){const _0x136e47=new _0x17acab();this['resetToDefault']();for(const _0x4e5a1a of _0xc250bf){const _0x3ed785=new _0x3c45c3({'label':_0x4e5a1a['label'],'withText':!0x0,'role':'menuitemradio','id':_0x4e5a1a['id'],'model':_0x4e5a1a});_0x3ed785['bind']('isOn')['to'](this,'formValue',_0x46ded8=>_0x46ded8===_0x3ed785['id']);const _0x216961={'type':'button','model':_0x3ed785};_0x136e47['add'](_0x216961);}return _0x136e47;}}class Ys extends _0x4e528a{['_formItem']=null;constructor(_0x45497d,_0x18d7f5,_0x1d2829){super(_0x45497d),this['argsKey']=_0x18d7f5?.['argsKey'];if('dropdown'===_0x18d7f5['formType'])this['_formItem']=new Mr(this['locale'],_0x18d7f5);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x45c3d6=new _0x477ff1(this['locale'],{'children':[this['_formItem']],'class':[_0x1d2829?'ck-form__row_with-submit':'']});_0x1d2829&&_0x45c3d6['children']['add'](_0x1d2829),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x45c3d6]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Hs extends _0x5ea2f2{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x45c201){super(_0x45c201),this['set']('isEmpty',!0x0),this['keystrokes']=new jt(),this['minRows']=Hs['MIN_ROWS'],this['maxRows']=Hs['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class Zs extends _0x40a2ba{['focusTracker']=new Bt();['keystrokes']=new jt();['focusCycler'];['_focusables']=new _0x23b83b();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x21c63b,_0x45d731){super(_0x21c63b),this['_check']=_0x45d731,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x45d731['models']&&_0x45d731['models']['length']>0x0?_0x45d731['models'][0x0]['id']:'',this['_defaultLabel']=_0x45d731['models']&&_0x45d731['models']['length']>0x0?_0x45d731['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x5abff3(this['locale'],()=>new Hs(_0x21c63b)),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 _0x17acab(),this['_setModelList'](),_0x4f0e71(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x477ff1(this['locale'],{'children':[this['promptInputView']]}),new _0x477ff1(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x2e4e57,_0x4fca27)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x4fca27()):_0x4fca27();}),this['focusCycler']=new Vt({'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'](_0x17ddbd=>{this['_focusables']['add'](_0x17ddbd),this['focusTracker']['add'](_0x17ddbd['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 _0x430812 of this['_getFormValidators']()){const _0x30b708=_0x430812();if(_0x30b708)return this['promptInputView']['errorText']=_0x30b708,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return f(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x372c5f=new _0x2cae14(this['locale']),t=this['locale']['t'];return _0x372c5f['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x372c5f['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x372c5f;}['_createCancelButtonView'](){const _0x13076b=new _0x2cae14(this['locale']),t=this['locale']['t'];return _0x13076b['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x13076b['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x58e6f5=>{_0x58e6f5['stopPropagation']();})}}),_0x13076b['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x13076b;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x4e7791=this['_check']['models'];if(this['resetToDefault'](),_0x4e7791?.['length']){const _0x5c4bf9=Mi['getLocalized'](this['locale'],_0x4e7791);for(const _0x179f12 of _0x5c4bf9){const _0xb6c407=new _0x3c45c3({'label':_0x179f12['name'],'withText':!0x0,'role':'menuitemradio','id':_0x179f12['id'],'model':_0x179f12});_0xb6c407['bind']('isOn')['to'](this,'modelId',_0x1dcc7d=>_0x1dcc7d===_0x179f12['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xb6c407,'labelView':new Ws(this['locale'],_0x179f12)});}}}['_createModelSelectionDropdown'](){const _0x220828=_0x51b8c3(this['locale']);return _0x220828['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x220828['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x220828,'execute',_0x1a92f0=>{this['modelId']=_0x1a92f0['source']['model']['id'],_0x220828['buttonView']['label']=_0x1a92f0['source']['label'];}),_0x220828;}['_createActionsFooterView'](){const _0x2c0f5d=new _0x40a2ba(this['locale']);return _0x2c0f5d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x2c0f5d;}}class Ws extends _0x8234dc{constructor(_0x5d5419,_0x35d9a5){super();const _0x1e8056=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1e8056['to']('style'),'id':_0x1e8056['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1e8056['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x35d9a5['description']||'']}]}]});}}class Gs extends _0x4e528a{['_formItemsCollection']=new _0x23b83b();['_customCheckView']=null;constructor(_0xc2d85e,_0x546828,_0x3bf309){super(_0xc2d85e),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x546828['isParameterized']);const _0x3da2a4=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x481e1f=>_0x481e1f),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0xd029c4=>_0xd029c4)],'style':{'--ck-ai-review-check-list-item-index':_0x3bf309}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x546828['title']}]},_0x3da2a4]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x546828['description']}]}]}]},..._0x546828['isParameterized']?[this['_createParameterizedView'](_0x546828)]:[],...'custom'===_0x546828['id']?[this['_createCustomView'](_0x546828)]:[]]}),this['on']('click',()=>{_0x546828['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x546828['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&ts({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x4662c8=>{_0x4662c8['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x4c222c=new _0x5a991c();return _0x4c222c['content']=_0x3435cf,_0x4c222c['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x4c222c;}['_createParameterizedView'](_0x4f838e){const _0x5cb146=new _0x40a2ba(),_0x1eaaf6=this['_createFormView'](_0x4f838e);return _0x5cb146['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x402c75=>!_0x402c75)]},'children':[_0x1eaaf6]}),_0x5cb146;}['_createFormView'](_0x5f34b0){const _0x119886=new _0x40a2ba(),_0x1b0026=Array['isArray'](_0x5f34b0['options'])?_0x5f34b0['options']:[],_0x3800ec=new _0x2cae14(this['locale']),t=this['locale']['t'];_0x3800ec['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3800ec['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1e7b6f=>{_0x1e7b6f['stopPropagation']();})}}),_0x3800ec['on']('execute',()=>{const _0x31a311=[],_0x330439={};this['_formItemsCollection']['forEach'](_0x7eca27=>{_0x31a311['push'](_0x7eca27['value']),_0x5f34b0['useArgs']&&_0x5f34b0['options']&&(_0x330439[_0x7eca27['argsKey']]=_0x7eca27['value']);}),this['fire']('runReviewCheck',{'id':_0x5f34b0['id'],'params':_0x31a311['length']?_0x31a311:void 0x0,'args':Object['keys'](_0x330439)['length']?_0x330439:void 0x0});});const _0x56378c=_0x1b0026['length'];return _0x1b0026['forEach']((_0x4c98f1,_0x469c2a)=>{const _0x2e9aa6=_0x469c2a===_0x56378c-0x1;this['_formItemsCollection']['add'](new Ys(this['locale'],_0x4c98f1,_0x2e9aa6?_0x3800ec:null));}),_0x119886['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x119886;}['_createCustomView'](_0x205aeb){return this['_customCheckView']=new Zs(this['locale'],_0x205aeb),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x2aaf49=>!_0x2aaf49)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x565a5f,_0x101eff,_0x505508)=>{_0x505508||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class $s extends _0x4e528a{['_checkViews'];constructor(_0x45e09f){super(_0x45e09f),this['_checkViews']=new _0x23b83b();const _0x44259e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x44259e['if']('isVisible','ck-hidden',_0x2e6a57=>!_0x2e6a57)]},'children':this['_checkViews']});}['setChecks'](_0x46ec79){this['_checkViews']['clear']();for(const [_0x316a13,_0x9bc46f]of _0x46ec79['entries']()){const _0x19443a=new Gs(this['locale'],_0x9bc46f,_0x316a13);_0x19443a['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x19443a);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x5e67e2 of this['_checkViews'])_0x5e67e2 instanceof Gs&&_0x5e67e2['resetToDefault']();}}class Bs extends _0x40a2ba{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0x45d309,_0x23643c){super(_0x45d309),this['id']=_0x23643c,this['set']('status','pending'),this['set']('changeId',_0x23643c),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['statusButtonView']=this['_createStatusButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['statusButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x23643c,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1ecc5a=new _0x40a2ba(this['locale']);return _0x1ecc5a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x4565d6=>!_0x4565d6)]}}),_0x1ecc5a;}['_createAcceptButtonView'](){const _0x18c35e=new _0x2cae14(this['locale']);return _0x18c35e['set']({'label':f(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x18c35e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3d0eef=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x3d0eef['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x1a9472=>'pending'!==_0x1a9472)]}}),_0x18c35e;}['_createDismissButtonView'](){const _0x577183=new _0x2cae14(this['locale']);return _0x577183['set']({'label':f(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x577183['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4ce803=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x4ce803['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0xb167fd=>'pending'!==_0xb167fd)]}}),_0x577183;}['_createInfoButtonView'](){const _0x3c0df5=new _0x2cae14(this['locale']);return _0x3c0df5['set']({'label':f(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x3b66f9,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x3c0df5['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3ae6c3=>_0x3ae6c3),_0x3c0df5['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x3c0df5;}['_createStatusButtonView'](){const _0x8f1bfe=new _0x2cae14(this['locale']);return _0x8f1bfe['set']({'withText':!0x0,'isEnabled':!0x1}),_0x8f1bfe['bind']('label')['to'](this,'status',_0x19059e=>f(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x19059e['toUpperCase']())),_0x8f1bfe['bind']('icon')['to'](this,'status',_0x5a218f=>'ACCEPTED'===_0x5a218f['toUpperCase']()?_0x54d1a3:'REJECTED'===_0x5a218f['toUpperCase']()?_0x458488:_0x3f37c2),_0x8f1bfe['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x5277d8=>'pending'===_0x5277d8)],'disabled':'disabled'}}),_0x8f1bfe;}}class Js extends _0x2cae14{constructor(_0x4cb0db){super(_0x4cb0db),this['set']({'label':f(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class sh extends _0x4e528a{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x4810d9){super(_0x4810d9),this['_resultViews']=new _0x23b83b(),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['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Hi(_0x4810d9),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 _0x4fe47e=this['_createCombinedSkeletonLoader'](),_0x4b71f0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x4b71f0['if']('isVisible','ck-hidden',_0xbcae6d=>!_0xbcae6d)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x1b62f6=>_0x1b62f6)]},'children':this['_resultViews']},_0x4fe47e]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x5bbe2e){const _0x346b7d=new Bs(this['locale'],_0x5bbe2e['id']);_0x346b7d['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x346b7d),_0x346b7d['resultResponseView']['element']['innerHTML']=_0x5bbe2e['contentDiffed'];}['hideResult'](_0x419c29,_0x30b0b3){if('pending'===_0x30b0b3)return;const _0x54be4c=this['_resultViews']['find'](_0x17a551=>_0x17a551['id']===_0x419c29);_0x54be4c&&(_0x54be4c['status']=_0x30b0b3,_0x54be4c['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x2fc90b,_0x12f20d){if('pending'!==_0x12f20d)return;const _0x5be12c=this['_resultViews']['find'](_0x4a119d=>_0x4a119d['id']===_0x2fc90b);_0x5be12c&&(_0x5be12c['status']=_0x12f20d,_0x5be12c['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x25d1f0,_0x57a811){this['headerTitle']=_0x25d1f0,this['headerSubtitle']=_0x57a811||'';}['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 be(this['locale'],Ie['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x12d170=new _0x40a2ba(this['locale']),_0x442363=[];for(let _0x377c6d=0x0;_0x377c6d<0x10;_0x377c6d++){const _0x57a832=this['_createSkeletonLoader']();_0x57a832['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x442363['push'](_0x57a832);}return _0x12d170['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2a9964=>!_0x2a9964)]},'children':_0x442363}),_0x12d170;}['_createErrorView'](){const _0x256b9d=new _0x40a2ba(this['locale']),_0x197a91=new _0x2cae14(this['locale']),t=this['locale']['t'];return _0x256b9d['delegate']('retryReview')['to'](this),_0x197a91['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x197a91['on']('execute',()=>{this['fire']('retryReview');}),_0x256b9d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x2d0dda=>!_0x2d0dda),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x3596ac=>'chunk'===_0x3596ac)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x4aebcc=>'chunk'===_0x4aebcc)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x42ab4e=>'general'!==_0x42ab4e)]},'children':[{'text':f(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4da923=>'chunk'!==_0x4da923)]},'children':[{'text':f(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x197a91]}),_0x256b9d;}['_createCancelButtonView'](){const _0x1e8910=new _0x2cae14(this['locale']);return _0x1e8910['set']({'label':f(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x1ddcb4}),_0x1e8910['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0xe1200e=>_0xe1200e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3921e0=>_0x3921e0)]}}),_0x1e8910['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x1e8910;}['_createToggleDiffButtonView'](){const _0x1a2d00=new _0x2cae14(this['locale']);_0x1a2d00['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x1a2d00['bind']('isEnabled')['to'](this,'isError',_0xded781=>!_0xded781),_0x1a2d00['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2e215d=>!_0x2e215d),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x592d0c=>_0x592d0c)]}});const _0x10aa23=f(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x78039b=f(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x1a2d00['bind']('isOn')['to'](this,'isToggleDiffOn',_0x840da=>_0x840da),_0x1a2d00['bind']('icon')['to'](this,'isToggleDiffOn',_0x17707e=>_0x17707e?_0x1b9236:_0x28ba8c),_0x1a2d00['bind']('label')['to'](this,'isToggleDiffOn',_0x5e913c=>_0x5e913c?_0x10aa23:_0x78039b),_0x1a2d00['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x1a2d00;}['_createAcceptAllButtonView'](){const _0x25a83a=new _0x2cae14(this['locale']);return _0x25a83a['set']({'label':f(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x25a83a['bind']('isEnabled')['to'](this,'isError',_0x4558a7=>!_0x4558a7),_0x25a83a['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4b309b=>!_0x4b309b),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x7fe76e=>_0x7fe76e)]}}),_0x25a83a['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x25a83a;}['_createExitReviewButtonView'](){const _0x16b618=new _0x2cae14(this['locale']);return _0x16b618['set']({'label':f(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x16b618['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x29f766=>!_0x29f766),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2b61e6=>_0x2b61e6)]}}),_0x16b618['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x16b618;}['_createResultHeaderView'](){const _0x30c3e4=new _0x40a2ba(this['locale']),_0x4d60c9=this['_createTitleView']();return _0x30c3e4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x770e2f=>_0x770e2f)]},'children':[_0x4d60c9,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x30c3e4;}['_createTitleView'](){const _0x1ffcd0=new _0x40a2ba(this['locale']),_0x3fa375=new je();return _0x3fa375['bind']('isVisible')['to'](this,'isResultReady',_0x8173b1=>!_0x8173b1),_0x1ffcd0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x3fa375,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5d9ab3=>_0x5d9ab3)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0xd1e90c=>!_0xd1e90c)]},'children':[{'text':f(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x1ffcd0;}['_createFinishReviewButtonView'](){const _0x1b2b02=new Js(this['locale']);return _0x1b2b02['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0xf90c71=>!_0xf90c71)]}}),_0x1b2b02['delegate']('finishReview')['to'](this),_0x1b2b02;}}class eh extends _0x4e528a{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x318b17){super(_0x318b17),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x1cbfbd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x1cbfbd['if']('isVisible','ck-hidden',_0x1722fa=>!_0x1722fa)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':f(_0x318b17,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x257c0f=new Js(this['locale']);return _0x257c0f['delegate']('finishReview')['to'](this),_0x257c0f;}['_createResultHeaderView'](){const _0x592f9d=new _0x40a2ba(this['locale']);return _0x592f9d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':f(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x592f9d;}}class we extends _0x40a2ba{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x2a619e){super(_0x2a619e),this['reviewModeHeader']=new _0x2be5f1(_0x2a619e,{'label':f(_0x2a619e,'AI_REVIEW_MODE'),'icon':_0x1f8f54,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new $s(_0x2a619e),this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=new sh(_0x2a619e),this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=new eh(_0x2a619e),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-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],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'](_0x1c4784){this['reviewCheckResultsView']['addResult'](_0x1c4784),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;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class ue extends _0x1c3e7b{['resultItemView'];constructor(_0x1ae15d,_0x5b473d){super(_0x1ae15d),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x5b473d['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x48b7c0){this['resultItemView']['changeId']=_0x48b7c0['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x48b7c0['contentDiffed'];}['showBalloon'](_0x12740b,_0xdea9b5){this['updateContent'](_0x12740b),this['show'](),this['pin']({'target':()=>this['_getBestRectPosition'](_0xdea9b5)});}['hideBalloon'](){this['hide'](),this['unpin']();}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_setupClickOutsideHandler'](){ts({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['_createContentView'](){const _0xbc1190=new _0x40a2ba();return this['resultItemView']=new Bs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0xbc1190['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0xbc1190;}['_getBestRectPosition'](_0x228f2c){const _0x368fc0=Array['from'](_0x228f2c['getClientRects']());return _0x368fc0['find'](_0x12f90d=>_0x12f90d['width']>0x0)||_0x368fc0[0x0];}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class re extends _0x5cd1ee{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[$];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x480888){super(_0x480888),this['_bodyCollection']=new Kt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new we(this['context']['locale']),this['_reviewModeView']['delegate'](...ih)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new ue(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x3bceaf=this['context']['plugins']['get']('AITabs');_0x3bceaf['view']['on']('activateTab',(_0x4ae878,_0x13a524)=>{'reviewMode'===_0x13a524?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x3bceaf['view']['addTab']({'id':'reviewMode','buttonLabel':f(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x1f8f54,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x21fbc8){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x21fbc8),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0xb99cf2){_0xb99cf2&&('error-general'!==_0xb99cf2['status']?'error-chunk'!==_0xb99cf2['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x899413){this['_reviewModeView']['addCheckRunResult'](_0x899413);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x13defa,_0x132632){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x13defa,_0x132632);}['setActiveStateInResults'](_0x50fcad){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x1dcaee=>{_0x1dcaee['id']===_0x50fcad&&_0x1dcaee['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x407a62=>_0x407a62['setItemAsInactive']());}['updateChangeState'](_0x382f61,_0x3aa495){'accepted'===_0x3aa495||'rejected'===_0x3aa495||'outdated'===_0x3aa495?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x382f61,_0x3aa495):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x382f61,_0x3aa495);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x143b6c,_0x3135c4){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x143b6c,_0x3135c4);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x267497){const _0x36cd2c=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x1d4a90=>_0x1d4a90['id']===_0x267497);return _0x36cd2c?_0x36cd2c['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const he='reviewmode-';class oe extends _0x5cd1ee{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x5f0575,s];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x2492e1){super(_0x2492e1),this['_domEmitter']=new(_0x12806d())(),this['_eventEmitter']=new(_0xd790fa())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x5c9d97=u(this['context']);_0x5c9d97['conversion']['for']('editingDowncast')['markerToElement']({'model':he+'insert','view':(_0x34159e,{writer:_0x41d30c})=>{const _0x217bc4=this['_markers']['get'](_0x34159e['markerName']),_0x39d07d={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x34159e['markerName']};return _0x41d30c['createUIElement']('span',_0x39d07d,function(_0x44df5a){const _0x3cdc62=this['toDomElement'](_0x44df5a);return _0x3cdc62['innerHTML']=_0x217bc4?.['text']||'',_0x3cdc62;});}}),_0x5c9d97['conversion']['for']('editingDowncast')['markerToHighlight']({'model':he+'remove-only','view':_0x18aaa1=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x18aaa1['markerName']}})}),_0x5c9d97['conversion']['for']('editingDowncast')['markerToHighlight']({'model':he+'remove-context','view':_0x2674f0=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x2674f0['markerName']}})}),_0x5c9d97['conversion']['for']('editingDowncast')['markerToHighlight']({'model':he+'remove-text','view':_0x2db68b=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x2db68b['markerName']}})}),_0x5c9d97['conversion']['for']('dataDowncast')['markerToElement']({'model':he+'suggestion-context','view':(_0x28bc5b,{writer:_0x5d4bdf})=>_0x5d4bdf['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x28bc5b['isOpening']?'start':'end')})}),_0x5c9d97['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x556091,'view':_0x32abca}),this['_domEmitter']['listenTo'](document,'click',(_0x47cb42,_0x1775da)=>{const _0x502c97=_0x1775da['target'],_0xb41fb1=this['_findMarkerElement'](_0x502c97);if(!_0xb41fb1)return;const _0x575fd1=_0xb41fb1['getAttribute']('data-marker-id'),_0x38b5cf=_0x575fd1['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x575fd1,'changeId':_0x38b5cf});}),_0x5c9d97['model']['document']['registerPostFixer'](_0x6dabf0=>this['_validateMarkers'](_0x5c9d97,_0x6dabf0)),_0x5c9d97['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x5c9d97));}['getDocumentData'](){const _0x2f2ffc=this['context']['plugins']['get']('AIEditing'),_0x106d4b=u(this['context']),_0x436b34=_0x106d4b['model'],_0x22d5f9=new _0x9a8814();for(const _0x40249a of _0x436b34['document']['getRoot']()['getChildren']()){const _0x4c189d=_0x40249a['_clone'](!0x0);_0x22d5f9['_appendChild'](_0x4c189d);}for(const _0x7ec685 of _0x436b34['markers'])_0x22d5f9['markers']['set'](_0x7ec685['name'],this['_changeRangeOwnerDocument'](_0x7ec685['getRange']()['clone'](),_0x22d5f9));const _0x383050=new _0xa9e3f4({'ignoreElementEnd':!0x0,'startPosition':_0x436b34['createPositionAt'](_0x22d5f9,0x0)}),_0x1ddf6f=new Set(),_0x310ed1=new Map();for(const {item:_0x48f6d6}of _0x383050){if(!_0x48f6d6['is']('$textProxy'))continue;const _0x325d19=_0x48f6d6['parent'];if((!_0x325d19||!_0x325d19['is']('element','caption'))&&(_0x325d19&&_0x325d19['is']('element'))){let _0x4a79f1=_0x325d19['getAttribute'](_0x556091);_0x4a79f1||(_0x4a79f1=_0x2f2ffc['_nextDataId'](_0x1ddf6f),_0x325d19['_setAttribute'](_0x556091,_0x4a79f1)),_0x1ddf6f['add'](_0x4a79f1);let _0x10a91c=_0x325d19;for(;_0x10a91c['parent']&&!_0x10a91c['parent']['is']('documentFragment');)_0x10a91c=_0x10a91c['parent'],_0x10a91c['hasAttribute'](_0x556091)&&_0x10a91c['_removeAttribute'](_0x556091);_0x310ed1['set'](_0x4a79f1,{'path':_0x325d19['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x10a91c['_clone'](!0x0),_0x4a79f1,_0x106d4b['data'])}),_0x383050['jumpTo'](_0x436b34['createPositionAfter'](_0x325d19));}}return{'content':_0x106d4b['data']['processor']['toData'](_0x106d4b['data']['toView'](_0x22d5f9)),'version':_0x106d4b['model']['document']['version'],'elements':_0x310ed1};}['diffContent'](_0x114755,_0x3b9864){const _0x2ea7fe=[],_0x5bf780=u(this['context']),_0x50a2f6=_0x5bf780['data']['parse'](_0x114755,'$documentFragment'),_0x20ca42=_0x5bf780['model']['createPositionAt'](_0x50a2f6,0x0),_0x4284be=_0x5bf780['data']['parse'](_0x3b9864,'$documentFragment');if(!this['_hasSameTopLevelElement'](_0x50a2f6,_0x4284be))return _0x2ea7fe;const _0x301e6e=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x114755,_0x3b9864,{'anchor':_0x20ca42,'markDeletions':!0x0})['getOperations']()['filter'](_0x554f7e=>'insert'===_0x554f7e['type']||'marker'===_0x554f7e['type']&&_0x554f7e['name']['startsWith']('$markedRemove')),_0x467825=this['_groupAdjacentOperations'](_0x301e6e);let _0x333b68=0x0;return _0x5bf780['model']['change'](_0x42f0b1=>{for(let _0x57c698=0x0;_0x57c698<_0x467825['length'];_0x57c698++){const _0x293d3a=_0x467825[_0x57c698],_0x530acc=_0x42f0b1['createDocumentFragment']();for(const _0x37266c of _0x50a2f6['getChildren']())_0x42f0b1['append'](_0x37266c['_clone'](!0x0),_0x530acc);for(const _0x487e91 of _0x293d3a['operationsIsolated'])if('insert'===_0x487e91['type']){const _0x1f06b2=_0x487e91;_0x1f06b2['baseVersion']=null,_0x1f06b2['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x1f06b2,_0x530acc),_0x42f0b1['batch']['addOperation'](_0x487e91),_0x5bf780['model']['applyOperation'](_0x487e91);const _0x171dcf='suggestion:insertion:id:authorId:'+_0x333b68++,_0x35d79f=_0x5bf780['model']['createRange'](_0x1f06b2['position'],_0x1f06b2['position']['getShiftedBy'](_0x1f06b2['howMany']));_0x530acc['markers']['set'](_0x171dcf,_0x35d79f);}else{if('marker'===_0x487e91['type']&&_0x487e91['name']['startsWith']('$markedRemove')){const _0x25a218=_0x487e91,_0x1868db='suggestion:deletion:id:authorId:'+_0x333b68++;this['_changeOperationOwnerDocument'](_0x25a218,_0x530acc),_0x530acc['markers']['set'](_0x1868db,_0x25a218['newRange']);}}const _0x29a054=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x293d3a['operationsIsolated'][0x0]),_0x530acc),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x293d3a['operationsIsolated'][_0x293d3a['operationsIsolated']['length']-0x1]),_0x530acc));_0x530acc['markers']['set'](he+'suggestion-context',new _0x3ceedb(_0x29a054['start'],_0x29a054['end'])),_0x2ea7fe['push']({..._0x293d3a,'context':this['_createGetContextFn'](_0x530acc,_0x5bf780['data'],{'ellipsisBefore':_0x29a054['hasContentBefore'],'ellipsisAfter':_0x29a054['hasContentAfter']}),'content':this['_createGetContentFn'](_0x530acc,_0x5bf780['data'])});}}),_0x2ea7fe;}['markChangePositionInEditorContent'](_0x4267b9,_0x32a5d7){if(!_0x4267b9['length'])return;const _0x525167=_0x4267b9[0x0]['parent']['id'],_0x1e5267=_0x32a5d7['elements']['get'](_0x525167);if(!_0x1e5267)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x525167);const _0x42f810=_0x1e5267['path'],_0x162677=u(this['context']),_0x406189=_0x162677['model']['document']['history']['getOperations'](_0x32a5d7['version']),_0x4e6c32=[];for(const _0x5bc1c6 of _0x4267b9){const _0x2af704=_0x5bc1c6['operationsIsolated']['map'](_0x5976de=>this['_translateOperationToEditorContent'](_0x5976de,_0x42f810,_0x162677['model']['document']['getRoots']()[0x0]));if(!_0x2af704||!_0x2af704['length'])continue;const _0x52dc18=_0x2af704['every'](_0x47b3d8=>'marker'===_0x47b3d8['type']&&_0x47b3d8['name']['startsWith']('$markedRemove')),_0x69687b={'document':_0x162677['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x263b79=_0x461ccc(_0x2af704,_0x406189,_0x69687b)['operationsA'];for(const _0x1d8bc3 of _0x263b79)if('insert'===_0x1d8bc3['type']){const _0x158a95=_0x1d8bc3,_0x487a1e=_0x158a95['nodes'];let _0x5efdcc='';for(const _0x20f442 of _0x487a1e)_0x20f442&&_0x20f442['is']('model:$text')&&(_0x5efdcc+=_0x20f442['data']);_0x4e6c32['push']({'start':_0x158a95['position'],'end':_0x158a95['position'],'type':'insert','groupId':_0x5bc1c6['id'],'text':_0x5efdcc});}else{if('marker'===_0x1d8bc3['type']&&_0x1d8bc3['name']['startsWith']('$markedRemove')){const _0x3df88d=_0x1d8bc3;let _0x5ae8f0='remove-text';if(_0x52dc18){const _0x59b123=this['_findAdjacentContextDistance'](_0x3df88d['newRange']['start'],'backward',_0x162677['model']['schema']),_0x2f514a=this['_findAdjacentContextDistance'](_0x3df88d['newRange']['end'],'forward',_0x162677['model']['schema']);if(_0x59b123||_0x2f514a){const _0x3ccb8c=_0x3df88d['newRange']['start']['getShiftedBy'](-_0x59b123),_0x161772=_0x3df88d['newRange']['end']['getShiftedBy'](_0x2f514a);_0x4e6c32['push']({'start':_0x3ccb8c,'end':_0x161772,'groupId':_0x5bc1c6['id'],'type':'remove-context'});}else _0x5ae8f0='remove-only';}_0x4e6c32['push']({'start':_0x3df88d['newRange']['start'],'end':_0x3df88d['newRange']['end'],'groupId':_0x5bc1c6['id'],'type':_0x5ae8f0});}}}this['_insertMarkers'](_0x4e6c32);}['clearAllMarkers'](){const _0x369955=u(this['context']);_0x369955['model']['change'](_0xff6d8b=>{for(const _0x4017f7 of this['_markers']['keys']())_0x369955['model']['markers']['get'](_0x4017f7)&&_0xff6d8b['removeMarker'](_0x4017f7);}),this['_markers']['clear']();}['switchToReadOnly'](){u(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){u(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x5a3169){const _0x4cbb2d=u(this['context']),_0x38f48b=_0x4cbb2d['model'],_0x802b49=_0x5a3169['map'](_0x356571=>this['_getMarkersDataForGroup'](_0x356571))['flat']();_0x38f48b['change'](_0x194bd2=>{for(const _0x17cc13 of _0x802b49){const _0x1115c9=_0x4cbb2d['model']['markers']['get'](_0x17cc13['id']);_0x1115c9&&('insert'===_0x17cc13['type']?_0x38f48b['insertContent'](_0x194bd2['createText'](_0x17cc13['text']||''),_0x1115c9['getRange']()['start']):'remove-text'!==_0x17cc13['type']&&'remove-only'!==_0x17cc13['type']||_0x38f48b['deleteContent'](_0x38f48b['createSelection'](_0x1115c9['getRange']())),_0x194bd2['removeMarker'](_0x17cc13['id']),this['_markers']['delete'](_0x17cc13['id']));}});}['rejectChange'](_0x46bc3c){const _0x2a141d=u(this['context']),_0x28d9b1=this['_getMarkersDataForGroup'](_0x46bc3c);_0x2a141d['model']['change'](_0x368693=>{for(const _0x4df789 of _0x28d9b1)_0x368693['removeMarker'](_0x4df789['id']),this['_markers']['delete'](_0x4df789['id']);});}['getEditor'](){return u(this['context']);}['getMarkerElementForChange'](_0x16a288){const _0x585cdc=Array['from'](this['_markers']['values']())['filter'](_0x4775a2=>_0x4775a2['groupId']===_0x16a288);if(!_0x585cdc['length'])return null;const _0x98ca3f=0x1===_0x585cdc['length']?_0x585cdc[0x0]:this['_sortMarkers'](_0x585cdc)[0x0],_0x1c7870=u(this['context']),_0x2f28b0=_0x1c7870['model']['markers']['get'](_0x98ca3f['id']);if(!_0x2f28b0)return null;const _0x508060=_0x2f28b0['getRange'](),_0x15f025=_0x1c7870['editing']['view']['getDomRoot']();if(!_0x15f025||!_0x508060)return null;const _0x1974d3=_0x15f025['querySelector']('[data-marker-id=\x22'+_0x98ca3f['id']+'\x22]');return _0x1974d3?{'modelRange':_0x508060,'domElement':_0x1974d3}:null;}['_validateMarkers'](_0x190a67,_0x576eae){const _0x16ab21=Array['from'](this['_markers']['keys']()),_0x278320=new Map();for(const _0x33f9f0 of _0x16ab21){const _0x3d8890=_0x190a67['model']['markers']['get'](_0x33f9f0);if(!_0x3d8890)continue;const _0x3b93fb=_0x3d8890['getStart']()['path'][0x0];_0x278320['has'](_0x3b93fb)||_0x278320['set'](_0x3b93fb,[]),_0x278320['get'](_0x3b93fb)['push'](_0x3d8890);}const _0x5086a3=new Set();for(const _0x2cae70 of _0x190a67['model']['document']['differ']['getChanges']()){let _0x3800eb=-0x1,_0x4cabca=null;if('insert'===_0x2cae70['type'])_0x4cabca=new _0x3ceedb(_0x2cae70['position'],_0x2cae70['position']['getShiftedBy'](_0x2cae70['length'])),_0x3800eb=_0x2cae70['position']['path'][0x0];else{if('remove'!==_0x2cae70['type'])continue;_0x4cabca=new _0x3ceedb(_0x2cae70['position']),_0x3800eb=_0x2cae70['position']['path'][0x0];}const _0x897be7=_0x278320['get'](_0x3800eb)||[];if(_0x897be7['length']){for(const _0x48ec77 of _0x897be7)if(_0x4cabca['root']['rootName']===_0x48ec77['getRange']()['root']['rootName']&&('insert'!==_0x2cae70['type']||!_0x4cabca['containsRange'](_0x48ec77['getRange']()))&&(_0x4cabca['isIntersecting'](_0x48ec77['getRange']())||_0x4cabca['start']['isTouching'](_0x48ec77['getRange']()['end'])||_0x4cabca['end']['isTouching'](_0x48ec77['getRange']()['start']))){const _0x55534c=this['_parseMarkerName'](_0x48ec77['name']);Array['from'](this['_markers']['values']())['filter'](_0x46a5c8=>_0x46a5c8['groupId']===_0x55534c['groupId'])['forEach'](_0x3b30f4=>_0x5086a3['add'](_0x3b30f4['id']));}}}if(_0x5086a3['size']){for(const _0x49ac8d of _0x5086a3)_0x576eae['removeMarker'](_0x49ac8d);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x44f665){for(const {name:_0x449c4b,data:_0x46ca5e}of _0x44f665['model']['document']['differ']['getChangedMarkers']()){if(!_0x449c4b['startsWith'](he))continue;const _0x41b5dd=_0x46ca5e['oldRange'],_0x4b6374=_0x46ca5e['newRange'],_0x678ba=_0x41b5dd&&'$graveyard'===_0x41b5dd['root']['rootName'],_0x18ee9c=_0x4b6374&&'$graveyard'===_0x4b6374['root']['rootName'];if(_0x678ba&&_0x18ee9c)continue;const _0x4fda25=this['_parseMarkerName'](_0x449c4b);this['_markers']['get'](_0x449c4b)&&(_0x18ee9c||!_0x4b6374?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x449c4b,'changeId':_0x4fda25['groupId']}):_0x678ba&&_0x4b6374&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x449c4b,'changeId':_0x4fda25['groupId']}));}}['_parseMarkerName'](_0x5ad9f5){const _0x514ae1=_0x5ad9f5['split'](':'),_0x32f8e0=(_0x514ae1[0x1]||'')['split']('_');return{'prefix':_0x514ae1[0x0],'groupId':_0x32f8e0[0x0],'suffix':_0x32f8e0[0x1]};}['_translateOperationToEditorContent'](_0x1a96ef,_0x3de3d4,_0xb0f0d1){if('insert'===_0x1a96ef['type']){const _0x28f241=_0x1a96ef;return new _0x5e4fdf(this['_changePosition'](_0x3de3d4['concat'](_0x28f241['position']['offset']),_0xb0f0d1),_0x28f241['nodes'],_0x28f241['baseVersion']);}if('marker'===_0x1a96ef['type']&&_0x1a96ef['name']['startsWith']('$markedRemove')){const _0x27c718=_0x1a96ef;return new _0x387f51(_0x27c718['name'],_0x27c718['oldRange'],this['_changeRange'](_0x27c718['newRange'],_0x3de3d4['concat'](_0x27c718['newRange']['start']['offset']),_0x3de3d4['concat'](_0x27c718['newRange']['end']['offset']),_0xb0f0d1),_0x27c718['_markers'],_0x27c718['affectsData'],_0x27c718['baseVersion']);}return _0x1a96ef;}['_groupAdjacentOperations'](_0x1af0c0){if(!_0x1af0c0['length'])return[];const _0x57adf6=[];let _0x2b036e=0x0,_0x31ba15=0x0,_0x27ca68=[];for(let _0x3ba4e2=0x0;_0x3ba4e2<=_0x1af0c0['length'];_0x3ba4e2++){const _0xfbfdda=_0x1af0c0[_0x3ba4e2],_0x41b08b=_0x1af0c0[_0x3ba4e2-0x1];!_0xfbfdda||_0x41b08b&&!this['_getOperationEnd'](_0x41b08b)['isTouching'](this['_getOperationStart'](_0xfbfdda))?(_0x57adf6['push']({'operations':_0x27ca68,'operationsIsolated':_0x27ca68['map'](_0x47343f=>this['_shiftOperation'](_0x47343f['clone'](),-_0x31ba15)),'groupOffset':_0x2b036e}),_0x27ca68=_0xfbfdda?[_0xfbfdda]:[],_0x31ba15+=_0x2b036e,_0x2b036e=0x0):_0x27ca68['push'](_0xfbfdda),_0xfbfdda&&'insert'===_0xfbfdda['type']&&(_0x2b036e+=_0xfbfdda['howMany']);}return _0x57adf6;}['_findAdjacentContextDistance'](_0x569858,_0x1e20c2,_0x8a6881,_0x32063a=0x1){const _0x4089ee=new _0xa9e3f4({'startPosition':_0x569858,'direction':_0x1e20c2});let _0x2f2bcb=0x0;for(let _0x2a2795=0x0;_0x2a2795<_0x32063a;_0x2a2795++){let _0x2f96a3=0x0,_0x336ba9=!0x1,_0x4b1b6d='forward'===_0x1e20c2?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x26ca3e}of _0x4089ee)if(_0x26ca3e['is']('$textProxy')){const _0x27cb8a=_0x4b1b6d['exec'](_0x26ca3e['data']);if(_0x27cb8a&&_0x27cb8a['length']){if(_0x2f96a3+='forward'===_0x1e20c2?_0x27cb8a['index']+_0x27cb8a[0x0]['length']:_0x26ca3e['data']['length']-_0x27cb8a['index'],_0x27cb8a[0x0]['length']!==_0x26ca3e['data']['length'])break;_0x336ba9=!0x0,_0x4b1b6d='forward'===_0x1e20c2?/^\w+/:/\w+$/;}else{if(_0x336ba9)break;_0x2f96a3+=_0x26ca3e['offsetSize'];}}else{if(_0x26ca3e['is']('element')){_0x8a6881['isInline'](_0x26ca3e)&&!_0x336ba9&&(_0x2f96a3+=0x1);break;}}_0x2f2bcb+=_0x2f96a3,_0x4089ee['jumpTo'](_0x569858['getShiftedBy']('forward'===_0x1e20c2?_0x2f2bcb:-_0x2f2bcb));}return _0x2f2bcb;}['_getChangeContext'](_0x8bf6cd,_0x220b8f){const _0x3fdce0=u(this['context'])['model']['schema'],_0x19cd07=this['_findAdjacentContextDistance'](_0x8bf6cd,'backward',_0x3fdce0,0x6),_0x13843f=this['_findAdjacentContextDistance'](_0x220b8f,'forward',_0x3fdce0,0x6),_0x335f85=_0x8bf6cd['getShiftedBy'](-_0x19cd07),_0xc596fa=_0x220b8f['getShiftedBy'](_0x13843f);return{'start':_0x335f85,'end':_0xc596fa,'hasContentBefore':!_0x335f85['isAtStart'],'hasContentAfter':!_0xc596fa['isAtEnd']};}['_insertMarkers'](_0x1b3e7f){const _0x620f3a=this['context']['plugins']['get']('AIEditing'),_0x17a4d8=new Set();u(this['context'])['model']['change'](_0x671f02=>{for(const _0x43f590 of _0x1b3e7f){const _0x25d86d=''+he+_0x43f590['type']+':'+_0x43f590['groupId']+'_'+_0x620f3a['_nextDataId'](_0x17a4d8);this['_markers']['set'](_0x25d86d,{'id':_0x25d86d,'groupId':_0x43f590['groupId'],'type':_0x43f590['type'],'text':_0x43f590['text']}),_0x671f02['addMarker'](_0x25d86d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x671f02['createRange'](_0x43f590['start'],_0x43f590['end'])});}});}['_createGetContextFn'](_0x3405d9,_0x2de238,_0x570ae2){let _0x6fac0b='';return()=>{if(!_0x6fac0b){const _0x270018=_0x2de238['toView'](_0x3405d9,{'showSuggestionHighlights':!0x0}),_0x495ff5=_0x270018['getChild'](0x0);if(!_0x495ff5)return'';let _0x5b6e69=!0x1;const _0x37a71b=[];for(const _0x5505ef of _0x495ff5['getChildren']())_0x5505ef['is']('element','span')&&_0x5505ef['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x5b6e69=!0x1),_0x5b6e69&&_0x37a71b['push'](_0x5505ef),_0x5505ef['is']('element','span')&&_0x5505ef['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x5b6e69=!0x0);_0x495ff5['_removeChildren'](0x0,_0x495ff5['childCount']),_0x570ae2?.['ellipsisBefore']&&_0x495ff5['_appendChild']('…'),_0x495ff5['_appendChild'](_0x37a71b),_0x570ae2?.['ellipsisAfter']&&_0x495ff5['_appendChild']('…');const _0x4528b6=_0x2de238['htmlProcessor']['domConverter']['viewToDom'](_0x270018),_0x21f409=_0x2de238['htmlProcessor']['htmlWriter']['getHtml'](_0x4528b6);_0x6fac0b=_0x21f409;}return _0x6fac0b;};}['_createGetContentFn'](_0x51e91d,_0x485fb1){let _0x21dadd='';return()=>(_0x21dadd||(_0x21dadd=_0x485fb1['stringify'](_0x51e91d,{'showSuggestionHighlights':!0x0})),_0x21dadd);}['_createGetContentUsingDataIdFn'](_0x2f492d,_0xa2b7f,_0x4fa32a){let _0x4489ab='';return()=>{if(!_0x4489ab){const _0xbe0744=_0x4fa32a['toView'](new _0x9a8814(_0x2f492d)),_0x1a6c8e=_0x4fa32a['htmlProcessor']['domConverter']['viewToDom'](_0xbe0744)['querySelector']('[data-id=\x22'+_0xa2b7f+'\x22]');_0x4489ab=_0x1a6c8e?.['outerHTML']||'';}return _0x4489ab;};}['_findMarkerElement'](_0x1207c2,_0x57f61b=0x5){let _0x9a38ec=_0x1207c2,_0x8a1784=null;for(let _0x2343da=0x0;_0x2343da<_0x57f61b&&_0x9a38ec;_0x2343da++){if(!_0x9a38ec['className']){_0x9a38ec=_0x9a38ec['parentElement'];continue;}if(!(''+_0x9a38ec['className'])['includes']('ck-ai_review-mode-marker_')){_0x9a38ec=_0x9a38ec['parentElement'];continue;}if(!_0x9a38ec['getAttribute']('data-marker-id'))break;_0x8a1784=_0x9a38ec;break;}return _0x8a1784;}['_getMarkersDataForGroup'](_0x5a3168){return Array['from'](this['_markers']['values']())['filter'](_0x5685a7=>_0x5685a7['groupId']===_0x5a3168);}['_getOperationStart'](_0x18e208){return'insert'===_0x18e208['type']?_0x18e208['position']:_0x18e208['newRange']['start'];}['_getOperationEnd'](_0x2af86f,_0x4c6af9=!0x1){return'insert'===_0x2af86f['type']?_0x4c6af9?_0x2af86f['position']:_0x2af86f['position']['getShiftedBy'](_0x2af86f['howMany']):_0x2af86f['newRange']['end'];}['_shiftOperation'](_0x4b5bed,_0xdfaef1){return'insert'===_0x4b5bed['type']?_0x4b5bed['position']=_0x4b5bed['position']['getShiftedBy'](_0xdfaef1):'marker'===_0x4b5bed['type']&&_0x4b5bed['newRange']&&(_0x4b5bed['newRange']=new _0x3ceedb(_0x4b5bed['newRange']['start']['getShiftedBy'](_0xdfaef1),_0x4b5bed['newRange']['end']['getShiftedBy'](_0xdfaef1))),_0x4b5bed;}['_changeOperationOwnerDocument'](_0x394c40,_0x579699){'insert'===_0x394c40['type']?_0x394c40['position']=this['_changePositionOwnerDocument'](_0x394c40['position'],_0x579699):'marker'===_0x394c40['type']&&_0x394c40['newRange']&&(_0x394c40['newRange']=this['_changeRangeOwnerDocument'](_0x394c40['newRange'],_0x579699));}['_changePositionOwnerDocument'](_0x1601bd,_0x54a84a){return new _0x110b0b(_0x54a84a,_0x1601bd['path']);}['_changeRangeOwnerDocument'](_0x5d85e8,_0x14a00c){return new _0x3ceedb(this['_changePositionOwnerDocument'](_0x5d85e8['start'],_0x14a00c),this['_changePositionOwnerDocument'](_0x5d85e8['end'],_0x14a00c));}['_changePosition'](_0x5afc58,_0x1b1066){return new _0x110b0b(_0x1b1066,[..._0x5afc58]);}['_changeRange'](_0x1f9816,_0x26efbf,_0x496754,_0x1e0ddd){return new _0x3ceedb(this['_changePosition'](_0x26efbf,_0x1e0ddd),this['_changePosition'](_0x496754,_0x1e0ddd));}['_sortMarkers'](_0x1105ec){const _0x38d701=_0x466430=>{switch(_0x466430){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x1105ec['sort']((_0x4b9f5e,_0x2e9de7)=>_0x38d701(_0x4b9f5e['type'])-_0x38d701(_0x2e9de7['type']));}['_hasSameTopLevelElement'](_0x108a44,_0x2b047c){const _0x194044=_0x108a44['getChild'](0x0),_0x19815c=_0x2b047c['getChild'](0x0);return!(!_0x194044||!_0x19815c)&&((!_0x194044['is']('element')||!_0x19815c['is']('element')||_0x194044['name']===_0x19815c['name'])&&!(_0x194044['is']('element')&&!_0x19815c['is']('element')||!_0x194044['is']('element')&&_0x19815c['is']('element')));}}class Ka extends _0x5cd1ee{static get['requires'](){return[ie,re,oe];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ji as AIActions,li as AIAdapter,qn as AIAssistant,ee as AIAssistantUI,N as AIBalloon,Ua as AIChat,q as AIChatController,F as AIChatHistory,ct as AIChatHistoryController,mt as AIChatHistoryUI,M as AIChatUI,o as AIConnector,s as AIEditing,Va as AIEditorIntegration,Nt as AIQuickActionType,Ba as AIQuickActions,gi as AIQuickActionsUI,tr as AIRequestError,js as AIReviewCheck,Rs as AIReviewCheckResult,Ts as AIReviewCheckRun,Ka as AIReviewMode,ie as AIReviewModeController,oe as AIReviewModeEditing,re as AIReviewModeUI,$ as AITabs,Te as AITextAdapter,bt as AIToggleButtonUI,zn as AWSTextAdapter,Xn as OpenAITextAdapter,hi as ShowAIAssistantCommand,co as ToggleAICommand,ms as createResizeButton,Qn as getDefaultAICommands};
|