@ckeditor/ckeditor5-ai 47.2.0-alpha.5 → 47.2.0-alpha.7
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/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +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/legacyerrors.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/aiassistant/utils/common-translations.js +1 -1
- package/src/aiassistant/utils/normalizecommandsconfig.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.d.ts +10 -2
- 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/aicontext.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/aispinner.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/common-translations.js +1 -1
- package/src/aicore/utils/createresizebutton.js +1 -1
- package/src/aicore/utils/documentposition.js +1 -1
- package/src/aicore/utils/documentrange.js +1 -1
- package/src/aicore/utils/eventnames.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/aireviewcheckdefinitions.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/aireviewcheck.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/model/aireviewcustomcheckrun.js +1 -1
- package/src/aireviewmode/model/aireviewsystemcheckrun.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/aitabsmainview.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/src/errors.js +1 -1
- package/src/index.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x523b53,Command as Qt,ContextPlugin as _0x3e59e0,Editor as pt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2ff693,IconCheck as _0x1e5ca3,IconError as _0x33935c,IconSubmit as _0x55a39b,IconAIHistory as Nt,IconMagicWand as _0x30e9c9,IconRobotPencil as _0x3b7522,IconMaximize as _0x4b4d07,IconMinimize as to,IconDocumentWithLoupe as _0x12e44a,IconAddComment as _0x2ce81a,IconShowChangesOn as _0x5a81f7,IconShowChangesOff as _0x200214,IconDocument as _0x46c616,IconThreeStars as _0x229815,IconRemove as _0x3d4b82,IconDocumentWithCheckmark as _0x4569af,IconDocumentWithCross as _0x3aefaf,IconLoupe as _0x2fb97a,IconCancel as _0x1c533a,IconStop as _0x31e03f,IconAIChat as Ht,IconPlus as _0x1294ec,IconPin as _0x407c66,IconThreeHorizontalDots as _0x3ad428,IconChevronRight as _0x8e6677,IconInfo as _0x586da8,IconOutdated as _0x2e680e,IconEye as _0xa784bf,IconEyeCrossedOut as _0xcbe20c,IconAIReview as _0x3a6d6a}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x1a633f,CKEditorError as _0x2120c6,ObservableMixin as ts,global as _0x31e929,isVisible as _0x2148f8,Rect as _0x11a5d6,Collection as _0x2afc13,FocusTracker as _0x51df1c,KeystrokeHandler as _0x3116d1,first as _0x19de19,toArray as _0x1b1674,EmitterMixin as _0x27cb74,logWarning as _0x218a11,scrollViewportToShowTarget as _0x1966fd,logError as ft,ResizeObserver as _0x2db29b,_isMotionReduced as Pt,scrollAncestorsToShowTarget as _0x299a6f,DomEmitterMixin as _0x48baa5}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0xf901f6,ButtonView as _0x290cbd,View as _0x3249c4,SpinnerView as _0x1fde3a,IconView as _0xf03b05,AutocompleteView as _0xa69052,ListView as _0x36c9a6,ListItemGroupView as _0x4bc919,ListItemView as _0x36570a,ButtonLabelView as _0x366752,FocusCycler as _0x504985,createLabeledTextarea as _0x227b28,Dialog as _0x3251e6,createDropdown as _0x1bd241,addMenuToDropdown as _0x3b2bdf,MenuBarMenuView as _0x252d57,MenuBarMenuListItemButtonView as _0x1854a6,DialogViewPosition as _0x4320e4,MenuBarMenuListView as _0x4dc9a7,MenuBarMenuListItemView as _0x514c3b,UIModel as _0x32dcb3,SplitButtonView as _0x351feb,BalloonPanelView as _0x1a6e6e,BodyCollection as _0x52097e,clickOutsideHandler as _0x178524,ListItemButtonView as _0x19db8a,ViewCollection as _0x33c41f,addListToDropdown as _0x710699,submitHandler as _0x25650d,LabeledFieldView as _0x12f7b2,createLabeledInputText as _0x30f559,FormHeaderView as _0x4aec09,HighlightedTextView as _0x1e2340,FileDialogButtonView as _0x685a49,InputTextView as _0x5842c8,SearchTextView as _0x43e520,DropdownMenuButtonView as _0x37fdbe,DropdownMenuPanelPositioningFunctions as _0x2b47cb,BalloonToolbar as _0xfe80ce,FormRowView as _0x4507eb,TextareaView as _0x475ed3}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x256e3e,ClipboardMarkersUtils as _0xa0c8e7}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x3777ec,ViewDataTransfer as _0x53f5cd,ViewUpcastWriter as _0x876d75,Matcher as _0x1e8df8,_DetachOperation as lt,_insertIntoModelNodeList as _0x319d9f,_removeFromModelNodeList as _0x580020,ModelRange as ht,ViewDowncastWriter as kt,transformOperationSets as ut,ModelDocumentFragment as at,ModelPosition as ct,ModelTreeWalker as _0x20a667,InsertOperation as _0x3c78ee,MarkerOperation as _0x1cd1bb}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x3c4eee,escape as _0x3739ad,escapeRegExp as _0xc3d813}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x46e017,InvokeModelWithResponseStreamCommand as _0x366721,InvokeModelCommand as _0x293e8}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x2baa55}from'htmlparser2';import{isTag as _0x42188e,findOne as wt,getParent as _0x3f6b40,findAll as _0x4858d0,removeElement as _0x55953c,replaceElement as _0x34bc5c,prepend as _0x7c35e5,prependChild as _0x3041bd,appendChild as _0xfe36b5,append as _0x5e4053,find as _0x3ea95c,isComment as _0x30ecdc,getChildren as _0x5b007a,textContent as _0x24b4a1}from'domutils';import _0x20a8a4 from'dom-serializer';import{Document as Rt,Element as _0x5b1b92,Text as _0x11e22c,cloneNode as _0x3fb256,isDocument as _0xfe47fd,isText as _0x545970,NodeWithChildren as _0x1289a2}from'domhandler';import{MarkdownGfmMdToHtml as _0x2614eb}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x5068aa,getAllMarkersDomElementsSorted as _0x46d27c,DocumentCompare as nt,DATA_ID_MODEL_ATTRIBUTE as Tt,ConfirmMixin as _0x543c36,LateFocusDropdownButtonView as _0x3ce694,DATA_ID_VIEW_ATTRIBUTE as _0x319184}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x4f6d80}from'es-toolkit';import{IconThumbUp as _0x41a339,IconThumbDown as _0x1b174c,IconCopy as _0x340a5f,IconCheck as _0x576672,IconShowChangesOff as tt,IconShowChangesOn as _0x1ca93a,IconWeb as _0x51778b,IconNextArrow as _0x53b3de,IconPreviousArrow as _0x2c7390,IconAI as Ot,IconClose as _0x4ac77e,IconSelection as _0xe5307b,IconFileUpload as _0x2ceb48,IconLink as _0x482077,IconDocument as _0x4aad50,IconBulb as _0x208bf9,IconDocumentOutline as _0x369ba5,IconPaperClip as _0x5b5f77,IconBrowseFiles as _0x5d443a,IconDropdownArrow as _0x43b007,IconAIAskAI as _0x3b3ac0,IconAIQuickActions as _0x52c472,IconAIChatCommands as Wt,IconAIImproveWriting as Vt,IconAIContinueWriting as Bt,IconAIGrammarCheck as Jt,IconAIAdjustLength as Kt,IconAIChangeTone as Gt,IconAITranslate as Zt,IconAIOther as Xt,IconRefresh as _0x446f03}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x14fc40 from'morphdom';import{SuggestionsConversion as zt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0xbde583}from'diff';const K='_ungrouppedCommands';function o(_0x3ae3b2,_0x44b32e){const _0x17922b=(0x0,_0x44b32e['t'])('Other');return _0x3ae3b2['length']?'groupId'in _0x3ae3b2[0x0]?_0x3ae3b2:[{'groupId':K,'groupLabel':_0x17922b,'order':0x1/0x0,'commands':_0x3ae3b2}]:[{'groupId':K,'groupLabel':_0x17922b,'order':0x1/0x0,'commands':[]}];}const Fn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x523b53{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5aa613}=this,_0x27271d=['ck-fake-ai-selection'];_0x5aa613['config']['get']('ai.assistant.useTheme')&&_0x27271d['push']('ck-ai-assistant-ui_theme'),_0x5aa613['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x27271d,'priority':0xc}}),_0x5aa613['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x3529f1,{writer:_0x527321})=>{if(!_0x3529f1['markerRange']['isCollapsed'])return null;const _0x3c6f70=_0x527321['createUIElement']('span');return _0x527321['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3c6f70),_0x3c6f70;}});}['afterInit'](){!async function(_0x4809c7){const _0x32d795=_0x20335b([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]),_0xbe783a=0x3dffc4e1,_0x573428=0x3df8bce9^_0xbe783a,_0x3ec219=window[_0x20335b([0x44,0x61,0x74,0x65])][_0x20335b([0x6e,0x6f,0x77])](),_0x3c0868=_0x4809c7[_0x20335b([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x570fe5=new window[(_0x20335b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x50ab4a=>{_0x3c0868[_0x20335b([0x6f,0x6e,0x63,0x65])](_0x20335b([0x72,0x65,0x61,0x64,0x79]),_0x50ab4a);}),_0x2ca318={[_0x20335b([0x6b,0x74,0x79])]:_0x20335b([0x45,0x43]),[_0x20335b([0x75,0x73,0x65])]:_0x20335b([0x73,0x69,0x67]),[_0x20335b([0x63,0x72,0x76])]:_0x20335b([0x50,0x2d,0x32,0x35,0x36]),[_0x20335b([0x78])]:_0x20335b([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]),[_0x20335b([0x79])]:_0x20335b([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]),[_0x20335b([0x61,0x6c,0x67])]:_0x20335b([0x45,0x53,0x32,0x35,0x36])},_0x32af21=_0x3c0868[_0x20335b([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x20335b([0x67,0x65,0x74])](_0x20335b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x50e632(){let _0x3d6abb,_0x1824f6=null,_0x14c792=null;try{if(_0x32af21==_0x20335b([0x47,0x50,0x4c]))return _0x20335b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3d6abb=_0x1cebe0(),!_0x3d6abb)return _0x20335b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3d6abb[_0x20335b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x14c792=_0xa48326(_0x3d6abb[_0x20335b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3d6abb[_0x20335b([0x6a,0x74,0x69])])),await _0x2fa9f2()?_0x5769d0()?_0x359913()?_0x20335b([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x5e7640()?(_0x3d6abb[_0x20335b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x20335b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1824f6=_0xa4245f(_0x20335b([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x3d6abb[_0x20335b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x20335b([0x74,0x72,0x69,0x61,0x6c])&&(_0x1824f6=_0xa4245f(_0x20335b([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x5d09bb()):_0x20335b([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x20335b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x20335b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x20335b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x359913(){const _0x1c3b36=[_0x20335b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x20335b([0x74,0x72,0x69,0x61,0x6c])][_0x20335b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3d6abb[_0x20335b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3ec219/0x3e8:0xe10*_0x573428;return _0x3d6abb[_0x20335b([0x65,0x78,0x70])]<_0x1c3b36;}function _0x5769d0(){const _0x9d8e9c=_0x3d6abb[_0x20335b([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x9d8e9c&&(!!_0x9d8e9c[_0x20335b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x20335b([0x2a]))||!!_0x9d8e9c[_0x20335b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x20335b([0x41,0x49])));}function _0x5e7640(){const _0x3a3d2b=_0x3d6abb[_0x20335b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3a3d2b||0x0==_0x3a3d2b[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1dd43e}=new URL(window[_0x20335b([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3a3d2b[_0x20335b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1dd43e))return!0x0;const _0x53ce31=_0x1dd43e[_0x20335b([0x73,0x70,0x6c,0x69,0x74])](_0x20335b([0x2e]));return _0x3a3d2b[_0x20335b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1d6390=>_0x1d6390[_0x20335b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x20335b([0x2a])))[_0x20335b([0x6d,0x61,0x70])](_0x2cc0e8=>_0x2cc0e8[_0x20335b([0x73,0x70,0x6c,0x69,0x74])](_0x20335b([0x2e])))[_0x20335b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x324f5a=>_0x324f5a[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x53ce31[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x20335b([0x6d,0x61,0x70])](_0x4376ea=>Array(_0x53ce31[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x4376ea[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x20335b([0x66,0x69,0x6c,0x6c])](_0x4376ea[0x0]===_0x20335b([0x2a])?_0x20335b([0x2a]):'')[_0x20335b([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x4376ea))[_0x20335b([0x73,0x6f,0x6d,0x65])](_0x33fa52=>_0x53ce31[_0x20335b([0x65,0x76,0x65,0x72,0x79])]((_0x3567ff,_0x59fe51)=>_0x33fa52[_0x59fe51]===_0x3567ff||_0x33fa52[_0x59fe51]===_0x20335b([0x2a])));}function _0x5d09bb(){return _0x1824f6&&_0x14c792?new window[(_0x20335b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1cbf82,_0x3993c1)=>{_0x1824f6[_0x20335b([0x74,0x68,0x65,0x6e])](_0x1cbf82,_0x3993c1),_0x14c792[_0x20335b([0x74,0x68,0x65,0x6e])](_0x51d0c6=>{_0x51d0c6!=_0x20335b([0x56,0x61,0x6c,0x69,0x64])&&_0x1cbf82(_0x51d0c6);},_0x3993c1);}):_0x1824f6||_0x14c792||_0x20335b([0x56,0x61,0x6c,0x69,0x64]);}}function _0xa48326(_0x14eda7,_0xd76f2b){return new window[(_0x20335b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xf40069=>{if(_0x359703())return _0xf40069(_0x20335b([0x56,0x61,0x6c,0x69,0x64]));_0x3dd19f(),_0x3c0868[_0x20335b([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x20335b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x48d62e=!0x1;const _0x182551=_0x1a633f();function _0x356d55(_0x317779){return!!_0x317779&&(typeof _0x317779===_0x20335b([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x317779===_0x20335b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x317779[_0x20335b([0x74,0x68,0x65,0x6e])]===_0x20335b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x317779[_0x20335b([0x63,0x61,0x74,0x63,0x68])]===_0x20335b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x412ece(_0x37c96f){_0x996146(_0x37c96f)[_0x20335b([0x74,0x68,0x65,0x6e])](_0x57ede6=>{if(!_0x57ede6||_0x57ede6[_0x20335b([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x20335b([0x6f,0x6b]))return _0x20335b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xe45f50(_0xb46259(_0x182551+_0xd76f2b))!=_0x57ede6[_0x20335b([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x20335b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x20335b([0x56,0x61,0x6c,0x69,0x64]);})[_0x20335b([0x74,0x68,0x65,0x6e])](_0x42b5e2=>(_0x441d2f(),_0x42b5e2),()=>{const _0x371aa3=_0x368a6e();return null==_0x371aa3?(_0x441d2f(),_0x20335b([0x56,0x61,0x6c,0x69,0x64])):_0x20335b(_0x3ec219-_0x371aa3>(0x19f340e1^_0xbe783a)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x20335b([0x74,0x68,0x65,0x6e])](_0xf40069)[_0x20335b([0x63,0x61,0x74,0x63,0x68])](()=>{_0xf40069(_0x20335b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1b0d4e=0x3dc92a61^_0xbe783a;function _0x441d2f(){const _0x2845a3=_0x20335b([0x6c,0x6c,0x63,0x74,0x2d])+_0xe45f50(_0xb46259(_0x14eda7)),_0x16b5e7=_0x5a43f0(_0xe45f50(window[_0x20335b([0x4d,0x61,0x74,0x68])][_0x20335b([0x63,0x65,0x69,0x6c])](_0x3ec219/_0x1b0d4e)));window[_0x20335b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x20335b([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2845a3,_0x16b5e7);}function _0x368a6e(){const _0x2b9ebb=_0x20335b([0x6c,0x6c,0x63,0x74,0x2d])+_0xe45f50(_0xb46259(_0x14eda7)),_0x54a949=window[_0x20335b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x20335b([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2b9ebb);return _0x54a949?window[_0x20335b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5a43f0(_0x54a949),0x10)*_0x1b0d4e:null;}function _0x996146(_0x32b1a1){return new window[(_0x20335b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x164e02,_0x5aea64)=>{_0x32b1a1[_0x20335b([0x74,0x68,0x65,0x6e])](_0x164e02,_0x5aea64),window[_0x20335b([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5aea64,0x3dfe1021^_0xbe783a);});}}_0x3c0868[_0x20335b([0x6f,0x6e])](_0x20335b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x4ff636,_0x3df39a)=>{if(_0x3df39a[0x0]!=_0x14eda7)return _0xf40069(_0x20335b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3df39a[0x1]={..._0x3df39a[0x1],[_0x20335b([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x182551};},{[_0x20335b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x20335b([0x68,0x69,0x67,0x68])}),_0x3c0868[_0x20335b([0x6f,0x6e])](_0x20335b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x53eacb=>{_0x356d55(_0x53eacb[_0x20335b([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x48d62e=!0x0,_0x412ece(_0x53eacb[_0x20335b([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x20335b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x20335b([0x6c,0x6f,0x77])}),_0x570fe5[_0x20335b([0x74,0x68,0x65,0x6e])](()=>{_0x48d62e||_0xf40069(_0x20335b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x359703(){return _0x3c0868[_0x20335b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x20335b([0x76,0x69,0x65,0x77])][_0x20335b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x20335b([0x61,0x75,0x74,0x6f]);}function _0x3dd19f(){_0x3c0868[_0x20335b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x20335b([0x76,0x69,0x65,0x77])][_0x20335b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x20335b([0x61,0x75,0x74,0x6f]);}}function _0xa4245f(_0x59a78b){const _0x3c2909=[new window[(_0x20335b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x30f016=>setTimeout(_0x30f016,0x3df6fa2d^_0xbe783a)),_0x570fe5[_0x20335b([0x74,0x68,0x65,0x6e])](()=>new window[(_0x20335b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x34055a=>{let _0x155f4d=0x0;_0x3c0868[_0x20335b([0x6d,0x6f,0x64,0x65,0x6c])][_0x20335b([0x6f,0x6e])](_0x20335b([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x34c40e,_0x36a833)=>{_0x36a833[0x0][_0x20335b([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x155f4d++,_0x155f4d==(0x3dffc519^_0xbe783a)&&(_0x34055a(),_0x34c40e[_0x20335b([0x6f,0x66,0x66])]());});}))];return window[_0x20335b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x20335b([0x72,0x61,0x63,0x65])](_0x3c2909)[_0x20335b([0x74,0x68,0x65,0x6e])](()=>_0x59a78b);}async function _0x3cc27d(){await _0x570fe5,_0x3c0868[_0x20335b([0x6d,0x6f,0x64,0x65,0x6c])][_0x20335b([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x36087e,_0x3c0868[_0x20335b([0x6d,0x6f,0x64,0x65,0x6c])][_0x20335b([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x36087e,_0x3c0868[_0x20335b([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x20335b([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1cc838(_0x173e77){const _0x54b5a9=_0x4790b7();_0x3c0868[_0x54b5a9]=_0x20335b([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x173e77,_0x173e77!=_0x20335b([0x56,0x61,0x6c,0x69,0x64])&&_0x3cc27d();}function _0x4790b7(){const _0x2ac9dc=window[_0x20335b([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x20335b([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x20335b([0x6e,0x6f,0x77])]())[_0x20335b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x20335b([0x2e]),'');let _0x4246dd=_0x20335b([0x6e]);for(let _0x47c5ae=0x0;_0x47c5ae<_0x2ac9dc[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x47c5ae+=0x2){let _0x55fd8d=window[_0x20335b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2ac9dc[_0x20335b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x47c5ae,_0x47c5ae+0x2));_0x55fd8d>=_0x32d795[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x55fd8d-=_0x32d795[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4246dd+=_0x32d795[_0x55fd8d];}return _0x4246dd;}function _0x1cebe0(){const _0x1a3931=_0x32af21[_0x20335b([0x73,0x70,0x6c,0x69,0x74])](_0x20335b([0x2e]));if(0x3!=_0x1a3931[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3aaced(_0x1a3931[0x1]);function _0x3aaced(_0x30ffcd){const _0x179643=_0x34c52f(_0x30ffcd);return _0x179643&&_0x53b2bb()?_0x179643:null;function _0x53b2bb(){const _0x23e6fd=_0x179643[_0x20335b([0x6a,0x74,0x69])],_0x2d1c2b=window[_0x20335b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x23e6fd[_0x20335b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x23e6fd[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4e943e={..._0x179643,[_0x20335b([0x6a,0x74,0x69])]:_0x23e6fd[_0x20335b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x23e6fd[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4e943e[_0x20335b([0x76,0x63])],_0xb46259(_0x4e943e)==_0x2d1c2b;}}}async function _0x2fa9f2(){let _0x1198bd=!0x0;try{const _0x792bf0=_0x32af21[_0x20335b([0x73,0x70,0x6c,0x69,0x74])](_0x20335b([0x2e])),[_0x1dd611,_0xf52f48,_0x129507]=_0x792bf0;return _0x20d700(_0x1dd611),await _0x10e4b3(_0x1dd611,_0xf52f48,_0x129507),_0x1198bd;}catch{return!0x1;}function _0x20d700(_0x47af44){const _0x57e164=_0x34c52f(_0x47af44);_0x57e164&&_0x57e164[_0x20335b([0x61,0x6c,0x67])]==_0x20335b([0x45,0x53,0x32,0x35,0x36])||(_0x1198bd=!0x1);}async function _0x10e4b3(_0x331b63,_0x391638,_0x153884){const _0x24395d=window[_0x20335b([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x20335b([0x66,0x72,0x6f,0x6d])](_0x349447(_0x153884),_0x1997ad=>_0x1997ad[_0x20335b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x388747=new window[(_0x20335b([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x20335b([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x331b63+_0x20335b([0x2e])+_0x391638),_0x3a5eeb=window[_0x20335b([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x20335b([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3a5eeb)return;const _0x454848=await _0x3a5eeb[_0x20335b([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x20335b([0x6a,0x77,0x6b]),_0x2ca318,{[_0x20335b([0x6e,0x61,0x6d,0x65])]:_0x20335b([0x45,0x43,0x44,0x53,0x41]),[_0x20335b([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x20335b([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x20335b([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3a5eeb[_0x20335b([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x20335b([0x6e,0x61,0x6d,0x65])]:_0x20335b([0x45,0x43,0x44,0x53,0x41]),[_0x20335b([0x68,0x61,0x73,0x68])]:{[_0x20335b([0x6e,0x61,0x6d,0x65])]:_0x20335b([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x454848,_0x24395d,_0x388747)||(_0x1198bd=!0x1);}}function _0x34c52f(_0x29721d){return _0x29721d[_0x20335b([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x20335b([0x65,0x79]))?JSON[_0x20335b([0x70,0x61,0x72,0x73,0x65])](_0x349447(_0x29721d)):null;}function _0x349447(_0x4c8891){return window[_0x20335b([0x61,0x74,0x6f,0x62])](_0x4c8891[_0x20335b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x20335b([0x2b]))[_0x20335b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x20335b([0x2f])));}function _0xb46259(_0x256020){let _0x2096ed=0x1505;function _0x58c61a(_0x1c6bd0){for(let _0x10772a=0x0;_0x10772a<_0x1c6bd0[_0x20335b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x10772a++){const _0x4de613=_0x1c6bd0[_0x20335b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x10772a);_0x2096ed=(_0x2096ed<<0x5)+_0x2096ed+_0x4de613,_0x2096ed&=_0x2096ed;}}function _0x15b59f(_0x49cc11){Array[_0x20335b([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x49cc11)?_0x49cc11[_0x20335b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x15b59f):_0x49cc11&&typeof _0x49cc11==_0x20335b([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x20335b([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x49cc11)[_0x20335b([0x73,0x6f,0x72,0x74])]()[_0x20335b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x47f3c2,_0x6c7847])=>{_0x58c61a(_0x47f3c2),_0x15b59f(_0x6c7847);}):_0x58c61a(window[_0x20335b([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x49cc11));}return _0x15b59f(_0x256020),_0x2096ed>>>0x0;}function _0xe45f50(_0x2314c5){return _0x2314c5[_0x20335b([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x20335b([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x20335b([0x30]));}function _0x5a43f0(_0x2cd0d6){return _0x2cd0d6[_0x20335b([0x73,0x70,0x6c,0x69,0x74])]('')[_0x20335b([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x20335b([0x6a,0x6f,0x69,0x6e])]('');}function _0x36087e(){}function _0x20335b(_0x140b1c){return _0x140b1c['map'](_0x5b76c6=>String['fromCharCode'](_0x5b76c6))['join']('');}_0x1cc838(await _0x50e632());}(this);}['showFakeVisualSelection'](){const _0x2de50c=this['editor']['model'];_0x2de50c['change'](_0x559be0=>{const _0x218e16=_0x2de50c['document']['selection']['getRanges']();let _0x133a64=0x0;for(const _0x398033 of _0x218e16){const _0x2921e0=f+':'+_0x133a64;if(_0x2de50c['markers']['has'](_0x2921e0))_0x559be0['updateMarker'](_0x2921e0,{'range':_0x398033});else{if(_0x398033['start']['isAtEnd']){const _0x3f5918=_0x398033['start']['getLastMatchingPosition'](({item:_0x583a58})=>!_0x2de50c['schema']['isContent'](_0x583a58),{'boundaries':_0x398033});_0x559be0['addMarker'](_0x2921e0,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x559be0['createRange'](_0x3f5918,_0x398033['end'])});}else _0x559be0['addMarker'](_0x2921e0,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x398033});}_0x133a64++;}});}['hideFakeVisualSelection'](){const _0x5853ce=this['editor']['model'],_0x259516=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x259516['length']&&_0x5853ce['change'](_0x466f7b=>{_0x259516['forEach'](_0x4608be=>{_0x466f7b['removeMarker'](_0x4608be);});});}['insertContent'](_0x90bbeb,_0x4c61d5){const _0x1a96ed=this['_getAISelection'](),_0x416b58=_0x4c61d5||_0x1a96ed['getFirstRange']();this['editor']['model']['canEditAt'](_0x416b58)&&this['editor']['model']['change'](_0x37325d=>{this['hideFakeVisualSelection'](),_0x4c61d5||this['_resetContentOfSelectedTableCells'](_0x37325d,_0x1a96ed),this['_pasteHTMLUsingClipboard']({'insertAt':_0x416b58,'writer':_0x37325d,'html':_0x90bbeb});});}['insertContentBelow'](_0x214c42){const {model:_0x57842a}=this['editor'],_0x30ec42=this['_getAISelection']();_0x57842a['change'](()=>{const _0x3f24c5=this['_prepareTableInsertBelowPosition'](_0x214c42,_0x30ec42)||this['_getDefaultInsertBelowPosition'](_0x30ec42);this['insertContent'](_0x214c42,_0x3f24c5);});}['_getAISelection'](){const _0x2b1a64=this['editor']['model'],_0x318ca1=Array['from'](_0x2b1a64['markers']['getMarkersGroup'](f))['map'](_0x1bb41c=>_0x1bb41c['getRange']());return _0x2b1a64['createSelection'](_0x318ca1);}['_pasteHTMLUsingClipboard']({writer:_0x2c196f,html:_0x1d7a37,insertAt:_0x5a1c87}){const {view:_0x1abf92}=this['editor']['editing'],_0x186f1e=this['editor']['plugins']['get'](_0x256e3e),_0x45de7f=new Fn();_0x45de7f['setData']('text/html',_0x1d7a37);const _0x127400=new ClipboardEvent('paste',{'clipboardData':_0x45de7f}),_0x128022=new _0x3777ec(_0x1abf92,_0x127400,{'dataTransfer':new _0x53f5cd(_0x45de7f)});_0x2c196f['setSelection'](_0x5a1c87);const _0x3d66c4=(_0x142bff,_0x14a236)=>{_0x14a236['resultRange']&&_0x2c196f['setSelection'](_0x14a236['resultRange']);};_0x186f1e['once']('contentInsertion',_0x3d66c4,{'priority':'lowest'}),_0x1abf92['document']['fire']('paste',_0x128022),_0x186f1e['off']('contentInsertion',_0x3d66c4);}['_getDefaultInsertBelowPosition'](_0x59bc5c){const {model:_0x195b29}=this['editor'],_0x35144a=Array['from'](_0x59bc5c['getSelectedBlocks']());return _0x35144a['length']?_0x195b29['createPositionAfter'](_0x35144a['pop']()):_0x59bc5c['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3cd9dc,_0x2a7dee){const {model:_0x49f7e9,plugins:_0x4d670e}=this['editor'];if(_0x4d670e['has']('TableUtils')){const _0x2b7fbd=_0x4d670e['get']('TableUtils')['getSelectedTableCells'](_0x2a7dee);if(_0x2b7fbd['length']){const _0x2211b3=this['_getTableRowCountFromContent'](_0x3cd9dc),_0x5bce8c=this['_createEmptyTableRows'](_0x2b7fbd,_0x2211b3);return _0x49f7e9['createPositionAt'](_0x5bce8c,0x0);}}return null;}['_getTableRowCountFromContent'](_0x40be5e){const _0xf02f79=this['editor']['plugins']['get']('TableUtils'),_0x4b18be=this['editor']['data']['parse'](_0x40be5e),_0x5e0e68=Array['from'](_0x4b18be['getChildren']())['filter'](_0x2b403a=>_0x2b403a['is']('element','table'));let _0x1476d9=0x0;return _0x5e0e68['forEach'](_0x2e51b1=>{_0x1476d9+=_0xf02f79['getRows'](_0x2e51b1);}),_0x1476d9;}['_createEmptyTableRows'](_0x3295c6,_0x4137cc){const _0x44f97b=this['editor']['plugins']['get']('TableUtils'),_0x34d89f=_0x44f97b['getRowIndexes'](_0x3295c6),_0x2ebdef=_0x44f97b['getColumnIndexes'](_0x3295c6),_0x25a20b=_0x34d89f['last']+0x1,_0x2b6132=_0x2ebdef['first'],_0x19a7e4=_0x3295c6[0x0]['findAncestor']('table');for(let _0x33075b=0x0;_0x33075b<_0x4137cc;_0x33075b++)_0x44f97b['insertRows'](_0x19a7e4,{'at':_0x25a20b});return _0x19a7e4['getChild'](_0x25a20b)['getChild'](_0x2b6132);}['_resetContentOfSelectedTableCells'](_0x5bfe74,_0x7f5eff){const {plugins:_0x56d9af}=this['editor'],{model:_0x4554e5}=_0x5bfe74;if(!_0x56d9af['has']('TableUtils'))return;_0x56d9af['get']('TableUtils')['getSelectedTableCells'](_0x7f5eff)['length']&&_0x4554e5['deleteContent'](_0x7f5eff);}}class x extends _0x523b53{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x2120c6('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x17ecfc){super(_0x17ecfc),this['name']='AIRequestError';}}function Yn(_0x349a2d,_0x181eed,_0x582365){const t=_0x349a2d['t'];switch(_0x181eed){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',_0x582365);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x582365);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'},_0x582365);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 _0x181eed;}}class E extends Qt{['_commandDefinitions'];constructor(_0x1f390c,_0x5b5237){super(_0x1f390c),this['_commandDefinitions']=_0x5b5237,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x2b5851,_0x58ff3a,_0x3ceb97)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x3ceb97));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xd848ca,_0x2e1cfd,_0x4c0882)=>{this['enabledCommandsIds']=_0x4c0882?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2ca480=this['editor']['model'];this['_hasContext']=function(_0x4829d4){const _0x2c637c=_0x4829d4['document']['selection'];return _0x2c637c['isCollapsed']?0x0!==[..._0x2c637c['getSelectedBlocks']()]['length']&&![..._0x2c637c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4829d4['hasContent'](_0x2c637c['getFirstRange']());}(_0x2ca480);const _0x252315=_0x2ca480['document']['selection'],_0x252af9=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x509f4d of _0x252315['getRanges']())for(const _0x136eef of _0x509f4d['getItems']())if(_0x136eef['is']('element')&&_0x252af9['includes'](_0x136eef['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0xb832b4='',_0x1b6a7d='',_0x282a0d='custom'){this['editor']['plugins']['get'](n)['showUI'](_0xb832b4,_0x1b6a7d,_0x282a0d);}}function ns(_0x5a141a,_0x50b1a0){const _0x52deb9=new Set();for(const _0x5ca061 of _0x5a141a['values']())(_0x50b1a0||!0x1===_0x5ca061['requiresContent'])&&_0x52deb9['add'](_0x5ca061['id']);return Array['from'](_0x52deb9);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3dfa5e,_0x367779,_0x15b1da){super(),this['editor']=_0x3dfa5e,this['textAdapter']=_0x367779,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x15b1da,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3c6a3b,_0x434cdf,_0xb47dc8)=>{this['view']['value']=this['_sanitizeHTML'](_0xb47dc8);}),this['listenTo'](this['view'],'submitPrompt',(_0x512d4a,_0x5691d2)=>{const _0x525ad0=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x5691d2,_0x525ad0,'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:_0x22a5b7,query:_0x145568,htmlContent:_0x2de394,label:_0x19ab8d,mainActionLabel:_0x203b19}){this['view']['prompt']=_0x19ab8d,this['view']['mainAction']=_0x203b19,this['initialContext']=_0x2de394,_0x145568&&(this['view']['isRendered']?this['_handleQuery'](_0x145568,_0x2de394,_0x22a5b7,_0x19ab8d):this['view']['once']('render',()=>{this['_handleQuery'](_0x145568,_0x2de394,_0x22a5b7,_0x19ab8d);}));}['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'](_0x3f96fb,_0x44c077,_0x247c26,_0x157780){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x44c077,this['previousQuery']=_0x3f96fb,this['previousLabel']=_0x157780||_0x3f96fb,this['previousActionId']=_0x247c26,new Promise(_0x39ef57=>{this['textAdapter']['makeRequest']({'query':_0x3f96fb,'context':_0x44c077,'onData':_0x154b75=>{this['currentResponse']=_0x154b75,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x247c26})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x49c66a=>{_0x49c66a instanceof tr?this['view']['handleError'](_0x49c66a['message']):this['view']['handleError'](),_0x39ef57();})['finally'](()=>{this['stopProcessing'](),_0x39ef57();});});}['_parseAndNormalizeContent'](_0x3bb921,_0x112ffe=!0x1){const _0xa7e103=hs['exec'](_0x3bb921);_0x3bb921=_0xa7e103?_0x3bb921['substring'](_0xa7e103[0x1]['length']):_0x3bb921['length']<0x64&&!_0x112ffe?'':this['_stripMarkdownSyntax'](_0x3bb921);const _0x5198a1=this['_domParser']['parseFromString'](_0x3bb921,'text/html');if(_0xa7e103){const _0x10a4b1=Array['from'](_0x5198a1['body']['childNodes']);_0x10a4b1['reverse']();for(const _0x3674b0 of _0x10a4b1){if(_0x3674b0['nodeType']==Node['ELEMENT_NODE'])break;_0x3674b0['remove']();}}const _0x1de748=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5198a1['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1de748);const _0x516b78=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x37b871=this['editor']['data']['toModel'](_0x1de748);return _0x516b78||_0x37b871['markers']['clear'](),this['editor']['data']['stringify'](_0x37b871);}['_normalizeResponseHeadings'](_0x5c9da3){const _0x157e5e=new _0x876d75(this['editor']['editing']['view']['document']),_0xb0ef3e=new _0x1e8df8({'name':/^h[1-5]$/}),_0x96ffc3=[];let _0x58038d=!0x1;for(const _0x438462 of _0x5c9da3)_0x438462['is']('element')&&_0xb0ef3e['match'](_0x438462)&&(_0x96ffc3['push'](_0x438462),'h1'==_0x438462['name']&&(_0x58038d=!0x0));if(_0x58038d){for(const _0x5ced4b of _0x96ffc3)_0x157e5e['rename']('h'+(parseInt(_0x5ced4b['name'][0x1])+0x1),_0x5ced4b);}}['_isH1TagSupportEnabled'](){const {data:_0x422980,editing:_0x395786}=this['editor'],_0x492461=_0x422980['htmlProcessor']['toView']('<h1></h1>'),_0x200d42=_0x422980['toView'](_0x422980['toModel'](_0x492461));return!!_0x395786['view']['domConverter']['viewToDom'](_0x200d42)['querySelector']('h1');}['_sanitizeHTML'](_0x33bd46){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x33bd46),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x465920){const _0x122f78=_0x465920['trim']();return _0x122f78['startsWith']('```html')?_0x122f78['endsWith']('```')?_0x122f78['substring'](0x7,_0x122f78['length']-0x3):_0x122f78['substring'](0x7):_0x465920;}}const _={'REPLACE':'replace','INSERT':'insert'};class wr extends _0xf901f6{constructor(_0x32bb7f){super(_0x32bb7f),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x201a40=>Yn(_0x32bb7f,'AI_'+_0x201a40['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0x32bb7f,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0x32bb7f,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0x32bb7f,'Stop'));const _0x3f0ef5=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3f0ef5['if']('isVisible','ck-hidden',_0x5e0610=>!_0x5e0610)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5d6ab4,_0x2ede5d){const _0x44826f=new _0x290cbd(this['locale']);return _0x44826f['set']({'label':_0x5d6ab4,'class':_0x2ede5d||'','isVisible':!0x0,'withText':!0x0}),_0x44826f;}}class yr extends _0x3249c4{['contentFieldView'];['copyButtonView'];constructor(_0x25dd74,_0x3e5269=''){super(_0x25dd74),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x6ba5da=this['bindTemplate'];this['contentFieldView']=new $n(_0x25dd74,_0x3e5269),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x6ba5da['if']('isVisible','ck-hidden',_0x7e3f1f=>!_0x7e3f1f)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x6ba5da['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 _0x42f790=!0x1;this['on']('change:value',(_0x14c554,_0x3881a1,_0x43f01d)=>{const _0xbd0dbc=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x43f01d),this['isProcessing']&&_0xbd0dbc&&!_0x42f790&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5934f3,_0x5df853,_0x2d16a3)=>{_0x42f790=!0x1,_0x2d16a3?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x42f790=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x42f790=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1f92fa=this['locale'],_0x431032=new _0x290cbd(this['locale']),_0x2e4591='ck-ai-form__copy-button';return _0x431032['set']({'label':Yn(_0x1f92fa,'Copy'),'icon':_0x2ff693,'class':_0x2e4591,'tooltip':!0x0}),_0x431032['bind']('isVisible')['to'](this,'value',_0x5ef964=>!!_0x5ef964),_0x431032['bind']('isEnabled')['to'](this,'isProcessing',_0xe1836c=>!_0xe1836c),_0x431032['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x431032['icon']=_0x1e5ca3,_0x431032['class']=_0x2e4591+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x431032['icon']=_0x2ff693,_0x431032['class']=_0x2e4591;},0x3e8);}),_0x431032;}['_copyHTMLToClipboard'](_0x49cec2){const {window:_0x59665c,document:_0x2473b8}=_0x31e929;if(_0x59665c['ClipboardItem']){const {Blob:_0x142c4f,ClipboardItem:_0x18ae77}=_0x59665c,_0x524d95=[new _0x18ae77({'text/html':new _0x142c4f([_0x49cec2['innerHTML']],{'type':'text/html'}),'text/plain':new _0x142c4f([_0x49cec2['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x524d95);}else{const _0x578c90=_0x2473b8['createElement']('div');_0x578c90['style']['position']='absolute',_0x578c90['style']['left']='-9999px',_0x578c90['innerHTML']='<span>[</span>'+_0x49cec2['innerHTML']+'<span>]</span>',_0x2473b8['body']['appendChild'](_0x578c90);const _0x51b609=_0x2473b8['createRange']();_0x51b609['setStartAfter'](_0x578c90['firstElementChild']),_0x51b609['setEndBefore'](_0x578c90['lastElementChild']);const _0x2000db=_0x59665c['getSelection']();_0x2000db['removeAllRanges'](),_0x2000db['addRange'](_0x51b609),_0x2473b8['execCommand']('copy'),_0x578c90['remove']();}}}class $n extends _0x3249c4{constructor(_0x11f5a0,_0x48ce9a=''){super(_0x11f5a0),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x48ce9a,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x38f30e){this['element']['innerHTML']=_0x38f30e;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x40c426=new _0x3249c4(),_0x1840e7=this['locale'],_0x588f57=new _0x1fde3a();return _0x588f57['isVisible']=!0x0,_0x40c426['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x588f57,{'text':Yn(_0x1840e7,'AI\x20is\x20writing...')}]}),_0x40c426['render'](),_0x40c426;}}class gr extends _0x3249c4{constructor(_0x103cd0,_0x412a15=''){super(_0x103cd0);const _0x44aa1e=new _0xf03b05(),_0xac8e0c=this['bindTemplate'];this['set']('text',_0x412a15),_0x44aa1e['content']=_0x33935c,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x44aa1e,{'text':_0xac8e0c['to']('text')}]});}}class Er extends _0xa69052{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2a32eb,_0x3ee8f0){super(_0x2a32eb,_0x3ee8f0),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',(_0x11d76b,_0x396b33)=>{_0x11d76b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x396b33());});}['_createSubmitButton'](){const _0x5f5d86=new _0x290cbd(this['locale']),_0x24c630=this['locale'];return _0x5f5d86['set']({'icon':_0x55a39b,'label':Yn(_0x24c630,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x5f5d86['on']('execute',()=>{this['submit']();}),_0x5f5d86['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0xa280e6,_0x560014)=>!_0xa280e6&&_0x560014),_0x5f5d86;}['_createShowHistoryButton'](){const _0x2caa9b=new _0x290cbd(this['locale']),_0x2d1255=this['resultsView'],_0x353208=this['locale'];_0x2caa9b['set']({'label':Yn(_0x353208,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x2caa9b['bind']('isOn')['to'](_0x2d1255,'isVisible'),_0x2caa9b['bind']('isEnabled')['to'](this,'isEnabled'),_0x2caa9b['on']('execute',()=>{_0x2d1255['isVisible']=!_0x2d1255['isVisible'],_0x2d1255['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2ab741=()=>{_0x31e929['window']['requestAnimationFrame'](()=>{if(_0x2148f8(this['element'])){const _0x2e42c7=new _0x11a5d6(this['queryView']['fieldView']['element']),_0x1fe44c=_0x2e42c7['width'],_0x34a04d='rtl'===_0x353208['uiLanguageDirection']?'left':'right';_0x2e42c7['excludeScrollbarsAndBorders'](),_0x2caa9b['element']['style'][_0x34a04d]=_0x1fe44c-_0x2e42c7['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2ab741),this['on']('render',_0x2ab741),_0x2caa9b;}['submit'](){const _0x3297c1=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x3297c1);}['focus'](_0x399407){-0x1===_0x399407?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x36c9a6{['historyGroupView'];['clearHistoryButton'];constructor(_0x3e30bf){super(_0x3e30bf),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x4bc919(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x3e30bf,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x52f980=0x0;for(const _0x374a77 of this['items'])_0x52f980+=_0x374a77['items']['length'];return{'resultsCount':_0x52f980,'totalItemsCount':_0x52f980};}['_createClearHistoryButton'](){const _0x5f4da3=this['locale'],_0x39fa8d=new _0x290cbd(this['locale']);return _0x39fa8d['set']({'label':'('+Yn(_0x5f4da3,'Clear')+')','withText':!0x0}),_0x39fa8d['on']('execute',()=>this['fire']('clearHistory')),_0x39fa8d;}}class Ar extends _0x36570a{constructor(_0x462506){super();const _0x57aad5=new _0x366752(),_0x3bf192=new _0x290cbd(this['locale'],_0x57aad5);this['children']['add'](_0x3bf192),_0x3bf192['set']({'label':_0x462506['prompt'],'withText':!0x0}),_0x3bf192['on']('execute',()=>{this['fire']('execute',{'value':_0x3c4eee(_0x462506['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Pr extends _0x2afc13{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3436da,_0x37dd15)=>{const _0x5bf90a=fo(_0x37dd15['prompt']);for(const _0x268641 of this)if(_0x268641!=_0x37dd15&&fo(_0x268641['prompt'])===_0x5bf90a){this['remove'](_0x268641);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x38171e=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x38171e));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x4dc911=>_0x4dc911)));}}function fo(_0x481bf9){return _0x481bf9['toLowerCase']()['trim']();}class k extends _0x3249c4{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x56aee2,_0x65bdc1,_0x48d719=''){super(_0x56aee2),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Pr(),this['errorView']=new gr(_0x56aee2),this['contentArea']=new yr(_0x56aee2,_0x48d719),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 _0x51df1c(),this['keystrokes']=new _0x3116d1(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x504985({'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 _0xd92ddc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x65bdc1],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0xd92ddc['if']('isError','ck-hidden',_0x1f4639=>!_0x1f4639)]},'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'](_0x38a777=0x1){-0x1===_0x38a777?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 _0x4ad098=this['locale'],_0x4ccf80=new Er(_0x4ad098,{'queryView':{'label':Yn(_0x4ad098,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x227b28,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x4ad098,'Empty\x20history'),'secondary':Yn(_0x4ad098,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4ccf80['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x34f271,_0x51b947)=>_0x34f271&&!_0x51b947),this['listenTo'](_0x4ccf80,'submit',(_0x3988a4,_0x1d1135)=>{this['prompt']=_0x1d1135;const _0x3c7d20=_0x3739ad(_0x1d1135);this['fire']('submitPrompt',_0x3c7d20),_0x1d1135['trim']()&&this['_promptHistory']['add']({'prompt':_0x3c7d20},0x0);},{'priority':'high'}),_0x4ccf80;}['_createHistoryView'](){const _0x1236f2=new vr(this['locale']);return _0x1236f2['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0x1236f2['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x1236f2;}['_createToolbar'](){const _0x2df1d7=new wr(this['locale']);return _0x2df1d7['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x46aec5,_0x5e6c9d,_0x4c7c6b)=>_0x46aec5&&!_0x5e6c9d&&!!_0x4c7c6b),_0x2df1d7['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2df1d7['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xb2a071,_0x49bc47,_0xc7bdf1)=>_0xb2a071&&!_0x49bc47&&!!_0xc7bdf1),_0x2df1d7['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2df1d7['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xbff4dd,_0x3b92c1)=>_0xbff4dd&&!_0x3b92c1),_0x2df1d7['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2df1d7['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2df1d7['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2df1d7;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x515b5f=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x515b5f,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x427365){const _0x135d07=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x427365||Yn(_0x135d07,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x523b53{['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[_0xa0c8e7,a,x,_0x3251e6];}constructor(_0x66d18f){super(_0x66d18f),_0x66d18f['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x66d18f['config']['define']('ai.assistant.contentAreaCssClass',''),_0x66d18f['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x66d18f['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x57f7e7}=this;this['_aiAdapter']=_0x57f7e7['plugins']['get'](x),this['_dialog']=_0x57f7e7['plugins']['get'](_0x3251e6),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x177c65=new E(_0x57f7e7,Array['from'](this['_commandDefinitions']['values']()));_0x57f7e7['commands']['add']('showAIAssistant',_0x177c65),_0x57f7e7['ui']['componentFactory']['add']('aiCommands',_0x146eef=>{const _0x2c5603=_0x1bd241(_0x146eef);return _0x2c5603['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2c5603['buttonView']['set']({'label':Yn(_0x146eef,'AI\x20Commands'),'icon':_0x30e9c9,'tooltip':!0x0}),_0x2c5603['on']('execute',_0x1c297d=>this['_onExecute'](_0x1c297d['source']['id'])),_0x3b2bdf(_0x2c5603,_0x57f7e7['ui']['view']['body'],function(_0x5d505e){const _0x23c879=o(_0x5d505e['config']['get']('ai.assistant.commands'),_0x5d505e['locale']),_0x578a9d=U(_0x5d505e,_0x23c879)['filter'](_0x255f93=>_0x255f93['commands']['length']);if(0x1===_0x578a9d['length'])return U(_0x5d505e,_0x578a9d[0x0]['commands'])['map'](_0x4b78d6=>({'id':_0x4b78d6['id'],'label':_0x4b78d6['label']}));return _0x578a9d['map'](_0xbc4c5b=>{const {groupId:_0x53b613,groupLabel:_0x1e94ef,commands:_0x3fa192}=_0xbc4c5b,_0x1240c5=U(_0x5d505e,_0x3fa192)['map'](_0x47fdcb=>({'id':_0x47fdcb['id'],'label':_0x47fdcb['label']}));return{'id':_0x53b613,'menu':_0x1e94ef||_0x53b613,'children':_0x1240c5};});}(_0x57f7e7),{'ariaLabel':Yn(_0x146eef,'AI\x20Commands')}),_0x2c5603['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x177c65['on']('change:enabledCommandsIds',_0x254781),_0x2c5603['menuView']['once']('render',_0x254781),_0x2c5603;function _0x254781(){_0x2c5603['isEnabled']=_0x177c65['enabledCommandsIds']['length']>0x0;for(const _0x5604a9 of _0x2c5603['menuView']['buttons'])_0x5604a9['isEnabled']=_0x177c65['enabledCommandsIds']['includes'](_0x5604a9['id']);}}),_0x57f7e7['ui']['componentFactory']['add']('menuBar:aiCommands',_0x11b62a=>{const _0x43003e=new _0x252d57(_0x11b62a);_0x43003e['buttonView']['set']({'label':Yn(_0x11b62a,'AI\x20Commands'),'icon':_0x30e9c9}),_0x43003e['bind']('isEnabled')['to'](_0x177c65,'enabledCommandsIds',_0x51b092=>_0x51b092['length']>0x0);const _0x15b0fe=o(_0x57f7e7['config']['get']('ai.assistant.commands'),_0x11b62a);return this['_populateMenuBarMenu'](_0x177c65,_0x43003e,_0x15b0fe,_0x8bb74b=>this['_onExecute'](_0x8bb74b)),_0x43003e;}),_0x57f7e7['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x3e9688=this['_createAIAssistantUIButton'](_0x290cbd);return _0x3e9688['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x3e9688;}),_0x57f7e7['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x2b071d=this['_createAIAssistantUIButton'](_0x1854a6);return _0x2b071d['set']({'role':'menuitemcheckbox'}),_0x2b071d;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x466a64=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x57f608;for(const _0x34def9 in _0x466a64){const _0x5b32c7=_0x34def9,_0x4bc37b=_0x466a64[_0x5b32c7];if('aiLicenseKeyValid'==_0x4bc37b||'aiLicenseKeyInvalid'==_0x4bc37b||'aiLicenseKeyExpired'==_0x4bc37b||'aiLicenseKeyDomainLimit'==_0x4bc37b||'aiLicenseKeyNotAllowed'==_0x4bc37b||'aiLicenseKeyEvaluationLimit'==_0x4bc37b||'aiLicenseKeyTrialLimit'==_0x4bc37b||'aiLicenseKeyUsageLimit'==_0x4bc37b){delete _0x466a64[_0x5b32c7],_0x57f608=_0x4bc37b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x57f608&&_0x466a64['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x57f608&&_0x466a64['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x57f608&&_0x466a64['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x57f608&&_0x466a64['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x57f608&&_0x466a64['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x57f608&&_0x466a64['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x57f608&&_0x466a64['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x12d4b3='',_0x2ba13d='',_0x18faa3='custom'){const _0x4f309f=this['editor'],_0x3eaf73=_0x4f309f['editing']['view'],_0x6bb278=_0x4f309f['plugins']['get'](a),_0x3ca745=_0x4f309f['plugins']['get'](_0xa0c8e7);_0x6bb278['showFakeVisualSelection']();const _0x478c4e=new w(),_0x3738e9=new ClipboardEvent('copy',{'clipboardData':_0x478c4e}),_0x2d8fe7=new _0x53f5cd(_0x478c4e),_0x513176=new _0x3777ec(_0x3eaf73,_0x3738e9,{'dataTransfer':_0x2d8fe7});_0x3ca745['_forceMarkersCopy']('comment',()=>{_0x3eaf73['document']['fire']('copy',_0x513176);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x4f309f,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x27e382=_0x2d8fe7['getData']('text/html');const _0x57fdf9=_0x4f309f['model']['document']['selection'],_0x5aefa6=Array['from'](_0x57fdf9['getRanges']());0x1===_0x5aefa6['length']&&_0x5aefa6[0x0]['isFlat']&&!_0x57fdf9['getSelectedElement']()&&''!==_0x27e382['replace'](/ /g,'')['trim']()&&(_0x27e382='<p>'+_0x27e382+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x18faa3,'query':_0x12d4b3,'htmlContent':_0x27e382,'label':_0x2ba13d,'mainActionLabel':_[_0x4f309f['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x3b7522,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x4320e4['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x6bb278['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x39b9bb=new Map(),_0x5cf292=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x22a990 of _0x5cf292)for(const _0x5c1e93 of _0x22a990['commands'])_0x39b9bb['set'](_0x5c1e93['id'],{..._0x5c1e93,'groupId':_0x22a990['groupId'],'groupLabel':_0x22a990['groupLabel']||_0x22a990['groupId']});return _0x39b9bb;}['_createAIAssistantUIButton'](_0x4be034){const _0x53558e=this['editor'],_0x575601=_0x53558e['commands']['get']('showAIAssistant'),_0x226d84=new _0x4be034(_0x53558e['locale']);return _0x226d84['set']({'label':Yn(_0x53558e['locale'],'AI\x20Assistant'),'icon':_0x3b7522,'isToggleable':!0x0}),_0x226d84['bind']('isEnabled')['to'](_0x575601),_0x226d84['bind']('isOn')['to'](this['_dialog'],'id',_0x28fedf=>'aiAssistant'===_0x28fedf),this['listenTo'](_0x226d84,'execute',()=>{_0x226d84['isOn']?this['hideUI']():_0x575601['execute']();}),_0x226d84;}['_initView'](){const _0x840add=this['editor']['plugins']['get'](a);this['_formView']=new k(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',()=>{_0x840add['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x840add['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0xd46320,ui:{ariaLiveAnnouncer:_0x15183d}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x350e2d,_0x1af52f,_0x49925b)=>{const _0x37da09=this['_aiAssistantController']['currentContext'];_0x49925b?_0x15183d['announce'](Yn(_0xd46320,'AI\x20is\x20writing')):_0x37da09&&_0x15183d['announce'](Yn(_0xd46320,'Generated\x20content:\x20%0',_0x37da09),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x31a38d,_0x4cc6d8,_0xb31111)=>{if(_0xb31111){const _0x137a59=this['_formView']['errorView']['text'];_0x15183d['announce'](Yn(_0xd46320,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x137a59));}});}['_onExecute'](_0x932a2d){const _0x2229e6=this['_commandDefinitions']['get'](_0x932a2d),_0x1168dd=this['editor'],_0x199b99=_0x1168dd['model']['document']['selection'],_0x4d01c2=_0x1168dd['commands']['get']('showAIAssistant'),_0x494a5f=_0x1168dd['plugins']['get'](a),_0x2c4671=''+(_0x2229e6['groupId']!==K?_0x2229e6['groupLabel']+':\x20':'')+_0x2229e6['label'];if(!0x1!==_0x2229e6['requiresContent']&&_0x199b99['isCollapsed']){const _0x2ecb70=_0x19de19(_0x199b99['getSelectedBlocks']())||_0x1168dd['model']['schema']['getLimitElement'](_0x199b99);_0x1168dd['model']['change'](_0x463174=>{_0x463174['setSelection'](_0x2ecb70,'in');});}_0x494a5f['showFakeVisualSelection'](),_0x4d01c2['execute'](_0x2229e6['prompt'],_0x2c4671,'command:'+_0x932a2d);}['_populateMenuBarMenu'](_0x35ad10,_0x4be3f5,_0x9c5b23,_0x6e0508){const _0x33ca9d=this['editor'],_0x4e61c9=_0x33ca9d['locale'],_0xc3061a=new _0x4dc9a7(_0x4e61c9),_0xf2b291=U(_0x33ca9d,_0x9c5b23)['filter'](_0x17d940=>_0x17d940['commands']['length']);0x1===_0xf2b291['length']?this['_getMenuBarGroupButtons']({'command':_0x35ad10,'commands':_0xf2b291[0x0]['commands'],'parentMenuView':_0x4be3f5,'onExecute':_0x6e0508})['forEach'](_0x4f8436=>_0xc3061a['items']['add'](_0x4f8436)):_0xf2b291['forEach'](({groupId:_0x129897,groupLabel:_0x5decc6,commands:_0x384354})=>{const _0x49e6da=new _0x514c3b(_0x4e61c9,_0x4be3f5),_0x25ac89=new _0x252d57(_0x4e61c9),_0x5bd4f5=new _0x4dc9a7(_0x4e61c9),_0x105eb1=this['_getMenuBarGroupButtons']({'command':_0x35ad10,'commands':_0x384354,'parentMenuView':_0x25ac89,'onExecute':_0x6e0508});_0x25ac89['buttonView']['set']({'label':_0x5decc6||_0x129897}),_0x25ac89['delegate']('execute')['to'](_0x4be3f5),_0x5bd4f5['items']['addMany'](_0x105eb1),_0x25ac89['panelView']['children']['add'](_0x5bd4f5),_0x49e6da['children']['add'](_0x25ac89),_0xc3061a['items']['add'](_0x49e6da);}),_0x4be3f5['panelView']['children']['add'](_0xc3061a);}['_getMenuBarGroupButtons']({command:_0x1d6b6f,commands:_0xd72802,parentMenuView:_0x43d5d7,onExecute:_0x1f8ab6}){const _0x2a339f=this['editor'],_0x5d721e=_0x2a339f['locale'];return U(_0x2a339f,_0xd72802)['map'](_0x127cb8=>{const _0x5c221f=new _0x514c3b(_0x5d721e,_0x43d5d7),_0x22281d=new _0x1854a6(_0x5d721e);return _0x22281d['set']({'label':_0x127cb8['label']}),_0x22281d['delegate']('execute')['to'](_0x43d5d7),_0x22281d['on']('execute',()=>_0x1f8ab6(_0x127cb8['id'])),_0x22281d['bind']('isEnabled')['to'](_0x1d6b6f,'enabledCommandsIds',_0x222e93=>_0x222e93['includes'](_0x127cb8['id'])),_0x5c221f['children']['add'](_0x22281d),_0x5c221f;});}}function T(_0x49f4a3,_0x575ebc){return void 0x0!==_0x49f4a3['order']&&void 0x0===_0x575ebc['order']?0x1:void 0x0===_0x49f4a3['order']&&void 0x0!==_0x575ebc['order']?-0x1:void 0x0!==_0x49f4a3['order']&&void 0x0!==_0x575ebc['order']?_0x49f4a3['order']-_0x575ebc['order']:0x0;}function U(_0x3172e9,_0x4bedd0){_0x4bedd0['sort'](T);const _0x171633={},_0x48af93=[];for(const _0x3a6c5d of _0x4bedd0)if(void 0x0!==_0x3a6c5d['order']){if(_0x3a6c5d['order']in _0x171633)throw new _0x2120c6('ai-commands-config-order-collision',_0x3172e9,{'conflictingDefinitions':[_0x3a6c5d,_0x171633[_0x3a6c5d['order']]]});_0x171633[_0x3a6c5d['order']]=_0x3a6c5d,_0x48af93['splice'](_0x3a6c5d['order'],0x0,_0x3a6c5d);}else _0x48af93['push'](_0x3a6c5d);return _0x48af93;}class qn extends _0x523b53{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x55244a){super(_0x55244a);const _0x4f95b9=_0x55244a['config'],_0x558c6a=_0x55244a['locale'];_0x4f95b9['define']('ai.assistant.preserveComments',!0x0),_0x4f95b9['define']('ai.assistant.commands',Qn(_0x558c6a)),_0x4f95b9['define']('ai.assistant.extraCommandGroups',[]),_0x4f95b9['define']('ai.assistant.removeCommands',[]);let _0x2b8e3c=o(_0x4f95b9['get']('ai.assistant.commands'),_0x558c6a);const _0x23d5dc=_0x4f95b9['get']('ai.assistant.extraCommandGroups'),_0x40fa3e=_0x4f95b9['get']('ai.assistant.removeCommands');_0x23d5dc['forEach'](_0x21fbfc=>{const _0x293b81=_0x2b8e3c['find'](_0x4e1ad2=>_0x4e1ad2['groupId']===_0x21fbfc['groupId']);_0x293b81?_0x293b81['commands']=_0x293b81['commands']['concat'](_0x21fbfc['commands']):_0x2b8e3c['push'](_0x21fbfc);}),_0x2b8e3c=_0x2b8e3c['filter'](_0x443532=>!_0x40fa3e['includes'](_0x443532['groupId'])),_0x2b8e3c['forEach'](_0xba1471=>{_0xba1471['commands']=_0xba1471['commands']['filter'](_0x7b0709=>!_0x40fa3e['includes'](_0x7b0709['id']));}),_0x4f95b9['set']('ai.assistant.commands',_0x2b8e3c);}}function Qn(_0x6ea79b){return[{'groupId':'editOrReview','groupLabel':Yn(_0x6ea79b,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x6ea79b,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x6ea79b,'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(_0x6ea79b,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x6ea79b,'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(_0x6ea79b,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x6ea79b,'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(_0x6ea79b,'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(_0x6ea79b,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x6ea79b,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x6ea79b,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x6ea79b,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x6ea79b,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x6ea79b,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x6ea79b,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x6ea79b,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x6ea79b,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x6ea79b,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x6ea79b,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x6ea79b,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x6ea79b,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x6ea79b,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x6ea79b,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x6ea79b,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x6ea79b,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x6ea79b,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x6ea79b,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x6ea79b,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class pe extends _0x523b53{['abortController'];static get['requires'](){return[x];}constructor(_0x4cbffa){super(_0x4cbffa),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x161c0e){return this['sendRequest'](_0x161c0e)['catch'](_0x181a94=>{if(_0x181a94 instanceof tr)return Promise['reject'](_0x181a94);if('AbortError'==_0x181a94['name'])return Promise['resolve']();throw console['error'](_0x181a94),new _0x2120c6('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x176171,_0x212c02){const _0x41434d=this['editor']['locale'],_0x45a006={'Content-Type':'application/json'};if('object'==typeof _0x176171)Object['assign'](_0x45a006,_0x176171);else{if(_0x176171)try{const _0x70c65c=await _0x176171(_0x212c02);Object['assign'](_0x45a006,_0x70c65c);}catch{return Promise['reject'](new tr(Yn(_0x41434d,'AI_ERROR_GET_HEADERS')));}}return _0x45a006;}async['_prepareRequestParameters'](_0x48b36f,_0x2a2ed4){const _0x3fdcbf=this['editor']['locale'];if('object'==typeof _0x48b36f)return _0x48b36f;try{return await _0x48b36f(_0x2a2ed4);}catch{return Promise['reject'](new tr(Yn(_0x3fdcbf,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends pe{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x20da58){super(_0x20da58),_0x20da58['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x20da58['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x20da58['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x20da58['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x20da58['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x20da58['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x25517b,context:_0x966ddd,onData:_0x45ac6e,actionId:_0x176f8d}){const _0x5cef9d=this['editor']['locale'],_0x47b2f0=await this['prepareMessages'](_0x25517b,_0x966ddd,_0x176f8d),_0x240eaa=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x176f8d),_0x2e7425=await this['_prepareRequestParameters'](this['_requestParameters'],_0x176f8d),_0x2d601e={'messages':_0x47b2f0,..._0x2e7425},_0x55e078={'method':'POST','headers':_0x240eaa,'body':JSON['stringify'](_0x2d601e),'signal':this['abortController']['signal']},_0x127b28=await fetch(this['_apiUrl'],_0x55e078);if(_0x127b28['ok'])return _0x2e7425['stream']?await this['_readStreamableResponse'](_0x127b28,_0x45ac6e):await this['_readStaticResponse'](_0x127b28,_0x45ac6e),Promise['resolve']();{const _0x339c85=await _0x127b28['text']();return _0x339c85['includes']('context_length_exceeded')?Promise['reject'](new tr(Yn(_0x5cef9d,'AI_ERROR_CONTEXT_LENGTH'))):_0x339c85['includes']('Moderation')?Promise['reject'](new tr(Yn(_0x5cef9d,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x339c85));}}async['prepareMessages'](_0x21abdf,_0x4dacec,_0x2ea7b2){let _0x5e7470,_0x42d34e;return _0x4dacec?(_0x5e7470='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.',_0x42d34e='Instruction:\x0a'+_0x21abdf+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4dacec):(_0x5e7470='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.',_0x42d34e=_0x21abdf),[{'role':'system','content':_0x5e7470},{'role':'user','content':_0x42d34e}];}async['_readStreamableResponse'](_0x23ef24,_0x20dd45){const _0x507a73=_0x23ef24['body']['getReader'](),_0x5d0dff=new TextDecoder();let _0x246f3c='',_0x5e0925='',_0xd3e850='',_0x156aa4=!0x1;for(;!_0x156aa4;){const {done:_0x3b5dc3,value:_0xbd216b}=await _0x507a73['read'](),_0x42a4c7=_0x246f3c+_0x5d0dff['decode'](_0xbd216b);let _0x3f4b5c='';_0x156aa4=_0x3b5dc3;try{_0x3f4b5c=this['_cleanUpData'](_0x42a4c7),_0x246f3c='';}catch{_0x246f3c=_0x42a4c7;continue;}_0x5e0925+=_0x3f4b5c,!_0x156aa4&&this['_isBufferIncomplete'](_0x5e0925)||_0x5e0925&&(_0xd3e850+=_0x5e0925,_0x5e0925='',_0x20dd45(_0xd3e850));}return Promise['resolve']();}async['_readStaticResponse'](_0x56ff6c,_0x1986d5){return _0x1986d5((await _0x56ff6c['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1b9dc6){const _0x323e51=_0x1b9dc6['split']('<')['length']!==_0x1b9dc6['split']('>')['length'],_0x562b84=_0x1b9dc6['length']<0x1e;return _0x323e51&&_0x562b84;}['_cleanUpData'](_0x8cfc9b){return _0x8cfc9b['split'](/\n(?![^{]*\})/g)['map'](_0x468e91=>_0x468e91['replace']('data:\x20',''))['filter'](_0x365e6d=>_0x365e6d&&_0x365e6d['length']>0x0&&'[DONE]'!==_0x365e6d)['map'](_0x1dcbac=>{const {choices:_0x53ae65}=JSON['parse'](_0x1dcbac);if(_0x53ae65[0x0]?.['delta']?.['content'])return _0x53ae65[0x0]['delta']['content'];})['filter'](_0x129793=>_0x129793)['join']('');}}class zn extends pe{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0xea11a2){super(_0xea11a2),_0xea11a2['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0xea11a2['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']=_0xea11a2['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0xea11a2['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0xea11a2['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0xea11a2['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x4c6635,context:_0x5219e0,onData:_0x1e0d49,actionId:_0x3f546c}){const {model:_0x3cc52e,stream:_0x405c65,..._0x1ebb62}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3f546c),_0x28a030={'prompt':await this['preparePrompt'](_0x4c6635,_0x5219e0,_0x3cc52e,_0x3f546c),..._0x1ebb62};this['_apiUrl']?await this['_processProxyRequest'](_0x28a030,_0x3cc52e,_0x405c65,_0x1e0d49,_0x3f546c):await this['_processAWSRequest'](_0x28a030,_0x3cc52e,_0x405c65,_0x1e0d49);}async['preparePrompt'](_0x3a0d4b,_0x508480,_0x4ff43a,_0x2d0357){let _0x175002,_0x861c57;return _0x508480?(_0x175002='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.',_0x861c57='Instruction:\x0a'+_0x3a0d4b+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x508480):(_0x175002='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.',_0x861c57=_0x3a0d4b),'meta.llama'==this['getModelFamily'](_0x4ff43a)?'<<SYS>>\x0a'+_0x175002+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x861c57+'\x0a[/INST]':'Human:\x0a'+_0x175002+'\x0a'+_0x861c57+'\x0a\x0aAssistant:';}['getModelFamily'](_0x462037){if(/^anthropic\.claude/['test'](_0x462037))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x462037))return'ai21.j2';if(/^cohere\.command/['test'](_0x462037))return'cohere.command';if(/^meta\.llama/['test'](_0x462037))return'meta.llama';throw new tr(Yn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x462037));}async['_processProxyRequest'](_0x107b2c,_0x9740af,_0x449b64,_0x4ea8fa,_0xabbb17){const _0x2bbd0f={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xabbb17),'body':JSON['stringify']({..._0x107b2c,'model':_0x9740af,'stream':_0x449b64}),'signal':this['abortController']['signal']},_0x134101=await fetch(this['_apiUrl'],_0x2bbd0f);_0x449b64?await this['_readStreamableResponse'](_0x134101,_0x9740af,_0x4ea8fa):await this['_readStaticResponse'](_0x134101,_0x9740af,_0x4ea8fa);}async['_processAWSRequest'](_0x2ce7bc,_0x1df126,_0x2a6acb,_0x5d99ae){const _0xc4e0b8=new _0x46e017(this['_bedrockClientConfig']),_0x3b885a={'body':JSON['stringify'](_0x2ce7bc),'contentType':'application/json','accept':'application/json','modelId':_0x1df126};let _0x3d39b1;if(_0x2a6acb){const _0x17105a=new _0x366721(_0x3b885a);_0x3d39b1=await _0xc4e0b8['send'](_0x17105a,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3d39b1,_0x1df126,_0x5d99ae);}else{const _0x47c8c9=new _0x293e8(_0x3b885a);_0x3d39b1=await _0xc4e0b8['send'](_0x47c8c9,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3d39b1,_0x1df126,_0x5d99ae);}}async['_readAsyncIterableResponse'](_0x2d31a3,_0x5a872a,_0x5ab4c1){const _0x14d6aa=_0x2d31a3['body'],_0x894a66=new TextDecoder('utf-8');let _0x1068cc='';for await(const _0x39b70a of _0x14d6aa)if(_0x39b70a['chunk']){const _0x392b95=_0x894a66['decode'](_0x39b70a['chunk']['bytes']),_0x5d42bb=JSON['parse'](_0x392b95);_0x1068cc+=this['_getGeneratedText'](_0x5d42bb,_0x5a872a),_0x5ab4c1(_0x1068cc);}return Promise['resolve']();}async['_readStreamableResponse'](_0x2e0aed,_0xa70734,_0x44c249){const _0x32e738=_0x2e0aed['body'],_0x2f1d20=new TextDecoder('utf-8'),_0xa1d5ff=_0x32e738['getReader']();let _0x27c0fe='',_0x3a2e44='',_0x3b5800=!0x1;for(;!_0x3b5800;){const {done:_0x12c78d,value:_0x4ddd8b}=await _0xa1d5ff['read']();if(_0x3b5800=_0x12c78d,_0x3b5800)break;const _0x2281c7=(_0x27c0fe+_0x2f1d20['decode'](_0x4ddd8b))['split']('\x0a')['map'](_0x56d799=>{try{return _0x27c0fe='',JSON['parse'](_0x56d799);}catch{return _0x27c0fe=_0x56d799,null;}})['filter'](_0x414dfc=>null!==_0x414dfc);_0x2281c7['length']&&(_0x3a2e44+=_0x2281c7['map'](_0x126d0=>this['_getGeneratedText'](_0x126d0,_0xa70734))['join'](''),_0x44c249(_0x3a2e44));}return Promise['resolve']();}async['_readStaticResponse'](_0x3e1291,_0x4a6c1b,_0x583cd0){let _0x242201;return _0x242201=_0x3e1291 instanceof Response?await _0x3e1291['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x3e1291['body'])),(_0x583cd0(this['_getGeneratedText'](_0x242201,_0x4a6c1b)),Promise['resolve']());}['_getGeneratedText'](_0x355ed7,_0x52bab4){switch(this['getModelFamily'](_0x52bab4)){case'anthropic.claude':return _0x355ed7['completion'];case'ai21.j2':return _0x355ed7['completions'][0x0]['data']['text'];case'cohere.command':return _0x355ed7['generations'][0x0]['text'];case'meta.llama':return _0x355ed7['generation'];}}}class Bs extends _0x290cbd{constructor(_0x19ba63,_0x28a108={}){super(_0x19ba63),this['isToggleable']=!0x0,this['set']('side',_0x28a108['side']||'top');const _0xb03e61=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x1b1674(_0x28a108['class']||[]),_0xb03e61['to']('side',_0x406c51=>'ck-tab-button_'+_0x406c51),_0xb03e61['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Ps extends _0x3249c4{['children'];constructor(_0x116dca,_0x4c15ee={}){super(_0x116dca);const _0x490f37=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x1b1674(_0x4c15ee['class']||[]),_0x490f37['to']('class'),_0x490f37['if']('isVisible','ck-hidden',_0x3ee27d=>!_0x3ee27d)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x3249c4{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x210f21,_0x1d5108={}){super(_0x210f21),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x1d5108['side']||'top'),this['set']('isMaximized',!0x1);const _0x5ee257=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x1b1674(_0x1d5108['class']||[]),_0x5ee257['to']('side',_0x594fd8=>'ck-tabs_'+_0x594fd8),_0x5ee257['to']('class'),_0x5ee257['to']('isMaximized',_0x4c0691=>_0x4c0691?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x5ee257['to']('side',_0x265c0a=>'ck-tabs__buttons-container_'+_0x265c0a)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x5ee257['to']('side',_0x4840a9=>'ck-tabs__panels-container_'+_0x4840a9)]},'children':this['panelViews']},..._0x1b1674(_0x1d5108['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x590c64){const _0x16238a=this['_tabs']['get'](_0x590c64);return _0x16238a||null;}['addTab'](_0x4adbed){const _0x5df7fa=this['_setupButton']({'id':_0x4adbed['id'],'label':_0x4adbed['buttonLabel'],'icon':_0x4adbed['buttonIcon'],'order':_0x4adbed['order']}),_0x54bb1d=new Ps(this['locale']);return _0x54bb1d['render'](),_0x4adbed['content']&&_0x54bb1d['children']['add'](_0x4adbed['content']),this['panelViews']['add'](_0x54bb1d),this['_tabs']['set'](_0x4adbed['id'],{'button':_0x5df7fa,'panel':_0x54bb1d,'order':void 0x0!==_0x4adbed['order']?_0x4adbed['order']:null}),this['fire']('addTab:'+_0x4adbed['id'],{'id':_0x4adbed['id'],'button':_0x5df7fa,'panel':_0x54bb1d}),null===this['activeTab']?this['activateTab'](_0x4adbed['id']):this['_hidePanel'](_0x4adbed['id']),{'button':_0x5df7fa,'panel':_0x54bb1d};}['activateTab'](_0x3ccf0c){if(null!==_0x3ccf0c&&!this['getTab'](_0x3ccf0c))throw new _0x2120c6('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3ccf0c});this['activeTab']!==_0x3ccf0c&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3ccf0c,_0x3ccf0c&&this['_showPanel'](_0x3ccf0c),this['fire']('activateTab:'+_0x3ccf0c,_0x3ccf0c));}['showTab'](_0x537d8d){if(!this['getTab'](_0x537d8d))throw new _0x2120c6('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x537d8d});this['_showPanel'](_0x537d8d),this['_showButton'](_0x537d8d),this['fire']('show:'+_0x537d8d,_0x537d8d);}['hideTab'](_0x197853){if(!this['getTab'](_0x197853))throw new _0x2120c6('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x197853});const _0x5d5fc7=this['activeTab'];this['_hidePanel'](_0x197853),this['_hideButton'](_0x197853);const _0x4e9c68=this['getTabIds']();_0x5d5fc7===_0x197853&&_0x4e9c68['length']>0x1&&this['activateTab'](_0x4e9c68['find'](_0x3d7051=>_0x3d7051!==_0x197853)),this['fire']('hide:'+_0x197853,_0x197853);}['_getPanel'](_0x35dc08){const _0xf81803=this['_tabs']['get'](_0x35dc08);return _0xf81803?_0xf81803['panel']:null;}['_showPanel'](_0x3423c2){null!==this['activeTab']&&this['activeTab']!==_0x3423c2||this['_getPanel'](_0x3423c2)['show']();}['_hidePanel'](_0x3e4c1c){const _0x46ae61=this['_getPanel'](_0x3e4c1c);_0x46ae61['isVisible']&&(this['activeTab']===_0x3e4c1c&&(this['activeTab']=null),_0x46ae61['hide']());}['_getButton'](_0x500085){const _0x2475fa=this['_tabs']['get'](_0x500085);return _0x2475fa?_0x2475fa['button']:null;}['_showButton'](_0x4371c8){this['_getButton'](_0x4371c8)['show']();}['_hideButton'](_0x3b48f5){this['_getButton'](_0x3b48f5)['hide']();}['_setupButton'](_0x2349b0){const _0x386ed2=new Bs(this['locale'],{'side':this['side']}),_0x589e07=this['buttonViews'];if(_0x386ed2['set']({'label':_0x2349b0['label'],'icon':_0x2349b0['icon'],'tooltip':!0x0,'withText':!0x0}),_0x386ed2['bind']('isOn')['to'](this,'activeTab',_0x42f800=>_0x42f800===_0x2349b0['id']),_0x386ed2['bind']('side')['to'](this,'side'),_0x2349b0['order']){const _0x3090a4=[...this['_tabs']]['reduce']((_0x5ea071,_0x25c070)=>{const _0x36e106=_0x25c070[0x0],{order:_0x57287d}=_0x25c070[0x1];return!_0x57287d||_0x57287d>_0x2349b0['order']?_0x5ea071:_0x57287d>=_0x5ea071['order']?{'id':_0x36e106,'order':_0x57287d}:_0x5ea071;},{'id':'','order':0x0}),_0x454574=_0x589e07['getIndex'](this['_getButton'](_0x3090a4['id']));_0x589e07['add'](_0x386ed2,_0x454574+0x1);}else _0x589e07['add'](_0x386ed2);return _0x386ed2['on']('execute',()=>{this['activateTab'](_0x2349b0['id']);}),_0x386ed2;}}const pi=['overlay','sidebar','custom'],di=['left','right'];class ui extends ss{constructor(_0x1e162e,_0x27cf89={}){super(_0x1e162e,_0x27cf89),this['set']('type',_0x27cf89['type']||'sidebar'),this['set']('side',_0x27cf89['side']||'right'),this['set']('isVisible',_0x27cf89['visibleByDefault']??!0x0);const _0x400027=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x400027['if']('type','ck-ai-tabs__overlay',_0x348c4d=>'overlay'===_0x348c4d),_0x400027['if']('type','ck-ai-tabs__sidebar',_0x2fd042=>'sidebar'===_0x2fd042),_0x400027['if']('isVisible','ck-hidden',_0x2f434a=>!_0x2f434a)]}}),this['buttonViews']['on']('add',(_0x345b4b,_0x50d573)=>{_0x50d573['set']('withText',!0x1);});}}class Ct extends _0x3e59e0{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4d78c8){super(_0x4d78c8);const _0x32bdfd=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x32bdfd)throw new _0x2120c6('ai-tabs-configuration-not-found');if(void 0x0!==_0x32bdfd['showResizeButton']&&(this['showResizeButton']=_0x32bdfd['showResizeButton']),'sidebar'!==_0x32bdfd['type']&&'overlay'!==_0x32bdfd['type']||_0x32bdfd['side']&&(this['side']=_0x32bdfd['side']),'sidebar'===_0x32bdfd['type']){if(this['container']=_0x32bdfd['element'],this['set']('type','sidebar'),!this['container'])throw new _0x2120c6('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x32bdfd['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ui(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x32bdfd['visibleByDefault']||_0x32bdfd['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 pt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x4cb395){if(_0x4cb395&&this['type']!==_0x4cb395){if(!pi['includes'](_0x4cb395))throw new _0x2120c6('ai-tabs-unsupported-ui-type');this['type']=_0x4cb395;}}['switchSide'](_0x5cbbc8){if(_0x5cbbc8&&this['side']!==_0x5cbbc8){if(!di['includes'](_0x5cbbc8))throw new _0x2120c6('ai-tabs-unsupported-ui-side');this['side']=_0x5cbbc8;}}['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 R extends _0x3e59e0{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4d8b4d){super(_0x4d8b4d),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 _0x32744f=this['context']['plugins']['get']('CloudServices');if(!_0x32744f['token'])throw new _0x2120c6('ai-missing-token',this);this['_token']=_0x32744f['token'];}['startConversation'](_0x2c5bbe,_0x2836ba){const _0x275b33=this['_sendApiRequest']('/conversations','POST',{'id':_0x2c5bbe,'group':_0x2836ba});return{'getConversation':async()=>(await _0x275b33['request'])['json'](),'abortController':_0x275b33['abortController']};}['queryAssistant']({message:_0x5994fa,conversationId:_0x11081d,parts:_0x1d7a5c,capabilities:_0x188da3,model:_0x1a9d14,quickActionData:_0x597bb4}){const _0x420fec={..._0x597bb4&&{'quickActionData':_0x597bb4}},_0x1307ab={'prompt':_0x5994fa,'content':_0x1d7a5c,'model':_0x1a9d14,..._0x188da3&&{'capabilities':_0x188da3},...Object['keys'](_0x420fec)['length']>0x0&&{'attributes':_0x420fec}},_0x1181c4=this['_sendApiRequest']('/conversations/'+_0x11081d+'/messages','POST',_0x1307ab);return{'getStream':async()=>{const _0x40da73=(await _0x1181c4['request'])['body'];return this['_getStreamReader'](_0x40da73);},'abortController':_0x1181c4['abortController']};}['executeCustomAction']({content:_0x3e1b1c,message:_0x10054e,model:_0x242886,outputFormat:_0x109cd5}){const _0x4da111={'content':[{'type':'text','content':_0x3e1b1c}],'prompt':_0x10054e,'model':_0x242886,'outputFormat':_0x109cd5},_0x183c12=this['_sendApiRequest']('/actions/custom/calls','POST',_0x4da111);return{'getStream':async()=>{const _0x23bcc5=(await _0x183c12['request'])['body'];return this['_getStreamReader'](_0x23bcc5);},'abortController':_0x183c12['abortController']};}['executeAction']({actionName:_0x2300fc,content:_0x17bb45,args:_0x516bdc}){const _0x4e27fd={'content':[{'type':'text','content':_0x17bb45}],'args':_0x516bdc},_0x4cadd9=this['_sendApiRequest']('/actions/system/'+_0x2300fc+'/calls','POST',_0x4e27fd);return{'getStream':async()=>{const _0x162945=(await _0x4cadd9['request'])['body'];return this['_getStreamReader'](_0x162945);},'abortController':_0x4cadd9['abortController']};}['uploadFile'](_0x3170ed,_0x4d53f6,_0x111487){const _0x78b46e=new FormData();_0x78b46e['append']('file',_0x4d53f6,_0x4d53f6['name']),_0x111487&&_0x78b46e['append']('attributes',JSON['stringify'](_0x111487));const _0x3e9013=this['_sendApiRequest']('/conversations/'+_0x3170ed+'/files','POST',_0x78b46e);return{'getId':async()=>(await _0x3e9013['request'])['json'](),'abortController':_0x3e9013['abortController']};}['fetchDocument'](_0x3a8cca,_0x3212f0){const _0x106d01=this['_sendApiRequest']('/conversations/'+_0x3a8cca+'/documents/'+_0x3212f0,'GET');return{'getDocument':async()=>(await _0x106d01['request'])['json'](),'abortController':_0x106d01['abortController']};}['uploadDocument'](_0x581a32,_0x400fa4,_0x551bbe){const _0x4da85d={'content':_0x400fa4};_0x551bbe&&(_0x4da85d['attributes']=_0x551bbe);const _0x769d34=this['_sendApiRequest']('/conversations/'+_0x581a32+'/documents','POST',_0x4da85d);return{'getId':async()=>(await _0x769d34['request'])['json'](),'abortController':_0x769d34['abortController']};}['fetchConversations'](_0x4d1b94,_0x1c8f24){const _0x266a3a=new URLSearchParams();_0x266a3a['append']('excludeEmpty','true'),_0x266a3a['append']('limit','100'),_0x266a3a['append']('group',_0x4d1b94),_0x1c8f24&&_0x266a3a['append']('search',_0x1c8f24);const _0x161c2=this['_sendApiRequest']('/conversations?'+_0x266a3a['toString'](),'GET');return{'getConversations':async()=>{const _0x3a0dd3=await _0x161c2['request'];return(await _0x3a0dd3['json']())['items'];},'abortController':_0x161c2['abortController']};}['deleteConversation'](_0x368306){const _0xbfecf0=this['_sendApiRequest']('/conversations/'+_0x368306,'DELETE');return{'execute':async()=>{await _0xbfecf0['request'];},'abortController':_0xbfecf0['abortController']};}['updateConversation'](_0x490f81,_0x560b5a){const _0x2aacbe=this['_sendApiRequest']('/conversations/'+_0x490f81,'PATCH',_0x560b5a);return{'getResult':async()=>(await _0x2aacbe['request'],_0x560b5a),'abortController':_0x2aacbe['abortController']};}['fetchConversation'](_0x21fe02){const _0x39ab2b=this['_sendApiRequest']('/conversations/'+_0x21fe02,'GET');return{'getConversation':async()=>(await _0x39ab2b['request'])['json'](),'abortController':_0x39ab2b['abortController']};}['fetchConversationMessages'](_0x460762){const _0x34187e=this['_sendApiRequest']('/conversations/'+_0x460762+'/messages','GET');return{'getMessages':async()=>{const _0x562781=await _0x34187e['request'];return(await _0x562781['json']())['items'];},'abortController':_0x34187e['abortController']};}['uploadUrl'](_0x30e21c,_0x265b74,_0x2c4c5a){const _0x3f0da7=this['_sendApiRequest']('/conversations/'+_0x30e21c+'/web-resources','POST',{'url':_0x265b74,'attributes':_0x2c4c5a});return{'getId':async()=>(await _0x3f0da7['request'])['json'](),'abortController':_0x3f0da7['abortController']};}['getModels'](){const _0x342f88=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x342f88['request'])['json'](),'abortController':_0x342f88['abortController']};}['deleteFile'](_0x58d2ec,_0x3ff5f2){const _0x3f5bb0=this['_sendApiRequest']('/conversations/'+_0x58d2ec+'/files/'+_0x3ff5f2,'DELETE');return{'execute':async()=>{await _0x3f5bb0['request'];},'abortController':_0x3f5bb0['abortController']};}['deleteDocument'](_0x32f558,_0x4b0e0e){const _0x52458b=this['_sendApiRequest']('/conversations/'+_0x32f558+'/documents/'+_0x4b0e0e,'DELETE');return{'execute':async()=>{await _0x52458b['request'];},'abortController':_0x52458b['abortController']};}['deleteWebResource'](_0x475087,_0x43237a){const _0x47dab6=this['_sendApiRequest']('/conversations/'+_0x475087+'/web-resources/'+_0x43237a,'DELETE');return{'execute':async()=>{await _0x47dab6['request'];},'abortController':_0x47dab6['abortController']};}['callSystemReview']({reviewName:_0x28dabe,content:_0x2549ee,args:_0x44b861}){const _0x2ea987=this['_sendApiRequest']('/reviews/system/'+_0x28dabe+'/calls','POST',{'content':[{'type':'text','content':_0x2549ee}],'args':_0x44b861});return{'getStream':async()=>{const _0x1638d2=(await _0x2ea987['request'])['body'];return this['_getStreamReader'](_0x1638d2);},'abortController':_0x2ea987['abortController']};}['callCustomReview']({content:_0x2a8f02,prompt:_0x50f272,model:_0x50f57a}){const _0x4529f8=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2a8f02}],'prompt':_0x50f272,'model':_0x50f57a});return{'getStream':async()=>{const _0x5a3ed6=(await _0x4529f8['request'])['body'];return this['_getStreamReader'](_0x5a3ed6);},'abortController':_0x4529f8['abortController']};}['upsertAIChatRating'](_0x516000,_0x4ca14d,_0x5b11b9){const _0x2f45ee=this['_sendApiRequest']('/conversations/'+_0x516000+'/messages/'+_0x4ca14d+'/ratings','PUT',{'positiveCount':_0x5b11b9['positiveCount'],'totalCount':_0x5b11b9['totalCount'],'modificationId':_0x5b11b9['modificationId']});return{'execute':async()=>{await _0x2f45ee['request'];},'abortController':_0x2f45ee['abortController']};}['upsertAIActionRating'](_0x130f13,_0xe7b9d4,_0x4d1c99){const _0x27d99e=this['_sendApiRequest']('/actions/system/'+_0x130f13+'/calls/'+_0xe7b9d4+'/ratings','PUT',{'positiveCount':_0x4d1c99['positiveCount'],'totalCount':_0x4d1c99['totalCount']});return{'execute':async()=>{await _0x27d99e['request'];},'abortController':_0x27d99e['abortController']};}['upsertCustomAIActionRating'](_0x287b80,_0x324c7e){const _0x6d7456=this['_sendApiRequest']('/actions/custom/calls/'+_0x287b80+'/ratings','PUT',{'positiveCount':_0x324c7e['positiveCount'],'totalCount':_0x324c7e['totalCount']});return{'execute':async()=>{await _0x6d7456['request'];},'abortController':_0x6d7456['abortController']};}['upsertAIReviewRating'](_0x39c783,_0x27e992,_0x1565b5,_0xe8efc3){const _0xc2c6ee=this['_sendApiRequest']('/reviews/system/'+_0x39c783+'/calls/'+_0x27e992+'/ratings','PUT',{'positiveCount':_0x1565b5['positiveCount'],'totalCount':_0x1565b5['totalCount'],'dataId':_0xe8efc3});return{'execute':async()=>{await _0xc2c6ee['request'];},'abortController':_0xc2c6ee['abortController']};}['upsertCustomAIReviewRating'](_0x404dc5,_0x43aab9,_0x2b4051){const _0x2a428a=this['_sendApiRequest']('/reviews/custom/calls/'+_0x404dc5+'/ratings','PUT',{'positiveCount':_0x43aab9['positiveCount'],'totalCount':_0x43aab9['totalCount'],'dataId':_0x2b4051});return{'execute':async()=>{await _0x2a428a['request'];},'abortController':_0x2a428a['abortController']};}['_sendApiRequest'](_0x5b4935,_0x209b33,_0x937ca1){const _0x5588c3=new AbortController(),_0x142c14=_0x937ca1 instanceof FormData,_0x447c8b={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x937ca1&&!_0x142c14&&(_0x447c8b['Content-Type']='application/json');const _0x1abf79={'method':_0x209b33,'headers':_0x447c8b,'signal':_0x5588c3['signal']};return _0x937ca1&&(_0x1abf79['body']=_0x142c14?_0x937ca1:JSON['stringify'](_0x937ca1)),{'request':fetch(''+this['_apiUrl']+_0x5b4935,_0x1abf79)['catch'](_0x259522=>{this['_handleError'](_0x259522);})['then'](_0x4fead5=>{if(!_0x4fead5['ok'])throw new _0x2120c6('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x5b4935,'method':_0x209b33,'body':_0x937ca1,'status':(_0x4fead5||{})['status'],'statusText':(_0x4fead5||{})['statusText']});return _0x4fead5;}),'abortController':_0x5588c3};}async*['_getStreamReader'](_0x51f89a){const _0x35d91f=[],_0x230fa5=_0x51f89a['getReader'](),_0x520f03=$t({'onError':_0x16de33=>{this['_handleError'](_0x16de33);},'onEvent':_0x56a782=>{_0x56a782['data']=JSON['parse'](_0x56a782['data']),_0x35d91f['push'](_0x56a782);}});try{let _0x2a3feb=!0x1;for(;!_0x2a3feb;){const {done:_0x3e4482,value:_0x298089}=await _0x230fa5['read']();_0x3e4482&&(_0x2a3feb=!0x0),_0x520f03['feed'](this['_decoder']['decode'](_0x298089,{'stream':!0x0})),yield*_0x35d91f,_0x35d91f['length']=0x0;}}catch(_0x6e50ce){this['_handleError'](_0x6e50ce);}finally{_0x230fa5['releaseLock'](),_0x520f03['reset']();}}['_handleError'](_0x1c0ab2){if(_0x1c0ab2 instanceof _0x2120c6)throw _0x1c0ab2;if(_0x1c0ab2 instanceof Error&&'AbortError'===_0x1c0ab2['name'])throw new _0x2120c6('ai-request-aborted',this,{'originalError':_0x1c0ab2});throw new _0x2120c6('ai-request-failed',this,{'originalError':_0x1c0ab2});}}function i(_0x50de52,_0xa8d8d4,_0x3b02e1){const t=_0x50de52['t'];switch(_0xa8d8d4){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'},_0x3b02e1);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.'},_0x3b02e1);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.'},_0x3b02e1);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.'},_0x3b02e1);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'},_0x3b02e1);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'},_0x3b02e1);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x3b02e1);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'},_0x3b02e1);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x3b02e1);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'},_0x3b02e1);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x3b02e1);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.'},_0x3b02e1);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.'},_0x3b02e1);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.'},_0x3b02e1);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.'},_0x3b02e1);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'},_0x3b02e1);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.'},_0x3b02e1);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 _0xa8d8d4;}}function ks(_0x38585f,_0x494ab6){const _0x23c244=new _0x290cbd(_0x38585f),_0x5f519a=i(_0x38585f,'AI_TABS_LABEL_MINIMIZE'),_0x37cfe7=i(_0x38585f,'AI_TABS_LABEL_MAXIMIZE');return _0x23c244['set']({'withText':!0x1,'icon':_0x4b4d07,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x23c244['bind']('label')['to'](_0x494ab6,'isMaximized',_0x1defdd=>_0x1defdd?_0x5f519a:_0x37cfe7),_0x23c244['bind']('icon')['to'](_0x494ab6,'isMaximized',_0x58cd8f=>_0x58cd8f?to:_0x4b4d07),_0x23c244['bind']('isOn')['to'](_0x494ab6,'isMaximized'),_0x23c244['on']('execute',()=>{_0x494ab6['fire']('resizeTabs');}),_0x23c244;}function ze(_0x194ed3){return _0x2baa55(_0x194ed3);}function St(_0xf95aef){return _0x20a8a4(_0xf95aef);}function Dt(_0x3cbc1c,_0x3da80a,_0x28106c){const _0x17cf4c=null!==_0x3da80a?_0x58876d=>_0x58876d['attribs'][_0x3cbc1c]===_0x3da80a:_0x54eb80=>Boolean(_0x54eb80['attribs'][_0x3cbc1c]);return wt(_0x141422=>_0x42188e(_0x141422)&&_0x17cf4c(_0x141422),_0x28106c);}function Xe(_0x180c04,_0x4a43cf,_0x187771){const _0x2669f2=null!==_0x4a43cf?_0x362049=>_0x362049['attribs'][_0x180c04]===_0x4a43cf:_0x5840d4=>Boolean(_0x5840d4['attribs'][_0x180c04]);return _0x4858d0(_0x1bf19b=>_0x42188e(_0x1bf19b)&&_0x2669f2(_0x1bf19b),_0x187771);}function Et(_0x10f3f0,_0x50cb70){return _0x10f3f0&&_0x42188e(_0x10f3f0)?_0x10f3f0['attribs'][_0x50cb70]:null;}function Ji(_0x90c460,_0x5cb635,_0x24f4b0){_0x42188e(_0x90c460)&&(null===_0x24f4b0?delete _0x90c460['attribs'][_0x5cb635]:_0x90c460['attribs'][_0x5cb635]=_0x24f4b0);}function Bi(_0x4602d9,_0x4a6270,_0x1965a4){const _0x3cfb37=_0x4a6270['cloneNode'](!0x0);'beforebegin'===_0x1965a4?_0x7c35e5(_0x4602d9,_0x3cfb37):'afterbegin'===_0x1965a4?_0x3041bd(_0x4602d9,_0x3cfb37):'beforeend'===_0x1965a4?_0xfe36b5(_0x4602d9,_0x3cfb37):'afterend'===_0x1965a4&&_0x5e4053(_0x4602d9,_0x3cfb37);}function qe(_0x5db9cc){const _0x4955d6=[];let _0x1fafef=_0x5db9cc;for(;_0x1fafef;)_0x1fafef=_0x3f6b40(_0x1fafef),_0x1fafef&&_0x4955d6['push'](_0x1fafef);return _0x4955d6;}function Jn(_0x6e7bc2){return _0x6e7bc2['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Xi(_0x35cebc){let _0x2afa27=0x0;for(;_0x35cebc['parentNode'];)_0x35cebc=_0x35cebc['parentNode'],_0x2afa27++;return _0x2afa27;}function $i(_0x4b78fe){const _0x2a9aeb=[];let _0x59d501=_0x4b78fe['nextSibling'];for(;_0x59d501;)_0x2a9aeb['push'](_0x59d501),_0x59d501=_0x59d501['nextSibling'];_0x2a9aeb['forEach'](_0x37e0cc=>{_0x55953c(_0x37e0cc);});}class Je extends/* #__PURE__ -- @preserve */
|
|
25
|
-
|
|
26
|
-
ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x796713){super(),this['_generateUid']=_0x796713||_0x1a633f;}['merge'](_0x28d1d4,_0x32877d,_0x35a264){const _0x420197=_0x28d1d4['cloneNode'](!0x0);if(0x0===_0x32877d['childNodes']['length']){const _0x49c3f7=[];return Xe('data-id','new-element',_0x420197)['forEach'](_0x412b40=>{const _0x26485b=this['_generateUid']();Ji(_0x412b40,'data-id',_0x26485b),_0x49c3f7['push'](_0x26485b);}),this['_removeSpecialComments'](_0x420197),{'parsedContent':_0x420197,'newNodeIds':_0x49c3f7,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x35a264&&_0x35a264['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x420197),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Xe('data-id',null,_0x32877d)['map'](_0x39cdda=>Et(_0x39cdda,'data-id'))['filter'](_0x55c24a=>!!_0x55c24a));let _0x2aad7d=-0x1,_0x3b1325=!0x1;const _0x263e75=_0x420197['childNodes'],_0x1f117d=Array['from'](_0x263e75)['filter'](_0x40897a=>!(0x3===_0x40897a['nodeType']&&''===St(_0x40897a)['trim']())),_0x47d3f2=_0x1f117d['length'];for(let _0x2f68ac=0x0;_0x2f68ac<_0x47d3f2;_0x2f68ac++){const _0x225431=_0x1f117d[_0x2f68ac],_0x587f9f=_0x1f117d[_0x2f68ac+0x1];if(this['_isNewNode'](_0x225431)){if(-0x1===_0x2aad7d&&(_0x2aad7d=_0x2f68ac),this['_markWrappedElements'](_0x225431),!this['_isNewNode'](_0x587f9f)){const [_0x1c0a91,_0x1a5cc4]=this['_findReferenceNode'](_0x225431,_0x3b1325,_0x32877d);if(_0x1c0a91){const _0x50a5c2=Array['from'](_0x1f117d)['slice'](_0x2aad7d,_0x2f68ac+0x1);this['_insertNodes'](_0x1c0a91,_0x50a5c2,_0x1a5cc4),_0x2aad7d=-0x1;}}}else{if(this['_isExistingContentComment'](_0x225431))_0x3b1325=!0x0;else{if(this['_isExistingNode'](_0x225431)){const _0xff96f9=Et(_0x225431,'data-id');if(_0xff96f9&&this['_existingDataIds']['has'](_0xff96f9)){const _0x563a7e=Dt('data-id',_0xff96f9,_0x32877d);this['_replaceNode'](_0x563a7e,_0x225431);}if(this['_touchedNodesState']['removedIds']['includes'](_0xff96f9)){const _0x590e34=this['_touchedNodesState']['removedIds']['indexOf'](_0xff96f9);this['_touchedNodesState']['removedIds']['splice'](_0x590e34,0x1);}}else{if(this['_isDelNode'](_0x225431)){const _0x466e09=Et(_0x225431,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x466e09)||this['_storeDeletedElementIds'](_0x225431);}}}}}for(const _0x5951c2 of this['_touchedNodesState']['removedIds']){const _0x45b309=Dt('data-id',_0x5951c2,_0x32877d);if(_0x45b309){if(_0x35a264&&_0x35a264['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x5951c2;const _0x4a7f1b=_0x35a264['replaceRemovedWith']['cloneNode'](!0x0);Ji(_0x4a7f1b,'data-id',_0x5951c2),Ji(_0x4a7f1b,'data-removed','true'),_0x34bc5c(_0x45b309,_0x4a7f1b);}else _0x55953c(_0x45b309);}}if(Xe('data-wrapped-id',null,_0x32877d)['forEach'](_0x402caa=>{const _0x15b5f9=Dt('data-id',Et(_0x402caa,'data-wrapped-id'),_0x32877d);var _0xfe8eac,_0x2bfd48;_0x15b5f9&&(_0x2bfd48=_0x402caa,_0x55953c(_0xfe8eac=_0x15b5f9),_0x34bc5c(_0x2bfd48,_0xfe8eac));}),Xe('data-id','new-element',_0x32877d)['forEach'](_0xc57fd7=>{const _0x412a4d=this['_getUid'](_0xc57fd7);Ji(_0xc57fd7,'data-id',_0x412a4d),this['_touchedNodesState']['newIds']['push'](_0x412a4d);}),this['_removeSpecialComments'](_0x32877d),_0x35a264&&_0x35a264['markUnstableElements']&&this['_markUnstableElements'](_0x32877d,_0x35a264['markUnstableElementsDepth']||0x0),_0x35a264&&_0x35a264['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x433b39=Dt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x32877d);for(;_0x433b39;)$i(_0x433b39),_0x433b39=_0x433b39['parentNode'];}return{'parsedContent':_0x32877d,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x1fc00b,_0x2ce6a0,_0x3234b8){for(const _0x201cb4 of _0x2ce6a0){const _0x4fd888=this['_getUid'](_0x201cb4);Ji(_0x201cb4,'data-id',_0x4fd888),this['_touchedNodesState']['newIds']['push'](_0x4fd888),this['_touchedNodesState']['lastTouchedId']=_0x4fd888;}const _0x2ecee3='afterbegin'===_0x3234b8||'afterend'===_0x3234b8?_0x2ce6a0['reverse']():_0x2ce6a0;for(const _0x352e61 of _0x2ecee3)Bi(_0x1fc00b,_0x352e61,_0x3234b8);}['_replaceNode'](_0x17a89d,_0x39f67e){if(!_0x17a89d)return;if(_0x54765d=_0x39f67e,Jn(St(_0x17a89d))===Jn(St(_0x54765d)))return;var _0x54765d;const _0x29b3c9=this['_getUid'](_0x17a89d);Ji(_0x39f67e,'data-id',_0x29b3c9),this['_touchedNodesState']['modifiedIds']['push'](_0x29b3c9),this['_touchedNodesState']['lastTouchedId']=_0x29b3c9,_0x34bc5c(_0x17a89d,_0x39f67e['cloneNode'](!0x0));}['_findReferenceNode'](_0xc60950,_0xcab2b5,_0xdb9146){const _0x13e84e=this['_findPrevElementWithDataId'](_0xc60950,!0x1);if(_0x13e84e){const _0x44aa31=this['_getNodeDataId'](_0x13e84e),_0xe60d6d=Dt('data-id',_0x44aa31,_0xdb9146);if(_0xe60d6d)return[_0xe60d6d,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x44aa31);}const _0x339aed=this['_findNextElementWithDataId'](_0xc60950,!0x1);if(_0x339aed){const _0x3f9163=this['_getNodeDataId'](_0x339aed),_0x49c497=Dt('data-id',_0x3f9163,_0xdb9146);if(_0x49c497)return[_0x49c497,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x3f9163);}return _0xcab2b5?_0xc60950['nextSibling']?this['_findFallbackReferenceNode'](_0xc60950,_0xdb9146):[_0xdb9146['childNodes'][_0xdb9146['childNodes']['length']-0x1],'afterend']:[_0xdb9146['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x20790d,_0x50e6f2){const _0x28a32c=[],_0x24fe80=this['_findPrevElementWithDataId'](_0x20790d,!0x0);if(_0x24fe80){const _0x393cb7=Dt('data-id',this['_getNodeDataId'](_0x24fe80),_0x50e6f2);_0x393cb7&&_0x28a32c['push']([_0x393cb7,'afterend']);}const _0x44cf3d=this['_findNextElementWithDataId'](_0x20790d,!0x0);if(_0x44cf3d){const _0x440d5a=Dt('data-id',this['_getNodeDataId'](_0x44cf3d),_0x50e6f2);_0x440d5a&&_0x28a32c['push']([_0x440d5a,'beforebegin']);}if(_0x28a32c['length']>0x1)return Xi(_0x28a32c[0x0][0x0])<=Xi(_0x28a32c[0x1][0x0])?_0x28a32c[0x0]:_0x28a32c[0x1];return 0x1===_0x28a32c['length']?_0x28a32c[0x0]:[_0x50e6f2['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x35b316,_0x49fdf4){let _0x2d1270=_0x35b316['nextSibling'],_0x9401f2=null,_0x4c0bc2=!0x1;for(;_0x2d1270;){if(_0x30ecdc(_0x2d1270)){if(this['_isDelNode'](_0x2d1270)&&(_0x9401f2=_0x2d1270),this['_isExistingContentComment'](_0x2d1270)&&_0x49fdf4&&!_0x4c0bc2){_0x4c0bc2=!0x0,_0x2d1270=_0x2d1270['nextSibling'];continue;}break;}const _0x421174=Et(_0x2d1270,'data-id');if(_0x421174&&'new-element'!==_0x421174&&this['_existingDataIds']['has'](_0x421174)){_0x9401f2=_0x2d1270;break;}_0x2d1270=_0x2d1270['nextSibling'];}return _0x9401f2;}['_findPrevElementWithDataId'](_0x582cde,_0x40a95d){let _0x14bbf4=_0x582cde['previousSibling'],_0x401fb2=null,_0x14ded7=!0x1;for(;_0x14bbf4;){if(_0x30ecdc(_0x14bbf4)){if(this['_isDelNode'](_0x14bbf4)&&(_0x401fb2=_0x14bbf4),this['_isExistingContentComment'](_0x14bbf4)&&_0x40a95d&&!_0x14ded7){_0x14ded7=!0x0,_0x14bbf4=_0x14bbf4['previousSibling'];continue;}break;}const _0x1f214f=Et(_0x14bbf4,'data-id');if(_0x1f214f&&'new-element'!==_0x1f214f&&this['_existingDataIds']['has'](_0x1f214f)){_0x401fb2=_0x14bbf4;break;}_0x14bbf4=_0x14bbf4['previousSibling'];}return _0x401fb2;}['_markWrappedElements'](_0x1dead5){_0x42188e(_0x1dead5)&&Xe('data-id',null,_0x1dead5)['forEach'](_0x27451a=>{this['_isExistingNode'](_0x27451a)&&!this['_hasWrappedParent'](_0x27451a)&&(Ji(_0x27451a,'data-wrapped-id',Et(_0x27451a,'data-id')),Ji(_0x27451a,'data-id',null));});}['_getNodeDataId'](_0x51b51e){if(!_0x51b51e)return null;if(_0x42188e(_0x51b51e))return Et(_0x51b51e,'data-id');if(_0x30ecdc(_0x51b51e)){const _0x441299=St(_0x51b51e)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x441299&&_0x441299[0x1])return _0x441299[0x1];}return null;}['_storeDeletedElementIds'](_0x5a8e6e){if(_0x30ecdc(_0x5a8e6e)){const _0x26e753=St(_0x5a8e6e)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x26e753&&_0x26e753[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x26e753[0x1]);}}['_getUid'](_0x5683ea){return this['_isExistingNode'](_0x5683ea)?Et(_0x5683ea,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x1f1fb8){(function(_0x57c2f5){return _0x3ea95c(_0x16d825=>_0x30ecdc(_0x16d825),_0x57c2f5,!0x0,0x1/0x0);}(_0x1f1fb8)['filter'](_0x2bc81c=>this['_isDelNode'](_0x2bc81c)||this['_isExistingContentComment'](_0x2bc81c))['forEach'](_0x5184b3=>{_0x55953c(_0x5184b3);}));}['_markLastTagElementUnstable'](_0x3d2a5d){const _0x20ccda=_0x3d2a5d['childNodes'],_0x2dce05=_0x20ccda[_0x20ccda['length']-0x1];_0x2dce05&&_0x42188e(_0x2dce05)&&Ji(_0x2dce05,'data-unstable','true');}['_markUnstableElements'](_0x234e68,_0x511fea){const _0x4c28fe=Dt('data-unstable','true',_0x234e68);if(!_0x4c28fe)return;const _0x561d5e=qe(_0x4c28fe)['slice'](0x0,-0x1),_0x5f28d2=_0x561d5e['length'];let _0x53d49f=_0x4c28fe;if(_0x5f28d2>_0x511fea){let _0x10160c=_0x5f28d2,_0x244cec=null;for(;_0x10160c>_0x511fea&&_0x10160c>=0x0;)_0x10160c--,_0x244cec=_0x561d5e[_0x10160c];_0x244cec&&(_0x53d49f=_0x244cec,Ji(_0x4c28fe,'data-unstable',null),Ji(_0x244cec,'data-unstable','true'));}else{if(_0x5f28d2<_0x511fea){let _0x5eb43b=_0x5f28d2,_0x267552=_0x4c28fe;for(;_0x5eb43b<_0x511fea;){const _0x240b40=_0x267552['childNodes']['filter'](_0x410dfd=>_0x42188e(_0x410dfd));if(0x0===_0x240b40['length'])break;_0x5eb43b++,_0x267552=_0x240b40[_0x240b40['length']-0x1];}_0x267552&&(_0x53d49f=_0x267552,Ji(_0x4c28fe,'data-unstable',null),Ji(_0x267552,'data-unstable','true'));}}let _0x21384e=_0x53d49f;for(;_0x21384e;){for(;_0x21384e['nextSibling'];)_0x21384e=_0x21384e['nextSibling'],_0x42188e(_0x21384e)&&Ji(_0x21384e,'data-unstable','true');_0x21384e=_0x21384e['parentNode'];}}['_isNewNode'](_0x239498){return Boolean('new-element'===Et(_0x239498,'data-id'));}['_isExistingNode'](_0x3ed494){return Boolean((Et(_0x3ed494,'data-id')||'')['length']>0x0&&'new-element'!==Et(_0x3ed494,'data-id'));}['_isDelNode'](_0x1f1e16){return!!_0x1f1e16&&Boolean(_0x30ecdc(_0x1f1e16)&&St(_0x1f1e16)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x26b5db){let _0x3ef141=_0x26b5db['parentNode'];for(;_0x3ef141;){if(Et(_0x3ef141,'data-wrapped-id'))return!0x0;_0x3ef141=_0x3ef141['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x1210fe){return Boolean(_0x30ecdc(_0x1210fe)&&St(_0x1210fe)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function et({editor:_0x29e22b,changeGroups:_0x4112f5,documentContextContent:_0x823f93,showDiff:_0x36f9cc,trimUnchanged:_0xdd5efb=!0x0}){return _0x4112f5['map'](_0x421059=>{const _0x5021e1=new Rt([]),_0x320d59=new Rt([]);for(const _0x535ba1 of _0x421059['changes'])if(_0x36f9cc&&'removed'==_0x535ba1['type']||_0x320d59['children']['push'](_0x535ba1['node']['cloneNode'](!0x0)),'new'!=_0x535ba1['type']&&(_0x36f9cc||'removed'!=_0x535ba1['type'])){const _0x49f7ea=wt(_0x2643d5=>Et(_0x2643d5,'data-id')==_0x535ba1['id'],_0x823f93,!0x0);_0x49f7ea&&_0x5021e1['children']['push'](_0x49f7ea['cloneNode'](!0x0));}const {content:_0x39b27d,hasChanges:_0x51e67b}=function(_0x41eeb5,_0x434d85,_0x145f35,_0x1e7c4f,_0x58d126=!0x0){const _0x11ba31=_0x41eeb5['plugins']['get']('DocumentCompare'),_0x1b2330=St(_0x434d85),_0x2ece79=St(_0x145f35),_0xc1bd68=_0x41eeb5['data']['parse'](_0x1b2330,'$root'),_0x4d29da=_0x41eeb5['model']['createPositionAt'](_0xc1bd68,0x0),_0x3dcd9a=_0x11ba31['getDiff'](_0x1b2330,_0x2ece79,{'anchor':_0x4d29da,'markDeletions':_0x1e7c4f}),_0x155203=_0x3dcd9a['getOperations']();if(0x0==_0x155203['length'])return{'content':_0x434d85['cloneNode'](!0x0),'hasChanges':!0x1};_0x1e7c4f?function(_0x5af48b,_0x366097,_0x1f33d9){if(0x0==_0x5af48b['length'])return;const _0x5ce9f4=_0x1f33d9['plugins']['get']('DocumentCompare'),_0x37f272=_0x1f33d9['plugins']['get']('SuggestionsConversion');_0x1f33d9['model']['change'](_0x522037=>{const _0x44c6fc=new Set();for(let _0x370e3d=0x0;_0x370e3d<_0x5af48b['length'];_0x370e3d++){const _0x32bdf7=_0x5af48b[_0x370e3d];if(_0x32bdf7['baseVersion']=null,_0x32bdf7['isDocumentOperation']=!0x1,_0x5ce9f4['isMarkedRemoveOperation'](_0x32bdf7)){const _0x105e08=_0x5068aa(_0x32bdf7['newRange'],_0x1f33d9['model']),_0x4aff1c='suggestion:deletion:'+_0x1a633f()+':$aiSuggestion';_0x366097['markers']['set'](_0x4aff1c,_0x105e08);}else switch(_0x32bdf7['type']){case'rename':{if(_0x32bdf7['oldName']==_0x32bdf7['newName'])break;_0x522037['batch']['addOperation'](_0x32bdf7),_0x1f33d9['model']['applyOperation'](_0x32bdf7);const _0x31c9a8='$elementName',_0x93b9fd=_0x32bdf7['position'],_0x4791bd=_0x1f33d9['model']['createRange'](_0x93b9fd,_0x1f33d9['model']['createPositionAt'](_0x93b9fd['nodeAfter'],'end')),_0xeb9ffc='suggestion:attribute:'+_0x31c9a8+':'+_0x1a633f()+':$aiSuggestion';_0x366097['markers']['set'](_0xeb9ffc,_0x4791bd);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x32bdf7['oldValue']==_0x32bdf7['newValue'])break;_0x522037['batch']['addOperation'](_0x32bdf7),_0x1f33d9['model']['applyOperation'](_0x32bdf7);const _0x359208=_0x32bdf7['key'];if(!_0x37f272['isRegisteredAttribute'](_0x359208))break;const _0x55026a=_0x5068aa(_0x32bdf7['range'],_0x1f33d9['model']),_0x50780a='suggestion:attribute:'+_0x359208+':'+_0x1a633f()+':$aiSuggestion';_0x366097['markers']['set'](_0x50780a,_0x55026a);break;}case'insert':{_0x522037['batch']['addOperation'](_0x32bdf7),_0x1f33d9['model']['applyOperation'](_0x32bdf7);if(_0x5af48b[_0x370e3d+0x1]&&'move'==_0x5af48b[_0x370e3d+0x1]['type']){ro(_0x366097,_0x32bdf7);break;}const _0x51eb41=_0x32bdf7['position'],_0x41c664=_0x32bdf7['howMany'],_0x136189=_0x5068aa(_0x1f33d9['model']['createRange'](_0x51eb41,_0x51eb41['getShiftedBy'](_0x41c664)),_0x1f33d9['model']),_0x5a458f='suggestion:insertion:'+_0x1a633f()+':$aiSuggestion';_0x366097['markers']['set'](_0x5a458f,_0x136189);break;}case'split':{_0x522037['batch']['addOperation'](_0x32bdf7),_0x1f33d9['model']['applyOperation'](_0x32bdf7);const _0x12e17f=_0x32bdf7['splitPosition'],_0x3aa9c=_0x32bdf7['moveTargetPosition'],_0x295900=_0x1f33d9['model']['createRange'](_0x12e17f,_0x3aa9c),_0x5e5d9f='suggestion:insertion:'+_0x1a633f()+':$aiSuggestion';_0x366097['markers']['set'](_0x5e5d9f,_0x295900);break;}case'move':{_0x522037['batch']['addOperation'](_0x32bdf7),_0x1f33d9['model']['applyOperation'](_0x32bdf7),_0x5af48b[_0x370e3d-0x1]&&'insert'==_0x5af48b[_0x370e3d-0x1]['type']&&ro(_0x366097,_0x32bdf7);const _0xbe8e03=_0x32bdf7['getMovedRangeStart'](),_0xca2a12=_0x32bdf7['howMany'];for(let _0x429671=0x0;_0x429671<_0xca2a12;_0x429671++){const _0x264d74=_0xbe8e03['getShiftedBy'](_0x429671)['nodeAfter'];_0x44c6fc['add'](_0x264d74);}break;}case'remove':{const _0x2b0f3b=_0x32bdf7['sourcePosition'],_0x35ab9f=_0x32bdf7['howMany'],_0x51a5d9=new lt(_0x2b0f3b,_0x35ab9f);_0x522037['batch']['addOperation'](_0x51a5d9),_0x1f33d9['model']['applyOperation'](_0x51a5d9);break;}}}for(const _0x3a9428 of _0x44c6fc){const _0x3d6c11=_0x1f33d9['model']['createRangeOn'](_0x3a9428),_0x4d38c1='suggestion:formatBlock:$fakeWrap:'+_0x1a633f()+':$aiSuggestion';_0x366097['markers']['set'](_0x4d38c1,_0x5068aa(_0x3d6c11,_0x1f33d9['model']));}});}(_0x155203,_0xc1bd68,_0x41eeb5):_0x41eeb5['model']['change'](_0x423037=>{for(const _0x122ba1 of _0x155203)if('remove'==_0x122ba1['type']){const _0xa700b4=_0x122ba1['sourcePosition'],_0x4ddab1=_0x122ba1['howMany'],_0x5b3aa7=new lt(_0xa700b4,_0x4ddab1);_0x423037['batch']['addOperation'](_0x5b3aa7),_0x41eeb5['model']['applyOperation'](_0x5b3aa7);}else{if('marker'==_0x122ba1['type']){const _0x4d8685=_0x122ba1['name'],_0x477bc6=_0x122ba1['newRange'];_0xc1bd68['markers']['set'](_0x4d8685,_0x477bc6);}else _0x122ba1['baseVersion']=null,_0x122ba1['isDocumentOperation']=!0x1,_0x423037['batch']['addOperation'](_0x122ba1),_0x41eeb5['model']['applyOperation'](_0x122ba1);}});if(_0x58d126){const _0x4bb46d=vt(_0x41eeb5,_0x155203,_0xc1bd68);At(_0x41eeb5['model'],_0x4bb46d),function(_0xfbb6f7,_0x179ef){const _0x53b325=_0x179ef['getFirstRange']()['start'];let _0x1674e5=_0x179ef['getFirstRange']()['end'];const _0x3e281c=_0x53b325['root'];(_0x1674e5['textNode']||_0x1674e5['nodeAfter']&&_0x1674e5['nodeAfter']['is']('$text'))&&(_0x319d9f(_0x1674e5,'...'),_0x1674e5=_0x1674e5['getShiftedBy'](0x3)),(_0x53b325['textNode']||_0x53b325['nodeBefore']&&_0x53b325['nodeBefore']['is']('$text'))&&(_0x319d9f(_0x53b325,'...'),function(_0x1faaa0,_0x36f7ca,_0xa3dee0){for(let [_0x564a4a,_0x50dea3]of _0x1faaa0['markers']){const _0x315b59=_0x50dea3['_getTransformedByInsertion'](_0x36f7ca,_0xa3dee0,!0x1);_0x50dea3=_0x315b59[0x0],_0x1faaa0['markers']['set'](_0x564a4a,_0x50dea3);}}(_0x3e281c,_0x53b325,0x3),_0x53b325['parent']==_0x1674e5['parent']&&(_0x1674e5=_0x1674e5['getShiftedBy'](0x3)));const _0x52631e=_0xfbb6f7['createRange'](_0xfbb6f7['createPositionAt'](_0x3e281c,0x0),_0x53b325),_0x343e47=_0xfbb6f7['createRange'](_0x1674e5,_0xfbb6f7['createPositionAt'](_0x3e281c,'end')),_0x2394ae=[..._0x52631e['getMinimalFlatRanges'](),..._0x343e47['getMinimalFlatRanges']()];_0x2394ae['reverse']();for(const _0x1531a1 of _0x2394ae)_0x580020(_0x1531a1),Zn(_0x3e281c,_0x1531a1);}(_0x41eeb5['model'],_0x4bb46d);}const _0x52c686=_0x41eeb5['data']['stringify'](_0xc1bd68,{'showSuggestionHighlights':!0x0});return{'content':ze(_0x52c686),'hasChanges':!0x0};}(_0x29e22b,_0x5021e1,_0x320d59,_0x36f9cc,_0xdd5efb);return{'type':_0x421059['changes'][0x0]['type'],'index':_0x421059['index'],'content':_0x39b27d,'hasChanges':_0x51e67b};});}function ro(_0x4923b4,_0x29d314){for(const [_0x188625,_0x11c16b]of _0x4923b4['markers']){const _0x164275=ht['_createFromRanges'](_0x11c16b['getTransformedByOperation'](_0x29d314));_0x4923b4['markers']['set'](_0x188625,_0x164275);}}function vt(_0x2f1688,_0x1fafcc,_0x339d55){const _0x32005e=_0x2f1688['plugins']['get']('DocumentCompare');let _0x4327f2=_0x2f1688['model']['createPositionAt'](_0x339d55,Number['POSITIVE_INFINITY']),_0x3a5d34=_0x2f1688['model']['createPositionAt'](_0x339d55,0x0);for(const _0x4fea2d of _0x1fafcc){let _0x2dd21c,_0x5d9b78;if(_0x32005e['isMarkedRemoveOperation'](_0x4fea2d))_0x2dd21c=_0x4fea2d['newRange']['start'],_0x5d9b78=_0x4fea2d['newRange']['end'];else switch(_0x4327f2=_0x4327f2['getTransformedByOperation'](_0x4fea2d),_0x3a5d34=_0x3a5d34['getTransformedByOperation'](_0x4fea2d),_0x4fea2d['type']){case'rename':_0x2dd21c=_0x4fea2d['position'],_0x5d9b78=_0x2dd21c['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x2dd21c=_0x4fea2d['range']['start'],_0x5d9b78=_0x4fea2d['range']['end'];break;case'insert':_0x2dd21c=_0x4fea2d['position'],_0x5d9b78=_0x2dd21c['getShiftedBy'](_0x4fea2d['howMany']);break;case'split':_0x2dd21c=_0x4fea2d['splitPosition'],_0x5d9b78=_0x4fea2d['moveTargetPosition'];break;case'merge':{const _0x4e2d3f=_0x4fea2d['targetPosition']['path']['slice'](0x0,-0x1);_0x2dd21c=_0x2f1688['model']['createPositionFromPath'](_0x339d55,_0x4e2d3f),_0x5d9b78=_0x2dd21c['getShiftedBy'](0x1);break;}case'remove':{const _0x8d69ae=_0x4fea2d['howMany'],_0x4b3a4d=_0x4fea2d['sourcePosition']['_getTransformedByInsertion'](_0x4fea2d['targetPosition'],_0x8d69ae),_0x40c63f=_0x4fea2d['getMovedRangeStart']();'remove'==_0x4fea2d['type']?(_0x2dd21c=_0x4b3a4d,_0x5d9b78=_0x4b3a4d):(_0x2dd21c=_0x40c63f,_0x5d9b78=_0x40c63f['getShiftedBy'](_0x8d69ae));break;}}_0x2dd21c&&_0x2dd21c['isBefore'](_0x4327f2)&&(_0x4327f2=_0x2dd21c['clone'](),_0x4327f2['stickiness']='toNone'),_0x5d9b78&&_0x5d9b78['isAfter'](_0x3a5d34)&&(_0x3a5d34=_0x5d9b78['clone'](),_0x3a5d34['stickiness']='toNone');}return _0x2f1688['model']['createSelection'](_0x2f1688['model']['createRange'](_0x4327f2,_0x3a5d34));}function At(_0x222ed3,_0x31eff7){so(_0x222ed3,_0x31eff7,'forward');const _0x4826a5=_0x31eff7['getFirstRange']();_0x31eff7['setTo']([]),_0x31eff7['setTo'](_0x4826a5,{'backward':!0x0}),so(_0x222ed3,_0x31eff7,'backward');}function so(_0x14947b,_0x1bb823,_0x2c1780){let _0x56199c=0x14;for(;_0x56199c;){_0x14947b['modifySelection'](_0x1bb823,{'unit':'word','direction':_0x2c1780}),_0x56199c--;const _0x2a405b=_0x1bb823['focus']['forward'==_0x2c1780?'nodeBefore':'nodeAfter'];if(_0x2a405b&&_0x2a405b['is']('element')&&_0x14947b['schema']['isBlock'](_0x2a405b)&&_0x14947b['schema']['isObject'](_0x2a405b))break;}}function Zn(_0x45bfa4,_0x463712){for(const [_0x57aec1,_0x2a7528]of _0x45bfa4['markers']){const _0x22c89a=_0x2a7528['_getTransformedByDeletion'](_0x463712['start'],_0x463712['end']['offset']-_0x463712['start']['offset']);null!=_0x22c89a?_0x45bfa4['markers']['set'](_0x57aec1,_0x22c89a):_0x45bfa4['markers']['delete'](_0x57aec1);}}const Ur=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class ke extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Rt([]);['parsedMergedContent']=new Rt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x309851,content:_0x25da3a='',isDone:_0x2d2ab4=!0x1,interactionId:_0x4e8639,areActionsDisabled:_0x5a277d,documentContextContent:_0x51f0f0,editor:_0x57eec4,id:_0x4f4a06}){super(),this['id']=_0x4f4a06||_0x1a633f(),this['interactionId']=_0x4e8639,this['type']=_0x309851,this['areActionsDisabled']=!!_0x5a277d,this['editor']=_0x57eec4,this['aiResponseParser']=new Je(),this['aiResponseApplier']=new Ke(),this['documentContextContent']=ze(_0x51f0f0||''),this['set']('isDone',_0x2d2ab4),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x25da3a);}['appendContent'](_0x3ab992){this['set']('content',this['content']+_0x3ab992);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x3c8e7a,_0x1c0dc2){this['changeGroups'][_0x3c8e7a]['state']=_0x1c0dc2,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x3c8e7a,'state':_0x1c0dc2});}['getContentParts']({showDiff:_0xf21f8,groupIndex:_0x4c841c}){if(!this['editor'])throw new _0x2120c6('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x12e96b=this['_getCachedContentParts'](_0xf21f8,_0x4c841c);if(_0x12e96b)return _0x12e96b;let _0x1d09a9=[];if(void 0x0===_0x4c841c)_0x1d09a9=this['changeGroups'];else{const _0x3d16a4=this['changeGroups']['find'](({index:_0x469a69})=>_0x469a69===_0x4c841c);if(!_0x3d16a4)throw new _0x2120c6('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x4c841c});_0x1d09a9=[_0x3d16a4];}const _0x48c219=et({'editor':this['editor'],'showDiff':_0xf21f8,'changeGroups':_0x1d09a9,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0xf21f8,_0x48c219),_0x48c219;}['_getCachedContentParts'](_0x8bf063,_0x374c78){const _0x3f8585=_0x8bf063?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x3f8585]['length'])return null;const _0x363f50=this['cachedSuggestionContentParts'][_0x3f8585];if(void 0x0===_0x374c78)return _0x4f6d80(_0x363f50);{const _0x3e81b2=_0x363f50['find'](({index:_0x9602ba})=>_0x9602ba===_0x374c78);if(_0x3e81b2)return[_0x4f6d80(_0x3e81b2)];}return null;}['_setCachedContentParts'](_0x2fb7f6,_0x5cb899){const _0x1c99f5=_0x2fb7f6?'withDiff':'withoutDiff';_0x5cb899['forEach'](_0x3011ee=>{const _0xfc11c9=this['cachedSuggestionContentParts'][_0x1c99f5],_0x5192da=_0xfc11c9['find'](({index:_0x501b5c})=>_0x501b5c===_0x3011ee['index']);if(_0x5192da){const _0x205a6b=_0xfc11c9['indexOf'](_0x5192da);_0xfc11c9['splice'](_0x205a6b,0x1,_0x3011ee);}else _0xfc11c9['push'](_0x3011ee);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x4db3aa=this['changeGroups'];this['updateChangeGroups']();const _0xcdbe0e=this['_getDifferentChangeGroups'](_0x4db3aa,this['changeGroups']);(_0xcdbe0e['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0xcdbe0e),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x439d5c,_0xbc6613){const _0x1e3a9d=[];for(const _0x5c1d52 of _0xbc6613){const _0x422937=_0x439d5c[_0x5c1d52['index']];_0x422937?_0x422937['changes']['length']!==_0x5c1d52['changes']['length']?_0x1e3a9d['push'](_0x5c1d52):_0x422937['changes']['forEach']((_0xcb5a69,_0x4ffad8)=>{const _0x144d7e=_0x5c1d52['changes'][_0x4ffad8];_0xcb5a69['id']!==_0x144d7e['id']&&_0x1e3a9d['push'](_0x5c1d52);}):_0x1e3a9d['push'](_0x5c1d52);}return _0x1e3a9d;}['updateChangeGroups'](){const _0x4f339d=new _0x5b1b92('p',{},[new _0x5b1b92('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x11e22c(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0xb9f678=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x4f339d,'cutAfterLastChange':!this['isDone']});if(!_0xb9f678['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0xb9f678['parsedContent'];let _0x2de702=[];if(_0x4858d0(_0x2d1cec=>{const _0x19260f=Et(_0x2d1cec,'data-id');if(!_0x19260f||!_0x244e09(_0x19260f))return!0x1;const _0x2de1e4=[_0x2d1cec,...qe(_0x2d1cec)]['at'](-0x2);if(_0x2d1cec!=_0x2de1e4){const _0x3c1255=Et(_0x2de1e4,'data-id');_0x244e09(_0x3c1255)||(_0x2de702['push']({'node':_0x2de1e4,'id':_0x3c1255,'type':'modified'}),_0xb9f678['modifiedNodeIds']['push'](_0x3c1255));}else _0xb9f678['modifiedNodeIds']['includes'](_0x19260f)?_0x2de702['push']({'node':_0x2d1cec,'type':'modified','id':_0x19260f}):_0xb9f678['newNodeIds']['includes'](_0x19260f)?_0x2de702['push']({'node':_0x2d1cec,'type':'new','id':_0x19260f,'anchorId':Et(_0x2d1cec['previousSibling'],'data-id')}):_0x2de702['push']({'node':_0x2d1cec,'type':'removed','id':_0x19260f});return!0x0;},this['parsedMergedContent']),_0x2de702=_0x2de702['filter'](({node:_0x364811})=>[...qe(_0x364811),_0x364811]['every'](_0x48a7a4=>!Et(_0x48a7a4,'data-unstable'))),0x0==_0x2de702['length'])return;const _0x894cb5=[[_0x2de702[0x0]]];for(let _0x41184e=0x1;_0x41184e<_0x2de702['length'];_0x41184e++){const _0x5a2c71=_0x894cb5[_0x894cb5['length']-0x1],_0x56c6c4=_0x5a2c71[_0x5a2c71['length']-0x1];_0x2de702[_0x41184e]['node']['previousSibling']==_0x56c6c4['node']&&'modified'!=_0x2de702[_0x41184e]['type']&&'modified'!=_0x56c6c4['type']?_0x5a2c71['push'](_0x2de702[_0x41184e]):_0x894cb5['push']([_0x2de702[_0x41184e]]);}for(const _0x52e8b4 of _0x894cb5){const _0x14c2e7=_0x52e8b4[0x0],_0x2c1a45=_0x52e8b4[_0x52e8b4['length']-0x1],_0x478893=_0x5899ba(_0x14c2e7['node']['previousSibling']);_0x478893&&_0x52e8b4['unshift'](_0x478893);const _0xe9b3e1=_0x5899ba(_0x2c1a45['node']['nextSibling']);_0xe9b3e1&&_0x52e8b4['push'](_0xe9b3e1);}function _0x244e09(_0x1cc06d){return _0xb9f678['modifiedNodeIds']['includes'](_0x1cc06d)||_0xb9f678['newNodeIds']['includes'](_0x1cc06d)||_0xb9f678['removedNodeIds']['includes'](_0x1cc06d);}function _0x5899ba(_0x2d249f){if(_0x2d249f&&Et(_0x2d249f,'data-id')&&!Et(_0x2d249f,'data-unstable')){const _0x11dc8a=Et(_0x2d249f,'data-id');if(!_0x244e09(_0x11dc8a))return{'node':_0x2d249f,'type':'context','id':_0x11dc8a};}return null;}this['changeGroups']=_0x894cb5['map']((_0x423f3c,_0x4e1a48)=>({'changes':_0x423f3c,'state':'pending','index':_0x4e1a48}));}}function Ui(_0x95115a){return Object['values'](Ur)['includes'](_0x95115a);}function Fi(_0x1fd426){return Wr['includes'](_0x1fd426);}function qi(_0x318933){return'conversation-title'===_0x318933;}function zi(_0x513773){return'source'===_0x513773;}const je=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class xe extends _0x27cb74(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x27f0b4,editor:_0xd9de1a}){super(),this['id']=_0x1a633f(),this['connector']=_0x27f0b4,this['isStopped']=!0x0,this['editor']=_0xd9de1a;}async['start'](){let _0x4e484;const _0x35abd3=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x9c1243=await this['currentRequest']['getStream']();for await(const _0x4195ba of _0x9c1243){if(this['isStopped'])return;if('error'===_0x4195ba['event'])return void this['fire']('error',{'error':new _0x2120c6('ai-chat-interaction-error',this)});if('message-metadata'!==_0x4195ba['event']){if('action-metadata'!==_0x4195ba['event']){if(qi(_0x4195ba['event'])&&this['setConversationTitle'](_0x4195ba['data']['conversationTitle'],!0x0),zi(_0x4195ba['event']))_0x35abd3['push'](_0x4195ba['data']['source']);else{if(Ui(_0x4195ba['event'])){if(_0x4195ba['event']!==_0x4e484){if(_0x4e484=_0x4195ba['event'],'web-search'===_0x4195ba['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x4195ba['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':_0x4195ba['event'],'interactionId':this['id'],'id':_0x4195ba['data']?.['id']}),_0x35abd3['length']>0x0&&'modification-delta'===_0x4195ba['event']&&(this['currentReply']['sources']=_0x35abd3['splice'](0x0));}_0x4195ba['data']['textDelta']&&this['currentReply']['appendContent'](_0x4195ba['data']['textDelta']);}else Fi(_0x4195ba['event'])||_0x218a11('ai-interaction-invalid-event-type',{'chunk':_0x4195ba});}}else this['actionCallId']=_0x4195ba['data']['callId'];}else this['messageId']=_0x4195ba['data']['messageId'];}}finally{this['isStopped']||(_0x35abd3['length']>0x0&&(this['currentReply']['sources']=_0x35abd3['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x29090b){return this['replies']['find'](_0x3a5a4b=>_0x3a5a4b['id']===_0x29090b);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x156c14=>_0x156c14['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x5a2612){const _0x4b51c7=new ke({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x5a2612});return this['replies']['push'](_0x4b51c7),_0x4b51c7['delegate'](...je)['to'](this),this['fire']('replyCreated',_0x4b51c7),_0x4b51c7;}['setConversationTitle'](_0x530855,_0x163c97=!0x1){this['fire']('setConversationTitle',_0x530855,_0x163c97);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Ie=function(_0x5884a1){return _0x5884a1['FILE']='file',_0x5884a1['DOCUMENT']='document',_0x5884a1['URL']='web-resource',_0x5884a1['TEXT']='text',_0x5884a1['SELECTION']='selection',_0x5884a1;}({}),be=function(_0x8f9318){return _0x8f9318['TEXT']='text',_0x8f9318['MARKDOWN']='markdown',_0x8f9318['HTML']='html',_0x8f9318;}({});const vi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class wi extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0xed3620,config:_0x446f97,ownerId:_0x1efc57}){super(),this['_connector']=_0xed3620,this['_config']=_0x446f97,this['_ownerId']=_0x1efc57;}['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'](_0x521727){const _0x14563e=await this['_createContextItemFromContent'](_0x521727);return this['_addToConversationContextItem'](_0x14563e),'current-document'===_0x14563e['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x14563e;}async['_createContextItemFromContent'](_0x2f2aa9){if(_0x2f2aa9['type']===Ie['DOCUMENT']){const _0x26c8a9=await this['_connector']['fetchDocument'](this['_ownerId'],_0x2f2aa9['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x2f2aa9['type'],'content':_0x26c8a9['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x26c8a9['attributes']?.['version'],'sessionId':_0x26c8a9['attributes']?.['sessionId']};}return{'id':_0x2f2aa9['id'],'uiId':_0x2f2aa9['id'],'label':_0x2f2aa9['attributes']?.['label']||_0x2f2aa9['name']||_0x2f2aa9['url']||_0x2f2aa9['id'],'type':_0x2f2aa9['type'],..._0x2f2aa9?.['attributes']?.['resourceId']?{'resourceId':_0x2f2aa9['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x10e2f4){const _0x4ceca9=this['_pendingContextItems']['get'](_0x10e2f4);_0x4ceca9?.['isReadOnly']||this['_removeContextItem'](_0x10e2f4);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x189097 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x189097['uiId']);const _0x1b0bbd=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x1b0bbd&&this['_addContextItem']({..._0x1b0bbd,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x2b3f18){for(const _0x2dd3aa of _0x2b3f18['values']())this['_addToConversationContextItem'](_0x2dd3aa);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'](_0x313d18){return Array['from'](_0x313d18['values']())['map'](_0x12388c=>this['_mapContextItemToRequestData'](_0x12388c))['filter'](_0x249170=>null!==_0x249170);}async['addFilesToContext'](_0x1e5bec,_0x8632c8,_0x13368e=Ie['FILE']){const _0x2a42fb='files-'+_0x1a633f();this['_startUploadOperation'](_0x2a42fb);try{await Promise['all'](_0x1e5bec['map'](async _0x3d3cce=>{const _0x2f231c='file-'+_0x1a633f(),_0x5c9edd=_0x3739ad(_0x3d3cce['name']);try{this['_addContextItem']({'type':_0x13368e,'label':_0x8632c8?.['label']||_0x5c9edd,'uiId':_0x2f231c,'resourceId':_0x8632c8?.['resourceId']},!0x0);const _0x416e7d=this['_connector']['uploadFile'](this['_ownerId'],_0x3d3cce,_0x8632c8);this['_ongoingUploads']['set'](_0x2f231c,_0x416e7d['abortController']);const {id:_0x56b42b}=await _0x416e7d['getId']();this['_ongoingUploads']['delete'](_0x2f231c),this['_finishContextItemLoading']({'type':_0x13368e,'id':_0x56b42b,'label':_0x8632c8?.['label']||_0x5c9edd,'uiId':_0x2f231c,'resourceId':_0x8632c8?.['resourceId']},!0x1);}catch(_0x4eaa73){this['_ongoingUploads']['delete'](_0x2f231c);if(!_0x4eaa73['message']['startsWith']('ai-request-aborted')){const _0x49d93c=new _0x2120c6('ai-chat-file-upload-failed',null,{'fileName':_0x5c9edd});_0x49d93c['stack']=_0x4eaa73['stack'],this['fire']('error',{'error':_0x49d93c,'fileName':_0x5c9edd});}this['_removeContextItem'](_0x2f231c);}}));}finally{this['_finishUploadOperation'](_0x2a42fb);}}['addCurrentDocumentToContext'](_0x317973){if(this['isCurrentDocumentInContext']())return;const _0x3bde1c={'type':Ie['DOCUMENT'],'uiId':'current-document','label':_0x317973,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3bde1c);}async['updateCurrentDocument'](_0xf222c0,_0x34fab8,_0x482c65,_0x3f3e12){const _0x11142d=this['_pendingContextItems']['get']('current-document');if(_0x11142d&&_0xf222c0){_0x11142d['selection']=_0x3f3e12?_0x3f3e12['map'](_0x5aa482=>({'start':_0x5aa482['start'],'end':_0x5aa482['end']})):[];try{if(_0x11142d['version']===_0x34fab8)return;const {id:_0x2ccd02}=await this['_connector']['uploadDocument'](this['_ownerId'],_0xf222c0,{'version':_0x34fab8,'sessionId':_0x482c65})['getId']();_0x11142d['id']=_0x2ccd02,_0x11142d['content']=_0xf222c0,_0x11142d['version']=_0x34fab8,_0x11142d['sessionId']=_0x482c65;}catch(_0x156904){const _0x2e8bed=new _0x2120c6('ai-chat-document-upload-failed',null);_0x2e8bed['stack']=_0x156904['stack'],this['fire']('error',{'error':_0x2e8bed});}}}['addSelectionToContext'](_0x11e57a){this['_addContextItem']({'type':Ie['SELECTION'],'label':_0x11e57a,'uiId':'selection','content':_0x11e57a});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x59ab0f,_0xcb873e){const _0x4f4555='url-'+_0x1a633f();this['_startUploadOperation'](_0x4f4555);const _0x5ce2fc='url-'+_0x1a633f();try{this['_addContextItem']({'type':Ie['URL'],'label':_0xcb873e?.['label']||_0x59ab0f,'uiId':_0x5ce2fc,'resourceId':_0xcb873e?.['resourceId']},!0x0);const _0x20d279=this['_connector']['uploadUrl'](this['_ownerId'],_0x59ab0f,_0xcb873e);this['_ongoingUploads']['set'](_0x5ce2fc,_0x20d279['abortController']);const {id:_0x265e16}=await _0x20d279['getId']();this['_ongoingUploads']['delete'](_0x5ce2fc),this['_finishContextItemLoading']({'type':Ie['URL'],'id':_0x265e16,'label':_0xcb873e?.['label']||_0x59ab0f,'uiId':_0x5ce2fc,'resourceId':_0xcb873e?.['resourceId']},!0x1);}catch(_0x5af163){this['_ongoingUploads']['delete'](_0x5ce2fc),(_0x5af163['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x2120c6('ai-chat-url-upload-failed',this,{'url':_0x59ab0f,'originalError':_0x5af163}),'url':_0x59ab0f}),this['_removeContextItem'](_0x5ce2fc));}finally{this['_finishUploadOperation'](_0x4f4555);}}async['loadSourceResources'](_0x42aba5,_0x35af65,_0x486756){const _0x56f8d7=this['_addContextOptionsState']['sources']['find'](_0x586e2a=>_0x586e2a['id']===_0x42aba5);if(!_0x56f8d7)return this['fire']('error',{'error':new _0x2120c6('ai-chat-source-not-found',this,{'sourceId':_0x42aba5}),'sourceId':_0x42aba5}),[];try{const _0x1af81d=(await _0x56f8d7['getResources'](_0x35af65))['map'](_0x39dc31=>{const _0x5b53e6=this['_isResourceInContext'](_0x39dc31['id']);return{..._0x39dc31,'isInContext':_0x5b53e6};});return _0x56f8d7['resources']=_0x1af81d,this['fire']('sourceResourcesLoaded',{'sourceId':_0x42aba5,'source':_0x56f8d7,'resources':_0x1af81d,'uid':_0x486756}),_0x1af81d;}catch(_0x40cdf1){return this['fire']('error',{'error':new _0x2120c6('ai-chat-source-resources-load-failed',this,{'sourceId':_0x42aba5,'originalError':_0x40cdf1}),'sourceId':_0x42aba5,'sourceLabel':_0x56f8d7['label']}),[];}}async['addResourceToContext'](_0x10e999,_0x5d5625){if(this['_isResourceInContext'](_0x5d5625['id']))return;let _0x28161a=_0x5d5625['data'];if(!_0x28161a&&_0x10e999['getData'])try{_0x28161a=await _0x10e999['getData'](_0x5d5625['id']);}catch(_0x485ff1){return void this['fire']('error',{'error':new _0x2120c6('ai-chat-resource-load-failed',this,{'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id'],'originalError':_0x485ff1}),'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id']});}if(_0x28161a)switch(_0x5d5625['type']){case Ie['URL']:if('string'!=typeof _0x28161a)return void this['fire']('error',{'error':new _0x2120c6('ai-chat-context-invalid-data',this,{'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id'],'expectedType':'string','actualType':typeof _0x28161a}),'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id']});await this['addUrlToContext'](_0x28161a,{'label':_0x5d5625['label'],'resourceId':_0x5d5625['id']});break;case Ie['FILE']:if(!(_0x28161a instanceof File))return void this['fire']('error',{'error':new _0x2120c6('ai-chat-context-invalid-data',this,{'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id'],'expectedType':'File','actualType':typeof _0x28161a}),'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id']});await this['addFilesToContext']([_0x28161a],{'label':_0x5d5625['label'],'resourceId':_0x5d5625['id']});break;case Ie['TEXT']:if('object'!=typeof _0x28161a||!('content'in _0x28161a)||!('type'in _0x28161a))return void this['fire']('error',{'error':new _0x2120c6('ai-chat-context-invalid-data',this,{'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x28161a}),'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id']});_0x28161a=wi['_convertTextResourceToFile'](_0x28161a,_0x5d5625['label']),await this['addFilesToContext']([_0x28161a],{'label':_0x5d5625['label'],'resourceId':_0x5d5625['id']},Ie['TEXT']);break;default:this['fire']('error',{'error':new _0x2120c6('ai-chat-context-unsupported-type',this,{'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id'],'resourceType':_0x5d5625['type']}),'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id']});}else this['fire']('error',{'error':new _0x2120c6('ai-chat-resource-no-data',this,{'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id']}),'resourceId':_0x5d5625['id'],'sourceId':_0x10e999['id']});}static['_convertTextResourceToFile'](_0x28f52d,_0x1bd90d){switch(_0x28f52d['type']){case be['MARKDOWN']:return new File([_0x28f52d['content']],_0x1bd90d,{'type':'text/markdown'});case be['HTML']:return new File([_0x28f52d['content']],_0x1bd90d,{'type':'text/html'});default:return new File([_0x28f52d['content']],_0x1bd90d,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x48558c){switch(_0x48558c['type']){case Ie['FILE']:return{'type':Ie['FILE'],'id':_0x48558c['id']};case Ie['URL']:return{'type':Ie['URL'],'id':_0x48558c['id']};case Ie['DOCUMENT']:return{'type':Ie['DOCUMENT'],'id':_0x48558c['id'],..._0x48558c['selection']?.['length']&&{'selection':_0x48558c['selection']}};case Ie['TEXT']:return{'type':Ie['FILE'],'id':_0x48558c['id']};default:return null;}}['_addContextItem'](_0x1727aa,_0x2590c6=!0x1){if(this['_pendingContextItems']['set'](_0x1727aa['uiId'],_0x1727aa),_0x1727aa['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x1727aa,'isLoading':_0x2590c6}),'current-document'===_0x1727aa['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x1727aa['resourceId']){const _0x25610b=this['_findSourceIdsByResourceId'](_0x1727aa['resourceId']);_0x25610b&&_0x25610b['forEach'](_0x137ff8=>{this['_updateResourceInContextState'](_0x137ff8,_0x1727aa['resourceId'],!0x0);});}}['_removeContextItem'](_0x2b4554){const _0x576851=this['_pendingContextItems']['get'](_0x2b4554),_0x447ede=this['_ongoingUploads']['get'](_0x2b4554);if(_0x447ede&&(_0x447ede['abort'](),this['_ongoingUploads']['delete'](_0x2b4554)),_0x576851?.['resourceId']){const _0x356068=this['_findSourceIdsByResourceId'](_0x576851['resourceId']);_0x356068&&_0x356068['forEach'](_0x5c5546=>{this['_updateResourceInContextState'](_0x5c5546,_0x576851['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2b4554),this['fire']('contextItemRemoved',{'uiId':_0x2b4554,'type':_0x576851?.['type']}),'current-document'===_0x2b4554&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x29f2c8,_0x12c489){if(this['_pendingContextItems']['has'](_0x29f2c8['uiId'])&&(this['_pendingContextItems']['set'](_0x29f2c8['uiId'],_0x29f2c8),this['fire']('contextItemLoadingEnded',{'contextItem':_0x29f2c8,'isLoading':_0x12c489}),_0x29f2c8['resourceId'])){const _0x4975e7=this['_findSourceIdsByResourceId'](_0x29f2c8['resourceId']);_0x4975e7&&_0x4975e7['forEach'](_0x19fdb1=>{this['_updateResourceInContextState'](_0x19fdb1,_0x29f2c8['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x26dda6){this['_conversationContextItems']['set'](_0x26dda6['uiId'],_0x26dda6);}['_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'](_0x3f8768=>({..._0x3f8768,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x421de6=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x421de6,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x2b32a8){for(const _0x5330f3 of this['_pendingContextItems']['values']())if(_0x5330f3['resourceId']===_0x2b32a8)return!0x0;for(const _0x4a197e of this['_conversationContextItems']['values']())if(_0x4a197e['resourceId']===_0x2b32a8)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x5b68f1){const _0x3a5e1a=[];for(const _0x1eaea3 of this['_addContextOptionsState']['sources']){_0x1eaea3['resources']['find'](_0x4afa58=>_0x4afa58['id']===_0x5b68f1)&&_0x3a5e1a['push'](_0x1eaea3['id']);}return 0x0===_0x3a5e1a['length']?null:_0x3a5e1a;}['_updateResourceInContextState'](_0x55f4f3,_0x2feb46,_0x1c00f1){const _0xf90c30=this['_addContextOptionsState']['sources']['find'](_0x5826f9=>_0x5826f9['id']===_0x55f4f3);if(!_0xf90c30)return;const _0x4276ad=_0xf90c30['resources']['find'](_0x21b8ef=>_0x21b8ef['id']===_0x2feb46);_0x4276ad&&(_0x4276ad['isInContext']=_0x1c00f1,this['fire']('resourceStateChanged',{'sourceId':_0x55f4f3,'resourceId':_0x2feb46,'isInContext':_0x1c00f1}));}['_startUploadOperation'](_0x3bcca3){this['_ongoingUploadOperations']['set'](_0x3bcca3,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x102ec8){this['_ongoingUploadOperations']['delete'](_0x102ec8),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const fi=['capabilitiesUpdated'];class Ii extends _0x27cb74(){['_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'](_0x19945b){const _0x2d422f={};return _0x19945b&&_0x19945b['isWebSearchEnabled']&&(_0x2d422f['webSearch']={}),_0x19945b&&_0x19945b['isReasoningEnabled']&&(_0x2d422f['reasoning']={}),_0x2d422f;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x468897){_0x468897!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x468897,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x11756c){_0x11756c!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x11756c,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ci extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x341646){super(_0x341646),this['conversationId']=_0x341646['conversationId'],this['contextItems']=_0x341646['contextItems'],this['capabilities']=_0x341646['capabilities'],this['userMessage']=_0x341646['userMessage'],this['model']=_0x341646['model'],this['quickActionData']=_0x341646['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':wi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ii['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class _t extends _0x27cb74(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x2686d9){super(),this['options']=_0x2686d9,this['connector']=_0x2686d9['connector'],this['chatModels']=_0x2686d9['chatModels'],this['id']=_0x2686d9['conversationId'];}async['init'](_0x13e797){try{this['chatContext']=new wi({'connector':this['connector'],'config':_0x13e797,'ownerId':this['id']}),this['chatContext']['delegate'](...vi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ii(),this['chatCapabilities']['delegate'](...fi)['to'](this),this['chatCapabilities']['init']();const _0x4f8345=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x4f8345});const _0x224dc6=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x224dc6&&await this['setModel'](_0x224dc6);}catch(_0xdc05e4){const _0x23d004=new _0x2120c6('ai-chat-conversation-init-failed',null,{'message':_0xdc05e4['message']});_0x23d004['stack']=_0xdc05e4['stack'],this['fire']('error',{'error':_0x23d004});}}async['start'](){if(this['isStarted'])throw new _0x2120c6('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x2120c6('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x1bf688}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x1bf688,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x350371){const _0x556b35=new _0x2120c6('ai-chat-conversation-start-failed',null,{'message':_0x350371['message']});_0x556b35['stack']=_0x350371['stack'],this['fire']('error',{'error':_0x556b35});}}async['load'](_0x40eeb9,_0x40cca2){try{const _0x3c3f35=await this['connector']['fetchConversation'](_0x40eeb9)['getConversation'](),_0x327943=await this['connector']['fetchConversationMessages'](_0x40eeb9)['getMessages'](),_0x457d7e=_0x327943[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x3c3f35['id'],'title'in _0x3c3f35?this['fire']('setConversationTitle',_0x3c3f35['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x4deddb=(await this['chatModels']['getAll']())['find'](_0x58d2d3=>_0x58d2d3['id']['toLowerCase']()===_0x457d7e['toLowerCase']());return this['selectedModel']=_0x4deddb,this['fire']('modelSelected',{'selectedModel':_0x4deddb,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x327943,_0x40cca2,_0x457d7e),this['currentInteraction']=void 0x0,this;}catch(_0x550972){const _0x57d9f4=new _0x2120c6('ai-chat-conversation-init-from-id-failed',null,{'message':_0x550972['message'],'conversationId':_0x40eeb9});throw _0x57d9f4['stack']=_0x550972['stack'],this['fire']('error',{'error':_0x57d9f4}),_0x57d9f4;}}async['_processMessagesToInteractions'](_0x8b67ec,_0xfc9377,_0x5d581d){let _0x40b6f0;for(const _0x21d23f of _0x8b67ec)if('user'===_0x21d23f['role']){const _0x507913=await this['_extractContextItems'](_0x21d23f),_0x1f467d={'isReasoningEnabled':Object['hasOwn'](_0x21d23f['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x21d23f['capabilities'],'webSearch')};_0x40b6f0=this['createInteraction']({'userMessage':_0x21d23f['prompt'],'contextItems':_0x507913,'capabilities':_0x1f467d,'modelId':_0x5d581d,'quickActionData':_0x21d23f['attributes']?.['quickActionData']}),this['currentInteraction']=_0x40b6f0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x21d23f['role']&&_0x40b6f0)for(const _0x15ebb2 of _0x21d23f['content']){const _0x966769='text'===_0x15ebb2['type']?'text-delta':'modification-delta',_0x5a092=_0x40b6f0['getDocumentContext']()?.['sessionId']!==_0xfc9377;_0x40b6f0['currentReply']=_0x40b6f0['createReply']({'type':_0x966769,'isDone':!0x0,'interactionId':_0x40b6f0['id'],'areActionsDisabled':_0x5a092}),_0x40b6f0['currentReply']['appendContent'](_0x15ebb2['content']);}}}async['_extractContextItems'](_0x2aff07){const _0x16b3b9=new Map();if(!_0x2aff07['content'])return _0x16b3b9;for(const _0x21868e of _0x2aff07['content']){const _0x480c8d=await this['chatContext']['populateFromMessage'](_0x21868e);_0x480c8d&&_0x16b3b9['set'](_0x480c8d['id'],_0x480c8d);}return _0x16b3b9;}async['handleUserInteraction']({userMessage:_0x1ecae2,quickActionData:_0x569ba2}){if(!this['isStarted'])throw new _0x2120c6('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x2120c6('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x159936=this['chatContext']['getPendingContextItems'](),_0x47a1c9=this['chatCapabilities']['getCapabilitiesConfig'](),_0x125b40=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x1ecae2,'contextItems':_0x159936,'capabilities':_0x47a1c9,'modelId':_0x125b40,'quickActionData':_0x569ba2}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x4fe0b3){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x4fe0b3});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x36364e,contextItems:_0x25da0c,capabilities:_0x29dab8,modelId:_0xdf2c0a,quickActionData:_0x14c72e}){const _0x11cf06=new Ci({'userMessage':_0x36364e,'contextItems':_0x25da0c,'capabilities':_0x29dab8,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0xdf2c0a,'quickActionData':_0x14c72e});return _0x11cf06['delegate'](...je)['to'](this),this['interactions']['push'](_0x11cf06),this['fire']('interactionCreated',_0x11cf06),_0x11cf06;}['getInteraction'](_0x24d4ea){return this['interactions']['find'](_0x546d94=>_0x546d94['id']===_0x24d4ea);}['removeInteraction'](_0x35a349){const _0x179de6=this['getInteraction'](_0x35a349);_0x179de6&&(_0x179de6['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x179de6),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x2271d5){this['chatContext']['addCurrentDocumentToContext'](_0x2271d5);}async['updateCurrentDocumentInContext']({content:_0x1dfda8,version:_0xa8b33b,sessionId:_0x2a40da,selections:_0x278ee0}){await this['chatContext']['updateCurrentDocument'](_0x1dfda8,_0xa8b33b,_0x2a40da,_0x278ee0);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x1822e4){this['chatContext']['addSelectionToContext'](_0x1822e4);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x361fc5){this['chatContext']['addFilesToContext'](_0x361fc5);}['addUrlToContext'](_0x18ea18){this['chatContext']['addUrlToContext'](_0x18ea18);}['addResourceToContext'](_0x5e7891,_0x32597c){this['chatContext']['addResourceToContext'](_0x5e7891,_0x32597c);}['loadSourceResources'](_0x599602,_0x416dbd,_0x133814){return this['chatContext']['loadSourceResources'](_0x599602,_0x416dbd,_0x133814);}['removeFromContext'](_0x83435f){this['chatContext']['removeFromContext'](_0x83435f);}['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'](_0x357b6f){_0x357b6f?!0x1===await this['chatModels']['isAvailable'](_0x357b6f)&&(_0x218a11('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x357b6f}),_0x357b6f=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x218a11('ai-chat-conversation-set-model-null',{'conversation':this}),_0x357b6f=(await this['chatModels']['getAvailableModels']())[0x0]),_0x357b6f['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x357b6f,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x357b6f}));}}function q(_0x32f714){if(_0x32f714 instanceof pt)return _0x32f714;if(_0x32f714?.['editors']&&_0x32f714['editors']['get'](0x0))return _0x32f714['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.'),_0x32f714['editors']['get'](0x0);throw new _0x2120c6('ai-get-editor-from-context-no-editor');}const yt='ai-selection';class N extends _0x3e59e0{['_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 _0x3ed985=q(this['context']),_0x2d7dc7=_0x3ed985['plugins']['has']('RealTimeCollaborationClient')&&_0x3ed985['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x2d7dc7||_0x1a633f();}return this['_sessionId'];}['getDocumentData'](){const _0x5e3bbe=q(this['context']),_0x587c9f=_0x5e3bbe['model'],_0x4b8423=_0x5e3bbe['data']['toView'](_0x587c9f['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x22c068=new kt(_0x5e3bbe['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x4b8423,_0x22c068);let _0x5dcaf7=_0x5e3bbe['data']['processor']['toData'](_0x4b8423);const _0x2d4833=this['_getMarkersInDocumentOrder'](),_0x5aff16=[];for(const _0x468fcb of _0x2d4833){const _0x5ba558='<'+_0x468fcb['name']+':start></'+_0x468fcb['name']+':start>',_0x55f7db=_0x5dcaf7['indexOf'](_0x5ba558);_0x5dcaf7=_0x5dcaf7['substring'](0x0,_0x55f7db)+_0x5dcaf7['substring'](_0x55f7db+_0x5ba558['length']);const _0xeca946='<'+_0x468fcb['name']+':end></'+_0x468fcb['name']+':end>',_0x310d45=_0x5dcaf7['indexOf'](_0xeca946);_0x5dcaf7=_0x5dcaf7['substring'](0x0,_0x310d45)+_0x5dcaf7['substring'](_0x310d45+_0xeca946['length']),_0x5aff16['push']({'markerName':_0x468fcb['name'],'start':_0x55f7db,'end':_0x310d45,'htmlFragment':_0x5dcaf7['substring'](_0x55f7db,_0x310d45)});}return{'content':_0x5dcaf7,'version':_0x5e3bbe['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x5aff16};}async['afterInit'](){this['context']instanceof pt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4f61ac,_0x24efd5)=>{_0x24efd5['on']('ready',()=>{this['_integrateEditor'](_0x24efd5);});});}['_integrateEditor'](_0x1ecedb){_0x1ecedb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':yt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x1ecedb['conversion']['for']('dataDowncast')['markerToElement']({'model':yt,'view':(_0x143541,{writer:_0x46b5c8,options:_0x22a278})=>_0x22a278['convertAiChatSelectionMarker']?_0x46b5c8['createUIElement'](_0x143541['markerName']+':'+(_0x143541['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x10509e,_0x35b21c,_0x31862f=!0x1,_0x27ad52=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x27ad52)return!0x1;const _0x5752cf=q(this['context'])['model'];return _0x5752cf['change'](_0x108190=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x35b21c,this['_displayedFakeSelectionLocked']=_0x31862f;let _0x653b30=0x0;for(let _0x40963b of _0x10509e){const _0x4c1df2=yt+':'+_0x653b30;if(_0x40963b['start']['isAtEnd']){const _0x4c68cb=_0x40963b['start']['getLastMatchingPosition'](({item:_0x14cf70})=>!_0x5752cf['schema']['isContent'](_0x14cf70),{'boundaries':_0x40963b});_0x40963b=_0x108190['createRange'](_0x4c68cb,_0x40963b['end']);}_0x108190['addMarker'](_0x4c1df2,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x40963b}),_0x653b30++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x1ef409){if(this['_displayedFakeSelectionId']!=_0x1ef409)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x4d502b=q(this['context']),_0x4c19d2=_0x4d502b['model']['markers']['getMarkersGroup'](yt);return _0x4d502b['model']['change'](_0x1f3bc2=>{for(const _0x2c37c1 of _0x4c19d2)_0x1f3bc2['removeMarker'](_0x2c37c1);}),!0x0;}['modelToViewWithIds'](_0x44a943){const _0x1f68e2=q(this['context']),_0x47109f=_0x1f68e2['data']['toView'](_0x44a943),_0x12f41b=new kt(_0x1f68e2['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x47109f,_0x12f41b),_0x47109f;}['_setDataIdsOnChildren'](_0x378726,_0x583127){let _0x394f27=!0x1;const _0xd1380a=new Set();for(const _0x54bcfb of _0x378726['getChildren']()){const _0x39e9a8=_0x54bcfb['is']('emptyElement')||_0x54bcfb['is']('containerElement');if(!_0x54bcfb['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x54bcfb,_0x583127)||_0x39e9a8)&&(_0x583127['setAttribute']('data-id',this['_nextDataId'](_0xd1380a),_0x54bcfb),_0x394f27=!0x0);}return _0x394f27;}['_nextDataId'](_0x4183f5){let _0x8fea16;do{_0x8fea16='';for(let _0x7643fa=0x0;_0x7643fa<0x4;_0x7643fa++)_0x8fea16+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x4183f5['has'](_0x8fea16));return _0x4183f5['add'](_0x8fea16),_0x8fea16;}['getSelectionText'](){const {model:_0x490811}=q(this['context']),_0x5185c7=_0x490811['document']['selection'],_0x4b02c7=_0x490811['getSelectedContent'](_0x5185c7),_0x2780e2=[],_0x3672ee=_0x490811['createRangeIn'](_0x4b02c7)['getWalker']();for(const {item:_0x3373f4}of _0x3672ee)_0x3373f4['is']('$textProxy')?_0x2780e2['push'](_0x3373f4['data']):_0x3373f4['is']('element')&&_0x2780e2['length']>0x0&&'\x20'!==_0x2780e2[_0x2780e2['length']-0x1]&&_0x2780e2['push']('\x20');return'\x22'+_0x2780e2['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x52fa53=q(this['context'])['model'];return Array['from'](_0x52fa53['markers']['getMarkersGroup'](yt))['sort']((_0x333ea9,_0x4d7be2)=>_0x333ea9['getStart']()['isBefore'](_0x4d7be2['getStart']())?-0x1:_0x333ea9['getStart']()['isAfter'](_0x4d7be2['getStart']())?0x1:0x0);}}const H=['applySuggestion','insertSuggestion','showChangeInText'];class hh extends _0x3249c4{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x16068b,_0x529e3c){super(_0x16068b),this['_dropdownOriginalConfig']=_0x529e3c||[...H],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x1c137c=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x32dcb3({'label':Sn('applySuggestion',_0x16068b,this['_partsCount']),'icon':_0x1e5ca3,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x32dcb3({'label':Sn('showChangeInText',_0x16068b,this['_partsCount']),'icon':_0x12e44a,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x32dcb3({'label':Sn('insertSuggestion',_0x16068b,this['_partsCount']),'icon':_0x2ce81a,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x16068b),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',_0x1c137c['if']('isVisible','ck-hidden',_0x1137ca=>!_0x1137ca)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x3b6e55=>'applySuggestion'!==_0x3b6e55):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x16068b);});}['_updateDropdownActions'](_0x19535f){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x19535f),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x30d287){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x4fd0be=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x30d287):this['_createActionsDropdown'](_0x30d287),_0x1e49f5=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x4fd0be['set']({'label':Sn(this['_dropdownCurrentConfig'][0x0],_0x30d287,this['_partsCount']),'tooltip':wn(this['_dropdownCurrentConfig'][0x0],_0x30d287,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x1e49f5});for(const _0x3241fa of this['_dropdownCurrentConfig'])_0x4fd0be['on'](_0x3241fa,()=>{this['fire'](_0x3241fa);});return this['_firstRender']=!0x1,_0x4fd0be;}['_createActionsButton'](_0x3bc5bf){const _0x47466f=new _0x290cbd(_0x3bc5bf);return _0x47466f['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x47466f['on']('execute',()=>{_0x47466f['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x47466f;}['_createActionsDropdown'](_0x42deaa){const _0x3cba5a=new Tn(_0x42deaa,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x3af267=>{switch(_0x3af267){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x3cba5a['set']({'label':Sn(this['_dropdownCurrentConfig'][0x0],_0x42deaa,this['_partsCount']),'tooltip':wn(this['_dropdownCurrentConfig'][0x0],_0x42deaa,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x3cba5a['bind']('isEnabled')['to'](this),_0x3cba5a;}['updateLabels'](_0xa7d0a2){const _0x1fc189=this['locale'];this['_partsCount']=_0xa7d0a2||this['_partsCount'],this['actionsButton']['set']({'label':Sn(this['_dropdownCurrentConfig'][0x0],_0x1fc189,this['_partsCount']),'tooltip':wn(this['_dropdownCurrentConfig'][0x0],_0x1fc189,this['_partsCount'])}),this['applySuggestionModel']['label']=Sn('applySuggestion',_0x1fc189,this['_partsCount']),this['showChangeInTextModel']['label']=Sn('showChangeInText',_0x1fc189,this['_partsCount']),this['insertSuggestionModel']['label']=Sn('insertSuggestion',_0x1fc189,this['_partsCount']);}}class Tn extends _0x351feb{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x256c53,_0x2ded11){super(_0x256c53),this['balloonPanelView']=new _0x1a6e6e(this['locale']),this['bodyCollection']=new _0x52097e(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x2ded11['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',i(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x21b3f9=_0x2ded11['listItemModels'][0x0]['actionName'];this['fire'](_0x21b3f9),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']?pn:In]}),this['listView']['focus']());}),_0x178524({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x3fe38d){const _0xa3a87b=this['locale'],_0xd3fb66=new _0x36c9a6(_0xa3a87b);for(const _0x194315 of _0x3fe38d){const _0x14a1d1=new _0x36570a(_0xa3a87b),_0x1df12b=new _0x19db8a(_0xa3a87b);_0x1df12b['bind'](...Object['keys'](_0x194315))['to'](_0x194315),_0x1df12b['delegate']('execute')['to'](_0xd3fb66),_0x14a1d1['children']['add'](_0x1df12b),_0xd3fb66['items']['add'](_0x14a1d1);}return _0xd3fb66['items']['delegate']('execute')['to'](this),_0xd3fb66['on']('execute',_0x1cc391=>{const _0x247fa7=_0x1cc391['source'];this['fire'](_0x247fa7['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0xd3fb66;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x3116d1(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x4a0176,_0x344058)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x344058();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function pn(_0x84a9df){return{'top':_0x84a9df['bottom'],'left':_0x84a9df['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function In(_0x3a7550,_0x1ceda0){return{'top':_0x3a7550['bottom'],'left':_0x3a7550['left']-(_0x1ceda0['width']-_0x3a7550['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Sn(_0x5afb26,_0x382e3d,_0x10f8a1){switch(_0x5afb26){case'applySuggestion':return i(_0x382e3d,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x10f8a1);case'showChangeInText':return i(_0x382e3d,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x10f8a1);case'insertSuggestion':return i(_0x382e3d,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x10f8a1);}}function wn(_0xe68679,_0x4aed38,_0x5b5c02){switch(_0xe68679){case'applySuggestion':return i(_0x4aed38,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x5b5c02);case'showChangeInText':return i(_0x4aed38,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x5b5c02);case'insertSuggestion':return i(_0x4aed38,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x5b5c02);}}class ni extends _0x27cb74(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x3d7c96,availableModels:_0x3168ef,defaultModelId:_0x11b878}){super(),this['_connector']=_0x3d7c96,this['_availableModels']=_0x3168ef,this['_defaultModelId']=_0x11b878;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x276b53=this['_connector']['getModels'](),_0x31d284=await _0x276b53['list']();this['_modelList']=_0x31d284['items'];}catch(_0x270808){throw new _0x2120c6('ai-models-unable-to-retrieve',null,{'error':_0x270808});}return[...this['_modelList']];}async['getAvailableModels'](){const _0x7076f3=await this['getAll']();return this['_filterModels'](_0x7076f3,this['_availableModels']);}async['getModel'](_0x4dc0c5){const _0x2d880a=await this['getAll']();if(!_0x2d880a['length'])return null;if(_0x4dc0c5){const _0x131cb6=this['_getModelById'](_0x2d880a,_0x4dc0c5);if(_0x131cb6)return _0x131cb6;_0x218a11('ai-chat-model-id-unrecognized',{'modelId':_0x4dc0c5,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x1deefc=await this['getAvailableModels']();if(!_0x1deefc['length'])return null;if(this['_defaultModelId']){const _0x45376d=this['_getModelById'](_0x1deefc,this['_defaultModelId']);if(_0x45376d)return _0x45376d;_0x218a11('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x1deefc[0x0]['id']});}return _0x1deefc[0x0];}async['isAvailable'](_0x48fbde){return(await this['getAvailableModels']())['some'](_0x4e839c=>_0x4e839c['name']===_0x48fbde['name']&&_0x4e839c['provider']===_0x48fbde['provider']);}['_filterModels'](_0x3dd48d,_0x1b129e){let _0x38bcad;if(_0x1b129e){_0x38bcad=[];const _0x5df624='string'==typeof _0x1b129e?[_0x1b129e['toLocaleLowerCase']()]:_0x1b129e['map'](_0x5b9bb6=>_0x5b9bb6['toLocaleLowerCase']());for(const _0x28c969 of _0x5df624)for(const _0x111dce of _0x3dd48d)(_0x111dce['id']['toLocaleLowerCase']()===_0x28c969||_0x111dce['name']['toLocaleLowerCase']()===_0x28c969||Ne(_0x111dce)&&'auto'===_0x28c969||_0x111dce['provider']['toLocaleLowerCase']()===_0x28c969||_0x111dce['id']['toLocaleLowerCase']()['startsWith'](_0x28c969))&&_0x38bcad['push'](_0x111dce);}else _0x38bcad=_0x3dd48d;return _0x38bcad;}['_getModelById'](_0x1a2fcc,_0x4e68b9){return _0x1a2fcc['find'](_0x51c533=>Ne(_0x51c533)&&'auto'===_0x4e68b9?_0x51c533:_0x51c533['id']===_0x4e68b9)||null;}static['getLocalized'](_0x3135df,_0x3c556b){return _0x3c556b['map'](_0x5d8456=>{if(Ne(_0x5d8456))_0x5d8456['name']=i(_0x3135df,'AI_MODEL_NAME_AUTO'),_0x5d8456['description']=i(_0x3135df,'AI_MODEL_DESCRIPTION_AUTO');else i(_0x3135df,'AI_MODEL_DESCRIPTION_'+_0x5d8456['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x5d8456['description']=i(_0x3135df,'AI_MODEL_DESCRIPTION_'+_0x5d8456['id']['toUpperCase']()));return _0x5d8456;});}}function Ne(_0x485241){return _0x485241['id']['startsWith']('agent');}class It extends ni{async['getAll'](){return(await super['getAll']())['sort']((_0x8dea7d,_0x46890b)=>{const _0x2299ad=Object['values'](_0x8dea7d['capabilities'])['filter'](_0x5ecb63=>_0x5ecb63['enabled'])['length'];return Object['values'](_0x46890b['capabilities'])['filter'](_0xde8503=>_0xde8503['enabled'])['length']-_0x2299ad;});}}function rt({editor:_0xc96a57,interaction:_0x54e810,reply:_0x2a7b93,groups:_0x1f63e7,transform:_0x5dd39e,documentCompare:_0x15c1f0,documentCompareOptions:_0xf97c0}){const _0x380ffa=_0x54e810['getDocumentContext']();if(!_0x380ffa)return[];const _0x58265e=_0x380ffa['content'],_0x1c21d1=_0x380ffa['version'],_0x42a2c0=_0x2a7b93['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x3cce00}of _0x1f63e7){const _0x4edca1=_0x3cce00['filter'](_0xefc829=>'new'!=_0xefc829['type'])['map'](_0x4ffe84=>Dt('data-id',_0x4ffe84['id'],_0x42a2c0)),_0x307c70=_0x3cce00['filter'](_0x3faff3=>'removed'!=_0x3faff3['type'])['map'](_0x551ba1=>_0x551ba1['node']['cloneNode'](!0x0));let _0x3a0c37=null;if(_0x4edca1['length']){_0x3a0c37=_0x4edca1[0x0]['previousSibling'];for(let _0x46d430=0x0;_0x46d430<_0x4edca1['length'];_0x46d430++)_0x55953c(_0x4edca1[_0x46d430]);}if(_0x307c70['length']){_0x3a0c37||(_0x3cce00[0x0]['anchorId']?_0x3a0c37=Dt('data-id',_0x3cce00[0x0]['anchorId'],_0x42a2c0):(_0x3a0c37=_0x307c70['shift'](),_0x3041bd(_0x42a2c0,_0x3a0c37)));for(let _0x7afd83=0x0;_0x7afd83<_0x307c70['length'];_0x7afd83++)_0x5e4053(_0x3a0c37,_0x307c70[_0x7afd83]),_0x3a0c37=_0x307c70[_0x7afd83];}}const _0x5d7ec4=St(_0x42a2c0),_0x517695=_0x15c1f0['getDiff'](_0x58265e,_0x5d7ec4,_0xf97c0)['getOperations']();if(_0x5dd39e){const _0x4feeed=_0xc96a57['model']['document']['history']['getOperations'](_0x1c21d1),_0x1c6aeb={'document':_0xc96a57['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return ut(_0x517695,_0x4feeed,_0x1c6aeb)['operationsA'];}return _0x517695;}function ot(_0x1398c3,_0x58e7b8){if('marker'!=_0x58e7b8['type'])return;const _0x5656d1=_0x1398c3['model']['markers']['get'](_0x58e7b8['name']);_0x5656d1&&(_0x58e7b8['oldRange']=_0x5656d1['getRange']());}class Sr extends _0xf901f6{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x339556,_0x4422c3={},_0x18b09e){super(_0x339556),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x4422c3};const _0x300c65=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x300c65?'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'](_0x18b09e),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 _0x290cbd(this['locale']),this['likeButton']['set']({'icon':_0x41a339,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x44d619=>!_0x44d619),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x290cbd(this['locale']),this['dislikeButton']['set']({'icon':_0x1b174c,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3e05ae=>!_0x3e05ae),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x290cbd(this['locale']),this['copyButton']['set']({'icon':_0x340a5f,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3c2a26=>!_0x3c2a26);const _0x2822a9=new _0xf03b05();_0x2822a9['set']({'content':_0x576672}),_0x2822a9['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'](_0x2822a9);}['_setupShowChangesButton'](_0x4a2eee){this['showChangesButton']=new _0x290cbd(this['locale']),this['showChangesButton']['set']({'icon':tt,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x4a2eee}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x430ee0=>!_0x430ee0),this['showChangesButton']['on']('execute',()=>{const _0x28497b=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x28497b,'icon':_0x28497b?_0x1ca93a:tt}),this['fire']('toggleShowChanges',_0x28497b);});}}class Lr extends _0x3249c4{['showChangesToggleView'];constructor(_0x40ca23,_0x1b3ae5){super(_0x40ca23),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0x40ca23),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x40ca23,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1b3ae5['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x339fe0=>_0x339fe0?_0x5a81f7:_0x200214),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x353781=new _0xf03b05();_0x353781['content']=_0x46c616,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1b3ae5['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x353781,{'tag':'span','children':[i(_0x40ca23,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0x290cbd{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class sa{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x317578){this['options']={'delay':_0x317578['delay']??0x14,'textNodeStyle':_0x317578['textNodeStyle'],'onStreamUpdate':_0x317578['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x28aa64,targetElement:_0xa2ca63,abortSignal:_0x2c1b08}){this['isStreaming']&&this['stop'](),_0x2c1b08?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x3fb256(_0x28aa64,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x218a11('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x21cba3=0x0;_0x21cba3<this['currentIndex'];_0x21cba3++)this['nodesList'][_0x21cba3]['shouldBeStreamed']=!0x0;let _0x5bc832=0x0;for(let _0x530484=this['currentIndex'];_0x530484<this['nodesList']['length'];_0x530484++){const _0x435cc8=Date['now'](),_0x4b01b5=this['nodesList'][_0x530484],_0xaa8910=_0x435cc8-_0x5bc832;_0x4b01b5['shouldBeStreamed']=!0x0;let _0x240fa8=_0x4b01b5['parent'];for(;_0x240fa8;)_0x240fa8['shouldBeStreamed']=!0x0,_0x240fa8=_0x240fa8['parent'];if(_0xaa8910<this['options']['delay'])try{const {promise:_0x3d1352,abortController:_0x30e70e}=pr(this['options']['delay']-_0xaa8910);this['timeoutAbortController']=_0x30e70e,await _0x3d1352;}catch(_0x144b05){return;}_0x14fc40(_0xa2ca63,'<'+_0xa2ca63['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0xa2ca63['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x530484,_0x5bc832=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x3b8cfd}){Array['from'](_0x3b8cfd['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x262c98=>{_0x262c98['replaceWith'](_0x262c98['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x4dda5c){let _0x3d43eb='';if(function(_0x2186e1){return _0xfe47fd(_0x2186e1);}(_0x4dda5c)){for(const _0xb85323 of _0x4dda5c['children'])_0x3d43eb+=this['renderNode'](_0xb85323);}else{if(dr(_0x4dda5c)){if(!_0x4dda5c['shouldBeStreamed'])return'';const _0x3bc93a=_0x4dda5c,_0x3e8396=Object['entries'](_0x3bc93a['attribs'])['map'](([_0x1144ce,_0x34408d])=>_0x1144ce+'=\x22'+_0x34408d+'\x22')['join']('\x20');_0x3d43eb+='<'+_0x3bc93a['tagName']+(_0x3e8396?'\x20'+_0x3e8396:'')+'>';for(const _0x46bf0d of _0x5b007a(_0x3bc93a))_0x3d43eb+=this['renderNode'](_0x46bf0d);_0x3d43eb+='</'+_0x3bc93a['tagName']+'>';}else{if(!ar(_0x4dda5c))return'';if(!_0x4dda5c['shouldBeStreamed'])return'';!function(_0x1ead57){if(!_0x1ead57['parent']||!dr(_0x1ead57['parent']))return!0x1;if(!cr['includes'](_0x1ead57['parent']['tagName']))return!0x1;return!_0x24b4a1(_0x1ead57)['match'](/^\s*[<>]\s*$/);}(_0x4dda5c)?_0x3d43eb+=_0x20a8a4(_0x4dda5c):_0x3d43eb+=_0x20a8a4(new _0x5b1b92('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x4dda5c]));}}return _0x3d43eb;}['getParsedDocumentNodeList'](){const _0x4a9f0f=[];return function(_0x2750d8,_0x18346a){const _0xf36dfe=_0x321b9a=>{if(_0x18346a(_0x321b9a),_0x321b9a instanceof _0x1289a2)for(let _0x4cf671=0x0;_0x4cf671<_0x321b9a['children']['length'];_0x4cf671++){const _0x5cfa2a=_0x321b9a['children'][_0x4cf671];_0xf36dfe(_0x5cfa2a);}};for(let _0x27010f=0x0;_0x27010f<_0x2750d8['children']['length'];_0x27010f++)_0xf36dfe(_0x2750d8['children'][_0x27010f]);}(this['document'],_0x3cc4b3=>{if(ar(_0x3cc4b3)){const _0x30a9cc=this['splitTextNodeIntoWordNodes'](_0x3cc4b3);_0x30a9cc['length']&&_0x4a9f0f['push'](..._0x30a9cc);}_0x3cc4b3['isWordSplitSource']||_0x3cc4b3['isWordSplitResult']||_0x4a9f0f['push'](_0x3cc4b3);}),_0x4a9f0f;}['splitTextNodeIntoWordNodes'](_0xcd2010){if(_0xcd2010['isWordSplitSource']||_0xcd2010['isWordSplitResult'])return[];const _0x3a182a=_0x24b4a1(_0xcd2010)['match'](/(?:\s*\S+\s*)/g),_0xecd2ca=[];if(_0x3a182a&&_0x3a182a['length']>0x1){for(const _0x93300 of _0x3a182a){const _0x2d66a0=new _0x11e22c(_0x93300);_0x2d66a0['isWordSplitResult']=!0x0,_0x7c35e5(_0xcd2010,_0x2d66a0),_0xecd2ca['push'](_0x2d66a0);}_0xcd2010['isWordSplitSource']=!0x0,_0x55953c(_0xcd2010);}return _0xecd2ca;}}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(_0x5564b2){return _0x545970(_0x5564b2);}function dr(_0x3ddb6a){return _0x42188e(_0x3ddb6a);}function pr(_0x2d6c95){const _0x13665f=new AbortController();return{'promise':new Promise((_0x4fa840,_0x5efba4)=>{const _0x10aeb9=setTimeout(_0x4fa840,_0x2d6c95);_0x13665f['signal']['addEventListener']('abort',()=>{clearTimeout(_0x10aeb9),_0x5efba4();});}),'abortController':_0x13665f};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x3249c4{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x464e38,{part:_0x47674e,uiIndex:_0x180ab7,areActionsDisabled:_0x379e91,availableActions:_0x6e9670}){super(_0x464e38),this['set']('partDefinition',_0x47674e),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x5ab35c=>'pending'==_0x5ab35c&&!_0x379e91),this['children']=this['createCollection'](),this['htmlStreamer']=new sa({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x464e38,{'part':_0x47674e,'uiIndex':_0x180ab7,'availableActions':_0x6e9670}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ee)['to'](this);const _0x5595ac=this['bindTemplate'];this['contentView']=new _0x3249c4(),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',_0x5595ac['to']('state',_0x47401c=>'ck-ai-suggestion__body__content-part_'+_0x47401c),_0x5595ac['to']('isEnabled',_0x490826=>_0x490826?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x5595ac['if']('isVisible','ck-hidden',_0x408a5c=>!_0x408a5c)]},'children':this['children'],'on':{'mouseenter':_0x5595ac['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x47674e['index']});}),'mouseleave':_0x5595ac['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x47674e['index']});})}});}async['updateContent']({part:_0x85cd4e,renderingStrategy:_0x173516,showUnchangedParts:_0x3f0656=!0x1,abortSignal:_0x2d771e}){this['partDefinition']=_0x85cd4e,this['isVisible']=this['partDefinition']['hasChanges']||_0x3f0656,this['isVisible']&&('streaming'===_0x173516?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x2d771e}):this['contentView']['element']['innerHTML']=St(this['partDefinition']['content']));}['toggleHeader'](_0x240215){_0x240215?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x3249c4{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x3a1b28,{part:_0x1ad1d0,uiIndex:_0x11b683,availableActions:_0x186c3f}){super(_0x3a1b28),this['set']('partDefinition',_0x1ad1d0),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x1174cb=new _0xf03b05();_0x1174cb['content']=_0x229815,_0x1174cb['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x1640fd=[];if(_0x186c3f['includes']('showChangeInText')){const _0x3aba32=new _0x290cbd(_0x3a1b28);_0x3aba32['set']({'label':i(_0x3a1b28,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x12e44a}),_0x3aba32['bind']('isEnabled')['to'](this),_0x3aba32['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x1ad1d0['index']});}),_0x1640fd['push'](_0x3aba32);}if(_0x186c3f['includes']('insertSuggestion')){const _0x453988=new _0x290cbd(_0x3a1b28);_0x453988['set']({'label':i(_0x3a1b28,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x2ce81a}),_0x453988['bind']('isEnabled')['to'](this),_0x453988['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x1ad1d0['index']});}),_0x1640fd['push'](_0x453988);}const _0xe7c4ff=new _0x290cbd(_0x3a1b28);_0xe7c4ff['set']({'label':i(_0x3a1b28,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x3d4b82}),_0xe7c4ff['bind']('isEnabled')['to'](this),_0xe7c4ff['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x1ad1d0['index']});}),_0x1640fd['push'](_0xe7c4ff),this['_toolbarView']=new _0xf901f6(_0x3a1b28),this['_toolbarView']['items']['addMany'](_0x1640fd),this['_iconStateAccepted']=new _0xf03b05(),this['_iconStateAccepted']['content']=_0x4569af,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':i(_0x3a1b28,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0xf03b05(),this['_iconStateRejected']['content']=_0x3aefaf,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':i(_0x3a1b28,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0xf03b05(),this['_iconStateOutdated']['content']=_0x3aefaf,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':i(_0x3a1b28,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x558967=new _0x3249c4(_0x3a1b28);_0x558967['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x3a1b28,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x11b683['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x1174cb,_0x558967,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',(_0x1643b4,_0x32500a,_0x13a18f,_0x16019a)=>{switch(_0x16019a){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(_0x13a18f){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 st extends _0x27cb74(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x55add2){const _0x10fe4b=this['createTask'](_0x55add2);return this['queue']['push'](_0x10fe4b),this['_processQueue'](),_0x10fe4b['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(_0x10af8b=>{this['once']('_queueEmpty',()=>{_0x10af8b();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x35f37d=this['queue']['shift']();try{await _0x35f37d['callback'](this['_abortController']['signal']),_0x35f37d['resolve']();}catch(_0x29f793){_0x35f37d['reject'](_0x29f793);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x126407){let _0x40898c,_0x446132;const _0x3088c8=new Promise((_0x53ff0b,_0x200a02)=>{_0x40898c=_0x53ff0b,_0x446132=_0x200a02;});return{'callback':_0x126407,'resolve':_0x40898c,'reject':_0x446132,'completePromise':_0x3088c8};}}class Ir extends _0x3249c4{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x4c5b4a){super();const _0x146e91=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new sa({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x4c5b4a,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x146e91['if']('isDone','ck-ai-chat__feed__item_done'),_0x146e91['if']('isVisible','ck-hidden',_0x508cb3=>!_0x508cb3),'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'](_0x4a5543=>{_0x4a5543['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x1420a2,_0x4a626c,_0x518bb3){await this['htmlStreamer']['stream']({'document':_0x1420a2,'targetElement':_0x4a626c,'abortSignal':_0x518bb3});}}class Oe extends Ir{constructor(_0x5ba1d0){super(_0x5ba1d0),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x5ba1d0['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x5397f1){this['element']['innerHTML']=_0x5397f1;}}class Dr extends _0x3249c4{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x41f050,_0x36ad95){super(_0x41f050);const {areActionsDisabled:_0x2359a3,showUnchangedParts:_0xe43bb0,availableActions:_0x32a226}=_0x36ad95;this['_areActionsDisabled']=_0x2359a3,this['_showUnchangedParts']=_0xe43bb0,this['_availableActions']=_0x32a226,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new st(),this['_emptyPartsWarningView']=new Oe({'id':'empty-parts-warning','initialContent':i(_0x41f050,'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:_0x4da643,renderingStrategy:_0x1edbaa,abortSignal:_0x3dc797}){this['_children']['length']?_0x4da643['forEach'](_0x15093f=>{const _0x339ca6=this['_cachedContentParts']['findIndex'](_0x541b89=>_0x541b89['index']==_0x15093f['index']);-0x1===_0x339ca6?this['_cachedContentParts']['push'](_0x15093f):this['_cachedContentParts'][_0x339ca6]=_0x15093f;}):this['_cachedContentParts']=_0x4da643;for(const _0xc5da00 of _0x4da643['filter'](_0xb79622=>_0xb79622['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x3e3f10=>{let _0x151b9d=this['getPartView'](_0xc5da00['index']);_0x151b9d||(_0x151b9d=new na(this['locale'],{'part':_0xc5da00,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x151b9d['delegate'](...Ee)['to'](this),this['_children']['add'](_0x151b9d),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x151b9d['toggleHeader'](this['_children']['length']>0x1),await _0x151b9d['updateContent']({'part':_0xc5da00,'renderingStrategy':_0x1edbaa,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x3e3f10});});return _0x3dc797?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x203809,_0x38cb25){const _0x92b780=this['getPartView'](_0x203809);_0x92b780&&(_0x92b780['state']=_0x38cb25),this['hasPendingParts']='pending'==_0x38cb25||Array['from'](this['_children'])['some'](_0x42aaf2=>'pending'==_0x42aaf2['state']);}['getPartView'](_0x58e0e5){return this['_children']['find'](_0xefaff3=>_0xefaff3['partDefinition']['index']==_0x58e0e5)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x2117df=!this['_cachedContentParts']['find'](({hasChanges:_0x2c7cf5})=>_0x2c7cf5),_0x38101b=!!this['_cachedContentParts']['find'](({hasChanges:_0x4a78c5})=>!_0x4a78c5);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x38101b,_0x2117df?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0xd65733=>_0xd65733['partDefinition']['hasChanges']);}}class De extends _0x1fde3a{constructor(_0x5535d7=void 0x0){super();const _0xafad3=_0x5535d7?'ck-ai-spinner_'+_0x5535d7:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0xafad3]}});}}class F extends _0x3249c4{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x135056,_0x182969){super(_0x135056);const {showDiff:_0x4f3028,areActionsDisabled:_0x4c44fe,miniToolbarConfig:_0x3cad06,hideHeader:_0x403cae,showLoader:_0x17e36f,showUnchangedParts:_0x509dc3,availableActions:_0x4de87d}=_0x182969;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x17e36f),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x403cae||(this['headerView']=new Lr(_0x135056,{'showDiff':_0x4f3028}),this['headerView']['on']('toggleShowChanges',(_0x50a102,_0xa30896)=>{this['areChangesVisible']=_0xa30896['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0xa30896['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x135056,{'areActionsDisabled':_0x4c44fe,'showUnchangedParts':!!_0x509dc3,'availableActions':_0x4de87d}),this['bodyView']['delegate'](...Ee)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Sr(_0x135056,_0x3cad06,_0x4f3028),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x345cce,_0x398c32)=>{this['areChangesVisible']=_0x398c32,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x398c32});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new _r(this['locale']),this['children']['add'](this['sourcesView']),_0x17e36f&&(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'](_0x4e31b1){await this['bodyView']['updateContentParts'](_0x4e31b1);}['updateSources'](_0x126bad){this['sourcesView']['children']['addMany'](_0x126bad['map'](_0x591233=>new jr(this['locale'],_0x591233))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0xd5913){if(this['errorView']){const _0x3dae33=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x3dae33&&(_0x3dae33['textContent']=_0xd5913),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'](_0x587b10){this['miniToolbarView']['items']['add'](_0x587b10);}['removeNavigationItem'](_0x4f7118){this['miniToolbarView']['items']['remove'](_0x4f7118);}['_createLoaderView'](){const _0x4379fe=new _0x3249c4(this['locale']),_0x2574fe=new De('small');_0x2574fe['isVisible']=!0x0;const _0x45fe44=new _0x3249c4(this['locale']);return _0x45fe44['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x4379fe['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x624342=>!_0x624342)]},'children':[_0x2574fe,_0x45fe44]}),_0x4379fe;}['_createErrorView'](){const _0x16a745=new _0x3249c4(this['locale']),_0x20072f=new _0x3249c4(this['locale']);return _0x20072f['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[i(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x16a745['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x4c7c7a=>!_0x4c7c7a)]},'children':[_0x20072f]}),_0x16a745;}}class _r extends _0x3249c4{['children'];constructor(_0x51b0a5){super(_0x51b0a5),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',_0x4f6ed8=>!_0x4f6ed8)]},'children':this['children']});const _0x4f0c31=new _0x3249c4(this['locale']),_0x3b2993=new _0xf03b05();_0x3b2993['content']=_0x51778b,_0x4f0c31['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x3b2993,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x4f0c31);}}class jr extends _0x290cbd{constructor(_0x495595,_0x5ab9a3){super(_0x495595),this['set']({'label':_0x5ab9a3['title'],'tooltip':_0x5ab9a3['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x52747e=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x52747e['to'](()=>{window['open'](_0x5ab9a3['url'],'_blank');})}}),_0x5ab9a3['favicon']){const _0x25f8c8=new _0x3249c4(_0x495595);_0x25f8c8['setTemplate']({'tag':'img','attributes':{'src':_0x5ab9a3['favicon']||_0x51778b,'alt':_0x5ab9a3['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x25f8c8);}else this['set']('icon',_0x51778b);}}class cs extends _0xf901f6{constructor(_0x519cfb,_0x32f935=!0x0,_0x3fbc0a=!0x0){super(_0x519cfb),this['set']('isLoading',!0x1),_0x32f935&&(this['applyButton']=this['_createButton'](i(_0x519cfb,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x153898=>!_0x153898),this['items']['add'](this['applyButton'])),_0x3fbc0a&&(this['suggestButton']=this['_createButton'](i(_0x519cfb,'AI_BALLOON_SUGGEST_BUTTON'),_0x32f935?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x1b2400=>!_0x1b2400),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x113f5e,_0x52749f){const _0x28a3f1=new _0x290cbd(this['locale']);return _0x28a3f1['set']({'label':_0x113f5e,'class':_0x52749f||'','isVisible':!0x0,'withText':!0x0}),_0x28a3f1;}}class ls extends _0x3249c4{constructor(_0xe98b0c){super(_0xe98b0c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0xe98b0c,'AI_DISCLAIMER_TEXT')}]}]});}}const B=['applySuggestion','insertSuggestion','showNext','showPrevious'];class D extends _0x3249c4{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];constructor(_0x1c9f29,_0x5a848c,_0x2880a8,_0x57ae89){super(_0x1c9f29),this['_availableActions']=_0x2880a8,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x57ae89),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new _0x51df1c(),this['keystrokes']=new _0x3116d1(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x504985({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x33c41f(),this['_addContentView'](_0x5a848c['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x5a848c['showApplyButton'],_0x5a848c['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'](_0x5a848c['showApplyButton'],_0x5a848c['showSuggestButton']);});}['render'](){super['render']();for(const _0x11db85 of this['_focusables'])this['focusTracker']['add'](_0x11db85['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x2bb489){-0x1===_0x2bb489?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x2c9cfa){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x2c9cfa,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0xcd3850){this['showError'](_0xcd3850);}['showBlockingError'](_0x3f23fa){this['showError'](_0x3f23fa),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x4fc89c){const _0x479a14=this['_createNextButtonView'](),_0x511dfc=this['_createPreviousButtonView']();_0x4fc89c['view']['headerView']['children']['add'](_0x479a14,0x2),_0x4fc89c['view']['headerView']['children']['add'](_0x511dfc,0x0),this['_focusables']['addMany']([_0x479a14,_0x511dfc]),this['focusTracker']['add'](_0x479a14['element']),this['focusTracker']['add'](_0x511dfc['element']);}['_addContentView'](_0x12fb39){this['_mainView']=_0x12fb39,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x6e63ec){const _0x55b361=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x6e63ec,this['_dialogContent']['add'](this['_mainView'],_0x55b361),this['hideError']();}['_addDisclaimerView'](){this['disclaimerView']=new ls(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x1b24b5=!0x0,_0x51f17f=!0x0){_0x1b24b5=_0x1b24b5&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x51f17f=_0x51f17f&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new cs(this['locale'],_0x1b24b5,_0x51f17f),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x53932b=new _0x290cbd(this['locale']);return _0x53932b['set']({'icon':_0x53b3de,'tooltip':i(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x53932b['on']('execute',()=>{this['fire']('showNext');}),_0x53932b;}['_createPreviousButtonView'](){const _0x5d4ad0=new _0x290cbd(this['locale']);return _0x5d4ad0['set']({'icon':_0x2c7390,'tooltip':i(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x5d4ad0['on']('execute',()=>{this['fire']('showPrevious');}),_0x5d4ad0;}['_createErrorView'](){const _0x5d1560=new _0x3249c4(this['locale']),_0x464a82=new _0x3249c4(this['locale']);return _0x464a82['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x5d1560['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x4753d0=>!_0x4753d0)]},'children':[_0x464a82]}),_0x5d1560;}}const z=0xa;class it extends _0x3e59e0{static get['requires'](){return[R,N];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x30bdc4){const _0x27c5b9=q(this['context']);if(this['_config']=_0x30bdc4,this['isOpen'])return void this['_updateBalloon'](_0x30bdc4);const _0x3c1c16=this['context']['config']['get']('ai.availableReplyActions')||[...H],_0x108a80=_0x27c5b9?.['commands']['get']('trackChanges'),_0x21e9fd=_0x108a80?.['value'];this['balloonView']=new D(_0x27c5b9['locale'],_0x30bdc4,_0x3c1c16,!!_0x21e9fd),this['balloonView']['delegate'](...B)['to'](this),_0x108a80&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x108a80,'value'),this['_showDialog'](_0x30bdc4);}['close'](){q(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateBalloon'](_0x3cf3a3){const _0x4330a7=q(this['context']),_0x4aacd6=_0x4330a7['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x4330a7['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x4aacd6['view']?.['headerView']&&(_0x4aacd6['view']['headerView']['label']=_0x3cf3a3['title'],_0x4aacd6['view']['headerView']['iconView']&&_0x3cf3a3['icon']&&(_0x4aacd6['view']['headerView']['iconView']['content']=_0x3cf3a3['icon'])),this['balloonView']['updateContent'](_0x3cf3a3['mainView']),this['_setupVisualSelection'](_0x3cf3a3['ranges'],_0x3cf3a3['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x4aacd6['view']&&_0x4aacd6['view']['updatePosition']();},_0x4330a7['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x480c47,_0xbd8eea){this['context']['plugins']['get'](N)['showFakeVisualSelection'](_0x480c47,'ai-balloon-'+_0xbd8eea,!0x0,!0x0);}['_showDialog'](_0x22bd36){const _0x2067b2=q(this['context']);this['_setupVisualSelection'](_0x22bd36['ranges'],_0x22bd36['index']);const _0x5dfdf8=this['_getSelectionElements']();_0x5dfdf8&&_0x5dfdf8[0x0]&&_0x1966fd({'target':_0x5dfdf8[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x2067b2['plugins']['get']('Dialog')['show']({'title':_0x22bd36['title'],'icon':_0x22bd36['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x22bd36['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x446e5f=>{_0x22bd36['showRotator']&&this['balloonView']['setupRotator'](_0x446e5f),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'](_0x24e092,_0x5e05ee){if(!_0x5e05ee)return null;const _0x154066=this['_getSelectionElements']();if(!_0x154066||0x0===_0x154066['length'])return{'left':Math['round'](_0x5e05ee['left']+_0x5e05ee['width']/0x2-_0x24e092['width']/0x2),'top':Math['round'](_0x5e05ee['top']+_0x5e05ee['height']/0x2-_0x24e092['height']/0x2)};const _0x34ab0e=Math['round'](_0x5e05ee['left']+_0x5e05ee['width']/0x2-_0x24e092['width']/0x2),_0x4dd3b6=new _0x11a5d6(_0x154066[0x0]),_0x1bf3d1=new _0x11a5d6(_0x154066[_0x154066['length']-0x1]),_0x3d6c4b=_0x24e092['height'],_0x125db1=this['_config']['showRotator']?0x8:0x0;return{'left':_0x34ab0e,'top':this['_calculateOptimalTopPosition'](_0x4dd3b6,_0x1bf3d1,_0x3d6c4b,_0x125db1,_0x5e05ee)};}['_calculateOptimalTopPosition'](_0x4d2a9c,_0x2be527,_0x21d809,_0x3735f9=0x0,_0x2e637a){const _0x454d42=_0x21d809+_0x3735f9,_0x2202b8=new _0x11a5d6(_0x31e929['window']),_0x5d5142=[_0x4d2a9c['getVisible'](),_0x2be527['getVisible']()]['filter'](_0x529b4e=>_0x529b4e),_0x423792=_0x11a5d6['getBoundingRect'](_0x5d5142);if(!_0x423792)return Math['round'](_0x2e637a['top']+_0x2e637a['height']/0x2);const _0x2ddd04=_0x2202b8['getIntersection'](_0x423792);if(!_0x2ddd04)return Math['round'](_0x2e637a['top']+_0x2e637a['height']/0x2);const _0x1981ef=_0x2e637a['getVisible'](),_0x39005b=_0x1981ef&&_0x423792['height']>_0x1981ef['height'],_0x4829fd=_0x2ddd04['top'],_0x1d01c6=_0x2ddd04['bottom'];if(_0x39005b){const _0x4ecf69=(_0x1981ef||_0x2202b8)['height']/0x2-_0x454d42/0x2,_0x49f0a4=_0x4829fd-z-_0x2e637a['top'],_0x5f2a68=_0x2e637a['bottom']-_0x1d01c6-z;return _0x49f0a4>=_0x454d42?Math['max'](z,_0x4829fd-_0x454d42-z):_0x5f2a68>=_0x454d42?_0x1d01c6+z:Math['max'](z,_0x4ecf69);}const _0x100d0b=_0x4829fd-_0x454d42,_0x4895cf=_0x2e637a['bottom']-_0x1d01c6-z,_0x1cba82=_0x4829fd-z-_0x2e637a['top'];let _0x289707;if(_0x4895cf>=_0x454d42)_0x289707=_0x1d01c6+z;else{if(_0x1cba82>=_0x454d42)_0x289707=_0x100d0b-z;else _0x289707=_0x4829fd+_0x423792['height']/0x2-_0x454d42/0x2;}return _0x289707;}['_setupMarkerRemovalListener'](){const _0x23b59d=q(this['context']);this['listenTo'](_0x23b59d['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x57de15,data:{newRange:_0x45e41d}}of _0x23b59d['model']['document']['differ']['getChangedMarkers']())if(_0x57de15['startsWith']('ai-selection:')&&(_0x45e41d&&(_0x45e41d['start']['isEqual'](_0x45e41d['end'])||'$graveyard'==_0x45e41d['root']['rootName'])||null==_0x45e41d)){const _0x3f7fcf=i(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x3f7fcf),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x422bba=q(this['context']);this['stopListening'](_0x422bba['model']['document']);}['_getSelectionElements'](){const _0x2896c4=q(this['context']);return _0x46d27c(_0x2896c4['editing'],[..._0x2896c4['model']['markers']['getMarkersGroup']('ai-selection'),..._0x2896c4['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class mt extends _0x3e59e0{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[R,it,nt];}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 It({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0xe96b57=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x42cfab,_0x6f844)=>{this['_handleUIUserMessage']({'userMessage':_0x6f844});}),this['listenTo'](_0xe96b57,'resizedTabs',(_0x3c074f,_0x4240b4)=>{this['_setIsMaximized'](_0x4240b4);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0xe96b57['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x458abb,_0x509f15)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x509f15));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x267eca,_0x6462ca)=>{this['activeConversation']?.['addUrlToContext'](_0x6462ca);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x526f67,_0x3a0290)=>{this['activeConversation']?.['addResourceToContext'](_0x3a0290['source'],_0x3a0290['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x1f1bc0,_0x1d577a)=>{this['_removeFromContext'](_0x1d577a);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x330242,_0x4416ec)=>{this['activeConversation']?.['loadSourceResources'](_0x4416ec['sourceId'],_0x4416ec['query'],_0x4416ec['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x51827c,_0x203aba)=>{this['activeConversation']?.['setModel'](_0x203aba);}),this['listenTo'](this['_aiChatUi'],'like',(_0x420978,{replyId:_0x1b8cb9})=>{console['log']('Liked\x20response',_0x1b8cb9);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x50a845,{replyId:_0x2d7d8e})=>{console['log']('Disliked\x20response',_0x2d7d8e);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x8a5162,_0xc8442a)=>{this['context']['plugins']['get'](it)['close'](),this['_insertSuggestion'](_0xc8442a);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x3a1b1e,{replyId:_0x4f669f,partIndex:_0x1a41f5})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4f669f,_0x1a41f5);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x447011,{replyId:_0x504712,partIndex:_0x33fbbf})=>{const _0xca8e6f=this['_getDocumentRangeForReplyChanges'](_0x504712,_0x33fbbf);_0xca8e6f&&'$graveyard'!=_0xca8e6f['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0xca8e6f['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3a780e,_0x1d3f04)=>{this['context']['plugins']['get'](it)['close'](),this['_applySuggestion'](_0x1d3f04);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x417cb3,{replyId:_0x235bf2,showDiff:_0x9cf00a})=>{const {reply:_0x79ae2}=this['getInteractionAndReplyById'](_0x235bf2),_0x55c6ab=_0x79ae2['getContentParts']({'showDiff':_0x9cf00a});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x79ae2['id'],'parts':_0x55c6ab,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x2ac5c4,{replyId:_0x332bd8,partIndex:_0x4e6d59})=>{this['_previewedChangeGroup']?.['replyId']==_0x332bd8&&this['_previewedChangeGroup']?.['partIndex']==_0x4e6d59&&this['context']['plugins']['get'](it)['close']();const {reply:_0x47b7ab}=this['getInteractionAndReplyById'](_0x332bd8);_0x47b7ab['setChangeGroupState'](_0x4e6d59,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof pt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2c05dc,_0x4b6193)=>{_0x4b6193['on']('ready',()=>{this['_integrateEditor'](_0x4b6193);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x2e6aed){const _0x44da43=q(this['context']);if(!_0x44da43['plugins']['has']('TrackChanges'))throw new _0x2120c6('ai-no-track-changes',null);const _0x397650=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x3a8767,interaction:_0x3ab0bf}=this['getInteractionAndReplyById'](_0x2e6aed['replyId']),_0x15bef0=this['_getDocumentRangeForReplyChanges'](_0x2e6aed['replyId'],_0x2e6aed['partIndex']),_0x562896=void 0x0!==_0x2e6aed['partIndex']?[_0x3a8767['changeGroups'][_0x2e6aed['partIndex']]]:_0x3a8767['changeGroups']['filter'](_0x45bb98=>'pending'==_0x45bb98['state']),_0x24641e=_0x562896['map'](_0x5e7f26=>_0x3a8767['changeGroups']['indexOf'](_0x5e7f26));if(!_0x15bef0||'$graveyard'==_0x15bef0['range']['root']['rootName'])return void _0x24641e['forEach'](_0x4bd823=>_0x3a8767['setChangeGroupState'](_0x4bd823,'outdated'));_0x24641e['forEach'](_0x5e9fe8=>_0x3a8767['setChangeGroupState'](_0x5e9fe8,'accepted'));const _0xcdb6a4=rt({'editor':_0x44da43,'reply':_0x3a8767,'interaction':_0x3ab0bf,'groups':_0x562896,'transform':!0x0,'documentCompare':_0x397650,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x52a1b0;_0x15bef0&&this['_scrollToSuggestionRange'](_0x15bef0['range']),_0x44da43['model']['change'](_0x26865b=>{_0x52a1b0=_0x26865b['batch'],_0x44da43['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xcdb6a4),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x52a1b0,{'interactionId':_0x3ab0bf['id'],'replyId':_0x3a8767['id'],'indexes':_0x24641e['slice']()}),this['_updateRatings'](_0x3a8767);}['_applySuggestion'](_0x1543db){const _0xae22ab=q(this['context']),_0x3bd183=this['context']['plugins']['get'](nt),{reply:_0x5c7c99,interaction:_0x3b1b44}=this['getInteractionAndReplyById'](_0x1543db['replyId']),_0x27e658=this['_getDocumentRangeForReplyChanges'](_0x1543db['replyId'],_0x1543db['partIndex']),_0x3704e9=void 0x0!==_0x1543db['partIndex']?[_0x5c7c99['changeGroups'][_0x1543db['partIndex']]]:_0x5c7c99['changeGroups']['filter'](_0x592474=>'pending'==_0x592474['state']),_0x4c706b=_0x3704e9['map'](_0x140f7e=>_0x5c7c99['changeGroups']['indexOf'](_0x140f7e));if(!_0x27e658||'$graveyard'==_0x27e658['range']['root']['rootName'])return void _0x4c706b['forEach'](_0x413f9f=>_0x5c7c99['setChangeGroupState'](_0x413f9f,'outdated'));_0x4c706b['forEach'](_0x705158=>_0x5c7c99['setChangeGroupState'](_0x705158,'accepted'));const _0x39e77b=rt({'editor':_0xae22ab,'reply':_0x5c7c99,'interaction':_0x3b1b44,'groups':_0x3704e9,'transform':!0x0,'documentCompare':_0x3bd183,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x30cc9f;_0x27e658&&this['_scrollToSuggestionRange'](_0x27e658['range']),_0xae22ab['model']['change'](_0x4db2aa=>{_0x30cc9f=_0x4db2aa['batch'];for(const _0x547df0 of _0x39e77b)_0x547df0['baseVersion']=_0xae22ab['model']['document']['version'],ot(_0xae22ab,_0x547df0),_0x4db2aa['batch']['addOperation'](_0x547df0),_0xae22ab['model']['applyOperation'](_0x547df0);}),this['_batchToChanges']['set'](_0x30cc9f,{'interactionId':_0x3b1b44['id'],'replyId':_0x5c7c99['id'],'indexes':_0x4c706b['slice']()}),this['_updateRatings'](_0x5c7c99);}['_openBalloonFor'](_0x152394,_0x1ad7e7){const _0x37140e=q(this['context']),_0x2e413a=this['_getDocumentRangeForReplyChanges'](_0x152394,_0x1ad7e7),_0x5552dc=this['context']['plugins']['get'](it);if(!_0x2e413a)return void _0x5552dc['close']();const {range:_0x361038,currentIndex:_0x422d91}=_0x2e413a;if('$graveyard'==_0x361038['root']['rootName']){const {reply:_0x258489}=this['getInteractionAndReplyById'](_0x152394);return _0x258489['setChangeGroupState'](_0x422d91,'outdated'),void _0x5552dc['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x152394&&this['_previewedChangeGroup']?.['partIndex']==_0x422d91)return;this['stopListening'](_0x5552dc),this['_previewedChangeGroup']={'replyId':_0x152394,'partIndex':_0x422d91};let _0x4a7fb3=_0x37140e['config']['get']('ai.availableReplyActions')||[...H];_0x37140e['plugins']['has']('TrackChanges')||(_0x4a7fb3=_0x4a7fb3['filter'](_0x51c953=>'insertSuggestion'!=_0x51c953));const _0x137637=new F(_0x37140e['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x4a7fb3});this['stopListening'](_0x137637);const {reply:_0x78017e}=this['getInteractionAndReplyById'](_0x152394),_0x286914=_0x78017e['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x414530=>_0x414530['hasChanges']),_0x272c6d=_0x286914['findIndex'](_0x39fd92=>_0x39fd92['index']==_0x422d91);if(-0x1==_0x272c6d)return;const _0x10e86e=_0x286914[_0x272c6d],_0x298eb1=_0x286914['at']((_0x272c6d-0x1)%_0x286914['length'])?.['index'],_0x349c51=_0x286914['at']((_0x272c6d+0x1)%_0x286914['length'])?.['index'];_0x137637['updateContent']({'parts':[_0x10e86e],'renderingStrategy':'static'});const _0x101930=_0x422d91!==_0x298eb1;this['_scrollToSuggestionRange'](_0x361038,!0x0),_0x5552dc['open']({'index':_0x422d91,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x272c6d+0x1)['toString']()),'icon':Ot,'mainView':_0x137637,'showRotator':_0x101930,'showApplyButton':!0x0,'showSuggestButton':_0x37140e['plugins']['has']('TrackChanges'),'ranges':[_0x361038]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x152394,_0x422d91),this['listenTo'](_0x137637,'toggleSuggestionDisplayMode',(_0x3459f4,{showDiff:_0x2e89a0})=>{this['_balloonShowDiff']=_0x2e89a0;const {reply:_0x357205}=this['getInteractionAndReplyById'](_0x152394),_0x168b97=_0x357205['getContentParts']({'showDiff':_0x2e89a0,'groupIndex':_0x422d91});_0x137637['updateContent']({'parts':_0x168b97,'renderingStrategy':'static'});}),this['listenTo'](_0x5552dc,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x152394,'partIndex':_0x422d91}),_0x101930?this['_openBalloonFor'](_0x152394,_0x349c51):_0x5552dc['close']();}),this['listenTo'](_0x5552dc,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x152394,'partIndex':_0x422d91}),_0x101930?this['_openBalloonFor'](_0x152394,_0x349c51):_0x5552dc['close']();}),_0x101930&&(this['listenTo'](_0x5552dc,'showNext',()=>{this['_openBalloonFor'](_0x152394,_0x349c51);}),this['listenTo'](_0x5552dc,'showPrevious',()=>{this['_openBalloonFor'](_0x152394,_0x298eb1);})),this['listenTo'](_0x5552dc,'dialogClosed',()=>{this['stopListening'](_0x5552dc),this['stopListening'](_0x137637),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x258478,_0x4c3772){const _0x8ace61=q(this['context']),{reply:_0x406a38,interaction:_0x22813c}=this['getInteractionAndReplyById'](_0x258478),_0x33a403=_0x406a38['changeGroups']['filter'](_0x212242=>'pending'==_0x212242['state']),_0x2641ab=_0x33a403['map'](_0x14e0c9=>_0x406a38['changeGroups']['indexOf'](_0x14e0c9));void 0x0===_0x4c3772&&(_0x4c3772=_0x2641ab[0x0]);const _0x27cabb=_0x2641ab['indexOf'](_0x4c3772);if(-0x1==_0x27cabb)return null;const _0x179347=_0x33a403[_0x27cabb],_0x4cf5fe=new Rt([]),_0x1e0617=new Rt([]);for(const _0x488aac of _0x179347['changes'])if('removed'!=_0x488aac['type']&&_0x1e0617['children']['push'](_0x488aac['node']['cloneNode'](!0x0)),'new'!=_0x488aac['type']){const _0x1cec43=wt(_0x4720e8=>Et(_0x4720e8,'data-id')==_0x488aac['id'],_0x406a38['documentContextContent'],!0x0);_0x4cf5fe['children']['push'](_0x1cec43['cloneNode'](!0x0));}if(0x0==_0x4cf5fe['children']['length']){if(_0x179347['changes'][0x0]['anchorId']){const _0x1cd4e5=Dt('data-id',_0x179347['changes'][0x0]['anchorId'],_0x406a38['documentContextContent']);_0x4cf5fe['children']['unshift'](_0x1cd4e5['cloneNode'](!0x0)),_0x1e0617['children']['unshift'](_0x1cd4e5['cloneNode'](!0x0)),_0x1cd4e5['nextSibling']&&(_0x4cf5fe['children']['push'](_0x1cd4e5['nextSibling']['cloneNode'](!0x0)),_0x1e0617['children']['push'](_0x1cd4e5['nextSibling']['cloneNode'](!0x0)));}else{const _0x2e9ba7=_0x406a38['documentContextContent']['children'][0x0];if(!_0x2e9ba7)return null;_0x4cf5fe['children']['push'](_0x2e9ba7['cloneNode'](!0x0)),_0x1e0617['children']['push'](_0x2e9ba7['cloneNode'](!0x0));}}const _0x320b66=_0x22813c['getDocumentContext'](),_0x4283eb=_0x8ace61['data']['parse'](_0x320b66['content']),_0x175108=St(_0x4cf5fe),_0x1af822=_0x8ace61['data']['parse'](_0x175108),_0xc315bd=_0x8ace61['data']['parse'](_0x175108),_0xcf8a7c=_0x8ace61['model']['createPositionAt'](_0x1af822,0x0),_0x4263a0=St(_0x1e0617),_0x27d1a8={'anchor':_0xcf8a7c,'markDeletions':!0x1},_0x52c705=_0x8ace61['plugins']['get'](nt)['getDiff'](_0x175108,_0x4263a0,_0x27d1a8)['getOperations']();if(!_0x52c705['length'])return null;_0x8ace61['model']['change'](_0x28e146=>{for(const _0x4c3c21 of _0x52c705)if('remove'==_0x4c3c21['type']){const _0x2584db=_0x4c3c21['sourcePosition'],_0xae2040=_0x4c3c21['howMany'],_0x2af4f4=new lt(_0x2584db,_0xae2040);_0x28e146['batch']['addOperation'](_0x2af4f4),_0x8ace61['model']['applyOperation'](_0x2af4f4);}else'marker'!==_0x4c3c21['type']&&(_0x4c3c21['baseVersion']=null,_0x4c3c21['isDocumentOperation']=!0x1,_0x28e146['batch']['addOperation'](_0x4c3c21),_0x8ace61['model']['applyOperation'](_0x4c3c21));});const _0x4eabdc=vt(_0x8ace61,_0x52c705,_0x1af822);At(_0x8ace61['model'],_0x4eabdc);const _0x5dc50d=_0x4eabdc['getFirstRange']()['start']['path']['slice'](),_0x579740=_0x4eabdc['getFirstRange']()['end']['path']['slice'](),_0x5899dd=[];let _0x5220d8=_0x1af822,_0x5e0d8e=_0xc315bd;for(let _0x5aec79=0x0;_0x5aec79<_0x579740['length'];_0x5aec79++){const _0x3ee5b4=_0x5220d8['maxOffset']-_0x579740[_0x5aec79];_0x5899dd[_0x5aec79]=_0x5e0d8e['maxOffset']-_0x3ee5b4,_0x5220d8=_0x5220d8['getChildAtOffset'](_0x579740[_0x5aec79]),_0x5e0d8e=_0x5e0d8e['getChildAtOffset'](_0x5899dd[_0x5aec79]);}const _0x319a00=_0x8ace61['model']['createRange'](_0x8ace61['model']['createPositionFromPath'](_0xc315bd,_0x5dc50d),_0x8ace61['model']['createPositionFromPath'](_0xc315bd,_0x5899dd)),_0x65c942=_0xc315bd['getChild'](0x0)['getAttribute'](Tt),_0x49bd18=Array['from'](_0x4283eb['getChildren']())['find'](_0x38ee94=>_0x38ee94['getAttribute'](Tt)==_0x65c942)['getPath'](),_0x23fbe6=_0x319a00['start']['path']['slice'](),_0xbfca57=_0x319a00['end']['path']['slice']();_0x23fbe6[0x0]=_0x49bd18[0x0]+_0x23fbe6[0x0],_0xbfca57[0x0]=_0x49bd18[0x0]+_0xbfca57[0x0];let _0x2535a9=_0x8ace61['model']['createRange'](_0x8ace61['model']['createPositionFromPath'](_0x8ace61['model']['document']['getRoot'](),_0x23fbe6),_0x8ace61['model']['createPositionFromPath'](_0x8ace61['model']['document']['getRoot'](),_0xbfca57));const _0x6f2632=_0x8ace61['model']['document']['history']['getOperations'](_0x320b66['version']);for(const _0x55c5a7 of _0x6f2632)_0x2535a9=ht['_createFromRanges'](_0x2535a9['getTransformedByOperation'](_0x55c5a7));return{'range':_0x2535a9,'currentIndex':_0x4c3772};}['_integrateEditor'](_0x2052c8){if(!_0x2052c8['plugins']['has']('Undo'))return;const _0x3be1fd=_0x2052c8['commands']['get']('undo'),_0xf6bfaa=_0x2052c8['commands']['get']('redo');this['listenTo'](_0x3be1fd,'revert',(_0x27cd34,_0x347a8f,_0x4ddf63)=>{const _0x302e51=this['_batchToChanges']['get'](_0x347a8f);if(!_0x302e51)return;const _0x224bff=this['activeConversation']['getInteraction'](_0x302e51['interactionId'])['getReply'](_0x302e51['replyId']);_0x302e51['indexes']['forEach'](_0x2e1667=>_0x224bff['setChangeGroupState'](_0x2e1667,'pending')),this['_batchToChanges']['delete'](_0x347a8f),this['_batchToChanges']['set'](_0x4ddf63,_0x302e51);}),this['listenTo'](_0xf6bfaa,'revert',(_0x32e7d5,_0x5647f6,_0x1249b6)=>{const _0xcfb64d=this['_batchToChanges']['get'](_0x5647f6);if(!_0xcfb64d)return;const _0x114de9=this['activeConversation']['getInteraction'](_0xcfb64d['interactionId'])['getReply'](_0xcfb64d['replyId']);_0xcfb64d['indexes']['forEach'](_0x4c68ec=>_0x114de9['setChangeGroupState'](_0x4c68ec,'accepted')),this['_batchToChanges']['delete'](_0x5647f6),this['_batchToChanges']['set'](_0x1249b6,_0xcfb64d);});}async['loadConversation'](_0x477f91){this['context']['plugins']['get'](it)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x1f2e80=this['context']['plugins']['get'](Ct);this['updateConversationTitle']('\x20'),_0x1f2e80['view']['activateTab']('chat'),await this['_startConversationSafely'](_0x477f91);const {sessionId:_0x23a67f}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x477f91,_0x23a67f),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x87458d){console['error']('Failed\x20to\x20load\x20conversation',_0x87458d);}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x528e62){this['activeConversation']['id']===_0x528e62&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x34cb79=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x34cb79),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x204120,quickActionData:_0x8e5de1}){await this['_handleUIUserMessage']({'userMessage':_0x204120,'quickActionData':_0x8e5de1});}['getGroupId'](){const _0x3e18e7=this['context']['config']['get']('collaboration.channelId');if(!_0x3e18e7)throw new _0x2120c6('ai-chat-missing-channel-id',this);return _0x3e18e7;}async['_startConversationSafely'](_0x422060){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x422060);}catch(_0x1bb782){ft('ai-chat-conversation-start-failed',_0x1bb782),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0xdfc1be){const _0x2130ab=this['context']['plugins']['get'](it);let _0x5544ce;_0x2130ab['isOpen']&&_0x2130ab['close'](),_0xdfc1be||!this['activeConversation']?_0x5544ce=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x5544ce=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x4c6181=this['getGroupId'](),_0x49014b=_0xdfc1be||_0x1a633f();this['activeConversation']=new _t({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x5544ce,'conversationId':_0x49014b,'group':_0x4c6181,'getEditor':()=>q(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x164457,_0x4e56b7)=>{this['_aiChatUi']['createConversation'](_0x4e56b7),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0xdfc1be||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x546798,_0xe1cdee)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xe1cdee['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x3098d5,_0x5829b8)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x5829b8);}),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',(_0x9f27d3,_0x5a4ff6)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x5a4ff6,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x2b132a,_0x2e7262)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2e7262,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x23ce98,_0x3d5508)=>{this['_aiChatUi']['removeFeedInteraction'](_0x3d5508['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x5d4c93,_0x5a5692,_0xaf2103)=>{this['updateConversationTitle'](_0x5a5692,_0xaf2103);}),this['activeConversation']['on']('replyCreated',(_0x36745f,_0x4be2d0)=>{'text-delta'===_0x4be2d0['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x4be2d0):this['_aiChatUi']['addFeedItemAISuggestion'](_0x4be2d0);}),this['activeConversation']['on']('replyContentUpdated',async(_0xc94793,_0x26cf98)=>{await this['_updateReplyContent']({'reply':_0x26cf98});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x59b417,{reply:_0x277564,index:_0x1ad784,state:_0x199910})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x277564['id'],'index':_0x1ad784,'state':_0x199910});}),this['activeConversation']['on']('contextItemAdded',(_0x2d7b54,_0x55813b)=>{if(this['_aiChatUi']['addContextItem'](_0x55813b['contextItem'],_0x55813b['isLoading']),'selection'===_0x55813b['contextItem']['type']){const _0x1e30f2=[...q(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x1e30f2,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x75c110,_0x21601b)=>{this['_aiChatUi']['removeContextItem'](_0x21601b['uiId']),'current-document'==_0x21601b['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x21601b['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x5add02,_0x237b47)=>{this['_aiChatUi']['setContextItemLoading'](_0x237b47['contextItem']['uiId'],_0x237b47['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x22fc0d,_0x4053dd)=>{this['_aiChatUi']['setConversationContext'](_0x4053dd['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x2dea6d,_0x3a592a)=>{this['_aiChatUi']['setAddContextOptions'](_0x3a592a['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0xc89083,_0x508db7)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x508db7['sourceId'],_0x508db7['source'],_0x508db7['resources'],_0x508db7['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x427a8b,_0x36af97)=>{this['_aiChatUi']['updateResourceState'](_0x36af97['sourceId'],_0x36af97['resourceId'],_0x36af97['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x185fce,_0x5bebf6)=>{this['_aiChatUi']['updateCapabilities'](_0x5bebf6);}),this['activeConversation']['on']('modelSelected',(_0x55637c,_0x1e9aef)=>{this['_aiChatUi']['setSelectedModel'](_0x1e9aef['selectedModel'],_0x1e9aef['isDisabled']);}),this['activeConversation']['on']('error',(_0x2c357c,{error:_0x28d3fc,interactionId:_0x55481c,fileName:_0x1becb6,url:_0x4cdd34,sourceId:_0x42fd9a,sourceLabel:_0x378faf})=>{const _0x26e556=_0x55481c?_0x55481c+':'+_0x1a633f():_0x1a633f();_0x28d3fc['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x26e556}):_0x28d3fc['message']['startsWith']('ai-chat-conversation-init-failed')||_0x28d3fc['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x26e556}),this['_logError'](_0x28d3fc)):_0x28d3fc['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x1becb6),'id':_0x26e556}):_0x28d3fc['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x4cdd34),'id':_0x26e556}):_0x28d3fc['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x26e556}):_0x28d3fc['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x26e556}):_0x28d3fc['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x42fd9a&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x42fd9a),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x378faf||'source'),'id':_0x26e556}),this['_logError'](_0x28d3fc)):_0x28d3fc['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x26e556}),this['_logError'](_0x28d3fc)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x26e556}),this['_logError'](_0x28d3fc));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0xdfc1be||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x14d285,quickActionData:_0x469b62}){if(!this['activeConversation'])throw new _0x2120c6('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':_0x14d285,'quickActionData':_0x469b62}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x369b93=q(this['context'])['model'],_0x4e3a92=Array['from'](_0x369b93['markers']['getMarkersGroup'](yt));_0x369b93['change'](_0x269641=>{_0x4e3a92['forEach'](_0x1b5c0d=>_0x269641['removeMarker'](_0x1b5c0d));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x590766){this['_aiChatUi']['setIsMaximized'](_0x590766);}['_logError'](_0x4d6723){ft(_0x4d6723['message']);}['_removeFromContext'](_0x2c24e2){this['activeConversation']?.['removeFromContext'](_0x2c24e2);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x48795c){const [_0x1db481,_0x4490a7]=_0x48795c['split'](':'),_0x1cc0ce=this['activeConversation']['getInteraction'](_0x1db481),_0x1af293=_0x1cc0ce['getReply'](_0x4490a7);return{'interaction':_0x1cc0ce,'reply':_0x1af293};}['_scrollToSuggestionRange'](_0x9bc2fe,_0x3a31d0=!0x1){const _0x45823f=q(this['context']),_0x12a8c3={'target':_0x45823f['editing']['view']['domConverter']['viewRangeToDom'](_0x45823f['editing']['mapper']['toViewRange'](_0x9bc2fe)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x3a31d0};_0x3a31d0&&(_0x12a8c3['alignToTop']=!0x0),_0x1966fd(_0x12a8c3);}['updateConversationTitle'](_0x7edf05,_0x31ec29=!0x1){this['_aiChatUi']['setConversationTitle'](_0x7edf05||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x31ec29);}async['_updateReplyContent']({reply:_0x109650,renderingStrategy:_0xf359a2}){const {id:_0x1199a3,isDone:_0x28faf3,type:_0x4ab830,parsedContent:_0x24619d}=_0x109650;if('modification-delta'===_0x4ab830){const _0x35e366=_0x109650['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1199a3,'parts':_0x35e366,'renderingStrategy':_0xf359a2,'isDone':_0x28faf3});}else'text-delta'===_0x4ab830&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x1199a3,'parsedContent':_0x24619d,'renderingStrategy':_0xf359a2,'isDone':_0x28faf3});_0x28faf3&&_0x109650['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x1199a3,_0x109650['sources']);}async['_stopLastInteraction'](){const _0x4f8f6d=this['activeConversation']?.['lastInteraction'];_0x4f8f6d&&(_0x4f8f6d['stop'](),this['_aiChatUi']['stopInteraction'](_0x4f8f6d));}async['_flushLastInteractionUI'](){const _0x21a8a2=this['activeConversation']?.['lastInteraction'];if(_0x21a8a2){for await(const _0x29d4ea of _0x21a8a2['replies'])await this['_updateReplyContent']({'reply':_0x29d4ea,'renderingStrategy':'static'});}}['_updateRatings'](_0x50033f){const _0x272ba2={'positiveCount':_0x50033f['changeGroups']['filter'](_0x468f2f=>'accepted'===_0x468f2f['state'])['length'],'totalCount':_0x50033f['changeGroups']['length'],'modificationId':_0x50033f['id']},_0x53bd0b=this['activeConversation']['getInteraction'](_0x50033f['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x53bd0b,_0x272ba2);}}const Mt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class Le extends Ir{['containerView'];['actionsView'];constructor(_0x4e7c14,_0x1e3663){super(_0x1e3663),this['set']('isTrackChangesOn',!0x1),this['containerView']=new F(_0x4e7c14,{'showDiff':_0x1e3663['showDiff'],'areActionsDisabled':_0x1e3663['areActionsDisabled'],'availableActions':_0x1e3663['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x391297,_0x2ad9e2)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x2ad9e2['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',(_0x338b7a,{index:_0x3f389b})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x3f389b});}),this['containerView']['on']('insertSuggestion',(_0x18afc1,{index:_0x36081b})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x36081b});}),this['containerView']['on']('rejectSuggestion',(_0x30c02e,{index:_0x53b6de})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x53b6de});}),this['containerView']['on']('mouseOverSuggestion',(_0x110894,{index:_0x343d62})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x343d62});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x4b592c,{index:_0x85fe1f})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x85fe1f});}),this['actionsView']=new hh(_0x4e7c14,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']});}),_0x1e3663['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'](_0x36276d){await this['containerView']['updateContent'](_0x36276d),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0xf1c98e,_0x33e1bd){this['containerView']['bodyView']['updatePartState'](_0xf1c98e,_0x33e1bd);}['updateSources'](_0x380a55){this['containerView']['updateSources'](_0x380a55);}['getPartView'](_0x2f465f){return this['containerView']['bodyView']['getPartView'](_0x2f465f);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Ve extends Ir{['replyContainer'];constructor(_0x1279cf,_0x45500d){super(_0x45500d),this['locale']=_0x1279cf,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x3249c4(),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':ze(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x39e162,renderingStrategy:_0x3912a8,abortSignal:_0x47356c}){'streaming'===_0x3912a8?await this['streamIntoElement'](_0x39e162,this['replyContainer']['element'],_0x47356c):this['replyContainer']['element']['innerHTML']=_0x20a8a4(_0x39e162);}['updateSources'](_0x11ee16){const _0x58dad2=new _r(this['locale']);_0x58dad2['children']['addMany'](_0x11ee16['map'](_0x41f039=>new jr(this['locale'],_0x41f039))),_0x58dad2['isVisible']=!0x0,this['children']['add'](_0x58dad2);}}const An={'file':_0x2ceb48,'document':_0x4aad50,'web-resource':_0x482077,'text':_0x2ceb48,'selection':_0xe5307b},$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',Vn='n';class wo extends _0x290cbd{constructor(_0x47e5e6,_0x27f9a8,_0x83a248,_0x18c871,_0xb71f62=!0x1){super(_0x47e5e6),this['_isAnimationOnEnterEnabled']=_0x18c871,this['_initializeProperties'](_0x27f9a8,_0x83a248,_0xb71f62),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'](_0x2bd479,_0x327ceb,_0x452a18){this['set']('label',_0x2bd479['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x2bd479['type']),this['set']('id',_0x2bd479['uiId']),this['set']('readonly',_0x327ceb),this['set']('isLoading',_0x452a18);}['_setupTemplate'](){const _0xfeb825=this['_createIconView'](),_0x1ac08e=this['_createRemoveButton'](),_0x2b051f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x2b051f),'children':this['_createTemplateChildren'](_0xfeb825,_0x1ac08e,_0x2b051f)});}['_createTemplateAttributes'](_0x9caea3){return{'class':[$r,_0x9caea3['if']('itemType',Jr,_0x4bdebe=>'document'==_0x4bdebe),_0x9caea3['if']('itemType',Qr,_0x213e7c=>'selection'==_0x213e7c)],'data-cke-tooltip-text':_0x9caea3['to']('label',jn),'data-cke-tooltip-position':Vn,'data-cke-tooltip-class':oa};}['_createTemplateChildren'](_0x57c27e,_0x596005,_0x38315c){const _0x249d47=this['_createLabelElement'](_0x38315c),_0x59216f=this['_createLoaderIcon']();return this['readonly']?[_0x57c27e,_0x249d47]:[_0x57c27e,_0x59216f,_0x249d47,_0x596005];}['_createLabelElement'](_0xf9f581){return{'tag':'span','attributes':{'class':Zr},'children':[{'text':_0xf9f581['to']('label')}]};}['_createRemoveButton'](){const _0x3d7c4c=new _0x290cbd(this['locale']);return _0x3d7c4c['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x4ac77e}),this['_setupRemoveButtonEvent'](_0x3d7c4c),_0x3d7c4c;}['_setupRemoveButtonEvent'](_0x52bfea){_0x52bfea['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x4be5d6=this['bindTemplate'],_0x58df0a=new _0xf03b05();return _0x58df0a['content']=An[this['itemType']],_0x58df0a['extendTemplate']({'attributes':{'class':[ra,_0x4be5d6['if']('isLoading','ck-hidden',_0x58cae3=>_0x58cae3)]}}),_0x58df0a;}['_handleAnimationEndOnce'](_0x56a84b,_0x39ea2a){if(!_0x56a84b)return;const _0x13d473=()=>{_0x39ea2a(),_0x56a84b['removeEventListener']('animationend',_0x13d473),_0x56a84b['removeEventListener']('webkitAnimationEnd',_0x13d473);};_0x56a84b['addEventListener']('animationend',_0x13d473),_0x56a84b['addEventListener']('webkitAnimationEnd',_0x13d473);}['_createLoaderIcon'](){const _0x8a8ad6=new De('small');return _0x8a8ad6['bind']('isVisible')['to'](this,'isLoading',_0x13f3ac=>_0x13f3ac),_0x8a8ad6;}}function jn(_0xabfbc2){if(!_0xabfbc2)return _0xabfbc2;if(_0xabfbc2['length']<=0x78)return _0xabfbc2;const _0x3c240d=_0xabfbc2['slice'](0x0,0x78),_0x33b255=_0x3c240d['lastIndexOf']('\x20');return(_0x33b255>0x0?_0x3c240d['slice'](0x0,_0x33b255):_0x3c240d)+'…';}const dn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},bn='300px';class _o{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x440cd6,_0x514502,_0x3f43a8,_0x5a036e,_0x32bdcc){this['_locale']=_0x440cd6,this['_visibleChips']=_0x514502,this['_config']={...dn,..._0x3f43a8,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x3f43a8['cssClasses']}},this['_overflowChips']=new _0x2afc13(),this['_bodyCollection']=_0x5a036e,this['_parentView']=_0x32bdcc||null;}['setContainerElement'](_0x17fd7e){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x17fd7e,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 _0x403d21=[...this['_visibleChips'],...this['_overflowChips']],_0x391462=this['_createCalculationContainer'](),_0x389b96=this['_calculateOverflowInContainer'](_0x391462,_0x403d21),_0x233059=_0x391462['_ancestorsToRestore'];_0x233059&&this['_restoreAncestorVisibility'](_0x233059),_0x391462['remove'](),this['_applyOverflowResults'](_0x403d21,_0x389b96);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x178524({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x24a90b=new _0x290cbd(this['_locale']);_0x24a90b['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0xd19c96=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0xd19c96['push'](this['_config']['cssClasses']['controlsButton']),_0x24a90b['extendTemplate']({'attributes':{'class':_0xd19c96}}),_0x24a90b;}['_createShowMoreBalloonPanelView'](){const _0x3b9316=new _0x1a6e6e(this['_locale']);return _0x3b9316['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x3b9316),_0x3b9316;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5d9108=>{_0x5d9108['disableAnimationOnEnter']();});const _0x199e35=new _0x3249c4(this['_locale']);_0x199e35['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x199e35);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3cd6ab=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3cd6ab?'':'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'](_0x4a23d9){const _0x27b7f4=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2d8520=this['_containerElement']?.['classList'];if(_0x2d8520){const _0x1207eb=_0x2d8520[0x0]||'',_0x57dbcd=_0x4a23d9['querySelector']('.'+_0x1207eb),_0x571d93=_0x4a23d9['querySelector'](_0x27b7f4);return _0x57dbcd||_0x571d93||_0x4a23d9;}return _0x4a23d9['querySelector'](_0x27b7f4)||_0x4a23d9;}['_calculateContainerWidth'](){const _0x350f63=this['_parentView']?.['element']||this['_containerElement'];if(!_0x350f63)return bn;const _0x17b686=window['getComputedStyle'](_0x350f63)['width'];if('auto'===_0x17b686||'0px'===_0x17b686||!_0x17b686){const _0x5b6d29=_0x350f63['parentElement'];if(_0x5b6d29){const _0x9aa33e=window['getComputedStyle'](_0x5b6d29);return'auto'!==_0x9aa33e['width']?_0x9aa33e['width']:bn;}return bn;}return _0x17b686;}['_applyCalculationStyles'](_0x3788f9,_0x26e821){this['_config']['cssClasses']['calculationContainer']&&_0x3788f9['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x3788f9['style']['width']=_0x26e821,_0x3788f9['style']['position']='absolute',_0x3788f9['style']['top']='-9999px',_0x3788f9['style']['left']='-9999px',_0x3788f9['style']['opacity']='0',_0x3788f9['style']['pointerEvents']='none',_0x3788f9['style']['zIndex']='-1',_0x3788f9['style']['visibility']='visible\x20!important',_0x3788f9['style']['display']='block\x20!important',_0x3788f9['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x5b97c0){_0x5b97c0['forEach'](({element:_0x3745e5,originalDisplay:_0x365ab5,originalVisibility:_0xc4bb2b})=>{_0x3745e5['style']['display']=_0x365ab5,_0x3745e5['style']['visibility']=_0xc4bb2b;});}['_makeAncestorsVisible'](_0x535634){const _0x440922=[];let _0x24ec4a=_0x535634;for(;_0x24ec4a&&_0x24ec4a!==document['body'];){const _0xfed4d4=window['getComputedStyle'](_0x24ec4a);'none'!==_0xfed4d4['display']&&'hidden'!==_0xfed4d4['visibility']||(_0x440922['push']({'element':_0x24ec4a,'originalDisplay':_0x24ec4a['style']['display'],'originalVisibility':_0x24ec4a['style']['visibility']}),_0x24ec4a['style']['display']='block',_0x24ec4a['style']['visibility']='visible'),_0x24ec4a=_0x24ec4a['parentElement'];}return _0x440922;}['_createContainerElements'](){let _0x58054a,_0x566c2f;return this['_parentView']?.['element']?(_0x58054a=this['_parentView']['element']['cloneNode'](!0x0),_0x566c2f=this['_findTargetContainer'](_0x58054a)):(_0x58054a=document['createElement']('div'),_0x566c2f=_0x58054a),{'calculationContainer':_0x58054a,'targetContainer':_0x566c2f};}['_createCalculationContainer'](){const {calculationContainer:_0x3def09,targetContainer:_0x4338dd}=this['_createContainerElements'](),_0x4299b3=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x3def09,_0x4299b3);const _0x47185a=this['_parentView']?.['element']||this['_containerElement'],_0x1b0944=_0x47185a?.['parentElement'];_0x1b0944?_0x1b0944['appendChild'](_0x3def09):document['body']['appendChild'](_0x3def09),_0x3def09['_targetContainer']=_0x4338dd;const _0x4144a2=this['_makeAncestorsVisible'](_0x1b0944||null);return _0x3def09['offsetWidth'],_0x3def09['_ancestorsToRestore']=_0x4144a2,_0x3def09;}['_calculateOverflowInContainer'](_0x117528,_0x1f3d36){const _0x3fcd2e=_0x117528['_targetContainer']||_0x117528,_0x3d442c=[],{rowCount:_0x2919a3}=this['_renderChipsAndCountRows'](_0x3fcd2e,_0x1f3d36);if(_0x2919a3<=this['_config']['maxVisibleRows'])return _0x3d442c;const _0x39a20f=_0x1f3d36['slice']();for(;_0x39a20f['length']>0x0;){if(this['_testButtonFit'](_0x117528,_0x3fcd2e,_0x39a20f)){const _0x5b970e=_0x1f3d36['filter'](_0x1713c8=>!_0x39a20f['includes'](_0x1713c8));_0x3d442c['push'](..._0x5b970e);break;}if(!_0x39a20f['pop']())break;}return _0x3d442c;}['_renderChipsAndCountRows'](_0x4fe359,_0x5667c7){_0x4fe359['innerHTML']='',_0x5667c7['forEach'](_0x230693=>{if(_0x230693['element']){const _0x338d85=_0x230693['element']['cloneNode'](!0x0);_0x4fe359['appendChild'](_0x338d85);}}),_0x4fe359['offsetWidth'];const _0x5346da=_0x4fe359['children'],_0x5aa3c1=[];return Array['from'](_0x5346da)['forEach'](_0x356315=>{const _0x4acf47=_0x356315['getBoundingClientRect']()['top'];_0x5aa3c1['some'](_0x2f9c75=>Math['abs'](_0x2f9c75-_0x4acf47)<this['_config']['rowDetectionTolerance'])||_0x5aa3c1['push'](_0x4acf47);}),{'rowCount':_0x5aa3c1['length']};}['_createMockButton'](){const _0x55fa04=document['createElement']('button');return _0x55fa04['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x55fa04['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x55fa04['textContent']='+\x201',_0x55fa04;}['_testButtonFit'](_0x2bc38a,_0x179c26,_0x4164fa){this['_renderChipsAndCountRows'](_0x179c26,_0x4164fa);const _0x44f91f=this['_createMockButton']();_0x2bc38a['appendChild'](_0x44f91f),_0x2bc38a['offsetWidth'];const _0x4a982c=[..._0x179c26['children'],_0x44f91f],_0x340676=[];_0x4a982c['forEach'](_0x5b07e9=>{const _0x2bb4a2=_0x5b07e9['getBoundingClientRect']()['top'];_0x340676['some'](_0x170f13=>Math['abs'](_0x170f13-_0x2bb4a2)<this['_config']['rowDetectionTolerance'])||_0x340676['push'](_0x2bb4a2);});const _0x4918a5=_0x340676['length'];return _0x44f91f['remove'](),_0x4918a5<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x515a2b,_0x5273dc){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x515a2b['forEach'](_0x4a01e5=>{_0x5273dc['includes'](_0x4a01e5)?this['_overflowChips']['add'](_0x4a01e5):this['_visibleChips']['add'](_0x4a01e5);});}['_updateOverflowUI'](_0x32f724){if(_0x32f724>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x32f724>0x0&&this['_showMoreButtonView']){const _0x55deae=''+this['_config']['showMoreLabelPrefix']+(_0x32f724<0x63?_0x32f724:'99');this['_showMoreButtonView']['label']=_0x55deae;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x19ecaa,_0xeb7e1c){this['_distributeChips'](_0x19ecaa,_0xeb7e1c),this['_updateOverflowUI'](_0xeb7e1c['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x1233b0=>{_0x1233b0[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 _0x36b60b=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x36b60b['width']||0x0===_0x36b60b['height'])return!0x1;const _0x1ea0cb=window['innerHeight']||document['documentElement']['clientHeight'],_0x5b4005=window['innerWidth']||document['documentElement']['clientWidth'],_0x175af5=0xc8;return _0x36b60b['bottom']>=-0xc8&&_0x36b60b['top']<=_0x1ea0cb+_0x175af5&&_0x36b60b['right']>=-0xc8&&_0x36b60b['left']<=_0x5b4005+_0x175af5;}}const ha='ck-ai-chat__feed__context-chips',ca='ck-ai-chat-context-chips-wrapper',la='ck-ai-chat-context-chips-wrapper-balloon',da='ck-ai-chat-controls-button',ua='ck-ai-chat-controls_context_show-more-button',_a='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x3249c4{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x1d6a21,_0x4d705f,_0x9147c9){super(_0x1d6a21),this['_bodyCollection']=_0x9147c9,this['_createContextChips'](_0x4d705f);const _0x2b966b={'cssClasses':{'showMoreButton':ua,'showMoreBalloon':_a,'overflowContainer':la,'controlsButton':da}};this['_overflowManager']=new _o(_0x1d6a21,this['_contextChips'],_0x2b966b,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[ha,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':ca},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x1fb17b=this['element']['querySelector']('.'+ca);_0x1fb17b&&(this['_overflowManager']['setContainerElement'](_0x1fb17b),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x16b032){for(const _0x3cd860 of _0x16b032){const _0xeb60f4=new wo(this['locale'],_0x3cd860,!0x0,!0x1);this['_contextChips']['add'](_0xeb60f4);}}}class Me extends Ir{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x4777cc,_0x317e00,_0x1a6aab){super(_0x317e00),this['_locale']=_0x4777cc,this['_bodyCollection']=_0x1a6aab,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'](_0x3925e9=>!_0x3925e9['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x3249c4(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 Lt extends Ir{['capabilities'];constructor(_0x2c6f9e,_0x400bcb){super(_0x400bcb);const {isWebSearchEnabled:_0x5b1463,isReasoningEnabled:_0x3b4e54}=_0x400bcb['capabilities'],_0x250bf0=[];let _0x575618='';_0x5b1463&&_0x3b4e54?(_0x575618=i(_0x2c6f9e,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x250bf0['push'](aa(_0x51778b)),_0x250bf0['push'](aa(_0x208bf9))):_0x5b1463?(_0x575618=i(_0x2c6f9e,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x250bf0['push'](aa(_0x51778b))):_0x3b4e54&&(_0x575618=i(_0x2c6f9e,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x250bf0['push'](aa(_0x208bf9))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x575618?'':'ck-hidden']}});const _0xe6c3ca=new _0x3249c4();_0xe6c3ca['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x250bf0,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x575618]}]}),this['children']['add'](_0xe6c3ca),this['capabilities']=_0x400bcb['capabilities'];}}function aa(_0x4bcb81){const _0xfbe3ee=new _0xf03b05();return _0xfbe3ee['content']=_0x4bcb81,_0xfbe3ee;}const ms=['wheel','touchstart','pointerdown','keydown'],us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Fe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x277c09){this['element']=_0x277c09,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x1098d6 of ms){const _0x45999b='keydown'!==_0x1098d6;this['element']['addEventListener'](_0x1098d6,this['_onUserEvent']['bind'](this),{'passive':_0x45999b,'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'](_0x2770ab){if(this['isRunning']){if('keydown'===_0x2770ab['type']){const _0xf20a89=_0x2770ab['key'];if(!us['includes'](_0xf20a89))return;}_0x2770ab instanceof WheelEvent?_0x2770ab['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x59152f,scrollHeight:_0x4b49a7,clientHeight:_0x480021}=this['element'];return _0x4b49a7-_0x59152f-_0x480021<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Pe extends _0x3249c4{constructor(_0x211d5d,_0x29f9c3){super(_0x211d5d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x29f9c3)});}['_createSkeletonItems'](_0x223dcd){const _0x44858b=['ck','ck-ai-skeleton__item'];return _0x223dcd['map'](_0xe85b30=>{let _0x1f141c='';switch(_0xe85b30['attributes']['align']){case'right':_0x1f141c='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x1f141c='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x1f141c='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0xe85b30['tag'],'attributes':{'class':[..._0x44858b,_0xe85b30['attributes']['class']?_0xe85b30['attributes']['class']:''],'style':'width:\x20'+_0xe85b30['attributes']['width']+';\x20height:\x20'+_0xe85b30['attributes']['height']+';'+_0x1f141c}};});}}const Be={'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(_0x463787,_0xf84cac,_0x5284bc,_0xfde924){return new Array(_0x463787)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0xf84cac,'height':_0x5284bc,'align':_0xfde924}}));}class ji extends _0x3249c4{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x361872,_0x5ed35a){super(_0x361872),this['_bodyCollection']=_0x5ed35a,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Mt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Fe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x26819d,_0x16269c){let _0xc1f6c6;'ai-reply'===_0x26819d?_0xc1f6c6=new Ve(this['locale'],_0x16269c):'ai-suggestion-reply'===_0x26819d?(_0xc1f6c6=new Le(this['locale'],_0x16269c),_0xc1f6c6['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0xc1f6c6='user-message'===_0x26819d?new Me(this['locale'],_0x16269c,this['_bodyCollection']):'interaction-header'===_0x26819d?new Lt(this['locale'],_0x16269c):new Oe(_0x16269c),this['children']['add'](_0xc1f6c6);}async['updateReplyItem']({id:_0x3a9247,parsedContent:_0x720c0a,renderingStrategy:_0x5dbfc1,abortSignal:_0x3af878}){const _0x2bb1b7=this['getItemById'](_0x3a9247);if(!(_0x2bb1b7 instanceof Ve))throw new _0x2120c6('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x2bb1b7,'id':_0x3a9247,'parsedContent':_0x720c0a});await _0x2bb1b7['updateContent']({'parsedContent':_0x720c0a,'renderingStrategy':_0x5dbfc1,'abortSignal':_0x3af878});}async['updateWebSources'](_0x51922e,_0x44ed4a){const _0x26e8a3=this['getItemById'](_0x51922e);if(_0x26e8a3 instanceof Le)_0x26e8a3['updateSources'](_0x44ed4a);else{if(!(_0x26e8a3 instanceof Ve))throw new _0x2120c6('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x26e8a3,'id':_0x51922e,'sources':_0x44ed4a});_0x26e8a3['updateSources'](_0x44ed4a);}}async['updateSuggestionItem']({id:_0x16f2d3,parts:_0x2bdf77,renderingStrategy:_0x1940dd,abortSignal:_0x4f5702}){const _0x56e16f=this['getItemById'](_0x16f2d3);if(!(_0x56e16f instanceof Le))throw new _0x2120c6('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x56e16f,'id':_0x16f2d3,'parts':_0x2bdf77});await _0x56e16f['updateContent']({'parts':_0x2bdf77,'renderingStrategy':_0x1940dd,'abortSignal':_0x4f5702});}['updateSuggestionPartState']({id:_0x293862,index:_0x494859,state:_0x393b99}){const _0x1fd9c6=this['getItemById'](_0x293862);if(!(_0x1fd9c6 instanceof Le))throw new _0x2120c6('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x293862});_0x1fd9c6['updatePartState'](_0x494859,_0x393b99);}['markItemAsDone'](_0x2789c7){this['getItemById'](_0x2789c7)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0xbd8c9d=>_0xbd8c9d['options']['id']);}['removeItem'](_0x5d8d7d){this['children']['remove'](this['getItemById'](_0x5d8d7d));}['scrollToSuggestion'](_0xb1bf04,_0x583808){const _0x4aa34a=this['getItemById'](_0xb1bf04);if(!(_0x4aa34a instanceof Le))return void _0x218a11('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0xb1bf04,'partIndex':_0x583808});const _0x357b29=_0x4aa34a['getPartView'](_0x583808);_0x357b29?_0x1966fd({'target':_0x357b29['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x218a11('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0xb1bf04,'partIndex':_0x583808});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x3ee862=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x3ee862,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x2c3533=new Pe(this['locale'],Be['aiFeed']);return _0x2c3533['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x2183d4=>!_0x2183d4)]}}),_0x2c3533;}['_createFeedItems'](){const _0x370aba=new _0x3249c4(this['locale']);return _0x370aba['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x370aba;}['_createFeedLoader'](){const _0x10f145=new _0x3249c4(this['locale']);return _0x10f145['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0xf672df=>!_0xf672df)]},'children':this['_createLoaderChildren']()}),_0x10f145;}['_createLoaderChildren'](){const _0x58891b=new De();return _0x58891b['isVisible']=!0x0,[_0x58891b,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x31d4da){const _0x70c337=this['children']['find'](_0x5408b2=>_0x5408b2['options']['id']['includes'](_0x31d4da));if(!_0x70c337)throw new _0x2120c6('ai-chat-feed-view-item-not-found',this,{'id':_0x31d4da});return _0x70c337;}['setLoadingMessage'](_0x47742b){this['set']('loadingMessage',_0x47742b);}['toggleLoadingSkeleton'](_0x3640e0){this['set']('isLoadingSkeletonVisible',_0x3640e0);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Br extends _0x36c9a6{['filter'](){let _0x127c85=0x0;for(const _0x3fdfab of this['items'])_0x127c85+=_0x3fdfab['items']['length'];return{'resultsCount':_0x127c85,'totalItemsCount':_0x127c85};}}class ps extends _0xa69052{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x553b9d,_0x300954){super(_0x553b9d,{'queryView':{'label':'','creator':_0x227b28,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Br(_0x553b9d),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x300954,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ps['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ps['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',(_0x330ed4,_0x56a291)=>!_0x330ed4&&!_0x56a291),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5c6942,_0x512ea2)=>{this['isUploadInProgress']||this['isEmpty']||_0x5c6942['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x512ea2());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xcf6849=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xcf6849)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x3698c0=_0x3739ad(_0xcf6849);this['fire']('sendUserMessage',_0x3698c0),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0xa749ca){this['queryView']['fieldView']['set']('placeholder',_0xa749ca);}['_createSubmitButton'](){const _0x519e01=new _0x290cbd(this['locale']);return _0x519e01['set']({'icon':_0x55a39b,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x519e01['on']('execute',()=>{this['submit']();}),_0x519e01;}['setIsUploadInProgress'](_0x340bf5){this['isUploadInProgress']=_0x340bf5;}['_setUpAddContextButtonPositioning'](){const _0x2a327f=this['locale'],_0x2f59f8=()=>{_0x31e929['window']['requestAnimationFrame'](()=>{if(_0x2148f8(this['element'])){const _0x1f8535=new _0x11a5d6(this['queryView']['fieldView']['element']),_0x468459=new _0x11a5d6(this['_addContextButtonView']['element']),_0x26eee4=_0x1f8535['width'],_0x17d0a6='rtl'===_0x2a327f['uiLanguageDirection']?'right':'left';_0x1f8535['excludeScrollbarsAndBorders']();const _0x1b7c76=_0x26eee4-_0x1f8535['width']+0x1;this['_addContextButtonView']['element']['style'][_0x17d0a6]='calc('+(_0x26eee4-_0x468459['width']-_0x1b7c76)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x2f59f8),this['on']('render',()=>{_0x2f59f8(),this['_queryViewResizeObserver']=new _0x2db29b(this['queryView']['fieldView']['element'],()=>{_0x2f59f8();});});}}const Ia='ck-ai-chat__prompt-capabilities',Aa='ck-ai-chat-controls-button',ga='ck-ai-chat-controls-button--commands',Ea='ck-ai-chat-controls__model-selection',ma='ck-ai-chat-controls__model-selection__item-name',pa='ck-ai-chat-controls__model-selection__item-description',Ta='ck-ai-chat-controls__model-selection__item-capabilities',Ca='n';class bs extends _0x3249c4{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x1489c5){super(_0x1489c5),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',_0x4e84a7=>_0x4e84a7),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x2a811c=>_0x2a811c?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x5cab74=>_0x5cab74),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x4ccde6=>_0x4ccde6),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x49f584=>!_0x49f584),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x3c8606=>i(this['locale'],_0x3c8606?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x369f14=>_0x369f14),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x2e6009=>!_0x2e6009),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x7e7a4c=>i(this['locale'],_0x7e7a4c?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Ia]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x2afc13(),_0x710699(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x3f0358,_0x4a9f81){if(this['set']('modelSelectorVisible',!(_0x4a9f81&&_0x3f0358['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x3f0358?.['length']){const _0x17aea3=ni['getLocalized'](this['locale'],_0x3f0358);for(const _0x5ad79c of _0x17aea3){const _0x31fa0c=new _0x32dcb3({'label':_0x5ad79c['name'],'withText':!0x0,'role':'menuitemradio','id':_0x5ad79c['id'],'model':_0x5ad79c});_0x31fa0c['bind']('isOn')['to'](this,'activeModelId',_0x140923=>_0x140923===_0x5ad79c['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x31fa0c,'labelView':new wa(this['locale'],_0x5ad79c)});}}}['setWebSearch'](_0x46e74c){this['set']('webSearchActive',_0x46e74c);}['setReasoning'](_0x7621ae){this['set']('reasoningActive',_0x7621ae);}['setModel'](_0x1eba71){if(!_0x1eba71)return;this['activeModelId']=_0x1eba71['id'],this['activeModelName']=_0x1eba71['name']||_0x1eba71['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x1eba71['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x1eba71['name']);const _0x502f9c=_0x1eba71['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x502f9c),this['_webSearchButton']['set']('isVisible',_0x502f9c);const _0x1ffd30=_0x1eba71['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x1ffd30),this['_reasoningButton']['set']('isVisible',_0x1ffd30);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x2182ae){this['set']('modelSelectorEnabled',!0x1),_0x2182ae&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x223785=new _0x290cbd();return _0x223785['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x51778b,'class':Aa,'isToggleable':!0x0,'tooltipPosition':Ca}),_0x223785['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x223785;}['_createReasoningButton'](){const _0x16e957=new _0x290cbd();return _0x16e957['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x208bf9,'class':Aa,'isToggleable':!0x0,'tooltipPosition':Ca}),_0x16e957['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x16e957;}['_createCommandsButton'](){const _0x41fdad=new _0x290cbd();return _0x41fdad['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':Ot,'withText':!0x0,'class':Aa,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ca}),_0x41fdad['extendTemplate']({'attributes':{'class':[ga]}}),_0x41fdad['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x41fdad;}['_createModelSelectionDropdown'](){const _0x54726c=_0x1bd241(this['locale']);return _0x54726c['set']({'panelPosition':'ne','class':[Ea]}),_0x54726c['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ca}),this['listenTo'](_0x54726c,'execute',_0x2745c7=>{this['fire']('selectModel',_0x2745c7['source']['model']);}),_0x54726c;}['_createModelNameView'](){const _0x4003fb=new Ko(this['locale']);return _0x4003fb['bind']('text')['to'](this,'activeModelName',_0x165b21=>_0x165b21??''),_0x4003fb['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x15befe,_0x569f21)=>!_0x15befe&&!_0x569f21?.['toLowerCase']()['startsWith']('agent')),_0x4003fb;}}let wa=class extends _0x366752{constructor(_0x434a8b,_0x3a8412){super();const _0x21b5fe=this['bindTemplate'],_0x1ba423=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x21b5fe['to']('style'),'id':_0x21b5fe['to']('id')},'children':[{'tag':'div','attributes':{'class':[ma]},'children':[{'text':_0x21b5fe['to']('text')}]},{'tag':'div','attributes':{'class':[pa]},'children':[{'tag':'span','children':[{'text':_0x3a8412['description']}]}]},{'tag':'div','attributes':{'class':[Ta]},'children':_0x1ba423}]}),_0x1ba423['addMany'](this['_getCapabilityParts'](_0x434a8b,_0x51778b,'AI_CHAT_SEARCH_WEB',_0x3a8412['capabilities']['webSearch']?.['enabled']??!0x1)),_0x1ba423['addMany'](this['_getCapabilityParts'](_0x434a8b,_0x208bf9,'AI_CHAT_REASONING',_0x3a8412['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x4e681a,_0x238aa1,_0x113c67,_0x270c8c){const _0x557d8d=new _0xf03b05();_0x557d8d['content']=_0x238aa1;const _0xd9cfa9=new _0x3249c4(_0x4e681a);_0xd9cfa9['setTemplate']({'tag':'span','children':[{'text':i(_0x4e681a,_0x113c67)+':\x20'}]});const _0x472278=new _0x3249c4(_0x4e681a);return _0x472278['setTemplate']({'tag':'span','children':[{'text':i(_0x4e681a,_0x270c8c?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x557d8d,_0xd9cfa9,_0x472278];}};class Ko extends _0x3249c4{constructor(_0xbd3cf6){super(_0xbd3cf6),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x2d53b9=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x2d53b9['if']('isVisible','ck-hidden',_0x11a6ab=>!_0x11a6ab)]},'children':[{'text':_0x2d53b9['to']('text')}]});}}const fa='ck-ai-chat-context-controls__url-form',Sa='ck-ai-chat-context-controls__url-input-section';class Io extends _0x3249c4{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x1f0dfb){super(_0x1f0dfb),this['focusTracker']=new _0x51df1c(),this['keystrokes']=new _0x3116d1(),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 _0x504985({'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'](_0x8ff78=>{this['focusTracker']['add'](_0x8ff78['element']),this['keystrokes']['listenTo'](_0x8ff78['element']);}),_0x25650d({'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'](_0x2dc9e7){this['urlInputField']['errorText']=_0x2dc9e7,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x18bcad=new _0x290cbd(this['locale']);return _0x18bcad['set']({'icon':_0x2c7390,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x18bcad;}['_createUrlInputField'](){const _0xaec0f=new _0x12f7b2(this['locale'],_0x30f559);return _0xaec0f['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0xaec0f['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0xaec0f;}['_createConfirmButton'](){const _0x80babd=new _0x290cbd(this['locale']);return _0x80babd['set']({'icon':_0x576672,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x80babd;}['_setupTemplate'](){const _0x52a83d=new _0x4aec09(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x52a83d['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':fa,'tabindex':'-1'},'children':[_0x52a83d,{'tag':'div','attributes':{'class':Sa},'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',_0x1d6d75=>{_0x1d6d75['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x184b67,_0x39b449)=>{this['clear'](),this['fire']('cancel'),_0x39b449();});}['_handleSubmit'](){const _0x59f2c1=this['getValue']()['trim']();_0x59f2c1?this['_isValidUrl'](_0x59f2c1)?(this['clearError'](),this['fire']('submitUrl',_0x59f2c1)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x56b96a=this['getValue']()['trim'](),_0x1ac692=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x56b96a['length']>0x0&&!_0x1ac692;}['_isValidUrl'](_0xbe62db){try{return!!new URL(_0xbe62db);}catch{return!0x1;}}}const Oa='ck-ai-chat-resources__item',Ra='ck-ai-chat-resources__item--in-context',ba='ck-ai-chat-resources__item-title',Na='ck-ai-chat-resources__item__icon';class tc extends _0x36570a{['resource'];['_titleView'];['_iconView'];constructor(_0x555598,_0x23f145){super(_0x555598),this['resource']=_0x23f145,this['set']('isInContext',!!_0x23f145['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x3bba29){if(_0x3bba29['isInContext'])return _0x576672;switch(_0x3bba29['type']){case Ie['DOCUMENT']:return _0x4aad50;case Ie['URL']:return _0x482077;case Ie['FILE']:case Ie['TEXT']:return _0x2ceb48;default:return _0x369ba5;}}['highlightText'](_0x1498dc){if(!_0x1498dc||''===_0x1498dc['trim']())return void this['_titleView']['highlightText'](null);const _0x4a00aa=new RegExp(_0xc3d813(_0x1498dc),'gi');this['_titleView']['highlightText'](_0x4a00aa);}['updateResourceState'](_0x379b7b){this['resource']['isInContext']=_0x379b7b,this['isInContext']=_0x379b7b,this['_updateIcon']();}['_createTitleView'](){const _0x2ca354=new _0x1e2340();return _0x2ca354['text']=this['resource']['label'],_0x2ca354['extendTemplate']({'tag':'span','attributes':{'class':[ba]}}),_0x2ca354;}['_createIconView'](){const _0x3ba15b=new _0xf03b05();return _0x3ba15b['content']=this['getResourceIcon'](this['resource']),_0x3ba15b;}['_setupTemplate'](){const _0x4955af=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Oa,_0x4955af['if']('isVisible','ck-hidden',_0x3f00dc=>!_0x3f00dc),_0x4955af['if']('isInContext',Ra)]},'children':[{'tag':'div','attributes':{'class':[Na]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x4955af['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const ka='ck-ai-chat-resources__list';class Rr extends _0x36c9a6{['_source'];constructor(_0x3167ae,_0x1ef525){super(_0x3167ae),this['_source']=_0x1ef525,this['extendTemplate']({'attributes':{'class':[ka]}});}['setResources'](_0xb044f9,_0x74e33){this['items']['clear']();let _0x26fe7d=_0xb044f9;if(this['_source']['useDefaultFiltering']&&_0x74e33&&''!==_0x74e33['trim']()){const _0xb33771=new RegExp(_0x74e33['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x26fe7d=_0xb044f9['filter'](_0x7b3cba=>_0xb33771['test'](_0x7b3cba['label']));}for(const _0x521824 of _0x26fe7d){const _0x50a912=new tc(this['locale'],_0x521824);_0x50a912['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x521824);}),this['items']['add'](_0x50a912);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x74e33);}['highlightText'](_0x3ca317){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x3dec07=>{_0x3dec07['highlightText'](_0x3ca317);});}['updateResourceState'](_0x5f17aa,_0x4ca328){for(const _0x4a4b8d of this['items']){const _0xc3b221=_0x4a4b8d;_0xc3b221['resource']['id']===_0x5f17aa&&_0xc3b221['updateResourceState'](_0x4ca328);}}['_handleResourceSelection'](_0x955878,_0x51b5ec){this['fire']('addResourceToContext',{'source':_0x955878,'resource':_0x51b5ec});}}class qr extends _0x12f7b2{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x572ed1){const t=_0x572ed1['t'],_0x93c93b={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x30f559,'label':i(_0x572ed1,'AI_CHAT_SEARCH_RESOURCES')};super(_0x572ed1,_0x93c93b['creator']),this['label']=_0x93c93b['label'],this['_viewConfig']=_0x93c93b,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x572ed1,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x15267c){this['fire']('search',_0x15267c);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0xf03b05(),this['iconView']['content']=_0x2fb97a,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x2d9e84,t){this['resetButtonView']=new _0x290cbd(_0x2d9e84),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x1c533a,'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',_0x53adac=>!_0x53adac),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 _0x3249c4{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x619908,_0x1c7d8c){super(_0x619908),this['_source']=_0x1c7d8c['source'],this['_searchInputVisibleFrom']=_0x1c7d8c['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 _0x33c41f([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 _0x29a6e7=new _0x3249c4(this['locale']);return _0x29a6e7['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x35aa10,_0x250ad5)=>{this['loadResources'](_0x250ad5),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x250ad5);}),_0x29a6e7;}['_createResourcesListView'](){const _0xb480c=new Rr(this['locale'],this['_source']);return _0xb480c['delegate']('addResourceToContext')['to'](this),_0xb480c['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0xb480c;}['_createSkeletonView'](){const _0x35fd66=new Pe(this['locale'],Be['aiChatResources']);return _0x35fd66['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xa106f=>!_0xa106f)]}}),_0x35fd66;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x335f50){const _0x534e09=_0x1a633f();this['_latestLoadResourcesUid']=_0x534e09,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x335f50,'uid':_0x534e09}),this['isLoading']=!0x0;}['setResources'](_0x50398b,_0x20f54a){if(_0x20f54a&&_0x20f54a!==this['_latestLoadResourcesUid'])return;const _0x309f23=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x50398b,_0x309f23),_0x50398b['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0xb3192b,_0x1272ad){this['_resourcesListView']['updateResourceState'](_0xb3192b,_0x1272ad);}}const ya='ck-ai-chat-context-controls__source-balloon-panel',va='ck-button-icon\x20ck-button-back',xa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x35aefa,_0x5dc268,_0x2c396f){this['_locale']=_0x35aefa,this['_bodyCollection']=_0x5dc268,this['_config']=_0x2c396f;}['showSourceResourcesBalloon'](_0x277cea){let _0x3033f5=this['_sourceResourceBalloons']['get'](_0x277cea['id']);_0x3033f5||(_0x3033f5=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x277cea['id'],_0x3033f5),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x3033f5)),this['_addSourceResourceContent'](_0x3033f5,_0x277cea),_0x3033f5['show']();const _0x4234f1=this['_config']['getTargetElement']();_0x4234f1&&_0x3033f5['pin']({'target':_0x4234f1,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x4e7282,_0x49a4bb,_0x4dd9c4){const _0x12f20e=this['_sourceResourceBalloons']['get'](_0x4e7282);if(!_0x12f20e)return;const _0xf2273b=this['_getResourcesViewFromBalloon'](_0x12f20e);_0xf2273b&&(_0xf2273b['setResources'](_0x49a4bb,_0x4dd9c4),_0xf2273b['once']('change:isLoading',()=>{_0x12f20e['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x13782e){const _0xf67fb=this['_sourceResourceBalloons']['get'](_0x13782e);_0xf67fb&&requestAnimationFrame(()=>{_0xf67fb['hide'](),this['_sourceResourceBalloons']['delete'](_0x13782e),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x1f5e3e of this['_sourceResourceBalloons']['values']())if(_0x1f5e3e['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x448e41,_0x230790,_0x27298b){const _0x3e527b=this['_sourceResourceBalloons']['get'](_0x448e41);if(!_0x3e527b||!_0x3e527b['isVisible'])return;const _0x1c511d=this['_config']['getTargetElement']();if(!_0x1c511d)return;_0x3e527b['pin']({'target':_0x1c511d,'limiter':this['_config']['getLimiterElement']()});const _0x408f6e=this['_getResourcesViewFromBalloon'](_0x3e527b);_0x408f6e&&_0x408f6e['updateResourceState'](_0x230790,_0x27298b);}['destroy'](){for(const _0x4e74fa of this['_sourceResourceBalloons']['values']())_0x4e74fa['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x5b38e5=new _0x1a6e6e(this['_locale']);return _0x5b38e5['extendTemplate']({'attributes':{'class':ya}}),this['_bodyCollection']['add'](_0x5b38e5),_0x5b38e5;}['_addSourceResourceContent'](_0x53ee3d,_0x27f6c3){_0x53ee3d['content']['clear']();const _0x5351e1=this['_createBalloonHeader'](_0x53ee3d,_0x27f6c3);_0x53ee3d['content']['add'](_0x5351e1);const _0x3af019=this['_createBalloonResourcesView'](_0x27f6c3);_0x53ee3d['content']['add'](_0x3af019);}['_createBalloonHeader'](_0x42a4c4,_0xa45294){const _0x2e4c78=this['_createBackButton'](_0x42a4c4),_0x1d02b5=new _0x4aec09(this['_locale'],{'label':_0xa45294['label'],'class':xa});return _0x1d02b5['children']['add'](_0x2e4c78,0x0),_0x1d02b5;}['_createBackButton'](_0xa2501d){const _0x4c7406=new _0x290cbd(this['_locale']);return _0x4c7406['set']({'icon':_0x2c7390,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':va}),_0x4c7406['on']('execute',()=>{_0xa2501d['hide'](),this['_config']['onBackToContext']();}),_0x4c7406;}['_createBalloonResourcesView'](_0x405c81){const _0x2db298=new Or(this['_locale'],{'source':_0x405c81,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x2db298['on']('loadSourceResources',(_0x1f8e2b,_0x49a6fe)=>{this['_config']['onLoadSourceResources'](_0x49a6fe);}),_0x2db298['on']('addResourceToContext',(_0x12794c,_0x19792d)=>{this['_config']['onResourceSelected'](_0x19792d['source'],_0x19792d['resource']),this['closeSourceResourceBalloon'](_0x405c81['id']);}),_0x2db298;}['_getResourcesViewFromBalloon'](_0x1076df){const _0x186862=_0x1076df['content']['get'](0x1);return _0x186862 instanceof Or?_0x186862:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x1657ad){_0x178524({'emitter':_0x1657ad,'contextElements':[_0x1657ad['element']],'callback':()=>{_0x1657ad['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x1657ad['isVisible']});}}const _s=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],Ro='ck-ai-chat-context-controls',Uo='ck-ai-chat-context-controls__pending-contexts',Lo='ck-ai-chat-context-controls__add-context-balloon-panel',No='ck-ai-chat-context-controls__add-context-button',Oo='ck-ai-chat-context-controls__url-balloon-panel',Mo='ck-ai-chat-context-controls__balloon-button',Ho='ck-ai-chat-context-controls__balloon-button-source',bo='ck-ai-chat-controls-button',Fo='ck-ai-chat-context-chips-wrapper-balloon',vo='ck-ai-chat-controls_context_show-more-button',jo='ck-ai-chat-context-controls__show-more-balloon-panel',Xo='ck-ai-chat',Do=[_0x1a6e6e['defaultPositions']['northArrowSouthWest'],_0x1a6e6e['defaultPositions']['northArrowSouth'],_0x1a6e6e['defaultPositions']['northArrowSouthEast'],_0x1a6e6e['defaultPositions']['southArrowNorthWest'],_0x1a6e6e['defaultPositions']['southArrowNorth'],_0x1a6e6e['defaultPositions']['southArrowNorthEast']];class gs extends _0x3249c4{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x417e85,_0x206f9c){super(_0x417e85),this['bodyCollection']=_0x206f9c['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x417e85),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x417e85),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x417e85),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x417e85,_0x206f9c);const _0x5ab375={'cssClasses':{'showMoreButton':vo,'showMoreBalloon':jo,'overflowContainer':Fo,'controlsButton':bo}};this['_overflowManager']=new _o(_0x417e85,this['_currentContextsChips'],_0x5ab375,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'](_0x5f157a,_0x26ef20){const _0x48887e=this['_createContextButton'](_0x5f157a,'current',!0x0,_0x26ef20);this['_addContextToCollection'](_0x48887e,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x469c32){this['_removeContextFromCollection'](_0x469c32,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x469c32,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x590bb2,_0x213c30){let _0x4cd122=this['_currentContextsChips']['find'](_0x5f24fc=>_0x5f24fc['id']===_0x590bb2);_0x4cd122||(_0x4cd122=this['_overflowManager']['overflowChips']['find'](_0xf428e3=>_0xf428e3['id']===_0x590bb2)),_0x4cd122&&(_0x4cd122['isLoading']=_0x213c30);}['setConversationContext'](_0x48edd9){this['_conversationContextsChips']['clear']();for(const _0x175850 of _0x48edd9){const _0x1af333=this['_createContextButton'](_0x175850,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x1af333,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x146f6a,_0x2b7143,_0x323bec){this['_resourcesBalloonView']['updateResourceState'](_0x146f6a,_0x2b7143,_0x323bec);}['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'](_0x24a311){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x24a311),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x3e6e7e,_0x2f0bbe,_0x4c1c11,_0x39e691){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x3e6e7e,_0x4c1c11,_0x39e691);}['closeSourceResourceBalloon'](_0xa646f0){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0xa646f0),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x208591){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x208591),this['_setAddContextButtonEnabled'](_0x208591);}['_setAddContextButtonEnabled'](_0x41d98b){const _0x41129e=!_0x41d98b['document']['isHidden']&&_0x41d98b['document']['enabled'],_0x578fa4=_0x41d98b['urls']['enabled'],_0x59ac1c=_0x41d98b['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x41129e||_0x578fa4||_0x59ac1c;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Ro,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Uo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x144024){const _0x31d6a6=new _0x290cbd(_0x144024);return _0x31d6a6['set']({'label':i(_0x144024,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':bo+'\x20'+No,'icon':_0x5b5f77,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x31d6a6;}['_createAddContextBalloonPanelView'](_0x15f6de){return this['_createBaseBalloonPanel'](_0x15f6de,Lo);}['_createUrlBalloonPanelView'](_0x175b18){const _0x2224c7=this['_createBaseBalloonPanel'](_0x175b18,Oo);return this['_addUrlContent'](_0x2224c7,_0x175b18),_0x2224c7;}['_createResourcesBalloonView'](_0x5b9a9c,_0x127006){const _0x4b9e65={'searchInputVisibleFrom':_0x127006['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Do});},'onResourceSelected':(_0xee2440,_0x16a39f)=>{this['fire']('addResourceToContext',{'source':_0xee2440,'resource':_0x16a39f});},'onLoadSourceResources':_0x33958e=>{this['fire']('loadSourceResources',_0x33958e);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Po(_0x5b9a9c,_0x127006['bodyCollection'],_0x4b9e65);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Xo)||document['body'];}['_createBaseBalloonPanel'](_0x222b9d,_0x42203e){const _0x33a50e=new _0x1a6e6e(_0x222b9d);return _0x33a50e['extendTemplate']({'attributes':{'class':_0x42203e}}),this['bodyCollection']['add'](_0x33a50e),_0x33a50e;}['_setBalloonPanelContent'](_0x1689da,_0x214dea,_0x34bb41){if(_0x1689da['content']['clear'](),!_0x34bb41['document']['isHidden']&&_0x34bb41['document']['enabled']){const _0x3c084a=this['_createBalloonButton'](_0x214dea,{'label':i(_0x214dea,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x4aad50});_0x3c084a['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x1689da['content']['add'](_0x3c084a);}if(_0x34bb41['urls']['enabled']){const _0x1af2ce=this['_createBalloonButton'](_0x214dea,{'label':i(_0x214dea,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x482077});_0x1af2ce['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Do}),this['_urlInputView']['focus']();}),_0x1689da['content']['add'](_0x1af2ce);}if(_0x34bb41['files']['enabled']){const _0x2907fe=new _0x685a49(_0x214dea);_0x2907fe['set']({'label':i(_0x214dea,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x5d443a,'withText':!0x0,'tooltip':!0x0,'class':Mo,'allowMultipleFiles':!0x0}),_0x2907fe['on']('done',(_0x146d3c,_0x1852d5)=>{this['fire']('addFileToContext',_0x1852d5),this['hideAddContextBalloonPanel']();}),_0x2907fe['tooltip']=!0x0,_0x1689da['content']['add'](_0x2907fe);}for(const _0x2e7f54 of _0x34bb41['sources']){const _0x38d5b7=this['_createBalloonButton'](_0x214dea,{'label':_0x2e7f54['label'],'icon':_0x2e7f54['icon']||_0x369ba5,'type':'source'});_0x1689da['content']['add'](_0x38d5b7),_0x38d5b7['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x2e7f54);});}}['_addUrlContent'](_0x1b9884,_0x262089){this['_urlInputView']=new Io(_0x262089),this['_urlInputView']['on']('submitUrl',(_0x3cd46a,_0x4add10)=>{this['_handleUrlSubmit'](_0x4add10);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Do});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Do});}),_0x1b9884['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x40ac38,_0x46c881){const _0x1ca450='source'===_0x46c881['type']?new La(_0x40ac38):new _0x290cbd(_0x40ac38);return _0x1ca450['set']({'label':_0x46c881['label'],'icon':_0x46c881['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mo}),_0x1ca450;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x178524({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0xfc8441){const _0x352b0f=this['_addContextBalloonConfig'];_0x352b0f['buttonView']['isOn']=_0xfc8441,_0xfc8441?_0x352b0f['balloonView']['show']():_0x352b0f['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x10ffc0,buttonView:_0x28f80f,hideMethod:_0x2d695b}=this['_addContextBalloonConfig'];_0x178524({'emitter':_0x10ffc0,'contextElements':[_0x10ffc0['element'],_0x28f80f['element']],'callback':()=>{_0x2d695b();},'activator':()=>_0x28f80f['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x583fa3,_0x11eccf,_0x938f44=!0x1,_0x5c77d6=!0x1){const _0x4c5e73='conversation'===_0x11eccf||!0x0===_0x583fa3['isReadOnly'],_0x99f9cf=new wo(this['locale'],_0x583fa3,_0x4c5e73,_0x938f44,_0x5c77d6);return _0x4c5e73||_0x99f9cf['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x99f9cf['id']);}),_0x99f9cf;}['_addContextToCollection'](_0xafd2ee,_0x574d40){_0x574d40['add'](_0xafd2ee,0x0);}['_removeContextFromCollection'](_0x3280f1,_0x2b0b0a){const _0x46c654=_0x2b0b0a['find'](_0x5b580c=>_0x5b580c['id']===_0x3280f1);_0x46c654&&_0x2b0b0a['remove'](_0x46c654);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Do}));}['_handleUrlSubmit'](_0x4038ba){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x4038ba);}}class La extends _0x290cbd{['arrowView'];constructor(_0x14d7fa){super(_0x14d7fa),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ho]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x33c6f9=new _0xf03b05();return _0x33c6f9['content']=_0x43b007,_0x33c6f9['extendTemplate']({'attributes':{'class':Ho+'__arrow'}}),_0x33c6f9;}}class ws extends _0x3249c4{['_cancelButtonView'];['_loaderView'];constructor(_0x4766b3){super(_0x4766b3),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 _0x55546c=new _0x290cbd(this['locale']);return _0x55546c['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x31e03f}),_0x55546c['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x55546c;}['_createLoaderView'](){const _0x36f4bc=new _0x3249c4(this['locale']);return _0x36f4bc['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':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x36f4bc;}}class ki extends _0x3249c4{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x3801a2,_0x5d31ba){super(_0x3801a2),this['_contextPanelView']=this['_createContextPanelView'](_0x3801a2,{'bodyCollection':_0x5d31ba['bodyCollection'],'searchInputVisibleFrom':_0x5d31ba['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x3801a2),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x3801a2),this['_loaderView']=this['_createLoaderView'](_0x3801a2),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x3801a2),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'](..._s)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x5a2950=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x5a2950['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x5a2950['if']('isLoading','ck-hidden',_0x2dfe4e=>_0x2dfe4e||!this['isModelAvailable']),_0x5a2950['if']('isModelAvailable','ck-hidden',_0x1e9af6=>!_0x1e9af6||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x5a2950['if']('isLoading','ck-hidden',_0x1d104b=>!_0x1d104b)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x5a2950['if']('isModelAvailable','ck-hidden',_0x2cde1e=>_0x2cde1e)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x178524({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0xd22419,_0x25d6ce){return new gs(_0xd22419,_0x25d6ce);}['_createPromptInputView'](_0x548b55){return new ps(_0x548b55,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x4ff3b5){return new bs(_0x4ff3b5);}['_createLoaderView'](_0x251a74){return new ws(_0x251a74);}['_createModelUnavailableMessageView'](_0x4ee3ac){const _0x47c739=new vs(_0x4ee3ac);return _0x47c739['delegate']('startConversation')['to'](this),_0x47c739;}['_handlePromptInputFocus'](_0x3c0547,_0x1e8547,_0xe0b189){_0xe0b189?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x111af3,_0x4c2ae9){this['_contextPanelView']['addContextItem'](_0x111af3,_0x4c2ae9);}['removeContextItem'](_0x51443b){this['_contextPanelView']['removeContextItem'](_0x51443b);}['setContextItemLoading'](_0x1fad4e,_0x5c39c6){this['_contextPanelView']['setContextItemLoading'](_0x1fad4e,_0x5c39c6);}['setIsUploadInProgress'](_0x2efd17){this['_promptInputView']['setIsUploadInProgress'](_0x2efd17);}['setConversationContext'](_0x543f17){this['_contextPanelView']['setConversationContext'](_0x543f17);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x453c4a,_0x43c352,_0x10e548){this['_contextPanelView']['updateResourceState'](_0x453c4a,_0x43c352,_0x10e548);}['setWebSearch'](_0x191b97){this['_promptCapabilitiesView']['setWebSearch'](_0x191b97);}['setReasoning'](_0x3e9145){this['_promptCapabilitiesView']['setReasoning'](_0x3e9145);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x2d040d){this['_contextPanelView']['setAddContextOptions'](_0x2d040d);}['setInputPlaceholder'](_0x1a69fb){this['_promptInputView']['setPlaceholderText'](_0x1a69fb);}['setModelList'](_0x179900,_0x3c2131){this['_displayedModels']=_0x179900,this['_promptCapabilitiesView']['setModelList'](_0x179900,_0x3c2131);}['setModel'](_0x199d6e){(_0x199d6e?this['_displayedModels']['find'](_0x2b1cbd=>_0x2b1cbd['id']===_0x199d6e['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x199d6e)):_0x199d6e?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x298229){this['_promptCapabilitiesView']['disableModelSelector'](_0x298229);}['populateSourceResourceBalloon'](_0x4a1fde,_0x6f21fd,_0x2267ec,_0xa68b44){this['_contextPanelView']['populateSourceResourceBalloon'](_0x4a1fde,_0x6f21fd,_0x2267ec,_0xa68b44);}['closeSourceResourceBalloon'](_0x40c6da){this['_contextPanelView']['closeSourceResourceBalloon'](_0x40c6da);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class vs extends _0x3249c4{constructor(_0x9ae59c){super(_0x9ae59c);const _0x8ed7e6=new _0x290cbd(_0x9ae59c);_0x8ed7e6['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x8ed7e6['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x8ed7e6]}]});}}class bi extends _0x4aec09{['conversationStartButton'];['resizeButton'];constructor(_0x16e298,_0x161ed6){super(_0x16e298,{'label':i(_0x16e298,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Ht}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x16e298),this['children']['add'](this['conversationStartButton']),_0x161ed6&&(this['resizeButton']=ks(_0x16e298,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x25a7a3){const _0x45ce2f=new _0x290cbd(_0x25a7a3);return _0x45ce2f['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1294ec,'class':'ck-ai-chat__start-conversation'}),_0x45ce2f['on']('execute',()=>{this['fire']('startConversation');}),_0x45ce2f;}}class xi extends _0x3249c4{constructor(_0x213ac3){super(_0x213ac3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x213ac3,'AI_DISCLAIMER_TEXT')}]}]});}}class bt extends _0x3249c4{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x3ebcd9,_0x2715db){super(_0x3ebcd9),this['_bodyCollection']=new _0x52097e(_0x3ebcd9),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new bi(_0x3ebcd9,_0x2715db['showResizeButton']),this['chatHeader']['delegate'](...Mt)['to'](this),this['chatFeed']=new ji(_0x3ebcd9,this['_bodyCollection']),this['chatFeed']['delegate'](...Mt)['to'](this),this['chatControls']=new ki(_0x3ebcd9,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x2715db['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Mt)['to'](this),this['chatDisclaimer']=new xi(_0x3ebcd9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x3ebcd9['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x282319,_0x52e6b5,_0x4d5877,_0x2404e1){this['chatControls']['populateSourceResourceBalloon'](_0x282319,_0x52e6b5,_0x4d5877,_0x2404e1);}['closeSourceResourceBalloon'](_0x1862b4){this['chatControls']['closeSourceResourceBalloon'](_0x1862b4);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class dt extends _0x3e59e0{static get['requires'](){return[Ct];}['_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(_0x314631){super(_0x314631);const _0x3b6853=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new st(),this['_view']=new bt(this['context']['locale'],{'showResizeButton':_0x3b6853['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Mt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x2a5c40,{showDiff:_0x4d50b4})=>{this['showDiff']=_0x4d50b4;}),_0x3b6853['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x6eb7e6=>_0x6eb7e6),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0xb1fd6=>_0xb1fd6),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x52f35d){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x52f35d['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x550376,staticMessage:_0x252907}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x550376,'initialContent':'<p>'+_0x252907+'</p>'});}['addFeedItemUserMessage'](_0x47dce7){const _0x414433=_0x47dce7['quickActionData']?.['displayedPrompt']||_0x47dce7['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x47dce7['contextItems']['values']()),'initialContent':'<p>'+_0x414433+'</p>','id':_0x47dce7['id']});}['addFeedItemError']({errorMessage:_0x4e1c89,id:_0x518be1}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x4e1c89+'</p>','id':_0x518be1});}['addFeedItemAIReply'](_0x5aa188){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x5aa188['interactionId']+':'+_0x5aa188['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x566fd7){const _0x48e3ce=q(this['context']);let _0x4ad1a5=_0x48e3ce['config']['get']('ai.availableReplyActions')||[...H];if(_0x48e3ce['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x59485a=_0x48e3ce['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x59485a,'value');}}else _0x4ad1a5=_0x4ad1a5['filter'](_0x10b90d=>'insertSuggestion'!=_0x10b90d);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x566fd7['interactionId']+':'+_0x566fd7['id'],'areActionsDisabled':_0x566fd7['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x4ad1a5}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x37d98d,_0x13901e){const _0x14fdcc=this['_view']['chatFeed']['children']['last'];if(_0x14fdcc instanceof Lt)return this['_view']['chatFeed']['children']['remove'](_0x14fdcc),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x37d98d['id'],'capabilities':{'isWebSearchEnabled':_0x14fdcc['capabilities']['isWebSearchEnabled']||_0x13901e['isWebSearchEnabled'],'isReasoningEnabled':_0x14fdcc['capabilities']['isReasoningEnabled']||_0x13901e['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x37d98d['id'],'capabilities':_0x13901e});}['updateFeedInteractionHeader'](_0x1e69cd){const _0x3bc9d3=this['_view']['chatFeed']['children']['find'](_0xf3991f=>_0xf3991f['options']['id']==_0x1e69cd['id']&&_0xf3991f instanceof Lt);_0x3bc9d3&&_0x3bc9d3['set']('isVisible',_0x1e69cd['isVisible']);}async['updateFeedItemAIReplyContent'](_0x2dff82){const _0x53a5be=_0x2dff82['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x12d998=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x2dff82,'abortSignal':_0x12d998,'renderingStrategy':_0x53a5be}),_0x2dff82['isDone']&&this['markFeedItemAsDone'](_0x2dff82['id']);});}['updateFeedItemAIReplySources'](_0x2c8295,_0x47d681){this['_view']['chatFeed']['updateWebSources'](_0x2c8295,_0x47d681);}async['updateFeedItemAIReplySuggestionContent'](_0x19e2e1){const _0x4b43ef=_0x19e2e1['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1e3933=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x19e2e1,'abortSignal':_0x1e3933,'renderingStrategy':_0x4b43ef}),_0x19e2e1['isDone']&&this['markFeedItemAsDone'](_0x19e2e1['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x2e6dc2){this['_view']['chatFeed']['updateSuggestionPartState'](_0x2e6dc2);}['markFeedItemAsDone'](_0x1c89c5){this['_view']['chatFeed']['markItemAsDone'](_0x1c89c5);}['removeFeedInteraction'](_0x33585b){this['_view']['chatFeed']['getItemIds']()['filter'](_0xca262f=>_0xca262f['startsWith'](_0x33585b))['forEach'](_0x327d06=>this['_view']['chatFeed']['removeItem'](_0x327d06));}['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'](_0x362e7b){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0xdc7a13=>_0xdc7a13['startsWith'](_0x362e7b['id']))['forEach'](_0x149ab0=>this['markFeedItemAsDone'](_0x149ab0)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x3ce6a3,_0x544642){this['_view']['chatControls']['addContextItem'](_0x3ce6a3,_0x544642);}['removeContextItem'](_0x1a185c){this['_view']['chatControls']['removeContextItem'](_0x1a185c);}['setContextItemLoading'](_0x1c2cdf,_0x126f5d){this['_view']['chatControls']['setContextItemLoading'](_0x1c2cdf,_0x126f5d);}['setIsUploadInProgress'](_0xd866d2){this['_view']['chatControls']['setIsUploadInProgress'](_0xd866d2);}['setConversationContext'](_0x3efe8a){this['_view']['chatControls']['setConversationContext'](_0x3efe8a);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x259fe5,_0x3ea9af,_0x228b52){this['_view']['chatControls']['updateResourceState'](_0x259fe5,_0x3ea9af,_0x228b52);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x27dec3){this['_view']['chatControls']['setAddContextOptions'](_0x27dec3);}['updateCapabilities'](_0x3273db){this['_view']['chatControls']['setWebSearch'](_0x3273db['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x3273db['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x3273db));}['setSelectedModel'](_0x13b4b7,_0x220ea5){this['_view']['chatControls']['setModel'](_0x13b4b7),_0x220ea5&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x46dc1c){this['feedItemRenderingStrategy']=_0x46dc1c;}['toggleLoadingSkeleton'](_0x3594ee){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x3594ee);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x3c8c20,_0x2be680=!0x1){if(_0x2be680&&!Pt()&&_0x3c8c20['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x3c8c20);this['_view']['chatHeader']['label']=_0x3c8c20;}['setLoadingMessage'](_0x5227d5){const _0x1fe46b=this['_getLoadingMessage'](_0x5227d5);this['_view']['chatFeed']['setLoadingMessage'](_0x1fe46b);}['_animateConversationTitle'](_0x351b4e){let _0x4e35e6=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x351b4e[_0x4e35e6],_0x4e35e6++,_0x4e35e6===_0x351b4e['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x387add){this['_view']['chatHeader']['isMaximized']=_0x387add;}['_getLoadingMessage'](_0x178f38){return _0x178f38?_0x178f38['isWebSearchEnabled']&&_0x178f38['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x178f38['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x178f38['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x37872e){return _0x37872e?_0x37872e['isWebSearchEnabled']&&_0x37872e['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x37872e['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x37872e['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x2f2b39,_0x45d027,_0x3ce23d,_0xbfd561){this['_view']['populateSourceResourceBalloon'](_0x2f2b39,_0x45d027,_0x3ce23d,_0xbfd561);}['closeSourceResourceBalloon'](_0x3cb185){this['_view']['closeSourceResourceBalloon'](_0x3cb185);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x4b321c,_0x52fb86){this['_view']['chatFeed']['scrollToSuggestion'](_0x4b321c,_0x52fb86);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Li extends _0x36c9a6{['sections'];constructor(_0x31be58,_0x155b85){super(_0x31be58),this['sections']=_0x155b85,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x33ede0){let _0x2127d0=0x0,_0x31dadd=0x0;for(const _0x353eee of this['sections']){const {resultsCount:_0x1f0b54,totalItemsCount:_0x989ab9}=_0x353eee['filter'](_0x33ede0);_0x2127d0+=_0x1f0b54,_0x31dadd+=_0x989ab9;}return{'resultsCount':_0x2127d0,'totalItemsCount':_0x31dadd};}}class Mi extends _0x36570a{['title'];['itemsViews'];['_itemsListView'];constructor(_0x29e019,{title:_0x1e171a,items:_0x3b56f6}){super(_0x29e019);const _0x309bf9=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x1e171a,this['itemsViews']=_0x3b56f6;const _0x421c3d=new _0x3249c4(_0x29e019);_0x421c3d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x36c9a6(_0x29e019),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x309bf9['if']('isVisible','ck-hidden',_0x5eca5d=>!_0x5eca5d)]},'children':[_0x421c3d,this['_itemsListView']]});}['filter'](_0x16ffa9){const _0x12af8e=this['itemsViews']['length'];let _0x481974=0x0;for(const _0x1fd3b6 of this['itemsViews']){if(_0x16ffa9){const _0x24a559=_0x1fd3b6['isMatching'](_0x16ffa9);_0x1fd3b6['isVisible']=!!_0x24a559,_0x1fd3b6['highlightText'](_0x16ffa9);}else _0x1fd3b6['isVisible']=!0x0,_0x1fd3b6['highlightText'](null);_0x1fd3b6['isVisible']&&_0x481974++;}return this['isVisible']=_0x481974>0x0,{'resultsCount':_0x481974,'totalItemsCount':_0x12af8e};}['getItem'](_0x2a4343){return this['itemsViews']['find'](_0x5894bd=>_0x5894bd['id']===_0x2a4343);}['removeItem'](_0x2f9f9d){const _0x5ed6b0=this['itemsViews']['indexOf'](_0x2f9f9d);-0x1!==_0x5ed6b0&&(this['itemsViews']['splice'](_0x5ed6b0,0x1),this['_itemsListView']['items']['remove'](_0x2f9f9d));}}class Yi extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x543c36(_0x36570a){['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(_0x3873aa,_0x284797){super(_0x3873aa);const _0x56f98c=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x284797['pinned']),this['set']('loadingState',null),this['id']=_0x284797['id'];const {title:_0x251df7,createdAt:_0x421c92,active:_0x3e8cf4=!0x1}=_0x284797;this['_titleView']=new _0x1e2340(),this['_titleView']['text']=_0x251df7,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x31d54f=this['_createCheckView'](),_0x50188d=this['_createPinButtonView'](_0x3873aa),_0x442f06=this['_createMenuDropdownView'](),_0x1e8a00=this['_createEditInputView'](_0x3873aa,_0x251df7),_0x2a473a=this['_createAcceptEditButtonView'](_0x3873aa,_0x1e8a00),_0x259626=this['_createCancelEditButtonView'](_0x3873aa,_0x1e8a00);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x50188d),this['actions']['add'](_0x442f06),this['on']('change:isEdit',(_0x4c613a,_0x506eac,_0x2732c2)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x2732c2?(this['actions']['add'](_0x2a473a),this['actions']['add'](_0x259626),this['mainContent']['add'](_0x1e8a00),_0x1e8a00['element']['focus']()):(this['actions']['add'](_0x50188d),this['actions']['add'](_0x442f06),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x3e8cf4?'ck-ai-chat-history__item--active':'',_0x56f98c['if']('isVisible','ck-hidden',_0x69ee5d=>!_0x69ee5d),_0x56f98c['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',_0x56f98c['if']('loadingState','ck-hidden',_0x420750=>!!_0x420750)]},'children':_0x3e8cf4?[_0x31d54f]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x56f98c['if']('loadingState','ck-hidden',_0x4d2970=>!_0x4d2970)]},'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',_0x56f98c['if']('loadingState','ck-hidden',_0x40802d=>!!_0x40802d)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x56f98c['if']('loadingState','ck-hidden',_0x1013d1=>!_0x1013d1)]},'children':[{'text':_0x56f98c['to']('loadingState',_0x257e46=>_0x257e46?i(this['locale'],Yi['LOADING_LABELS'][_0x257e46]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x421c92]}]},{'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'](_0x2ff31b){this['_titleView']['text']=_0x3739ad(_0x2ff31b);}['updateLoadingState'](_0x152d30,_0x22d2da){this['set']('loadingState',_0x22d2da?_0x152d30:null);}['_createCheckView'](){const _0x358738=new _0xf03b05();return _0x358738['set']({'content':_0x1e5ca3}),_0x358738;}['_createPinButtonView'](_0x464ae6){const _0x239085=new _0x290cbd(_0x464ae6);return _0x239085['set']({'label':i(_0x464ae6,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x407c66,'withText':!0x1,'tooltip':!0x0}),_0x239085['bind']('isOn')['to'](this,'pinned'),_0x239085['on']('execute',()=>{const _0x53684c=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x53684c});}),_0x239085;}['_createMenuDropdownView'](){const _0x3a4696=_0x1bd241(this['locale'],_0x3ce694),_0x666b51=_0x3a4696['panelView']['children'];_0x3a4696['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x3ad428}),_0x3a4696['panelPosition']='sw';const _0x207c58=new _0x290cbd(this['locale']);_0x207c58['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x207c58['withText']=!0x0,_0x207c58['on']('execute',()=>{this['isEdit']=!0x0;});const _0x1a03c4=new _0x290cbd(this['locale']);_0x1a03c4['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x1a03c4['withText']=!0x0,_0x1a03c4['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x25d688=new _0x36c9a6(this['locale']),_0x5a1aae=new _0x36570a(this['locale']);_0x5a1aae['children']['add'](_0x207c58);const _0x9e84be=new _0x36570a(this['locale']);return _0x9e84be['children']['add'](_0x1a03c4),_0x25d688['items']['addMany']([_0x5a1aae,_0x9e84be]),_0x666b51['add'](_0x25d688),_0x3a4696;}['_createEditInputView'](_0x22ffff,_0x629540){const _0x2698aa=new _0x5842c8(_0x22ffff),_0x1f9962=_0x2698aa['bindTemplate'];return _0x2698aa['value']=_0x629540,_0x2698aa['extendTemplate']({'on':{'keydown':_0x1f9962['to'](_0x1de550=>{'Enter'==_0x1de550['key']&&this['_commitEditInputValue'](_0x2698aa);})}}),_0x2698aa;}['_createAcceptEditButtonView'](_0x328440,_0x1ef955){const _0x5bc4b8=new _0x290cbd(_0x328440);return _0x5bc4b8['set']({'icon':_0x1e5ca3,'withText':!0x1,'tooltip':i(_0x328440,'AI_CHAT_HISTORY_ACCEPT')}),_0x5bc4b8['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x5bc4b8['on']('execute',()=>{this['_commitEditInputValue'](_0x1ef955);}),_0x5bc4b8;}['_commitEditInputValue'](_0x55891a){const _0xf55254=_0x55891a['element']['value']||'';this['_titleView']['text']=_0xf55254,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0xf55254});}['_createCancelEditButtonView'](_0x3be84e,_0x7b2ffe){const _0x50ca0e=new _0x290cbd(_0x3be84e);return _0x50ca0e['set']({'icon':_0x1c533a,'withText':!0x1,'tooltip':i(_0x3be84e,'AI_CHAT_HISTORY_CANCEL')}),_0x50ca0e['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x50ca0e['on']('execute',()=>{this['isEdit']=!0x1,_0x7b2ffe['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x50ca0e;}['_createSpinnerView'](){const _0x11af75=new De('tiny');return _0x11af75['isVisible']=!0x0,_0x11af75;}['isMatching'](_0x400fe3){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x400fe3)?{'title':!0x0}:null;}['highlightText'](_0x2448d0){this['_titleView']['highlightText'](_0x2448d0);}}class Ut extends _0x3249c4{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0xac10d0,_0x5af11d){super(_0xac10d0),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x11815c=new _0x4aec09(_0xac10d0,{'label':i(_0xac10d0,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x5af11d&&(this['resizeButton']=ks(_0xac10d0,this),_0x11815c['children']['add'](this['resizeButton'])),this['sectionsView']=new Li(_0xac10d0,[]),this['sectionsView']['delegate'](...Di)['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':[_0x11815c,{'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 _0x2e5193=new _0x43e520(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x38c36c=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x38c36c),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x2e5193['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x2e5193['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x19ed1f=>!_0x19ed1f)]}}),_0x2e5193;}['_createSkeletonView'](){const _0x5bead1=new Pe(this['locale'],Be['aiHistory']);return _0x5bead1['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3cf185=>!_0x3cf185)]}}),_0x5bead1;}['_createErrorView'](){const _0x429f4b=new _0x3249c4(this['locale']),_0x1eb29d=new _0x290cbd(this['locale']);return _0x1eb29d['set']({'withText':!0x1,'icon':_0x1c533a,'class':'ck-ai-chat-error__dismiss-button'}),_0x1eb29d['bind']('isVisible')['to'](this,'hasItems',_0x1a427a=>!!_0x1a427a),_0x1eb29d['on']('execute',()=>{this['errorMessage']='';}),_0x429f4b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x2181c7=>!_0x2181c7)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x1eb29d]}),_0x429f4b;}['_createEmptyStateView'](){const _0x193e0b=new _0x290cbd(this['locale']);_0x193e0b['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1294ec,'class':'ck-ai-chat__start-conversation'}),_0x193e0b['on']('execute',()=>{this['fire']('openChat');});const _0x6948dc=new _0x3249c4(this['locale']);return _0x6948dc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x130eb8=>!_0x130eb8)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x193e0b]}),_0x6948dc;}['_createListItemViews'](_0x155516,_0x28d248){const _0x4b0c0b=[];for(const _0x57457f of _0x155516){const _0x439ea1=new Yi(_0x28d248,_0x57457f);_0x439ea1['delegate'](...Di)['to'](this),_0x4b0c0b['push'](_0x439ea1);}return _0x4b0c0b;}['updateHistoryItemsWithCategories'](_0x1f1fc2){const _0x41c02f=this['locale']||'en',_0x51c1ee=[];for(const _0xe00c6 of _0x1f1fc2){const _0x1b012d=this['_createListItemViews'](_0xe00c6['items'],_0x41c02f);_0x51c1ee['push'](new Mi(_0x41c02f,{'title':_0xe00c6['title'],'items':_0x1b012d}));}this['sectionsView']['sections']=_0x51c1ee,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x51c1ee),this['hasItems']=_0x1f1fc2['some'](_0x1ceafa=>_0x1ceafa['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x128cd4){for(const _0x292b06 of this['sectionsView']['sections']){const _0x376b66=_0x292b06['getItem'](_0x128cd4);if(_0x376b66){if(_0x292b06['removeItem'](_0x376b66),0x0===_0x292b06['itemsViews']['length']){const _0x33756c=this['sectionsView']['sections']['indexOf'](_0x292b06);-0x1!==_0x33756c&&(this['sectionsView']['sections']['splice'](_0x33756c,0x1),this['sectionsView']['items']['remove'](_0x292b06));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x2f885e,_0x4408d2){for(const _0x35b38c of this['sectionsView']['sections']){const _0x58cd67=_0x35b38c['getItem'](_0x2f885e);if(_0x58cd67){_0x58cd67['updateTitle'](_0x4408d2);break;}}}['updateItemLoadingState'](_0x2031ba,_0x36d004,_0xceaf32){for(const _0x5257b9 of this['sectionsView']['sections']){const _0x384ee9=_0x5257b9['getItem'](_0x2031ba);if(_0x384ee9){_0x384ee9['updateLoadingState'](_0x36d004,_0xceaf32);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x298a16=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x298a16);}}}const Di=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x3e59e0{static get['requires'](){return[Ct];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3b78dc){super(_0x3b78dc);const _0x27d035=this['context']['plugins']['get']('AITabs');this['_historyView']=new Ut(this['context']['locale'],_0x27d035['showResizeButton']),this['_historyView']['delegate'](...Di)['to'](this),_0x27d035['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x36c297){this['_historyView']['removeHistoryItem'](_0x36c297);}['updateItems'](_0x3cee94){this['_historyView']['updateHistoryItemsWithCategories'](_0x3cee94);}['updateItemTitle'](_0x18a589,_0x18c77b){this['_historyView']['updateItemTitle'](_0x18a589,_0x18c77b);}['updateItemLoadingState'](_0x292594,_0x585c00,_0x43bfa7){this['_historyView']['updateItemLoadingState'](_0x292594,_0x585c00,_0x43bfa7);}['setLoadingSkeleton'](_0x131516){this['_historyView']['isLoading']=_0x131516;}['showError'](_0x249b2c){this['_historyView']['errorMessage']=_0x249b2c;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x515280){this['_historyView']['isMaximized']=_0x515280;}}class Ue extends ts(){['id'];['createdAt'];constructor({id:_0x1cc28d,title:_0x1b8c2d,createdAt:_0x4416a5,updatedAt:_0x5e5f34,pinned:_0x22ed48}){super(),this['id']=_0x1cc28d,this['createdAt']=new Date(_0x4416a5),this['set']('title',_0x1b8c2d),this['set']('updatedAt',_0x5e5f34?new Date(_0x5e5f34):null),this['set']('pinned',_0x22ed48||!0x1);}['updateTitle'](_0x5c76e5){this['set']('title',_0x3739ad(_0x5c76e5)),this['updatedAt']=new Date();}['updatePinned'](_0x5de8e4){this['set']('pinned',_0x5de8e4),this['updatedAt']=new Date();}}class Yt extends _0x27cb74(){['items']=[];['connector'];['group'];constructor({connector:_0x2ea0a0,group:_0x3d5306}){super(),this['connector']=_0x2ea0a0,this['group']=_0x3d5306;}async['init'](){try{const _0x495199=this['connector']['fetchConversations'](this['group']),_0x553daa=await _0x495199['getConversations']();this['loadItems'](_0x553daa);}catch(_0x99bd5f){this['fire']('error',{'error':_0x99bd5f,'operation':'init'});}}['addItem'](_0x18d8f9){this['items']['push'](_0x18d8f9);}async['removeItem'](_0x2e5068){const _0x59ca74=this['items']['findIndex'](_0x201f86=>_0x201f86['id']===_0x2e5068);if(-0x1===_0x59ca74)return!0x1;try{return await this['connector']['deleteConversation'](_0x2e5068)['execute'](),this['items']['splice'](_0x59ca74,0x1),this['fire']('itemRemoved',{'itemId':_0x2e5068}),!0x0;}catch(_0x38f060){return this['fire']('error',{'error':_0x38f060,'operation':'removeItem','itemId':_0x2e5068}),!0x1;}}['getItem'](_0x4271b0){return this['items']['find'](_0x1496f3=>_0x1496f3['id']===_0x4271b0);}async['updateItemTitle'](_0x154367,_0x36d859){const _0x20e601=this['getItem'](_0x154367);if(!_0x20e601)return!0x1;try{return await this['connector']['updateConversation'](_0x154367,{'title':_0x36d859})['getResult'](),_0x20e601['updateTitle'](_0x36d859),this['fire']('itemUpdated',{'itemId':_0x154367,'updates':{'title':_0x36d859}}),!0x0;}catch(_0xbf81ca){return this['fire']('error',{'error':_0xbf81ca,'operation':'updateItemTitle','itemId':_0x154367}),!0x1;}}async['updateItemPinned'](_0x1cca74,_0x2b7e72){const _0x4ea126=this['getItem'](_0x1cca74);if(!_0x4ea126)return!0x1;try{return await this['connector']['updateConversation'](_0x1cca74,{'pinned':_0x2b7e72})['getResult'](),_0x4ea126['updatePinned'](_0x2b7e72),this['fire']('itemUpdated',{'itemId':_0x1cca74,'updates':{'pinned':_0x2b7e72}}),!0x0;}catch(_0x3a904d){return this['fire']('error',{'error':_0x3a904d,'operation':'updateItemPinned','itemId':_0x1cca74}),!0x1;}}['loadItems'](_0xa40f70){try{this['items']=[],_0xa40f70['map'](_0x557709=>{this['addItem'](new Ue(_0x557709));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x2aa5fb){this['fire']('error',{'error':_0x2aa5fb,'operation':'loadItems'});}}['getItems'](_0x4c7ec8={}){const _0x5351fc=void 0x0!==_0x4c7ec8['pinned']&&_0x4c7ec8['pinned'],_0x4fdcb5=_0x4c7ec8['from']?new Date(_0x4c7ec8['from']['getFullYear'](),_0x4c7ec8['from']['getMonth'](),_0x4c7ec8['from']['getDate']()):null,_0x6725d5=_0x4c7ec8['to']?new Date(_0x4c7ec8['to']['getFullYear'](),_0x4c7ec8['to']['getMonth'](),_0x4c7ec8['to']['getDate']()):null;return this['items']['filter'](_0x33ff11=>{if(_0x33ff11['pinned']!==_0x5351fc)return!0x1;if(_0x6725d5){const _0x13a29f=new Date(_0x33ff11['createdAt']['getFullYear'](),_0x33ff11['createdAt']['getMonth'](),_0x33ff11['createdAt']['getDate']());return _0x4fdcb5?_0x4fdcb5['getTime']()===_0x6725d5['getTime']()?_0x13a29f['getTime']()===_0x4fdcb5['getTime']():_0x13a29f<_0x6725d5&&_0x13a29f>=_0x4fdcb5:_0x13a29f<_0x6725d5;}return!0x0;});}}class jt extends _0x3e59e0{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[R,mt,xt,Ct];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](R),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](mt);const _0x1793e6=this['context']['plugins']['get'](Ct),_0x340099=this['_aiChatController']['getGroupId']();this['history']=new Yt({'connector':this['_aiConnector'],'group':_0x340099}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x958fc0,_0x301e6c)=>{this['_setItemLoading'](_0x301e6c['id'],'remove'),this['_handleRemove'](_0x301e6c['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x537c9d,_0x395995)=>{this['_setItemLoading'](_0x395995['id'],'rename'),this['_handleEditTitle'](_0x395995['id'],_0x395995['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x37f1a7,_0x4afa8e)=>{void 0x0!==_0x4afa8e['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x4afa8e['itemId'],_0x4afa8e['updates']['title']),void 0x0!==_0x4afa8e['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x4afa8e['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x418bd8,_0x20c2fc)=>{this['_aiChatController']['handleRemovedConversation'](_0x20c2fc['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x20c2fc['itemId']),this['_clearItemLoading'](_0x20c2fc['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x51c002,_0x5ceea8)=>{this['_handleHistoryErrorUI'](_0x5ceea8['error'],_0x5ceea8['operation'],_0x5ceea8['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x13980a,_0x4378ac)=>{this['_handleSelectConversation'](_0x4378ac['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x51d252,_0x49e605)=>{const _0x19895e=_0x49e605['pinned']?'pin':'unpin';this['_setItemLoading'](_0x49e605['id'],_0x19895e),this['_handleTogglePin'](_0x49e605['id'],_0x49e605['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x1793e6['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x1793e6['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x1793e6,'resizedTabs',(_0x2e8953,_0x1403bd)=>{this['_setIsMaximized'](_0x1403bd);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x1793e6['resize']();});}async['_handleEditTitle'](_0x1e2ade,_0x13aadc){await this['history']['updateItemTitle'](_0x1e2ade,_0x13aadc);}async['_handleTogglePin'](_0x3b3ad2,_0xae3de){await this['history']['updateItemPinned'](_0x3b3ad2,_0xae3de);}async['_handleRemove'](_0x21ec85){await this['history']['removeItem'](_0x21ec85);}async['_handleSelectConversation'](_0xa37017){await this['_aiChatController']['loadConversation'](_0xa37017);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x5286dc=this['_aiChatController']['activeConversation']?.['id'],_0x21a2a8=this['_getCategorizedItems']()['map'](_0x85e83f=>({'title':_0x85e83f['title'],'items':_0x85e83f['items']['map'](_0x20a296=>({'id':_0x20a296['id'],'title':_0x20a296['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x20a296['createdAt'])['toLocaleDateString'](),'active':_0x20a296['id']===_0x5286dc,'pinned':_0x20a296['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x21a2a8);}['_setItemLoading'](_0x22b26a,_0x651eea){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x22b26a,_0x651eea,!0x0);}['_clearItemLoading'](_0x4783ec){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4783ec,null,!0x1);}['_handleHistoryErrorUI'](_0x34eeda,_0x4dafba,_0x174b04){const _0x28dc2e=this['_generateErrorMessage'](_0x4dafba,_0x174b04);this['_aiChatHistoryUi']['showError'](_0x28dc2e),_0x174b04&&this['_clearItemLoading'](_0x174b04),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x22a9cf,_0xd6dcaa){const _0x188d37=_0xd6dcaa?this['history']['getItem'](_0xd6dcaa):null,_0x1c5df5=_0x188d37?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x22a9cf){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x1c5df5);case'updateItemPinned':{const _0x3aeb7a=i(this['context']['locale'],_0x188d37?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x3aeb7a,_0x1c5df5]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x1c5df5);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x3821c7=new Date(),_0x27fad5=new Date(_0x3821c7['getFullYear'](),_0x3821c7['getMonth'](),_0x3821c7['getDate']()),_0x3d84b9=new Date(_0x27fad5);_0x3d84b9['setDate'](_0x3d84b9['getDate']()-0x1);const _0x2f3b4d=new Date(_0x27fad5);_0x2f3b4d['setDate'](_0x2f3b4d['getDate']()-0xe);const _0x16fbd4=this['history']['getItems']({'pinned':!0x0}),_0x3704ac=this['history']['getItems']({'from':_0x27fad5,'to':_0x27fad5}),_0x29248f=this['history']['getItems']({'from':_0x3d84b9,'to':_0x3d84b9}),_0xf4faa3=this['history']['getItems']({'from':_0x2f3b4d,'to':_0x3d84b9}),_0x385a7a=this['history']['getItems']({'to':_0x2f3b4d}),_0x13ce24=[];return _0x16fbd4['length']>0x0&&_0x13ce24['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x16fbd4}),_0x3704ac['length']>0x0&&_0x13ce24['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x3704ac}),_0x29248f['length']>0x0&&_0x13ce24['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x29248f}),_0xf4faa3['length']>0x0&&_0x13ce24['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0xf4faa3}),_0x385a7a['length']>0x0&&_0x13ce24['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x385a7a}),_0x13ce24;}['_setIsMaximized'](_0x16dc75){this['_aiChatHistoryUi']['setIsMaximized'](_0x16dc75);}}class gt extends _0x3e59e0{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Da extends _0x3e59e0{static get['requires'](){return[mt,N,dt,gt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4528d9){super(_0x4528d9),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'](mt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](mt)['startConversation']();}async['sendMessage']({message:_0x260674,quickActionData:_0x1f41e2}){await this['context']['plugins']['get'](mt)['sendMessage']({'message':_0x260674,'quickActionData':_0x1f41e2});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](mt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](mt)['focusPromptInput']();}}class co extends Qt{constructor(_0x31aabb){super(_0x31aabb);const _0x4a399e=_0x31aabb['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4a399e,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x58e618=this['editor']['plugins']['get']('AITabs')['view'];_0x58e618['isVisible']=!_0x58e618['isVisible'];}}class qt extends _0x523b53{static get['requires'](){return[Ct];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x18dd3e=this['editor'];_0x18dd3e['commands']['add']('toggleAi',new co(_0x18dd3e)),_0x18dd3e['ui']['componentFactory']['add']('toggleAi',()=>{const _0x273cb3=this['_createAIUIButton'](_0x290cbd);return _0x273cb3['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x273cb3;}),_0x18dd3e['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x1b78c3=this['_createAIUIButton'](_0x1854a6);return _0x1b78c3['set']({'role':'menuitemcheckbox'}),_0x1b78c3;});}['_createAIUIButton'](_0x46eb01){const _0xe58934=this['editor'],_0x3d79d0=_0xe58934['commands']['get']('toggleAi'),_0x5ca0e7=new _0x46eb01(_0xe58934['locale']);return _0x5ca0e7['set']({'label':i(_0xe58934['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x3b3ac0,'isToggleable':!0x0}),_0x5ca0e7['bind']('isEnabled')['to'](_0x3d79d0),_0x5ca0e7['bind']('isOn')['to'](_0x3d79d0,'value',_0x59015b=>!!_0x59015b),this['listenTo'](_0x5ca0e7,'execute',()=>{_0x3d79d0['execute']();}),_0x5ca0e7;}}class Pa extends _0x523b53{static get['requires'](){return[qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function ee(_0x378639,_0x31678d,_0x2b9a2e=!0x1,_0x945606=!0x0,_0x214821=!0x0){return()=>{const _0x4345e4=_0x378639['locale'],_0x7eb3c8=new _0x290cbd(_0x4345e4),_0x3c4cc0=_0x7eb3c8['bindTemplate'];_0x214821&&_0x7eb3c8['extendTemplate']({'on':{'mouseenter':_0x3c4cc0['to'](()=>{_0x7eb3c8['focus']();})}});const _0x37fec6=_0x31678d['icon']??_0x31678d['parent']?.['icon'];return _0x7eb3c8['set']({'label':_0x31678d['displayedPrompt'],'withText':_0x2b9a2e,'role':'menuitem','icon':_0x945606?_0x37fec6??_0x52c472:void 0x0,'tooltip':!_0x2b9a2e,'class':'ck-ai-quick-actions-button'}),_0x7eb3c8['on']('execute',()=>{_0x378639['editing']['view']['focus'](),_0x378639['commands']['execute']('aiQuickAction',_0x31678d);}),_0x7eb3c8;};}const Ls='menu',Ns='menuitem';class ao extends _0x3249c4{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x560e92,_0x18c994,_0x329d9e,_0x290bab){const _0x5cdd97=_0x560e92['locale'];super(_0x5cdd97),this['_bodyCollection']=_0x290bab;const _0x3789ef=this['_createListItems'](_0x560e92,_0x18c994,_0x329d9e);this['optionsListView']=new _0x36c9a6(_0x5cdd97),this['optionsListView']['role']=Ls,this['optionsListView']['items']['addMany'](_0x3789ef),this['focusTracker']=new _0x51df1c(),this['keystrokes']=new _0x3116d1(),this['_focusables']=_0x3789ef,this['focusCycler']=new _0x504985({'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':_0x5cdd97['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0xfdc965,_0x178ef5,_0x17ae9e){const _0x24c778=new _0x33c41f();return _0x178ef5['forEach'](_0x3a3f9f=>{'actions'in _0x3a3f9f?_0x24c778['add'](this['_createActionGroupButton'](_0xfdc965,_0x3a3f9f,_0x17ae9e)):_0x24c778['add'](this['_createActionButton'](_0xfdc965,_0x3a3f9f));}),_0x24c778;}['_createActionButton'](_0x4c523a,_0x371b87){const _0x5dd594=new _0x36570a(this['locale']),_0x31f501=ee(_0x4c523a,_0x371b87,!0x0,void 0x0!==_0x371b87['icon'])();return _0x5dd594['children']['add'](_0x31f501),_0x5dd594;}['_createActionGroupButton'](_0x5a2faf,_0x21bf88,_0x1e30e8){const _0x2ff9be=new _0x36570a(this['locale']),_0x9adcd3=new _0x37fdbe(this['locale']),_0x174020=_0x9adcd3['bindTemplate'],_0x31337a='rtl'===_0x1e30e8['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x217316=this['_createGroupActionsList'](_0x5a2faf,_0x21bf88['actions'],_0x1e30e8);_0x9adcd3['set']({'label':_0x21bf88['label'],'withText':!0x0,'role':Ns,'icon':_0x21bf88['icon']??_0x52c472}),_0x9adcd3['extendTemplate']({'on':{'mouseenter':_0x174020['to'](()=>{_0x9adcd3['focus']();})}});const _0x46d8a0=new _0x1a6e6e(this['locale']);return _0x46d8a0['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x174020['to'](_0x1855fa=>{_0x1855fa['key']==_0x31337a&&(_0x9adcd3['focus'](),this['_hideNestedPanel'](_0x46d8a0));})}}),_0x9adcd3['bind']('isOn')['to'](_0x46d8a0,'isVisible'),this['_bodyCollection']['add'](_0x46d8a0),_0x46d8a0['content']['add'](_0x217316),this['_setupGroupMenuBehavior'](_0x9adcd3,_0x46d8a0),_0x2ff9be['children']['add'](_0x9adcd3),_0x2ff9be;}['_createGroupActionsList'](_0x24dee0,_0x22733d,_0x34cd60){const _0x4714df=new _0x36c9a6(this['locale']);return _0x4714df['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x22733d['forEach'](_0x3a42e9=>{const _0x28ac92=new _0x36570a(this['locale']),_0x37918b=ee(_0x24dee0,_0x3a42e9,!0x0,!0x1)();_0x28ac92['children']['add'](_0x37918b),_0x34cd60['focusTracker']['add'](_0x37918b),_0x4714df['items']['add'](_0x28ac92);}),_0x4714df;}['_setupGroupMenuBehavior'](_0x3b78ae,_0x1e46ce){const _0x232640=_0x3b78ae['bindTemplate'],_0x51ebf8='rtl'===_0x3b78ae['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x3b78ae['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x232640['to'](()=>{this['_showNestedPanel'](_0x1e46ce,_0x3b78ae);}),'mouseleave':_0x232640['to'](_0x1d578c=>{const _0x8a4b93=_0x1d578c['relatedTarget'];this['_isMovingToNestedMenu'](_0x8a4b93,_0x1e46ce)||this['_hideNestedPanel'](_0x1e46ce);}),'keydown':_0x232640['to'](_0x4bad53=>{_0x4bad53['key']==_0x51ebf8&&(this['_showNestedPanel'](_0x1e46ce,_0x3b78ae),_0x1e46ce['content']['get'](0x0)['focus']());})}}),_0x1e46ce['on']('render',()=>{_0x1e46ce['element']?.['addEventListener']('mouseleave',_0x198f31=>{const _0x3e8ece=_0x198f31['relatedTarget'];_0x3b78ae['element']?.['contains'](_0x3e8ece)||this['_isMovingToNestedMenu'](_0x3e8ece,_0x1e46ce)||this['_hideNestedPanel'](_0x1e46ce);});});}['_showNestedPanel'](_0x4cb5dd,_0x220a19){this['_openNestedPanels']['forEach'](_0x1f0c12=>{_0x1f0c12!==_0x4cb5dd&&_0x1f0c12['isVisible']&&_0x1f0c12['hide']();}),_0x4cb5dd['show'](),_0x4cb5dd['pin']({'positions':[_0x2b47cb['eastSouth']],'target':_0x220a19['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x4cb5dd);}['_hideNestedPanel'](_0x55247e){_0x55247e['hide'](),this['_openNestedPanels']['delete'](_0x55247e);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x3db63c=>_0x3db63c['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x337a44,_0x2c7121){if(!_0x337a44)return!0x1;if(_0x2c7121['element']?.['contains'](_0x337a44))return!0x0;const _0x1a79cd=_0x337a44;return _0x1a79cd['closest']&&(null!==_0x1a79cd['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x1a79cd['closest']('.ck-ai-quick-actions-group-list')||null!==_0x1a79cd['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function te(_0x4da770,_0x285227,_0x4ea8c3,_0x518184){return()=>{const _0x328389=_0x4da770['locale'],_0x398729=_0x1bd241(_0x328389);_0x398729['buttonView']['set']({'icon':_0x4ea8c3['icon']??_0x52c472,'label':_0x4ea8c3['label'],'tooltip':!0x0}),_0x398729['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x3a296b=new ao(_0x4da770,_0x285227,_0x398729,_0x518184);return _0x398729['panelView']['children']['add'](_0x3a296b),_0x398729;};}const oe='<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>',ae='<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>',se='<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 Ft=function(_0x355cba){return _0x355cba['CHAT']='CHAT',_0x355cba['ACTION']='ACTION',_0x355cba['REVIEW']='REVIEW',_0x355cba;}({}),Ha=function(_0x383116){return _0x383116['CHAT']='AIChat',_0x383116['ACTION']='AIActions',_0x383116['REVIEW']='AIReviewMode',_0x383116;}({});class ii extends _0x523b53{static get['requires'](){return[_0xfe80ce];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x54e383){return function(_0x1a3699){const _0x12ce4b=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x1a3699['uiLanguage']),_0x534869=_0x12ce4b||'English',_0x55f7cb=[{'id':'ask-ai','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Wt},{'id':'chat-commands','label':i(_0x1a3699,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Wt,'actions':[{'id':'explain','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':oe['replace']('%0',_0x534869),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ae['replace']('%0',_0x534869),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':se['replace']('%0',_0x534869),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Vt},{'id':'continue','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Bt},{'id':'fix-grammar','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Jt},{'id':'adjust-length','label':i(_0x1a3699,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x1a3699,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Gt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x1a3699,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Zt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x1a3699,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x1a3699,'AI_QUICK_ACTIONS_OTHER'),'icon':Xt,'actions':[]}];return _0x55f7cb;}(_0x54e383);}['_getDefaultAndCustomActions'](){const _0x56b957=ii['getDefaultQuickActions'](this['editor']['locale']),_0x17aeb7=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x9d2ed4=>({..._0x9d2ed4,'icon':void 0x0}));return _0x56b957['find'](_0x384d08=>'other'===_0x384d08['id'])['actions']['push'](..._0x17aeb7),_0x56b957;}['_initializeQuickActionsComponentsAndCommands'](){const _0x10022f=new _0x52097e(this['editor']['locale']);_0x10022f['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x10022f),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x10022f);}['_initializeQuickActionsDropdown'](_0x250769){this['editor']['ui']['componentFactory']['add']('aiQuickActions',te(this['editor'],this['_quickActionsDefinition'],{'icon':_0x52c472,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x250769));}['_prepareQuickActionsDefinition'](_0x3a81a4){this['_quickActionsDefinition']=_0x3a81a4['map'](_0x279768=>{if('actions'in _0x279768){const _0x340092=_0x279768;return{..._0x340092,'actions':_0x340092['actions']['map'](_0x4b7b12=>{const {actions:_0x4c96e7,..._0x3f1a34}=_0x340092;return{..._0x4b7b12,'parent':_0x3f1a34};})['filter'](_0x259c61=>this['_shouldIncludeAction'](_0x259c61))};}return _0x279768;})['filter'](_0x30d8aa=>'actions'in _0x30d8aa?_0x30d8aa['actions']['length']>0x0:this['_shouldIncludeAction'](_0x30d8aa));}['_shouldIncludeAction'](_0x4be12b){const _0x41390c=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ha[_0x4be12b['type']])&&!_0x41390c['includes'](_0x4be12b['id']);}['_initializeQuickActionsComponents'](_0x26699d){this['_quickActionsDefinition']['forEach'](_0x293122=>{if('actions'in _0x293122){const _0x2d53b4=te(this['editor'],_0x293122['actions'],_0x293122,_0x26699d);this['editor']['ui']['componentFactory']['add'](_0x293122['id'],_0x2d53b4),_0x293122['actions']['forEach'](_0x369f98=>{const _0x2cc2b6=ee(this['editor'],_0x369f98);this['editor']['ui']['componentFactory']['add'](_0x369f98['id'],_0x2cc2b6);});}else{const _0x3b7496=ee(this['editor'],_0x293122,!0x1,!0x0,!0x1);this['editor']['ui']['componentFactory']['add'](_0x293122['id'],_0x3b7496);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x1f3009=>{const _0x1f3562=new _0x252d57(_0x1f3009),_0x2687df=i(_0x1f3009,'AI_QUICK_ACTIONS_HEADING');_0x1f3562['buttonView']['set']({'label':_0x2687df,'icon':_0x52c472});const _0xbe0f82=new _0x4dc9a7(_0x1f3009);_0xbe0f82['set']({'ariaLabel':_0x2687df,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x148f76=>{if('actions'in _0x148f76){const _0x3129a3=_0x148f76,_0x546940=new _0x514c3b(_0x1f3009,_0x1f3562),_0x4a2b0c=new _0x252d57(_0x1f3009),_0x17d771=new _0x4dc9a7(_0x1f3009);_0x4a2b0c['buttonView']['set']({'label':_0x3129a3['label'],'icon':_0x3129a3['icon']}),_0x3129a3['actions']['forEach'](_0x2d0e9d=>{const _0x45ece3=new _0x514c3b(_0x1f3009,_0x4a2b0c),_0x56a06d=new _0x1854a6(_0x1f3009);_0x56a06d['set']({'label':_0x2d0e9d['displayedPrompt'],'icon':_0x2d0e9d['icon'],'role':'menuitem'}),_0x56a06d['on']('execute',()=>{this['_executeQuickAction'](_0x2d0e9d);}),_0x56a06d['delegate']('execute')['to'](_0x4a2b0c),_0x45ece3['children']['add'](_0x56a06d),_0x17d771['items']['add'](_0x45ece3);}),_0x4a2b0c['panelView']['children']['add'](_0x17d771),_0x546940['children']['add'](_0x4a2b0c),_0xbe0f82['items']['add'](_0x546940);}else{const _0x437d46=_0x148f76,_0x1d205e=new _0x514c3b(_0x1f3009,_0x1f3562),_0x59fb06=new _0x1854a6(_0x1f3009);_0x59fb06['set']({'label':_0x437d46['displayedPrompt'],'icon':_0x437d46['icon'],'role':'menuitem'}),_0x59fb06['on']('execute',()=>{this['_executeQuickAction'](_0x437d46);}),_0x59fb06['delegate']('execute')['to'](_0x1f3562),_0x1d205e['children']['add'](_0x59fb06),_0xbe0f82['items']['add'](_0x1d205e);}});const _0x4ba181=Object['values'](Ha)['some'](_0x19262d=>this['editor']['plugins']['has'](_0x19262d));return _0x1f3562['set']({'isEnabled':_0x4ba181}),_0x1f3562['panelView']['children']['add'](_0xbe0f82),_0x1f3562;});}['_executeQuickAction'](_0xdac08a){const _0x53a554=this['editor'];_0x53a554['editing']['view']['focus'](),_0x53a554['commands']['execute']('aiQuickAction',_0xdac08a);const _0x172278=_0x53a554['ui']['view']['menuBarView'];_0x172278&&_0x172278['close']&&_0x172278['close']();}}class ci extends Qt{['execute'](_0x27c406){switch(this['_expandSelectionIfCollapsed'](),_0x27c406['type']){case Ft['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x4c87af=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x2120c6('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4c87af});}this['_handleAIChatAction'](_0x27c406);break;case Ft['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x3b1a7d=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x2120c6('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3b1a7d});}this['_handleAIActionsAction'](_0x27c406);break;case Ft['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0xdb8fa=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x2120c6('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0xdb8fa});}this['_handleAIReviewAction'](_0x27c406);}}async['_handleAIChatAction'](_0x568b40){const _0x75ed58=this['editor']['plugins']['get']('AIChat'),_0x4218e7=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x568b40['id'])_0x4218e7['removeSelectionFromChatContext'](),await _0x75ed58['addSelectionToChatContext'](),_0x75ed58['focusPromptInput']();else await _0x75ed58['startConversation'](),_0x4218e7['removeSelectionFromChatContext'](),await _0x75ed58['addSelectionToChatContext'](),_0x75ed58['focusPromptInput'](),await _0x75ed58['sendMessage']({'message':_0x568b40['prompt']||_0x568b40['displayedPrompt'],'quickActionData':{'id':_0x568b40['id'],'displayedPrompt':_0x568b40['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x9a29ab=this['editor'],_0x3cb30f=_0x9a29ab['model']['document']['selection'];if(!_0x3cb30f['isCollapsed'])return;const _0x1bcbf1=_0x19de19(_0x3cb30f['getSelectedBlocks']())||_0x9a29ab['model']['schema']['getLimitElement'](_0x3cb30f);_0x9a29ab['model']['change'](_0x1f38dd=>{_0x1f38dd['setSelection'](_0x1bcbf1,'in');});}['_handleAIActionsActionLabel'](_0x949e6f){return _0x949e6f['parent']?.['label']&&'other'!==_0x949e6f['parent']?.['id']?_0x949e6f['parent']['label']+':\x20'+_0x949e6f['displayedPrompt']:_0x949e6f['displayedPrompt'];}async['_handleAIActionsAction'](_0x48f629){const _0x4c8f25=this['editor']['plugins']['get']('AIActions'),_0x22df4a=_0x48f629['prompt']?{'userMessage':_0x48f629['prompt'],'model':_0x48f629['model']}:{'actionName':_0x48f629['actionName']||_0x48f629['id'],'args':_0x48f629['args']},_0x3641fa=this['_handleAIActionsActionLabel'](_0x48f629);await _0x4c8f25['executeAction'](_0x22df4a,_0x3641fa,_0x48f629['icon']);}async['_handleAIReviewAction'](_0x330362){console['log']('handleAIReviewAction',_0x330362);}}class ti extends _0x523b53{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4fa5db=this['editor'],_0x2d5d34=new ci(this['editor']);if(_0x4fa5db['commands']['add']('aiQuickAction',_0x2d5d34),_0x4fa5db['plugins']['has']('AIChat')){const _0x6ace48=this['editor']['plugins']['get']('AIChat');_0x4fa5db['model']['document']['selection']['on']('change:range',(_0x5b47ed,_0x699379)=>{_0x699379['directChange']&&_0x6ace48['removeSelectionFromChatContext']();});}}}class Ae extends ke{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x33e95d=this['documentContextContent']['children']['map'](_0x48ee7b=>({'node':_0x48ee7b,'id':Et(_0x48ee7b,'data-id')})),_0x54a79f=this['parsedMergedContent']['children']['map'](_0x49e153=>({'node':_0x49e153,'id':Et(_0x49e153,'data-id')||_0x1a633f()})),_0x4d0945=_0xbde583(_0x33e95d,_0x54a79f,{'comparator':(_0x3f8eaa,_0x20580a)=>_0x3f8eaa['id']==_0x20580a['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x4d0945['length']&&_0x4d0945[_0x4d0945['length']-0x1]['removed'];)_0x4d0945['pop']();}const _0x16e980=_0x4d0945['map'](_0x5d71b3=>{const _0x458531=_0x5d71b3['added']?'new':_0x5d71b3['removed']?'removed':'modified';return{'node':_0x5d71b3['value'][0x0]['node'],'type':_0x458531,'id':_0x5d71b3['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x16e980,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x11ac8a,_0x398b43){return _0x398b43;}}class Q extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x491445){super(_0x491445),this['content']=_0x491445['content'],this['version']=_0x491445['version'],this['actionName']=_0x491445['actionName'],this['args']=_0x491445['args'],this['userMessage']=_0x491445['userMessage'],this['model']=_0x491445['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':Ie['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x2e77db){const _0x172c12=new Ae({'editor':this['editor'],'documentContextContent':this['content'],..._0x2e77db});return this['replies']['push'](_0x172c12),_0x172c12['delegate'](...je)['to'](this),this['fire']('replyCreated',_0x172c12),_0x172c12;}}class ri extends _0x523b53{static get['requires'](){return[R,_0x3251e6,N,it,nt];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x33c41f();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x43b3ef){super(_0x43b3ef),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new st(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x3186b3,_0x39b327,_0x5946e5){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x4edce2,anchorData:_0x3d317c}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x3186b3,_0x4edce2,_0x3d317c,_0x39b327,_0x5946e5);}}const {modelFragment:_0xf8367a,anchorData:_0x29fda2}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x3186b3,_0xf8367a,_0x29fda2,_0x39b327,_0x5946e5);}['_getExecuteDataRegular'](){const _0x16107e=this['editor']['model']['document']['selection'];if(_0x16107e['isCollapsed']){const _0x1b1e35=_0x19de19(_0x16107e['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x16107e);this['editor']['model']['change'](_0x5f2922=>{_0x5f2922['setSelection'](_0x1b1e35,'in');});}const _0x55c405=_0x16107e['getFirstRange'](),_0x4f66a0=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x16107e),_0x55c405['start'],_0x55c405['end']),_0xfba4ba=_0x16107e['getFirstRange']()['start'],_0x259b72=new Map();let _0x4b91a7=_0x4f66a0;for(let _0x501321=0x0;_0x501321<_0xfba4ba['path']['length'];_0x501321++)_0x259b72['set'](_0x4b91a7,_0xfba4ba['path'][_0x501321]),_0x4b91a7=_0x4b91a7['getChild'](0x0);return{'modelFragment':_0x4f66a0,'anchorData':_0x259b72};}['_getExecuteDataInTable'](){const _0x422686=this['editor']['model']['document']['selection'],_0x39f56f=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0xb16a2=_0x422686['getFirstRange']()['start']['parent']['parent'],_0x6da116=this['_wrapWithCommonAncestors'](_0x39f56f,this['editor']['model']['createPositionBefore'](_0xb16a2),this['editor']['model']['createPositionAfter'](_0xb16a2)),_0x5c5997=_0x422686['getFirstRange']()['start'],_0x1cf167=new Map();let _0x37d1e4=_0x6da116;for(let _0x33a9bd=0x0;_0x33a9bd<_0x5c5997['path']['length'];_0x33a9bd++)if(_0x1cf167['set'](_0x37d1e4,_0x5c5997['path'][_0x33a9bd]),_0x33a9bd<_0x5c5997['path']['length']-0x1)_0x37d1e4=_0x37d1e4['getChild'](0x0);else{let _0x19abe9=_0x37d1e4['nextSibling'];for(;_0x19abe9;)_0x1cf167['set'](_0x19abe9,_0x5c5997['path'][_0x33a9bd]),_0x19abe9=_0x19abe9['nextSibling'];}return{'modelFragment':_0x6da116,'anchorData':_0x1cf167};}['_executeAction'](_0x4b9f3d,_0x17012a,_0x2fad88,_0x459843,_0x2f2d3f){const _0x5bd423=this['editor']['plugins']['get'](N),_0x557dec=this['editor']['plugins']['get'](it),_0xec49f5=this['editor']['model']['document']['selection'],_0x461a59=_0x5bd423['modelToViewWithIds'](_0x17012a),_0x2997d6=this['editor']['data']['processor']['toData'](_0x461a59),_0x30b9d7=this['editor']['model']['document']['version'],_0x482f0a=[..._0xec49f5['getRanges']()];let _0x5ba60b=this['editor']['config']['get']('ai.availableReplyActions')||[...H];this['editor']['plugins']['has']('TrackChanges')||(_0x5ba60b=_0x5ba60b['filter'](_0x5e3679=>'insertSuggestion'!=_0x5e3679));const _0x286685=new F(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x5ba60b});return _0x557dec['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x459843,'icon':_0x2f2d3f||_0x52c472,'mainView':_0x286685,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x482f0a}),this['_setLoadingState'](_0x286685,_0x557dec),this['listenTo'](_0x557dec,'applySuggestion',()=>{this['_applyChanges'](_0x17012a,_0x2fad88,!0x1);}),this['listenTo'](_0x557dec,'insertSuggestion',()=>{this['_applyChanges'](_0x17012a,_0x2fad88,!0x0);}),this['listenTo'](_0x557dec,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x557dec,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x3ba437=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0xceefc=_0x3ba437['changeGroups'][0x0];_0xceefc&&'pending'===_0xceefc['state']&&_0x3ba437['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x557dec);}),this['_createInteraction'](_0x2997d6,_0x30b9d7,_0x286685,_0x557dec,_0x4b9f3d);}['_wrapWithCommonAncestors'](_0x176c79,_0xb2edfb,_0x47a123){const _0x49556f=this['editor']['model']['createRange'](_0xb2edfb,_0x47a123)['getCommonAncestor'](),_0x222f3d=_0x49556f['is']('documentFragment')?[]:_0x49556f['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x222f3d['length']){const _0x2e7538=_0x222f3d['map'](_0x5f3a14=>_0x5f3a14['_clone'](!0x1));for(let _0x24f8e9=0x1;_0x24f8e9<_0x2e7538['length'];_0x24f8e9++)_0x2e7538[_0x24f8e9-0x1]['_appendChild'](_0x2e7538[_0x24f8e9]);return _0x2e7538[_0x2e7538['length']-0x1]['_appendChild'](_0x176c79),new at(_0x2e7538[0x0]);}return _0x176c79;}async['_createInteraction'](_0x44e3b9,_0x263880,_0xa5e920,_0x2de4d7,_0x1c939a){const _0x5d74e4=this['editor'];this['_interactionParams']={'action':_0x1c939a,'content':_0x44e3b9,'version':_0x263880,'mainView':_0xa5e920,'aiBalloon':_0x2de4d7};const _0xa169c1=new Q({'connector':this['_aiConnector'],'editor':_0x5d74e4,'content':_0x44e3b9,'version':_0x263880,..._0x1c939a});this['_interactions']['push'](_0xa169c1),_0xa5e920['hideError']();const _0x495bea=(_0x318cfb,_0x350023,_0x1898b8=!0x1,_0x1b1f5c='streaming')=>this['_promiseQueue']['enqueue'](async _0x4f4730=>{try{const _0x2db0f1=et({'editor':_0x5d74e4,'changeGroups':_0x318cfb['changeGroups'],'documentContextContent':_0x318cfb['documentContextContent'],'showDiff':_0x1898b8,'trimUnchanged':!0x1});await _0x350023['updateContent']({'parts':_0x2db0f1,'renderingStrategy':_0x1b1f5c,'abortSignal':_0x4f4730});}catch(_0x5de4d7){if(this['_isAbortError'](_0x5de4d7))return;throw _0x5de4d7;}});this['_interaction']['on']('replyCreated',(_0x1c3cbd,_0x3a3c62)=>{_0xa5e920['hideLoader'](),_0x495bea(_0x3a3c62,_0xa5e920)['catch'](_0x294c09=>{this['_isAbortError'](_0x294c09)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x294c09),this['_setErrorState'](_0xa169c1,_0xa5e920));});}),this['_interaction']['on']('replyContentUpdated',(_0x4e1309,_0x3c50b4)=>{_0x495bea(_0x3c50b4,_0xa5e920)['catch'](_0x25d743=>{this['_isAbortError'](_0x25d743)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x25d743),this['_setErrorState'](_0xa169c1,_0xa5e920));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0xa5e920,_0x2de4d7),this['_updateNavigationUI']();}catch(_0x11858c){this['_isAbortError'](_0x11858c)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x11858c),this['_setErrorState'](_0xa169c1,_0xa5e920));}}),this['listenTo'](_0xa5e920,'toggleSuggestionDisplayMode',(_0x1a7cdd,{showDiff:_0xa717dd})=>{this['_balloonShowDiff']=_0xa717dd;const _0x13039b=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x13039b&&_0x495bea(_0x13039b,_0xa5e920,_0xa717dd,'static')['catch'](_0x322d90=>{this['_isAbortError'](_0x322d90)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x322d90),this['_setErrorState'](_0xa169c1,_0xa5e920));});}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x4f80af,{reply:_0x12ebdc})=>{const _0x6239e8={'positiveCount':_0x12ebdc['changeGroups']['filter'](_0x5c8dfb=>'accepted'===_0x5c8dfb['state'])['length'],'totalCount':_0x12ebdc['changeGroups']['length']},_0x306f64=this['_interaction']['actionCallId'],_0x48ac72=this['_interaction']['actionName'];_0x48ac72?this['_aiConnector']['upsertAIActionRating'](_0x48ac72,_0x306f64,_0x6239e8):this['_aiConnector']['upsertCustomAIActionRating'](_0x306f64,_0x6239e8);}),this['_setLoadingState'](_0xa5e920,_0x2de4d7);try{const _0x2d6a0e=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x2d6a0e;}catch(_0x3c5d14){if(this['_isAbortError'](_0x3c5d14))return;_0xa5e920['hideLoader'](),this['_setErrorState'](_0xa169c1,_0xa5e920);}}['_applyChanges'](_0x2f802e,_0x33e346,_0x297cb2){const _0x3a7660=this['editor'];if(_0x297cb2&&!_0x3a7660['plugins']['has']('TrackChanges'))throw new _0x2120c6('ai-no-track-changes',null);const _0x3ab287=this['editor']['plugins']['get'](nt),_0x4c55fc=this['_interaction'],_0x3cd49f=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x2c904d=_0x3cd49f['changeGroups'];_0x3cd49f['setChangeGroupState'](0x0,'accepted');let _0x468cce=rt({'editor':_0x3a7660,'reply':_0x3cd49f,'interaction':_0x4c55fc,'groups':_0x2c904d,'transform':!0x1,'documentCompare':_0x3ab287,'documentCompareOptions':{'anchor':_0x3a7660['model']['createPositionAt'](_0x2f802e,0x0),'markDeletions':_0x297cb2}});_0x468cce=this['_filterOperationsOutsideRange'](_0x468cce,_0x33e346);for(const _0x3d741d of _0x468cce)this['_anchorOperation'](_0x33e346,_0x3d741d,_0x3a7660['model']['document']['getRoot']());const _0x24e5fb=_0x4c55fc['getDocumentContext']()['version'],_0x2de7b6=_0x3a7660['model']['document']['history']['getOperations'](_0x24e5fb),_0x1247c5={'document':_0x3a7660['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x144f5d=ut(_0x468cce,_0x2de7b6,_0x1247c5)['operationsA'];_0x3a7660['model']['change'](_0x4775ec=>{if(_0x4775ec['setSelection'](_0x3a7660['model']['document']['selection']['focus']),_0x297cb2)_0x3a7660['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x144f5d);else{for(const _0x1ce497 of _0x144f5d)_0x1ce497['baseVersion']=_0x3a7660['model']['document']['version'],ot(_0x3a7660,_0x1ce497),_0x4775ec['batch']['addOperation'](_0x1ce497),_0x3a7660['model']['applyOperation'](_0x1ce497);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x525436,_0x32aadc){return _0x525436['filter'](_0x43a355=>{if('rename'==_0x43a355['type']){const _0x3307e7=_0x43a355['position']['nodeAfter'];return!_0x32aadc['has'](_0x3307e7);}if(_0x43a355['type']['indexOf']('Attribute')>-0x1){const _0x161bab=_0x43a355['range']['start']['nodeAfter'];return!_0x32aadc['has'](_0x161bab);}return!0x0;});}['_anchorOperation'](_0x2a0e61,_0x9e7c11,_0x10231c){const _0x1792e8=_0x9e7c11['clone']();for(const _0x3eb862 in _0x9e7c11){const _0x44303a=_0x9e7c11[_0x3eb862];_0x44303a instanceof ht?_0x9e7c11[_0x3eb862]=new ht(_0x20298c(_0x44303a['start']),_0x20298c(_0x44303a['end'])):_0x44303a instanceof ct&&(_0x9e7c11[_0x3eb862]=_0x20298c(_0x44303a));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x1792e8['type'])){if(_0x1792e8['isDocumentOperation']=!0x1,_0x1792e8['baseVersion']=null,'remove'==_0x1792e8['type']){const _0xe89f18=_0x1792e8['sourcePosition'],_0x22a3ef=_0x1792e8['howMany'];new lt(_0xe89f18,_0x22a3ef)['_execute']();}else _0x1792e8['_execute']();}function _0x20298c(_0x500261){if('$graveyard'==_0x500261['root']['rootName'])return _0x500261;const _0x583932=[];let _0x7e7cac=_0x500261['root'];for(let _0x419ce9=0x0;_0x419ce9<_0x500261['path']['length'];_0x419ce9++){const _0x4f2f3d=_0x2a0e61['get'](_0x7e7cac)||0x0;_0x583932[_0x419ce9]=_0x500261['path'][_0x419ce9]+_0x4f2f3d,_0x7e7cac=_0x7e7cac['getChildAtOffset'](_0x500261['path'][_0x419ce9]);}return new ct(_0x10231c,_0x583932,_0x500261['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x27b541,content:_0x446043,version:_0x1bd63d,mainView:_0x293e51,aiBalloon:_0x1179de}=this['_interactionParams'];_0x293e51['areChangesVisible']=!0x1,_0x293e51['hideError'](),this['_clearErrorState'](_0x293e51,_0x1179de);const _0x2b0680=_0x293e51;_0x2b0680['miniToolbarView']&&_0x2b0680['miniToolbarView']['showChangesButton']&&_0x2b0680['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':tt}),this['_clearSuggestionContent'](_0x293e51),_0x293e51['showLoader'](),this['_updateNavigationUI'](),this['_createInteraction'](_0x446043,_0x1bd63d,_0x293e51,_0x1179de,_0x27b541)['catch'](_0x48c934=>{this['_isAbortError'](_0x48c934)||console['error']('Error\x20refreshing\x20interaction:',_0x48c934);});}['_clearSuggestionContent'](_0x4936a1){const _0x40fe2e=_0x4936a1['bodyView']['_children'];for(;_0x40fe2e['length']>0x0;)_0x40fe2e['remove'](_0x40fe2e['first']);_0x4936a1['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x13f20d){return!!_0x13f20d['message']&&_0x13f20d['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 _0x3878a9=new _0x290cbd(this['editor']['locale']),_0x241a4c=new _0x290cbd(this['editor']['locale']),_0x23bbda=new _0x3249c4(this['editor']['locale']),_0x51971f=new _0x290cbd(this['editor']['locale']);_0x3878a9['set']({'icon':_0x446f03,'label':i(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x241a4c['set']({'icon':_0x2c7390,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x23bbda['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x51971f['set']({'icon':_0x53b3de,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x3878a9['bind']('isEnabled')['to'](this,'isBusy',_0x4c88cf=>!_0x4c88cf),_0x3878a9['on']('execute',()=>{this['_refreshInteraction']();}),_0x241a4c['bind']('isEnabled')['to'](this,'isBusy',_0xf8c91=>!_0xf8c91),_0x241a4c['on']('execute',()=>{this['_navigateToPrevious']();}),_0x51971f['bind']('isEnabled')['to'](this,'isBusy',_0x5282fb=>!_0x5282fb),_0x51971f['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x241a4c,this['_navigationCounter']=_0x23bbda,this['_navigationNextButton']=_0x51971f,this['_customViews']['add'](_0x3878a9);}['_navigateToPrevious'](){const _0x320f27=this['_interactions']['length'];this['_currentInteractionIndex']<_0x320f27-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x31b0e3){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x31b0e3;const {mainView:_0x179d72}=this['_interactionParams'],_0x280131=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x280131)return;if(_0x280131['hasError'])return this['_setErrorState'](_0x280131,_0x179d72),void this['_updateNavigationUI']();if(!_0x280131['replies']['length'])return;_0x179d72['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x179d72,this['_interactionParams']['aiBalloon']);const _0x118eee=_0x280131['replies'][_0x280131['replies']['length']-0x1];if(_0x118eee){const _0x8bfc24=this['editor'];this['_clearSuggestionContent'](_0x179d72);try{const _0x2f1882=et({'editor':_0x8bfc24,'changeGroups':_0x118eee['changeGroups'],'documentContextContent':_0x118eee['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x179d72),await new Promise(_0x3e78ad=>setTimeout(_0x3e78ad,0x32)),await _0x179d72['updateContent']({'parts':_0x2f1882,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x1d4c0f){this['_isAbortError'](_0x1d4c0f)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x1d4c0f);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x493c18=this['_interactions']['length'],_0x4352e9=_0x493c18>0x1,_0x16fd6e=this['_interactionParams']?.['mainView'];if(_0x4352e9){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x16fd6e?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x16fd6e?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x16fd6e?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x2143ae=_0x493c18-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x2143ae+'/'+_0x493c18),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x493c18-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x16fd6e?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x16fd6e?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x16fd6e?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x4fa940,_0x2a0d5b){_0x4fa940['setLoading'](),_0x2a0d5b['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x48719d,_0x49e49d){const _0x38a650=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x49e49d['showError'](_0x38a650),_0x48719d['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x49e49d['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x3e5714,_0x2dd77d){_0x3e5714['clearErrorState'](),_0x2dd77d['balloonView']['toolbar']&&(_0x2dd77d['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x44a614,_0x64643b){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x44a614['clearLoading'](),_0x64643b['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x1bb014=>{'isEnabled'in _0x1bb014&&(_0x1bb014['isEnabled']=!0x1);});}}class Ma extends _0x523b53{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa47cef){super(_0xa47cef),_0xa47cef['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class js{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x1d8de6,title:_0x4f3119,description:_0x11f91c,isParameterized:_0x42486c,useArgs:_0x361598,options:_0xe6b607}){this['id']=_0x1d8de6,this['title']=_0x4f3119,this['description']=_0x11f91c,this['isParameterized']=_0x42486c,this['useArgs']=_0x361598,this['options']=_0xe6b607;}}class kr extends js{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x45632c){this['_models']=_0x45632c;}}class si extends ts(){['_checks'];constructor(_0x15ccc7){super(),this['_checks']=this['_mapCheckDefinitions'](_0x15ccc7);}get['checks'](){return this['_checks'];}['getCheckById'](_0x3f67b8){return this['checks']['find'](_0x2772fa=>_0x2772fa['id']===_0x3f67b8);}['_mapCheckDefinitions'](_0x88983f){return _0x88983f['map'](_0x39c26e=>'custom'===_0x39c26e['id']?new kr(_0x39c26e):new js(_0x39c26e));}}class Rs extends _0x27cb74(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x196c03,contentNew:_0x23b3ab,contentInitial:_0x5d1538,documentVersion:_0x4cab5f}){super(),this['id']=_0x196c03,this['contentNew']=_0x23b3ab,this['contentInitial']=_0x5d1538,this['documentVersion']=_0x4cab5f;}}class Is extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0xfe0651,_0x14e45d,_0x5d292e){super(),this['id']=_0xfe0651,this['parent']=_0x5d292e,this['_data']=_0x14e45d,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 ts(){['id']=_0x1a633f();['callId'];['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x162409,_0x27e04d,_0x2d7765,_0x1c9b87,_0xb87150){super(),this['_documentData']=_0x162409,this['_sourceCheck']=_0x27e04d,this['_aiConnector']=_0x2d7765,this['_reviewParams']=_0x1c9b87,this['_reviewArgs']=_0xb87150,this['on']('change:status',(_0x5ce4bb,_0x59bcdb,_0x207b9f)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x207b9f,'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'](_0x46735d=>'pending'===_0x46735d['status']);}get['currentError'](){return this['_currentError'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x5af30c=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x4dfac5 of _0x5af30c)'unmodified'!==_0x4dfac5['data']['operation']&&('error'!==_0x4dfac5['data']['operation']?'review-metadata'!==_0x4dfac5['event']?this['_addReviewCheckResult'](_0x4dfac5['data']['dataId'],_0x4dfac5['data']['textDelta']):this['callId']=_0x4dfac5['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x4b4713){this['_currentError']=_0x4b4713,_0x4b4713 instanceof Error&&_0x4b4713['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'](_0x3eb0fd,_0x1ea4ed){const _0x346918=this['_results']['get'](_0x3eb0fd);if(!_0x346918)return;const _0x17d52f=[];_0x1ea4ed['forEach']((_0xb586b9,_0x480574)=>{const _0x26dd93=new Is(_0x346918['id']+'-'+_0x480574,_0xb586b9,_0x346918);_0x26dd93['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x26dd93,'status':_0x26dd93['status']});}),_0x26dd93['on']('change:isActivated',()=>{_0x26dd93['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x26dd93}):this['fire']('reviewCheckResultDeactivated',{'change':_0x26dd93});}),this['_changes']['push'](_0x26dd93),_0x17d52f['push'](_0x26dd93);}),this['fire']('reviewCheckResultReady',{'changes':_0x17d52f,'result':_0x346918,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x51416f){const _0x58a457=this['_changes']['find'](_0x2522d8=>_0x2522d8['id']===_0x51416f);return!(!_0x58a457||'pending'!==_0x58a457['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x1373e5=>'pending'===_0x1373e5['status']);}['markAllChangesAsAccepted'](){for(const _0x1a91dc of this['_changes'])'pending'===_0x1a91dc['status']&&(_0x1a91dc['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x181eb8){const _0x5e51bd=this['_changes']['find'](_0x3f80e5=>_0x3f80e5['id']===_0x181eb8);_0x5e51bd&&'pending'===_0x5e51bd['status']&&(_0x5e51bd['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x44ea69){const _0x181f1f=this['_changes']['find'](_0x43e37c=>_0x43e37c['id']===_0x44ea69);_0x181f1f&&'pending'===_0x181f1f['status']&&(_0x181f1f['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x11150a){const _0x5b9844=this['_changes']['find'](_0x5e6397=>_0x5e6397['id']===_0x11150a);_0x5b9844&&'pending'===_0x5b9844['status']&&(_0x5b9844['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x1f829b){const _0x20ce0a=this['_changes']['find'](_0x482857=>_0x482857['id']===_0x1f829b);_0x20ce0a&&'outdated'===_0x20ce0a['status']&&(_0x20ce0a['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x4ba228){this['_changes']['filter'](_0x47fb8a=>_0x47fb8a['isActivated']&&_0x47fb8a['id']!==_0x4ba228)['forEach'](_0x4a9140=>{_0x4a9140['isActivated']=!0x1;});const _0x39dc55=this['_changes']['find'](_0x2f4bc9=>_0x2f4bc9['id']===_0x4ba228);_0x39dc55&&'pending'===_0x39dc55['status']&&(_0x39dc55['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x3b7511=>_0x3b7511['isActivated'])['forEach'](_0x1caa3c=>{_0x1caa3c['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x52bbf6){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x19c467;if(_0x52bbf6){const _0x4503b3=this['_changes']['find'](_0x21e521=>_0x21e521['id']===_0x52bbf6);if(_0x4503b3&&_0x4503b3['isRated'])return;_0x4503b3&&(_0x19c467=_0x4503b3['parent']['id'],_0x4503b3['isRated']=!0x0);}const _0x6679a1={'positiveCount':this['_changes']['filter'](_0x504dcc=>'accepted'===_0x504dcc['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x6679a1,this['callId'],_0x19c467);}['_addReviewCheckResult'](_0x48e4dc,_0x4141fc){const _0x103a14=this['_documentData']['elements']['get'](_0x48e4dc);if(!_0x103a14)return;const _0x3ce19c=_0x103a14['getContent']();if(_0x3ce19c===_0x4141fc)return;const _0x3e494c=new Rs({'id':_0x48e4dc,'contentInitial':_0x3ce19c,'contentNew':_0x4141fc,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x3e494c['id'],_0x3e494c),this['fire']('reviewCheckResultAdded',{'result':_0x3e494c,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x150911=>'pending'===_0x150911['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x6a6bdd=>'pending'===_0x6a6bdd['status'])['length']&&(this['status']='finished'));}}class hi extends Ts{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x43d499=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x32cae5=0x0;_0x32cae5<this['_reviewParams']['length'];_0x32cae5++){if(!this['_reviewParams'][_0x32cae5]||!this['_sourceCheck']['options'][_0x32cae5])continue;const _0x2157c5=this['_sourceCheck']['options'][_0x32cae5],_0x316539=_0x2157c5['data']?.['find'](_0xd1ce83=>_0xd1ce83['id']===this['_reviewParams'][_0x32cae5]);_0x316539&&_0x43d499['push'](_0x316539['label']);}return _0x43d499['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x4592f9,_0x2f06ec,_0x261ac9){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x2f06ec,_0x4592f9,_0x261ac9);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class oi extends Ts{['_prompt'];['_model'];constructor(_0x2041d4,_0x5c2ced,_0x58ef42,_0x2a7760,_0x5ac081){super(_0x58ef42,_0x2a7760,_0x5ac081),this['_prompt']=_0x2041d4,this['_model']=_0x5c2ced;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x2f178a,_0x3bc689,_0x2bc8f8){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x3bc689,_0x2f178a,_0x2bc8f8);}}const ai=[{'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 re extends _0x3e59e0{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[R];}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 _0x46af1c=this['context']['config']['get']('ai.reviewMode.translations');if(_0x46af1c){for(const _0x1cd587 of ai)'translate'===_0x1cd587['id']&&(_0x1cd587['options'][0x0]['data']=_0x46af1c);}const _0x12288c=this['_translateReviewChecks'](ai);this['_aiReviewCheckList']=new si(_0x12288c);const _0x5795d8=this['_aiReviewCheckList']['checks']['find'](_0x14e537=>'custom'===_0x14e537['id']);if(_0x5795d8){const _0x5d1546=await new ni({'connector':this['_aiConnector']})['getAll']();_0x5795d8['models']=_0x5d1546['map'](_0x2fc840=>({..._0x2fc840,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x2fc840['id']['toUpperCase'](),_0x2fc840['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x2182b3,_0x7bd309)=>{const _0x28a1e0=this['_aiReviewCheckList']['getCheckById'](_0x7bd309['id']);if(_0x28a1e0){this['_onDiffChange'](this['_isDiffOn']),_0x7bd309['isCustom']?this['_currentReviewCheckRun']=new oi(_0x7bd309['args']['prompt'],_0x7bd309['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x28a1e0,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x28a1e0,this['_aiConnector'],_0x7bd309['params'],_0x7bd309['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x1ccefd,_0x1f7541)=>{'data'===_0x1f7541['status']||'loading'===_0x1f7541['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x1f7541)):'finished'===_0x1f7541['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x1f7541['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x1f7541['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x1f7541['status']?(this['_aiReviewModeUi']['showGeneralErrorView'](),this['_logError'](new _0x2120c6('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x1f7541['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x2120c6('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x1f7541['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x1f7541['status']&&'error-chunk'!==_0x1f7541['status']&&'error-general'!==_0x1f7541['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x3b4ffd,_0x3d672b)=>{if(!this['_currentReviewCheckRun'])throw new _0x2120c6('ai-review-mode-no-current-check-run',this);const _0x5ade52=this['_aiReviewModeEditing']['diffContent'](_0x3d672b['result']['contentInitial'],_0x3d672b['result']['contentNew']);_0x3d672b['source']['addResultChanges'](_0x3d672b['result']['id'],_0x5ade52);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x52da8f,_0x1dd55e)=>{for(const _0x4f9700 of _0x1dd55e['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x4f9700);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x1dd55e['changes'],_0x1dd55e['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x29b465,_0x3d242c)=>{this['_aiReviewModeUi']['updateChangeState'](_0x3d242c['change']['id'],_0x3d242c['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x1e2e29,_0x10990a)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x10990a['change']['id']);const _0x37813b=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x10990a['change']['id']);if(_0x37813b){if('content'===this['_changeActivationSource']){const _0x35b836=this['_aiReviewModeUi']['getChangeElement'](_0x10990a['change']['id']);_0x35b836&&_0x299a6f(_0x35b836['closest']('.ck-ai-review-mode__check-run-result')||_0x35b836);}else{if('panel'===this['_changeActivationSource']){const _0x38dd92={'target':_0x37813b['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x1966fd(_0x38dd92);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x10990a['change'],_0x37813b['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x3fc50d){_0x3fc50d instanceof Error&&_0x3fc50d['message']['includes']('ai-request-aborted')||(_0x3fc50d instanceof _0x2120c6?this['_logError'](_0x3fc50d):this['_logError'](new _0x2120c6('ai-review-mode-check-run-failed',this,{'error':_0x3fc50d})));}}else this['_logError'](new _0x2120c6('ai-review-mode-source-check-not-found',this,{'checkId':_0x7bd309['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 _0x292ab8=this['_currentReviewCheckRun']['getActiveChanges']();_0x292ab8['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x292ab8['map'](_0x375973=>_0x375973['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x20e759,_0x1c52eb)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1c52eb['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x1c52eb['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1c52eb['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1c52eb['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0xdbd82f,_0x36c0be)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x36c0be['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x36c0be['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x36c0be['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x36c0be['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x1418f6,_0x30acea)=>{this['_isDiffOn']=_0x30acea['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x47aa95,_0x2f86cb)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x2f86cb['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x59d9c4,_0x31262e)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x31262e['changeId']));}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x559d0d,_0x446ea1)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x446ea1['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x321f3a,_0x3d330f)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x3d330f['changeId']);});}['_onReviewModeRunLeave'](_0x4a357f=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x4a357f&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x19fa0d=this['_aiReviewModeEditing']['getEditor']();_0x19fa0d&&_0x19fa0d['editing']['view']['change'](_0x487bca=>{const _0x2fe896=_0x19fa0d['editing']['view']['document']['getRoot']();_0x487bca['removeClass']('ck-ai-review-mode-diff',_0x2fe896),_0x487bca['removeClass']('ck-ai-review-mode-highlights',_0x2fe896);});}['_onDiffChange'](_0x47ad91){const _0x2b937c=this['_aiReviewModeEditing']['getEditor']();_0x47ad91?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x2b937c&&_0x2b937c['editing']['view']['change'](_0x8b6e01=>{const _0x243a89=_0x2b937c['editing']['view']['document']['getRoot']();_0x8b6e01['removeClass']('ck-ai-review-mode-diff',_0x243a89),_0x8b6e01['removeClass']('ck-ai-review-mode-highlights',_0x243a89),_0x8b6e01['addClass'](_0x47ad91?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x243a89);});}['_translateReviewChecks'](_0x27c530){return _0x27c530['map'](_0x7193db=>{const _0x11f829='AI_REVIEW_CHECK_'+_0x7193db['id']['toUpperCase']()['replaceAll']('-','_'),_0x54cf81={..._0x7193db,'title':this['_getTranslationWithDefault'](_0x11f829+'_TITLE',_0x7193db['title']),'description':this['_getTranslationWithDefault'](_0x11f829+'_DESCRIPTION',_0x7193db['description'])};return _0x7193db['options']&&(_0x54cf81['options']=_0x7193db['options']['map'](_0x4d72de=>({..._0x4d72de,'label':this['_getTranslationWithDefault'](_0x11f829+'_OPTIONS_LABEL',_0x4d72de['label']||''),'data':_0x4d72de['data']?_0x4d72de['data']['map'](_0x25710e=>({..._0x25710e,'label':this['_getTranslationWithDefault'](_0x11f829+'_OPTIONS_DATA_'+_0x25710e['id']['toUpperCase'](),_0x25710e['label'])})):void 0x0}))),_0x54cf81;});}['_getTranslationWithDefault'](_0x100779,_0x44852e){const _0x15528d=i(this['context']['locale'],_0x100779);return _0x15528d===_0x100779?_0x44852e:_0x15528d;}['_logError'](_0x1d95c4){ft(_0x1d95c4['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x3249c4{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x55ad83,_0x1accc2){super(_0x55ad83),this['_defaultValue']=_0x1accc2['default']||(_0x1accc2['data']['length']>0x0?_0x1accc2['data'][0x0]['id']:''),this['_defaultLabel']=_0x1accc2['data']['find'](_0x504954=>_0x504954['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x1bd241(this['locale']);const _0x342ddf=this['_prepareListOptions'](_0x1accc2['data']);_0x710699(this['_dropdownView'],_0x342ddf,{'role':'menu','ariaLabel':_0x1accc2['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3064d8=>{_0x3064d8['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x428768=>{this['formValue']=_0x428768['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x428768['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'](_0x256e3a=[]){const _0x31fec0=new _0x2afc13();this['resetToDefault']();for(const _0x57a599 of _0x256e3a){const _0x19e6f1=new _0x32dcb3({'label':_0x57a599['label'],'withText':!0x0,'role':'menuitemradio','id':_0x57a599['id'],'model':_0x57a599});_0x19e6f1['bind']('isOn')['to'](this,'formValue',_0x24ca36=>_0x24ca36===_0x19e6f1['id']);const _0x1d9215={'type':'button','model':_0x19e6f1};_0x31fec0['add'](_0x1d9215);}return _0x31fec0;}}class ec extends _0x36570a{['_formItem']=null;constructor(_0x37e61e,_0x4421f0,_0x319799){super(_0x37e61e),this['argsKey']=_0x4421f0?.['argsKey'];if('dropdown'===_0x4421f0['formType'])this['_formItem']=new Mr(this['locale'],_0x4421f0);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x12b07c=new _0x4507eb(this['locale'],{'children':[this['_formItem']],'class':[_0x319799?'ck-form__row_with-submit':'']});_0x319799&&_0x12b07c['children']['add'](_0x319799),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x12b07c]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Ys extends _0x475ed3{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x2ed1fa){super(_0x2ed1fa),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x3116d1(),this['minRows']=Ys['MIN_ROWS'],this['maxRows']=Ys['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 ic extends _0x3249c4{['focusTracker']=new _0x51df1c();['keystrokes']=new _0x3116d1();['focusCycler'];['_focusables']=new _0x33c41f();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0xdcd278,_0x12ea1d){super(_0xdcd278),this['_check']=_0x12ea1d,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x12ea1d['models']&&_0x12ea1d['models']['length']>0x0?_0x12ea1d['models'][0x0]['id']:'',this['_defaultLabel']=_0x12ea1d['models']&&_0x12ea1d['models']['length']>0x0?_0x12ea1d['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x12f7b2(this['locale'],()=>new Ys(_0xdcd278)),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 _0x2afc13(),this['_setModelList'](),_0x710699(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 _0x4507eb(this['locale'],{'children':[this['promptInputView']]}),new _0x4507eb(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x42ded6,_0x287c93)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x287c93()):_0x287c93();}),this['focusCycler']=new _0x504985({'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'](_0x1d0ae7=>{this['_focusables']['add'](_0x1d0ae7),this['focusTracker']['add'](_0x1d0ae7['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 _0x2c9bd3 of this['_getFormValidators']()){const _0x3f69df=_0x2c9bd3();if(_0x3f69df)return this['promptInputView']['errorText']=_0x3f69df,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x2bf5a8=new _0x290cbd(this['locale']),t=this['locale']['t'];return _0x2bf5a8['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x2bf5a8['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x2bf5a8;}['_createCancelButtonView'](){const _0x19a71e=new _0x290cbd(this['locale']),t=this['locale']['t'];return _0x19a71e['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x19a71e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x173066=>{_0x173066['stopPropagation']();})}}),_0x19a71e['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x19a71e;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x13702b=this['_check']['models'];if(this['resetToDefault'](),_0x13702b?.['length']){const _0x2fe155=ni['getLocalized'](this['locale'],_0x13702b);for(const _0x1c6c0f of _0x2fe155){const _0x1e4fbe=new _0x32dcb3({'label':_0x1c6c0f['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1c6c0f['id'],'model':_0x1c6c0f});_0x1e4fbe['bind']('isOn')['to'](this,'modelId',_0x20976e=>_0x20976e===_0x1c6c0f['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1e4fbe,'labelView':new Gs(this['locale'],_0x1c6c0f)});}}}['_createModelSelectionDropdown'](){const _0x43402c=_0x1bd241(this['locale']);return _0x43402c['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x43402c['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x43402c,'execute',_0xde137c=>{this['modelId']=_0xde137c['source']['model']['id'],_0x43402c['buttonView']['label']=_0xde137c['source']['label'];}),_0x43402c;}['_createActionsFooterView'](){const _0x46a5b9=new _0x3249c4(this['locale']);return _0x46a5b9['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']]}]}),_0x46a5b9;}}class Gs extends _0x366752{constructor(_0x2d01dd,_0x5b5b13){super();const _0x3d14fe=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x3d14fe['to']('style'),'id':_0x3d14fe['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x3d14fe['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x5b5b13['description']||'']}]}]});}}class Js extends _0x36570a{['_formItemsCollection']=new _0x33c41f();['_customCheckView']=null;constructor(_0x3fe72b,_0x167650,_0x105f74){super(_0x3fe72b),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x167650['isParameterized']);const _0xabe911=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',_0x388eb3=>_0x388eb3),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x3e89ce=>_0x3e89ce)],'style':{'--ck-ai-review-check-list-item-index':_0x105f74}},'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':_0x167650['title']}]},_0xabe911]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x167650['description']}]}]}]},..._0x167650['isParameterized']?[this['_createParameterizedView'](_0x167650)]:[],...'custom'===_0x167650['id']?[this['_createCustomView'](_0x167650)]:[]]}),this['on']('click',()=>{_0x167650['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x167650['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x178524({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x28eb86=>{_0x28eb86['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x23b886=new _0xf03b05();return _0x23b886['content']=_0x8e6677,_0x23b886['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x23b886;}['_createParameterizedView'](_0x3c83d3){const _0x244494=new _0x3249c4(),_0x235d89=this['_createFormView'](_0x3c83d3);return _0x244494['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x2cd735=>!_0x2cd735)]},'children':[_0x235d89]}),_0x244494;}['_createFormView'](_0x351cec){const _0x47cbcd=new _0x3249c4(),_0x13ddfc=Array['isArray'](_0x351cec['options'])?_0x351cec['options']:[],_0x395541=new _0x290cbd(this['locale']),t=this['locale']['t'];_0x395541['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x395541['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3c6048=>{_0x3c6048['stopPropagation']();})}}),_0x395541['on']('execute',()=>{const _0x1b71f0=[],_0x33c5bb={};this['_formItemsCollection']['forEach'](_0x47b266=>{_0x1b71f0['push'](_0x47b266['value']),_0x351cec['useArgs']&&_0x351cec['options']&&(_0x33c5bb[_0x47b266['argsKey']]=_0x47b266['value']);}),this['fire']('runReviewCheck',{'id':_0x351cec['id'],'params':_0x1b71f0['length']?_0x1b71f0:void 0x0,'args':Object['keys'](_0x33c5bb)['length']?_0x33c5bb:void 0x0});});const _0x426be0=_0x13ddfc['length'];return _0x13ddfc['forEach']((_0x1b6e9d,_0x53578d)=>{const _0x447c94=_0x53578d===_0x426be0-0x1;this['_formItemsCollection']['add'](new ec(this['locale'],_0x1b6e9d,_0x447c94?_0x395541:null));}),_0x47cbcd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x47cbcd;}['_createCustomView'](_0x503467){return this['_customCheckView']=new ic(this['locale'],_0x503467),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',_0x35b61f=>!_0x35b61f)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x53df23,_0x4d6d6d,_0x5717da)=>{_0x5717da||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class ih extends _0x36570a{['_checkViews'];constructor(_0x586017){super(_0x586017),this['_checkViews']=new _0x33c41f();const _0x5e661c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x5e661c['if']('isVisible','ck-hidden',_0x3c11c1=>!_0x3c11c1)]},'children':this['_checkViews']});}['setChecks'](_0x5476f8){this['_checkViews']['clear']();for(const [_0x70e8b5,_0x161d4a]of _0x5476f8['entries']()){const _0x9e34ba=new Js(this['locale'],_0x161d4a,_0x70e8b5);_0x9e34ba['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x9e34ba);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x56bf39 of this['_checkViews'])_0x56bf39 instanceof Js&&_0x56bf39['resetToDefault']();}}class Vs extends _0x3249c4{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0x57695e,_0x313d51){super(_0x57695e),this['id']=_0x313d51,this['set']('status','pending'),this['set']('changeId',_0x313d51),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':_0x313d51,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x29d7d1=new _0x3249c4(this['locale']);return _0x29d7d1['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',_0x3fba74=>!_0x3fba74)]}}),_0x29d7d1;}['_createAcceptButtonView'](){const _0x4fb3d8=new _0x290cbd(this['locale']);return _0x4fb3d8['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x4fb3d8['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x295b38=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x295b38['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x2f7bce=>'pending'!==_0x2f7bce)]}}),_0x4fb3d8;}['_createDismissButtonView'](){const _0x48c147=new _0x290cbd(this['locale']);return _0x48c147['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x48c147['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2b9151=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x2b9151['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x5c7356=>'pending'!==_0x5c7356)]}}),_0x48c147;}['_createInfoButtonView'](){const _0x6f8ced=new _0x290cbd(this['locale']);return _0x6f8ced['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x586da8,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x6f8ced['bind']('isOn')['to'](this,'isInfoToggleOn',_0x32073d=>_0x32073d),_0x6f8ced['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x6f8ced;}['_createStatusButtonView'](){const _0x4ac96d=new _0x290cbd(this['locale']);return _0x4ac96d['set']({'withText':!0x0,'isEnabled':!0x1}),_0x4ac96d['bind']('label')['to'](this,'status',_0xcc47b4=>i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0xcc47b4['toUpperCase']())),_0x4ac96d['bind']('icon')['to'](this,'status',_0x1d3fb1=>'ACCEPTED'===_0x1d3fb1['toUpperCase']()?_0x1e5ca3:'REJECTED'===_0x1d3fb1['toUpperCase']()?_0x1c533a:_0x2e680e),_0x4ac96d['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x1385ea=>'pending'===_0x1385ea)],'disabled':'disabled'}}),_0x4ac96d;}}class Qs extends _0x290cbd{constructor(_0x2cf93c){super(_0x2cf93c),this['set']({'label':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class eh extends _0x36570a{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x4be042){super(_0x4be042),this['_resultViews']=new _0x33c41f(),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 xi(_0x4be042),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 _0x588609=this['_createCombinedSkeletonLoader'](),_0x5ddc0a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x5ddc0a['if']('isVisible','ck-hidden',_0x2df773=>!_0x2df773)]},'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',_0x3f1bee=>_0x3f1bee)]},'children':this['_resultViews']},_0x588609]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x32e296){const _0x2fdafb=new Vs(this['locale'],_0x32e296['id']);_0x2fdafb['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x2fdafb),_0x2fdafb['resultResponseView']['element']['innerHTML']=_0x32e296['contentDiffed'];}['hideResult'](_0x377656,_0x5668bc){if('pending'===_0x5668bc)return;const _0x4fce8c=this['_resultViews']['find'](_0x29700d=>_0x29700d['id']===_0x377656);_0x4fce8c&&(_0x4fce8c['status']=_0x5668bc,_0x4fce8c['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x17e40a,_0x4dd773){if('pending'!==_0x4dd773)return;const _0x699701=this['_resultViews']['find'](_0x3970b9=>_0x3970b9['id']===_0x17e40a);_0x699701&&(_0x699701['status']=_0x4dd773,_0x699701['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x42a7e9,_0x34f1b7){this['headerTitle']=_0x42a7e9,this['headerSubtitle']=_0x34f1b7||'';}['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 Pe(this['locale'],Be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x4bf427=new _0x3249c4(this['locale']),_0x4b6a6f=[];for(let _0x3d9099=0x0;_0x3d9099<0x10;_0x3d9099++){const _0x1f030d=this['_createSkeletonLoader']();_0x1f030d['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x4b6a6f['push'](_0x1f030d);}return _0x4bf427['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3e02a3=>!_0x3e02a3)]},'children':_0x4b6a6f}),_0x4bf427;}['_createErrorView'](){const _0x4a73cf=new _0x3249c4(this['locale']),_0x4ca6ad=new _0x290cbd(this['locale']),t=this['locale']['t'];return _0x4a73cf['delegate']('retryReview')['to'](this),_0x4ca6ad['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x4ca6ad['on']('execute',()=>{this['fire']('retryReview');}),_0x4a73cf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x424542=>!_0x424542),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x2912d3=>'chunk'===_0x2912d3)]},'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',_0x2f18ba=>'chunk'===_0x2f18ba)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4c0f07=>'general'!==_0x4c0f07)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4e411a=>'chunk'!==_0x4e411a)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x4ca6ad]}),_0x4a73cf;}['_createCancelButtonView'](){const _0xeab111=new _0x290cbd(this['locale']);return _0xeab111['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x31e03f}),_0xeab111['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x7caca1=>_0x7caca1),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x33068c=>_0x33068c)]}}),_0xeab111['on']('execute',()=>{this['fire']('abortReviewStream');}),_0xeab111;}['_createToggleDiffButtonView'](){const _0x2184c2=new _0x290cbd(this['locale']);_0x2184c2['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x2184c2['bind']('isEnabled')['to'](this,'isError',_0x14c62c=>!_0x14c62c),_0x2184c2['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x443c6a=>!_0x443c6a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3930c4=>_0x3930c4)]}});const _0x529339=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x4262ae=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x2184c2['bind']('isOn')['to'](this,'isToggleDiffOn',_0xe52b2c=>_0xe52b2c),_0x2184c2['bind']('icon')['to'](this,'isToggleDiffOn',_0x5661a5=>_0x5661a5?_0xa784bf:_0xcbe20c),_0x2184c2['bind']('label')['to'](this,'isToggleDiffOn',_0x825162=>_0x825162?_0x529339:_0x4262ae),_0x2184c2['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x2184c2;}['_createAcceptAllButtonView'](){const _0x122f37=new _0x290cbd(this['locale']);return _0x122f37['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x122f37['bind']('isEnabled')['to'](this,'isError',_0x223748=>!_0x223748),_0x122f37['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5f5786=>!_0x5f5786),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x415152=>_0x415152)]}}),_0x122f37['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x122f37;}['_createExitReviewButtonView'](){const _0x3357e1=new _0x290cbd(this['locale']);return _0x3357e1['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x3357e1['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x222338=>!_0x222338),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4e740c=>_0x4e740c)]}}),_0x3357e1['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x3357e1;}['_createResultHeaderView'](){const _0x3b40e0=new _0x3249c4(this['locale']),_0x326e2d=this['_createTitleView']();return _0x3b40e0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x1bbc51=>_0x1bbc51)]},'children':[_0x326e2d,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x3b40e0;}['_createTitleView'](){const _0x38ea9e=new _0x3249c4(this['locale']),_0x19de52=new De();return _0x19de52['bind']('isVisible')['to'](this,'isResultReady',_0x362f02=>!_0x362f02),_0x38ea9e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x19de52,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2816b9=>_0x2816b9)]},'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',_0x3eb8a6=>!_0x3eb8a6)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x38ea9e;}['_createFinishReviewButtonView'](){const _0x910138=new Qs(this['locale']);return _0x910138['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5d8f86=>!_0x5d8f86)]}}),_0x910138['delegate']('finishReview')['to'](this),_0x910138;}}class th extends _0x36570a{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x11f595){super(_0x11f595),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x214b7b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x214b7b['if']('isVisible','ck-hidden',_0x412ae3=>!_0x412ae3)]},'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':i(_0x11f595,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x38188c=new Qs(this['locale']);return _0x38188c['delegate']('finishReview')['to'](this),_0x38188c;}['_createResultHeaderView'](){const _0x5bb2aa=new _0x3249c4(this['locale']);return _0x5bb2aa['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':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x5bb2aa;}}class Re extends _0x3249c4{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x2a9769){super(_0x2a9769),this['reviewModeHeader']=new _0x4aec09(_0x2a9769,{'label':i(_0x2a9769,'AI_REVIEW_MODE'),'icon':_0x3a6d6a,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new ih(_0x2a9769),this['reviewCheckListView']['delegate'](...sh)['to'](this),this['reviewCheckResultsView']=new eh(_0x2a9769),this['reviewCheckResultsView']['delegate'](...sh)['to'](this),this['reviewCompletedView']=new th(_0x2a9769),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'](_0x5e8fc2){this['reviewCheckResultsView']['addResult'](_0x5e8fc2),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 Ce extends _0x1a6e6e{['resultItemView'];constructor(_0x431f8f,_0x25b7bb){super(_0x431f8f),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']()),_0x25b7bb['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0xf0471e){this['resultItemView']['changeId']=_0xf0471e['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0xf0471e['contentDiffed'];}['showBalloon'](_0x55ad2e,_0x1f501b){this['updateContent'](_0x55ad2e),this['show'](),this['pin']({'target':()=>this['_getBestRectPosition'](_0x1f501b)});}['hideBalloon'](){this['hide'](),this['unpin']();}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_setupClickOutsideHandler'](){_0x178524({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['_createContentView'](){const _0x13108b=new _0x3249c4();return this['resultItemView']=new Vs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x13108b['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']]}]}),_0x13108b;}['_getBestRectPosition'](_0x36d909){const _0x21b434=Array['from'](_0x36d909['getClientRects']());return _0x21b434['find'](_0x152d4d=>_0x152d4d['width']>0x0)||_0x21b434[0x0];}}const sh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class me extends _0x3e59e0{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[Ct];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x17d49f){super(_0x17d49f),this['_bodyCollection']=new _0x52097e(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new Re(this['context']['locale']),this['_reviewModeView']['delegate'](...sh)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new Ce(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x273fc3=this['context']['plugins']['get']('AITabs');_0x273fc3['view']['on']('activateTab',(_0x362f41,_0x351785)=>{'reviewMode'===_0x351785?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x273fc3['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x3a6d6a,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x2e2ffc){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x2e2ffc),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0xd42fe4){_0xd42fe4&&('error-general'!==_0xd42fe4['status']?'error-chunk'!==_0xd42fe4['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x53549e){this['_reviewModeView']['addCheckRunResult'](_0x53549e);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x40e39e,_0x3a7c0c){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x40e39e,_0x3a7c0c);}['setActiveStateInResults'](_0x16d383){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0xdfb483=>{_0xdfb483['id']===_0x16d383&&_0xdfb483['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0xeed06=>_0xeed06['setItemAsInactive']());}['updateChangeState'](_0x436bd5,_0x5c91da){'accepted'===_0x5c91da||'rejected'===_0x5c91da||'outdated'===_0x5c91da?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x436bd5,_0x5c91da):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x436bd5,_0x5c91da);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x5aa72d,_0x1ed7fa){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x5aa72d,_0x1ed7fa);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x18b5d4){const _0x4914c9=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x19012b=>_0x19012b['id']===_0x18b5d4);return _0x4914c9?_0x4914c9['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const we='reviewmode-';class ce extends _0x3e59e0{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[nt,N];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x44951a){super(_0x44951a),this['_domEmitter']=new(_0x48baa5())(),this['_eventEmitter']=new(_0x27cb74())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x12174c=q(this['context']);_0x12174c['conversion']['for']('editingDowncast')['markerToElement']({'model':we+'insert','view':(_0x4b72ff,{writer:_0x34c81e})=>{const _0x1740ea=this['_markers']['get'](_0x4b72ff['markerName']),_0x101653={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x4b72ff['markerName']};return _0x34c81e['createUIElement']('span',_0x101653,function(_0x2b111b){const _0x126c3d=this['toDomElement'](_0x2b111b);return _0x126c3d['innerHTML']=_0x1740ea?.['text']||'',_0x126c3d;});}}),_0x12174c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-only','view':_0xee483e=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0xee483e['markerName']}})}),_0x12174c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-context','view':_0x529c07=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x529c07['markerName']}})}),_0x12174c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-text','view':_0xe9f850=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0xe9f850['markerName']}})}),_0x12174c['conversion']['for']('dataDowncast')['markerToElement']({'model':we+'suggestion-context','view':(_0x1edcea,{writer:_0x16570e})=>_0x16570e['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x1edcea['isOpening']?'start':'end')})}),_0x12174c['conversion']['for']('downcast')['attributeToAttribute']({'model':Tt,'view':_0x319184}),this['_domEmitter']['listenTo'](document,'click',(_0x3316c5,_0x38f38e)=>{const _0x5ceddd=_0x38f38e['target'],_0x4bf83c=this['_findMarkerElement'](_0x5ceddd);if(!_0x4bf83c)return;const _0x553da6=_0x4bf83c['getAttribute']('data-marker-id'),_0x1068a5=_0x553da6['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x553da6,'changeId':_0x1068a5});}),_0x12174c['model']['document']['registerPostFixer'](_0x4ec627=>this['_validateMarkers'](_0x12174c,_0x4ec627)),_0x12174c['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x12174c));}['getDocumentData'](){const _0x96884c=this['context']['plugins']['get']('AIEditing'),_0x480483=q(this['context']),_0x468efd=_0x480483['model'],_0xd8d780=new at();for(const _0x3f8a8b of _0x468efd['document']['getRoot']()['getChildren']()){const _0x55672d=_0x3f8a8b['_clone'](!0x0);_0xd8d780['_appendChild'](_0x55672d);}for(const _0x3af882 of _0x468efd['markers'])_0xd8d780['markers']['set'](_0x3af882['name'],this['_changeRangeOwnerDocument'](_0x3af882['getRange']()['clone'](),_0xd8d780));const _0x23528e=new _0x20a667({'ignoreElementEnd':!0x0,'startPosition':_0x468efd['createPositionAt'](_0xd8d780,0x0)}),_0x4d2999=new Set(),_0x4f66c1=new Map();for(const {item:_0x512915}of _0x23528e){if(!_0x512915['is']('$textProxy'))continue;const _0x1a7890=_0x512915['parent'];if((!_0x1a7890||!_0x1a7890['is']('element','caption'))&&(_0x1a7890&&_0x1a7890['is']('element'))){let _0x1467dd=_0x1a7890['getAttribute'](Tt);_0x1467dd||(_0x1467dd=_0x96884c['_nextDataId'](_0x4d2999),_0x1a7890['_setAttribute'](Tt,_0x1467dd)),_0x4d2999['add'](_0x1467dd);let _0x3d4835=_0x1a7890;for(;_0x3d4835['parent']&&!_0x3d4835['parent']['is']('documentFragment');)_0x3d4835=_0x3d4835['parent'],_0x3d4835['hasAttribute'](Tt)&&_0x3d4835['_removeAttribute'](Tt);_0x4f66c1['set'](_0x1467dd,{'path':_0x1a7890['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x3d4835['_clone'](!0x0),_0x1467dd,_0x480483['data'])}),_0x23528e['jumpTo'](_0x468efd['createPositionAfter'](_0x1a7890));}}return{'content':_0x480483['data']['processor']['toData'](_0x480483['data']['toView'](_0xd8d780)),'version':_0x480483['model']['document']['version'],'elements':_0x4f66c1};}['diffContent'](_0x228bd0,_0x3cba71){const _0x20f7e1=[],_0x17384f=q(this['context']),_0x199f64=_0x17384f['data']['parse'](_0x228bd0,'$documentFragment'),_0x13eaf6=_0x17384f['model']['createPositionAt'](_0x199f64,0x0),_0xc583d0=_0x17384f['data']['parse'](_0x3cba71,'$documentFragment');if(!this['_hasSameTopLevelElement'](_0x199f64,_0xc583d0))return _0x20f7e1;const _0x1d5599=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x228bd0,_0x3cba71,{'anchor':_0x13eaf6,'markDeletions':!0x0})['getOperations']()['filter'](_0x151d68=>'insert'===_0x151d68['type']||'marker'===_0x151d68['type']&&_0x151d68['name']['startsWith']('$markedRemove')),_0x57f17c=this['_groupAdjacentOperations'](_0x1d5599);let _0x5cfe38=0x0;return _0x17384f['model']['change'](_0x44cc19=>{for(let _0x58a580=0x0;_0x58a580<_0x57f17c['length'];_0x58a580++){const _0x47cfe6=_0x57f17c[_0x58a580],_0x178846=_0x44cc19['createDocumentFragment']();for(const _0x3b4203 of _0x199f64['getChildren']())_0x44cc19['append'](_0x3b4203['_clone'](!0x0),_0x178846);for(const _0x15e6d9 of _0x47cfe6['operationsIsolated'])if('insert'===_0x15e6d9['type']){const _0x4c86f9=_0x15e6d9;_0x4c86f9['baseVersion']=null,_0x4c86f9['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x4c86f9,_0x178846),_0x44cc19['batch']['addOperation'](_0x15e6d9),_0x17384f['model']['applyOperation'](_0x15e6d9);const _0x224691='suggestion:insertion:id:authorId:'+_0x5cfe38++,_0x40824e=_0x17384f['model']['createRange'](_0x4c86f9['position'],_0x4c86f9['position']['getShiftedBy'](_0x4c86f9['howMany']));_0x178846['markers']['set'](_0x224691,_0x40824e);}else{if('marker'===_0x15e6d9['type']&&_0x15e6d9['name']['startsWith']('$markedRemove')){const _0x3ce558=_0x15e6d9,_0x1325c9='suggestion:deletion:id:authorId:'+_0x5cfe38++;this['_changeOperationOwnerDocument'](_0x3ce558,_0x178846),_0x178846['markers']['set'](_0x1325c9,_0x3ce558['newRange']);}}const _0x504ee2=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x47cfe6['operationsIsolated'][0x0]),_0x178846),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x47cfe6['operationsIsolated'][_0x47cfe6['operationsIsolated']['length']-0x1]),_0x178846));_0x178846['markers']['set'](we+'suggestion-context',new ht(_0x504ee2['start'],_0x504ee2['end'])),_0x20f7e1['push']({..._0x47cfe6,'context':this['_createGetContextFn'](_0x178846,_0x17384f['data'],{'ellipsisBefore':_0x504ee2['hasContentBefore'],'ellipsisAfter':_0x504ee2['hasContentAfter']}),'content':this['_createGetContentFn'](_0x178846,_0x17384f['data'])});}}),_0x20f7e1;}['markChangePositionInEditorContent'](_0x352999,_0xa85321){if(!_0x352999['length'])return;const _0x53be78=_0x352999[0x0]['parent']['id'],_0x49ffc6=_0xa85321['elements']['get'](_0x53be78);if(!_0x49ffc6)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x53be78);const _0x3650ee=_0x49ffc6['path'],_0x22c4ce=q(this['context']),_0x9f51d1=_0x22c4ce['model']['document']['history']['getOperations'](_0xa85321['version']),_0x547330=[];for(const _0x30a422 of _0x352999){const _0x48286a=_0x30a422['operationsIsolated']['map'](_0x44cdb4=>this['_translateOperationToEditorContent'](_0x44cdb4,_0x3650ee,_0x22c4ce['model']['document']['getRoots']()[0x0]));if(!_0x48286a||!_0x48286a['length'])continue;const _0x491e97=_0x48286a['every'](_0x374fae=>'marker'===_0x374fae['type']&&_0x374fae['name']['startsWith']('$markedRemove')),_0x4ba8ac={'document':_0x22c4ce['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x157cf5=ut(_0x48286a,_0x9f51d1,_0x4ba8ac)['operationsA'];for(const _0x7daab2 of _0x157cf5)if('insert'===_0x7daab2['type']){const _0x2f84d2=_0x7daab2,_0x470a61=_0x2f84d2['nodes'];let _0x5477cf='';for(const _0x3f138c of _0x470a61)_0x3f138c&&_0x3f138c['is']('model:$text')&&(_0x5477cf+=_0x3f138c['data']);_0x547330['push']({'start':_0x2f84d2['position'],'end':_0x2f84d2['position'],'type':'insert','groupId':_0x30a422['id'],'text':_0x5477cf});}else{if('marker'===_0x7daab2['type']&&_0x7daab2['name']['startsWith']('$markedRemove')){const _0x4b509f=_0x7daab2;let _0x344d23='remove-text';if(_0x491e97){const _0x4e66a7=this['_findAdjacentContextDistance'](_0x4b509f['newRange']['start'],'backward',_0x22c4ce['model']['schema']),_0x4d09c9=this['_findAdjacentContextDistance'](_0x4b509f['newRange']['end'],'forward',_0x22c4ce['model']['schema']);if(_0x4e66a7||_0x4d09c9){const _0x192bf3=_0x4b509f['newRange']['start']['getShiftedBy'](-_0x4e66a7),_0x418d55=_0x4b509f['newRange']['end']['getShiftedBy'](_0x4d09c9);_0x547330['push']({'start':_0x192bf3,'end':_0x418d55,'groupId':_0x30a422['id'],'type':'remove-context'});}else _0x344d23='remove-only';}_0x547330['push']({'start':_0x4b509f['newRange']['start'],'end':_0x4b509f['newRange']['end'],'groupId':_0x30a422['id'],'type':_0x344d23});}}}this['_insertMarkers'](_0x547330);}['clearAllMarkers'](){const _0xb9e6c9=q(this['context']);_0xb9e6c9['model']['change'](_0x42b5ea=>{for(const _0x5c56db of this['_markers']['keys']())_0xb9e6c9['model']['markers']['get'](_0x5c56db)&&_0x42b5ea['removeMarker'](_0x5c56db);}),this['_markers']['clear']();}['switchToReadOnly'](){q(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){q(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x4f8f0b){const _0x55950f=q(this['context']),_0x50f749=_0x55950f['model'],_0x565d6b=_0x4f8f0b['map'](_0x5f4cd0=>this['_getMarkersDataForGroup'](_0x5f4cd0))['flat']();_0x50f749['change'](_0x4f080d=>{for(const _0x523120 of _0x565d6b){const _0x10e9b7=_0x55950f['model']['markers']['get'](_0x523120['id']);_0x10e9b7&&('insert'===_0x523120['type']?_0x50f749['insertContent'](_0x4f080d['createText'](_0x523120['text']||''),_0x10e9b7['getRange']()['start']):'remove-text'!==_0x523120['type']&&'remove-only'!==_0x523120['type']||_0x50f749['deleteContent'](_0x50f749['createSelection'](_0x10e9b7['getRange']())),_0x4f080d['removeMarker'](_0x523120['id']),this['_markers']['delete'](_0x523120['id']));}});}['rejectChange'](_0x97e9d4){const _0x51f030=q(this['context']),_0x3c6d2d=this['_getMarkersDataForGroup'](_0x97e9d4);_0x51f030['model']['change'](_0x141a96=>{for(const _0x4393ca of _0x3c6d2d)_0x141a96['removeMarker'](_0x4393ca['id']),this['_markers']['delete'](_0x4393ca['id']);});}['getEditor'](){return q(this['context']);}['getMarkerElementForChange'](_0x3bb1bd){const _0x2c3e9e=Array['from'](this['_markers']['values']())['filter'](_0x476815=>_0x476815['groupId']===_0x3bb1bd);if(!_0x2c3e9e['length'])return null;const _0x254e13=0x1===_0x2c3e9e['length']?_0x2c3e9e[0x0]:this['_sortMarkers'](_0x2c3e9e)[0x0],_0x5a81c4=q(this['context']),_0x2f8b0a=_0x5a81c4['model']['markers']['get'](_0x254e13['id']);if(!_0x2f8b0a)return null;const _0x5fe90=_0x2f8b0a['getRange'](),_0x5f0594=_0x5a81c4['editing']['view']['getDomRoot']();if(!_0x5f0594||!_0x5fe90)return null;const _0x17df81=_0x5f0594['querySelector']('[data-marker-id=\x22'+_0x254e13['id']+'\x22]');return _0x17df81?{'modelRange':_0x5fe90,'domElement':_0x17df81}:null;}['_validateMarkers'](_0x48e8b0,_0x2e3867){const _0x49b629=Array['from'](this['_markers']['keys']()),_0x3ba694=new Map();for(const _0x24a293 of _0x49b629){const _0x428773=_0x48e8b0['model']['markers']['get'](_0x24a293);if(!_0x428773)continue;const _0x50fce9=_0x428773['getStart']()['path'][0x0];_0x3ba694['has'](_0x50fce9)||_0x3ba694['set'](_0x50fce9,[]),_0x3ba694['get'](_0x50fce9)['push'](_0x428773);}const _0x376714=new Set();for(const _0x3e995 of _0x48e8b0['model']['document']['differ']['getChanges']()){let _0x1ed813=-0x1,_0x59b505=null;if('insert'===_0x3e995['type'])_0x59b505=new ht(_0x3e995['position'],_0x3e995['position']['getShiftedBy'](_0x3e995['length'])),_0x1ed813=_0x3e995['position']['path'][0x0];else{if('remove'!==_0x3e995['type'])continue;_0x59b505=new ht(_0x3e995['position']),_0x1ed813=_0x3e995['position']['path'][0x0];}const _0x204256=_0x3ba694['get'](_0x1ed813)||[];if(_0x204256['length']){for(const _0x183001 of _0x204256)if(_0x59b505['root']['rootName']===_0x183001['getRange']()['root']['rootName']&&('insert'!==_0x3e995['type']||!_0x59b505['containsRange'](_0x183001['getRange']()))&&(_0x59b505['isIntersecting'](_0x183001['getRange']())||_0x59b505['start']['isTouching'](_0x183001['getRange']()['end'])||_0x59b505['end']['isTouching'](_0x183001['getRange']()['start']))){const _0x1cfc42=this['_parseMarkerName'](_0x183001['name']);Array['from'](this['_markers']['values']())['filter'](_0x3aa19d=>_0x3aa19d['groupId']===_0x1cfc42['groupId'])['forEach'](_0x532a39=>_0x376714['add'](_0x532a39['id']));}}}if(_0x376714['size']){for(const _0x16e6cd of _0x376714)_0x2e3867['removeMarker'](_0x16e6cd);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x5b012b){for(const {name:_0x1ad426,data:_0x4b7894}of _0x5b012b['model']['document']['differ']['getChangedMarkers']()){if(!_0x1ad426['startsWith'](we))continue;const _0x245ce1=_0x4b7894['oldRange'],_0x9500ae=_0x4b7894['newRange'],_0x4cfbad=_0x245ce1&&'$graveyard'===_0x245ce1['root']['rootName'],_0x4b6e96=_0x9500ae&&'$graveyard'===_0x9500ae['root']['rootName'];if(_0x4cfbad&&_0x4b6e96)continue;const _0x17e21d=this['_parseMarkerName'](_0x1ad426);this['_markers']['get'](_0x1ad426)&&(_0x4b6e96||!_0x9500ae?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x1ad426,'changeId':_0x17e21d['groupId']}):_0x4cfbad&&_0x9500ae&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x1ad426,'changeId':_0x17e21d['groupId']}));}}['_parseMarkerName'](_0x399daa){const _0x2b49c6=_0x399daa['split'](':'),_0x48847a=(_0x2b49c6[0x1]||'')['split']('_');return{'prefix':_0x2b49c6[0x0],'groupId':_0x48847a[0x0],'suffix':_0x48847a[0x1]};}['_translateOperationToEditorContent'](_0x31a2f3,_0x370377,_0x228a37){if('insert'===_0x31a2f3['type']){const _0x1fac81=_0x31a2f3;return new _0x3c78ee(this['_changePosition'](_0x370377['concat'](_0x1fac81['position']['offset']),_0x228a37),_0x1fac81['nodes'],_0x1fac81['baseVersion']);}if('marker'===_0x31a2f3['type']&&_0x31a2f3['name']['startsWith']('$markedRemove')){const _0x2bcb34=_0x31a2f3;return new _0x1cd1bb(_0x2bcb34['name'],_0x2bcb34['oldRange'],this['_changeRange'](_0x2bcb34['newRange'],_0x370377['concat'](_0x2bcb34['newRange']['start']['offset']),_0x370377['concat'](_0x2bcb34['newRange']['end']['offset']),_0x228a37),_0x2bcb34['_markers'],_0x2bcb34['affectsData'],_0x2bcb34['baseVersion']);}return _0x31a2f3;}['_groupAdjacentOperations'](_0x23aaee){if(!_0x23aaee['length'])return[];const _0x16ff8d=[];let _0x83cf55=0x0,_0x2b86e1=0x0,_0x5d726e=[];for(let _0x1a7530=0x0;_0x1a7530<=_0x23aaee['length'];_0x1a7530++){const _0x254a07=_0x23aaee[_0x1a7530],_0x238769=_0x23aaee[_0x1a7530-0x1];!_0x254a07||_0x238769&&!this['_getOperationEnd'](_0x238769)['isTouching'](this['_getOperationStart'](_0x254a07))?(_0x16ff8d['push']({'operations':_0x5d726e,'operationsIsolated':_0x5d726e['map'](_0x28a109=>this['_shiftOperation'](_0x28a109['clone'](),-_0x2b86e1)),'groupOffset':_0x83cf55}),_0x5d726e=_0x254a07?[_0x254a07]:[],_0x2b86e1+=_0x83cf55,_0x83cf55=0x0):_0x5d726e['push'](_0x254a07),_0x254a07&&'insert'===_0x254a07['type']&&(_0x83cf55+=_0x254a07['howMany']);}return _0x16ff8d;}['_findAdjacentContextDistance'](_0xc1668d,_0x3ffebf,_0x335de3,_0x5ba939=0x1){const _0x37eb06=new _0x20a667({'startPosition':_0xc1668d,'direction':_0x3ffebf});let _0x42526a=0x0;for(let _0x5b6b0d=0x0;_0x5b6b0d<_0x5ba939;_0x5b6b0d++){let _0x1768b1=0x0,_0x25c9a2=!0x1,_0x2db8de='forward'===_0x3ffebf?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x44954b}of _0x37eb06)if(_0x44954b['is']('$textProxy')){const _0x1d8134=_0x2db8de['exec'](_0x44954b['data']);if(_0x1d8134&&_0x1d8134['length']){if(_0x1768b1+='forward'===_0x3ffebf?_0x1d8134['index']+_0x1d8134[0x0]['length']:_0x44954b['data']['length']-_0x1d8134['index'],_0x1d8134[0x0]['length']!==_0x44954b['data']['length'])break;_0x25c9a2=!0x0,_0x2db8de='forward'===_0x3ffebf?/^\w+/:/\w+$/;}else{if(_0x25c9a2)break;_0x1768b1+=_0x44954b['offsetSize'];}}else{if(_0x44954b['is']('element')){_0x335de3['isInline'](_0x44954b)&&!_0x25c9a2&&(_0x1768b1+=0x1);break;}}_0x42526a+=_0x1768b1,_0x37eb06['jumpTo'](_0xc1668d['getShiftedBy']('forward'===_0x3ffebf?_0x42526a:-_0x42526a));}return _0x42526a;}['_getChangeContext'](_0xe734e7,_0x3ee97e){const _0x1e70f1=q(this['context'])['model']['schema'],_0x371c1a=this['_findAdjacentContextDistance'](_0xe734e7,'backward',_0x1e70f1,0x6),_0x65675e=this['_findAdjacentContextDistance'](_0x3ee97e,'forward',_0x1e70f1,0x6),_0x2712cf=_0xe734e7['getShiftedBy'](-_0x371c1a),_0x694059=_0x3ee97e['getShiftedBy'](_0x65675e);return{'start':_0x2712cf,'end':_0x694059,'hasContentBefore':!_0x2712cf['isAtStart'],'hasContentAfter':!_0x694059['isAtEnd']};}['_insertMarkers'](_0x2150f0){const _0x1eb2b6=this['context']['plugins']['get']('AIEditing'),_0x577611=new Set();q(this['context'])['model']['change'](_0x4e6378=>{for(const _0x2ecbbb of _0x2150f0){const _0x61822d=''+we+_0x2ecbbb['type']+':'+_0x2ecbbb['groupId']+'_'+_0x1eb2b6['_nextDataId'](_0x577611);this['_markers']['set'](_0x61822d,{'id':_0x61822d,'groupId':_0x2ecbbb['groupId'],'type':_0x2ecbbb['type'],'text':_0x2ecbbb['text']}),_0x4e6378['addMarker'](_0x61822d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4e6378['createRange'](_0x2ecbbb['start'],_0x2ecbbb['end'])});}});}['_createGetContextFn'](_0x5cb898,_0x494a27,_0x397612){let _0x31f86c='';return()=>{if(!_0x31f86c){const _0x8dbf49=_0x494a27['toView'](_0x5cb898,{'showSuggestionHighlights':!0x0}),_0x478d01=_0x8dbf49['getChild'](0x0);if(!_0x478d01)return'';let _0x59e825=!0x1;const _0x1b4cc3=[];for(const _0x22ebfe of _0x478d01['getChildren']())_0x22ebfe['is']('element','span')&&_0x22ebfe['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x59e825=!0x1),_0x59e825&&_0x1b4cc3['push'](_0x22ebfe),_0x22ebfe['is']('element','span')&&_0x22ebfe['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x59e825=!0x0);_0x478d01['_removeChildren'](0x0,_0x478d01['childCount']),_0x397612?.['ellipsisBefore']&&_0x478d01['_appendChild']('…'),_0x478d01['_appendChild'](_0x1b4cc3),_0x397612?.['ellipsisAfter']&&_0x478d01['_appendChild']('…');const _0x546a40=_0x494a27['htmlProcessor']['domConverter']['viewToDom'](_0x8dbf49),_0xe56dc8=_0x494a27['htmlProcessor']['htmlWriter']['getHtml'](_0x546a40);_0x31f86c=_0xe56dc8;}return _0x31f86c;};}['_createGetContentFn'](_0x2a42e8,_0x513eef){let _0x446d46='';return()=>(_0x446d46||(_0x446d46=_0x513eef['stringify'](_0x2a42e8,{'showSuggestionHighlights':!0x0})),_0x446d46);}['_createGetContentUsingDataIdFn'](_0x447f0e,_0xa21c52,_0x332a29){let _0x3f0498='';return()=>{if(!_0x3f0498){const _0x3aac6f=_0x332a29['toView'](new at(_0x447f0e)),_0x43bb08=_0x332a29['htmlProcessor']['domConverter']['viewToDom'](_0x3aac6f)['querySelector']('[data-id=\x22'+_0xa21c52+'\x22]');_0x3f0498=_0x43bb08?.['outerHTML']||'';}return _0x3f0498;};}['_findMarkerElement'](_0x37bd50,_0x8d5ce8=0x5){let _0x4d7824=_0x37bd50,_0x258fed=null;for(let _0x11589b=0x0;_0x11589b<_0x8d5ce8&&_0x4d7824;_0x11589b++){if(!_0x4d7824['className']){_0x4d7824=_0x4d7824['parentElement'];continue;}if(!(''+_0x4d7824['className'])['includes']('ck-ai_review-mode-marker_')){_0x4d7824=_0x4d7824['parentElement'];continue;}if(!_0x4d7824['getAttribute']('data-marker-id'))break;_0x258fed=_0x4d7824;break;}return _0x258fed;}['_getMarkersDataForGroup'](_0x4c2f39){return Array['from'](this['_markers']['values']())['filter'](_0x41c202=>_0x41c202['groupId']===_0x4c2f39);}['_getOperationStart'](_0x556171){return'insert'===_0x556171['type']?_0x556171['position']:_0x556171['newRange']['start'];}['_getOperationEnd'](_0x3490b8,_0x121d63=!0x1){return'insert'===_0x3490b8['type']?_0x121d63?_0x3490b8['position']:_0x3490b8['position']['getShiftedBy'](_0x3490b8['howMany']):_0x3490b8['newRange']['end'];}['_shiftOperation'](_0x1f41f6,_0x418a5d){return'insert'===_0x1f41f6['type']?_0x1f41f6['position']=_0x1f41f6['position']['getShiftedBy'](_0x418a5d):'marker'===_0x1f41f6['type']&&_0x1f41f6['newRange']&&(_0x1f41f6['newRange']=new ht(_0x1f41f6['newRange']['start']['getShiftedBy'](_0x418a5d),_0x1f41f6['newRange']['end']['getShiftedBy'](_0x418a5d))),_0x1f41f6;}['_changeOperationOwnerDocument'](_0x2b5298,_0x3186c4){'insert'===_0x2b5298['type']?_0x2b5298['position']=this['_changePositionOwnerDocument'](_0x2b5298['position'],_0x3186c4):'marker'===_0x2b5298['type']&&_0x2b5298['newRange']&&(_0x2b5298['newRange']=this['_changeRangeOwnerDocument'](_0x2b5298['newRange'],_0x3186c4));}['_changePositionOwnerDocument'](_0x40c684,_0x58cfcc){return new ct(_0x58cfcc,_0x40c684['path']);}['_changeRangeOwnerDocument'](_0x43be54,_0x5315c3){return new ht(this['_changePositionOwnerDocument'](_0x43be54['start'],_0x5315c3),this['_changePositionOwnerDocument'](_0x43be54['end'],_0x5315c3));}['_changePosition'](_0x1fffcb,_0x4fab8a){return new ct(_0x4fab8a,[..._0x1fffcb]);}['_changeRange'](_0x4f19e7,_0x18da6f,_0x123682,_0x542ad2){return new ht(this['_changePosition'](_0x18da6f,_0x542ad2),this['_changePosition'](_0x123682,_0x542ad2));}['_sortMarkers'](_0x1f925e){const _0x1fdc5f=_0x2c513d=>{switch(_0x2c513d){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x1f925e['sort']((_0x35bf26,_0x5ca901)=>_0x1fdc5f(_0x35bf26['type'])-_0x1fdc5f(_0x5ca901['type']));}['_hasSameTopLevelElement'](_0x14c6e2,_0x5d7d0b){const _0xa99286=_0x14c6e2['getChild'](0x0),_0x14d21b=_0x5d7d0b['getChild'](0x0);return!(!_0xa99286||!_0x14d21b)&&((!_0xa99286['is']('element')||!_0x14d21b['is']('element')||_0xa99286['name']===_0x14d21b['name'])&&!(_0xa99286['is']('element')&&!_0x14d21b['is']('element')||!_0xa99286['is']('element')&&_0x14d21b['is']('element')));}}class Ua extends _0x3e59e0{static get['requires'](){return[re,me,ce];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,x as AIAdapter,qn as AIAssistant,n as AIAssistantUI,it as AIBalloon,Da as AIChat,mt as AIChatController,gt as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,dt as AIChatUI,R as AIConnector,N as AIEditing,Pa as AIEditorIntegration,Ft as AIQuickActionType,Ma as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,js as AIReviewCheck,Rs as AIReviewCheckResult,Ts as AIReviewCheckRun,Ua as AIReviewMode,re as AIReviewModeController,ce as AIReviewModeEditing,me as AIReviewModeUI,Ct as AITabs,pe as AITextAdapter,qt as AIToggleButtonUI,zn as AWSTextAdapter,Xn as OpenAITextAdapter,E as ShowAIAssistantCommand,co as ToggleAICommand,ks as createResizeButton,Qn as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x3711b7,Command as Nt,ContextPlugin as _0x267838,Editor as st}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x54fc92,IconCheck as _0x47bafa,IconError as _0x141f49,IconSubmit as _0x3a517e,IconAIHistory as Ht,IconMagicWand as _0x2b987d,IconRobotPencil as _0x547788,IconMaximize as _0x10f52f,IconMinimize as to,IconDocumentWithLoupe as _0x193385,IconAddComment as _0x87ebb0,IconShowChangesOn as _0x5f4a4e,IconShowChangesOff as _0x1c85b2,IconDocument as _0x2cbef8,IconThreeStars as _0x3b149b,IconRemove as _0x449359,IconDocumentWithCheckmark as _0x13c00f,IconDocumentWithCross as _0x5511b4,IconLoupe as _0x15be19,IconCancel as _0x27c5a9,IconStop as _0x2b48d9,IconAIChat as _t,IconPlus as _0x17d64d,IconPin as _0x47880f,IconThreeHorizontalDots as _0x3c01b9,IconChevronRight as _0x5a11af,IconInfo as _0x4ae3dc,IconOutdated as _0x44d7c8,IconEye as _0x554163,IconEyeCrossedOut as _0x320f3e,IconAIReview as _0x30da4f}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5ef33e,CKEditorError as _0x239292,ObservableMixin as _0x314197,global as _0x218ca6,isVisible as _0x5a4e2b,Rect as _0x507e52,Collection as _0x4c3887,FocusTracker as ts,KeystrokeHandler as _0x4c12a2,first as _0x457991,toArray as _0x2141c6,EmitterMixin as _0x7d5e47,logWarning as _0x361f9e,scrollViewportToShowTarget as _0x10737b,logError as ot,ResizeObserver as _0x459443,_isMotionReduced as It,scrollAncestorsToShowTarget as _0x9d44c8,DomEmitterMixin as _0x14a852}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x4deb4c,ButtonView as _0x5cde82,View as _0x10aa9f,SpinnerView as _0x2265d2,IconView as _0x3dad93,AutocompleteView as _0x329d79,ListView as _0x4a219d,ListItemGroupView as _0x136b89,ListItemView as _0x2ced3c,ButtonLabelView as _0x342201,FocusCycler as $t,createLabeledTextarea as _0x2485cf,Dialog as _0x161ed4,createDropdown as _0x1fe5fd,addMenuToDropdown as _0x11e5a3,MenuBarMenuView as _0x2d240a,MenuBarMenuListItemButtonView as _0x3c5e19,DialogViewPosition as _0x43cf0d,MenuBarMenuListView as ti,MenuBarMenuListItemView as _0x29d062,UIModel as _0x238f2a,SplitButtonView as _0x1cf9f8,BalloonPanelView as _0x179f18,BodyCollection as qt,clickOutsideHandler as _0x2cf367,ListItemButtonView as _0x993614,ViewCollection as _0x285700,addListToDropdown as _0x43d564,submitHandler as _0x256be1,LabeledFieldView as _0x2acda0,createLabeledInputText as _0x3090df,FormHeaderView as _0x4f9b0c,HighlightedTextView as _0x4eed03,FileDialogButtonView as _0x522a32,InputTextView as _0x35834b,SearchTextView as _0x722ee7,DropdownMenuButtonView as _0x15c9c1,DropdownMenuPanelPositioningFunctions as _0x426b9b,BalloonToolbar as zt,FormRowView as _0x4f6c96,TextareaView as _0x317754}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x5586c9,ClipboardMarkersUtils as _0x4939a6}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x298a3f,ViewDataTransfer as _0x390f6a,ViewUpcastWriter as _0x38d8fd,Matcher as _0x1bda3b,_DetachOperation as _0x207911,_insertIntoModelNodeList as _0x2720f2,_removeFromModelNodeList as _0x3666da,ModelRange as _0x473568,ViewDowncastWriter as kt,transformOperationSets as _0x1c1e0c,ModelDocumentFragment as _0x42c406,ModelPosition as _0x2a6f0c,ModelTreeWalker as _0x1c22cf,InsertOperation as te,MarkerOperation as _0x55facf}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0xd2685e,escape as _0x59aba,escapeRegExp as _0x186f47}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x5a8df5,InvokeModelWithResponseStreamCommand as _0x440801,InvokeModelCommand as _0x14bf18}from'@aws-sdk/client-bedrock-runtime';import{createParser as wt}from'eventsource-parser';import{parseDocument as _0x2e2d8f}from'htmlparser2';import{isTag as _0x5bf45b,findOne as gt,getParent as _0x375dfb,findAll as _0x5bf864,removeElement as _0x5de200,replaceElement as _0x3ad05b,prepend as _0x1b3de7,prependChild as _0x10bdac,appendChild as _0x838115,append as _0x24dd09,find as _0x5b38d5,isComment as _0x1f159b,getChildren as _0xbebafa,textContent as _0x439ba7}from'domutils';import _0x259462 from'dom-serializer';import{Document as mt,Element as _0x3d5305,Text as _0x40d4fe,cloneNode as _0x19eeb8,isDocument as _0x2f8491,isText as _0x1ddb5a,NodeWithChildren as _0x10a76f}from'domhandler';import{MarkdownGfmMdToHtml as _0x4652b8}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x2fe0fa,getAllMarkersDomElementsSorted as _0x27098b,DocumentCompare as _0x4176c6,DATA_ID_MODEL_ATTRIBUTE as ct,ConfirmMixin as _0x3a5d8a,LateFocusDropdownButtonView as _0x2515fe,DATA_ID_VIEW_ATTRIBUTE as _0x3ebb99}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x3af120}from'es-toolkit';import{IconThumbUp as _0x5c7a21,IconThumbDown as _0x2b5af5,IconCopy as _0x5165e9,IconCheck as _0x222bf2,IconShowChangesOff as _0x17eb0a,IconShowChangesOn as _0x47c4e2,IconWeb as _0x340ab6,IconNextArrow as _0x1524bc,IconPreviousArrow as _0x52404d,IconAI as Ct,IconClose as _0x3c4bba,IconSelection as _0x5ce07c,IconFileUpload as _0x18f1cd,IconLink as _0xe254f0,IconDocument as _0x3af6f7,IconBulb as _0x18edd5,IconDocumentOutline as _0x2ca83b,IconPaperClip as _0x5e57c2,IconBrowseFiles as _0x2625c2,IconDropdownArrow as _0xb14688,IconAIAskAI as _0x3e2624,IconAIQuickActions as _0x2faead,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 _0x384b34}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x2be199 from'morphdom';import{SuggestionsConversion as Pt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x271aee}from'diff';const ei='_ungrouppedCommands';function z(_0x1a1b0e,_0x27ea69){const _0x537c6d=(0x0,_0x27ea69['t'])('Other');return _0x1a1b0e['length']?'groupId'in _0x1a1b0e[0x0]?_0x1a1b0e:[{'groupId':ei,'groupLabel':_0x537c6d,'order':0x1/0x0,'commands':_0x1a1b0e}]:[{'groupId':ei,'groupLabel':_0x537c6d,'order':0x1/0x0,'commands':[]}];}const Fn=globalThis['DataTransfer'],q='ai-ui';class F extends _0x3711b7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1c398f}=this,_0x5d64c7=['ck-fake-ai-selection'];_0x1c398f['config']['get']('ai.assistant.useTheme')&&_0x5d64c7['push']('ck-ai-assistant-ui_theme'),_0x1c398f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':q,'view':{'classes':_0x5d64c7,'priority':0xc}}),_0x1c398f['conversion']['for']('editingDowncast')['markerToElement']({'model':q,'view':(_0x434c04,{writer:_0x39d1e3})=>{if(!_0x434c04['markerRange']['isCollapsed'])return null;const _0x4f05d2=_0x39d1e3['createUIElement']('span');return _0x39d1e3['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4f05d2),_0x4f05d2;}});}['afterInit'](){!async function(_0x10b357){const _0xcdc22=_0x304e5b([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]),_0x2d8b9f=0x3dffc4e1,_0x2fd7b8=0x3df8bcd9^_0x2d8b9f,_0x41af6e=window[_0x304e5b([0x44,0x61,0x74,0x65])][_0x304e5b([0x6e,0x6f,0x77])](),_0x51cd80=_0x10b357[_0x304e5b([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2c4dd3=new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xb53b65=>{_0x51cd80[_0x304e5b([0x6f,0x6e,0x63,0x65])](_0x304e5b([0x72,0x65,0x61,0x64,0x79]),_0xb53b65);}),_0x273dd7={[_0x304e5b([0x6b,0x74,0x79])]:_0x304e5b([0x45,0x43]),[_0x304e5b([0x75,0x73,0x65])]:_0x304e5b([0x73,0x69,0x67]),[_0x304e5b([0x63,0x72,0x76])]:_0x304e5b([0x50,0x2d,0x32,0x35,0x36]),[_0x304e5b([0x78])]:_0x304e5b([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]),[_0x304e5b([0x79])]:_0x304e5b([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]),[_0x304e5b([0x61,0x6c,0x67])]:_0x304e5b([0x45,0x53,0x32,0x35,0x36])},_0xf46e4b=_0x51cd80[_0x304e5b([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x304e5b([0x67,0x65,0x74])](_0x304e5b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x13d6e5(){let _0x4bf36b,_0x19828d=null,_0x16dadb=null;try{if(_0xf46e4b==_0x304e5b([0x47,0x50,0x4c]))return _0x304e5b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4bf36b=_0x2a50be(),!_0x4bf36b)return _0x304e5b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4bf36b[_0x304e5b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x16dadb=_0x12b6dc(_0x4bf36b[_0x304e5b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4bf36b[_0x304e5b([0x6a,0x74,0x69])])),await _0x19a8d6()?_0x34c5ce()?_0x4004ce()?_0x304e5b([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3ec629()?(_0x4bf36b[_0x304e5b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x304e5b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x19828d=_0x1ba171(_0x304e5b([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x4bf36b[_0x304e5b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x304e5b([0x74,0x72,0x69,0x61,0x6c])&&(_0x19828d=_0x1ba171(_0x304e5b([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x163a0c()):_0x304e5b([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x304e5b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x304e5b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x304e5b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4004ce(){const _0x5063ef=[_0x304e5b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x304e5b([0x74,0x72,0x69,0x61,0x6c])][_0x304e5b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4bf36b[_0x304e5b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x41af6e/0x3e8:0xe10*_0x2fd7b8;return _0x4bf36b[_0x304e5b([0x65,0x78,0x70])]<_0x5063ef;}function _0x34c5ce(){const _0x3e75b4=_0x4bf36b[_0x304e5b([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3e75b4&&(!!_0x3e75b4[_0x304e5b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x304e5b([0x2a]))||!!_0x3e75b4[_0x304e5b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x304e5b([0x41,0x49])));}function _0x3ec629(){const _0x23219c=_0x4bf36b[_0x304e5b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x23219c||0x0==_0x23219c[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x47ed56}=new URL(window[_0x304e5b([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x23219c[_0x304e5b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x47ed56))return!0x0;const _0x128691=_0x47ed56[_0x304e5b([0x73,0x70,0x6c,0x69,0x74])](_0x304e5b([0x2e]));return _0x23219c[_0x304e5b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x29a413=>_0x29a413[_0x304e5b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x304e5b([0x2a])))[_0x304e5b([0x6d,0x61,0x70])](_0xdd5d64=>_0xdd5d64[_0x304e5b([0x73,0x70,0x6c,0x69,0x74])](_0x304e5b([0x2e])))[_0x304e5b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xc4561e=>_0xc4561e[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x128691[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x304e5b([0x6d,0x61,0x70])](_0x45e21b=>Array(_0x128691[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x45e21b[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x304e5b([0x66,0x69,0x6c,0x6c])](_0x45e21b[0x0]===_0x304e5b([0x2a])?_0x304e5b([0x2a]):'')[_0x304e5b([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x45e21b))[_0x304e5b([0x73,0x6f,0x6d,0x65])](_0x3eac45=>_0x128691[_0x304e5b([0x65,0x76,0x65,0x72,0x79])]((_0x1de0b4,_0x367ca4)=>_0x3eac45[_0x367ca4]===_0x1de0b4||_0x3eac45[_0x367ca4]===_0x304e5b([0x2a])));}function _0x163a0c(){return _0x19828d&&_0x16dadb?new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1e974f,_0x169a64)=>{_0x19828d[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x1e974f,_0x169a64),_0x16dadb[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x5f47b3=>{_0x5f47b3!=_0x304e5b([0x56,0x61,0x6c,0x69,0x64])&&_0x1e974f(_0x5f47b3);},_0x169a64);}):_0x19828d||_0x16dadb||_0x304e5b([0x56,0x61,0x6c,0x69,0x64]);}}function _0x12b6dc(_0x183d3a,_0x234be5){return new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x320d8f=>{if(_0x207e32())return _0x320d8f(_0x304e5b([0x56,0x61,0x6c,0x69,0x64]));_0x35042c(),_0x51cd80[_0x304e5b([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x304e5b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x23441a=!0x1;const _0x113280=_0x5ef33e();function _0x118313(_0x4d16f3){return!!_0x4d16f3&&(typeof _0x4d16f3===_0x304e5b([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4d16f3===_0x304e5b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4d16f3[_0x304e5b([0x74,0x68,0x65,0x6e])]===_0x304e5b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4d16f3[_0x304e5b([0x63,0x61,0x74,0x63,0x68])]===_0x304e5b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x43bd92(_0xafac46){_0x14ea3e(_0xafac46)[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x54e015=>{if(!_0x54e015||_0x54e015[_0x304e5b([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x304e5b([0x6f,0x6b]))return _0x304e5b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x19384e(_0x4152b9(_0x113280+_0x234be5))!=_0x54e015[_0x304e5b([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x304e5b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x304e5b([0x56,0x61,0x6c,0x69,0x64]);})[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x5bc282=>(_0x3c81aa(),_0x5bc282),()=>{const _0x13952d=_0xde0b4a();return null==_0x13952d?(_0x3c81aa(),_0x304e5b([0x56,0x61,0x6c,0x69,0x64])):_0x304e5b(_0x41af6e-_0x13952d>(0x19f340e1^_0x2d8b9f)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x320d8f)[_0x304e5b([0x63,0x61,0x74,0x63,0x68])](()=>{_0x320d8f(_0x304e5b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5aabcf=0x3dc92a61^_0x2d8b9f;function _0x3c81aa(){const _0x3aacf1=_0x304e5b([0x6c,0x6c,0x63,0x74,0x2d])+_0x19384e(_0x4152b9(_0x183d3a)),_0x31ee41=_0x2946d9(_0x19384e(window[_0x304e5b([0x4d,0x61,0x74,0x68])][_0x304e5b([0x63,0x65,0x69,0x6c])](_0x41af6e/_0x5aabcf)));window[_0x304e5b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x304e5b([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3aacf1,_0x31ee41);}function _0xde0b4a(){const _0x589307=_0x304e5b([0x6c,0x6c,0x63,0x74,0x2d])+_0x19384e(_0x4152b9(_0x183d3a)),_0x5bc013=window[_0x304e5b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x304e5b([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x589307);return _0x5bc013?window[_0x304e5b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2946d9(_0x5bc013),0x10)*_0x5aabcf:null;}function _0x14ea3e(_0x4f0b71){return new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5d116a,_0x3a02cf)=>{_0x4f0b71[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x5d116a,_0x3a02cf),window[_0x304e5b([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3a02cf,0x3dfe1021^_0x2d8b9f);});}}_0x51cd80[_0x304e5b([0x6f,0x6e])](_0x304e5b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1bcd24,_0x528878)=>{if(_0x528878[0x0]!=_0x183d3a)return _0x320d8f(_0x304e5b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x528878[0x1]={..._0x528878[0x1],[_0x304e5b([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x113280};},{[_0x304e5b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x304e5b([0x68,0x69,0x67,0x68])}),_0x51cd80[_0x304e5b([0x6f,0x6e])](_0x304e5b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2fabd5=>{_0x118313(_0x2fabd5[_0x304e5b([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x23441a=!0x0,_0x43bd92(_0x2fabd5[_0x304e5b([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x304e5b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x304e5b([0x6c,0x6f,0x77])}),_0x2c4dd3[_0x304e5b([0x74,0x68,0x65,0x6e])](()=>{_0x23441a||_0x320d8f(_0x304e5b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x207e32(){return _0x51cd80[_0x304e5b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x304e5b([0x76,0x69,0x65,0x77])][_0x304e5b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x304e5b([0x61,0x75,0x74,0x6f]);}function _0x35042c(){_0x51cd80[_0x304e5b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x304e5b([0x76,0x69,0x65,0x77])][_0x304e5b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x304e5b([0x61,0x75,0x74,0x6f]);}}function _0x1ba171(_0x32841a){const _0x26d412=[new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5a83aa=>setTimeout(_0x5a83aa,0x3df6fa2d^_0x2d8b9f)),_0x2c4dd3[_0x304e5b([0x74,0x68,0x65,0x6e])](()=>new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x347bcd=>{let _0x12b217=0x0;_0x51cd80[_0x304e5b([0x6d,0x6f,0x64,0x65,0x6c])][_0x304e5b([0x6f,0x6e])](_0x304e5b([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3e0f0a,_0x283157)=>{_0x283157[0x0][_0x304e5b([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x12b217++,_0x12b217==(0x3dffc519^_0x2d8b9f)&&(_0x347bcd(),_0x3e0f0a[_0x304e5b([0x6f,0x66,0x66])]());});}))];return window[_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x304e5b([0x72,0x61,0x63,0x65])](_0x26d412)[_0x304e5b([0x74,0x68,0x65,0x6e])](()=>_0x32841a);}async function _0x5750f9(){await _0x2c4dd3,_0x51cd80[_0x304e5b([0x6d,0x6f,0x64,0x65,0x6c])][_0x304e5b([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5ebbc9,_0x51cd80[_0x304e5b([0x6d,0x6f,0x64,0x65,0x6c])][_0x304e5b([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5ebbc9,_0x51cd80[_0x304e5b([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x304e5b([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x53fca4(_0x3bfefd){const _0xfff093=_0x169183();_0x51cd80[_0xfff093]=_0x304e5b([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3bfefd,_0x3bfefd!=_0x304e5b([0x56,0x61,0x6c,0x69,0x64])&&_0x5750f9();}function _0x169183(){const _0x108b6c=window[_0x304e5b([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x304e5b([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x304e5b([0x6e,0x6f,0x77])]())[_0x304e5b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x304e5b([0x2e]),'');let _0x3c43ac=_0x304e5b([0x6e]);for(let _0x4b93e8=0x0;_0x4b93e8<_0x108b6c[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4b93e8+=0x2){let _0x40b3e2=window[_0x304e5b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x108b6c[_0x304e5b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4b93e8,_0x4b93e8+0x2));_0x40b3e2>=_0xcdc22[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x40b3e2-=_0xcdc22[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3c43ac+=_0xcdc22[_0x40b3e2];}return _0x3c43ac;}function _0x2a50be(){const _0x5de340=_0xf46e4b[_0x304e5b([0x73,0x70,0x6c,0x69,0x74])](_0x304e5b([0x2e]));if(0x3!=_0x5de340[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xb15f4(_0x5de340[0x1]);function _0xb15f4(_0x4bc2d8){const _0x308a21=_0x13b19d(_0x4bc2d8);return _0x308a21&&_0x243b2c()?_0x308a21:null;function _0x243b2c(){const _0x31cd50=_0x308a21[_0x304e5b([0x6a,0x74,0x69])],_0x54d136=window[_0x304e5b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x31cd50[_0x304e5b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x31cd50[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4c1208={..._0x308a21,[_0x304e5b([0x6a,0x74,0x69])]:_0x31cd50[_0x304e5b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x31cd50[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4c1208[_0x304e5b([0x76,0x63])],_0x4152b9(_0x4c1208)==_0x54d136;}}}async function _0x19a8d6(){let _0x507275=!0x0;try{const _0x4d09c8=_0xf46e4b[_0x304e5b([0x73,0x70,0x6c,0x69,0x74])](_0x304e5b([0x2e])),[_0xaa08be,_0x5d43c9,_0x47a33f]=_0x4d09c8;return _0x4b7350(_0xaa08be),await _0x4ed4d5(_0xaa08be,_0x5d43c9,_0x47a33f),_0x507275;}catch{return!0x1;}function _0x4b7350(_0x159b29){const _0xb27fc5=_0x13b19d(_0x159b29);_0xb27fc5&&_0xb27fc5[_0x304e5b([0x61,0x6c,0x67])]==_0x304e5b([0x45,0x53,0x32,0x35,0x36])||(_0x507275=!0x1);}async function _0x4ed4d5(_0x5e9c3e,_0x3aea87,_0x4b8e29){const _0x322be3=window[_0x304e5b([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x304e5b([0x66,0x72,0x6f,0x6d])](_0x17ebc9(_0x4b8e29),_0x47e4a4=>_0x47e4a4[_0x304e5b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x137ec3=new window[(_0x304e5b([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x304e5b([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5e9c3e+_0x304e5b([0x2e])+_0x3aea87),_0x1232bb=window[_0x304e5b([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x304e5b([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1232bb)return;const _0x53ffae=await _0x1232bb[_0x304e5b([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x304e5b([0x6a,0x77,0x6b]),_0x273dd7,{[_0x304e5b([0x6e,0x61,0x6d,0x65])]:_0x304e5b([0x45,0x43,0x44,0x53,0x41]),[_0x304e5b([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x304e5b([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x304e5b([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1232bb[_0x304e5b([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x304e5b([0x6e,0x61,0x6d,0x65])]:_0x304e5b([0x45,0x43,0x44,0x53,0x41]),[_0x304e5b([0x68,0x61,0x73,0x68])]:{[_0x304e5b([0x6e,0x61,0x6d,0x65])]:_0x304e5b([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x53ffae,_0x322be3,_0x137ec3)||(_0x507275=!0x1);}}function _0x13b19d(_0x41b8db){return _0x41b8db[_0x304e5b([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x304e5b([0x65,0x79]))?JSON[_0x304e5b([0x70,0x61,0x72,0x73,0x65])](_0x17ebc9(_0x41b8db)):null;}function _0x17ebc9(_0x6ce853){return window[_0x304e5b([0x61,0x74,0x6f,0x62])](_0x6ce853[_0x304e5b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x304e5b([0x2b]))[_0x304e5b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x304e5b([0x2f])));}function _0x4152b9(_0x4c95c2){let _0x5757a5=0x1505;function _0x3766f7(_0x196885){for(let _0x480b26=0x0;_0x480b26<_0x196885[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x480b26++){const _0x28715f=_0x196885[_0x304e5b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x480b26);_0x5757a5=(_0x5757a5<<0x5)+_0x5757a5+_0x28715f,_0x5757a5&=_0x5757a5;}}function _0x36eeca(_0x9ecda5){Array[_0x304e5b([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x9ecda5)?_0x9ecda5[_0x304e5b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x36eeca):_0x9ecda5&&typeof _0x9ecda5==_0x304e5b([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x304e5b([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x9ecda5)[_0x304e5b([0x73,0x6f,0x72,0x74])]()[_0x304e5b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x5b4b1a,_0x3bba45])=>{_0x3766f7(_0x5b4b1a),_0x36eeca(_0x3bba45);}):_0x3766f7(window[_0x304e5b([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x9ecda5));}return _0x36eeca(_0x4c95c2),_0x5757a5>>>0x0;}function _0x19384e(_0x470ebe){return _0x470ebe[_0x304e5b([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x304e5b([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x304e5b([0x30]));}function _0x2946d9(_0x70dc42){return _0x70dc42[_0x304e5b([0x73,0x70,0x6c,0x69,0x74])]('')[_0x304e5b([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x304e5b([0x6a,0x6f,0x69,0x6e])]('');}function _0x5ebbc9(){}function _0x304e5b(_0x52ddce){return _0x52ddce['map'](_0x1e5e21=>String['fromCharCode'](_0x1e5e21))['join']('');}_0x53fca4(await _0x13d6e5());}(this);}['showFakeVisualSelection'](){const _0x4d6ce9=this['editor']['model'];_0x4d6ce9['change'](_0x381867=>{const _0x2ae3cf=_0x4d6ce9['document']['selection']['getRanges']();let _0x411d20=0x0;for(const _0x1483ec of _0x2ae3cf){const _0x23bba2=q+':'+_0x411d20;if(_0x4d6ce9['markers']['has'](_0x23bba2))_0x381867['updateMarker'](_0x23bba2,{'range':_0x1483ec});else{if(_0x1483ec['start']['isAtEnd']){const _0x67c159=_0x1483ec['start']['getLastMatchingPosition'](({item:_0x46209d})=>!_0x4d6ce9['schema']['isContent'](_0x46209d),{'boundaries':_0x1483ec});_0x381867['addMarker'](_0x23bba2,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x381867['createRange'](_0x67c159,_0x1483ec['end'])});}else _0x381867['addMarker'](_0x23bba2,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1483ec});}_0x411d20++;}});}['hideFakeVisualSelection'](){const _0x2fb367=this['editor']['model'],_0x29ae76=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](q));_0x29ae76['length']&&_0x2fb367['change'](_0xfb282d=>{_0x29ae76['forEach'](_0x27f81b=>{_0xfb282d['removeMarker'](_0x27f81b);});});}['insertContent'](_0x42e71b,_0x502bd7){const _0x901e01=this['_getAISelection'](),_0x281dd3=_0x502bd7||_0x901e01['getFirstRange']();this['editor']['model']['canEditAt'](_0x281dd3)&&this['editor']['model']['change'](_0x1e4489=>{this['hideFakeVisualSelection'](),_0x502bd7||this['_resetContentOfSelectedTableCells'](_0x1e4489,_0x901e01),this['_pasteHTMLUsingClipboard']({'insertAt':_0x281dd3,'writer':_0x1e4489,'html':_0x42e71b});});}['insertContentBelow'](_0x2c4e9e){const {model:_0xa2b630}=this['editor'],_0x1c69dd=this['_getAISelection']();_0xa2b630['change'](()=>{const _0x2c623a=this['_prepareTableInsertBelowPosition'](_0x2c4e9e,_0x1c69dd)||this['_getDefaultInsertBelowPosition'](_0x1c69dd);this['insertContent'](_0x2c4e9e,_0x2c623a);});}['_getAISelection'](){const _0x3d16ea=this['editor']['model'],_0x812aea=Array['from'](_0x3d16ea['markers']['getMarkersGroup'](q))['map'](_0x2e2f80=>_0x2e2f80['getRange']());return _0x3d16ea['createSelection'](_0x812aea);}['_pasteHTMLUsingClipboard']({writer:_0xd033f6,html:_0x3a5e4e,insertAt:_0x221d2d}){const {view:_0x2a84f2}=this['editor']['editing'],_0x523c55=this['editor']['plugins']['get'](_0x5586c9),_0x293fdb=new Fn();_0x293fdb['setData']('text/html',_0x3a5e4e);const _0x5dbea4=new ClipboardEvent('paste',{'clipboardData':_0x293fdb}),_0x1fae46=new _0x298a3f(_0x2a84f2,_0x5dbea4,{'dataTransfer':new _0x390f6a(_0x293fdb)});_0xd033f6['setSelection'](_0x221d2d);const _0x58cf5b=(_0x48f070,_0x3ee1d9)=>{_0x3ee1d9['resultRange']&&_0xd033f6['setSelection'](_0x3ee1d9['resultRange']);};_0x523c55['once']('contentInsertion',_0x58cf5b,{'priority':'lowest'}),_0x2a84f2['document']['fire']('paste',_0x1fae46),_0x523c55['off']('contentInsertion',_0x58cf5b);}['_getDefaultInsertBelowPosition'](_0x3945f8){const {model:_0x5c2ae7}=this['editor'],_0x226e15=Array['from'](_0x3945f8['getSelectedBlocks']());return _0x226e15['length']?_0x5c2ae7['createPositionAfter'](_0x226e15['pop']()):_0x3945f8['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x39ba92,_0x434ba6){const {model:_0x84b814,plugins:_0x53bf48}=this['editor'];if(_0x53bf48['has']('TableUtils')){const _0x2b19cb=_0x53bf48['get']('TableUtils')['getSelectedTableCells'](_0x434ba6);if(_0x2b19cb['length']){const _0x59fd96=this['_getTableRowCountFromContent'](_0x39ba92),_0x4ef6e8=this['_createEmptyTableRows'](_0x2b19cb,_0x59fd96);return _0x84b814['createPositionAt'](_0x4ef6e8,0x0);}}return null;}['_getTableRowCountFromContent'](_0x580206){const _0x1a1b09=this['editor']['plugins']['get']('TableUtils'),_0x4c6919=this['editor']['data']['parse'](_0x580206),_0x1fb183=Array['from'](_0x4c6919['getChildren']())['filter'](_0x57efc5=>_0x57efc5['is']('element','table'));let _0x569c5b=0x0;return _0x1fb183['forEach'](_0x302c83=>{_0x569c5b+=_0x1a1b09['getRows'](_0x302c83);}),_0x569c5b;}['_createEmptyTableRows'](_0x1f1a7f,_0x39d082){const _0x3deab5=this['editor']['plugins']['get']('TableUtils'),_0x1254ed=_0x3deab5['getRowIndexes'](_0x1f1a7f),_0x14eb11=_0x3deab5['getColumnIndexes'](_0x1f1a7f),_0x5ec4b0=_0x1254ed['last']+0x1,_0x111b23=_0x14eb11['first'],_0x270e24=_0x1f1a7f[0x0]['findAncestor']('table');for(let _0xce098b=0x0;_0xce098b<_0x39d082;_0xce098b++)_0x3deab5['insertRows'](_0x270e24,{'at':_0x5ec4b0});return _0x270e24['getChild'](_0x5ec4b0)['getChild'](_0x111b23);}['_resetContentOfSelectedTableCells'](_0x3e1f4c,_0x46488c){const {plugins:_0x16f167}=this['editor'],{model:_0x5e4172}=_0x3e1f4c;if(!_0x16f167['has']('TableUtils'))return;_0x16f167['get']('TableUtils')['getSelectedTableCells'](_0x46488c)['length']&&_0x5e4172['deleteContent'](_0x46488c);}}class ni extends _0x3711b7{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x239292('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x1ec9be){super(_0x1ec9be),this['name']='AIRequestError';}}function Yn(_0x1983fa,_0xed8cc0,_0xdc777d){const t=_0x1983fa['t'];switch(_0xed8cc0){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',_0xdc777d);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xdc777d);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'},_0xdc777d);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 _0xed8cc0;}}class ai extends Nt{['_commandDefinitions'];constructor(_0x50688e,_0x2bd627){super(_0x50688e),this['_commandDefinitions']=_0x2bd627,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x49be4b,_0x48045d,_0x42425b)=>{this['isEnabled']&&(this['enabledCommandsIds']=cs(this['_commandDefinitions'],_0x42425b));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1e18ce,_0x1a5d0e,_0x3698f7)=>{this['enabledCommandsIds']=_0x3698f7?cs(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x4994bf=this['editor']['model'];this['_hasContext']=function(_0x252349){const _0x1ab4af=_0x252349['document']['selection'];return _0x1ab4af['isCollapsed']?0x0!==[..._0x1ab4af['getSelectedBlocks']()]['length']&&![..._0x1ab4af['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x252349['hasContent'](_0x1ab4af['getFirstRange']());}(_0x4994bf);const _0x1952e2=_0x4994bf['document']['selection'],_0x276547=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x499c94 of _0x1952e2['getRanges']())for(const _0x2642a4 of _0x499c94['getItems']())if(_0x2642a4['is']('element')&&_0x276547['includes'](_0x2642a4['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2cd0ed='',_0x117ebd='',_0x1be8fb='custom'){this['editor']['plugins']['get'](G)['showUI'](_0x2cd0ed,_0x117ebd,_0x1be8fb);}}function cs(_0x527508,_0x58cf85){const _0x31a52f=new Set();for(const _0x29b200 of _0x527508['values']())(_0x58cf85||!0x1===_0x29b200['requiresContent'])&&_0x31a52f['add'](_0x29b200['id']);return Array['from'](_0x31a52f);}const as=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class oi extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x314197(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5b17d1,_0x135b81,_0x39745b){super(),this['editor']=_0x5b17d1,this['textAdapter']=_0x135b81,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x39745b,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x8fe5d6,_0x320ccc,_0x4553c7)=>{this['view']['value']=this['_sanitizeHTML'](_0x4553c7);}),this['listenTo'](this['view'],'submitPrompt',(_0x61a7e9,_0x531a03)=>{const _0x450a58=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x531a03,_0x450a58,'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:_0x5c99c4,query:_0xabb99e,htmlContent:_0x234609,label:_0x1e25d8,mainActionLabel:_0x4a98d9}){this['view']['prompt']=_0x1e25d8,this['view']['mainAction']=_0x4a98d9,this['initialContext']=_0x234609,_0xabb99e&&(this['view']['isRendered']?this['_handleQuery'](_0xabb99e,_0x234609,_0x5c99c4,_0x1e25d8):this['view']['once']('render',()=>{this['_handleQuery'](_0xabb99e,_0x234609,_0x5c99c4,_0x1e25d8);}));}['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'](_0x520a1e,_0x82b2d2,_0x55e541,_0x1dd5e6){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x82b2d2,this['previousQuery']=_0x520a1e,this['previousLabel']=_0x1dd5e6||_0x520a1e,this['previousActionId']=_0x55e541,new Promise(_0x4bb65b=>{this['textAdapter']['makeRequest']({'query':_0x520a1e,'context':_0x82b2d2,'onData':_0x52bd7e=>{this['currentResponse']=_0x52bd7e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x55e541})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0xa326d1=>{_0xa326d1 instanceof tr?this['view']['handleError'](_0xa326d1['message']):this['view']['handleError'](),_0x4bb65b();})['finally'](()=>{this['stopProcessing'](),_0x4bb65b();});});}['_parseAndNormalizeContent'](_0x258f86,_0x46dce4=!0x1){const _0x181dae=as['exec'](_0x258f86);_0x258f86=_0x181dae?_0x258f86['substring'](_0x181dae[0x1]['length']):_0x258f86['length']<0x64&&!_0x46dce4?'':this['_stripMarkdownSyntax'](_0x258f86);const _0x11824f=this['_domParser']['parseFromString'](_0x258f86,'text/html');if(_0x181dae){const _0x1178ad=Array['from'](_0x11824f['body']['childNodes']);_0x1178ad['reverse']();for(const _0x4bfd23 of _0x1178ad){if(_0x4bfd23['nodeType']==Node['ELEMENT_NODE'])break;_0x4bfd23['remove']();}}const _0xdcc824=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x11824f['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0xdcc824);const _0x8ec959=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x149e4b=this['editor']['data']['toModel'](_0xdcc824);return _0x8ec959||_0x149e4b['markers']['clear'](),this['editor']['data']['stringify'](_0x149e4b);}['_normalizeResponseHeadings'](_0x444173){const _0x56ad10=new _0x38d8fd(this['editor']['editing']['view']['document']),_0x4bca29=new _0x1bda3b({'name':/^h[1-5]$/}),_0x140980=[];let _0x285f4b=!0x1;for(const _0x10defb of _0x444173)_0x10defb['is']('element')&&_0x4bca29['match'](_0x10defb)&&(_0x140980['push'](_0x10defb),'h1'==_0x10defb['name']&&(_0x285f4b=!0x0));if(_0x285f4b){for(const _0xfd5958 of _0x140980)_0x56ad10['rename']('h'+(parseInt(_0xfd5958['name'][0x1])+0x1),_0xfd5958);}}['_isH1TagSupportEnabled'](){const {data:_0x44a324,editing:_0x52355b}=this['editor'],_0x4cf868=_0x44a324['htmlProcessor']['toView']('<h1></h1>'),_0xc2c4ea=_0x44a324['toView'](_0x44a324['toModel'](_0x4cf868));return!!_0x52355b['view']['domConverter']['viewToDom'](_0xc2c4ea)['querySelector']('h1');}['_sanitizeHTML'](_0x161cc5){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x161cc5),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x3d3509){const _0x241b01=_0x3d3509['trim']();return _0x241b01['startsWith']('```html')?_0x241b01['endsWith']('```')?_0x241b01['substring'](0x7,_0x241b01['length']-0x3):_0x241b01['substring'](0x7):_0x3d3509;}}const ci={'REPLACE':'replace','INSERT':'insert'};class wr extends _0x4deb4c{constructor(_0xc1ae40){super(_0xc1ae40),this['set']('isVisible',!0x1),this['set']('mainAction',ci['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x2eb1d6=>Yn(_0xc1ae40,'AI_'+_0x2eb1d6['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0xc1ae40,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0xc1ae40,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0xc1ae40,'Stop'));const _0x442c65=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x442c65['if']('isVisible','ck-hidden',_0x2ee4c8=>!_0x2ee4c8)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3e8cd4,_0x1bc4dd){const _0x52d4cd=new _0x5cde82(this['locale']);return _0x52d4cd['set']({'label':_0x3e8cd4,'class':_0x1bc4dd||'','isVisible':!0x0,'withText':!0x0}),_0x52d4cd;}}class yr extends _0x10aa9f{['contentFieldView'];['copyButtonView'];constructor(_0x3cc37a,_0x47e7df=''){super(_0x3cc37a),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x14b705=this['bindTemplate'];this['contentFieldView']=new $n(_0x3cc37a,_0x47e7df),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x14b705['if']('isVisible','ck-hidden',_0xa0fb28=>!_0xa0fb28)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x14b705['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 _0x56f935=!0x1;this['on']('change:value',(_0x348db7,_0x3d3941,_0x3b3fe0)=>{const _0x5a05aa=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3b3fe0),this['isProcessing']&&_0x5a05aa&&!_0x56f935&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4910a0,_0x241248,_0x1bdc75)=>{_0x56f935=!0x1,_0x1bdc75?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x56f935=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x56f935=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x15ffe1=this['locale'],_0x5d36b9=new _0x5cde82(this['locale']),_0x25f61e='ck-ai-form__copy-button';return _0x5d36b9['set']({'label':Yn(_0x15ffe1,'Copy'),'icon':_0x54fc92,'class':_0x25f61e,'tooltip':!0x0}),_0x5d36b9['bind']('isVisible')['to'](this,'value',_0x3f2e21=>!!_0x3f2e21),_0x5d36b9['bind']('isEnabled')['to'](this,'isProcessing',_0x32da65=>!_0x32da65),_0x5d36b9['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5d36b9['icon']=_0x47bafa,_0x5d36b9['class']=_0x25f61e+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5d36b9['icon']=_0x54fc92,_0x5d36b9['class']=_0x25f61e;},0x3e8);}),_0x5d36b9;}['_copyHTMLToClipboard'](_0x3fa536){const {window:_0x4c4651,document:_0x43672a}=_0x218ca6;if(_0x4c4651['ClipboardItem']){const {Blob:_0x151f62,ClipboardItem:_0x40de75}=_0x4c4651,_0xfc09b0=[new _0x40de75({'text/html':new _0x151f62([_0x3fa536['innerHTML']],{'type':'text/html'}),'text/plain':new _0x151f62([_0x3fa536['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xfc09b0);}else{const _0xdddf3=_0x43672a['createElement']('div');_0xdddf3['style']['position']='absolute',_0xdddf3['style']['left']='-9999px',_0xdddf3['innerHTML']='<span>[</span>'+_0x3fa536['innerHTML']+'<span>]</span>',_0x43672a['body']['appendChild'](_0xdddf3);const _0x18464b=_0x43672a['createRange']();_0x18464b['setStartAfter'](_0xdddf3['firstElementChild']),_0x18464b['setEndBefore'](_0xdddf3['lastElementChild']);const _0x32642b=_0x4c4651['getSelection']();_0x32642b['removeAllRanges'](),_0x32642b['addRange'](_0x18464b),_0x43672a['execCommand']('copy'),_0xdddf3['remove']();}}}class $n extends _0x10aa9f{constructor(_0x5d8a90,_0x192847=''){super(_0x5d8a90),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x192847,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3e9166){this['element']['innerHTML']=_0x3e9166;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5d6898=new _0x10aa9f(),_0x5816d8=this['locale'],_0x44a375=new _0x2265d2();return _0x44a375['isVisible']=!0x0,_0x5d6898['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x44a375,{'text':Yn(_0x5816d8,'AI\x20is\x20writing...')}]}),_0x5d6898['render'](),_0x5d6898;}}class gr extends _0x10aa9f{constructor(_0x2c4ca1,_0xcc4bd8=''){super(_0x2c4ca1);const _0xba99d9=new _0x3dad93(),_0x22ad8=this['bindTemplate'];this['set']('text',_0xcc4bd8),_0xba99d9['content']=_0x141f49,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xba99d9,{'text':_0x22ad8['to']('text')}]});}}class Er extends _0x329d79{['submitButtonView'];['showHistoryButtonView'];constructor(_0x469f67,_0x131a8e){super(_0x469f67,_0x131a8e),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',(_0x18ea4e,_0x574829)=>{_0x18ea4e['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x574829());});}['_createSubmitButton'](){const _0xa16afe=new _0x5cde82(this['locale']),_0x40d9dd=this['locale'];return _0xa16afe['set']({'icon':_0x3a517e,'label':Yn(_0x40d9dd,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xa16afe['on']('execute',()=>{this['submit']();}),_0xa16afe['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4a04a7,_0x5ee184)=>!_0x4a04a7&&_0x5ee184),_0xa16afe;}['_createShowHistoryButton'](){const _0x3f7d04=new _0x5cde82(this['locale']),_0x591554=this['resultsView'],_0x2f5a89=this['locale'];_0x3f7d04['set']({'label':Yn(_0x2f5a89,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3f7d04['bind']('isOn')['to'](_0x591554,'isVisible'),_0x3f7d04['bind']('isEnabled')['to'](this,'isEnabled'),_0x3f7d04['on']('execute',()=>{_0x591554['isVisible']=!_0x591554['isVisible'],_0x591554['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x275143=()=>{_0x218ca6['window']['requestAnimationFrame'](()=>{if(_0x5a4e2b(this['element'])){const _0x2bfc0f=new _0x507e52(this['queryView']['fieldView']['element']),_0x4bab48=_0x2bfc0f['width'],_0x1589e0='rtl'===_0x2f5a89['uiLanguageDirection']?'left':'right';_0x2bfc0f['excludeScrollbarsAndBorders'](),_0x3f7d04['element']['style'][_0x1589e0]=_0x4bab48-_0x2bfc0f['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x275143),this['on']('render',_0x275143),_0x3f7d04;}['submit'](){const _0x128229=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x128229);}['focus'](_0x17aba0){-0x1===_0x17aba0?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x4a219d{['historyGroupView'];['clearHistoryButton'];constructor(_0x55df7d){super(_0x55df7d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x136b89(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x55df7d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2d1f93=0x0;for(const _0x353e7c of this['items'])_0x2d1f93+=_0x353e7c['items']['length'];return{'resultsCount':_0x2d1f93,'totalItemsCount':_0x2d1f93};}['_createClearHistoryButton'](){const _0x2207d8=this['locale'],_0x50e441=new _0x5cde82(this['locale']);return _0x50e441['set']({'label':'('+Yn(_0x2207d8,'Clear')+')','withText':!0x0}),_0x50e441['on']('execute',()=>this['fire']('clearHistory')),_0x50e441;}}class Ar extends _0x2ced3c{constructor(_0x130f52){super();const _0x110dc0=new _0x342201(),_0x8852f7=new _0x5cde82(this['locale'],_0x110dc0);this['children']['add'](_0x8852f7),_0x8852f7['set']({'label':_0x130f52['prompt'],'withText':!0x0}),_0x8852f7['on']('execute',()=>{this['fire']('execute',{'value':_0xd2685e(_0x130f52['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Pr extends _0x4c3887{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4cb76c,_0x3e6cbb)=>{const _0x3a32c6=fo(_0x3e6cbb['prompt']);for(const _0x14ccbd of this)if(_0x14ccbd!=_0x3e6cbb&&fo(_0x14ccbd['prompt'])===_0x3a32c6){this['remove'](_0x14ccbd);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2a72a2=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x2a72a2));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x481442=>_0x481442)));}}function fo(_0x5f34f1){return _0x5f34f1['toLowerCase']()['trim']();}class ri extends _0x10aa9f{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x233427,_0x8252e5,_0x4bb8f3=''){super(_0x233427),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(_0x233427),this['contentArea']=new yr(_0x233427,_0x4bb8f3),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 _0x4c12a2(),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 _0x1b5338=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x8252e5],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1b5338['if']('isError','ck-hidden',_0x174f0a=>!_0x174f0a)]},'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'](_0x5a2584=0x1){-0x1===_0x5a2584?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 _0x12aca5=this['locale'],_0x422909=new Er(_0x12aca5,{'queryView':{'label':Yn(_0x12aca5,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2485cf,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x12aca5,'Empty\x20history'),'secondary':Yn(_0x12aca5,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x422909['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4e240e,_0x254d40)=>_0x4e240e&&!_0x254d40),this['listenTo'](_0x422909,'submit',(_0x217546,_0x2e2994)=>{this['prompt']=_0x2e2994;const _0x1999d5=_0x59aba(_0x2e2994);this['fire']('submitPrompt',_0x1999d5),_0x2e2994['trim']()&&this['_promptHistory']['add']({'prompt':_0x1999d5},0x0);},{'priority':'high'}),_0x422909;}['_createHistoryView'](){const _0x42233f=new vr(this['locale']);return _0x42233f['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0x42233f['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x42233f;}['_createToolbar'](){const _0x4e3601=new wr(this['locale']);return _0x4e3601['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x40c05f,_0x4043c4,_0x3ef016)=>_0x40c05f&&!_0x4043c4&&!!_0x3ef016),_0x4e3601['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4e3601['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x43c506,_0xfe637c,_0x2e61c9)=>_0x43c506&&!_0xfe637c&&!!_0x2e61c9),_0x4e3601['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4e3601['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x12e01d,_0x52e7d4)=>_0x12e01d&&!_0x52e7d4),_0x4e3601['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4e3601['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4e3601['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4e3601;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4260a9=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x4260a9,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1b86ec){const _0x1b304e=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1b86ec||Yn(_0x1b304e,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const J=globalThis['DataTransfer'];class G extends _0x3711b7{['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[_0x4939a6,F,ni,_0x161ed4];}constructor(_0x2e4f73){super(_0x2e4f73),_0x2e4f73['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2e4f73['config']['define']('ai.assistant.contentAreaCssClass',''),_0x2e4f73['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2e4f73['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x571fb2}=this;this['_aiAdapter']=_0x571fb2['plugins']['get'](ni),this['_dialog']=_0x571fb2['plugins']['get'](_0x161ed4),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x42e63a=new ai(_0x571fb2,Array['from'](this['_commandDefinitions']['values']()));_0x571fb2['commands']['add']('showAIAssistant',_0x42e63a),_0x571fb2['ui']['componentFactory']['add']('aiCommands',_0x407dac=>{const _0x4318a4=_0x1fe5fd(_0x407dac);return _0x4318a4['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4318a4['buttonView']['set']({'label':Yn(_0x407dac,'AI\x20Commands'),'icon':_0x2b987d,'tooltip':!0x0}),_0x4318a4['on']('execute',_0x47cd4d=>this['_onExecute'](_0x47cd4d['source']['id'])),_0x11e5a3(_0x4318a4,_0x571fb2['ui']['view']['body'],function(_0x31f41e){const _0x9b685=z(_0x31f41e['config']['get']('ai.assistant.commands'),_0x31f41e['locale']),_0x3b1a42=hi(_0x31f41e,_0x9b685)['filter'](_0x17a07d=>_0x17a07d['commands']['length']);if(0x1===_0x3b1a42['length'])return hi(_0x31f41e,_0x3b1a42[0x0]['commands'])['map'](_0x22b9da=>({'id':_0x22b9da['id'],'label':_0x22b9da['label']}));return _0x3b1a42['map'](_0x425fe6=>{const {groupId:_0x40525c,groupLabel:_0x21d3e6,commands:_0x129172}=_0x425fe6,_0x57a766=hi(_0x31f41e,_0x129172)['map'](_0xaf07d2=>({'id':_0xaf07d2['id'],'label':_0xaf07d2['label']}));return{'id':_0x40525c,'menu':_0x21d3e6||_0x40525c,'children':_0x57a766};});}(_0x571fb2),{'ariaLabel':Yn(_0x407dac,'AI\x20Commands')}),_0x4318a4['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x42e63a['on']('change:enabledCommandsIds',_0x6561bd),_0x4318a4['menuView']['once']('render',_0x6561bd),_0x4318a4;function _0x6561bd(){_0x4318a4['isEnabled']=_0x42e63a['enabledCommandsIds']['length']>0x0;for(const _0x842a33 of _0x4318a4['menuView']['buttons'])_0x842a33['isEnabled']=_0x42e63a['enabledCommandsIds']['includes'](_0x842a33['id']);}}),_0x571fb2['ui']['componentFactory']['add']('menuBar:aiCommands',_0x62a643=>{const _0x271168=new _0x2d240a(_0x62a643);_0x271168['buttonView']['set']({'label':Yn(_0x62a643,'AI\x20Commands'),'icon':_0x2b987d}),_0x271168['bind']('isEnabled')['to'](_0x42e63a,'enabledCommandsIds',_0x380d40=>_0x380d40['length']>0x0);const _0x38fce7=z(_0x571fb2['config']['get']('ai.assistant.commands'),_0x62a643);return this['_populateMenuBarMenu'](_0x42e63a,_0x271168,_0x38fce7,_0x5e6529=>this['_onExecute'](_0x5e6529)),_0x271168;}),_0x571fb2['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x392584=this['_createAIAssistantUIButton'](_0x5cde82);return _0x392584['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x392584;}),_0x571fb2['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x301884=this['_createAIAssistantUIButton'](_0x3c5e19);return _0x301884['set']({'role':'menuitemcheckbox'}),_0x301884;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2a3838=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4d0193;for(const _0x3814dc in _0x2a3838){const _0x289e5b=_0x3814dc,_0x1353b9=_0x2a3838[_0x289e5b];if('aiLicenseKeyValid'==_0x1353b9||'aiLicenseKeyInvalid'==_0x1353b9||'aiLicenseKeyExpired'==_0x1353b9||'aiLicenseKeyDomainLimit'==_0x1353b9||'aiLicenseKeyNotAllowed'==_0x1353b9||'aiLicenseKeyEvaluationLimit'==_0x1353b9||'aiLicenseKeyTrialLimit'==_0x1353b9||'aiLicenseKeyUsageLimit'==_0x1353b9){delete _0x2a3838[_0x289e5b],_0x4d0193=_0x1353b9,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4d0193&&_0x2a3838['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4d0193&&_0x2a3838['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4d0193&&_0x2a3838['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4d0193&&_0x2a3838['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4d0193&&_0x2a3838['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x4d0193&&_0x2a3838['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x4d0193&&_0x2a3838['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3f695b='',_0x772f3e='',_0x2d1a6b='custom'){const _0x3b25b5=this['editor'],_0x23f61b=_0x3b25b5['editing']['view'],_0x4b9ac3=_0x3b25b5['plugins']['get'](F),_0x431b1a=_0x3b25b5['plugins']['get'](_0x4939a6);_0x4b9ac3['showFakeVisualSelection']();const _0x3bbd6c=new J(),_0x36fd9f=new ClipboardEvent('copy',{'clipboardData':_0x3bbd6c}),_0x43609a=new _0x390f6a(_0x3bbd6c),_0x505e5c=new _0x298a3f(_0x23f61b,_0x36fd9f,{'dataTransfer':_0x43609a});_0x431b1a['_forceMarkersCopy']('comment',()=>{_0x23f61b['document']['fire']('copy',_0x505e5c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new oi(_0x3b25b5,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5142d4=_0x43609a['getData']('text/html');const _0x4f4d1=_0x3b25b5['model']['document']['selection'],_0x21d41e=Array['from'](_0x4f4d1['getRanges']());0x1===_0x21d41e['length']&&_0x21d41e[0x0]['isFlat']&&!_0x4f4d1['getSelectedElement']()&&''!==_0x5142d4['replace'](/ /g,'')['trim']()&&(_0x5142d4='<p>'+_0x5142d4+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2d1a6b,'query':_0x3f695b,'htmlContent':_0x5142d4,'label':_0x772f3e,'mainActionLabel':ci[_0x3b25b5['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x547788,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x43cf0d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4b9ac3['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x71e8d8=new Map(),_0x1431d6=z(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0xef2df3 of _0x1431d6)for(const _0x1cf419 of _0xef2df3['commands'])_0x71e8d8['set'](_0x1cf419['id'],{..._0x1cf419,'groupId':_0xef2df3['groupId'],'groupLabel':_0xef2df3['groupLabel']||_0xef2df3['groupId']});return _0x71e8d8;}['_createAIAssistantUIButton'](_0x5c3ca9){const _0x88abab=this['editor'],_0x264fe7=_0x88abab['commands']['get']('showAIAssistant'),_0x4b4959=new _0x5c3ca9(_0x88abab['locale']);return _0x4b4959['set']({'label':Yn(_0x88abab['locale'],'AI\x20Assistant'),'icon':_0x547788,'isToggleable':!0x0}),_0x4b4959['bind']('isEnabled')['to'](_0x264fe7),_0x4b4959['bind']('isOn')['to'](this['_dialog'],'id',_0x25655c=>'aiAssistant'===_0x25655c),this['listenTo'](_0x4b4959,'execute',()=>{_0x4b4959['isOn']?this['hideUI']():_0x264fe7['execute']();}),_0x4b4959;}['_initView'](){const _0x3a7188=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',()=>{_0x3a7188['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3a7188['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0xb49db3,ui:{ariaLiveAnnouncer:_0x5586b7}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x535651,_0x59992a,_0x45e58f)=>{const _0x2d718c=this['_aiAssistantController']['currentContext'];_0x45e58f?_0x5586b7['announce'](Yn(_0xb49db3,'AI\x20is\x20writing')):_0x2d718c&&_0x5586b7['announce'](Yn(_0xb49db3,'Generated\x20content:\x20%0',_0x2d718c),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x200766,_0x4755f6,_0x43581b)=>{if(_0x43581b){const _0x50cf4f=this['_formView']['errorView']['text'];_0x5586b7['announce'](Yn(_0xb49db3,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x50cf4f));}});}['_onExecute'](_0x35fb00){const _0x414ebc=this['_commandDefinitions']['get'](_0x35fb00),_0x552a3e=this['editor'],_0x392fa0=_0x552a3e['model']['document']['selection'],_0xcd0cae=_0x552a3e['commands']['get']('showAIAssistant'),_0x37c994=_0x552a3e['plugins']['get'](F),_0x56993f=''+(_0x414ebc['groupId']!==ei?_0x414ebc['groupLabel']+':\x20':'')+_0x414ebc['label'];if(!0x1!==_0x414ebc['requiresContent']&&_0x392fa0['isCollapsed']){const _0x3c6fc3=_0x457991(_0x392fa0['getSelectedBlocks']())||_0x552a3e['model']['schema']['getLimitElement'](_0x392fa0);_0x552a3e['model']['change'](_0x2a2e13=>{_0x2a2e13['setSelection'](_0x3c6fc3,'in');});}_0x37c994['showFakeVisualSelection'](),_0xcd0cae['execute'](_0x414ebc['prompt'],_0x56993f,'command:'+_0x35fb00);}['_populateMenuBarMenu'](_0x33dca3,_0x4de5b2,_0x3a0a22,_0x321af2){const _0x574f40=this['editor'],_0x3c114a=_0x574f40['locale'],_0x2ecba1=new ti(_0x3c114a),_0x497c58=hi(_0x574f40,_0x3a0a22)['filter'](_0x35210f=>_0x35210f['commands']['length']);0x1===_0x497c58['length']?this['_getMenuBarGroupButtons']({'command':_0x33dca3,'commands':_0x497c58[0x0]['commands'],'parentMenuView':_0x4de5b2,'onExecute':_0x321af2})['forEach'](_0x13a3e3=>_0x2ecba1['items']['add'](_0x13a3e3)):_0x497c58['forEach'](({groupId:_0x37097c,groupLabel:_0x447326,commands:_0x109f1e})=>{const _0x3645bf=new _0x29d062(_0x3c114a,_0x4de5b2),_0x51087c=new _0x2d240a(_0x3c114a),_0x29f599=new ti(_0x3c114a),_0x479893=this['_getMenuBarGroupButtons']({'command':_0x33dca3,'commands':_0x109f1e,'parentMenuView':_0x51087c,'onExecute':_0x321af2});_0x51087c['buttonView']['set']({'label':_0x447326||_0x37097c}),_0x51087c['delegate']('execute')['to'](_0x4de5b2),_0x29f599['items']['addMany'](_0x479893),_0x51087c['panelView']['children']['add'](_0x29f599),_0x3645bf['children']['add'](_0x51087c),_0x2ecba1['items']['add'](_0x3645bf);}),_0x4de5b2['panelView']['children']['add'](_0x2ecba1);}['_getMenuBarGroupButtons']({command:_0x16b0e4,commands:_0x3e144b,parentMenuView:_0x360083,onExecute:_0x5f1911}){const _0x48801f=this['editor'],_0x479814=_0x48801f['locale'];return hi(_0x48801f,_0x3e144b)['map'](_0x59aac5=>{const _0x438203=new _0x29d062(_0x479814,_0x360083),_0x2be84b=new _0x3c5e19(_0x479814);return _0x2be84b['set']({'label':_0x59aac5['label']}),_0x2be84b['delegate']('execute')['to'](_0x360083),_0x2be84b['on']('execute',()=>_0x5f1911(_0x59aac5['id'])),_0x2be84b['bind']('isEnabled')['to'](_0x16b0e4,'enabledCommandsIds',_0x470ae1=>_0x470ae1['includes'](_0x59aac5['id'])),_0x438203['children']['add'](_0x2be84b),_0x438203;});}}function li(_0x53cd70,_0x103a9a){return void 0x0!==_0x53cd70['order']&&void 0x0===_0x103a9a['order']?0x1:void 0x0===_0x53cd70['order']&&void 0x0!==_0x103a9a['order']?-0x1:void 0x0!==_0x53cd70['order']&&void 0x0!==_0x103a9a['order']?_0x53cd70['order']-_0x103a9a['order']:0x0;}function hi(_0xfdbd6,_0x88c9d){_0x88c9d['sort'](li);const _0x34bc30={},_0x211889=[];for(const _0x14b00d of _0x88c9d)if(void 0x0!==_0x14b00d['order']){if(_0x14b00d['order']in _0x34bc30)throw new _0x239292('ai-commands-config-order-collision',_0xfdbd6,{'conflictingDefinitions':[_0x14b00d,_0x34bc30[_0x14b00d['order']]]});_0x34bc30[_0x14b00d['order']]=_0x14b00d,_0x211889['splice'](_0x14b00d['order'],0x0,_0x14b00d);}else _0x211889['push'](_0x14b00d);return _0x211889;}class qn extends _0x3711b7{static get['requires'](){return[G,F];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x407c59){super(_0x407c59);const _0x1603df=_0x407c59['config'],_0x1d95b5=_0x407c59['locale'];_0x1603df['define']('ai.assistant.preserveComments',!0x0),_0x1603df['define']('ai.assistant.commands',Qn(_0x1d95b5)),_0x1603df['define']('ai.assistant.extraCommandGroups',[]),_0x1603df['define']('ai.assistant.removeCommands',[]);let _0x3469b4=z(_0x1603df['get']('ai.assistant.commands'),_0x1d95b5);const _0x5c0013=_0x1603df['get']('ai.assistant.extraCommandGroups'),_0xe2c8ea=_0x1603df['get']('ai.assistant.removeCommands');_0x5c0013['forEach'](_0x3079cf=>{const _0x4ee438=_0x3469b4['find'](_0x197905=>_0x197905['groupId']===_0x3079cf['groupId']);_0x4ee438?_0x4ee438['commands']=_0x4ee438['commands']['concat'](_0x3079cf['commands']):_0x3469b4['push'](_0x3079cf);}),_0x3469b4=_0x3469b4['filter'](_0x54a8b3=>!_0xe2c8ea['includes'](_0x54a8b3['groupId'])),_0x3469b4['forEach'](_0x550a68=>{_0x550a68['commands']=_0x550a68['commands']['filter'](_0x7ce021=>!_0xe2c8ea['includes'](_0x7ce021['id']));}),_0x1603df['set']('ai.assistant.commands',_0x3469b4);}}function Qn(_0x25abc3){return[{'groupId':'editOrReview','groupLabel':Yn(_0x25abc3,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x25abc3,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x25abc3,'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(_0x25abc3,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x25abc3,'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(_0x25abc3,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x25abc3,'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(_0x25abc3,'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(_0x25abc3,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x25abc3,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x25abc3,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x25abc3,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x25abc3,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x25abc3,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x25abc3,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x25abc3,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x25abc3,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x25abc3,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x25abc3,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x25abc3,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x25abc3,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x25abc3,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x25abc3,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x25abc3,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x25abc3,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x25abc3,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x25abc3,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x25abc3,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ue extends _0x3711b7{['abortController'];static get['requires'](){return[ni];}constructor(_0x14a9b5){super(_0x14a9b5),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'](_0x3b5779){return this['sendRequest'](_0x3b5779)['catch'](_0x19f838=>{if(_0x19f838 instanceof tr)return Promise['reject'](_0x19f838);if('AbortError'==_0x19f838['name'])return Promise['resolve']();throw console['error'](_0x19f838),new _0x239292('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1cccc0,_0x3f05ad){const _0x12bbcd=this['editor']['locale'],_0x33fba8={'Content-Type':'application/json'};if('object'==typeof _0x1cccc0)Object['assign'](_0x33fba8,_0x1cccc0);else{if(_0x1cccc0)try{const _0x26088f=await _0x1cccc0(_0x3f05ad);Object['assign'](_0x33fba8,_0x26088f);}catch{return Promise['reject'](new tr(Yn(_0x12bbcd,'AI_ERROR_GET_HEADERS')));}}return _0x33fba8;}async['_prepareRequestParameters'](_0x17f47c,_0x21d718){const _0x5e3b89=this['editor']['locale'];if('object'==typeof _0x17f47c)return _0x17f47c;try{return await _0x17f47c(_0x21d718);}catch{return Promise['reject'](new tr(Yn(_0x5e3b89,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends ue{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5b0702){super(_0x5b0702),_0x5b0702['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5b0702['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x5b0702['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5b0702['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x5b0702['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x5b0702['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x236db5,context:_0x3b1fbc,onData:_0x11b5f8,actionId:_0x5e979a}){const _0x466f92=this['editor']['locale'],_0x2f9ec8=await this['prepareMessages'](_0x236db5,_0x3b1fbc,_0x5e979a),_0x576cc6=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5e979a),_0x3a0d8d=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5e979a),_0x160c6c={'messages':_0x2f9ec8,..._0x3a0d8d},_0xd3dea6={'method':'POST','headers':_0x576cc6,'body':JSON['stringify'](_0x160c6c),'signal':this['abortController']['signal']},_0x23a120=await fetch(this['_apiUrl'],_0xd3dea6);if(_0x23a120['ok'])return _0x3a0d8d['stream']?await this['_readStreamableResponse'](_0x23a120,_0x11b5f8):await this['_readStaticResponse'](_0x23a120,_0x11b5f8),Promise['resolve']();{const _0x1bd05b=await _0x23a120['text']();return _0x1bd05b['includes']('context_length_exceeded')?Promise['reject'](new tr(Yn(_0x466f92,'AI_ERROR_CONTEXT_LENGTH'))):_0x1bd05b['includes']('Moderation')?Promise['reject'](new tr(Yn(_0x466f92,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1bd05b));}}async['prepareMessages'](_0x4dfc02,_0x1ea695,_0x13fd9d){let _0x47c65a,_0x10b572;return _0x1ea695?(_0x47c65a='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.',_0x10b572='Instruction:\x0a'+_0x4dfc02+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1ea695):(_0x47c65a='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.',_0x10b572=_0x4dfc02),[{'role':'system','content':_0x47c65a},{'role':'user','content':_0x10b572}];}async['_readStreamableResponse'](_0x2a7528,_0x27c6a0){const _0x184c37=_0x2a7528['body']['getReader'](),_0x282fcf=new TextDecoder();let _0xd1fe13='',_0x181842='',_0x193074='',_0x59472=!0x1;for(;!_0x59472;){const {done:_0x1f1e29,value:_0x4f4055}=await _0x184c37['read'](),_0x5c0a55=_0xd1fe13+_0x282fcf['decode'](_0x4f4055);let _0x159384='';_0x59472=_0x1f1e29;try{_0x159384=this['_cleanUpData'](_0x5c0a55),_0xd1fe13='';}catch{_0xd1fe13=_0x5c0a55;continue;}_0x181842+=_0x159384,!_0x59472&&this['_isBufferIncomplete'](_0x181842)||_0x181842&&(_0x193074+=_0x181842,_0x181842='',_0x27c6a0(_0x193074));}return Promise['resolve']();}async['_readStaticResponse'](_0x54da70,_0x35daa3){return _0x35daa3((await _0x54da70['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x467a97){const _0x527b18=_0x467a97['split']('<')['length']!==_0x467a97['split']('>')['length'],_0x3d8d52=_0x467a97['length']<0x1e;return _0x527b18&&_0x3d8d52;}['_cleanUpData'](_0x5439a2){return _0x5439a2['split'](/\n(?![^{]*\})/g)['map'](_0x5301c2=>_0x5301c2['replace']('data:\x20',''))['filter'](_0x4276ca=>_0x4276ca&&_0x4276ca['length']>0x0&&'[DONE]'!==_0x4276ca)['map'](_0x18bd24=>{const {choices:_0x1a8330}=JSON['parse'](_0x18bd24);if(_0x1a8330[0x0]?.['delta']?.['content'])return _0x1a8330[0x0]['delta']['content'];})['filter'](_0x4fb9cf=>_0x4fb9cf)['join']('');}}class zn extends ue{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x17d535){super(_0x17d535),_0x17d535['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x17d535['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']=_0x17d535['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x17d535['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x17d535['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x17d535['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x299cc0,context:_0x4d0bd6,onData:_0x3186da,actionId:_0x2a0b01}){const {model:_0x4bea76,stream:_0x30511d,..._0x1419e5}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2a0b01),_0x481d97={'prompt':await this['preparePrompt'](_0x299cc0,_0x4d0bd6,_0x4bea76,_0x2a0b01),..._0x1419e5};this['_apiUrl']?await this['_processProxyRequest'](_0x481d97,_0x4bea76,_0x30511d,_0x3186da,_0x2a0b01):await this['_processAWSRequest'](_0x481d97,_0x4bea76,_0x30511d,_0x3186da);}async['preparePrompt'](_0x5735ab,_0x2188a1,_0x497133,_0x262942){let _0x408599,_0x2bc5c4;return _0x2188a1?(_0x408599='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.',_0x2bc5c4='Instruction:\x0a'+_0x5735ab+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2188a1):(_0x408599='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.',_0x2bc5c4=_0x5735ab),'meta.llama'==this['getModelFamily'](_0x497133)?'<<SYS>>\x0a'+_0x408599+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2bc5c4+'\x0a[/INST]':'Human:\x0a'+_0x408599+'\x0a'+_0x2bc5c4+'\x0a\x0aAssistant:';}['getModelFamily'](_0x21abac){if(/^anthropic\.claude/['test'](_0x21abac))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x21abac))return'ai21.j2';if(/^cohere\.command/['test'](_0x21abac))return'cohere.command';if(/^meta\.llama/['test'](_0x21abac))return'meta.llama';throw new tr(Yn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x21abac));}async['_processProxyRequest'](_0x1850ed,_0x4e44fe,_0x1be717,_0x21586b,_0xa31c04){const _0x24d063={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xa31c04),'body':JSON['stringify']({..._0x1850ed,'model':_0x4e44fe,'stream':_0x1be717}),'signal':this['abortController']['signal']},_0xe92141=await fetch(this['_apiUrl'],_0x24d063);_0x1be717?await this['_readStreamableResponse'](_0xe92141,_0x4e44fe,_0x21586b):await this['_readStaticResponse'](_0xe92141,_0x4e44fe,_0x21586b);}async['_processAWSRequest'](_0x53d46c,_0x33163b,_0x1fd021,_0x2fa7eb){const _0x29b747=new _0x5a8df5(this['_bedrockClientConfig']),_0x539fa2={'body':JSON['stringify'](_0x53d46c),'contentType':'application/json','accept':'application/json','modelId':_0x33163b};let _0x36b0ca;if(_0x1fd021){const _0x20750f=new _0x440801(_0x539fa2);_0x36b0ca=await _0x29b747['send'](_0x20750f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x36b0ca,_0x33163b,_0x2fa7eb);}else{const _0x1a698a=new _0x14bf18(_0x539fa2);_0x36b0ca=await _0x29b747['send'](_0x1a698a,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x36b0ca,_0x33163b,_0x2fa7eb);}}async['_readAsyncIterableResponse'](_0xbfa155,_0x557ec5,_0x3344df){const _0x56713c=_0xbfa155['body'],_0x25f899=new TextDecoder('utf-8');let _0x3a085c='';for await(const _0xc6edcf of _0x56713c)if(_0xc6edcf['chunk']){const _0x93ce4e=_0x25f899['decode'](_0xc6edcf['chunk']['bytes']),_0x2bab86=JSON['parse'](_0x93ce4e);_0x3a085c+=this['_getGeneratedText'](_0x2bab86,_0x557ec5),_0x3344df(_0x3a085c);}return Promise['resolve']();}async['_readStreamableResponse'](_0xaa6b8c,_0x5b05cd,_0x405f9d){const _0x2cb15d=_0xaa6b8c['body'],_0x4b59af=new TextDecoder('utf-8'),_0x317d76=_0x2cb15d['getReader']();let _0x23048c='',_0x571fef='',_0x52bc03=!0x1;for(;!_0x52bc03;){const {done:_0x251ea4,value:_0x276026}=await _0x317d76['read']();if(_0x52bc03=_0x251ea4,_0x52bc03)break;const _0x3bdc8d=(_0x23048c+_0x4b59af['decode'](_0x276026))['split']('\x0a')['map'](_0x22ce95=>{try{return _0x23048c='',JSON['parse'](_0x22ce95);}catch{return _0x23048c=_0x22ce95,null;}})['filter'](_0x596ce0=>null!==_0x596ce0);_0x3bdc8d['length']&&(_0x571fef+=_0x3bdc8d['map'](_0x3b314d=>this['_getGeneratedText'](_0x3b314d,_0x5b05cd))['join'](''),_0x405f9d(_0x571fef));}return Promise['resolve']();}async['_readStaticResponse'](_0x3610ae,_0x2bb125,_0x335609){let _0x486ff1;return _0x486ff1=_0x3610ae instanceof Response?await _0x3610ae['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x3610ae['body'])),(_0x335609(this['_getGeneratedText'](_0x486ff1,_0x2bb125)),Promise['resolve']());}['_getGeneratedText'](_0x24b466,_0x235e8f){switch(this['getModelFamily'](_0x235e8f)){case'anthropic.claude':return _0x24b466['completion'];case'ai21.j2':return _0x24b466['completions'][0x0]['data']['text'];case'cohere.command':return _0x24b466['generations'][0x0]['text'];case'meta.llama':return _0x24b466['generation'];}}}class ia extends _0x5cde82{constructor(_0x348cfb,_0xcf30b0={}){super(_0x348cfb),this['isToggleable']=!0x0,this['set']('side',_0xcf30b0['side']||'top');const _0x5523d8=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x2141c6(_0xcf30b0['class']||[]),_0x5523d8['to']('side',_0x387720=>'ck-tab-button_'+_0x387720),_0x5523d8['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x10aa9f{['children'];constructor(_0x726cee,_0x504394={}){super(_0x726cee);const _0x37c54f=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x2141c6(_0x504394['class']||[]),_0x37c54f['to']('class'),_0x37c54f['if']('isVisible','ck-hidden',_0x4834fa=>!_0x4834fa)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x10aa9f{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x3ba541,_0x466782={}){super(_0x3ba541),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x466782['side']||'top'),this['set']('isMaximized',!0x1);const _0x77a813=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x2141c6(_0x466782['class']||[]),_0x77a813['to']('side',_0x54dbf7=>'ck-tabs_'+_0x54dbf7),_0x77a813['to']('class'),_0x77a813['to']('isMaximized',_0x2cee40=>_0x2cee40?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x77a813['to']('side',_0x776aef=>'ck-tabs__buttons-container_'+_0x776aef)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x77a813['to']('side',_0x4c1be2=>'ck-tabs__panels-container_'+_0x4c1be2)]},'children':this['panelViews']},..._0x2141c6(_0x466782['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x58990f){const _0x442708=this['_tabs']['get'](_0x58990f);return _0x442708||null;}['addTab'](_0x5ec2a2){const _0x211b56=this['_setupButton']({'id':_0x5ec2a2['id'],'label':_0x5ec2a2['buttonLabel'],'icon':_0x5ec2a2['buttonIcon'],'order':_0x5ec2a2['order']}),_0x713ebf=new ea(this['locale']);return _0x713ebf['render'](),_0x5ec2a2['content']&&_0x713ebf['children']['add'](_0x5ec2a2['content']),this['panelViews']['add'](_0x713ebf),this['_tabs']['set'](_0x5ec2a2['id'],{'button':_0x211b56,'panel':_0x713ebf,'order':void 0x0!==_0x5ec2a2['order']?_0x5ec2a2['order']:null}),this['fire']('addTab:'+_0x5ec2a2['id'],{'id':_0x5ec2a2['id'],'button':_0x211b56,'panel':_0x713ebf}),null===this['activeTab']?this['activateTab'](_0x5ec2a2['id']):this['_hidePanel'](_0x5ec2a2['id']),{'button':_0x211b56,'panel':_0x713ebf};}['activateTab'](_0x4af66d){if(null!==_0x4af66d&&!this['getTab'](_0x4af66d))throw new _0x239292('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4af66d});this['activeTab']!==_0x4af66d&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x4af66d,_0x4af66d&&this['_showPanel'](_0x4af66d),this['fire']('activateTab:'+_0x4af66d,_0x4af66d));}['showTab'](_0x170d96){if(!this['getTab'](_0x170d96))throw new _0x239292('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x170d96});this['_showPanel'](_0x170d96),this['_showButton'](_0x170d96),this['fire']('show:'+_0x170d96,_0x170d96);}['hideTab'](_0x55f9db){if(!this['getTab'](_0x55f9db))throw new _0x239292('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x55f9db});const _0xea5017=this['activeTab'];this['_hidePanel'](_0x55f9db),this['_hideButton'](_0x55f9db);const _0x3d2dec=this['getTabIds']();_0xea5017===_0x55f9db&&_0x3d2dec['length']>0x1&&this['activateTab'](_0x3d2dec['find'](_0x14f85c=>_0x14f85c!==_0x55f9db)),this['fire']('hide:'+_0x55f9db,_0x55f9db);}['_getPanel'](_0x17a8a2){const _0x1d8782=this['_tabs']['get'](_0x17a8a2);return _0x1d8782?_0x1d8782['panel']:null;}['_showPanel'](_0x5c56c1){null!==this['activeTab']&&this['activeTab']!==_0x5c56c1||this['_getPanel'](_0x5c56c1)['show']();}['_hidePanel'](_0x3840fc){const _0x52e705=this['_getPanel'](_0x3840fc);_0x52e705['isVisible']&&(this['activeTab']===_0x3840fc&&(this['activeTab']=null),_0x52e705['hide']());}['_getButton'](_0x5796bc){const _0x3d2728=this['_tabs']['get'](_0x5796bc);return _0x3d2728?_0x3d2728['button']:null;}['_showButton'](_0x3bccc7){this['_getButton'](_0x3bccc7)['show']();}['_hideButton'](_0x1b5ead){this['_getButton'](_0x1b5ead)['hide']();}['_setupButton'](_0x52f513){const _0x5b0b29=new ia(this['locale'],{'side':this['side']}),_0x40a08c=this['buttonViews'];if(_0x5b0b29['set']({'label':_0x52f513['label'],'icon':_0x52f513['icon'],'tooltip':!0x0,'withText':!0x0}),_0x5b0b29['bind']('isOn')['to'](this,'activeTab',_0x50882e=>_0x50882e===_0x52f513['id']),_0x5b0b29['bind']('side')['to'](this,'side'),_0x52f513['order']){const _0xbabf93=[...this['_tabs']]['reduce']((_0x54b6e9,_0x49975a)=>{const _0x4e7c5c=_0x49975a[0x0],{order:_0x500176}=_0x49975a[0x1];return!_0x500176||_0x500176>_0x52f513['order']?_0x54b6e9:_0x500176>=_0x54b6e9['order']?{'id':_0x4e7c5c,'order':_0x500176}:_0x54b6e9;},{'id':'','order':0x0}),_0x29640d=_0x40a08c['getIndex'](this['_getButton'](_0xbabf93['id']));_0x40a08c['add'](_0x5b0b29,_0x29640d+0x1);}else _0x40a08c['add'](_0x5b0b29);return _0x5b0b29['on']('execute',()=>{this['activateTab'](_0x52f513['id']);}),_0x5b0b29;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends ss{constructor(_0x7430c0,_0x5e32b5={}){super(_0x7430c0,_0x5e32b5),this['set']('type',_0x5e32b5['type']||'sidebar'),this['set']('side',_0x5e32b5['side']||'right'),this['set']('isVisible',_0x5e32b5['visibleByDefault']??!0x0);const _0xceace2=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xceace2['if']('type','ck-ai-tabs__overlay',_0x9238ef=>'overlay'===_0x9238ef),_0xceace2['if']('type','ck-ai-tabs__sidebar',_0x55f1ca=>'sidebar'===_0x55f1ca),_0xceace2['if']('isVisible','ck-hidden',_0x5e0e73=>!_0x5e0e73)]}}),this['buttonViews']['on']('add',(_0x51f188,_0x4dd5ab)=>{_0x4dd5ab['set']('withText',!0x1);});}}class at extends _0x267838{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1948fe){super(_0x1948fe);const _0x55112d=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x55112d)throw new _0x239292('ai-tabs-configuration-not-found');if(void 0x0!==_0x55112d['showResizeButton']&&(this['showResizeButton']=_0x55112d['showResizeButton']),'sidebar'!==_0x55112d['type']&&'overlay'!==_0x55112d['type']||_0x55112d['side']&&(this['side']=_0x55112d['side']),'sidebar'===_0x55112d['type']){if(this['container']=_0x55112d['element'],this['set']('type','sidebar'),!this['container'])throw new _0x239292('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x55112d['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===_0x55112d['visibleByDefault']||_0x55112d['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'](_0x43f0b2){if(_0x43f0b2&&this['type']!==_0x43f0b2){if(!Ti['includes'](_0x43f0b2))throw new _0x239292('ai-tabs-unsupported-ui-type');this['type']=_0x43f0b2;}}['switchSide'](_0x3ea16f){if(_0x3ea16f&&this['side']!==_0x3ea16f){if(!yi['includes'](_0x3ea16f))throw new _0x239292('ai-tabs-unsupported-ui-side');this['side']=_0x3ea16f;}}['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 _0x267838{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5edd09){super(_0x5edd09),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 _0x8906ee=this['context']['plugins']['get']('CloudServices');if(!_0x8906ee['token'])throw new _0x239292('ai-missing-token',this);this['_token']=_0x8906ee['token'];}['startConversation'](_0xdb198,_0xa9a207){const _0x280e20=this['_sendApiRequest']('/conversations','POST',{'id':_0xdb198,'group':_0xa9a207});return{'getConversation':async()=>(await _0x280e20['request'])['json'](),'abortController':_0x280e20['abortController']};}['queryAssistant']({message:_0x4b88fe,conversationId:_0x4ac0ac,parts:_0x182f17,capabilities:_0x4eaf73,model:_0x50ac2b,quickActionData:_0x5c4b6e}){const _0x59e669={..._0x5c4b6e&&{'quickActionData':_0x5c4b6e}},_0x295bfa={'prompt':_0x4b88fe,'content':_0x182f17,'model':_0x50ac2b,..._0x4eaf73&&{'capabilities':_0x4eaf73},...Object['keys'](_0x59e669)['length']>0x0&&{'attributes':_0x59e669}},_0x5b65d8=this['_sendApiRequest']('/conversations/'+_0x4ac0ac+'/messages','POST',_0x295bfa);return{'getStream':async()=>{const _0x4d2be8=(await _0x5b65d8['request'])['body'];return this['_getStreamReader'](_0x4d2be8);},'abortController':_0x5b65d8['abortController']};}['executeCustomAction']({content:_0x4ec777,message:_0x257654,model:_0x3097a7,outputFormat:_0x1c3b22}){const _0x5f1eb2={'content':[{'type':'text','content':_0x4ec777}],'prompt':_0x257654,'model':_0x3097a7,'outputFormat':_0x1c3b22},_0x3a4972=this['_sendApiRequest']('/actions/custom/calls','POST',_0x5f1eb2);return{'getStream':async()=>{const _0x323bad=(await _0x3a4972['request'])['body'];return this['_getStreamReader'](_0x323bad);},'abortController':_0x3a4972['abortController']};}['executeAction']({actionName:_0x2fbe38,content:_0x16bc79,args:_0x310221}){const _0x25786d={'content':[{'type':'text','content':_0x16bc79}],'args':_0x310221},_0x3d9a18=this['_sendApiRequest']('/actions/system/'+_0x2fbe38+'/calls','POST',_0x25786d);return{'getStream':async()=>{const _0x370799=(await _0x3d9a18['request'])['body'];return this['_getStreamReader'](_0x370799);},'abortController':_0x3d9a18['abortController']};}['uploadFile'](_0x8ab0d,_0x204fd1,_0x19e87c){const _0x5a1cb6=new FormData();_0x5a1cb6['append']('file',_0x204fd1,_0x204fd1['name']),_0x19e87c&&_0x5a1cb6['append']('attributes',JSON['stringify'](_0x19e87c));const _0x192172=this['_sendApiRequest']('/conversations/'+_0x8ab0d+'/files','POST',_0x5a1cb6);return{'getId':async()=>(await _0x192172['request'])['json'](),'abortController':_0x192172['abortController']};}['fetchDocument'](_0x15b3da,_0x3c19ff){const _0x1c78c6=this['_sendApiRequest']('/conversations/'+_0x15b3da+'/documents/'+_0x3c19ff,'GET');return{'getDocument':async()=>(await _0x1c78c6['request'])['json'](),'abortController':_0x1c78c6['abortController']};}['uploadDocument'](_0x43a757,_0x5c8c4f,_0x3ad39d){const _0x36ec0b={'content':_0x5c8c4f};_0x3ad39d&&(_0x36ec0b['attributes']=_0x3ad39d);const _0x4f6300=this['_sendApiRequest']('/conversations/'+_0x43a757+'/documents','POST',_0x36ec0b);return{'getId':async()=>(await _0x4f6300['request'])['json'](),'abortController':_0x4f6300['abortController']};}['fetchConversations'](_0x1e83ff,_0x554099){const _0x130d84=new URLSearchParams();_0x130d84['append']('excludeEmpty','true'),_0x130d84['append']('limit','100'),_0x130d84['append']('group',_0x1e83ff),_0x554099&&_0x130d84['append']('search',_0x554099);const _0x2e2769=this['_sendApiRequest']('/conversations?'+_0x130d84['toString'](),'GET');return{'getConversations':async()=>{const _0xde4d10=await _0x2e2769['request'];return(await _0xde4d10['json']())['items'];},'abortController':_0x2e2769['abortController']};}['deleteConversation'](_0x5bc1ea){const _0x3dbec7=this['_sendApiRequest']('/conversations/'+_0x5bc1ea,'DELETE');return{'execute':async()=>{await _0x3dbec7['request'];},'abortController':_0x3dbec7['abortController']};}['updateConversation'](_0x326987,_0x4ac191){const _0x13cea2=this['_sendApiRequest']('/conversations/'+_0x326987,'PATCH',_0x4ac191);return{'getResult':async()=>(await _0x13cea2['request'],_0x4ac191),'abortController':_0x13cea2['abortController']};}['fetchConversation'](_0x4fbc7c){const _0x412e31=this['_sendApiRequest']('/conversations/'+_0x4fbc7c,'GET');return{'getConversation':async()=>(await _0x412e31['request'])['json'](),'abortController':_0x412e31['abortController']};}['fetchConversationMessages'](_0x48c581){const _0x49165c=this['_sendApiRequest']('/conversations/'+_0x48c581+'/messages','GET');return{'getMessages':async()=>{const _0x4adce1=await _0x49165c['request'];return(await _0x4adce1['json']())['items'];},'abortController':_0x49165c['abortController']};}['uploadUrl'](_0x7c1908,_0x3a849a,_0x1da6bf){const _0x174047=this['_sendApiRequest']('/conversations/'+_0x7c1908+'/web-resources','POST',{'url':_0x3a849a,'attributes':_0x1da6bf});return{'getId':async()=>(await _0x174047['request'])['json'](),'abortController':_0x174047['abortController']};}['getModels'](){const _0x49fab6=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x49fab6['request'])['json'](),'abortController':_0x49fab6['abortController']};}['deleteFile'](_0x30f42c,_0xe23bbe){const _0x154806=this['_sendApiRequest']('/conversations/'+_0x30f42c+'/files/'+_0xe23bbe,'DELETE');return{'execute':async()=>{await _0x154806['request'];},'abortController':_0x154806['abortController']};}['deleteDocument'](_0x17ecc5,_0x16bb9d){const _0xeb4429=this['_sendApiRequest']('/conversations/'+_0x17ecc5+'/documents/'+_0x16bb9d,'DELETE');return{'execute':async()=>{await _0xeb4429['request'];},'abortController':_0xeb4429['abortController']};}['deleteWebResource'](_0xe00bc8,_0x56a243){const _0xdb5d6a=this['_sendApiRequest']('/conversations/'+_0xe00bc8+'/web-resources/'+_0x56a243,'DELETE');return{'execute':async()=>{await _0xdb5d6a['request'];},'abortController':_0xdb5d6a['abortController']};}['callSystemReview']({reviewName:_0x30b921,content:_0x3978b2,args:_0xb01ffc}){const _0x2168c0=this['_sendApiRequest']('/reviews/system/'+_0x30b921+'/calls','POST',{'content':[{'type':'text','content':_0x3978b2}],'args':_0xb01ffc});return{'getStream':async()=>{const _0x162f29=(await _0x2168c0['request'])['body'];return this['_getStreamReader'](_0x162f29);},'abortController':_0x2168c0['abortController']};}['callCustomReview']({content:_0x3ba120,prompt:_0x2a9d8b,model:_0x3b3325}){const _0x31f3df=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x3ba120}],'prompt':_0x2a9d8b,'model':_0x3b3325});return{'getStream':async()=>{const _0x2ae46e=(await _0x31f3df['request'])['body'];return this['_getStreamReader'](_0x2ae46e);},'abortController':_0x31f3df['abortController']};}['upsertAIChatRating'](_0xb5288,_0x30c29c,_0x125ff6){const _0x83b435=this['_sendApiRequest']('/conversations/'+_0xb5288+'/messages/'+_0x30c29c+'/ratings','PUT',{'positiveCount':_0x125ff6['positiveCount'],'totalCount':_0x125ff6['totalCount'],'modificationId':_0x125ff6['modificationId']});return{'execute':async()=>{await _0x83b435['request'];},'abortController':_0x83b435['abortController']};}['upsertAIActionRating'](_0xf89841,_0x2ab542,_0x3812eb){const _0x147390=this['_sendApiRequest']('/actions/system/'+_0xf89841+'/calls/'+_0x2ab542+'/ratings','PUT',{'positiveCount':_0x3812eb['positiveCount'],'totalCount':_0x3812eb['totalCount']});return{'execute':async()=>{await _0x147390['request'];},'abortController':_0x147390['abortController']};}['upsertCustomAIActionRating'](_0x1b5c50,_0x347920){const _0x12d120=this['_sendApiRequest']('/actions/custom/calls/'+_0x1b5c50+'/ratings','PUT',{'positiveCount':_0x347920['positiveCount'],'totalCount':_0x347920['totalCount']});return{'execute':async()=>{await _0x12d120['request'];},'abortController':_0x12d120['abortController']};}['upsertAIReviewRating'](_0xcf6654,_0x11e032,_0x58b795,_0x7226d0){const _0x478a48=this['_sendApiRequest']('/reviews/system/'+_0xcf6654+'/calls/'+_0x11e032+'/ratings','PUT',{'positiveCount':_0x58b795['positiveCount'],'totalCount':_0x58b795['totalCount'],'dataId':_0x7226d0});return{'execute':async()=>{await _0x478a48['request'];},'abortController':_0x478a48['abortController']};}['upsertCustomAIReviewRating'](_0x1f2606,_0x53c7ac,_0x2bcf50){const _0x1e61ec=this['_sendApiRequest']('/reviews/custom/calls/'+_0x1f2606+'/ratings','PUT',{'positiveCount':_0x53c7ac['positiveCount'],'totalCount':_0x53c7ac['totalCount'],'dataId':_0x2bcf50});return{'execute':async()=>{await _0x1e61ec['request'];},'abortController':_0x1e61ec['abortController']};}['_sendApiRequest'](_0x56a71c,_0x33f438,_0xbc13a6){const _0x5efcbb=new AbortController(),_0x27e3c8=_0xbc13a6 instanceof FormData,_0x1bc08c={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0xbc13a6&&!_0x27e3c8&&(_0x1bc08c['Content-Type']='application/json');const _0x5b618={'method':_0x33f438,'headers':_0x1bc08c,'signal':_0x5efcbb['signal']};return _0xbc13a6&&(_0x5b618['body']=_0x27e3c8?_0xbc13a6:JSON['stringify'](_0xbc13a6)),{'request':fetch(''+this['_apiUrl']+_0x56a71c,_0x5b618)['catch'](_0x59300b=>{this['_handleError'](_0x59300b);})['then'](_0x178f0f=>{if(!_0x178f0f['ok'])throw new _0x239292('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x56a71c,'method':_0x33f438,'body':_0xbc13a6,'status':(_0x178f0f||{})['status'],'statusText':(_0x178f0f||{})['statusText']});return _0x178f0f;}),'abortController':_0x5efcbb};}async*['_getStreamReader'](_0x236752){const _0xb6e413=[],_0x2af7ab=_0x236752['getReader'](),_0x45464a=wt({'onError':_0x3f123d=>{this['_handleError'](_0x3f123d);},'onEvent':_0x447cd1=>{_0x447cd1['data']=JSON['parse'](_0x447cd1['data']),_0xb6e413['push'](_0x447cd1);}});try{let _0x48fb46=!0x1;for(;!_0x48fb46;){const {done:_0x57322a,value:_0x36e9c9}=await _0x2af7ab['read']();_0x57322a&&(_0x48fb46=!0x0),_0x45464a['feed'](this['_decoder']['decode'](_0x36e9c9,{'stream':!0x0})),yield*_0xb6e413,_0xb6e413['length']=0x0;}}catch(_0x13d06c){this['_handleError'](_0x13d06c);}finally{_0x2af7ab['releaseLock'](),_0x45464a['reset']();}}['_handleError'](_0x40ed5e){if(_0x40ed5e instanceof _0x239292)throw _0x40ed5e;if(_0x40ed5e instanceof Error&&'AbortError'===_0x40ed5e['name'])throw new _0x239292('ai-request-aborted',this,{'originalError':_0x40ed5e});throw new _0x239292('ai-request-failed',this,{'originalError':_0x40ed5e});}}function C(_0x12b5b8,_0x1d29f5,_0x44f2b5){const t=_0x12b5b8['t'];switch(_0x1d29f5){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'},_0x44f2b5);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.'},_0x44f2b5);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.'},_0x44f2b5);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.'},_0x44f2b5);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'},_0x44f2b5);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'},_0x44f2b5);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x44f2b5);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'},_0x44f2b5);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x44f2b5);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'},_0x44f2b5);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x44f2b5);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.'},_0x44f2b5);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.'},_0x44f2b5);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.'},_0x44f2b5);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.'},_0x44f2b5);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'},_0x44f2b5);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.'},_0x44f2b5);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 _0x1d29f5;}}function Cs(_0x18f84f,_0x4355d1){const _0x35bf27=new _0x5cde82(_0x18f84f),_0x5dbd88=C(_0x18f84f,'AI_TABS_LABEL_MINIMIZE'),_0x41092c=C(_0x18f84f,'AI_TABS_LABEL_MAXIMIZE');return _0x35bf27['set']({'withText':!0x1,'icon':_0x10f52f,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x35bf27['bind']('label')['to'](_0x4355d1,'isMaximized',_0x189a89=>_0x189a89?_0x5dbd88:_0x41092c),_0x35bf27['bind']('icon')['to'](_0x4355d1,'isMaximized',_0xc18798=>_0xc18798?to:_0x10f52f),_0x35bf27['bind']('isOn')['to'](_0x4355d1,'isMaximized'),_0x35bf27['on']('execute',()=>{_0x4355d1['fire']('resizeTabs');}),_0x35bf27;}function Ye(_0xe36a35){return _0x2e2d8f(_0xe36a35);}function ut(_0x3dd33b){return _0x259462(_0x3dd33b);}function ft(_0x206093,_0x44e642,_0x2f31dc){const _0x5f3845=null!==_0x44e642?_0x5b5480=>_0x5b5480['attribs'][_0x206093]===_0x44e642:_0x1bdc29=>Boolean(_0x1bdc29['attribs'][_0x206093]);return gt(_0x35578a=>_0x5bf45b(_0x35578a)&&_0x5f3845(_0x35578a),_0x2f31dc);}function Be(_0x592326,_0x53bad3,_0x174f38){const _0x4ecee0=null!==_0x53bad3?_0x1bd489=>_0x1bd489['attribs'][_0x592326]===_0x53bad3:_0x1bad5e=>Boolean(_0x1bad5e['attribs'][_0x592326]);return _0x5bf864(_0x5b3fbd=>_0x5bf45b(_0x5b3fbd)&&_0x4ecee0(_0x5b3fbd),_0x174f38);}function pt(_0xe04d1,_0x66d0ba){return _0xe04d1&&_0x5bf45b(_0xe04d1)?_0xe04d1['attribs'][_0x66d0ba]:null;}function Qe(_0x425b45,_0xb7559c,_0x39b6db){_0x5bf45b(_0x425b45)&&(null===_0x39b6db?delete _0x425b45['attribs'][_0xb7559c]:_0x425b45['attribs'][_0xb7559c]=_0x39b6db);}function ze(_0x373309,_0x46d3ea,_0x10a2ae){const _0x1c5edf=_0x46d3ea['cloneNode'](!0x0);'beforebegin'===_0x10a2ae?_0x1b3de7(_0x373309,_0x1c5edf):'afterbegin'===_0x10a2ae?_0x10bdac(_0x373309,_0x1c5edf):'beforeend'===_0x10a2ae?_0x838115(_0x373309,_0x1c5edf):'afterend'===_0x10a2ae&&_0x24dd09(_0x373309,_0x1c5edf);}function Ae(_0x2c9ea5){const _0xf831d1=[];let _0x43cf64=_0x2c9ea5;for(;_0x43cf64;)_0x43cf64=_0x375dfb(_0x43cf64),_0x43cf64&&_0xf831d1['push'](_0x43cf64);return _0xf831d1;}function Jn(_0x40a629){return _0x40a629['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ze(_0x16c4e7){let _0x529d51=0x0;for(;_0x16c4e7['parentNode'];)_0x16c4e7=_0x16c4e7['parentNode'],_0x529d51++;return _0x529d51;}function Is(_0x492ba6){const _0x532ac8=[];let _0x3640b5=_0x492ba6['nextSibling'];for(;_0x3640b5;)_0x532ac8['push'](_0x3640b5),_0x3640b5=_0x3640b5['nextSibling'];_0x532ac8['forEach'](_0x357dc8=>{_0x5de200(_0x357dc8);});}class Oe extends/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x314197(){['_m2html'];constructor(){super(),this['_m2html']=new _0x4652b8();}['convertMarkdownToHTML'](_0x460b85){const _0x3dbaa1=this['_m2html']['parse'](_0x460b85);return this['parseAndNormalizeHTML'](_0x3dbaa1);}['parseAndNormalizeHTML'](_0x18fb2b){return this['_parseHTML'](_0x18fb2b);}['_parseHTML'](_0x2afe22){const _0x27a57a=Ye('<dummy>'+_0x2afe22['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x27a57a['children']=_0x27a57a['children'][0x0]['children'],_0x27a57a;}}class Ne extends/* #__PURE__ -- @preserve */
|
|
26
|
+
_0x314197(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x9fde10){super(),this['_generateUid']=_0x9fde10||_0x5ef33e;}['merge'](_0xb8ed70,_0x36c597,_0x27d30a){const _0x3cf4a9=_0xb8ed70['cloneNode'](!0x0);if(0x0===_0x36c597['childNodes']['length']){const _0x34539=[];return Be('data-id','new-element',_0x3cf4a9)['forEach'](_0x25bb9c=>{const _0x25ad10=this['_generateUid']();Qe(_0x25bb9c,'data-id',_0x25ad10),_0x34539['push'](_0x25ad10);}),this['_removeSpecialComments'](_0x3cf4a9),{'parsedContent':_0x3cf4a9,'newNodeIds':_0x34539,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x27d30a&&_0x27d30a['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x3cf4a9),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Be('data-id',null,_0x36c597)['map'](_0x474196=>pt(_0x474196,'data-id'))['filter'](_0x5b4637=>!!_0x5b4637));let _0x3bddd3=-0x1,_0x106c0d=!0x1;const _0x552c71=_0x3cf4a9['childNodes'],_0x4df1b0=Array['from'](_0x552c71)['filter'](_0x4f654c=>!(0x3===_0x4f654c['nodeType']&&''===ut(_0x4f654c)['trim']())),_0x571296=_0x4df1b0['length'];for(let _0x408f04=0x0;_0x408f04<_0x571296;_0x408f04++){const _0x2e9ccc=_0x4df1b0[_0x408f04],_0xe59fcf=_0x4df1b0[_0x408f04+0x1];if(this['_isNewNode'](_0x2e9ccc)){if(-0x1===_0x3bddd3&&(_0x3bddd3=_0x408f04),this['_markWrappedElements'](_0x2e9ccc),!this['_isNewNode'](_0xe59fcf)){const [_0x4e367f,_0xb63a68]=this['_findReferenceNode'](_0x2e9ccc,_0x106c0d,_0x36c597);if(_0x4e367f){const _0x1867c7=Array['from'](_0x4df1b0)['slice'](_0x3bddd3,_0x408f04+0x1);this['_insertNodes'](_0x4e367f,_0x1867c7,_0xb63a68),_0x3bddd3=-0x1;}}}else{if(this['_isExistingContentComment'](_0x2e9ccc))_0x106c0d=!0x0;else{if(this['_isExistingNode'](_0x2e9ccc)){const _0x531043=pt(_0x2e9ccc,'data-id');if(_0x531043&&this['_existingDataIds']['has'](_0x531043)){const _0x469c0f=ft('data-id',_0x531043,_0x36c597);this['_replaceNode'](_0x469c0f,_0x2e9ccc);}if(this['_touchedNodesState']['removedIds']['includes'](_0x531043)){const _0x1b1f8a=this['_touchedNodesState']['removedIds']['indexOf'](_0x531043);this['_touchedNodesState']['removedIds']['splice'](_0x1b1f8a,0x1);}}else{if(this['_isDelNode'](_0x2e9ccc)){const _0x4718f7=pt(_0x2e9ccc,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x4718f7)||this['_storeDeletedElementIds'](_0x2e9ccc);}}}}}for(const _0x4aad14 of this['_touchedNodesState']['removedIds']){const _0x1593f2=ft('data-id',_0x4aad14,_0x36c597);if(_0x1593f2){if(_0x27d30a&&_0x27d30a['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x4aad14;const _0x4e8426=_0x27d30a['replaceRemovedWith']['cloneNode'](!0x0);Qe(_0x4e8426,'data-id',_0x4aad14),Qe(_0x4e8426,'data-removed','true'),_0x3ad05b(_0x1593f2,_0x4e8426);}else _0x5de200(_0x1593f2);}}if(Be('data-wrapped-id',null,_0x36c597)['forEach'](_0x58421e=>{const _0x379607=ft('data-id',pt(_0x58421e,'data-wrapped-id'),_0x36c597);var _0x4dd2b3,_0x2093ea;_0x379607&&(_0x2093ea=_0x58421e,_0x5de200(_0x4dd2b3=_0x379607),_0x3ad05b(_0x2093ea,_0x4dd2b3));}),Be('data-id','new-element',_0x36c597)['forEach'](_0xb96fee=>{const _0x27947c=this['_getUid'](_0xb96fee);Qe(_0xb96fee,'data-id',_0x27947c),this['_touchedNodesState']['newIds']['push'](_0x27947c);}),this['_removeSpecialComments'](_0x36c597),_0x27d30a&&_0x27d30a['markUnstableElements']&&this['_markUnstableElements'](_0x36c597,_0x27d30a['markUnstableElementsDepth']||0x0),_0x27d30a&&_0x27d30a['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x317c60=ft('data-id',this['_touchedNodesState']['lastTouchedId'],_0x36c597);for(;_0x317c60;)Is(_0x317c60),_0x317c60=_0x317c60['parentNode'];}return{'parsedContent':_0x36c597,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x34a0e3,_0x1b5518,_0x3c9b49){for(const _0x4ba758 of _0x1b5518){const _0xf55ac2=this['_getUid'](_0x4ba758);Qe(_0x4ba758,'data-id',_0xf55ac2),this['_touchedNodesState']['newIds']['push'](_0xf55ac2),this['_touchedNodesState']['lastTouchedId']=_0xf55ac2;}const _0xd903ed='afterbegin'===_0x3c9b49||'afterend'===_0x3c9b49?_0x1b5518['reverse']():_0x1b5518;for(const _0x543547 of _0xd903ed)ze(_0x34a0e3,_0x543547,_0x3c9b49);}['_replaceNode'](_0x41d32a,_0x2ef76b){if(!_0x41d32a)return;if(_0x323aeb=_0x2ef76b,Jn(ut(_0x41d32a))===Jn(ut(_0x323aeb)))return;var _0x323aeb;const _0x4ea32e=this['_getUid'](_0x41d32a);Qe(_0x2ef76b,'data-id',_0x4ea32e),this['_touchedNodesState']['modifiedIds']['push'](_0x4ea32e),this['_touchedNodesState']['lastTouchedId']=_0x4ea32e,_0x3ad05b(_0x41d32a,_0x2ef76b['cloneNode'](!0x0));}['_findReferenceNode'](_0x157ac9,_0x52b760,_0x455739){const _0x406c8a=this['_findPrevElementWithDataId'](_0x157ac9,!0x1);if(_0x406c8a){const _0xa923eb=this['_getNodeDataId'](_0x406c8a),_0x2e8a11=ft('data-id',_0xa923eb,_0x455739);if(_0x2e8a11)return[_0x2e8a11,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0xa923eb);}const _0xbf8d32=this['_findNextElementWithDataId'](_0x157ac9,!0x1);if(_0xbf8d32){const _0x440e83=this['_getNodeDataId'](_0xbf8d32),_0x3231a8=ft('data-id',_0x440e83,_0x455739);if(_0x3231a8)return[_0x3231a8,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x440e83);}return _0x52b760?_0x157ac9['nextSibling']?this['_findFallbackReferenceNode'](_0x157ac9,_0x455739):[_0x455739['childNodes'][_0x455739['childNodes']['length']-0x1],'afterend']:[_0x455739['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x1c1afa,_0x35fc52){const _0x278bf1=[],_0x311e83=this['_findPrevElementWithDataId'](_0x1c1afa,!0x0);if(_0x311e83){const _0x4dc7d9=ft('data-id',this['_getNodeDataId'](_0x311e83),_0x35fc52);_0x4dc7d9&&_0x278bf1['push']([_0x4dc7d9,'afterend']);}const _0x565f12=this['_findNextElementWithDataId'](_0x1c1afa,!0x0);if(_0x565f12){const _0x243289=ft('data-id',this['_getNodeDataId'](_0x565f12),_0x35fc52);_0x243289&&_0x278bf1['push']([_0x243289,'beforebegin']);}if(_0x278bf1['length']>0x1)return Ze(_0x278bf1[0x0][0x0])<=Ze(_0x278bf1[0x1][0x0])?_0x278bf1[0x0]:_0x278bf1[0x1];return 0x1===_0x278bf1['length']?_0x278bf1[0x0]:[_0x35fc52['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x55ab35,_0x522c13){let _0x192579=_0x55ab35['nextSibling'],_0x48bbc1=null,_0x5137e1=!0x1;for(;_0x192579;){if(_0x1f159b(_0x192579)){if(this['_isDelNode'](_0x192579)&&(_0x48bbc1=_0x192579),this['_isExistingContentComment'](_0x192579)&&_0x522c13&&!_0x5137e1){_0x5137e1=!0x0,_0x192579=_0x192579['nextSibling'];continue;}break;}const _0x591360=pt(_0x192579,'data-id');if(_0x591360&&'new-element'!==_0x591360&&this['_existingDataIds']['has'](_0x591360)){_0x48bbc1=_0x192579;break;}_0x192579=_0x192579['nextSibling'];}return _0x48bbc1;}['_findPrevElementWithDataId'](_0x5e5ad8,_0x2743e0){let _0x29574a=_0x5e5ad8['previousSibling'],_0x5d264b=null,_0xfd662e=!0x1;for(;_0x29574a;){if(_0x1f159b(_0x29574a)){if(this['_isDelNode'](_0x29574a)&&(_0x5d264b=_0x29574a),this['_isExistingContentComment'](_0x29574a)&&_0x2743e0&&!_0xfd662e){_0xfd662e=!0x0,_0x29574a=_0x29574a['previousSibling'];continue;}break;}const _0x58dac1=pt(_0x29574a,'data-id');if(_0x58dac1&&'new-element'!==_0x58dac1&&this['_existingDataIds']['has'](_0x58dac1)){_0x5d264b=_0x29574a;break;}_0x29574a=_0x29574a['previousSibling'];}return _0x5d264b;}['_markWrappedElements'](_0x3bcb91){_0x5bf45b(_0x3bcb91)&&Be('data-id',null,_0x3bcb91)['forEach'](_0x86acf5=>{this['_isExistingNode'](_0x86acf5)&&!this['_hasWrappedParent'](_0x86acf5)&&(Qe(_0x86acf5,'data-wrapped-id',pt(_0x86acf5,'data-id')),Qe(_0x86acf5,'data-id',null));});}['_getNodeDataId'](_0x4813d6){if(!_0x4813d6)return null;if(_0x5bf45b(_0x4813d6))return pt(_0x4813d6,'data-id');if(_0x1f159b(_0x4813d6)){const _0x5eeaa9=ut(_0x4813d6)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x5eeaa9&&_0x5eeaa9[0x1])return _0x5eeaa9[0x1];}return null;}['_storeDeletedElementIds'](_0x535826){if(_0x1f159b(_0x535826)){const _0x11abb5=ut(_0x535826)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x11abb5&&_0x11abb5[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x11abb5[0x1]);}}['_getUid'](_0x23a5f3){return this['_isExistingNode'](_0x23a5f3)?pt(_0x23a5f3,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x5bdc51){(function(_0x432d63){return _0x5b38d5(_0x5d96a1=>_0x1f159b(_0x5d96a1),_0x432d63,!0x0,0x1/0x0);}(_0x5bdc51)['filter'](_0x471e6f=>this['_isDelNode'](_0x471e6f)||this['_isExistingContentComment'](_0x471e6f))['forEach'](_0x143642=>{_0x5de200(_0x143642);}));}['_markLastTagElementUnstable'](_0x9f7a18){const _0x52eecd=_0x9f7a18['childNodes'],_0x2238f1=_0x52eecd[_0x52eecd['length']-0x1];_0x2238f1&&_0x5bf45b(_0x2238f1)&&Qe(_0x2238f1,'data-unstable','true');}['_markUnstableElements'](_0x40d86c,_0x24c482){const _0x2f3291=ft('data-unstable','true',_0x40d86c);if(!_0x2f3291)return;const _0xa26cb0=Ae(_0x2f3291)['slice'](0x0,-0x1),_0x4d93ef=_0xa26cb0['length'];let _0x92d80f=_0x2f3291;if(_0x4d93ef>_0x24c482){let _0x2fd020=_0x4d93ef,_0x340062=null;for(;_0x2fd020>_0x24c482&&_0x2fd020>=0x0;)_0x2fd020--,_0x340062=_0xa26cb0[_0x2fd020];_0x340062&&(_0x92d80f=_0x340062,Qe(_0x2f3291,'data-unstable',null),Qe(_0x340062,'data-unstable','true'));}else{if(_0x4d93ef<_0x24c482){let _0x1079ad=_0x4d93ef,_0x1dcd9c=_0x2f3291;for(;_0x1079ad<_0x24c482;){const _0x1718fd=_0x1dcd9c['childNodes']['filter'](_0x3ff5f3=>_0x5bf45b(_0x3ff5f3));if(0x0===_0x1718fd['length'])break;_0x1079ad++,_0x1dcd9c=_0x1718fd[_0x1718fd['length']-0x1];}_0x1dcd9c&&(_0x92d80f=_0x1dcd9c,Qe(_0x2f3291,'data-unstable',null),Qe(_0x1dcd9c,'data-unstable','true'));}}let _0x4d283c=_0x92d80f;for(;_0x4d283c;){for(;_0x4d283c['nextSibling'];)_0x4d283c=_0x4d283c['nextSibling'],_0x5bf45b(_0x4d283c)&&Qe(_0x4d283c,'data-unstable','true');_0x4d283c=_0x4d283c['parentNode'];}}['_isNewNode'](_0x1afd32){return Boolean('new-element'===pt(_0x1afd32,'data-id'));}['_isExistingNode'](_0x20f2ee){return Boolean((pt(_0x20f2ee,'data-id')||'')['length']>0x0&&'new-element'!==pt(_0x20f2ee,'data-id'));}['_isDelNode'](_0x306b04){return!!_0x306b04&&Boolean(_0x1f159b(_0x306b04)&&ut(_0x306b04)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x4cd91a){let _0xd846f6=_0x4cd91a['parentNode'];for(;_0xd846f6;){if(pt(_0xd846f6,'data-wrapped-id'))return!0x0;_0xd846f6=_0xd846f6['parentNode'];}return!0x1;}['_isExistingContentComment'](_0xefb140){return Boolean(_0x1f159b(_0xefb140)&&ut(_0xefb140)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function y({editor:_0x320b03,changeGroups:_0x407359,documentContextContent:_0x4f484d,showDiff:_0x2c4367,trimUnchanged:_0x5a1037=!0x0}){return _0x407359['map'](_0x5e8d90=>{const _0x3c64af=new mt([]),_0x2ff7a3=new mt([]);for(const _0x4f72a0 of _0x5e8d90['changes'])if(_0x2c4367&&'removed'==_0x4f72a0['type']||_0x2ff7a3['children']['push'](_0x4f72a0['node']['cloneNode'](!0x0)),'new'!=_0x4f72a0['type']&&(_0x2c4367||'removed'!=_0x4f72a0['type'])){const _0x251902=gt(_0x4bd01a=>pt(_0x4bd01a,'data-id')==_0x4f72a0['id'],_0x4f484d,!0x0);_0x251902&&_0x3c64af['children']['push'](_0x251902['cloneNode'](!0x0));}const {content:_0x449d85,hasChanges:_0x29b61b}=function(_0x5cd49b,_0x1f3362,_0x1c6e64,_0x32ae50,_0x115316=!0x0){const _0x2ed30d=_0x5cd49b['plugins']['get']('DocumentCompare'),_0x3b2ad1=ut(_0x1f3362),_0x4d920b=ut(_0x1c6e64),_0x576957=_0x5cd49b['data']['parse'](_0x3b2ad1,'$root'),_0x147363=_0x5cd49b['model']['createPositionAt'](_0x576957,0x0),_0x4c3e70=_0x2ed30d['getDiff'](_0x3b2ad1,_0x4d920b,{'anchor':_0x147363,'markDeletions':_0x32ae50}),_0xba231e=_0x4c3e70['getOperations']();if(0x0==_0xba231e['length'])return{'content':_0x1f3362['cloneNode'](!0x0),'hasChanges':!0x1};_0x32ae50?function(_0x32c666,_0x1c6c26,_0x1a5a58){if(0x0==_0x32c666['length'])return;const _0x9ae7a8=_0x1a5a58['plugins']['get']('DocumentCompare'),_0x436de8=_0x1a5a58['plugins']['get']('SuggestionsConversion');_0x1a5a58['model']['change'](_0x381a39=>{const _0x1986b1=new Set();for(let _0x49269b=0x0;_0x49269b<_0x32c666['length'];_0x49269b++){const _0x3db3c4=_0x32c666[_0x49269b];if(_0x3db3c4['baseVersion']=null,_0x3db3c4['isDocumentOperation']=!0x1,_0x9ae7a8['isMarkedRemoveOperation'](_0x3db3c4)){const _0x24faac=_0x2fe0fa(_0x3db3c4['newRange'],_0x1a5a58['model']),_0x1fcc2d='suggestion:deletion:'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0x1fcc2d,_0x24faac);}else switch(_0x3db3c4['type']){case'rename':{if(_0x3db3c4['oldName']==_0x3db3c4['newName'])break;_0x381a39['batch']['addOperation'](_0x3db3c4),_0x1a5a58['model']['applyOperation'](_0x3db3c4);const _0x2f7765='$elementName',_0xdab92c=_0x3db3c4['position'],_0x1c825d=_0x1a5a58['model']['createRange'](_0xdab92c,_0x1a5a58['model']['createPositionAt'](_0xdab92c['nodeAfter'],'end')),_0x1206a0='suggestion:attribute:'+_0x2f7765+':'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0x1206a0,_0x1c825d);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3db3c4['oldValue']==_0x3db3c4['newValue'])break;_0x381a39['batch']['addOperation'](_0x3db3c4),_0x1a5a58['model']['applyOperation'](_0x3db3c4);const _0x1a92cb=_0x3db3c4['key'];if(!_0x436de8['isRegisteredAttribute'](_0x1a92cb))break;const _0x11cff8=_0x2fe0fa(_0x3db3c4['range'],_0x1a5a58['model']),_0x40ca66='suggestion:attribute:'+_0x1a92cb+':'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0x40ca66,_0x11cff8);break;}case'insert':{_0x381a39['batch']['addOperation'](_0x3db3c4),_0x1a5a58['model']['applyOperation'](_0x3db3c4);if(_0x32c666[_0x49269b+0x1]&&'move'==_0x32c666[_0x49269b+0x1]['type']){ro(_0x1c6c26,_0x3db3c4);break;}const _0x52a2f9=_0x3db3c4['position'],_0x30192b=_0x3db3c4['howMany'],_0x26640d=_0x2fe0fa(_0x1a5a58['model']['createRange'](_0x52a2f9,_0x52a2f9['getShiftedBy'](_0x30192b)),_0x1a5a58['model']),_0xe76400='suggestion:insertion:'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0xe76400,_0x26640d);break;}case'split':{_0x381a39['batch']['addOperation'](_0x3db3c4),_0x1a5a58['model']['applyOperation'](_0x3db3c4);const _0x5016bd=_0x3db3c4['splitPosition'],_0x561929=_0x3db3c4['moveTargetPosition'],_0x2fcb17=_0x1a5a58['model']['createRange'](_0x5016bd,_0x561929),_0x382d38='suggestion:insertion:'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0x382d38,_0x2fcb17);break;}case'move':{_0x381a39['batch']['addOperation'](_0x3db3c4),_0x1a5a58['model']['applyOperation'](_0x3db3c4),_0x32c666[_0x49269b-0x1]&&'insert'==_0x32c666[_0x49269b-0x1]['type']&&ro(_0x1c6c26,_0x3db3c4);const _0x4f55f1=_0x3db3c4['getMovedRangeStart'](),_0x2a7104=_0x3db3c4['howMany'];for(let _0x115d1c=0x0;_0x115d1c<_0x2a7104;_0x115d1c++){const _0x15d81f=_0x4f55f1['getShiftedBy'](_0x115d1c)['nodeAfter'];_0x1986b1['add'](_0x15d81f);}break;}case'remove':{const _0x30c484=_0x3db3c4['sourcePosition'],_0x377b9b=_0x3db3c4['howMany'],_0x1a5de8=new _0x207911(_0x30c484,_0x377b9b);_0x381a39['batch']['addOperation'](_0x1a5de8),_0x1a5a58['model']['applyOperation'](_0x1a5de8);break;}}}for(const _0x259cc4 of _0x1986b1){const _0x2218eb=_0x1a5a58['model']['createRangeOn'](_0x259cc4),_0x4dc19c='suggestion:formatBlock:$fakeWrap:'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0x4dc19c,_0x2fe0fa(_0x2218eb,_0x1a5a58['model']));}});}(_0xba231e,_0x576957,_0x5cd49b):_0x5cd49b['model']['change'](_0x24336b=>{for(const _0x49aa82 of _0xba231e)if('remove'==_0x49aa82['type']){const _0x1e84da=_0x49aa82['sourcePosition'],_0x458b80=_0x49aa82['howMany'],_0x414332=new _0x207911(_0x1e84da,_0x458b80);_0x24336b['batch']['addOperation'](_0x414332),_0x5cd49b['model']['applyOperation'](_0x414332);}else{if('marker'==_0x49aa82['type']){const _0x4dc97e=_0x49aa82['name'],_0x25f77b=_0x49aa82['newRange'];_0x576957['markers']['set'](_0x4dc97e,_0x25f77b);}else _0x49aa82['baseVersion']=null,_0x49aa82['isDocumentOperation']=!0x1,_0x24336b['batch']['addOperation'](_0x49aa82),_0x5cd49b['model']['applyOperation'](_0x49aa82);}});if(_0x115316){const _0x4378a1=lt(_0x5cd49b,_0xba231e,_0x576957);dt(_0x5cd49b['model'],_0x4378a1),function(_0x41a418,_0x471edc){const _0x5a93d9=_0x471edc['getFirstRange']()['start'];let _0x35c068=_0x471edc['getFirstRange']()['end'];const _0xc1f04=_0x5a93d9['root'];(_0x35c068['textNode']||_0x35c068['nodeAfter']&&_0x35c068['nodeAfter']['is']('$text'))&&(_0x2720f2(_0x35c068,'...'),_0x35c068=_0x35c068['getShiftedBy'](0x3)),(_0x5a93d9['textNode']||_0x5a93d9['nodeBefore']&&_0x5a93d9['nodeBefore']['is']('$text'))&&(_0x2720f2(_0x5a93d9,'...'),function(_0x4e918f,_0x1d71b5,_0x3e68da){for(let [_0x1889b8,_0x5dec6e]of _0x4e918f['markers']){const _0x5ca419=_0x5dec6e['_getTransformedByInsertion'](_0x1d71b5,_0x3e68da,!0x1);_0x5dec6e=_0x5ca419[0x0],_0x4e918f['markers']['set'](_0x1889b8,_0x5dec6e);}}(_0xc1f04,_0x5a93d9,0x3),_0x5a93d9['parent']==_0x35c068['parent']&&(_0x35c068=_0x35c068['getShiftedBy'](0x3)));const _0x554254=_0x41a418['createRange'](_0x41a418['createPositionAt'](_0xc1f04,0x0),_0x5a93d9),_0x83f8ea=_0x41a418['createRange'](_0x35c068,_0x41a418['createPositionAt'](_0xc1f04,'end')),_0x2dfa8a=[..._0x554254['getMinimalFlatRanges'](),..._0x83f8ea['getMinimalFlatRanges']()];_0x2dfa8a['reverse']();for(const _0x437529 of _0x2dfa8a)_0x3666da(_0x437529),Zn(_0xc1f04,_0x437529);}(_0x5cd49b['model'],_0x4378a1);}const _0x8a4083=_0x5cd49b['data']['stringify'](_0x576957,{'showSuggestionHighlights':!0x0});return{'content':Ye(_0x8a4083),'hasChanges':!0x0};}(_0x320b03,_0x3c64af,_0x2ff7a3,_0x2c4367,_0x5a1037);return{'type':_0x5e8d90['changes'][0x0]['type'],'index':_0x5e8d90['index'],'content':_0x449d85,'hasChanges':_0x29b61b};});}function ro(_0x4ee4e4,_0x4bdd27){for(const [_0x2d5cd5,_0x369762]of _0x4ee4e4['markers']){const _0x521150=_0x473568['_createFromRanges'](_0x369762['getTransformedByOperation'](_0x4bdd27));_0x4ee4e4['markers']['set'](_0x2d5cd5,_0x521150);}}function lt(_0x2ed3bb,_0x1a9dcc,_0x27f7b2){const _0x5e4099=_0x2ed3bb['plugins']['get']('DocumentCompare');let _0xa5d738=_0x2ed3bb['model']['createPositionAt'](_0x27f7b2,Number['POSITIVE_INFINITY']),_0x426267=_0x2ed3bb['model']['createPositionAt'](_0x27f7b2,0x0);for(const _0x5f2957 of _0x1a9dcc){let _0x21124c,_0x488ef1;if(_0x5e4099['isMarkedRemoveOperation'](_0x5f2957))_0x21124c=_0x5f2957['newRange']['start'],_0x488ef1=_0x5f2957['newRange']['end'];else switch(_0xa5d738=_0xa5d738['getTransformedByOperation'](_0x5f2957),_0x426267=_0x426267['getTransformedByOperation'](_0x5f2957),_0x5f2957['type']){case'rename':_0x21124c=_0x5f2957['position'],_0x488ef1=_0x21124c['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x21124c=_0x5f2957['range']['start'],_0x488ef1=_0x5f2957['range']['end'];break;case'insert':_0x21124c=_0x5f2957['position'],_0x488ef1=_0x21124c['getShiftedBy'](_0x5f2957['howMany']);break;case'split':_0x21124c=_0x5f2957['splitPosition'],_0x488ef1=_0x5f2957['moveTargetPosition'];break;case'merge':{const _0x158f7a=_0x5f2957['targetPosition']['path']['slice'](0x0,-0x1);_0x21124c=_0x2ed3bb['model']['createPositionFromPath'](_0x27f7b2,_0x158f7a),_0x488ef1=_0x21124c['getShiftedBy'](0x1);break;}case'remove':{const _0x3264e3=_0x5f2957['howMany'],_0xb90d77=_0x5f2957['sourcePosition']['_getTransformedByInsertion'](_0x5f2957['targetPosition'],_0x3264e3),_0x26d938=_0x5f2957['getMovedRangeStart']();'remove'==_0x5f2957['type']?(_0x21124c=_0xb90d77,_0x488ef1=_0xb90d77):(_0x21124c=_0x26d938,_0x488ef1=_0x26d938['getShiftedBy'](_0x3264e3));break;}}_0x21124c&&_0x21124c['isBefore'](_0xa5d738)&&(_0xa5d738=_0x21124c['clone'](),_0xa5d738['stickiness']='toNone'),_0x488ef1&&_0x488ef1['isAfter'](_0x426267)&&(_0x426267=_0x488ef1['clone'](),_0x426267['stickiness']='toNone');}return _0x2ed3bb['model']['createSelection'](_0x2ed3bb['model']['createRange'](_0xa5d738,_0x426267));}function dt(_0x52c211,_0x2601c1){so(_0x52c211,_0x2601c1,'forward');const _0x3b2a63=_0x2601c1['getFirstRange']();_0x2601c1['setTo']([]),_0x2601c1['setTo'](_0x3b2a63,{'backward':!0x0}),so(_0x52c211,_0x2601c1,'backward');}function so(_0xce71a6,_0x43787e,_0x2a9c56){let _0x341d3f=0x14;for(;_0x341d3f;){_0xce71a6['modifySelection'](_0x43787e,{'unit':'word','direction':_0x2a9c56}),_0x341d3f--;const _0x5e4e9b=_0x43787e['focus']['forward'==_0x2a9c56?'nodeBefore':'nodeAfter'];if(_0x5e4e9b&&_0x5e4e9b['is']('element')&&_0xce71a6['schema']['isBlock'](_0x5e4e9b)&&_0xce71a6['schema']['isObject'](_0x5e4e9b))break;}}function Zn(_0xfd8c99,_0x290a9d){for(const [_0xd80219,_0x2a6dd7]of _0xfd8c99['markers']){const _0x564e62=_0x2a6dd7['_getTransformedByDeletion'](_0x290a9d['start'],_0x290a9d['end']['offset']-_0x290a9d['start']['offset']);null!=_0x564e62?_0xfd8c99['markers']['set'](_0xd80219,_0x564e62):_0xfd8c99['markers']['delete'](_0xd80219);}}const Ur=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class de extends _0x314197(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new mt([]);['parsedMergedContent']=new mt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x419563,content:_0x112dd5='',isDone:_0x152ee9=!0x1,interactionId:_0x1247bd,areActionsDisabled:_0x6cb37a,documentContextContent:_0x1e74ac,editor:_0xb39f7f,id:_0x2c1ec1}){super(),this['id']=_0x2c1ec1||_0x5ef33e(),this['interactionId']=_0x1247bd,this['type']=_0x419563,this['areActionsDisabled']=!!_0x6cb37a,this['editor']=_0xb39f7f,this['aiResponseParser']=new Oe(),this['aiResponseApplier']=new Ne(),this['documentContextContent']=Ye(_0x1e74ac||''),this['set']('isDone',_0x152ee9),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x112dd5);}['appendContent'](_0x168dbc){this['set']('content',this['content']+_0x168dbc);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x311b14,_0x90c65b){this['changeGroups'][_0x311b14]['state']=_0x90c65b,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x311b14,'state':_0x90c65b});}['getContentParts']({showDiff:_0x132b40,groupIndex:_0x13d625}){if(!this['editor'])throw new _0x239292('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x30cb76=this['_getCachedContentParts'](_0x132b40,_0x13d625);if(_0x30cb76)return _0x30cb76;let _0x1caf74=[];if(void 0x0===_0x13d625)_0x1caf74=this['changeGroups'];else{const _0x87c595=this['changeGroups']['find'](({index:_0x8facbd})=>_0x8facbd===_0x13d625);if(!_0x87c595)throw new _0x239292('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x13d625});_0x1caf74=[_0x87c595];}const _0x29fedb=y({'editor':this['editor'],'showDiff':_0x132b40,'changeGroups':_0x1caf74,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x132b40,_0x29fedb),_0x29fedb;}['_getCachedContentParts'](_0x1725f5,_0x42da9d){const _0x16aee0=_0x1725f5?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x16aee0]['length'])return null;const _0x514d55=this['cachedSuggestionContentParts'][_0x16aee0];if(void 0x0===_0x42da9d)return _0x3af120(_0x514d55);{const _0x3edf33=_0x514d55['find'](({index:_0x154b93})=>_0x154b93===_0x42da9d);if(_0x3edf33)return[_0x3af120(_0x3edf33)];}return null;}['_setCachedContentParts'](_0x2e192f,_0x4c0cb2){const _0x4a04b2=_0x2e192f?'withDiff':'withoutDiff';_0x4c0cb2['forEach'](_0x498d9c=>{const _0x53755b=this['cachedSuggestionContentParts'][_0x4a04b2],_0x1b5510=_0x53755b['find'](({index:_0x5cc8e7})=>_0x5cc8e7===_0x498d9c['index']);if(_0x1b5510){const _0x301d37=_0x53755b['indexOf'](_0x1b5510);_0x53755b['splice'](_0x301d37,0x1,_0x498d9c);}else _0x53755b['push'](_0x498d9c);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x5ef47f=this['changeGroups'];this['updateChangeGroups']();const _0x5e13fd=this['_getDifferentChangeGroups'](_0x5ef47f,this['changeGroups']);(_0x5e13fd['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x5e13fd),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0xee2770,_0x40b3db){const _0x2c2eb8=[];for(const _0x3dffe6 of _0x40b3db){const _0x114f66=_0xee2770[_0x3dffe6['index']];_0x114f66?_0x114f66['changes']['length']!==_0x3dffe6['changes']['length']?_0x2c2eb8['push'](_0x3dffe6):_0x114f66['changes']['forEach']((_0x8c8aa3,_0x33e88f)=>{const _0x4c6e67=_0x3dffe6['changes'][_0x33e88f];_0x8c8aa3['id']!==_0x4c6e67['id']&&_0x2c2eb8['push'](_0x3dffe6);}):_0x2c2eb8['push'](_0x3dffe6);}return _0x2c2eb8;}['updateChangeGroups'](){const _0x466131=new _0x3d5305('p',{},[new _0x3d5305('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x40d4fe(C(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x43863e=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x466131,'cutAfterLastChange':!this['isDone']});if(!_0x43863e['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x43863e['parsedContent'];let _0x205dae=[];if(_0x5bf864(_0x25fca2=>{const _0x8db2ff=pt(_0x25fca2,'data-id');if(!_0x8db2ff||!_0x1cb48e(_0x8db2ff))return!0x1;const _0x58e1e7=[_0x25fca2,...Ae(_0x25fca2)]['at'](-0x2);if(_0x25fca2!=_0x58e1e7){const _0x38af70=pt(_0x58e1e7,'data-id');_0x1cb48e(_0x38af70)||(_0x205dae['push']({'node':_0x58e1e7,'id':_0x38af70,'type':'modified'}),_0x43863e['modifiedNodeIds']['push'](_0x38af70));}else _0x43863e['modifiedNodeIds']['includes'](_0x8db2ff)?_0x205dae['push']({'node':_0x25fca2,'type':'modified','id':_0x8db2ff}):_0x43863e['newNodeIds']['includes'](_0x8db2ff)?_0x205dae['push']({'node':_0x25fca2,'type':'new','id':_0x8db2ff,'anchorId':pt(_0x25fca2['previousSibling'],'data-id')}):_0x205dae['push']({'node':_0x25fca2,'type':'removed','id':_0x8db2ff});return!0x0;},this['parsedMergedContent']),_0x205dae=_0x205dae['filter'](({node:_0x2b7b9b})=>[...Ae(_0x2b7b9b),_0x2b7b9b]['every'](_0x491c56=>!pt(_0x491c56,'data-unstable'))),0x0==_0x205dae['length'])return;const _0x38e079=[[_0x205dae[0x0]]];for(let _0x5e6207=0x1;_0x5e6207<_0x205dae['length'];_0x5e6207++){const _0x4f45ec=_0x38e079[_0x38e079['length']-0x1],_0x325d59=_0x4f45ec[_0x4f45ec['length']-0x1];_0x205dae[_0x5e6207]['node']['previousSibling']==_0x325d59['node']&&'modified'!=_0x205dae[_0x5e6207]['type']&&'modified'!=_0x325d59['type']?_0x4f45ec['push'](_0x205dae[_0x5e6207]):_0x38e079['push']([_0x205dae[_0x5e6207]]);}for(const _0x3c1c48 of _0x38e079){const _0x7e541c=_0x3c1c48[0x0],_0x32d83a=_0x3c1c48[_0x3c1c48['length']-0x1],_0x5555e5=_0x304ea1(_0x7e541c['node']['previousSibling']);_0x5555e5&&_0x3c1c48['unshift'](_0x5555e5);const _0x1ba526=_0x304ea1(_0x32d83a['node']['nextSibling']);_0x1ba526&&_0x3c1c48['push'](_0x1ba526);}function _0x1cb48e(_0x317d6f){return _0x43863e['modifiedNodeIds']['includes'](_0x317d6f)||_0x43863e['newNodeIds']['includes'](_0x317d6f)||_0x43863e['removedNodeIds']['includes'](_0x317d6f);}function _0x304ea1(_0x47061a){if(_0x47061a&&pt(_0x47061a,'data-id')&&!pt(_0x47061a,'data-unstable')){const _0x28899a=pt(_0x47061a,'data-id');if(!_0x1cb48e(_0x28899a))return{'node':_0x47061a,'type':'context','id':_0x28899a};}return null;}this['changeGroups']=_0x38e079['map']((_0x97a196,_0x4dace4)=>({'changes':_0x97a196,'state':'pending','index':_0x4dace4}));}}function $i(_0x5850d9){return Object['values'](Ur)['includes'](_0x5850d9);}function Zi(_0x5df154){return Wr['includes'](_0x5df154);}function Ee(_0x53e186){return'conversation-title'===_0x53e186;}function Fe(_0x77ce34){return'source'===_0x77ce34;}const Vt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class Jt extends _0x7d5e47(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x6db83e,editor:_0x151813}){super(),this['id']=_0x5ef33e(),this['connector']=_0x6db83e,this['isStopped']=!0x0,this['editor']=_0x151813;}async['start'](){let _0x2e1060;const _0x8fdcb7=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x134138=await this['currentRequest']['getStream']();for await(const _0x1d1fd4 of _0x134138){if(this['isStopped'])return;if('error'===_0x1d1fd4['event'])return void this['fire']('error',{'error':new _0x239292('ai-chat-interaction-error',this)});if('message-metadata'!==_0x1d1fd4['event']){if('action-metadata'!==_0x1d1fd4['event']){if(Ee(_0x1d1fd4['event'])&&this['setConversationTitle'](_0x1d1fd4['data']['conversationTitle'],!0x0),Fe(_0x1d1fd4['event']))_0x8fdcb7['push'](_0x1d1fd4['data']['source']);else{if($i(_0x1d1fd4['event'])){if(_0x1d1fd4['event']!==_0x2e1060){if(_0x2e1060=_0x1d1fd4['event'],'web-search'===_0x1d1fd4['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x1d1fd4['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':_0x1d1fd4['event'],'interactionId':this['id'],'id':_0x1d1fd4['data']?.['id']}),_0x8fdcb7['length']>0x0&&'modification-delta'===_0x1d1fd4['event']&&(this['currentReply']['sources']=_0x8fdcb7['splice'](0x0));}_0x1d1fd4['data']['textDelta']&&this['currentReply']['appendContent'](_0x1d1fd4['data']['textDelta']);}else Zi(_0x1d1fd4['event'])||_0x361f9e('ai-interaction-invalid-event-type',{'chunk':_0x1d1fd4});}}else this['actionCallId']=_0x1d1fd4['data']['callId'];}else this['messageId']=_0x1d1fd4['data']['messageId'];}}finally{this['isStopped']||(_0x8fdcb7['length']>0x0&&(this['currentReply']['sources']=_0x8fdcb7['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x2baf4c){return this['replies']['find'](_0x1414a7=>_0x1414a7['id']===_0x2baf4c);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x494a2f=>_0x494a2f['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x1eb7da){const _0x2509cb=new de({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x1eb7da});return this['replies']['push'](_0x2509cb),_0x2509cb['delegate'](...Vt)['to'](this),this['fire']('replyCreated',_0x2509cb),_0x2509cb;}['setConversationTitle'](_0x4dc1ad,_0x1f8793=!0x1){this['fire']('setConversationTitle',_0x4dc1ad,_0x1f8793);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Xt=function(_0x27b00b){return _0x27b00b['FILE']='file',_0x27b00b['DOCUMENT']='document',_0x27b00b['URL']='web-resource',_0x27b00b['TEXT']='text',_0x27b00b['SELECTION']='selection',_0x27b00b;}({}),Ie=function(_0x6a343c){return _0x6a343c['TEXT']='text',_0x6a343c['MARKDOWN']='markdown',_0x6a343c['HTML']='html',_0x6a343c;}({});const xi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ci extends _0x314197(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x14f24b,config:_0x4598a9,ownerId:_0x21b434}){super(),this['_connector']=_0x14f24b,this['_config']=_0x4598a9,this['_ownerId']=_0x21b434;}['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'](_0x4a9ae3){const _0x405ea1=await this['_createContextItemFromContent'](_0x4a9ae3);return this['_addToConversationContextItem'](_0x405ea1),'current-document'===_0x405ea1['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x405ea1;}async['_createContextItemFromContent'](_0x4114b1){if(_0x4114b1['type']===Xt['DOCUMENT']){const _0x2bfd76=await this['_connector']['fetchDocument'](this['_ownerId'],_0x4114b1['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x4114b1['type'],'content':_0x2bfd76['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x2bfd76['attributes']?.['version'],'sessionId':_0x2bfd76['attributes']?.['sessionId']};}return{'id':_0x4114b1['id'],'uiId':_0x4114b1['id'],'label':_0x4114b1['attributes']?.['label']||_0x4114b1['name']||_0x4114b1['url']||_0x4114b1['id'],'type':_0x4114b1['type'],..._0x4114b1?.['attributes']?.['resourceId']?{'resourceId':_0x4114b1['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x1a1326){const _0x4df497=this['_pendingContextItems']['get'](_0x1a1326);_0x4df497?.['isReadOnly']||this['_removeContextItem'](_0x1a1326);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0xb0bde2 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0xb0bde2['uiId']);const _0x1dd32f=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x1dd32f&&this['_addContextItem']({..._0x1dd32f,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x4164ed){for(const _0x3827d9 of _0x4164ed['values']())this['_addToConversationContextItem'](_0x3827d9);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'](_0x7b45ea){return Array['from'](_0x7b45ea['values']())['map'](_0x5b59c7=>this['_mapContextItemToRequestData'](_0x5b59c7))['filter'](_0x3f9bd3=>null!==_0x3f9bd3);}async['addFilesToContext'](_0x3721da,_0x2cc381,_0x478955=Xt['FILE']){const _0x134e55='files-'+_0x5ef33e();this['_startUploadOperation'](_0x134e55);try{await Promise['all'](_0x3721da['map'](async _0x4fcbb2=>{const _0x499413='file-'+_0x5ef33e(),_0x5cc07a=_0x59aba(_0x4fcbb2['name']);try{this['_addContextItem']({'type':_0x478955,'label':_0x2cc381?.['label']||_0x5cc07a,'uiId':_0x499413,'resourceId':_0x2cc381?.['resourceId']},!0x0);const _0x582bcd=this['_connector']['uploadFile'](this['_ownerId'],_0x4fcbb2,_0x2cc381);this['_ongoingUploads']['set'](_0x499413,_0x582bcd['abortController']);const {id:_0xb387f7}=await _0x582bcd['getId']();this['_ongoingUploads']['delete'](_0x499413),this['_finishContextItemLoading']({'type':_0x478955,'id':_0xb387f7,'label':_0x2cc381?.['label']||_0x5cc07a,'uiId':_0x499413,'resourceId':_0x2cc381?.['resourceId']},!0x1);}catch(_0x4f3929){this['_ongoingUploads']['delete'](_0x499413);if(!_0x4f3929['message']['startsWith']('ai-request-aborted')){const _0x4824f3=new _0x239292('ai-chat-file-upload-failed',null,{'fileName':_0x5cc07a});_0x4824f3['stack']=_0x4f3929['stack'],this['fire']('error',{'error':_0x4824f3,'fileName':_0x5cc07a});}this['_removeContextItem'](_0x499413);}}));}finally{this['_finishUploadOperation'](_0x134e55);}}['addCurrentDocumentToContext'](_0x49f4e7){if(this['isCurrentDocumentInContext']())return;const _0x5c464e={'type':Xt['DOCUMENT'],'uiId':'current-document','label':_0x49f4e7,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x5c464e);}async['updateCurrentDocument'](_0x346deb,_0xf2bc5e,_0x1d8e07,_0x4fe727){const _0x1d180b=this['_pendingContextItems']['get']('current-document');if(_0x1d180b&&_0x346deb){_0x1d180b['selection']=_0x4fe727?_0x4fe727['map'](_0x3038be=>({'start':_0x3038be['start'],'end':_0x3038be['end']})):[];try{if(_0x1d180b['version']===_0xf2bc5e)return;const {id:_0x4573ee}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x346deb,{'version':_0xf2bc5e,'sessionId':_0x1d8e07})['getId']();_0x1d180b['id']=_0x4573ee,_0x1d180b['content']=_0x346deb,_0x1d180b['version']=_0xf2bc5e,_0x1d180b['sessionId']=_0x1d8e07;}catch(_0x43d03c){const _0x38d8d2=new _0x239292('ai-chat-document-upload-failed',null);_0x38d8d2['stack']=_0x43d03c['stack'],this['fire']('error',{'error':_0x38d8d2});}}}['addSelectionToContext'](_0x137c10){this['_addContextItem']({'type':Xt['SELECTION'],'label':_0x137c10,'uiId':'selection','content':_0x137c10});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x1bcfee,_0x4ba8a4){const _0x23a0dc='url-'+_0x5ef33e();this['_startUploadOperation'](_0x23a0dc);const _0x3431bb='url-'+_0x5ef33e();try{this['_addContextItem']({'type':Xt['URL'],'label':_0x4ba8a4?.['label']||_0x1bcfee,'uiId':_0x3431bb,'resourceId':_0x4ba8a4?.['resourceId']},!0x0);const _0x36ee8c=this['_connector']['uploadUrl'](this['_ownerId'],_0x1bcfee,_0x4ba8a4);this['_ongoingUploads']['set'](_0x3431bb,_0x36ee8c['abortController']);const {id:_0x547e99}=await _0x36ee8c['getId']();this['_ongoingUploads']['delete'](_0x3431bb),this['_finishContextItemLoading']({'type':Xt['URL'],'id':_0x547e99,'label':_0x4ba8a4?.['label']||_0x1bcfee,'uiId':_0x3431bb,'resourceId':_0x4ba8a4?.['resourceId']},!0x1);}catch(_0x13d1f0){this['_ongoingUploads']['delete'](_0x3431bb),(_0x13d1f0['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x239292('ai-chat-url-upload-failed',this,{'url':_0x1bcfee,'originalError':_0x13d1f0}),'url':_0x1bcfee}),this['_removeContextItem'](_0x3431bb));}finally{this['_finishUploadOperation'](_0x23a0dc);}}async['loadSourceResources'](_0x55529a,_0x375780,_0x5901eb){const _0x415ae2=this['_addContextOptionsState']['sources']['find'](_0x1bb0c7=>_0x1bb0c7['id']===_0x55529a);if(!_0x415ae2)return this['fire']('error',{'error':new _0x239292('ai-chat-source-not-found',this,{'sourceId':_0x55529a}),'sourceId':_0x55529a}),[];try{const _0x4e3052=(await _0x415ae2['getResources'](_0x375780))['map'](_0x562262=>{const _0x193018=this['_isResourceInContext'](_0x562262['id']);return{..._0x562262,'isInContext':_0x193018};});return _0x415ae2['resources']=_0x4e3052,this['fire']('sourceResourcesLoaded',{'sourceId':_0x55529a,'source':_0x415ae2,'resources':_0x4e3052,'uid':_0x5901eb}),_0x4e3052;}catch(_0x8ceba8){return this['fire']('error',{'error':new _0x239292('ai-chat-source-resources-load-failed',this,{'sourceId':_0x55529a,'originalError':_0x8ceba8}),'sourceId':_0x55529a,'sourceLabel':_0x415ae2['label']}),[];}}async['addResourceToContext'](_0x489311,_0x16c6af){if(this['_isResourceInContext'](_0x16c6af['id']))return;let _0x5509ef=_0x16c6af['data'];if(!_0x5509ef&&_0x489311['getData'])try{_0x5509ef=await _0x489311['getData'](_0x16c6af['id']);}catch(_0x40dc62){return void this['fire']('error',{'error':new _0x239292('ai-chat-resource-load-failed',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id'],'originalError':_0x40dc62}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});}if(_0x5509ef)switch(_0x16c6af['type']){case Xt['URL']:if('string'!=typeof _0x5509ef)return void this['fire']('error',{'error':new _0x239292('ai-chat-context-invalid-data',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id'],'expectedType':'string','actualType':typeof _0x5509ef}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});await this['addUrlToContext'](_0x5509ef,{'label':_0x16c6af['label'],'resourceId':_0x16c6af['id']});break;case Xt['FILE']:if(!(_0x5509ef instanceof File))return void this['fire']('error',{'error':new _0x239292('ai-chat-context-invalid-data',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id'],'expectedType':'File','actualType':typeof _0x5509ef}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});await this['addFilesToContext']([_0x5509ef],{'label':_0x16c6af['label'],'resourceId':_0x16c6af['id']});break;case Xt['TEXT']:if('object'!=typeof _0x5509ef||!('content'in _0x5509ef)||!('type'in _0x5509ef))return void this['fire']('error',{'error':new _0x239292('ai-chat-context-invalid-data',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x5509ef}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});_0x5509ef=Ci['_convertTextResourceToFile'](_0x5509ef,_0x16c6af['label']),await this['addFilesToContext']([_0x5509ef],{'label':_0x16c6af['label'],'resourceId':_0x16c6af['id']},Xt['TEXT']);break;default:this['fire']('error',{'error':new _0x239292('ai-chat-context-unsupported-type',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id'],'resourceType':_0x16c6af['type']}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});}else this['fire']('error',{'error':new _0x239292('ai-chat-resource-no-data',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});}static['_convertTextResourceToFile'](_0x517119,_0x41a6fd){switch(_0x517119['type']){case Ie['MARKDOWN']:return new File([_0x517119['content']],_0x41a6fd,{'type':'text/markdown'});case Ie['HTML']:return new File([_0x517119['content']],_0x41a6fd,{'type':'text/html'});default:return new File([_0x517119['content']],_0x41a6fd,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x4f8cdb){switch(_0x4f8cdb['type']){case Xt['FILE']:return{'type':Xt['FILE'],'id':_0x4f8cdb['id']};case Xt['URL']:return{'type':Xt['URL'],'id':_0x4f8cdb['id']};case Xt['DOCUMENT']:return{'type':Xt['DOCUMENT'],'id':_0x4f8cdb['id'],..._0x4f8cdb['selection']?.['length']&&{'selection':_0x4f8cdb['selection']}};case Xt['TEXT']:return{'type':Xt['FILE'],'id':_0x4f8cdb['id']};default:return null;}}['_addContextItem'](_0x4948cb,_0x1b5446=!0x1){if(this['_pendingContextItems']['set'](_0x4948cb['uiId'],_0x4948cb),_0x4948cb['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x4948cb,'isLoading':_0x1b5446}),'current-document'===_0x4948cb['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x4948cb['resourceId']){const _0x169216=this['_findSourceIdsByResourceId'](_0x4948cb['resourceId']);_0x169216&&_0x169216['forEach'](_0x31657a=>{this['_updateResourceInContextState'](_0x31657a,_0x4948cb['resourceId'],!0x0);});}}['_removeContextItem'](_0x36f9ba){const _0x4f584e=this['_pendingContextItems']['get'](_0x36f9ba),_0x25b4d4=this['_ongoingUploads']['get'](_0x36f9ba);if(_0x25b4d4&&(_0x25b4d4['abort'](),this['_ongoingUploads']['delete'](_0x36f9ba)),_0x4f584e?.['resourceId']){const _0x49fc8c=this['_findSourceIdsByResourceId'](_0x4f584e['resourceId']);_0x49fc8c&&_0x49fc8c['forEach'](_0x39902e=>{this['_updateResourceInContextState'](_0x39902e,_0x4f584e['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x36f9ba),this['fire']('contextItemRemoved',{'uiId':_0x36f9ba,'type':_0x4f584e?.['type']}),'current-document'===_0x36f9ba&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x17be40,_0x4ed71b){if(this['_pendingContextItems']['has'](_0x17be40['uiId'])&&(this['_pendingContextItems']['set'](_0x17be40['uiId'],_0x17be40),this['fire']('contextItemLoadingEnded',{'contextItem':_0x17be40,'isLoading':_0x4ed71b}),_0x17be40['resourceId'])){const _0x510989=this['_findSourceIdsByResourceId'](_0x17be40['resourceId']);_0x510989&&_0x510989['forEach'](_0x134ef1=>{this['_updateResourceInContextState'](_0x134ef1,_0x17be40['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x28951c){this['_conversationContextItems']['set'](_0x28951c['uiId'],_0x28951c);}['_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'](_0x457431=>({..._0x457431,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x1ba2c3=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x1ba2c3,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x10c15e){for(const _0x2bcbca of this['_pendingContextItems']['values']())if(_0x2bcbca['resourceId']===_0x10c15e)return!0x0;for(const _0x14dd44 of this['_conversationContextItems']['values']())if(_0x14dd44['resourceId']===_0x10c15e)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x28fb4f){const _0x2c2117=[];for(const _0x486af1 of this['_addContextOptionsState']['sources']){_0x486af1['resources']['find'](_0x25cc14=>_0x25cc14['id']===_0x28fb4f)&&_0x2c2117['push'](_0x486af1['id']);}return 0x0===_0x2c2117['length']?null:_0x2c2117;}['_updateResourceInContextState'](_0x209fee,_0x403450,_0x3141b6){const _0x42137d=this['_addContextOptionsState']['sources']['find'](_0x46732f=>_0x46732f['id']===_0x209fee);if(!_0x42137d)return;const _0x21ce2f=_0x42137d['resources']['find'](_0x3d73af=>_0x3d73af['id']===_0x403450);_0x21ce2f&&(_0x21ce2f['isInContext']=_0x3141b6,this['fire']('resourceStateChanged',{'sourceId':_0x209fee,'resourceId':_0x403450,'isInContext':_0x3141b6}));}['_startUploadOperation'](_0x3bd61f){this['_ongoingUploadOperations']['set'](_0x3bd61f,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x10bfc2){this['_ongoingUploadOperations']['delete'](_0x10bfc2),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Mi=['capabilitiesUpdated'];class Di extends _0x7d5e47(){['_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'](_0x442bd7){const _0x2feeff={};return _0x442bd7&&_0x442bd7['isWebSearchEnabled']&&(_0x2feeff['webSearch']={}),_0x442bd7&&_0x442bd7['isReasoningEnabled']&&(_0x2feeff['reasoning']={}),_0x2feeff;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x5b0628){_0x5b0628!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x5b0628,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0xb1861c){_0xb1861c!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0xb1861c,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Si extends Jt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x2cda0c){super(_0x2cda0c),this['conversationId']=_0x2cda0c['conversationId'],this['contextItems']=_0x2cda0c['contextItems'],this['capabilities']=_0x2cda0c['capabilities'],this['userMessage']=_0x2cda0c['userMessage'],this['model']=_0x2cda0c['model'],this['quickActionData']=_0x2cda0c['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 _0x7d5e47(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0xac476){super(),this['options']=_0xac476,this['connector']=_0xac476['connector'],this['chatModels']=_0xac476['chatModels'],this['id']=_0xac476['conversationId'];}async['init'](_0x4b69f8){try{this['chatContext']=new Ci({'connector':this['connector'],'config':_0x4b69f8,'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 _0x903da6=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x903da6});const _0x46c865=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x46c865&&await this['setModel'](_0x46c865);}catch(_0x1a3b18){const _0x290210=new _0x239292('ai-chat-conversation-init-failed',null,{'message':_0x1a3b18['message']});_0x290210['stack']=_0x1a3b18['stack'],this['fire']('error',{'error':_0x290210});}}async['start'](){if(this['isStarted'])throw new _0x239292('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x239292('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x444cb3}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x444cb3,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x58d456){const _0x3ffe4c=new _0x239292('ai-chat-conversation-start-failed',null,{'message':_0x58d456['message']});_0x3ffe4c['stack']=_0x58d456['stack'],this['fire']('error',{'error':_0x3ffe4c});}}async['load'](_0x399909,_0x1b01d9){try{const _0x388b3c=await this['connector']['fetchConversation'](_0x399909)['getConversation'](),_0x51a538=await this['connector']['fetchConversationMessages'](_0x399909)['getMessages'](),_0x2a2a7d=_0x51a538[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x388b3c['id'],'title'in _0x388b3c?this['fire']('setConversationTitle',_0x388b3c['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x32696c=(await this['chatModels']['getAll']())['find'](_0x5d8c2a=>_0x5d8c2a['id']['toLowerCase']()===_0x2a2a7d['toLowerCase']());return this['selectedModel']=_0x32696c,this['fire']('modelSelected',{'selectedModel':_0x32696c,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x51a538,_0x1b01d9,_0x2a2a7d),this['currentInteraction']=void 0x0,this;}catch(_0x48acfd){const _0x33a5db=new _0x239292('ai-chat-conversation-init-from-id-failed',null,{'message':_0x48acfd['message'],'conversationId':_0x399909});throw _0x33a5db['stack']=_0x48acfd['stack'],this['fire']('error',{'error':_0x33a5db}),_0x33a5db;}}async['_processMessagesToInteractions'](_0x2763f4,_0x4e64cd,_0x147a56){let _0x31c14f;for(const _0x4dcdb4 of _0x2763f4)if('user'===_0x4dcdb4['role']){const _0x1db812=await this['_extractContextItems'](_0x4dcdb4),_0x4e17f8={'isReasoningEnabled':Object['hasOwn'](_0x4dcdb4['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x4dcdb4['capabilities'],'webSearch')};_0x31c14f=this['createInteraction']({'userMessage':_0x4dcdb4['prompt'],'contextItems':_0x1db812,'capabilities':_0x4e17f8,'modelId':_0x147a56,'quickActionData':_0x4dcdb4['attributes']?.['quickActionData']}),this['currentInteraction']=_0x31c14f,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x4dcdb4['role']&&_0x31c14f)for(const _0x14b1fd of _0x4dcdb4['content']){const _0x43ee92='text'===_0x14b1fd['type']?'text-delta':'modification-delta',_0x37c490=_0x31c14f['getDocumentContext']()?.['sessionId']!==_0x4e64cd;_0x31c14f['currentReply']=_0x31c14f['createReply']({'type':_0x43ee92,'isDone':!0x0,'interactionId':_0x31c14f['id'],'areActionsDisabled':_0x37c490}),_0x31c14f['currentReply']['appendContent'](_0x14b1fd['content']);}}}async['_extractContextItems'](_0x599c38){const _0x5d9790=new Map();if(!_0x599c38['content'])return _0x5d9790;for(const _0x4a2165 of _0x599c38['content']){const _0x3b71bd=await this['chatContext']['populateFromMessage'](_0x4a2165);_0x3b71bd&&_0x5d9790['set'](_0x3b71bd['id'],_0x3b71bd);}return _0x5d9790;}async['handleUserInteraction']({userMessage:_0xf7916,quickActionData:_0x2d13f2}){if(!this['isStarted'])throw new _0x239292('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x239292('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x15fccd=this['chatContext']['getPendingContextItems'](),_0x40db6c=this['chatCapabilities']['getCapabilitiesConfig'](),_0x407237=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0xf7916,'contextItems':_0x15fccd,'capabilities':_0x40db6c,'modelId':_0x407237,'quickActionData':_0x2d13f2}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x5b9ae2){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x5b9ae2});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x71ac31,contextItems:_0x1e269f,capabilities:_0x5cd69a,modelId:_0x353a75,quickActionData:_0x162eba}){const _0x15cdea=new Si({'userMessage':_0x71ac31,'contextItems':_0x1e269f,'capabilities':_0x5cd69a,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x353a75,'quickActionData':_0x162eba});return _0x15cdea['delegate'](...Vt)['to'](this),this['interactions']['push'](_0x15cdea),this['fire']('interactionCreated',_0x15cdea),_0x15cdea;}['getInteraction'](_0x1f9d38){return this['interactions']['find'](_0x594b27=>_0x594b27['id']===_0x1f9d38);}['removeInteraction'](_0x436901){const _0x4efa59=this['getInteraction'](_0x436901);_0x4efa59&&(_0x4efa59['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4efa59),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x31b210){this['chatContext']['addCurrentDocumentToContext'](_0x31b210);}async['updateCurrentDocumentInContext']({content:_0x4d2953,version:_0x1e22f7,sessionId:_0x5f2052,selections:_0x4eaeb4}){await this['chatContext']['updateCurrentDocument'](_0x4d2953,_0x1e22f7,_0x5f2052,_0x4eaeb4);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x2ac2f2){this['chatContext']['addSelectionToContext'](_0x2ac2f2);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x1b880a){this['chatContext']['addFilesToContext'](_0x1b880a);}['addUrlToContext'](_0x31c42b){this['chatContext']['addUrlToContext'](_0x31c42b);}['addResourceToContext'](_0x63cce7,_0x1f8468){this['chatContext']['addResourceToContext'](_0x63cce7,_0x1f8468);}['loadSourceResources'](_0x5a891d,_0x1bc61b,_0xf0f751){return this['chatContext']['loadSourceResources'](_0x5a891d,_0x1bc61b,_0xf0f751);}['removeFromContext'](_0x5383c3){this['chatContext']['removeFromContext'](_0x5383c3);}['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'](_0x91923c){_0x91923c?!0x1===await this['chatModels']['isAvailable'](_0x91923c)&&(_0x361f9e('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x91923c}),_0x91923c=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x361f9e('ai-chat-conversation-set-model-null',{'conversation':this}),_0x91923c=(await this['chatModels']['getAvailableModels']())[0x0]),_0x91923c['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x91923c,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x91923c}));}}function P(_0x3f6750){if(_0x3f6750 instanceof st)return _0x3f6750;if(_0x3f6750?.['editors']&&_0x3f6750['editors']['get'](0x0))return _0x3f6750['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.'),_0x3f6750['editors']['get'](0x0);throw new _0x239292('ai-get-editor-from-context-no-editor');}const rt='ai-selection';class c extends _0x267838{['_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 _0x449f19=P(this['context']),_0x8d7115=_0x449f19['plugins']['has']('RealTimeCollaborationClient')&&_0x449f19['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x8d7115||_0x5ef33e();}return this['_sessionId'];}['getDocumentData'](){const _0x21947e=P(this['context']),_0x29bd48=_0x21947e['model'],_0x26cb2f=_0x21947e['data']['toView'](_0x29bd48['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x570c35=new kt(_0x21947e['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x26cb2f,_0x570c35);let _0x20d9f5=_0x21947e['data']['processor']['toData'](_0x26cb2f);const _0x55e2aa=this['_getMarkersInDocumentOrder'](),_0x143e71=[];for(const _0x50bbd6 of _0x55e2aa){const _0x59177a='<'+_0x50bbd6['name']+':start></'+_0x50bbd6['name']+':start>',_0x11174a=_0x20d9f5['indexOf'](_0x59177a);_0x20d9f5=_0x20d9f5['substring'](0x0,_0x11174a)+_0x20d9f5['substring'](_0x11174a+_0x59177a['length']);const _0x36842d='<'+_0x50bbd6['name']+':end></'+_0x50bbd6['name']+':end>',_0x38853a=_0x20d9f5['indexOf'](_0x36842d);_0x20d9f5=_0x20d9f5['substring'](0x0,_0x38853a)+_0x20d9f5['substring'](_0x38853a+_0x36842d['length']),_0x143e71['push']({'markerName':_0x50bbd6['name'],'start':_0x11174a,'end':_0x38853a,'htmlFragment':_0x20d9f5['substring'](_0x11174a,_0x38853a)});}return{'content':_0x20d9f5,'version':_0x21947e['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x143e71};}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4aa04e,_0x5831c3)=>{_0x5831c3['on']('ready',()=>{this['_integrateEditor'](_0x5831c3);});});}['_integrateEditor'](_0x51482e){_0x51482e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':rt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x51482e['conversion']['for']('dataDowncast')['markerToElement']({'model':rt,'view':(_0x170a58,{writer:_0x3f8fe7,options:_0xd0a347})=>_0xd0a347['convertAiChatSelectionMarker']?_0x3f8fe7['createUIElement'](_0x170a58['markerName']+':'+(_0x170a58['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x2bafa0,_0x5f44fd,_0x55330b=!0x1,_0x29d1c3=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x29d1c3)return!0x1;const _0xa6ae91=P(this['context'])['model'];return _0xa6ae91['change'](_0x68b17b=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x5f44fd,this['_displayedFakeSelectionLocked']=_0x55330b;let _0x143f18=0x0;for(let _0xcbc3df of _0x2bafa0){const _0x10b623=rt+':'+_0x143f18;if(_0xcbc3df['start']['isAtEnd']){const _0x43aea5=_0xcbc3df['start']['getLastMatchingPosition'](({item:_0x4631ed})=>!_0xa6ae91['schema']['isContent'](_0x4631ed),{'boundaries':_0xcbc3df});_0xcbc3df=_0x68b17b['createRange'](_0x43aea5,_0xcbc3df['end']);}_0x68b17b['addMarker'](_0x10b623,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xcbc3df}),_0x143f18++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x44e1eb){if(this['_displayedFakeSelectionId']!=_0x44e1eb)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x5c6f97=P(this['context']),_0x58a675=_0x5c6f97['model']['markers']['getMarkersGroup'](rt);return _0x5c6f97['model']['change'](_0x156fb9=>{for(const _0x31c5e7 of _0x58a675)_0x156fb9['removeMarker'](_0x31c5e7);}),!0x0;}['modelToViewWithIds'](_0x1eec6a){const _0xd84362=P(this['context']),_0x1194f2=_0xd84362['data']['toView'](_0x1eec6a),_0x269072=new kt(_0xd84362['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x1194f2,_0x269072),_0x1194f2;}['_setDataIdsOnChildren'](_0x50b562,_0x4e293b){let _0x317923=!0x1;const _0x53dcab=new Set();for(const _0x449ffc of _0x50b562['getChildren']()){const _0x5dc187=_0x449ffc['is']('emptyElement')||_0x449ffc['is']('containerElement');if(!_0x449ffc['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x449ffc,_0x4e293b)||_0x5dc187)&&(_0x4e293b['setAttribute']('data-id',this['_nextDataId'](_0x53dcab),_0x449ffc),_0x317923=!0x0);}return _0x317923;}['_nextDataId'](_0x6e8235){let _0x2006a0;do{_0x2006a0='';for(let _0x4c01e8=0x0;_0x4c01e8<0x4;_0x4c01e8++)_0x2006a0+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x6e8235['has'](_0x2006a0));return _0x6e8235['add'](_0x2006a0),_0x2006a0;}['getSelectionText'](){const {model:_0x4e2a9e}=P(this['context']),_0x49443f=_0x4e2a9e['document']['selection'],_0x381390=_0x4e2a9e['getSelectedContent'](_0x49443f),_0x2d5cbc=[],_0x44deba=_0x4e2a9e['createRangeIn'](_0x381390)['getWalker']();for(const {item:_0x261bd7}of _0x44deba)_0x261bd7['is']('$textProxy')?_0x2d5cbc['push'](_0x261bd7['data']):_0x261bd7['is']('element')&&_0x2d5cbc['length']>0x0&&'\x20'!==_0x2d5cbc[_0x2d5cbc['length']-0x1]&&_0x2d5cbc['push']('\x20');return'\x22'+_0x2d5cbc['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x54dfaa=P(this['context'])['model'];return Array['from'](_0x54dfaa['markers']['getMarkersGroup'](rt))['sort']((_0x3cedf6,_0x253e05)=>_0x3cedf6['getStart']()['isBefore'](_0x253e05['getStart']())?-0x1:_0x3cedf6['getStart']()['isAfter'](_0x253e05['getStart']())?0x1:0x0);}}const k=['applySuggestion','insertSuggestion','showChangeInText'];class nh extends _0x10aa9f{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x5cca61,_0x38aa84){super(_0x5cca61),this['_dropdownOriginalConfig']=_0x38aa84||[...k],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x399354=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x238f2a({'label':Hn('applySuggestion',_0x5cca61,this['_partsCount']),'icon':_0x47bafa,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x238f2a({'label':Hn('showChangeInText',_0x5cca61,this['_partsCount']),'icon':_0x193385,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x238f2a({'label':Hn('insertSuggestion',_0x5cca61,this['_partsCount']),'icon':_0x87ebb0,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x5cca61),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',_0x399354['if']('isVisible','ck-hidden',_0x2b2528=>!_0x2b2528)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x2d2e14=>'applySuggestion'!==_0x2d2e14):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x5cca61);});}['_updateDropdownActions'](_0x5cad42){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x5cad42),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x32bf7a){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x4dd6f1=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x32bf7a):this['_createActionsDropdown'](_0x32bf7a),_0x40ac17=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x4dd6f1['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x32bf7a,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x32bf7a,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x40ac17});for(const _0x11df53 of this['_dropdownCurrentConfig'])_0x4dd6f1['on'](_0x11df53,()=>{this['fire'](_0x11df53);});return this['_firstRender']=!0x1,_0x4dd6f1;}['_createActionsButton'](_0x106a99){const _0x1c5c0b=new _0x5cde82(_0x106a99);return _0x1c5c0b['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x1c5c0b['on']('execute',()=>{_0x1c5c0b['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x1c5c0b;}['_createActionsDropdown'](_0x51b5d3){const _0x521435=new Gn(_0x51b5d3,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x1d4c95=>{switch(_0x1d4c95){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x521435['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x51b5d3,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x51b5d3,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x521435['bind']('isEnabled')['to'](this),_0x521435;}['updateLabels'](_0x33dd40){const _0x3055cb=this['locale'];this['_partsCount']=_0x33dd40||this['_partsCount'],this['actionsButton']['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x3055cb,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x3055cb,this['_partsCount'])}),this['applySuggestionModel']['label']=Hn('applySuggestion',_0x3055cb,this['_partsCount']),this['showChangeInTextModel']['label']=Hn('showChangeInText',_0x3055cb,this['_partsCount']),this['insertSuggestionModel']['label']=Hn('insertSuggestion',_0x3055cb,this['_partsCount']);}}class Gn extends _0x1cf9f8{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x376165,_0x569528){super(_0x376165),this['balloonPanelView']=new _0x179f18(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'](_0x569528['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 _0x180dc8=_0x569528['listItemModels'][0x0]['actionName'];this['fire'](_0x180dc8),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']());}),_0x2cf367({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x2cc461){const _0x32c009=this['locale'],_0x15d826=new _0x4a219d(_0x32c009);for(const _0x2921ee of _0x2cc461){const _0x98ec9=new _0x2ced3c(_0x32c009),_0xc69ea1=new _0x993614(_0x32c009);_0xc69ea1['bind'](...Object['keys'](_0x2921ee))['to'](_0x2921ee),_0xc69ea1['delegate']('execute')['to'](_0x15d826),_0x98ec9['children']['add'](_0xc69ea1),_0x15d826['items']['add'](_0x98ec9);}return _0x15d826['items']['delegate']('execute')['to'](this),_0x15d826['on']('execute',_0x407da3=>{const _0x22de90=_0x407da3['source'];this['fire'](_0x22de90['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x15d826;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x4c12a2(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x142a57,_0x3c6aea)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x3c6aea();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function yn(_0x3bb7b5){return{'top':_0x3bb7b5['bottom'],'left':_0x3bb7b5['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x19d1e3,_0x55b259){return{'top':_0x19d1e3['bottom'],'left':_0x19d1e3['left']-(_0x55b259['width']-_0x19d1e3['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Hn(_0x257361,_0x32ca65,_0x41a28b){switch(_0x257361){case'applySuggestion':return C(_0x32ca65,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x41a28b);case'showChangeInText':return C(_0x32ca65,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x41a28b);case'insertSuggestion':return C(_0x32ca65,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x41a28b);}}function Ln(_0x750339,_0x95ce45,_0x25651e){switch(_0x750339){case'applySuggestion':return C(_0x95ce45,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x25651e);case'showChangeInText':return C(_0x95ce45,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x25651e);case'insertSuggestion':return C(_0x95ce45,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x25651e);}}class ki extends _0x7d5e47(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x38d9c4,availableModels:_0x10f545,defaultModelId:_0xf5b7b1}){super(),this['_connector']=_0x38d9c4,this['_availableModels']=_0x10f545,this['_defaultModelId']=_0xf5b7b1;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x57e3a8=this['_connector']['getModels'](),_0x1ac895=await _0x57e3a8['list']();this['_modelList']=_0x1ac895['items'];}catch(_0x50b12b){throw new _0x239292('ai-models-unable-to-retrieve',null,{'error':_0x50b12b});}return[...this['_modelList']];}async['getAvailableModels'](){const _0x13dbdc=await this['getAll']();return this['_filterModels'](_0x13dbdc,this['_availableModels']);}async['getModel'](_0x3b9d87){const _0x5e8a6b=await this['getAll']();if(!_0x5e8a6b['length'])return null;if(_0x3b9d87){const _0x3601ec=this['_getModelById'](_0x5e8a6b,_0x3b9d87);if(_0x3601ec)return _0x3601ec;_0x361f9e('ai-chat-model-id-unrecognized',{'modelId':_0x3b9d87,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x537a03=await this['getAvailableModels']();if(!_0x537a03['length'])return null;if(this['_defaultModelId']){const _0x1ca901=this['_getModelById'](_0x537a03,this['_defaultModelId']);if(_0x1ca901)return _0x1ca901;_0x361f9e('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x537a03[0x0]['id']});}return _0x537a03[0x0];}async['isAvailable'](_0x88e86c){return(await this['getAvailableModels']())['some'](_0x74bc1c=>_0x74bc1c['name']===_0x88e86c['name']&&_0x74bc1c['provider']===_0x88e86c['provider']);}['_filterModels'](_0x237860,_0x30b1dd){let _0x56f2b6;if(_0x30b1dd){_0x56f2b6=[];const _0x3f902c='string'==typeof _0x30b1dd?[_0x30b1dd['toLocaleLowerCase']()]:_0x30b1dd['map'](_0x39e8ec=>_0x39e8ec['toLocaleLowerCase']());for(const _0x5ddf7d of _0x3f902c)for(const _0x28abb9 of _0x237860)(_0x28abb9['id']['toLocaleLowerCase']()===_0x5ddf7d||_0x28abb9['name']['toLocaleLowerCase']()===_0x5ddf7d||Me(_0x28abb9)&&'auto'===_0x5ddf7d||_0x28abb9['provider']['toLocaleLowerCase']()===_0x5ddf7d||_0x28abb9['id']['toLocaleLowerCase']()['startsWith'](_0x5ddf7d))&&_0x56f2b6['push'](_0x28abb9);}else _0x56f2b6=_0x237860;return _0x56f2b6;}['_getModelById'](_0x19ca9e,_0x1b9e1d){return _0x19ca9e['find'](_0x30b19a=>Me(_0x30b19a)&&'auto'===_0x1b9e1d?_0x30b19a:_0x30b19a['id']===_0x1b9e1d)||null;}static['getLocalized'](_0x15456a,_0x4c3edf){return _0x4c3edf['map'](_0x53791e=>{if(Me(_0x53791e))_0x53791e['name']=C(_0x15456a,'AI_MODEL_NAME_AUTO'),_0x53791e['description']=C(_0x15456a,'AI_MODEL_DESCRIPTION_AUTO');else C(_0x15456a,'AI_MODEL_DESCRIPTION_'+_0x53791e['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x53791e['description']=C(_0x15456a,'AI_MODEL_DESCRIPTION_'+_0x53791e['id']['toUpperCase']()));return _0x53791e;});}}function Me(_0x3c6def){return _0x3c6def['id']['startsWith']('agent');}class ht extends ki{async['getAll'](){return(await super['getAll']())['sort']((_0xfe339b,_0x8ed3f8)=>{const _0x18bd76=Object['values'](_0xfe339b['capabilities'])['filter'](_0x2cd860=>_0x2cd860['enabled'])['length'];return Object['values'](_0x8ed3f8['capabilities'])['filter'](_0x394656=>_0x394656['enabled'])['length']-_0x18bd76;});}}function v({editor:_0x39398f,interaction:_0x55beea,reply:_0x4e6ee9,groups:_0x3af4e0,transform:_0x4a724a,documentCompare:_0x5b67af,documentCompareOptions:_0x375ccf}){const _0x2b182f=_0x55beea['getDocumentContext']();if(!_0x2b182f)return[];const _0x5161aa=_0x2b182f['content'],_0x813d70=_0x2b182f['version'],_0x2b69f0=_0x4e6ee9['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4307e5}of _0x3af4e0){const _0x331117=_0x4307e5['filter'](_0x229ebc=>'new'!=_0x229ebc['type'])['map'](_0x444230=>ft('data-id',_0x444230['id'],_0x2b69f0)),_0x67087e=_0x4307e5['filter'](_0x52cfb8=>'removed'!=_0x52cfb8['type'])['map'](_0x2862c6=>_0x2862c6['node']['cloneNode'](!0x0));let _0x72b782=null;if(_0x331117['length']){_0x72b782=_0x331117[0x0]['previousSibling'];for(let _0x4174f2=0x0;_0x4174f2<_0x331117['length'];_0x4174f2++)_0x5de200(_0x331117[_0x4174f2]);}if(_0x67087e['length']){_0x72b782||(_0x4307e5[0x0]['anchorId']?_0x72b782=ft('data-id',_0x4307e5[0x0]['anchorId'],_0x2b69f0):(_0x72b782=_0x67087e['shift'](),_0x10bdac(_0x2b69f0,_0x72b782)));for(let _0x16ccf5=0x0;_0x16ccf5<_0x67087e['length'];_0x16ccf5++)_0x24dd09(_0x72b782,_0x67087e[_0x16ccf5]),_0x72b782=_0x67087e[_0x16ccf5];}}const _0x1fa039=ut(_0x2b69f0),_0x72a119=_0x5b67af['getDiff'](_0x5161aa,_0x1fa039,_0x375ccf)['getOperations']();if(_0x4a724a){const _0x342b8f=_0x39398f['model']['document']['history']['getOperations'](_0x813d70),_0x418249={'document':_0x39398f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x1c1e0c(_0x72a119,_0x342b8f,_0x418249)['operationsA'];}return _0x72a119;}function b(_0x4ffb66,_0x337ea8){if('marker'!=_0x337ea8['type'])return;const _0x5e2aef=_0x4ffb66['model']['markers']['get'](_0x337ea8['name']);_0x5e2aef&&(_0x337ea8['oldRange']=_0x5e2aef['getRange']());}class Vr extends _0x4deb4c{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x32217a,_0x8db6a8={},_0x24bdbe){super(_0x32217a),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x8db6a8};const _0x9ac7d2=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x9ac7d2?'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'](_0x24bdbe),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 _0x5cde82(this['locale']),this['likeButton']['set']({'icon':_0x5c7a21,'label':C(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x43e054=>!_0x43e054),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x5cde82(this['locale']),this['dislikeButton']['set']({'icon':_0x2b5af5,'label':C(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3b06d6=>!_0x3b06d6),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x5cde82(this['locale']),this['copyButton']['set']({'icon':_0x5165e9,'label':C(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5cfcfa=>!_0x5cfcfa);const _0x4f5e4e=new _0x3dad93();_0x4f5e4e['set']({'content':_0x222bf2}),_0x4f5e4e['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'](_0x4f5e4e);}['_setupShowChangesButton'](_0x2ba4b5){this['showChangesButton']=new _0x5cde82(this['locale']),this['showChangesButton']['set']({'icon':_0x17eb0a,'label':C(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x2ba4b5}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x1e2526=>!_0x1e2526),this['showChangesButton']['on']('execute',()=>{const _0xdbbd05=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0xdbbd05,'icon':_0xdbbd05?_0x47c4e2:_0x17eb0a}),this['fire']('toggleShowChanges',_0xdbbd05);});}}class Lr extends _0x10aa9f{['showChangesToggleView'];constructor(_0x416bad,_0x14cc5f){super(_0x416bad),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0x416bad),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':C(_0x416bad,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x14cc5f['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x28b81d=>_0x28b81d?_0x5f4a4e:_0x1c85b2),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x4a04d4=new _0x3dad93();_0x4a04d4['content']=_0x2cbef8,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x14cc5f['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x4a04d4,{'tag':'span','children':[C(_0x416bad,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0x5cde82{['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(_0x577276){this['options']={'delay':_0x577276['delay']??0x14,'textNodeStyle':_0x577276['textNodeStyle'],'onStreamUpdate':_0x577276['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x136c9a,targetElement:_0x1e0747,abortSignal:_0x16d745}){this['isStreaming']&&this['stop'](),_0x16d745?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x19eeb8(_0x136c9a,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x361f9e('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x569369=0x0;_0x569369<this['currentIndex'];_0x569369++)this['nodesList'][_0x569369]['shouldBeStreamed']=!0x0;let _0x5b23ed=0x0;for(let _0x472962=this['currentIndex'];_0x472962<this['nodesList']['length'];_0x472962++){const _0x399a5d=Date['now'](),_0x235713=this['nodesList'][_0x472962],_0x294715=_0x399a5d-_0x5b23ed;_0x235713['shouldBeStreamed']=!0x0;let _0x847243=_0x235713['parent'];for(;_0x847243;)_0x847243['shouldBeStreamed']=!0x0,_0x847243=_0x847243['parent'];if(_0x294715<this['options']['delay'])try{const {promise:_0xb24781,abortController:_0x8b8d74}=pr(this['options']['delay']-_0x294715);this['timeoutAbortController']=_0x8b8d74,await _0xb24781;}catch(_0x3f6f53){return;}_0x2be199(_0x1e0747,'<'+_0x1e0747['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x1e0747['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x472962,_0x5b23ed=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x22fb3f}){Array['from'](_0x22fb3f['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0xe43cf9=>{_0xe43cf9['replaceWith'](_0xe43cf9['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x4653c4){let _0xc09019='';if(function(_0x2d7684){return _0x2f8491(_0x2d7684);}(_0x4653c4)){for(const _0x2ccd28 of _0x4653c4['children'])_0xc09019+=this['renderNode'](_0x2ccd28);}else{if(dr(_0x4653c4)){if(!_0x4653c4['shouldBeStreamed'])return'';const _0x17dbf9=_0x4653c4,_0x76aa8=Object['entries'](_0x17dbf9['attribs'])['map'](([_0x3f44fb,_0x2d8a67])=>_0x3f44fb+'=\x22'+_0x2d8a67+'\x22')['join']('\x20');_0xc09019+='<'+_0x17dbf9['tagName']+(_0x76aa8?'\x20'+_0x76aa8:'')+'>';for(const _0x5900bf of _0xbebafa(_0x17dbf9))_0xc09019+=this['renderNode'](_0x5900bf);_0xc09019+='</'+_0x17dbf9['tagName']+'>';}else{if(!ar(_0x4653c4))return'';if(!_0x4653c4['shouldBeStreamed'])return'';!function(_0x10b561){if(!_0x10b561['parent']||!dr(_0x10b561['parent']))return!0x1;if(!cr['includes'](_0x10b561['parent']['tagName']))return!0x1;return!_0x439ba7(_0x10b561)['match'](/^\s*[<>]\s*$/);}(_0x4653c4)?_0xc09019+=_0x259462(_0x4653c4):_0xc09019+=_0x259462(new _0x3d5305('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x4653c4]));}}return _0xc09019;}['getParsedDocumentNodeList'](){const _0x3671a4=[];return function(_0x2d56e9,_0x337e24){const _0x815526=_0xdb735c=>{if(_0x337e24(_0xdb735c),_0xdb735c instanceof _0x10a76f)for(let _0x553b3b=0x0;_0x553b3b<_0xdb735c['children']['length'];_0x553b3b++){const _0x3c7080=_0xdb735c['children'][_0x553b3b];_0x815526(_0x3c7080);}};for(let _0x345088=0x0;_0x345088<_0x2d56e9['children']['length'];_0x345088++)_0x815526(_0x2d56e9['children'][_0x345088]);}(this['document'],_0x323085=>{if(ar(_0x323085)){const _0x1f3111=this['splitTextNodeIntoWordNodes'](_0x323085);_0x1f3111['length']&&_0x3671a4['push'](..._0x1f3111);}_0x323085['isWordSplitSource']||_0x323085['isWordSplitResult']||_0x3671a4['push'](_0x323085);}),_0x3671a4;}['splitTextNodeIntoWordNodes'](_0x203f14){if(_0x203f14['isWordSplitSource']||_0x203f14['isWordSplitResult'])return[];const _0x443c70=_0x439ba7(_0x203f14)['match'](/(?:\s*\S+\s*)/g),_0x425689=[];if(_0x443c70&&_0x443c70['length']>0x1){for(const _0x110670 of _0x443c70){const _0x2d7bc8=new _0x40d4fe(_0x110670);_0x2d7bc8['isWordSplitResult']=!0x0,_0x1b3de7(_0x203f14,_0x2d7bc8),_0x425689['push'](_0x2d7bc8);}_0x203f14['isWordSplitSource']=!0x0,_0x5de200(_0x203f14);}return _0x425689;}}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(_0x3aab5d){return _0x1ddb5a(_0x3aab5d);}function dr(_0x398762){return _0x5bf45b(_0x398762);}function pr(_0x90d1e3){const _0x20ad6c=new AbortController();return{'promise':new Promise((_0x251683,_0x573442)=>{const _0x1a1a0b=setTimeout(_0x251683,_0x90d1e3);_0x20ad6c['signal']['addEventListener']('abort',()=>{clearTimeout(_0x1a1a0b),_0x573442();});}),'abortController':_0x20ad6c};}const Te=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x10aa9f{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x2b9b2a,{part:_0x15ceae,uiIndex:_0xae3b2,areActionsDisabled:_0x5da3b6,availableActions:_0x24008d}){super(_0x2b9b2a),this['set']('partDefinition',_0x15ceae),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x5c398b=>'pending'==_0x5c398b&&!_0x5da3b6),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x2b9b2a,{'part':_0x15ceae,'uiIndex':_0xae3b2,'availableActions':_0x24008d}),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 _0x2db124=this['bindTemplate'];this['contentView']=new _0x10aa9f(),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',_0x2db124['to']('state',_0x358c03=>'ck-ai-suggestion__body__content-part_'+_0x358c03),_0x2db124['to']('isEnabled',_0x42ce62=>_0x42ce62?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x2db124['if']('isVisible','ck-hidden',_0x564fe5=>!_0x564fe5)]},'children':this['children'],'on':{'mouseenter':_0x2db124['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x15ceae['index']});}),'mouseleave':_0x2db124['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x15ceae['index']});})}});}async['updateContent']({part:_0x1ac767,renderingStrategy:_0x343b98,showUnchangedParts:_0x6615fc=!0x1,abortSignal:_0x408540}){this['partDefinition']=_0x1ac767,this['isVisible']=this['partDefinition']['hasChanges']||_0x6615fc,this['isVisible']&&('streaming'===_0x343b98?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x408540}):this['contentView']['element']['innerHTML']=ut(this['partDefinition']['content']));}['toggleHeader'](_0x3b1da5){_0x3b1da5?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x10aa9f{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x269885,{part:_0x32438c,uiIndex:_0x235f9b,availableActions:_0x2905cb}){super(_0x269885),this['set']('partDefinition',_0x32438c),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x478e1c=new _0x3dad93();_0x478e1c['content']=_0x3b149b,_0x478e1c['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x552738=[];if(_0x2905cb['includes']('showChangeInText')){const _0x3d7416=new _0x5cde82(_0x269885);_0x3d7416['set']({'label':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x193385}),_0x3d7416['bind']('isEnabled')['to'](this),_0x3d7416['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x32438c['index']});}),_0x552738['push'](_0x3d7416);}if(_0x2905cb['includes']('insertSuggestion')){const _0x44fce1=new _0x5cde82(_0x269885);_0x44fce1['set']({'label':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x87ebb0}),_0x44fce1['bind']('isEnabled')['to'](this),_0x44fce1['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x32438c['index']});}),_0x552738['push'](_0x44fce1);}const _0x13ee6a=new _0x5cde82(_0x269885);_0x13ee6a['set']({'label':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x449359}),_0x13ee6a['bind']('isEnabled')['to'](this),_0x13ee6a['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x32438c['index']});}),_0x552738['push'](_0x13ee6a),this['_toolbarView']=new _0x4deb4c(_0x269885),this['_toolbarView']['items']['addMany'](_0x552738),this['_iconStateAccepted']=new _0x3dad93(),this['_iconStateAccepted']['content']=_0x13c00f,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x3dad93(),this['_iconStateRejected']['content']=_0x5511b4,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x3dad93(),this['_iconStateOutdated']['content']=_0x5511b4,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x4332c6=new _0x10aa9f(_0x269885);_0x4332c6['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[C(_0x269885,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x235f9b['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x478e1c,_0x4332c6,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',(_0x160fb0,_0x5208d1,_0x2eab37,_0x550801)=>{switch(_0x550801){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(_0x2eab37){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 _0x7d5e47(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x5bcf37){const _0x2dec90=this['createTask'](_0x5bcf37);return this['queue']['push'](_0x2dec90),this['_processQueue'](),_0x2dec90['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(_0x43d7c0=>{this['once']('_queueEmpty',()=>{_0x43d7c0();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x36386b=this['queue']['shift']();try{await _0x36386b['callback'](this['_abortController']['signal']),_0x36386b['resolve']();}catch(_0x4799a5){_0x36386b['reject'](_0x4799a5);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x2b1426){let _0x27bcf0,_0x33dbe0;const _0x1b8b8d=new Promise((_0x62ee2b,_0xd33d25)=>{_0x27bcf0=_0x62ee2b,_0x33dbe0=_0xd33d25;});return{'callback':_0x2b1426,'resolve':_0x27bcf0,'reject':_0x33dbe0,'completePromise':_0x1b8b8d};}}class jr extends _0x10aa9f{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0xbab10b){super();const _0x4bca39=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']=_0xbab10b,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x4bca39['if']('isDone','ck-ai-chat__feed__item_done'),_0x4bca39['if']('isVisible','ck-hidden',_0x3322cf=>!_0x3322cf),'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'](_0x3e1a0d=>{_0x3e1a0d['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2414e4,_0x4d9a21,_0x4bcbc2){await this['htmlStreamer']['stream']({'document':_0x2414e4,'targetElement':_0x4d9a21,'abortSignal':_0x4bcbc2});}}class _e extends jr{constructor(_0x31ee8b){super(_0x31ee8b),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x31ee8b['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x8e1165){this['element']['innerHTML']=_0x8e1165;}}class Dr extends _0x10aa9f{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x24f408,_0xd7a9ff){super(_0x24f408);const {areActionsDisabled:_0x5ca7cf,showUnchangedParts:_0x535b18,availableActions:_0x17e266}=_0xd7a9ff;this['_areActionsDisabled']=_0x5ca7cf,this['_showUnchangedParts']=_0x535b18,this['_availableActions']=_0x17e266,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _(),this['_emptyPartsWarningView']=new _e({'id':'empty-parts-warning','initialContent':C(_0x24f408,'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:_0x2f893a,renderingStrategy:_0x317721,abortSignal:_0x43dc95}){this['_children']['length']?_0x2f893a['forEach'](_0x24d753=>{const _0x5deb43=this['_cachedContentParts']['findIndex'](_0x4d1e86=>_0x4d1e86['index']==_0x24d753['index']);-0x1===_0x5deb43?this['_cachedContentParts']['push'](_0x24d753):this['_cachedContentParts'][_0x5deb43]=_0x24d753;}):this['_cachedContentParts']=_0x2f893a;for(const _0x3ba1a1 of _0x2f893a['filter'](_0x38cd3f=>_0x38cd3f['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x378a46=>{let _0x2b02e9=this['getPartView'](_0x3ba1a1['index']);_0x2b02e9||(_0x2b02e9=new na(this['locale'],{'part':_0x3ba1a1,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x2b02e9['delegate'](...Te)['to'](this),this['_children']['add'](_0x2b02e9),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x2b02e9['toggleHeader'](this['_children']['length']>0x1),await _0x2b02e9['updateContent']({'part':_0x3ba1a1,'renderingStrategy':_0x317721,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x378a46});});return _0x43dc95?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x363e87,_0x35c1df){const _0x48b050=this['getPartView'](_0x363e87);_0x48b050&&(_0x48b050['state']=_0x35c1df),this['hasPendingParts']='pending'==_0x35c1df||Array['from'](this['_children'])['some'](_0x1f5956=>'pending'==_0x1f5956['state']);}['getPartView'](_0x153987){return this['_children']['find'](_0x35773c=>_0x35773c['partDefinition']['index']==_0x153987)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x619afd=!this['_cachedContentParts']['find'](({hasChanges:_0x526440})=>_0x526440),_0x14a6de=!!this['_cachedContentParts']['find'](({hasChanges:_0x12705a})=>!_0x12705a);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x14a6de,_0x619afd?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'](_0x5f4f05=>_0x5f4f05['partDefinition']['hasChanges']);}}class Le extends _0x2265d2{constructor(_0x336590=void 0x0){super();const _0x3b6aa9=_0x336590?'ck-ai-spinner_'+_0x336590:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x3b6aa9]}});}}class e extends _0x10aa9f{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x31288c,_0x1ec2d1){super(_0x31288c);const {showDiff:_0x2eae21,areActionsDisabled:_0x409f43,miniToolbarConfig:_0x3acef3,hideHeader:_0x2dd0f5,showLoader:_0x2ec528,showUnchangedParts:_0x53760f,availableActions:_0x3398d6}=_0x1ec2d1;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x2ec528),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x2dd0f5||(this['headerView']=new Lr(_0x31288c,{'showDiff':_0x2eae21}),this['headerView']['on']('toggleShowChanges',(_0x5ecd62,_0x473fcc)=>{this['areChangesVisible']=_0x473fcc['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x473fcc['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x31288c,{'areActionsDisabled':_0x409f43,'showUnchangedParts':!!_0x53760f,'availableActions':_0x3398d6}),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(_0x31288c,_0x3acef3,_0x2eae21),this['miniToolbarView']['delegate'](...Te)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x5cb244,_0x3e971a)=>{this['areChangesVisible']=_0x3e971a,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x3e971a});}),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']),_0x2ec528&&(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'](_0x43a208){await this['bodyView']['updateContentParts'](_0x43a208);}['updateSources'](_0x185b9a){this['sourcesView']['children']['addMany'](_0x185b9a['map'](_0x3d8db4=>new Fr(this['locale'],_0x3d8db4))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0xae6894){if(this['errorView']){const _0x3c1933=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x3c1933&&(_0x3c1933['textContent']=_0xae6894),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'](_0x37d03a){this['miniToolbarView']['items']['add'](_0x37d03a);}['removeNavigationItem'](_0x2603d6){this['miniToolbarView']['items']['remove'](_0x2603d6);}['_createLoaderView'](){const _0xa08ff=new _0x10aa9f(this['locale']),_0x359aa1=new Le('small');_0x359aa1['isVisible']=!0x0;const _0x1a1ab6=new _0x10aa9f(this['locale']);return _0x1a1ab6['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[C(this['locale'],'AI_CHAT_IS_WRITING')]}),_0xa08ff['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x5e71c2=>!_0x5e71c2)]},'children':[_0x359aa1,_0x1a1ab6]}),_0xa08ff;}['_createErrorView'](){const _0x461f84=new _0x10aa9f(this['locale']),_0x46ece4=new _0x10aa9f(this['locale']);return _0x46ece4['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[C(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x461f84['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x254118=>!_0x254118)]},'children':[_0x46ece4]}),_0x461f84;}}class Sr extends _0x10aa9f{['children'];constructor(_0x3c97c8){super(_0x3c97c8),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',_0x142e0e=>!_0x142e0e)]},'children':this['children']});const _0x27a8c4=new _0x10aa9f(this['locale']),_0x27b1f7=new _0x3dad93();_0x27b1f7['content']=_0x340ab6,_0x27a8c4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x27b1f7,{'tag':'span','children':[{'text':C(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x27a8c4);}}class Fr extends _0x5cde82{constructor(_0x3acdfa,_0x448d89){super(_0x3acdfa),this['set']({'label':_0x448d89['title'],'tooltip':_0x448d89['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x13199b=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x13199b['to'](()=>{window['open'](_0x448d89['url'],'_blank');})}}),_0x448d89['favicon']){const _0x389ed4=new _0x10aa9f(_0x3acdfa);_0x389ed4['setTemplate']({'tag':'img','attributes':{'src':_0x448d89['favicon']||_0x340ab6,'alt':_0x448d89['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x389ed4);}else this['set']('icon',_0x340ab6);}}class es extends _0x4deb4c{constructor(_0x46fe46,_0x54fd9e=!0x0,_0xfae7a5=!0x0){super(_0x46fe46),this['set']('isLoading',!0x1),_0x54fd9e&&(this['applyButton']=this['_createButton'](C(_0x46fe46,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x1f5a59=>!_0x1f5a59),this['items']['add'](this['applyButton'])),_0xfae7a5&&(this['suggestButton']=this['_createButton'](C(_0x46fe46,'AI_BALLOON_SUGGEST_BUTTON'),_0x54fd9e?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0xc8d828=>!_0xc8d828),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x30a0e7,_0x7492b5){const _0x55c731=new _0x5cde82(this['locale']);return _0x55c731['set']({'label':_0x30a0e7,'class':_0x7492b5||'','isVisible':!0x0,'withText':!0x0}),_0x55c731;}}class os extends _0x10aa9f{constructor(_0x3fe9e0){super(_0x3fe9e0),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(_0x3fe9e0,'AI_DISCLAIMER_TEXT')}]}]});}}const O=['applySuggestion','insertSuggestion','showNext','showPrevious'];class R extends _0x10aa9f{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];constructor(_0xdde84,_0x2c4d4e,_0x5b4f4b,_0x317ac9){super(_0xdde84),this['_availableActions']=_0x5b4f4b,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x317ac9),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new ts(),this['keystrokes']=new _0x4c12a2(),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 _0x285700(),this['_addContentView'](_0x2c4d4e['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x2c4d4e['showApplyButton'],_0x2c4d4e['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'](_0x2c4d4e['showApplyButton'],_0x2c4d4e['showSuggestButton']);});}['render'](){super['render']();for(const _0x5ed9c3 of this['_focusables'])this['focusTracker']['add'](_0x5ed9c3['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x1eff23){-0x1===_0x1eff23?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x47e3f8){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x47e3f8,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x41cd08){this['showError'](_0x41cd08);}['showBlockingError'](_0x4dd824){this['showError'](_0x4dd824),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x5df8f2){const _0x4a0e29=this['_createNextButtonView'](),_0x361aab=this['_createPreviousButtonView']();_0x5df8f2['view']['headerView']['children']['add'](_0x4a0e29,0x2),_0x5df8f2['view']['headerView']['children']['add'](_0x361aab,0x0),this['_focusables']['addMany']([_0x4a0e29,_0x361aab]),this['focusTracker']['add'](_0x4a0e29['element']),this['focusTracker']['add'](_0x361aab['element']);}['_addContentView'](_0x434f28){this['_mainView']=_0x434f28,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x3af4f8){const _0x9bba30=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x3af4f8,this['_dialogContent']['add'](this['_mainView'],_0x9bba30),this['hideError']();}['_addDisclaimerView'](){this['disclaimerView']=new os(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0xe5a2ed=!0x0,_0x5ee75f=!0x0){_0xe5a2ed=_0xe5a2ed&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x5ee75f=_0x5ee75f&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new es(this['locale'],_0xe5a2ed,_0x5ee75f),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x197337=new _0x5cde82(this['locale']);return _0x197337['set']({'icon':_0x1524bc,'tooltip':C(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x197337['on']('execute',()=>{this['fire']('showNext');}),_0x197337;}['_createPreviousButtonView'](){const _0x3218c3=new _0x5cde82(this['locale']);return _0x3218c3['set']({'icon':_0x52404d,'tooltip':C(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x3218c3['on']('execute',()=>{this['fire']('showPrevious');}),_0x3218c3;}['_createErrorView'](){const _0x3b185d=new _0x10aa9f(this['locale']),_0x41ab94=new _0x10aa9f(this['locale']);return _0x41ab94['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x3b185d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0xf6eb1a=>!_0xf6eb1a)]},'children':[_0x41ab94]}),_0x3b185d;}}const x=0xa;class w extends _0x267838{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'](_0x5ee860){const _0xe7e861=P(this['context']);if(this['_config']=_0x5ee860,this['isOpen'])return void this['_updateBalloon'](_0x5ee860);const _0x3be58d=this['context']['config']['get']('ai.availableReplyActions')||[...k],_0x13ead7=_0xe7e861?.['commands']['get']('trackChanges'),_0x10ad18=_0x13ead7?.['value'];this['balloonView']=new R(_0xe7e861['locale'],_0x5ee860,_0x3be58d,!!_0x10ad18),this['balloonView']['delegate'](...O)['to'](this),_0x13ead7&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x13ead7,'value'),this['_showDialog'](_0x5ee860);}['close'](){P(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateBalloon'](_0x13509b){const _0x37597b=P(this['context']),_0x2a0a58=_0x37597b['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x37597b['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x2a0a58['view']?.['headerView']&&(_0x2a0a58['view']['headerView']['label']=_0x13509b['title'],_0x2a0a58['view']['headerView']['iconView']&&_0x13509b['icon']&&(_0x2a0a58['view']['headerView']['iconView']['content']=_0x13509b['icon'])),this['balloonView']['updateContent'](_0x13509b['mainView']),this['_setupVisualSelection'](_0x13509b['ranges'],_0x13509b['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x2a0a58['view']&&_0x2a0a58['view']['updatePosition']();},_0x37597b['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x16ee83,_0xd90fb9){this['context']['plugins']['get'](c)['showFakeVisualSelection'](_0x16ee83,'ai-balloon-'+_0xd90fb9,!0x0,!0x0);}['_showDialog'](_0x49abba){const _0x50a869=P(this['context']);this['_setupVisualSelection'](_0x49abba['ranges'],_0x49abba['index']);const _0x2226b1=this['_getSelectionElements']();_0x2226b1&&_0x2226b1[0x0]&&_0x10737b({'target':_0x2226b1[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x50a869['plugins']['get']('Dialog')['show']({'title':_0x49abba['title'],'icon':_0x49abba['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x49abba['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x9aab9c=>{_0x49abba['showRotator']&&this['balloonView']['setupRotator'](_0x9aab9c),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'](_0x408e7a,_0x28447b){if(!_0x28447b)return null;const _0x271952=this['_getSelectionElements']();if(!_0x271952||0x0===_0x271952['length'])return{'left':Math['round'](_0x28447b['left']+_0x28447b['width']/0x2-_0x408e7a['width']/0x2),'top':Math['round'](_0x28447b['top']+_0x28447b['height']/0x2-_0x408e7a['height']/0x2)};const _0x30d8a3=Math['round'](_0x28447b['left']+_0x28447b['width']/0x2-_0x408e7a['width']/0x2),_0x2f715a=new _0x507e52(_0x271952[0x0]),_0xf9a1ff=new _0x507e52(_0x271952[_0x271952['length']-0x1]),_0x2bc049=_0x408e7a['height'],_0x1f8f52=this['_config']['showRotator']?0x8:0x0;return{'left':_0x30d8a3,'top':this['_calculateOptimalTopPosition'](_0x2f715a,_0xf9a1ff,_0x2bc049,_0x1f8f52,_0x28447b)};}['_calculateOptimalTopPosition'](_0x2c29b3,_0x32916b,_0x3effaa,_0x2add18=0x0,_0x54bd96){const _0x115725=_0x3effaa+_0x2add18,_0x452a5c=new _0x507e52(_0x218ca6['window']),_0x160db2=[_0x2c29b3['getVisible'](),_0x32916b['getVisible']()]['filter'](_0x3fa1df=>_0x3fa1df),_0x1b9a8c=_0x507e52['getBoundingRect'](_0x160db2);if(!_0x1b9a8c)return Math['round'](_0x54bd96['top']+_0x54bd96['height']/0x2);const _0x42074a=_0x452a5c['getIntersection'](_0x1b9a8c);if(!_0x42074a)return Math['round'](_0x54bd96['top']+_0x54bd96['height']/0x2);const _0x20ea33=_0x54bd96['getVisible'](),_0x1938f3=_0x20ea33&&_0x1b9a8c['height']>_0x20ea33['height'],_0x255952=_0x42074a['top'],_0x3c5765=_0x42074a['bottom'];if(_0x1938f3){const _0x3f095b=(_0x20ea33||_0x452a5c)['height']/0x2-_0x115725/0x2,_0x9a7f56=_0x255952-x-_0x54bd96['top'],_0x468720=_0x54bd96['bottom']-_0x3c5765-x;return _0x9a7f56>=_0x115725?Math['max'](x,_0x255952-_0x115725-x):_0x468720>=_0x115725?_0x3c5765+x:Math['max'](x,_0x3f095b);}const _0x106e19=_0x255952-_0x115725,_0xc83448=_0x54bd96['bottom']-_0x3c5765-x,_0x3fcab9=_0x255952-x-_0x54bd96['top'];let _0xb69937;if(_0xc83448>=_0x115725)_0xb69937=_0x3c5765+x;else{if(_0x3fcab9>=_0x115725)_0xb69937=_0x106e19-x;else _0xb69937=_0x255952+_0x1b9a8c['height']/0x2-_0x115725/0x2;}return _0xb69937;}['_setupMarkerRemovalListener'](){const _0x4e831c=P(this['context']);this['listenTo'](_0x4e831c['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x656f2b,data:{newRange:_0x1a487c}}of _0x4e831c['model']['document']['differ']['getChangedMarkers']())if(_0x656f2b['startsWith']('ai-selection:')&&(_0x1a487c&&(_0x1a487c['start']['isEqual'](_0x1a487c['end'])||'$graveyard'==_0x1a487c['root']['rootName'])||null==_0x1a487c)){const _0x496a88=C(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x496a88),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x4153a2=P(this['context']);this['stopListening'](_0x4153a2['model']['document']);}['_getSelectionElements'](){const _0x168537=P(this['context']);return _0x27098b(_0x168537['editing'],[..._0x168537['model']['markers']['getMarkersGroup']('ai-selection'),..._0x168537['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class tt extends _0x267838{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[s,w,_0x4176c6];}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 _0x2b845b=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x53348e,_0x3b0f68)=>{this['_handleUIUserMessage']({'userMessage':_0x3b0f68});}),this['listenTo'](_0x2b845b,'resizedTabs',(_0x471f94,_0x289b67)=>{this['_setIsMaximized'](_0x289b67);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x2b845b['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',(_0xdf7c7a,_0xe325ca)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0xe325ca));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x5046a8,_0x445d46)=>{this['activeConversation']?.['addUrlToContext'](_0x445d46);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x457571,_0x5cf6e9)=>{this['activeConversation']?.['addResourceToContext'](_0x5cf6e9['source'],_0x5cf6e9['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0xec8a0e,_0x38cc29)=>{this['_removeFromContext'](_0x38cc29);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x4207ee,_0x520d70)=>{this['activeConversation']?.['loadSourceResources'](_0x520d70['sourceId'],_0x520d70['query'],_0x520d70['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x943f9a,_0x1cbd48)=>{this['activeConversation']?.['setModel'](_0x1cbd48);}),this['listenTo'](this['_aiChatUi'],'like',(_0xf54f6c,{replyId:_0x4f1dad})=>{console['log']('Liked\x20response',_0x4f1dad);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x383e49,{replyId:_0x2cb04d})=>{console['log']('Disliked\x20response',_0x2cb04d);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x452c2a,_0x2ade5a)=>{this['context']['plugins']['get'](w)['close'](),this['_insertSuggestion'](_0x2ade5a);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x533e1c,{replyId:_0x4ad0e2,partIndex:_0x1ce715})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4ad0e2,_0x1ce715);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x440e75,{replyId:_0x49337d,partIndex:_0x1ce847})=>{const _0x4bd65f=this['_getDocumentRangeForReplyChanges'](_0x49337d,_0x1ce847);_0x4bd65f&&'$graveyard'!=_0x4bd65f['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x4bd65f['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0xcfd308,_0x32d8dc)=>{this['context']['plugins']['get'](w)['close'](),this['_applySuggestion'](_0x32d8dc);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x4066a7,{replyId:_0x1eb5d8,showDiff:_0x7df8e6})=>{const {reply:_0x398ef8}=this['getInteractionAndReplyById'](_0x1eb5d8),_0x336bb2=_0x398ef8['getContentParts']({'showDiff':_0x7df8e6});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x398ef8['id'],'parts':_0x336bb2,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x527d1b,{replyId:_0x3c6ab2,partIndex:_0x328acb})=>{this['_previewedChangeGroup']?.['replyId']==_0x3c6ab2&&this['_previewedChangeGroup']?.['partIndex']==_0x328acb&&this['context']['plugins']['get'](w)['close']();const {reply:_0x175414}=this['getInteractionAndReplyById'](_0x3c6ab2);_0x175414['setChangeGroupState'](_0x328acb,'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',(_0x179793,_0x441891)=>{_0x441891['on']('ready',()=>{this['_integrateEditor'](_0x441891);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x7eb48e){const _0x2e19df=P(this['context']);if(!_0x2e19df['plugins']['has']('TrackChanges'))throw new _0x239292('ai-no-track-changes',null);const _0x27045c=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x4c822b,interaction:_0x4e8610}=this['getInteractionAndReplyById'](_0x7eb48e['replyId']),_0x1d44b9=this['_getDocumentRangeForReplyChanges'](_0x7eb48e['replyId'],_0x7eb48e['partIndex']),_0x72c1de=void 0x0!==_0x7eb48e['partIndex']?[_0x4c822b['changeGroups'][_0x7eb48e['partIndex']]]:_0x4c822b['changeGroups']['filter'](_0x7648c4=>'pending'==_0x7648c4['state']),_0x18300c=_0x72c1de['map'](_0x2ac13e=>_0x4c822b['changeGroups']['indexOf'](_0x2ac13e));if(!_0x1d44b9||'$graveyard'==_0x1d44b9['range']['root']['rootName'])return void _0x18300c['forEach'](_0x3be6b3=>_0x4c822b['setChangeGroupState'](_0x3be6b3,'outdated'));_0x18300c['forEach'](_0x58d439=>_0x4c822b['setChangeGroupState'](_0x58d439,'accepted'));const _0x30c79a=v({'editor':_0x2e19df,'reply':_0x4c822b,'interaction':_0x4e8610,'groups':_0x72c1de,'transform':!0x0,'documentCompare':_0x27045c,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x29e5ca;_0x1d44b9&&this['_scrollToSuggestionRange'](_0x1d44b9['range']),_0x2e19df['model']['change'](_0x4c3258=>{_0x29e5ca=_0x4c3258['batch'],_0x2e19df['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x30c79a),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x29e5ca,{'interactionId':_0x4e8610['id'],'replyId':_0x4c822b['id'],'indexes':_0x18300c['slice']()}),this['_updateRatings'](_0x4c822b);}['_applySuggestion'](_0x298f9a){const _0x57f981=P(this['context']),_0x4afef5=this['context']['plugins']['get'](_0x4176c6),{reply:_0x113abf,interaction:_0x2a79c8}=this['getInteractionAndReplyById'](_0x298f9a['replyId']),_0xc820c4=this['_getDocumentRangeForReplyChanges'](_0x298f9a['replyId'],_0x298f9a['partIndex']),_0x544146=void 0x0!==_0x298f9a['partIndex']?[_0x113abf['changeGroups'][_0x298f9a['partIndex']]]:_0x113abf['changeGroups']['filter'](_0x379d80=>'pending'==_0x379d80['state']),_0x394b0e=_0x544146['map'](_0x30d615=>_0x113abf['changeGroups']['indexOf'](_0x30d615));if(!_0xc820c4||'$graveyard'==_0xc820c4['range']['root']['rootName'])return void _0x394b0e['forEach'](_0x4e3788=>_0x113abf['setChangeGroupState'](_0x4e3788,'outdated'));_0x394b0e['forEach'](_0x10eb85=>_0x113abf['setChangeGroupState'](_0x10eb85,'accepted'));const _0x4744dd=v({'editor':_0x57f981,'reply':_0x113abf,'interaction':_0x2a79c8,'groups':_0x544146,'transform':!0x0,'documentCompare':_0x4afef5,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x4b6292;_0xc820c4&&this['_scrollToSuggestionRange'](_0xc820c4['range']),_0x57f981['model']['change'](_0x5a2ebb=>{_0x4b6292=_0x5a2ebb['batch'];for(const _0x8f0cb2 of _0x4744dd)_0x8f0cb2['baseVersion']=_0x57f981['model']['document']['version'],b(_0x57f981,_0x8f0cb2),_0x5a2ebb['batch']['addOperation'](_0x8f0cb2),_0x57f981['model']['applyOperation'](_0x8f0cb2);}),this['_batchToChanges']['set'](_0x4b6292,{'interactionId':_0x2a79c8['id'],'replyId':_0x113abf['id'],'indexes':_0x394b0e['slice']()}),this['_updateRatings'](_0x113abf);}['_openBalloonFor'](_0x1944c8,_0x120e12){const _0x128c46=P(this['context']),_0x2fe2ec=this['_getDocumentRangeForReplyChanges'](_0x1944c8,_0x120e12),_0x149075=this['context']['plugins']['get'](w);if(!_0x2fe2ec)return void _0x149075['close']();const {range:_0x583a22,currentIndex:_0x557048}=_0x2fe2ec;if('$graveyard'==_0x583a22['root']['rootName']){const {reply:_0x30bd27}=this['getInteractionAndReplyById'](_0x1944c8);return _0x30bd27['setChangeGroupState'](_0x557048,'outdated'),void _0x149075['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x1944c8&&this['_previewedChangeGroup']?.['partIndex']==_0x557048)return;this['stopListening'](_0x149075),this['_previewedChangeGroup']={'replyId':_0x1944c8,'partIndex':_0x557048};let _0x24d1a5=_0x128c46['config']['get']('ai.availableReplyActions')||[...k];_0x128c46['plugins']['has']('TrackChanges')||(_0x24d1a5=_0x24d1a5['filter'](_0x4fc299=>'insertSuggestion'!=_0x4fc299));const _0x1398c1=new e(_0x128c46['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x24d1a5});this['stopListening'](_0x1398c1);const {reply:_0x4869e9}=this['getInteractionAndReplyById'](_0x1944c8),_0x481b43=_0x4869e9['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x3f970d=>_0x3f970d['hasChanges']),_0x29377e=_0x481b43['findIndex'](_0x1abdf8=>_0x1abdf8['index']==_0x557048);if(-0x1==_0x29377e)return;const _0x1d910a=_0x481b43[_0x29377e],_0x1f585e=_0x481b43['at']((_0x29377e-0x1)%_0x481b43['length'])?.['index'],_0x587b9b=_0x481b43['at']((_0x29377e+0x1)%_0x481b43['length'])?.['index'];_0x1398c1['updateContent']({'parts':[_0x1d910a],'renderingStrategy':'static'});const _0x569ec4=_0x557048!==_0x1f585e;this['_scrollToSuggestionRange'](_0x583a22,!0x0),_0x149075['open']({'index':_0x557048,'title':C(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x29377e+0x1)['toString']()),'icon':Ct,'mainView':_0x1398c1,'showRotator':_0x569ec4,'showApplyButton':!0x0,'showSuggestButton':_0x128c46['plugins']['has']('TrackChanges'),'ranges':[_0x583a22]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x1944c8,_0x557048),this['listenTo'](_0x1398c1,'toggleSuggestionDisplayMode',(_0x18a603,{showDiff:_0x49ac91})=>{this['_balloonShowDiff']=_0x49ac91;const {reply:_0x1ae521}=this['getInteractionAndReplyById'](_0x1944c8),_0x441949=_0x1ae521['getContentParts']({'showDiff':_0x49ac91,'groupIndex':_0x557048});_0x1398c1['updateContent']({'parts':_0x441949,'renderingStrategy':'static'});}),this['listenTo'](_0x149075,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x1944c8,'partIndex':_0x557048}),_0x569ec4?this['_openBalloonFor'](_0x1944c8,_0x587b9b):_0x149075['close']();}),this['listenTo'](_0x149075,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x1944c8,'partIndex':_0x557048}),_0x569ec4?this['_openBalloonFor'](_0x1944c8,_0x587b9b):_0x149075['close']();}),_0x569ec4&&(this['listenTo'](_0x149075,'showNext',()=>{this['_openBalloonFor'](_0x1944c8,_0x587b9b);}),this['listenTo'](_0x149075,'showPrevious',()=>{this['_openBalloonFor'](_0x1944c8,_0x1f585e);})),this['listenTo'](_0x149075,'dialogClosed',()=>{this['stopListening'](_0x149075),this['stopListening'](_0x1398c1),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x338c37,_0x3cb1e8){const _0x3a1679=P(this['context']),{reply:_0x53697c,interaction:_0x1f2d57}=this['getInteractionAndReplyById'](_0x338c37),_0x3af9e9=_0x53697c['changeGroups']['filter'](_0x342750=>'pending'==_0x342750['state']),_0xecba2f=_0x3af9e9['map'](_0xc1063c=>_0x53697c['changeGroups']['indexOf'](_0xc1063c));void 0x0===_0x3cb1e8&&(_0x3cb1e8=_0xecba2f[0x0]);const _0x434b2c=_0xecba2f['indexOf'](_0x3cb1e8);if(-0x1==_0x434b2c)return null;const _0x58f83a=_0x3af9e9[_0x434b2c],_0x37b01f=new mt([]),_0x11ead2=new mt([]);for(const _0xf9cae3 of _0x58f83a['changes'])if('removed'!=_0xf9cae3['type']&&_0x11ead2['children']['push'](_0xf9cae3['node']['cloneNode'](!0x0)),'new'!=_0xf9cae3['type']){const _0xccb89d=gt(_0x31de12=>pt(_0x31de12,'data-id')==_0xf9cae3['id'],_0x53697c['documentContextContent'],!0x0);_0x37b01f['children']['push'](_0xccb89d['cloneNode'](!0x0));}if(0x0==_0x37b01f['children']['length']){if(_0x58f83a['changes'][0x0]['anchorId']){const _0x3de10d=ft('data-id',_0x58f83a['changes'][0x0]['anchorId'],_0x53697c['documentContextContent']);_0x37b01f['children']['unshift'](_0x3de10d['cloneNode'](!0x0)),_0x11ead2['children']['unshift'](_0x3de10d['cloneNode'](!0x0)),_0x3de10d['nextSibling']&&(_0x37b01f['children']['push'](_0x3de10d['nextSibling']['cloneNode'](!0x0)),_0x11ead2['children']['push'](_0x3de10d['nextSibling']['cloneNode'](!0x0)));}else{const _0x54881a=_0x53697c['documentContextContent']['children'][0x0];if(!_0x54881a)return null;_0x37b01f['children']['push'](_0x54881a['cloneNode'](!0x0)),_0x11ead2['children']['push'](_0x54881a['cloneNode'](!0x0));}}const _0x48e2bf=_0x1f2d57['getDocumentContext'](),_0x1a5556=_0x3a1679['data']['parse'](_0x48e2bf['content']),_0x268009=ut(_0x37b01f),_0x4c3691=_0x3a1679['data']['parse'](_0x268009),_0x2e55e0=_0x3a1679['data']['parse'](_0x268009),_0x5eff2e=_0x3a1679['model']['createPositionAt'](_0x4c3691,0x0),_0x547914=ut(_0x11ead2),_0xff4086={'anchor':_0x5eff2e,'markDeletions':!0x1},_0x47caa8=_0x3a1679['plugins']['get'](_0x4176c6)['getDiff'](_0x268009,_0x547914,_0xff4086)['getOperations']();if(!_0x47caa8['length'])return null;_0x3a1679['model']['change'](_0x4c6edc=>{for(const _0x499a07 of _0x47caa8)if('remove'==_0x499a07['type']){const _0x24d7a2=_0x499a07['sourcePosition'],_0x264a40=_0x499a07['howMany'],_0x58435b=new _0x207911(_0x24d7a2,_0x264a40);_0x4c6edc['batch']['addOperation'](_0x58435b),_0x3a1679['model']['applyOperation'](_0x58435b);}else'marker'!==_0x499a07['type']&&(_0x499a07['baseVersion']=null,_0x499a07['isDocumentOperation']=!0x1,_0x4c6edc['batch']['addOperation'](_0x499a07),_0x3a1679['model']['applyOperation'](_0x499a07));});const _0x308ec7=lt(_0x3a1679,_0x47caa8,_0x4c3691);dt(_0x3a1679['model'],_0x308ec7);const _0x40c973=_0x308ec7['getFirstRange']()['start']['path']['slice'](),_0x33c26c=_0x308ec7['getFirstRange']()['end']['path']['slice'](),_0x35135b=[];let _0x4ccead=_0x4c3691,_0x346d8c=_0x2e55e0;for(let _0x327608=0x0;_0x327608<_0x33c26c['length'];_0x327608++){const _0x33ae68=_0x4ccead['maxOffset']-_0x33c26c[_0x327608];_0x35135b[_0x327608]=_0x346d8c['maxOffset']-_0x33ae68,_0x4ccead=_0x4ccead['getChildAtOffset'](_0x33c26c[_0x327608]),_0x346d8c=_0x346d8c['getChildAtOffset'](_0x35135b[_0x327608]);}const _0x5673d7=_0x3a1679['model']['createRange'](_0x3a1679['model']['createPositionFromPath'](_0x2e55e0,_0x40c973),_0x3a1679['model']['createPositionFromPath'](_0x2e55e0,_0x35135b)),_0x17f617=_0x2e55e0['getChild'](0x0)['getAttribute'](ct),_0x464e43=Array['from'](_0x1a5556['getChildren']())['find'](_0x35ec54=>_0x35ec54['getAttribute'](ct)==_0x17f617)['getPath'](),_0x526ada=_0x5673d7['start']['path']['slice'](),_0x461208=_0x5673d7['end']['path']['slice']();_0x526ada[0x0]=_0x464e43[0x0]+_0x526ada[0x0],_0x461208[0x0]=_0x464e43[0x0]+_0x461208[0x0];let _0x299b75=_0x3a1679['model']['createRange'](_0x3a1679['model']['createPositionFromPath'](_0x3a1679['model']['document']['getRoot'](),_0x526ada),_0x3a1679['model']['createPositionFromPath'](_0x3a1679['model']['document']['getRoot'](),_0x461208));const _0x44e674=_0x3a1679['model']['document']['history']['getOperations'](_0x48e2bf['version']);for(const _0x5cd8ce of _0x44e674)_0x299b75=_0x473568['_createFromRanges'](_0x299b75['getTransformedByOperation'](_0x5cd8ce));return{'range':_0x299b75,'currentIndex':_0x3cb1e8};}['_integrateEditor'](_0x2b2ce2){if(!_0x2b2ce2['plugins']['has']('Undo'))return;const _0x154977=_0x2b2ce2['commands']['get']('undo'),_0x55a980=_0x2b2ce2['commands']['get']('redo');this['listenTo'](_0x154977,'revert',(_0x28c74b,_0x38d6da,_0x3d2748)=>{const _0x22c4c6=this['_batchToChanges']['get'](_0x38d6da);if(!_0x22c4c6)return;const _0x5f54db=this['activeConversation']['getInteraction'](_0x22c4c6['interactionId'])['getReply'](_0x22c4c6['replyId']);_0x22c4c6['indexes']['forEach'](_0x4ac283=>_0x5f54db['setChangeGroupState'](_0x4ac283,'pending')),this['_batchToChanges']['delete'](_0x38d6da),this['_batchToChanges']['set'](_0x3d2748,_0x22c4c6);}),this['listenTo'](_0x55a980,'revert',(_0xc6d193,_0x39dcd7,_0x243edf)=>{const _0x2e944e=this['_batchToChanges']['get'](_0x39dcd7);if(!_0x2e944e)return;const _0x38535f=this['activeConversation']['getInteraction'](_0x2e944e['interactionId'])['getReply'](_0x2e944e['replyId']);_0x2e944e['indexes']['forEach'](_0x2ea2a2=>_0x38535f['setChangeGroupState'](_0x2ea2a2,'accepted')),this['_batchToChanges']['delete'](_0x39dcd7),this['_batchToChanges']['set'](_0x243edf,_0x2e944e);});}async['loadConversation'](_0x5779df){this['context']['plugins']['get'](w)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x44ac26=this['context']['plugins']['get'](at);this['updateConversationTitle']('\x20'),_0x44ac26['view']['activateTab']('chat'),await this['_startConversationSafely'](_0x5779df);const {sessionId:_0xeb608e}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x5779df,_0xeb608e),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x2b9f83){console['error']('Failed\x20to\x20load\x20conversation',_0x2b9f83);}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x3b126f){this['activeConversation']['id']===_0x3b126f&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x76d22=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x76d22),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:_0x3be0f0,quickActionData:_0x207055}){await this['_handleUIUserMessage']({'userMessage':_0x3be0f0,'quickActionData':_0x207055});}['getGroupId'](){const _0x3c3c94=this['context']['config']['get']('collaboration.channelId');if(!_0x3c3c94)throw new _0x239292('ai-chat-missing-channel-id',this);return _0x3c3c94;}async['_startConversationSafely'](_0x215e57){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x215e57);}catch(_0x31e688){ot('ai-chat-conversation-start-failed',_0x31e688),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x17c5d5){const _0x1d2257=this['context']['plugins']['get'](w);let _0x20a388;_0x1d2257['isOpen']&&_0x1d2257['close'](),_0x17c5d5||!this['activeConversation']?_0x20a388=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x20a388=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x5e893a=this['getGroupId'](),_0x2f0aef=_0x17c5d5||_0x5ef33e();this['activeConversation']=new nt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x20a388,'conversationId':_0x2f0aef,'group':_0x5e893a,'getEditor':()=>P(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x208cb7,_0x3697b7)=>{this['_aiChatUi']['createConversation'](_0x3697b7),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x17c5d5||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x5aed33,_0x18ad3e)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x18ad3e['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x2a7804,_0x576285)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x576285);}),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',(_0x250a35,_0x20380c)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x20380c,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x282b7a,_0x3bb55f)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3bb55f,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x53655e,_0x6cd2db)=>{this['_aiChatUi']['removeFeedInteraction'](_0x6cd2db['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x28a0dd,_0x15b0ae,_0x36b078)=>{this['updateConversationTitle'](_0x15b0ae,_0x36b078);}),this['activeConversation']['on']('replyCreated',(_0x1d9900,_0x206ca1)=>{'text-delta'===_0x206ca1['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x206ca1):this['_aiChatUi']['addFeedItemAISuggestion'](_0x206ca1);}),this['activeConversation']['on']('replyContentUpdated',async(_0x4bd571,_0x370ba3)=>{await this['_updateReplyContent']({'reply':_0x370ba3});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0xc888fd,{reply:_0x1353e5,index:_0x4a296f,state:_0x531024})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x1353e5['id'],'index':_0x4a296f,'state':_0x531024});}),this['activeConversation']['on']('contextItemAdded',(_0x377d26,_0x5d8255)=>{if(this['_aiChatUi']['addContextItem'](_0x5d8255['contextItem'],_0x5d8255['isLoading']),'selection'===_0x5d8255['contextItem']['type']){const _0x95d430=[...P(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x95d430,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x1dfa9b,_0x41e602)=>{this['_aiChatUi']['removeContextItem'](_0x41e602['uiId']),'current-document'==_0x41e602['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x41e602['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0xb66b32,_0x3cc28b)=>{this['_aiChatUi']['setContextItemLoading'](_0x3cc28b['contextItem']['uiId'],_0x3cc28b['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x24498c,_0x39d5b7)=>{this['_aiChatUi']['setConversationContext'](_0x39d5b7['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x10546f,_0x398a43)=>{this['_aiChatUi']['setAddContextOptions'](_0x398a43['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x3d8b94,_0xbeb50)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0xbeb50['sourceId'],_0xbeb50['source'],_0xbeb50['resources'],_0xbeb50['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x160ec3,_0x41867c)=>{this['_aiChatUi']['updateResourceState'](_0x41867c['sourceId'],_0x41867c['resourceId'],_0x41867c['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x1158fa,_0xe813df)=>{this['_aiChatUi']['updateCapabilities'](_0xe813df);}),this['activeConversation']['on']('modelSelected',(_0x1cb3f0,_0x267a2c)=>{this['_aiChatUi']['setSelectedModel'](_0x267a2c['selectedModel'],_0x267a2c['isDisabled']);}),this['activeConversation']['on']('error',(_0x64d680,{error:_0x154f76,interactionId:_0x433eb2,fileName:_0x1ffeee,url:_0x30c6de,sourceId:_0x52645c,sourceLabel:_0x5b625b})=>{const _0x46319c=_0x433eb2?_0x433eb2+':'+_0x5ef33e():_0x5ef33e();_0x154f76['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':C(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x46319c}):_0x154f76['message']['startsWith']('ai-chat-conversation-init-failed')||_0x154f76['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x46319c}),this['_logError'](_0x154f76)):_0x154f76['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x1ffeee),'id':_0x46319c}):_0x154f76['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x30c6de),'id':_0x46319c}):_0x154f76['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x46319c}):_0x154f76['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x46319c}):_0x154f76['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x52645c&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x52645c),this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x5b625b||'source'),'id':_0x46319c}),this['_logError'](_0x154f76)):_0x154f76['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x46319c}),this['_logError'](_0x154f76)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x46319c}),this['_logError'](_0x154f76));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x17c5d5||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x352eba,quickActionData:_0x3c88fa}){if(!this['activeConversation'])throw new _0x239292('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':_0x352eba,'quickActionData':_0x3c88fa}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x21748b=P(this['context'])['model'],_0x7c2128=Array['from'](_0x21748b['markers']['getMarkersGroup'](rt));_0x21748b['change'](_0x3f4b68=>{_0x7c2128['forEach'](_0x3ffe60=>_0x3f4b68['removeMarker'](_0x3ffe60));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x1414e9){this['_aiChatUi']['setIsMaximized'](_0x1414e9);}['_logError'](_0x4a34eb){ot(_0x4a34eb['message']);}['_removeFromContext'](_0x46c830){this['activeConversation']?.['removeFromContext'](_0x46c830);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x101674){const [_0x3c555e,_0x564d02]=_0x101674['split'](':'),_0x1a4b26=this['activeConversation']['getInteraction'](_0x3c555e),_0x2f4ce1=_0x1a4b26['getReply'](_0x564d02);return{'interaction':_0x1a4b26,'reply':_0x2f4ce1};}['_scrollToSuggestionRange'](_0x255ae1,_0x353889=!0x1){const _0x4856a2=P(this['context']),_0x293bcb={'target':_0x4856a2['editing']['view']['domConverter']['viewRangeToDom'](_0x4856a2['editing']['mapper']['toViewRange'](_0x255ae1)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x353889};_0x353889&&(_0x293bcb['alignToTop']=!0x0),_0x10737b(_0x293bcb);}['updateConversationTitle'](_0x1923c7,_0xb51c2c=!0x1){this['_aiChatUi']['setConversationTitle'](_0x1923c7||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0xb51c2c);}async['_updateReplyContent']({reply:_0x1bdb3c,renderingStrategy:_0x341f57}){const {id:_0x52883c,isDone:_0x3f5564,type:_0x426466,parsedContent:_0x58d54b}=_0x1bdb3c;if('modification-delta'===_0x426466){const _0x423ed7=_0x1bdb3c['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x52883c,'parts':_0x423ed7,'renderingStrategy':_0x341f57,'isDone':_0x3f5564});}else'text-delta'===_0x426466&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x52883c,'parsedContent':_0x58d54b,'renderingStrategy':_0x341f57,'isDone':_0x3f5564});_0x3f5564&&_0x1bdb3c['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x52883c,_0x1bdb3c['sources']);}async['_stopLastInteraction'](){const _0x31000b=this['activeConversation']?.['lastInteraction'];_0x31000b&&(_0x31000b['stop'](),this['_aiChatUi']['stopInteraction'](_0x31000b));}async['_flushLastInteractionUI'](){const _0x25bb48=this['activeConversation']?.['lastInteraction'];if(_0x25bb48){for await(const _0x1be404 of _0x25bb48['replies'])await this['_updateReplyContent']({'reply':_0x1be404,'renderingStrategy':'static'});}}['_updateRatings'](_0x14afb6){const _0x39977e={'positiveCount':_0x14afb6['changeGroups']['filter'](_0x310ae8=>'accepted'===_0x310ae8['state'])['length'],'totalCount':_0x14afb6['changeGroups']['length'],'modificationId':_0x14afb6['id']},_0x351e93=this['activeConversation']['getInteraction'](_0x14afb6['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x351e93,_0x39977e);}}const St=[...Te,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ge extends jr{['containerView'];['actionsView'];constructor(_0x4d289f,_0x2e731e){super(_0x2e731e),this['set']('isTrackChangesOn',!0x1),this['containerView']=new e(_0x4d289f,{'showDiff':_0x2e731e['showDiff'],'areActionsDisabled':_0x2e731e['areActionsDisabled'],'availableActions':_0x2e731e['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x4d010b,_0x4ab915)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4ab915['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',(_0x4fc209,{index:_0x269c6e})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x269c6e});}),this['containerView']['on']('insertSuggestion',(_0xf4abf,{index:_0x4b08f7})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4b08f7});}),this['containerView']['on']('rejectSuggestion',(_0x57fee2,{index:_0x2753b8})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2753b8});}),this['containerView']['on']('mouseOverSuggestion',(_0x5ed48e,{index:_0x2d652a})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2d652a});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x889015,{index:_0x10ad71})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x10ad71});}),this['actionsView']=new nh(_0x4d289f,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']});}),_0x2e731e['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'](_0x170f69){await this['containerView']['updateContent'](_0x170f69),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x543533,_0x3aa400){this['containerView']['bodyView']['updatePartState'](_0x543533,_0x3aa400);}['updateSources'](_0x276b34){this['containerView']['updateSources'](_0x276b34);}['getPartView'](_0x253723){return this['containerView']['bodyView']['getPartView'](_0x253723);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class ke extends jr{['replyContainer'];constructor(_0x12a456,_0x4d920a){super(_0x4d920a),this['locale']=_0x12a456,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x10aa9f(),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:_0x419644,renderingStrategy:_0x3e0ebe,abortSignal:_0x3c168b}){'streaming'===_0x3e0ebe?await this['streamIntoElement'](_0x419644,this['replyContainer']['element'],_0x3c168b):this['replyContainer']['element']['innerHTML']=_0x259462(_0x419644);}['updateSources'](_0x448bd2){const _0x22ed05=new Sr(this['locale']);_0x22ed05['children']['addMany'](_0x448bd2['map'](_0x349a7d=>new Fr(this['locale'],_0x349a7d))),_0x22ed05['isVisible']=!0x0,this['children']['add'](_0x22ed05);}}const xn={'file':_0x18f1cd,'document':_0x3af6f7,'web-resource':_0xe254f0,'text':_0x18f1cd,'selection':_0x5ce07c},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Zr='ck-ai-chat-context-chip_document',ra='ck-ai-chat-context-chip__label',oa='ck-ai-chat-context-chip__type-icon',ca='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class bo extends _0x5cde82{constructor(_0x7e3554,_0x291454,_0x258c32,_0x514d00,_0xcf61ff=!0x1){super(_0x7e3554),this['_isAnimationOnEnterEnabled']=_0x514d00,this['_initializeProperties'](_0x291454,_0x258c32,_0xcf61ff),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'](_0x487cc2,_0x1ee4b0,_0x2f1f31){this['set']('label',_0x487cc2['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x487cc2['type']),this['set']('id',_0x487cc2['uiId']),this['set']('readonly',_0x1ee4b0),this['set']('isLoading',_0x2f1f31);}['_setupTemplate'](){const _0x1ea638=this['_createIconView'](),_0x17f91e=this['_createRemoveButton'](),_0x5c5adb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x5c5adb),'children':this['_createTemplateChildren'](_0x1ea638,_0x17f91e,_0x5c5adb)});}['_createTemplateAttributes'](_0x11edc0){return{'class':[$r,_0x11edc0['if']('itemType',Zr,_0x483e35=>'document'==_0x483e35),_0x11edc0['if']('itemType',Qr,_0x28018f=>'selection'==_0x28018f)],'data-cke-tooltip-text':_0x11edc0['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':ca};}['_createTemplateChildren'](_0xd1f8fc,_0x4a2549,_0x14b8af){const _0x4db913=this['_createLabelElement'](_0x14b8af),_0x3aaa35=this['_createLoaderIcon']();return this['readonly']?[_0xd1f8fc,_0x4db913]:[_0xd1f8fc,_0x3aaa35,_0x4db913,_0x4a2549];}['_createLabelElement'](_0x4b9aa2){return{'tag':'span','attributes':{'class':ra},'children':[{'text':_0x4b9aa2['to']('label')}]};}['_createRemoveButton'](){const _0x573f64=new _0x5cde82(this['locale']);return _0x573f64['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3c4bba}),this['_setupRemoveButtonEvent'](_0x573f64),_0x573f64;}['_setupRemoveButtonEvent'](_0x48fa21){_0x48fa21['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x5ecd0d=this['bindTemplate'],_0x15dc45=new _0x3dad93();return _0x15dc45['content']=xn[this['itemType']],_0x15dc45['extendTemplate']({'attributes':{'class':[oa,_0x5ecd0d['if']('isLoading','ck-hidden',_0x26aed0=>_0x26aed0)]}}),_0x15dc45;}['_handleAnimationEndOnce'](_0x25bd1c,_0x3a3112){if(!_0x25bd1c)return;const _0x4d7f53=()=>{_0x3a3112(),_0x25bd1c['removeEventListener']('animationend',_0x4d7f53),_0x25bd1c['removeEventListener']('webkitAnimationEnd',_0x4d7f53);};_0x25bd1c['addEventListener']('animationend',_0x4d7f53),_0x25bd1c['addEventListener']('webkitAnimationEnd',_0x4d7f53);}['_createLoaderIcon'](){const _0x1dba60=new Le('small');return _0x1dba60['bind']('isVisible')['to'](this,'isLoading',_0x3ed344=>_0x3ed344),_0x1dba60;}}function In(_0x23468d){if(!_0x23468d)return _0x23468d;if(_0x23468d['length']<=0x78)return _0x23468d;const _0x13154b=_0x23468d['slice'](0x0,0x78),_0x1d7bb4=_0x13154b['lastIndexOf']('\x20');return(_0x1d7bb4>0x0?_0x13154b['slice'](0x0,_0x1d7bb4):_0x13154b)+'…';}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(_0x25a0bc,_0xb27260,_0x129897,_0x183531,_0x1217e2){this['_locale']=_0x25a0bc,this['_visibleChips']=_0xb27260,this['_config']={...hn,..._0x129897,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x129897['cssClasses']}},this['_overflowChips']=new _0x4c3887(),this['_bodyCollection']=_0x183531,this['_parentView']=_0x1217e2||null;}['setContainerElement'](_0xa8564f){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0xa8564f,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 _0x23e867=[...this['_visibleChips'],...this['_overflowChips']],_0x297800=this['_createCalculationContainer'](),_0x172bf0=this['_calculateOverflowInContainer'](_0x297800,_0x23e867),_0x12b5f7=_0x297800['_ancestorsToRestore'];_0x12b5f7&&this['_restoreAncestorVisibility'](_0x12b5f7),_0x297800['remove'](),this['_applyOverflowResults'](_0x23e867,_0x172bf0);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x2cf367({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x14e6c3=new _0x5cde82(this['_locale']);_0x14e6c3['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x22ed77=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x22ed77['push'](this['_config']['cssClasses']['controlsButton']),_0x14e6c3['extendTemplate']({'attributes':{'class':_0x22ed77}}),_0x14e6c3;}['_createShowMoreBalloonPanelView'](){const _0x48ec20=new _0x179f18(this['_locale']);return _0x48ec20['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x48ec20),_0x48ec20;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x9a456b=>{_0x9a456b['disableAnimationOnEnter']();});const _0x33f3ee=new _0x10aa9f(this['_locale']);_0x33f3ee['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x33f3ee);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x182316=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x182316?'':'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'](_0x47c280){const _0x1bf1ca=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x485540=this['_containerElement']?.['classList'];if(_0x485540){const _0x5b44db=_0x485540[0x0]||'',_0x14e597=_0x47c280['querySelector']('.'+_0x5b44db),_0x2e5a61=_0x47c280['querySelector'](_0x1bf1ca);return _0x14e597||_0x2e5a61||_0x47c280;}return _0x47c280['querySelector'](_0x1bf1ca)||_0x47c280;}['_calculateContainerWidth'](){const _0x225a64=this['_parentView']?.['element']||this['_containerElement'];if(!_0x225a64)return an;const _0x22bf3d=window['getComputedStyle'](_0x225a64)['width'];if('auto'===_0x22bf3d||'0px'===_0x22bf3d||!_0x22bf3d){const _0x2d3e4a=_0x225a64['parentElement'];if(_0x2d3e4a){const _0x56db6e=window['getComputedStyle'](_0x2d3e4a);return'auto'!==_0x56db6e['width']?_0x56db6e['width']:an;}return an;}return _0x22bf3d;}['_applyCalculationStyles'](_0x266694,_0x5251fe){this['_config']['cssClasses']['calculationContainer']&&_0x266694['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x266694['style']['width']=_0x5251fe,_0x266694['style']['position']='absolute',_0x266694['style']['top']='-9999px',_0x266694['style']['left']='-9999px',_0x266694['style']['opacity']='0',_0x266694['style']['pointerEvents']='none',_0x266694['style']['zIndex']='-1',_0x266694['style']['visibility']='visible\x20!important',_0x266694['style']['display']='block\x20!important',_0x266694['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x2111da){_0x2111da['forEach'](({element:_0x533247,originalDisplay:_0x147bbe,originalVisibility:_0xda9b5f})=>{_0x533247['style']['display']=_0x147bbe,_0x533247['style']['visibility']=_0xda9b5f;});}['_makeAncestorsVisible'](_0xb01a62){const _0x40ebf2=[];let _0x189244=_0xb01a62;for(;_0x189244&&_0x189244!==document['body'];){const _0x4d45aa=window['getComputedStyle'](_0x189244);'none'!==_0x4d45aa['display']&&'hidden'!==_0x4d45aa['visibility']||(_0x40ebf2['push']({'element':_0x189244,'originalDisplay':_0x189244['style']['display'],'originalVisibility':_0x189244['style']['visibility']}),_0x189244['style']['display']='block',_0x189244['style']['visibility']='visible'),_0x189244=_0x189244['parentElement'];}return _0x40ebf2;}['_createContainerElements'](){let _0x54ada7,_0x1eebda;return this['_parentView']?.['element']?(_0x54ada7=this['_parentView']['element']['cloneNode'](!0x0),_0x1eebda=this['_findTargetContainer'](_0x54ada7)):(_0x54ada7=document['createElement']('div'),_0x1eebda=_0x54ada7),{'calculationContainer':_0x54ada7,'targetContainer':_0x1eebda};}['_createCalculationContainer'](){const {calculationContainer:_0x5727b7,targetContainer:_0x5328cc}=this['_createContainerElements'](),_0x3c1b7a=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x5727b7,_0x3c1b7a);const _0x3dfb51=this['_parentView']?.['element']||this['_containerElement'],_0x5a03b8=_0x3dfb51?.['parentElement'];_0x5a03b8?_0x5a03b8['appendChild'](_0x5727b7):document['body']['appendChild'](_0x5727b7),_0x5727b7['_targetContainer']=_0x5328cc;const _0x326b37=this['_makeAncestorsVisible'](_0x5a03b8||null);return _0x5727b7['offsetWidth'],_0x5727b7['_ancestorsToRestore']=_0x326b37,_0x5727b7;}['_calculateOverflowInContainer'](_0x3ef474,_0x43a141){const _0x428d9b=_0x3ef474['_targetContainer']||_0x3ef474,_0x47c2e1=[],{rowCount:_0x18d443}=this['_renderChipsAndCountRows'](_0x428d9b,_0x43a141);if(_0x18d443<=this['_config']['maxVisibleRows'])return _0x47c2e1;const _0x1ed0b4=_0x43a141['slice']();for(;_0x1ed0b4['length']>0x0;){if(this['_testButtonFit'](_0x3ef474,_0x428d9b,_0x1ed0b4)){const _0xc6b791=_0x43a141['filter'](_0x2b832f=>!_0x1ed0b4['includes'](_0x2b832f));_0x47c2e1['push'](..._0xc6b791);break;}if(!_0x1ed0b4['pop']())break;}return _0x47c2e1;}['_renderChipsAndCountRows'](_0x3c9123,_0x51bcde){_0x3c9123['innerHTML']='',_0x51bcde['forEach'](_0x4a7a58=>{if(_0x4a7a58['element']){const _0xf5ea19=_0x4a7a58['element']['cloneNode'](!0x0);_0x3c9123['appendChild'](_0xf5ea19);}}),_0x3c9123['offsetWidth'];const _0x3c4926=_0x3c9123['children'],_0x980b72=[];return Array['from'](_0x3c4926)['forEach'](_0x3e501f=>{const _0x22c5fd=_0x3e501f['getBoundingClientRect']()['top'];_0x980b72['some'](_0x5d4eea=>Math['abs'](_0x5d4eea-_0x22c5fd)<this['_config']['rowDetectionTolerance'])||_0x980b72['push'](_0x22c5fd);}),{'rowCount':_0x980b72['length']};}['_createMockButton'](){const _0x4b9942=document['createElement']('button');return _0x4b9942['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x4b9942['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x4b9942['textContent']='+\x201',_0x4b9942;}['_testButtonFit'](_0x15e8d0,_0x2c7496,_0x115263){this['_renderChipsAndCountRows'](_0x2c7496,_0x115263);const _0x5a0673=this['_createMockButton']();_0x15e8d0['appendChild'](_0x5a0673),_0x15e8d0['offsetWidth'];const _0x3408ed=[..._0x2c7496['children'],_0x5a0673],_0x3ac40a=[];_0x3408ed['forEach'](_0x36a69f=>{const _0xde211c=_0x36a69f['getBoundingClientRect']()['top'];_0x3ac40a['some'](_0x8f0aa=>Math['abs'](_0x8f0aa-_0xde211c)<this['_config']['rowDetectionTolerance'])||_0x3ac40a['push'](_0xde211c);});const _0x4b7d94=_0x3ac40a['length'];return _0x5a0673['remove'](),_0x4b7d94<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x5cffee,_0x134015){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x5cffee['forEach'](_0x585821=>{_0x134015['includes'](_0x585821)?this['_overflowChips']['add'](_0x585821):this['_visibleChips']['add'](_0x585821);});}['_updateOverflowUI'](_0x4f559a){if(_0x4f559a>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4f559a>0x0&&this['_showMoreButtonView']){const _0x1278f7=''+this['_config']['showMoreLabelPrefix']+(_0x4f559a<0x63?_0x4f559a:'99');this['_showMoreButtonView']['label']=_0x1278f7;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x1464b9,_0x109e8c){this['_distributeChips'](_0x1464b9,_0x109e8c),this['_updateOverflowUI'](_0x109e8c['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x73cdf=>{_0x73cdf[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 _0x292e73=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x292e73['width']||0x0===_0x292e73['height'])return!0x1;const _0x360d77=window['innerHeight']||document['documentElement']['clientHeight'],_0x130843=window['innerWidth']||document['documentElement']['clientWidth'],_0x1c28ac=0xc8;return _0x292e73['bottom']>=-0xc8&&_0x292e73['top']<=_0x360d77+_0x1c28ac&&_0x292e73['right']>=-0xc8&&_0x292e73['left']<=_0x130843+_0x1c28ac;}}const la='ck-ai-chat__feed__context-chips',da='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',_a='ck-ai-chat-controls-button',Ia='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x10aa9f{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x3d4996,_0x42edc5,_0x80f57e){super(_0x3d4996),this['_bodyCollection']=_0x80f57e,this['_createContextChips'](_0x42edc5);const _0xae5e6b={'cssClasses':{'showMoreButton':Ia,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':_a}};this['_overflowManager']=new Ao(_0x3d4996,this['_contextChips'],_0xae5e6b,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[la,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':da},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x2856ca=this['element']['querySelector']('.'+da);_0x2856ca&&(this['_overflowManager']['setContainerElement'](_0x2856ca),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x1636f5){for(const _0x57775a of _0x1636f5){const _0x477846=new bo(this['locale'],_0x57775a,!0x0,!0x1);this['_contextChips']['add'](_0x477846);}}}class ve extends jr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x547dd0,_0x2c2636,_0x51fc56){super(_0x2c2636),this['_locale']=_0x547dd0,this['_bodyCollection']=_0x51fc56,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'](_0x2f0c98=>!_0x2f0c98['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x10aa9f(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(_0x3dc44e,_0x179c2d){super(_0x179c2d);const {isWebSearchEnabled:_0x240c28,isReasoningEnabled:_0x4d899d}=_0x179c2d['capabilities'],_0x207071=[];let _0x1ddb4b='';_0x240c28&&_0x4d899d?(_0x1ddb4b=C(_0x3dc44e,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x207071['push'](aa(_0x340ab6)),_0x207071['push'](aa(_0x18edd5))):_0x240c28?(_0x1ddb4b=C(_0x3dc44e,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x207071['push'](aa(_0x340ab6))):_0x4d899d&&(_0x1ddb4b=C(_0x3dc44e,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x207071['push'](aa(_0x18edd5))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x1ddb4b?'':'ck-hidden']}});const _0x5125e7=new _0x10aa9f();_0x5125e7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x207071,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x1ddb4b]}]}),this['children']['add'](_0x5125e7),this['capabilities']=_0x179c2d['capabilities'];}}function aa(_0x1d3131){const _0x3e126b=new _0x3dad93();return _0x3e126b['content']=_0x1d3131,_0x3e126b;}const ws=['wheel','touchstart','pointerdown','keydown'],fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class be{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x2ad1e3){this['element']=_0x2ad1e3,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x425b22 of ws){const _0x508991='keydown'!==_0x425b22;this['element']['addEventListener'](_0x425b22,this['_onUserEvent']['bind'](this),{'passive':_0x508991,'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'](_0xa54ce8){if(this['isRunning']){if('keydown'===_0xa54ce8['type']){const _0x58814a=_0xa54ce8['key'];if(!fs['includes'](_0x58814a))return;}_0xa54ce8 instanceof WheelEvent?_0xa54ce8['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x5df61b,scrollHeight:_0x44304e,clientHeight:_0x3151a5}=this['element'];return _0x44304e-_0x5df61b-_0x3151a5<=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 _0x10aa9f{constructor(_0x29d225,_0x12317f){super(_0x29d225),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x12317f)});}['_createSkeletonItems'](_0x3bf187){const _0x20aa05=['ck','ck-ai-skeleton__item'];return _0x3bf187['map'](_0x176349=>{let _0x825283='';switch(_0x176349['attributes']['align']){case'right':_0x825283='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x825283='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x825283='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x176349['tag'],'attributes':{'class':[..._0x20aa05,_0x176349['attributes']['class']?_0x176349['attributes']['class']:''],'style':'width:\x20'+_0x176349['attributes']['width']+';\x20height:\x20'+_0x176349['attributes']['height']+';'+_0x825283}};});}}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(_0x36824f,_0x479dfa,_0x36633d,_0x1b469e){return new Array(_0x36824f)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x479dfa,'height':_0x36633d,'align':_0x1b469e}}));}class ji extends _0x10aa9f{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x56a5b9,_0x55b7ea){super(_0x56a5b9),this['_bodyCollection']=_0x55b7ea,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'](_0x471646,_0x966549){let _0x2f07a8;'ai-reply'===_0x471646?_0x2f07a8=new ke(this['locale'],_0x966549):'ai-suggestion-reply'===_0x471646?(_0x2f07a8=new ge(this['locale'],_0x966549),_0x2f07a8['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x2f07a8='user-message'===_0x471646?new ve(this['locale'],_0x966549,this['_bodyCollection']):'interaction-header'===_0x471646?new Et(this['locale'],_0x966549):new _e(_0x966549),this['children']['add'](_0x2f07a8);}async['updateReplyItem']({id:_0x4d4320,parsedContent:_0x37bb73,renderingStrategy:_0x5d98ce,abortSignal:_0x46b511}){const _0x52e2f6=this['getItemById'](_0x4d4320);if(!(_0x52e2f6 instanceof ke))throw new _0x239292('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x52e2f6,'id':_0x4d4320,'parsedContent':_0x37bb73});await _0x52e2f6['updateContent']({'parsedContent':_0x37bb73,'renderingStrategy':_0x5d98ce,'abortSignal':_0x46b511});}async['updateWebSources'](_0x5cfa83,_0x408ed6){const _0x58bd11=this['getItemById'](_0x5cfa83);if(_0x58bd11 instanceof ge)_0x58bd11['updateSources'](_0x408ed6);else{if(!(_0x58bd11 instanceof ke))throw new _0x239292('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x58bd11,'id':_0x5cfa83,'sources':_0x408ed6});_0x58bd11['updateSources'](_0x408ed6);}}async['updateSuggestionItem']({id:_0x5c37f0,parts:_0x3ba99c,renderingStrategy:_0x4d4c74,abortSignal:_0xb3e1c2}){const _0x3b8ee5=this['getItemById'](_0x5c37f0);if(!(_0x3b8ee5 instanceof ge))throw new _0x239292('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x3b8ee5,'id':_0x5c37f0,'parts':_0x3ba99c});await _0x3b8ee5['updateContent']({'parts':_0x3ba99c,'renderingStrategy':_0x4d4c74,'abortSignal':_0xb3e1c2});}['updateSuggestionPartState']({id:_0x99e44c,index:_0x51b99e,state:_0x5182d3}){const _0x23120d=this['getItemById'](_0x99e44c);if(!(_0x23120d instanceof ge))throw new _0x239292('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x99e44c});_0x23120d['updatePartState'](_0x51b99e,_0x5182d3);}['markItemAsDone'](_0x5a799e){this['getItemById'](_0x5a799e)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x2401e0=>_0x2401e0['options']['id']);}['removeItem'](_0x21cd6c){this['children']['remove'](this['getItemById'](_0x21cd6c));}['scrollToSuggestion'](_0x4484bb,_0x1db680){const _0x538bc0=this['getItemById'](_0x4484bb);if(!(_0x538bc0 instanceof ge))return void _0x361f9e('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x4484bb,'partIndex':_0x1db680});const _0x5bf8e2=_0x538bc0['getPartView'](_0x1db680);_0x5bf8e2?_0x10737b({'target':_0x5bf8e2['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x361f9e('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x4484bb,'partIndex':_0x1db680});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x2fc60b=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x2fc60b,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x5dd01a=new je(this['locale'],Ce['aiFeed']);return _0x5dd01a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x407afc=>!_0x407afc)]}}),_0x5dd01a;}['_createFeedItems'](){const _0x524494=new _0x10aa9f(this['locale']);return _0x524494['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x524494;}['_createFeedLoader'](){const _0x452e79=new _0x10aa9f(this['locale']);return _0x452e79['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x39e0f7=>!_0x39e0f7)]},'children':this['_createLoaderChildren']()}),_0x452e79;}['_createLoaderChildren'](){const _0x11b9d0=new Le();return _0x11b9d0['isVisible']=!0x0,[_0x11b9d0,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x23da30){const _0x112f08=this['children']['find'](_0x4e55ff=>_0x4e55ff['options']['id']['includes'](_0x23da30));if(!_0x112f08)throw new _0x239292('ai-chat-feed-view-item-not-found',this,{'id':_0x23da30});return _0x112f08;}['setLoadingMessage'](_0x5e1a63){this['set']('loadingMessage',_0x5e1a63);}['toggleLoadingSkeleton'](_0x34dc49){this['set']('isLoadingSkeletonVisible',_0x34dc49);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x4a219d{['filter'](){let _0x5365f3=0x0;for(const _0x138aa5 of this['items'])_0x5365f3+=_0x138aa5['items']['length'];return{'resultsCount':_0x5365f3,'totalItemsCount':_0x5365f3};}}class ds extends _0x329d79{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x3bb5e5,_0x5ca3a5){super(_0x3bb5e5,{'queryView':{'label':'','creator':_0x2485cf,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x3bb5e5),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5ca3a5,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',(_0x268c68,_0x55fda2)=>!_0x268c68&&!_0x55fda2),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x49582a,_0x1d9021)=>{this['isUploadInProgress']||this['isEmpty']||_0x49582a['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1d9021());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x1c935b=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x1c935b)return this['queryView']['errorText']=C(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x10098d=_0x59aba(_0x1c935b);this['fire']('sendUserMessage',_0x10098d),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x37ce1f){this['queryView']['fieldView']['set']('placeholder',_0x37ce1f);}['_createSubmitButton'](){const _0x56c01d=new _0x5cde82(this['locale']);return _0x56c01d['set']({'icon':_0x3a517e,'label':C(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x56c01d['on']('execute',()=>{this['submit']();}),_0x56c01d;}['setIsUploadInProgress'](_0x2717c4){this['isUploadInProgress']=_0x2717c4;}['_setUpAddContextButtonPositioning'](){const _0x4efdd3=this['locale'],_0x12d565=()=>{_0x218ca6['window']['requestAnimationFrame'](()=>{if(_0x5a4e2b(this['element'])){const _0x1ceb7c=new _0x507e52(this['queryView']['fieldView']['element']),_0x7fc077=new _0x507e52(this['_addContextButtonView']['element']),_0x3902fa=_0x1ceb7c['width'],_0x199d97='rtl'===_0x4efdd3['uiLanguageDirection']?'right':'left';_0x1ceb7c['excludeScrollbarsAndBorders']();const _0x5558f3=_0x3902fa-_0x1ceb7c['width']+0x1;this['_addContextButtonView']['element']['style'][_0x199d97]='calc('+(_0x3902fa-_0x7fc077['width']-_0x5558f3)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x12d565),this['on']('render',()=>{_0x12d565(),this['_queryViewResizeObserver']=new _0x459443(this['queryView']['fieldView']['element'],()=>{_0x12d565();});});}}const ga='ck-ai-chat__prompt-capabilities',Ea='ck-ai-chat-controls-button',ma='ck-ai-chat-controls-button--commands',pa='ck-ai-chat-controls__model-selection',Ta='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class ps extends _0x10aa9f{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0xd1f31d){super(_0xd1f31d),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',_0x547297=>_0x547297),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x88c53a=>_0x88c53a?this['_modelSelectionDropdown']['buttonView']['label']:C(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x452a2a=>_0x452a2a),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x548473=>_0x548473),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x4c1d14=>!_0x4c1d14),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x27bf13=>C(this['locale'],_0x27bf13?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x5b9901=>_0x5b9901),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x5f4463=>!_0x5f4463),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1bf8be=>C(this['locale'],_0x1bf8be?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x4c3887(),_0x43d564(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0xbe856e,_0x4ea096){if(this['set']('modelSelectorVisible',!(_0x4ea096&&_0xbe856e['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0xbe856e?.['length']){const _0x161eee=ki['getLocalized'](this['locale'],_0xbe856e);for(const _0x2c6ab3 of _0x161eee){const _0x47c4e1=new _0x238f2a({'label':_0x2c6ab3['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2c6ab3['id'],'model':_0x2c6ab3});_0x47c4e1['bind']('isOn')['to'](this,'activeModelId',_0x4d44fb=>_0x4d44fb===_0x2c6ab3['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x47c4e1,'labelView':new Sa(this['locale'],_0x2c6ab3)});}}}['setWebSearch'](_0x43c96e){this['set']('webSearchActive',_0x43c96e);}['setReasoning'](_0x5f3b63){this['set']('reasoningActive',_0x5f3b63);}['setModel'](_0x176eab){if(!_0x176eab)return;this['activeModelId']=_0x176eab['id'],this['activeModelName']=_0x176eab['name']||_0x176eab['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x176eab['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x176eab['name']);const _0x48ebe9=_0x176eab['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x48ebe9),this['_webSearchButton']['set']('isVisible',_0x48ebe9);const _0xe38fd9=_0x176eab['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0xe38fd9),this['_reasoningButton']['set']('isVisible',_0xe38fd9);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x46bce6){this['set']('modelSelectorEnabled',!0x1),_0x46bce6&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x240a9d=new _0x5cde82();return _0x240a9d['set']({'label':C(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x340ab6,'class':Ea,'isToggleable':!0x0,'tooltipPosition':fa}),_0x240a9d['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x240a9d;}['_createReasoningButton'](){const _0x208eee=new _0x5cde82();return _0x208eee['set']({'label':C(this['locale'],'AI_CHAT_REASONING'),'icon':_0x18edd5,'class':Ea,'isToggleable':!0x0,'tooltipPosition':fa}),_0x208eee['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x208eee;}['_createCommandsButton'](){const _0x92b076=new _0x5cde82();return _0x92b076['set']({'label':C(this['locale'],'AI_CHAT_COMMANDS'),'icon':Ct,'withText':!0x0,'class':Ea,'isToggleable':!0x0,'tooltip':C(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x92b076['extendTemplate']({'attributes':{'class':[ma]}}),_0x92b076['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x92b076;}['_createModelSelectionDropdown'](){const _0x268432=_0x1fe5fd(this['locale']);return _0x268432['set']({'panelPosition':'ne','class':[pa]}),_0x268432['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa}),this['listenTo'](_0x268432,'execute',_0x1c552e=>{this['fire']('selectModel',_0x1c552e['source']['model']);}),_0x268432;}['_createModelNameView'](){const _0x1ce179=new Ko(this['locale']);return _0x1ce179['bind']('text')['to'](this,'activeModelName',_0x5da54b=>_0x5da54b??''),_0x1ce179['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x2515c4,_0x4f7f51)=>!_0x2515c4&&!_0x4f7f51?.['toLowerCase']()['startsWith']('agent')),_0x1ce179;}}let Sa=class extends _0x342201{constructor(_0x123c4b,_0x4a3196){super();const _0x12ebe6=this['bindTemplate'],_0x5c8158=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x12ebe6['to']('style'),'id':_0x12ebe6['to']('id')},'children':[{'tag':'div','attributes':{'class':[Ta]},'children':[{'text':_0x12ebe6['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x4a3196['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x5c8158}]}),_0x5c8158['addMany'](this['_getCapabilityParts'](_0x123c4b,_0x340ab6,'AI_CHAT_SEARCH_WEB',_0x4a3196['capabilities']['webSearch']?.['enabled']??!0x1)),_0x5c8158['addMany'](this['_getCapabilityParts'](_0x123c4b,_0x18edd5,'AI_CHAT_REASONING',_0x4a3196['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x334710,_0x2c043d,_0x736a34,_0x28d4a7){const _0x17c3ce=new _0x3dad93();_0x17c3ce['content']=_0x2c043d;const _0x47e69c=new _0x10aa9f(_0x334710);_0x47e69c['setTemplate']({'tag':'span','children':[{'text':C(_0x334710,_0x736a34)+':\x20'}]});const _0x14fb8a=new _0x10aa9f(_0x334710);return _0x14fb8a['setTemplate']({'tag':'span','children':[{'text':C(_0x334710,_0x28d4a7?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x17c3ce,_0x47e69c,_0x14fb8a];}};class Ko extends _0x10aa9f{constructor(_0x454da6){super(_0x454da6),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x108203=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x108203['if']('isVisible','ck-hidden',_0x2ea821=>!_0x2ea821)]},'children':[{'text':_0x108203['to']('text')}]});}}const Oa='ck-ai-chat-context-controls__url-form',Ra='ck-ai-chat-context-controls__url-input-section';class To extends _0x10aa9f{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0xa89ab9){super(_0xa89ab9),this['focusTracker']=new ts(),this['keystrokes']=new _0x4c12a2(),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'](_0x4f1f31=>{this['focusTracker']['add'](_0x4f1f31['element']),this['keystrokes']['listenTo'](_0x4f1f31['element']);}),_0x256be1({'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'](_0x176859){this['urlInputField']['errorText']=_0x176859,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x3118f8=new _0x5cde82(this['locale']);return _0x3118f8['set']({'icon':_0x52404d,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x3118f8;}['_createUrlInputField'](){const _0x41ec5b=new _0x2acda0(this['locale'],_0x3090df);return _0x41ec5b['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x41ec5b['fieldView']['set']({'placeholder':C(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x41ec5b;}['_createConfirmButton'](){const _0x40b787=new _0x5cde82(this['locale']);return _0x40b787['set']({'icon':_0x222bf2,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x40b787;}['_setupTemplate'](){const _0x102665=new _0x4f9b0c(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'});_0x102665['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Oa,'tabindex':'-1'},'children':[_0x102665,{'tag':'div','attributes':{'class':Ra},'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',_0x3c488b=>{_0x3c488b['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x20c749,_0x3a5f24)=>{this['clear'](),this['fire']('cancel'),_0x3a5f24();});}['_handleSubmit'](){const _0x2a8bb9=this['getValue']()['trim']();_0x2a8bb9?this['_isValidUrl'](_0x2a8bb9)?(this['clearError'](),this['fire']('submitUrl',_0x2a8bb9)):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x114f47=this['getValue']()['trim'](),_0x400946=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x114f47['length']>0x0&&!_0x400946;}['_isValidUrl'](_0x3d1b7b){try{return!!new URL(_0x3d1b7b);}catch{return!0x1;}}}const ba='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',ka='ck-ai-chat-resources__item-title',ya='ck-ai-chat-resources__item__icon';class tc extends _0x2ced3c{['resource'];['_titleView'];['_iconView'];constructor(_0x41e114,_0xc7a3e8){super(_0x41e114),this['resource']=_0xc7a3e8,this['set']('isInContext',!!_0xc7a3e8['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0xb4aa2c){if(_0xb4aa2c['isInContext'])return _0x222bf2;switch(_0xb4aa2c['type']){case Xt['DOCUMENT']:return _0x3af6f7;case Xt['URL']:return _0xe254f0;case Xt['FILE']:case Xt['TEXT']:return _0x18f1cd;default:return _0x2ca83b;}}['highlightText'](_0x4ae50d){if(!_0x4ae50d||''===_0x4ae50d['trim']())return void this['_titleView']['highlightText'](null);const _0x2ea2a0=new RegExp(_0x186f47(_0x4ae50d),'gi');this['_titleView']['highlightText'](_0x2ea2a0);}['updateResourceState'](_0x3c5630){this['resource']['isInContext']=_0x3c5630,this['isInContext']=_0x3c5630,this['_updateIcon']();}['_createTitleView'](){const _0xa259=new _0x4eed03();return _0xa259['text']=this['resource']['label'],_0xa259['extendTemplate']({'tag':'span','attributes':{'class':[ka]}}),_0xa259;}['_createIconView'](){const _0x1e7159=new _0x3dad93();return _0x1e7159['content']=this['getResourceIcon'](this['resource']),_0x1e7159;}['_setupTemplate'](){const _0x4783f4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ba,_0x4783f4['if']('isVisible','ck-hidden',_0x2d1422=>!_0x2d1422),_0x4783f4['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x4783f4['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const va='ck-ai-chat-resources__list';class qr extends _0x4a219d{['_source'];constructor(_0x4aab6a,_0x4af0a1){super(_0x4aab6a),this['_source']=_0x4af0a1,this['extendTemplate']({'attributes':{'class':[va]}});}['setResources'](_0x5832c5,_0xc54543){this['items']['clear']();let _0x45a30e=_0x5832c5;if(this['_source']['useDefaultFiltering']&&_0xc54543&&''!==_0xc54543['trim']()){const _0x45a44d=new RegExp(_0xc54543['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x45a30e=_0x5832c5['filter'](_0x33ee84=>_0x45a44d['test'](_0x33ee84['label']));}for(const _0x5d027f of _0x45a30e){const _0xfa2fb4=new tc(this['locale'],_0x5d027f);_0xfa2fb4['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x5d027f);}),this['items']['add'](_0xfa2fb4);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0xc54543);}['highlightText'](_0x33d722){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x527c20=>{_0x527c20['highlightText'](_0x33d722);});}['updateResourceState'](_0x21ff27,_0x237634){for(const _0x7af849 of this['items']){const _0x11a17e=_0x7af849;_0x11a17e['resource']['id']===_0x21ff27&&_0x11a17e['updateResourceState'](_0x237634);}}['_handleResourceSelection'](_0x3944bf,_0x3029a9){this['fire']('addResourceToContext',{'source':_0x3944bf,'resource':_0x3029a9});}}class Tr extends _0x2acda0{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x3fa5ed){const t=_0x3fa5ed['t'],_0x17ad0b={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x3090df,'label':C(_0x3fa5ed,'AI_CHAT_SEARCH_RESOURCES')};super(_0x3fa5ed,_0x17ad0b['creator']),this['label']=_0x17ad0b['label'],this['_viewConfig']=_0x17ad0b,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x3fa5ed,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x517ec4){this['fire']('search',_0x517ec4);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x3dad93(),this['iconView']['content']=_0x15be19,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x323297,t){this['resetButtonView']=new _0x5cde82(_0x323297),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x27c5a9,'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',_0x10365e=>!_0x10365e),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 _0x10aa9f{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x5c49ce,_0x333a48){super(_0x5c49ce),this['_source']=_0x333a48['source'],this['_searchInputVisibleFrom']=_0x333a48['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 _0x285700([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Tr(this['locale']);}['_createSearchSection'](){const _0x4f622e=new _0x10aa9f(this['locale']);return _0x4f622e['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x555474,_0x29b017)=>{this['loadResources'](_0x29b017),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x29b017);}),_0x4f622e;}['_createResourcesListView'](){const _0x337a97=new qr(this['locale'],this['_source']);return _0x337a97['delegate']('addResourceToContext')['to'](this),_0x337a97['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x337a97;}['_createSkeletonView'](){const _0x2b0964=new je(this['locale'],Ce['aiChatResources']);return _0x2b0964['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x5c7a84=>!_0x5c7a84)]}}),_0x2b0964;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x295ee8){const _0x9ccd5e=_0x5ef33e();this['_latestLoadResourcesUid']=_0x9ccd5e,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x295ee8,'uid':_0x9ccd5e}),this['isLoading']=!0x0;}['setResources'](_0x5ea150,_0x36d83b){if(_0x36d83b&&_0x36d83b!==this['_latestLoadResourcesUid'])return;const _0x2a9853=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x5ea150,_0x2a9853),_0x5ea150['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x2ab3ab,_0x411299){this['_resourcesListView']['updateResourceState'](_0x2ab3ab,_0x411299);}}const xa='ck-ai-chat-context-controls__source-balloon-panel',La='ck-button-icon\x20ck-button-back',Da='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class ko{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x2b2ef6,_0x5a8895,_0x184d3a){this['_locale']=_0x2b2ef6,this['_bodyCollection']=_0x5a8895,this['_config']=_0x184d3a;}['showSourceResourcesBalloon'](_0x2c0ce4){let _0x56d159=this['_sourceResourceBalloons']['get'](_0x2c0ce4['id']);_0x56d159||(_0x56d159=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x2c0ce4['id'],_0x56d159),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x56d159)),this['_addSourceResourceContent'](_0x56d159,_0x2c0ce4),_0x56d159['show']();const _0xc059b1=this['_config']['getTargetElement']();_0xc059b1&&_0x56d159['pin']({'target':_0xc059b1,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x1364fa,_0x3c8f1a,_0xcb89dd){const _0x538cf9=this['_sourceResourceBalloons']['get'](_0x1364fa);if(!_0x538cf9)return;const _0x5cb733=this['_getResourcesViewFromBalloon'](_0x538cf9);_0x5cb733&&(_0x5cb733['setResources'](_0x3c8f1a,_0xcb89dd),_0x5cb733['once']('change:isLoading',()=>{_0x538cf9['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x51494a){const _0x2d9583=this['_sourceResourceBalloons']['get'](_0x51494a);_0x2d9583&&requestAnimationFrame(()=>{_0x2d9583['hide'](),this['_sourceResourceBalloons']['delete'](_0x51494a),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x2fa2c2 of this['_sourceResourceBalloons']['values']())if(_0x2fa2c2['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1d7fbc,_0x59df37,_0x11e3b1){const _0x275c9a=this['_sourceResourceBalloons']['get'](_0x1d7fbc);if(!_0x275c9a||!_0x275c9a['isVisible'])return;const _0x4a28aa=this['_config']['getTargetElement']();if(!_0x4a28aa)return;_0x275c9a['pin']({'target':_0x4a28aa,'limiter':this['_config']['getLimiterElement']()});const _0xff5d98=this['_getResourcesViewFromBalloon'](_0x275c9a);_0xff5d98&&_0xff5d98['updateResourceState'](_0x59df37,_0x11e3b1);}['destroy'](){for(const _0x5cead8 of this['_sourceResourceBalloons']['values']())_0x5cead8['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x583f52=new _0x179f18(this['_locale']);return _0x583f52['extendTemplate']({'attributes':{'class':xa}}),this['_bodyCollection']['add'](_0x583f52),_0x583f52;}['_addSourceResourceContent'](_0x126f3b,_0x52bdf8){_0x126f3b['content']['clear']();const _0x59aa8b=this['_createBalloonHeader'](_0x126f3b,_0x52bdf8);_0x126f3b['content']['add'](_0x59aa8b);const _0x5066ee=this['_createBalloonResourcesView'](_0x52bdf8);_0x126f3b['content']['add'](_0x5066ee);}['_createBalloonHeader'](_0x5a63e4,_0xdc7d1c){const _0x6e62e1=this['_createBackButton'](_0x5a63e4),_0x3a122a=new _0x4f9b0c(this['_locale'],{'label':_0xdc7d1c['label'],'class':Da});return _0x3a122a['children']['add'](_0x6e62e1,0x0),_0x3a122a;}['_createBackButton'](_0x1c4e62){const _0x3a31b4=new _0x5cde82(this['_locale']);return _0x3a31b4['set']({'icon':_0x52404d,'tooltip':C(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':La}),_0x3a31b4['on']('execute',()=>{_0x1c4e62['hide'](),this['_config']['onBackToContext']();}),_0x3a31b4;}['_createBalloonResourcesView'](_0x2f6a1e){const _0x18a5ab=new Or(this['_locale'],{'source':_0x2f6a1e,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x18a5ab['on']('loadSourceResources',(_0x536994,_0x56645f)=>{this['_config']['onLoadSourceResources'](_0x56645f);}),_0x18a5ab['on']('addResourceToContext',(_0x3e8438,_0x3c345f)=>{this['_config']['onResourceSelected'](_0x3c345f['source'],_0x3c345f['resource']),this['closeSourceResourceBalloon'](_0x2f6a1e['id']);}),_0x18a5ab;}['_getResourcesViewFromBalloon'](_0x4afcaf){const _0x41a094=_0x4afcaf['content']['get'](0x1);return _0x41a094 instanceof Or?_0x41a094:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x311a1f){_0x2cf367({'emitter':_0x311a1f,'contextElements':[_0x311a1f['element']],'callback':()=>{_0x311a1f['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x311a1f['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=[_0x179f18['defaultPositions']['northArrowSouthWest'],_0x179f18['defaultPositions']['northArrowSouth'],_0x179f18['defaultPositions']['northArrowSouthEast'],_0x179f18['defaultPositions']['southArrowNorthWest'],_0x179f18['defaultPositions']['southArrowNorth'],_0x179f18['defaultPositions']['southArrowNorthEast']];class us extends _0x10aa9f{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x1d592c,_0x50c61e){super(_0x1d592c),this['bodyCollection']=_0x50c61e['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1d592c),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1d592c),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1d592c),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1d592c,_0x50c61e);const _0x423ad3={'cssClasses':{'showMoreButton':Oo,'showMoreBalloon':Mo,'overflowContainer':No,'controlsButton':Lo}};this['_overflowManager']=new Ao(_0x1d592c,this['_currentContextsChips'],_0x423ad3,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'](_0x1751d6,_0x696961){const _0x46c59a=this['_createContextButton'](_0x1751d6,'current',!0x0,_0x696961);this['_addContextToCollection'](_0x46c59a,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x52de82){this['_removeContextFromCollection'](_0x52de82,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x52de82,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x51e07f,_0x55c8ab){let _0x2051cf=this['_currentContextsChips']['find'](_0x39f899=>_0x39f899['id']===_0x51e07f);_0x2051cf||(_0x2051cf=this['_overflowManager']['overflowChips']['find'](_0x5f4b6e=>_0x5f4b6e['id']===_0x51e07f)),_0x2051cf&&(_0x2051cf['isLoading']=_0x55c8ab);}['setConversationContext'](_0x3a041e){this['_conversationContextsChips']['clear']();for(const _0x3b89ab of _0x3a041e){const _0x5e6f9a=this['_createContextButton'](_0x3b89ab,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x5e6f9a,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x4193e8,_0x5479c7,_0x3cbdde){this['_resourcesBalloonView']['updateResourceState'](_0x4193e8,_0x5479c7,_0x3cbdde);}['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'](_0x32b11c){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x32b11c),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x13984c,_0x154a68,_0x1c92f0,_0x4f5d01){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x13984c,_0x1c92f0,_0x4f5d01);}['closeSourceResourceBalloon'](_0x233043){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x233043),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xa0aa99){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xa0aa99),this['_setAddContextButtonEnabled'](_0xa0aa99);}['_setAddContextButtonEnabled'](_0x37a6f7){const _0x530a02=!_0x37a6f7['document']['isHidden']&&_0x37a6f7['document']['enabled'],_0x171acf=_0x37a6f7['urls']['enabled'],_0x4a2089=_0x37a6f7['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x530a02||_0x171acf||_0x4a2089;}['_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'](_0x2ec9cd){const _0x1c05c8=new _0x5cde82(_0x2ec9cd);return _0x1c05c8['set']({'label':C(_0x2ec9cd,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Lo+'\x20'+Io,'icon':_0x5e57c2,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x1c05c8;}['_createAddContextBalloonPanelView'](_0x57f434){return this['_createBaseBalloonPanel'](_0x57f434,Vo);}['_createUrlBalloonPanelView'](_0x32281f){const _0x24c4f3=this['_createBaseBalloonPanel'](_0x32281f,Po);return this['_addUrlContent'](_0x24c4f3,_0x32281f),_0x24c4f3;}['_createResourcesBalloonView'](_0x39c1fe,_0x397a4d){const _0x37e0de={'searchInputVisibleFrom':_0x397a4d['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});},'onResourceSelected':(_0x4f1617,_0x24895e)=>{this['fire']('addResourceToContext',{'source':_0x4f1617,'resource':_0x24895e});},'onLoadSourceResources':_0xad9a1f=>{this['fire']('loadSourceResources',_0xad9a1f);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new ko(_0x39c1fe,_0x397a4d['bodyCollection'],_0x37e0de);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ho)||document['body'];}['_createBaseBalloonPanel'](_0x6d3607,_0x120f02){const _0x148d69=new _0x179f18(_0x6d3607);return _0x148d69['extendTemplate']({'attributes':{'class':_0x120f02}}),this['bodyCollection']['add'](_0x148d69),_0x148d69;}['_setBalloonPanelContent'](_0x118fe3,_0x5e7511,_0x343d2e){if(_0x118fe3['content']['clear'](),!_0x343d2e['document']['isHidden']&&_0x343d2e['document']['enabled']){const _0x53666f=this['_createBalloonButton'](_0x5e7511,{'label':C(_0x5e7511,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x3af6f7});_0x53666f['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x118fe3['content']['add'](_0x53666f);}if(_0x343d2e['urls']['enabled']){const _0x128697=this['_createBalloonButton'](_0x5e7511,{'label':C(_0x5e7511,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0xe254f0});_0x128697['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}),this['_urlInputView']['focus']();}),_0x118fe3['content']['add'](_0x128697);}if(_0x343d2e['files']['enabled']){const _0x2872ce=new _0x522a32(_0x5e7511);_0x2872ce['set']({'label':C(_0x5e7511,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x2625c2,'withText':!0x0,'tooltip':!0x0,'class':Ro,'allowMultipleFiles':!0x0}),_0x2872ce['on']('done',(_0x6a60ca,_0x40d918)=>{this['fire']('addFileToContext',_0x40d918),this['hideAddContextBalloonPanel']();}),_0x2872ce['tooltip']=!0x0,_0x118fe3['content']['add'](_0x2872ce);}for(const _0x1244f1 of _0x343d2e['sources']){const _0x54c816=this['_createBalloonButton'](_0x5e7511,{'label':_0x1244f1['label'],'icon':_0x1244f1['icon']||_0x2ca83b,'type':'source'});_0x118fe3['content']['add'](_0x54c816),_0x54c816['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x1244f1);});}}['_addUrlContent'](_0x157d09,_0xf9a5b2){this['_urlInputView']=new To(_0xf9a5b2),this['_urlInputView']['on']('submitUrl',(_0x595f49,_0x1e3fa3)=>{this['_handleUrlSubmit'](_0x1e3fa3);}),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});}),_0x157d09['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x12cacc,_0x366819){const _0x49a569='source'===_0x366819['type']?new Pa(_0x12cacc):new _0x5cde82(_0x12cacc);return _0x49a569['set']({'label':_0x366819['label'],'icon':_0x366819['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ro}),_0x49a569;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x2cf367({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x31ac7e){const _0x77eaa1=this['_addContextBalloonConfig'];_0x77eaa1['buttonView']['isOn']=_0x31ac7e,_0x31ac7e?_0x77eaa1['balloonView']['show']():_0x77eaa1['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x21d443,buttonView:_0x38ab5a,hideMethod:_0x514a91}=this['_addContextBalloonConfig'];_0x2cf367({'emitter':_0x21d443,'contextElements':[_0x21d443['element'],_0x38ab5a['element']],'callback':()=>{_0x514a91();},'activator':()=>_0x38ab5a['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x124de9,_0x21e3cb,_0x4cf2b7=!0x1,_0x1932d2=!0x1){const _0x8b9f94='conversation'===_0x21e3cb||!0x0===_0x124de9['isReadOnly'],_0x2fbc2a=new bo(this['locale'],_0x124de9,_0x8b9f94,_0x4cf2b7,_0x1932d2);return _0x8b9f94||_0x2fbc2a['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x2fbc2a['id']);}),_0x2fbc2a;}['_addContextToCollection'](_0x5cb669,_0xe509f6){_0xe509f6['add'](_0x5cb669,0x0);}['_removeContextFromCollection'](_0x39b195,_0x20276b){const _0x4aeb9a=_0x20276b['find'](_0x277654=>_0x277654['id']===_0x39b195);_0x4aeb9a&&_0x20276b['remove'](_0x4aeb9a);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}));}['_handleUrlSubmit'](_0x72d09a){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x72d09a);}}class Pa extends _0x5cde82{['arrowView'];constructor(_0x1d2572){super(_0x1d2572),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 _0xa6549e=new _0x3dad93();return _0xa6549e['content']=_0xb14688,_0xa6549e['extendTemplate']({'attributes':{'class':Uo+'__arrow'}}),_0xa6549e;}}class bs extends _0x10aa9f{['_cancelButtonView'];['_loaderView'];constructor(_0x236efb){super(_0x236efb),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 _0x17b4f9=new _0x5cde82(this['locale']);return _0x17b4f9['set']({'label':C(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x2b48d9}),_0x17b4f9['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x17b4f9;}['_createLoaderView'](){const _0x37949a=new _0x10aa9f(this['locale']);return _0x37949a['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')}]}),_0x37949a;}}class Bi extends _0x10aa9f{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x413720,_0x7c73e5){super(_0x413720),this['_contextPanelView']=this['_createContextPanelView'](_0x413720,{'bodyCollection':_0x7c73e5['bodyCollection'],'searchInputVisibleFrom':_0x7c73e5['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x413720),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x413720),this['_loaderView']=this['_createLoaderView'](_0x413720),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x413720),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 _0xaa14ad=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0xaa14ad['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0xaa14ad['if']('isLoading','ck-hidden',_0x289a55=>_0x289a55||!this['isModelAvailable']),_0xaa14ad['if']('isModelAvailable','ck-hidden',_0x1b86d1=>!_0x1b86d1||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0xaa14ad['if']('isLoading','ck-hidden',_0x85a1c2=>!_0x85a1c2)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0xaa14ad['if']('isModelAvailable','ck-hidden',_0x53e11c=>_0x53e11c)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x2cf367({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x571850,_0x3f223b){return new us(_0x571850,_0x3f223b);}['_createPromptInputView'](_0x363465){return new ds(_0x363465,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x50eb16){return new ps(_0x50eb16);}['_createLoaderView'](_0xed0f03){return new bs(_0xed0f03);}['_createModelUnavailableMessageView'](_0x12bf22){const _0x3eff60=new gs(_0x12bf22);return _0x3eff60['delegate']('startConversation')['to'](this),_0x3eff60;}['_handlePromptInputFocus'](_0x498efa,_0x17fd14,_0x5c0be7){_0x5c0be7?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x17962a,_0x1650b7){this['_contextPanelView']['addContextItem'](_0x17962a,_0x1650b7);}['removeContextItem'](_0x407748){this['_contextPanelView']['removeContextItem'](_0x407748);}['setContextItemLoading'](_0x48bcc7,_0x44777f){this['_contextPanelView']['setContextItemLoading'](_0x48bcc7,_0x44777f);}['setIsUploadInProgress'](_0x2c61a1){this['_promptInputView']['setIsUploadInProgress'](_0x2c61a1);}['setConversationContext'](_0x9e9019){this['_contextPanelView']['setConversationContext'](_0x9e9019);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x396e4b,_0x2469c5,_0x39e48d){this['_contextPanelView']['updateResourceState'](_0x396e4b,_0x2469c5,_0x39e48d);}['setWebSearch'](_0x5e342a){this['_promptCapabilitiesView']['setWebSearch'](_0x5e342a);}['setReasoning'](_0x7c0912){this['_promptCapabilitiesView']['setReasoning'](_0x7c0912);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x51ebf6){this['_contextPanelView']['setAddContextOptions'](_0x51ebf6);}['setInputPlaceholder'](_0x572063){this['_promptInputView']['setPlaceholderText'](_0x572063);}['setModelList'](_0x1058ea,_0x5dd433){this['_displayedModels']=_0x1058ea,this['_promptCapabilitiesView']['setModelList'](_0x1058ea,_0x5dd433);}['setModel'](_0x3fd2c0){(_0x3fd2c0?this['_displayedModels']['find'](_0xab633f=>_0xab633f['id']===_0x3fd2c0['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3fd2c0)):_0x3fd2c0?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x644f25){this['_promptCapabilitiesView']['disableModelSelector'](_0x644f25);}['populateSourceResourceBalloon'](_0x27bf44,_0x515718,_0x1ef30a,_0x46940f){this['_contextPanelView']['populateSourceResourceBalloon'](_0x27bf44,_0x515718,_0x1ef30a,_0x46940f);}['closeSourceResourceBalloon'](_0xe47218){this['_contextPanelView']['closeSourceResourceBalloon'](_0xe47218);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class gs extends _0x10aa9f{constructor(_0x4cbea8){super(_0x4cbea8);const _0x397d73=new _0x5cde82(_0x4cbea8);_0x397d73['set']({'label':C(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x397d73['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'},_0x397d73]}]});}}class Fi extends _0x4f9b0c{['conversationStartButton'];['resizeButton'];constructor(_0x21de37,_0x2ae6fb){super(_0x21de37,{'label':C(_0x21de37,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_t}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x21de37),this['children']['add'](this['conversationStartButton']),_0x2ae6fb&&(this['resizeButton']=Cs(_0x21de37,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x3abe6c){const _0x3eedc6=new _0x5cde82(_0x3abe6c);return _0x3eedc6['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x17d64d,'class':'ck-ai-chat__start-conversation'}),_0x3eedc6['on']('execute',()=>{this['fire']('startConversation');}),_0x3eedc6;}}class Vi extends _0x10aa9f{constructor(_0x26f64a){super(_0x26f64a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':C(_0x26f64a,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0x10aa9f{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x18fe26,_0x1c5f05){super(_0x18fe26),this['_bodyCollection']=new qt(_0x18fe26),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Fi(_0x18fe26,_0x1c5f05['showResizeButton']),this['chatHeader']['delegate'](...St)['to'](this),this['chatFeed']=new ji(_0x18fe26,this['_bodyCollection']),this['chatFeed']['delegate'](...St)['to'](this),this['chatControls']=new Bi(_0x18fe26,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x1c5f05['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...St)['to'](this),this['chatDisclaimer']=new Vi(_0x18fe26),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x18fe26['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x184fc3,_0x12104e,_0x5a8a0b,_0x1b0b59){this['chatControls']['populateSourceResourceBalloon'](_0x184fc3,_0x12104e,_0x5a8a0b,_0x1b0b59);}['closeSourceResourceBalloon'](_0x277e3e){this['chatControls']['closeSourceResourceBalloon'](_0x277e3e);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class et extends _0x267838{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(_0x29faad){super(_0x29faad);const _0x28d1bb=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x28d1bb['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...St)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x584a52,{showDiff:_0x1644d7})=>{this['showDiff']=_0x1644d7;}),_0x28d1bb['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',_0x5a2d10=>_0x5a2d10),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x1a1c03=>_0x1a1c03),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x13b584){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x13b584['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:_0x384241,staticMessage:_0x409009}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x384241,'initialContent':'<p>'+_0x409009+'</p>'});}['addFeedItemUserMessage'](_0x414aec){const _0xdc333f=_0x414aec['quickActionData']?.['displayedPrompt']||_0x414aec['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x414aec['contextItems']['values']()),'initialContent':'<p>'+_0xdc333f+'</p>','id':_0x414aec['id']});}['addFeedItemError']({errorMessage:_0x6512dd,id:_0x3f3fc3}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x6512dd+'</p>','id':_0x3f3fc3});}['addFeedItemAIReply'](_0x3a9b73){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3a9b73['interactionId']+':'+_0x3a9b73['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x4d665d){const _0x14b523=P(this['context']);let _0x18b12e=_0x14b523['config']['get']('ai.availableReplyActions')||[...k];if(_0x14b523['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x4f696e=_0x14b523['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x4f696e,'value');}}else _0x18b12e=_0x18b12e['filter'](_0x4dbe83=>'insertSuggestion'!=_0x4dbe83);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4d665d['interactionId']+':'+_0x4d665d['id'],'areActionsDisabled':_0x4d665d['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x18b12e}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x4c896d,_0x3e239d){const _0x2e9960=this['_view']['chatFeed']['children']['last'];if(_0x2e9960 instanceof Et)return this['_view']['chatFeed']['children']['remove'](_0x2e9960),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x4c896d['id'],'capabilities':{'isWebSearchEnabled':_0x2e9960['capabilities']['isWebSearchEnabled']||_0x3e239d['isWebSearchEnabled'],'isReasoningEnabled':_0x2e9960['capabilities']['isReasoningEnabled']||_0x3e239d['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x4c896d['id'],'capabilities':_0x3e239d});}['updateFeedInteractionHeader'](_0x1e0f38){const _0x1c0e82=this['_view']['chatFeed']['children']['find'](_0x49416f=>_0x49416f['options']['id']==_0x1e0f38['id']&&_0x49416f instanceof Et);_0x1c0e82&&_0x1c0e82['set']('isVisible',_0x1e0f38['isVisible']);}async['updateFeedItemAIReplyContent'](_0x555802){const _0x426f00=_0x555802['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0xba4d4c=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x555802,'abortSignal':_0xba4d4c,'renderingStrategy':_0x426f00}),_0x555802['isDone']&&this['markFeedItemAsDone'](_0x555802['id']);});}['updateFeedItemAIReplySources'](_0x36206,_0xcb8f42){this['_view']['chatFeed']['updateWebSources'](_0x36206,_0xcb8f42);}async['updateFeedItemAIReplySuggestionContent'](_0x14408e){const _0x38f337=_0x14408e['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x625c09=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x14408e,'abortSignal':_0x625c09,'renderingStrategy':_0x38f337}),_0x14408e['isDone']&&this['markFeedItemAsDone'](_0x14408e['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x3943f2){this['_view']['chatFeed']['updateSuggestionPartState'](_0x3943f2);}['markFeedItemAsDone'](_0x38a480){this['_view']['chatFeed']['markItemAsDone'](_0x38a480);}['removeFeedInteraction'](_0x354121){this['_view']['chatFeed']['getItemIds']()['filter'](_0x1c148d=>_0x1c148d['startsWith'](_0x354121))['forEach'](_0x5ec9b9=>this['_view']['chatFeed']['removeItem'](_0x5ec9b9));}['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'](_0x4b561a){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x44fd0e=>_0x44fd0e['startsWith'](_0x4b561a['id']))['forEach'](_0x3687b3=>this['markFeedItemAsDone'](_0x3687b3)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x759fbd,_0x11c9da){this['_view']['chatControls']['addContextItem'](_0x759fbd,_0x11c9da);}['removeContextItem'](_0x2435e8){this['_view']['chatControls']['removeContextItem'](_0x2435e8);}['setContextItemLoading'](_0x58f5b7,_0x5c0198){this['_view']['chatControls']['setContextItemLoading'](_0x58f5b7,_0x5c0198);}['setIsUploadInProgress'](_0x3f519b){this['_view']['chatControls']['setIsUploadInProgress'](_0x3f519b);}['setConversationContext'](_0x451fc4){this['_view']['chatControls']['setConversationContext'](_0x451fc4);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x3f1f8f,_0x46472a,_0x5b6221){this['_view']['chatControls']['updateResourceState'](_0x3f1f8f,_0x46472a,_0x5b6221);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x2b9119){this['_view']['chatControls']['setAddContextOptions'](_0x2b9119);}['updateCapabilities'](_0x429f6f){this['_view']['chatControls']['setWebSearch'](_0x429f6f['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x429f6f['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x429f6f));}['setSelectedModel'](_0x431960,_0x5b0480){this['_view']['chatControls']['setModel'](_0x431960),_0x5b0480&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x1aa19b){this['feedItemRenderingStrategy']=_0x1aa19b;}['toggleLoadingSkeleton'](_0x362a9c){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x362a9c);}['resetConversationTitle'](){this['setConversationTitle'](C(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x16a13b,_0x34757b=!0x1){if(_0x34757b&&!It()&&_0x16a13b['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x16a13b);this['_view']['chatHeader']['label']=_0x16a13b;}['setLoadingMessage'](_0x5029c6){const _0x1150bb=this['_getLoadingMessage'](_0x5029c6);this['_view']['chatFeed']['setLoadingMessage'](_0x1150bb);}['_animateConversationTitle'](_0x54fe39){let _0x21bea8=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x54fe39[_0x21bea8],_0x21bea8++,_0x21bea8===_0x54fe39['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x466a69){this['_view']['chatHeader']['isMaximized']=_0x466a69;}['_getLoadingMessage'](_0x4d2527){return _0x4d2527?_0x4d2527['isWebSearchEnabled']&&_0x4d2527['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x4d2527['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x4d2527['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x19618c){return _0x19618c?_0x19618c['isWebSearchEnabled']&&_0x19618c['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x19618c['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x19618c['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'](_0x2f6930,_0x1ddf6d,_0x4bb8a0,_0x43f7d4){this['_view']['populateSourceResourceBalloon'](_0x2f6930,_0x1ddf6d,_0x4bb8a0,_0x43f7d4);}['closeSourceResourceBalloon'](_0x15710a){this['_view']['closeSourceResourceBalloon'](_0x15710a);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x32e491,_0x286dda){this['_view']['chatFeed']['scrollToSuggestion'](_0x32e491,_0x286dda);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Ji extends _0x4a219d{['sections'];constructor(_0x103203,_0x493f02){super(_0x103203),this['sections']=_0x493f02,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x315e5b){let _0x1393be=0x0,_0x37f2ec=0x0;for(const _0x156d45 of this['sections']){const {resultsCount:_0x14b7fe,totalItemsCount:_0x4cdc61}=_0x156d45['filter'](_0x315e5b);_0x1393be+=_0x14b7fe,_0x37f2ec+=_0x4cdc61;}return{'resultsCount':_0x1393be,'totalItemsCount':_0x37f2ec};}}class Ki extends _0x2ced3c{['title'];['itemsViews'];['_itemsListView'];constructor(_0xb68378,{title:_0x494cc6,items:_0x4a5a33}){super(_0xb68378);const _0x5eaed0=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x494cc6,this['itemsViews']=_0x4a5a33;const _0x26e53a=new _0x10aa9f(_0xb68378);_0x26e53a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x4a219d(_0xb68378),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x5eaed0['if']('isVisible','ck-hidden',_0x13831b=>!_0x13831b)]},'children':[_0x26e53a,this['_itemsListView']]});}['filter'](_0x502739){const _0x1d5a79=this['itemsViews']['length'];let _0x54b05b=0x0;for(const _0x304b9b of this['itemsViews']){if(_0x502739){const _0x53a0c5=_0x304b9b['isMatching'](_0x502739);_0x304b9b['isVisible']=!!_0x53a0c5,_0x304b9b['highlightText'](_0x502739);}else _0x304b9b['isVisible']=!0x0,_0x304b9b['highlightText'](null);_0x304b9b['isVisible']&&_0x54b05b++;}return this['isVisible']=_0x54b05b>0x0,{'resultsCount':_0x54b05b,'totalItemsCount':_0x1d5a79};}['getItem'](_0x143e81){return this['itemsViews']['find'](_0x147055=>_0x147055['id']===_0x143e81);}['removeItem'](_0x48066c){const _0x150718=this['itemsViews']['indexOf'](_0x48066c);-0x1!==_0x150718&&(this['itemsViews']['splice'](_0x150718,0x1),this['_itemsListView']['items']['remove'](_0x48066c));}}class Qi extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x3a5d8a(_0x2ced3c){['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(_0x3429f5,_0x302460){super(_0x3429f5);const _0x23d0be=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x302460['pinned']),this['set']('loadingState',null),this['id']=_0x302460['id'];const {title:_0x173ac8,createdAt:_0x4a0245,active:_0x495837=!0x1}=_0x302460;this['_titleView']=new _0x4eed03(),this['_titleView']['text']=_0x173ac8,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x49052e=this['_createCheckView'](),_0x568fd2=this['_createPinButtonView'](_0x3429f5),_0x735486=this['_createMenuDropdownView'](),_0x42a2e8=this['_createEditInputView'](_0x3429f5,_0x173ac8),_0x277f68=this['_createAcceptEditButtonView'](_0x3429f5,_0x42a2e8),_0xea046f=this['_createCancelEditButtonView'](_0x3429f5,_0x42a2e8);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x568fd2),this['actions']['add'](_0x735486),this['on']('change:isEdit',(_0x53da63,_0x1c8bf3,_0x376e9a)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x376e9a?(this['actions']['add'](_0x277f68),this['actions']['add'](_0xea046f),this['mainContent']['add'](_0x42a2e8),_0x42a2e8['element']['focus']()):(this['actions']['add'](_0x568fd2),this['actions']['add'](_0x735486),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x495837?'ck-ai-chat-history__item--active':'',_0x23d0be['if']('isVisible','ck-hidden',_0x2afd2d=>!_0x2afd2d),_0x23d0be['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',_0x23d0be['if']('loadingState','ck-hidden',_0x3345fe=>!!_0x3345fe)]},'children':_0x495837?[_0x49052e]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x23d0be['if']('loadingState','ck-hidden',_0x438d15=>!_0x438d15)]},'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',_0x23d0be['if']('loadingState','ck-hidden',_0x37bd76=>!!_0x37bd76)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x23d0be['if']('loadingState','ck-hidden',_0x356760=>!_0x356760)]},'children':[{'text':_0x23d0be['to']('loadingState',_0x5a6065=>_0x5a6065?C(this['locale'],Qi['LOADING_LABELS'][_0x5a6065]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4a0245]}]},{'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'](_0x284064){this['_titleView']['text']=_0x59aba(_0x284064);}['updateLoadingState'](_0x2f41ac,_0x39a43a){this['set']('loadingState',_0x39a43a?_0x2f41ac:null);}['_createCheckView'](){const _0x51b697=new _0x3dad93();return _0x51b697['set']({'content':_0x47bafa}),_0x51b697;}['_createPinButtonView'](_0x527229){const _0x35ad01=new _0x5cde82(_0x527229);return _0x35ad01['set']({'label':C(_0x527229,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x47880f,'withText':!0x1,'tooltip':!0x0}),_0x35ad01['bind']('isOn')['to'](this,'pinned'),_0x35ad01['on']('execute',()=>{const _0x27db92=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x27db92});}),_0x35ad01;}['_createMenuDropdownView'](){const _0x150877=_0x1fe5fd(this['locale'],_0x2515fe),_0x3da708=_0x150877['panelView']['children'];_0x150877['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x3c01b9}),_0x150877['panelPosition']='sw';const _0x27a312=new _0x5cde82(this['locale']);_0x27a312['label']=C(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x27a312['withText']=!0x0,_0x27a312['on']('execute',()=>{this['isEdit']=!0x0;});const _0x383805=new _0x5cde82(this['locale']);_0x383805['label']=C(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x383805['withText']=!0x0,_0x383805['on']('execute',()=>{this['showConfirm'](C(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x1f7455=new _0x4a219d(this['locale']),_0x233cfb=new _0x2ced3c(this['locale']);_0x233cfb['children']['add'](_0x27a312);const _0x1b97a9=new _0x2ced3c(this['locale']);return _0x1b97a9['children']['add'](_0x383805),_0x1f7455['items']['addMany']([_0x233cfb,_0x1b97a9]),_0x3da708['add'](_0x1f7455),_0x150877;}['_createEditInputView'](_0x28c34a,_0x2ea06a){const _0x501ac8=new _0x35834b(_0x28c34a),_0x4952d3=_0x501ac8['bindTemplate'];return _0x501ac8['value']=_0x2ea06a,_0x501ac8['extendTemplate']({'on':{'keydown':_0x4952d3['to'](_0x206b05=>{'Enter'==_0x206b05['key']&&this['_commitEditInputValue'](_0x501ac8);})}}),_0x501ac8;}['_createAcceptEditButtonView'](_0x5a7df9,_0x5a0733){const _0x1247b8=new _0x5cde82(_0x5a7df9);return _0x1247b8['set']({'icon':_0x47bafa,'withText':!0x1,'tooltip':C(_0x5a7df9,'AI_CHAT_HISTORY_ACCEPT')}),_0x1247b8['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x1247b8['on']('execute',()=>{this['_commitEditInputValue'](_0x5a0733);}),_0x1247b8;}['_commitEditInputValue'](_0x3e250e){const _0x2780dd=_0x3e250e['element']['value']||'';this['_titleView']['text']=_0x2780dd,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x2780dd});}['_createCancelEditButtonView'](_0x2776ce,_0x2a91b1){const _0x16e4ee=new _0x5cde82(_0x2776ce);return _0x16e4ee['set']({'icon':_0x27c5a9,'withText':!0x1,'tooltip':C(_0x2776ce,'AI_CHAT_HISTORY_CANCEL')}),_0x16e4ee['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x16e4ee['on']('execute',()=>{this['isEdit']=!0x1,_0x2a91b1['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x16e4ee;}['_createSpinnerView'](){const _0x2f2a8a=new Le('tiny');return _0x2f2a8a['isVisible']=!0x0,_0x2f2a8a;}['isMatching'](_0x492ec2){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x492ec2)?{'title':!0x0}:null;}['highlightText'](_0x4f88c1){this['_titleView']['highlightText'](_0x4f88c1);}}class vt extends _0x10aa9f{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x593f88,_0x11a483){super(_0x593f88),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x318d49=new _0x4f9b0c(_0x593f88,{'label':C(_0x593f88,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x11a483&&(this['resizeButton']=Cs(_0x593f88,this),_0x318d49['children']['add'](this['resizeButton'])),this['sectionsView']=new Ji(_0x593f88,[]),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':[_0x318d49,{'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 _0x19c724=new _0x722ee7(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5c8fdf=>C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5c8fdf),'secondary':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x19c724['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x19c724['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x113e78=>!_0x113e78)]}}),_0x19c724;}['_createSkeletonView'](){const _0x1a2a5f=new je(this['locale'],Ce['aiHistory']);return _0x1a2a5f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xeaef85=>!_0xeaef85)]}}),_0x1a2a5f;}['_createErrorView'](){const _0x52280d=new _0x10aa9f(this['locale']),_0x219e07=new _0x5cde82(this['locale']);return _0x219e07['set']({'withText':!0x1,'icon':_0x27c5a9,'class':'ck-ai-chat-error__dismiss-button'}),_0x219e07['bind']('isVisible')['to'](this,'hasItems',_0x4a6704=>!!_0x4a6704),_0x219e07['on']('execute',()=>{this['errorMessage']='';}),_0x52280d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x51654f=>!_0x51654f)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x219e07]}),_0x52280d;}['_createEmptyStateView'](){const _0x2521e8=new _0x5cde82(this['locale']);_0x2521e8['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x17d64d,'class':'ck-ai-chat__start-conversation'}),_0x2521e8['on']('execute',()=>{this['fire']('openChat');});const _0x57da9f=new _0x10aa9f(this['locale']);return _0x57da9f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x5b2dd1=>!_0x5b2dd1)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[C(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x2521e8]}),_0x57da9f;}['_createListItemViews'](_0x35ec43,_0x2fa1bd){const _0x38b3c6=[];for(const _0x587686 of _0x35ec43){const _0x32ad91=new Qi(_0x2fa1bd,_0x587686);_0x32ad91['delegate'](...Xi)['to'](this),_0x38b3c6['push'](_0x32ad91);}return _0x38b3c6;}['updateHistoryItemsWithCategories'](_0x5d918e){const _0x36b623=this['locale']||'en',_0x3a010d=[];for(const _0x5a7c6c of _0x5d918e){const _0x2cdf2a=this['_createListItemViews'](_0x5a7c6c['items'],_0x36b623);_0x3a010d['push'](new Ki(_0x36b623,{'title':_0x5a7c6c['title'],'items':_0x2cdf2a}));}this['sectionsView']['sections']=_0x3a010d,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x3a010d),this['hasItems']=_0x5d918e['some'](_0x337dfb=>_0x337dfb['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x4e9990){for(const _0x3015c9 of this['sectionsView']['sections']){const _0x465533=_0x3015c9['getItem'](_0x4e9990);if(_0x465533){if(_0x3015c9['removeItem'](_0x465533),0x0===_0x3015c9['itemsViews']['length']){const _0x9230a4=this['sectionsView']['sections']['indexOf'](_0x3015c9);-0x1!==_0x9230a4&&(this['sectionsView']['sections']['splice'](_0x9230a4,0x1),this['sectionsView']['items']['remove'](_0x3015c9));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0xf5a56,_0x53c10d){for(const _0x20b34b of this['sectionsView']['sections']){const _0x5bbcdf=_0x20b34b['getItem'](_0xf5a56);if(_0x5bbcdf){_0x5bbcdf['updateTitle'](_0x53c10d);break;}}}['updateItemLoadingState'](_0x215b99,_0x405510,_0x3a4b66){for(const _0x1be440 of this['sectionsView']['sections']){const _0xe788fc=_0x1be440['getItem'](_0x215b99);if(_0xe788fc){_0xe788fc['updateLoadingState'](_0x405510,_0x3a4b66);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x229375=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x229375);}}}const Xi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class jt extends _0x267838{static get['requires'](){return[at];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x58cdb2){super(_0x58cdb2);const _0x3302ae=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x3302ae['showResizeButton']),this['_historyView']['delegate'](...Xi)['to'](this),_0x3302ae['view']['addTab']({'id':'history','buttonLabel':C(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x55c4c1){this['_historyView']['removeHistoryItem'](_0x55c4c1);}['updateItems'](_0x1f185c){this['_historyView']['updateHistoryItemsWithCategories'](_0x1f185c);}['updateItemTitle'](_0x1aa6ee,_0x1b103b){this['_historyView']['updateItemTitle'](_0x1aa6ee,_0x1b103b);}['updateItemLoadingState'](_0x5b0905,_0x6447f9,_0x4cc7d2){this['_historyView']['updateItemLoadingState'](_0x5b0905,_0x6447f9,_0x4cc7d2);}['setLoadingSkeleton'](_0x338610){this['_historyView']['isLoading']=_0x338610;}['showError'](_0x2fb6cb){this['_historyView']['errorMessage']=_0x2fb6cb;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x11cc7f){this['_historyView']['isMaximized']=_0x11cc7f;}}class De extends _0x314197(){['id'];['createdAt'];constructor({id:_0x5da507,title:_0x3058f0,createdAt:_0x68d3aa,updatedAt:_0xc1f012,pinned:_0x2e95db}){super(),this['id']=_0x5da507,this['createdAt']=new Date(_0x68d3aa),this['set']('title',_0x3058f0),this['set']('updatedAt',_0xc1f012?new Date(_0xc1f012):null),this['set']('pinned',_0x2e95db||!0x1);}['updateTitle'](_0x1fd844){this['set']('title',_0x59aba(_0x1fd844)),this['updatedAt']=new Date();}['updatePinned'](_0x47d355){this['set']('pinned',_0x47d355),this['updatedAt']=new Date();}}class Tt extends _0x7d5e47(){['items']=[];['connector'];['group'];constructor({connector:_0x33a212,group:_0x47f936}){super(),this['connector']=_0x33a212,this['group']=_0x47f936;}async['init'](){try{const _0x28c38b=this['connector']['fetchConversations'](this['group']),_0x41b42f=await _0x28c38b['getConversations']();this['loadItems'](_0x41b42f);}catch(_0x29428a){this['fire']('error',{'error':_0x29428a,'operation':'init'});}}['addItem'](_0x40a8c6){this['items']['push'](_0x40a8c6);}async['removeItem'](_0x3d6937){const _0x19b1d8=this['items']['findIndex'](_0x263d84=>_0x263d84['id']===_0x3d6937);if(-0x1===_0x19b1d8)return!0x1;try{return await this['connector']['deleteConversation'](_0x3d6937)['execute'](),this['items']['splice'](_0x19b1d8,0x1),this['fire']('itemRemoved',{'itemId':_0x3d6937}),!0x0;}catch(_0x20f150){return this['fire']('error',{'error':_0x20f150,'operation':'removeItem','itemId':_0x3d6937}),!0x1;}}['getItem'](_0x552c14){return this['items']['find'](_0x381008=>_0x381008['id']===_0x552c14);}async['updateItemTitle'](_0x4261b3,_0xc54a31){const _0x54b227=this['getItem'](_0x4261b3);if(!_0x54b227)return!0x1;try{return await this['connector']['updateConversation'](_0x4261b3,{'title':_0xc54a31})['getResult'](),_0x54b227['updateTitle'](_0xc54a31),this['fire']('itemUpdated',{'itemId':_0x4261b3,'updates':{'title':_0xc54a31}}),!0x0;}catch(_0x438418){return this['fire']('error',{'error':_0x438418,'operation':'updateItemTitle','itemId':_0x4261b3}),!0x1;}}async['updateItemPinned'](_0x2c18ea,_0x4c7dc7){const _0x1046f4=this['getItem'](_0x2c18ea);if(!_0x1046f4)return!0x1;try{return await this['connector']['updateConversation'](_0x2c18ea,{'pinned':_0x4c7dc7})['getResult'](),_0x1046f4['updatePinned'](_0x4c7dc7),this['fire']('itemUpdated',{'itemId':_0x2c18ea,'updates':{'pinned':_0x4c7dc7}}),!0x0;}catch(_0x255054){return this['fire']('error',{'error':_0x255054,'operation':'updateItemPinned','itemId':_0x2c18ea}),!0x1;}}['loadItems'](_0x4375e1){try{this['items']=[],_0x4375e1['map'](_0x25530f=>{this['addItem'](new De(_0x25530f));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x562237){this['fire']('error',{'error':_0x562237,'operation':'loadItems'});}}['getItems'](_0x489e38={}){const _0x249ed7=void 0x0!==_0x489e38['pinned']&&_0x489e38['pinned'],_0x368aa9=_0x489e38['from']?new Date(_0x489e38['from']['getFullYear'](),_0x489e38['from']['getMonth'](),_0x489e38['from']['getDate']()):null,_0x49f719=_0x489e38['to']?new Date(_0x489e38['to']['getFullYear'](),_0x489e38['to']['getMonth'](),_0x489e38['to']['getDate']()):null;return this['items']['filter'](_0x5398ec=>{if(_0x5398ec['pinned']!==_0x249ed7)return!0x1;if(_0x49f719){const _0x5dda9d=new Date(_0x5398ec['createdAt']['getFullYear'](),_0x5398ec['createdAt']['getMonth'](),_0x5398ec['createdAt']['getDate']());return _0x368aa9?_0x368aa9['getTime']()===_0x49f719['getTime']()?_0x5dda9d['getTime']()===_0x368aa9['getTime']():_0x5dda9d<_0x49f719&&_0x5dda9d>=_0x368aa9:_0x5dda9d<_0x49f719;}return!0x0;});}}class yt extends _0x267838{['_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 _0x49fa27=this['context']['plugins']['get'](at),_0x202bd1=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x202bd1}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x1b7398,_0x519237)=>{this['_setItemLoading'](_0x519237['id'],'remove'),this['_handleRemove'](_0x519237['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x5a482c,_0x391918)=>{this['_setItemLoading'](_0x391918['id'],'rename'),this['_handleEditTitle'](_0x391918['id'],_0x391918['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x1e027f,_0xd80516)=>{void 0x0!==_0xd80516['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xd80516['itemId'],_0xd80516['updates']['title']),void 0x0!==_0xd80516['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xd80516['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x557136,_0x206d28)=>{this['_aiChatController']['handleRemovedConversation'](_0x206d28['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x206d28['itemId']),this['_clearItemLoading'](_0x206d28['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x22e014,_0x14e46f)=>{this['_handleHistoryErrorUI'](_0x14e46f['error'],_0x14e46f['operation'],_0x14e46f['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x2bc68b,_0x1d2a87)=>{this['_handleSelectConversation'](_0x1d2a87['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x8d4f02,_0x50c38d)=>{const _0x432741=_0x50c38d['pinned']?'pin':'unpin';this['_setItemLoading'](_0x50c38d['id'],_0x432741),this['_handleTogglePin'](_0x50c38d['id'],_0x50c38d['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x49fa27['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x49fa27['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x49fa27,'resizedTabs',(_0x12e94b,_0x191af9)=>{this['_setIsMaximized'](_0x191af9);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x49fa27['resize']();});}async['_handleEditTitle'](_0x4e7ae0,_0x651de5){await this['history']['updateItemTitle'](_0x4e7ae0,_0x651de5);}async['_handleTogglePin'](_0x160df2,_0x5ca377){await this['history']['updateItemPinned'](_0x160df2,_0x5ca377);}async['_handleRemove'](_0x41d774){await this['history']['removeItem'](_0x41d774);}async['_handleSelectConversation'](_0x4eb612){await this['_aiChatController']['loadConversation'](_0x4eb612);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x29d7e5=this['_aiChatController']['activeConversation']?.['id'],_0x44b517=this['_getCategorizedItems']()['map'](_0x2245ef=>({'title':_0x2245ef['title'],'items':_0x2245ef['items']['map'](_0x2f4620=>({'id':_0x2f4620['id'],'title':_0x2f4620['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x2f4620['createdAt'])['toLocaleDateString'](),'active':_0x2f4620['id']===_0x29d7e5,'pinned':_0x2f4620['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x44b517);}['_setItemLoading'](_0x39b0f5,_0x569b56){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x39b0f5,_0x569b56,!0x0);}['_clearItemLoading'](_0x214747){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x214747,null,!0x1);}['_handleHistoryErrorUI'](_0x1c5985,_0x112138,_0x5113d4){const _0xe44ca5=this['_generateErrorMessage'](_0x112138,_0x5113d4);this['_aiChatHistoryUi']['showError'](_0xe44ca5),_0x5113d4&&this['_clearItemLoading'](_0x5113d4),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x2125a6,_0x1786f1){const _0x5eeabc=_0x1786f1?this['history']['getItem'](_0x1786f1):null,_0x32d83f=_0x5eeabc?.['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x2125a6){case'updateItemTitle':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x32d83f);case'updateItemPinned':{const _0x34a18f=C(this['context']['locale'],_0x5eeabc?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x34a18f,_0x32d83f]);}case'removeItem':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x32d83f);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 _0x2301b8=new Date(),_0x2e54f5=new Date(_0x2301b8['getFullYear'](),_0x2301b8['getMonth'](),_0x2301b8['getDate']()),_0x31bc3e=new Date(_0x2e54f5);_0x31bc3e['setDate'](_0x31bc3e['getDate']()-0x1);const _0x45e875=new Date(_0x2e54f5);_0x45e875['setDate'](_0x45e875['getDate']()-0xe);const _0x2912ff=this['history']['getItems']({'pinned':!0x0}),_0xd01b1c=this['history']['getItems']({'from':_0x2e54f5,'to':_0x2e54f5}),_0x477377=this['history']['getItems']({'from':_0x31bc3e,'to':_0x31bc3e}),_0x55e6d0=this['history']['getItems']({'from':_0x45e875,'to':_0x31bc3e}),_0x3a2dec=this['history']['getItems']({'to':_0x45e875}),_0x428390=[];return _0x2912ff['length']>0x0&&_0x428390['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x2912ff}),_0xd01b1c['length']>0x0&&_0x428390['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0xd01b1c}),_0x477377['length']>0x0&&_0x428390['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x477377}),_0x55e6d0['length']>0x0&&_0x428390['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x55e6d0}),_0x3a2dec['length']>0x0&&_0x428390['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x3a2dec}),_0x428390;}['_setIsMaximized'](_0x15cfc2){this['_aiChatHistoryUi']['setIsMaximized'](_0x15cfc2);}}class it extends _0x267838{static get['requires'](){return[yt,jt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ha extends _0x267838{static get['requires'](){return[tt,c,et,it];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x411cdd){super(_0x411cdd),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:_0x288adc,quickActionData:_0x18cf63}){await this['context']['plugins']['get'](tt)['sendMessage']({'message':_0x288adc,'quickActionData':_0x18cf63});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](tt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](tt)['focusPromptInput']();}}class co extends Nt{constructor(_0x4a099f){super(_0x4a099f);const _0x5cd217=_0x4a099f['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x5cd217,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x57daf6=this['editor']['plugins']['get']('AITabs')['view'];_0x57daf6['isVisible']=!_0x57daf6['isVisible'];}}class bt extends _0x3711b7{static get['requires'](){return[at];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1546de=this['editor'];_0x1546de['commands']['add']('toggleAi',new co(_0x1546de)),_0x1546de['ui']['componentFactory']['add']('toggleAi',()=>{const _0x864cb8=this['_createAIUIButton'](_0x5cde82);return _0x864cb8['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x864cb8;}),_0x1546de['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x317c79=this['_createAIUIButton'](_0x3c5e19);return _0x317c79['set']({'role':'menuitemcheckbox'}),_0x317c79;});}['_createAIUIButton'](_0x53f76a){const _0x231b7c=this['editor'],_0x197e39=_0x231b7c['commands']['get']('toggleAi'),_0x18cdb4=new _0x53f76a(_0x231b7c['locale']);return _0x18cdb4['set']({'label':C(_0x231b7c['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x3e2624,'isToggleable':!0x0}),_0x18cdb4['bind']('isEnabled')['to'](_0x197e39),_0x18cdb4['bind']('isOn')['to'](_0x197e39,'value',_0x5017b5=>!!_0x5017b5),this['listenTo'](_0x18cdb4,'execute',()=>{_0x197e39['execute']();}),_0x18cdb4;}}class Ma extends _0x3711b7{static get['requires'](){return[bt,Pt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Gt(_0x1ffa63,_0x853999,_0x10a54a=!0x1,_0x814475=!0x0,_0x1366a0=!0x0){return()=>{const _0x51c9a6=_0x1ffa63['locale'],_0x5abe18=new _0x5cde82(_0x51c9a6),_0x2fbe4c=_0x5abe18['bindTemplate'];_0x1366a0&&_0x5abe18['extendTemplate']({'on':{'mouseenter':_0x2fbe4c['to'](()=>{_0x5abe18['focus']();})}});const _0x3905b1=_0x853999['icon']??_0x853999['parent']?.['icon'];return _0x5abe18['set']({'label':_0x853999['displayedPrompt'],'withText':_0x10a54a,'role':'menuitem','icon':_0x814475?_0x3905b1??_0x2faead:void 0x0,'tooltip':!_0x10a54a,'class':'ck-ai-quick-actions-button'}),_0x5abe18['on']('execute',()=>{_0x1ffa63['editing']['view']['focus'](),_0x1ffa63['commands']['execute']('aiQuickAction',_0x853999);}),_0x5abe18;};}const Ls='menu',Ns='menuitem';class ao extends _0x10aa9f{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x493a0c,_0x208ab5,_0x35d6b4,_0x583a3f){const _0x58c9d9=_0x493a0c['locale'];super(_0x58c9d9),this['_bodyCollection']=_0x583a3f;const _0x1d340b=this['_createListItems'](_0x493a0c,_0x208ab5,_0x35d6b4);this['optionsListView']=new _0x4a219d(_0x58c9d9),this['optionsListView']['role']=Ls,this['optionsListView']['items']['addMany'](_0x1d340b),this['focusTracker']=new ts(),this['keystrokes']=new _0x4c12a2(),this['_focusables']=_0x1d340b,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':_0x58c9d9['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x452379,_0x5a1c0a,_0x96f0d3){const _0x5a5652=new _0x285700();return _0x5a1c0a['forEach'](_0x57f74a=>{'actions'in _0x57f74a?_0x5a5652['add'](this['_createActionGroupButton'](_0x452379,_0x57f74a,_0x96f0d3)):_0x5a5652['add'](this['_createActionButton'](_0x452379,_0x57f74a));}),_0x5a5652;}['_createActionButton'](_0x1ba6cf,_0x10222b){const _0x2ca564=new _0x2ced3c(this['locale']),_0x52a5be=Gt(_0x1ba6cf,_0x10222b,!0x0,void 0x0!==_0x10222b['icon'])();return _0x2ca564['children']['add'](_0x52a5be),_0x2ca564;}['_createActionGroupButton'](_0x33df64,_0x783201,_0x207dfe){const _0x46c7a9=new _0x2ced3c(this['locale']),_0x4a2501=new _0x15c9c1(this['locale']),_0x49b2bc=_0x4a2501['bindTemplate'],_0x5ed5d5='rtl'===_0x207dfe['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x545a5b=this['_createGroupActionsList'](_0x33df64,_0x783201['actions'],_0x207dfe);_0x4a2501['set']({'label':_0x783201['label'],'withText':!0x0,'role':Ns,'icon':_0x783201['icon']??_0x2faead}),_0x4a2501['extendTemplate']({'on':{'mouseenter':_0x49b2bc['to'](()=>{_0x4a2501['focus']();})}});const _0x45654c=new _0x179f18(this['locale']);return _0x45654c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x49b2bc['to'](_0x68c369=>{_0x68c369['key']==_0x5ed5d5&&(_0x4a2501['focus'](),this['_hideNestedPanel'](_0x45654c));})}}),_0x4a2501['bind']('isOn')['to'](_0x45654c,'isVisible'),this['_bodyCollection']['add'](_0x45654c),_0x45654c['content']['add'](_0x545a5b),this['_setupGroupMenuBehavior'](_0x4a2501,_0x45654c),_0x46c7a9['children']['add'](_0x4a2501),_0x46c7a9;}['_createGroupActionsList'](_0x4b727,_0x596330,_0x1f4a3e){const _0x5c9dd3=new _0x4a219d(this['locale']);return _0x5c9dd3['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x596330['forEach'](_0x40c5f5=>{const _0xf4cf3a=new _0x2ced3c(this['locale']),_0x5d3b1d=Gt(_0x4b727,_0x40c5f5,!0x0,!0x1)();_0xf4cf3a['children']['add'](_0x5d3b1d),_0x1f4a3e['focusTracker']['add'](_0x5d3b1d),_0x5c9dd3['items']['add'](_0xf4cf3a);}),_0x5c9dd3;}['_setupGroupMenuBehavior'](_0x4239ef,_0x1e7e69){const _0xe46e7d=_0x4239ef['bindTemplate'],_0x2900a4='rtl'===_0x4239ef['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x4239ef['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0xe46e7d['to'](()=>{this['_showNestedPanel'](_0x1e7e69,_0x4239ef);}),'mouseleave':_0xe46e7d['to'](_0x1f3e89=>{const _0x103e6d=_0x1f3e89['relatedTarget'];this['_isMovingToNestedMenu'](_0x103e6d,_0x1e7e69)||this['_hideNestedPanel'](_0x1e7e69);}),'keydown':_0xe46e7d['to'](_0x589e9b=>{_0x589e9b['key']==_0x2900a4&&(this['_showNestedPanel'](_0x1e7e69,_0x4239ef),_0x1e7e69['content']['get'](0x0)['focus']());})}}),_0x1e7e69['on']('render',()=>{_0x1e7e69['element']?.['addEventListener']('mouseleave',_0x1c9c63=>{const _0x501abd=_0x1c9c63['relatedTarget'];_0x4239ef['element']?.['contains'](_0x501abd)||this['_isMovingToNestedMenu'](_0x501abd,_0x1e7e69)||this['_hideNestedPanel'](_0x1e7e69);});});}['_showNestedPanel'](_0x2dad74,_0x37b5a3){this['_openNestedPanels']['forEach'](_0x48ab30=>{_0x48ab30!==_0x2dad74&&_0x48ab30['isVisible']&&_0x48ab30['hide']();}),_0x2dad74['show'](),_0x2dad74['pin']({'positions':[_0x426b9b['eastSouth']],'target':_0x37b5a3['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2dad74);}['_hideNestedPanel'](_0x1285ac){_0x1285ac['hide'](),this['_openNestedPanels']['delete'](_0x1285ac);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x483302=>_0x483302['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x4a0936,_0x3a5c27){if(!_0x4a0936)return!0x1;if(_0x3a5c27['element']?.['contains'](_0x4a0936))return!0x0;const _0x150389=_0x4a0936;return _0x150389['closest']&&(null!==_0x150389['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x150389['closest']('.ck-ai-quick-actions-group-list')||null!==_0x150389['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Yt(_0x28971e,_0x10bc34,_0x501047,_0x3bd3ba){return()=>{const _0x96a37b=_0x28971e['locale'],_0x25e199=_0x1fe5fd(_0x96a37b);_0x25e199['buttonView']['set']({'icon':_0x501047['icon']??_0x2faead,'label':_0x501047['label'],'tooltip':!0x0}),_0x25e199['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1f6615=new ao(_0x28971e,_0x10bc34,_0x25e199,_0x3bd3ba);return _0x25e199['panelView']['children']['add'](_0x1f6615),_0x25e199;};}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(_0x556daa){return _0x556daa['CHAT']='CHAT',_0x556daa['ACTION']='ACTION',_0x556daa['REVIEW']='REVIEW',_0x556daa;}({}),Ua=function(_0x32794f){return _0x32794f['CHAT']='AIChat',_0x32794f['ACTION']='AIActions',_0x32794f['REVIEW']='AIReviewMode',_0x32794f;}({});class ui extends _0x3711b7{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'](_0x12c762){return function(_0x420d1b){const _0x54b7f1=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x420d1b['uiLanguage']),_0x2e8141=_0x54b7f1||'English',_0x54eb7c=[{'id':'ask-ai','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Ut},{'id':'chat-commands','label':C(_0x420d1b,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Ut,'actions':[{'id':'explain','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ft['replace']('%0',_0x2e8141),'type':'CHAT'},{'id':'summarize','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Wt['replace']('%0',_0x2e8141),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Bt['replace']('%0',_0x2e8141),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Mt},{'id':'continue','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Kt},{'id':'fix-grammar','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Rt},{'id':'adjust-length','label':C(_0x420d1b,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':C(_0x420d1b,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':xt,'actions':[{'id':'make-tone-casual','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Dt,'actions':[{'id':'translate-to-english','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':C(_0x420d1b,'AI_QUICK_ACTIONS_OTHER'),'icon':Lt,'actions':[]}];return _0x54eb7c;}(_0x12c762);}['_getDefaultAndCustomActions'](){const _0x5de835=ui['getDefaultQuickActions'](this['editor']['locale']),_0x3c9487=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x283fb1=>({..._0x283fb1,'icon':void 0x0}));return _0x5de835['find'](_0x436327=>'other'===_0x436327['id'])['actions']['push'](..._0x3c9487),_0x5de835;}['_initializeQuickActionsComponentsAndCommands'](){const _0x31f7d2=new qt(this['editor']['locale']);_0x31f7d2['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x31f7d2),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x31f7d2);}['_initializeQuickActionsDropdown'](_0x368a79){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Yt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x2faead,'label':C(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x368a79));}['_prepareQuickActionsDefinition'](_0x78735d){this['_quickActionsDefinition']=_0x78735d['map'](_0x17cc48=>{if('actions'in _0x17cc48){const _0x13b7fb=_0x17cc48;return{..._0x13b7fb,'actions':_0x13b7fb['actions']['map'](_0x46a985=>{const {actions:_0x25a18c,..._0x1087d3}=_0x13b7fb;return{..._0x46a985,'parent':_0x1087d3};})['filter'](_0xe7091c=>this['_shouldIncludeAction'](_0xe7091c))};}return _0x17cc48;})['filter'](_0x2f025a=>'actions'in _0x2f025a?_0x2f025a['actions']['length']>0x0:this['_shouldIncludeAction'](_0x2f025a));}['_shouldIncludeAction'](_0x3ba6d0){const _0x12a511=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ua[_0x3ba6d0['type']])&&!_0x12a511['includes'](_0x3ba6d0['id']);}['_initializeQuickActionsComponents'](_0xca2993){this['_quickActionsDefinition']['forEach'](_0x2d9ef5=>{if('actions'in _0x2d9ef5){const _0x4f39ee=Yt(this['editor'],_0x2d9ef5['actions'],_0x2d9ef5,_0xca2993);this['editor']['ui']['componentFactory']['add'](_0x2d9ef5['id'],_0x4f39ee),_0x2d9ef5['actions']['forEach'](_0x263d48=>{const _0x51525d=Gt(this['editor'],_0x263d48);this['editor']['ui']['componentFactory']['add'](_0x263d48['id'],_0x51525d);});}else{const _0x14c09f=Gt(this['editor'],_0x2d9ef5,!0x1,!0x0,!0x1);this['editor']['ui']['componentFactory']['add'](_0x2d9ef5['id'],_0x14c09f);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3de64a=>{const _0x3c9980=new _0x2d240a(_0x3de64a),_0x4ca50c=C(_0x3de64a,'AI_QUICK_ACTIONS_HEADING');_0x3c9980['buttonView']['set']({'label':_0x4ca50c,'icon':_0x2faead});const _0xf4da5f=new ti(_0x3de64a);_0xf4da5f['set']({'ariaLabel':_0x4ca50c,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x250623=>{if('actions'in _0x250623){const _0x3e3180=_0x250623,_0x171649=new _0x29d062(_0x3de64a,_0x3c9980),_0x24bcca=new _0x2d240a(_0x3de64a),_0x3de0ad=new ti(_0x3de64a);_0x24bcca['buttonView']['set']({'label':_0x3e3180['label'],'icon':_0x3e3180['icon']}),_0x3e3180['actions']['forEach'](_0x59ac8d=>{const _0x57ffcb=new _0x29d062(_0x3de64a,_0x24bcca),_0x2e3ebf=new _0x3c5e19(_0x3de64a);_0x2e3ebf['set']({'label':_0x59ac8d['displayedPrompt'],'icon':_0x59ac8d['icon'],'role':'menuitem'}),_0x2e3ebf['on']('execute',()=>{this['_executeQuickAction'](_0x59ac8d);}),_0x2e3ebf['delegate']('execute')['to'](_0x24bcca),_0x57ffcb['children']['add'](_0x2e3ebf),_0x3de0ad['items']['add'](_0x57ffcb);}),_0x24bcca['panelView']['children']['add'](_0x3de0ad),_0x171649['children']['add'](_0x24bcca),_0xf4da5f['items']['add'](_0x171649);}else{const _0xe75328=_0x250623,_0x303eb9=new _0x29d062(_0x3de64a,_0x3c9980),_0x57b3d1=new _0x3c5e19(_0x3de64a);_0x57b3d1['set']({'label':_0xe75328['displayedPrompt'],'icon':_0xe75328['icon'],'role':'menuitem'}),_0x57b3d1['on']('execute',()=>{this['_executeQuickAction'](_0xe75328);}),_0x57b3d1['delegate']('execute')['to'](_0x3c9980),_0x303eb9['children']['add'](_0x57b3d1),_0xf4da5f['items']['add'](_0x303eb9);}});const _0x3229fb=Object['values'](Ua)['some'](_0x2df471=>this['editor']['plugins']['has'](_0x2df471));return _0x3c9980['set']({'isEnabled':_0x3229fb}),_0x3c9980['panelView']['children']['add'](_0xf4da5f),_0x3c9980;});}['_executeQuickAction'](_0x2d4809){const _0x6afb95=this['editor'];_0x6afb95['editing']['view']['focus'](),_0x6afb95['commands']['execute']('aiQuickAction',_0x2d4809);const _0x5c29ac=_0x6afb95['ui']['view']['menuBarView'];_0x5c29ac&&_0x5c29ac['close']&&_0x5c29ac['close']();}}class Ai extends Nt{['execute'](_0x5eeb00){switch(this['_expandSelectionIfCollapsed'](),_0x5eeb00['type']){case Ot['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5ebaa1=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x239292('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5ebaa1});}this['_handleAIChatAction'](_0x5eeb00);break;case Ot['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x303020=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x239292('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x303020});}this['_handleAIActionsAction'](_0x5eeb00);break;case Ot['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x1d1e89=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x239292('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1d1e89});}this['_handleAIReviewAction'](_0x5eeb00);}}async['_handleAIChatAction'](_0x2d7eb3){const _0x4da035=this['editor']['plugins']['get']('AIChat'),_0x378b2b=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x2d7eb3['id'])_0x378b2b['removeSelectionFromChatContext'](),await _0x4da035['addSelectionToChatContext'](),_0x4da035['focusPromptInput']();else await _0x4da035['startConversation'](),_0x378b2b['removeSelectionFromChatContext'](),await _0x4da035['addSelectionToChatContext'](),_0x4da035['focusPromptInput'](),await _0x4da035['sendMessage']({'message':_0x2d7eb3['prompt']||_0x2d7eb3['displayedPrompt'],'quickActionData':{'id':_0x2d7eb3['id'],'displayedPrompt':_0x2d7eb3['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x4b4cc9=this['editor'],_0x172520=_0x4b4cc9['model']['document']['selection'];if(!_0x172520['isCollapsed'])return;const _0x40da76=_0x457991(_0x172520['getSelectedBlocks']())||_0x4b4cc9['model']['schema']['getLimitElement'](_0x172520);_0x4b4cc9['model']['change'](_0x404319=>{_0x404319['setSelection'](_0x40da76,'in');});}['_handleAIActionsActionLabel'](_0x37975c){return _0x37975c['parent']?.['label']&&'other'!==_0x37975c['parent']?.['id']?_0x37975c['parent']['label']+':\x20'+_0x37975c['displayedPrompt']:_0x37975c['displayedPrompt'];}async['_handleAIActionsAction'](_0x5ead29){const _0x5b5ca1=this['editor']['plugins']['get']('AIActions'),_0x573629=_0x5ead29['prompt']?{'userMessage':_0x5ead29['prompt'],'model':_0x5ead29['model']}:{'actionName':_0x5ead29['actionName']||_0x5ead29['id'],'args':_0x5ead29['args']},_0x235dd8=this['_handleAIActionsActionLabel'](_0x5ead29);await _0x5b5ca1['executeAction'](_0x573629,_0x235dd8,_0x5ead29['icon']);}async['_handleAIReviewAction'](_0x56e9e8){console['log']('handleAIReviewAction',_0x56e9e8);}}class gi extends _0x3711b7{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x8c2439=this['editor'],_0x5bd7d8=new Ai(this['editor']);if(_0x8c2439['commands']['add']('aiQuickAction',_0x5bd7d8),_0x8c2439['plugins']['has']('AIChat')){const _0x513a59=this['editor']['plugins']['get']('AIChat');_0x8c2439['model']['document']['selection']['on']('change:range',(_0x4dcf99,_0x51e335)=>{_0x51e335['directChange']&&_0x513a59['removeSelectionFromChatContext']();});}}}class Zt extends de{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x11134c=this['documentContextContent']['children']['map'](_0x74246=>({'node':_0x74246,'id':pt(_0x74246,'data-id')})),_0x2c65f2=this['parsedMergedContent']['children']['map'](_0x34c5bf=>({'node':_0x34c5bf,'id':pt(_0x34c5bf,'data-id')||_0x5ef33e()})),_0x59cfbb=_0x271aee(_0x11134c,_0x2c65f2,{'comparator':(_0x583297,_0x56baae)=>_0x583297['id']==_0x56baae['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x59cfbb['length']&&_0x59cfbb[_0x59cfbb['length']-0x1]['removed'];)_0x59cfbb['pop']();}const _0x5dbb76=_0x59cfbb['map'](_0x30ad29=>{const _0x42066b=_0x30ad29['added']?'new':_0x30ad29['removed']?'removed':'modified';return{'node':_0x30ad29['value'][0x0]['node'],'type':_0x42066b,'id':_0x30ad29['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x5dbb76,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x3e6437,_0xc4f3b7){return _0xc4f3b7;}}class l extends Jt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x532045){super(_0x532045),this['content']=_0x532045['content'],this['version']=_0x532045['version'],this['actionName']=_0x532045['actionName'],this['args']=_0x532045['args'],this['userMessage']=_0x532045['userMessage'],this['model']=_0x532045['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'](_0x338a21){const _0x5d1464=new Zt({'editor':this['editor'],'documentContextContent':this['content'],..._0x338a21});return this['replies']['push'](_0x5d1464),_0x5d1464['delegate'](...Vt)['to'](this),this['fire']('replyCreated',_0x5d1464),_0x5d1464;}}class pi extends _0x3711b7{static get['requires'](){return[s,_0x161ed4,c,w,_0x4176c6];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x285700();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x3f3bb4){super(_0x3f3bb4),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x30464b,_0x14c3ad,_0x397f44){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x17d44c,anchorData:_0x5472ca}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x30464b,_0x17d44c,_0x5472ca,_0x14c3ad,_0x397f44);}}const {modelFragment:_0x58dd8b,anchorData:_0x3223f8}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x30464b,_0x58dd8b,_0x3223f8,_0x14c3ad,_0x397f44);}['_getExecuteDataRegular'](){const _0x2a8b6b=this['editor']['model']['document']['selection'];if(_0x2a8b6b['isCollapsed']){const _0x5031c3=_0x457991(_0x2a8b6b['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x2a8b6b);this['editor']['model']['change'](_0x284722=>{_0x284722['setSelection'](_0x5031c3,'in');});}const _0x17e50c=_0x2a8b6b['getFirstRange'](),_0xb55ee5=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x2a8b6b),_0x17e50c['start'],_0x17e50c['end']),_0x3de57c=_0x2a8b6b['getFirstRange']()['start'],_0x722635=new Map();let _0x1046bc=_0xb55ee5;for(let _0x219a95=0x0;_0x219a95<_0x3de57c['path']['length'];_0x219a95++)_0x722635['set'](_0x1046bc,_0x3de57c['path'][_0x219a95]),_0x1046bc=_0x1046bc['getChild'](0x0);return{'modelFragment':_0xb55ee5,'anchorData':_0x722635};}['_getExecuteDataInTable'](){const _0x3fc645=this['editor']['model']['document']['selection'],_0x3d4dad=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x58221c=_0x3fc645['getFirstRange']()['start']['parent']['parent'],_0x58d527=this['_wrapWithCommonAncestors'](_0x3d4dad,this['editor']['model']['createPositionBefore'](_0x58221c),this['editor']['model']['createPositionAfter'](_0x58221c)),_0x1b92e7=_0x3fc645['getFirstRange']()['start'],_0x25c8b5=new Map();let _0xe69388=_0x58d527;for(let _0x2e13db=0x0;_0x2e13db<_0x1b92e7['path']['length'];_0x2e13db++)if(_0x25c8b5['set'](_0xe69388,_0x1b92e7['path'][_0x2e13db]),_0x2e13db<_0x1b92e7['path']['length']-0x1)_0xe69388=_0xe69388['getChild'](0x0);else{let _0x1297d5=_0xe69388['nextSibling'];for(;_0x1297d5;)_0x25c8b5['set'](_0x1297d5,_0x1b92e7['path'][_0x2e13db]),_0x1297d5=_0x1297d5['nextSibling'];}return{'modelFragment':_0x58d527,'anchorData':_0x25c8b5};}['_executeAction'](_0x32f902,_0x16e218,_0x174bcc,_0x6fae68,_0x4c9320){const _0x591178=this['editor']['plugins']['get'](c),_0x59de43=this['editor']['plugins']['get'](w),_0xf33152=this['editor']['model']['document']['selection'],_0x3961dd=_0x591178['modelToViewWithIds'](_0x16e218),_0x4eca31=this['editor']['data']['processor']['toData'](_0x3961dd),_0x268d9a=this['editor']['model']['document']['version'],_0x24f03f=[..._0xf33152['getRanges']()];let _0x260401=this['editor']['config']['get']('ai.availableReplyActions')||[...k];this['editor']['plugins']['has']('TrackChanges')||(_0x260401=_0x260401['filter'](_0x313afd=>'insertSuggestion'!=_0x313afd));const _0x12b359=new e(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x260401});return _0x59de43['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x6fae68,'icon':_0x4c9320||_0x2faead,'mainView':_0x12b359,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x24f03f}),this['_setLoadingState'](_0x12b359,_0x59de43),this['listenTo'](_0x59de43,'applySuggestion',()=>{this['_applyChanges'](_0x16e218,_0x174bcc,!0x1);}),this['listenTo'](_0x59de43,'insertSuggestion',()=>{this['_applyChanges'](_0x16e218,_0x174bcc,!0x0);}),this['listenTo'](_0x59de43,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x59de43,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0xbeacf4=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0xefa5d8=_0xbeacf4['changeGroups'][0x0];_0xefa5d8&&'pending'===_0xefa5d8['state']&&_0xbeacf4['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x59de43);}),this['_createInteraction'](_0x4eca31,_0x268d9a,_0x12b359,_0x59de43,_0x32f902);}['_wrapWithCommonAncestors'](_0x4bfb12,_0xf7a229,_0x1aa301){const _0x45da50=this['editor']['model']['createRange'](_0xf7a229,_0x1aa301)['getCommonAncestor'](),_0x1f28f8=_0x45da50['is']('documentFragment')?[]:_0x45da50['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x1f28f8['length']){const _0x493d8a=_0x1f28f8['map'](_0x1ad998=>_0x1ad998['_clone'](!0x1));for(let _0x45a6c9=0x1;_0x45a6c9<_0x493d8a['length'];_0x45a6c9++)_0x493d8a[_0x45a6c9-0x1]['_appendChild'](_0x493d8a[_0x45a6c9]);return _0x493d8a[_0x493d8a['length']-0x1]['_appendChild'](_0x4bfb12),new _0x42c406(_0x493d8a[0x0]);}return _0x4bfb12;}async['_createInteraction'](_0x15f46f,_0x117263,_0x378ef7,_0x5448f9,_0x503c66){const _0x4ff012=this['editor'];this['_interactionParams']={'action':_0x503c66,'content':_0x15f46f,'version':_0x117263,'mainView':_0x378ef7,'aiBalloon':_0x5448f9};const _0x20558e=new l({'connector':this['_aiConnector'],'editor':_0x4ff012,'content':_0x15f46f,'version':_0x117263,..._0x503c66});this['_interactions']['push'](_0x20558e),_0x378ef7['hideError']();const _0x4cfd85=(_0x19cb22,_0x4ff408,_0x1d6617=!0x1,_0x213ab2='streaming')=>this['_promiseQueue']['enqueue'](async _0x1b3cd2=>{try{const _0x3efba9=y({'editor':_0x4ff012,'changeGroups':_0x19cb22['changeGroups'],'documentContextContent':_0x19cb22['documentContextContent'],'showDiff':_0x1d6617,'trimUnchanged':!0x1});await _0x4ff408['updateContent']({'parts':_0x3efba9,'renderingStrategy':_0x213ab2,'abortSignal':_0x1b3cd2});}catch(_0xf777d8){if(this['_isAbortError'](_0xf777d8))return;throw _0xf777d8;}});this['_interaction']['on']('replyCreated',(_0x7959f1,_0x206195)=>{_0x378ef7['hideLoader'](),_0x4cfd85(_0x206195,_0x378ef7)['catch'](_0x4cb6fc=>{this['_isAbortError'](_0x4cb6fc)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x4cb6fc),this['_setErrorState'](_0x20558e,_0x378ef7));});}),this['_interaction']['on']('replyContentUpdated',(_0x201e01,_0x567bff)=>{_0x4cfd85(_0x567bff,_0x378ef7)['catch'](_0x4fe549=>{this['_isAbortError'](_0x4fe549)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x4fe549),this['_setErrorState'](_0x20558e,_0x378ef7));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x378ef7,_0x5448f9),this['_updateNavigationUI']();}catch(_0x38a3fc){this['_isAbortError'](_0x38a3fc)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x38a3fc),this['_setErrorState'](_0x20558e,_0x378ef7));}}),this['listenTo'](_0x378ef7,'toggleSuggestionDisplayMode',(_0x22d23c,{showDiff:_0x20a6f4})=>{this['_balloonShowDiff']=_0x20a6f4;const _0x1428a3=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x1428a3&&_0x4cfd85(_0x1428a3,_0x378ef7,_0x20a6f4,'static')['catch'](_0x349903=>{this['_isAbortError'](_0x349903)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x349903),this['_setErrorState'](_0x20558e,_0x378ef7));});}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x1a612f,{reply:_0x5841d0})=>{const _0x1563c6={'positiveCount':_0x5841d0['changeGroups']['filter'](_0x51a575=>'accepted'===_0x51a575['state'])['length'],'totalCount':_0x5841d0['changeGroups']['length']},_0x74a1dd=this['_interaction']['actionCallId'],_0x44629f=this['_interaction']['actionName'];_0x44629f?this['_aiConnector']['upsertAIActionRating'](_0x44629f,_0x74a1dd,_0x1563c6):this['_aiConnector']['upsertCustomAIActionRating'](_0x74a1dd,_0x1563c6);}),this['_setLoadingState'](_0x378ef7,_0x5448f9);try{const _0xc1172f=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0xc1172f;}catch(_0x93bad7){if(this['_isAbortError'](_0x93bad7))return;_0x378ef7['hideLoader'](),this['_setErrorState'](_0x20558e,_0x378ef7);}}['_applyChanges'](_0x76303b,_0x27bb62,_0x414eaf){const _0x4f231=this['editor'];if(_0x414eaf&&!_0x4f231['plugins']['has']('TrackChanges'))throw new _0x239292('ai-no-track-changes',null);const _0x2fb54e=this['editor']['plugins']['get'](_0x4176c6),_0x18f531=this['_interaction'],_0x10acbe=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x3353ab=_0x10acbe['changeGroups'];_0x10acbe['setChangeGroupState'](0x0,'accepted');let _0x3d4812=v({'editor':_0x4f231,'reply':_0x10acbe,'interaction':_0x18f531,'groups':_0x3353ab,'transform':!0x1,'documentCompare':_0x2fb54e,'documentCompareOptions':{'anchor':_0x4f231['model']['createPositionAt'](_0x76303b,0x0),'markDeletions':_0x414eaf}});_0x3d4812=this['_filterOperationsOutsideRange'](_0x3d4812,_0x27bb62);for(const _0x27c767 of _0x3d4812)this['_anchorOperation'](_0x27bb62,_0x27c767,_0x4f231['model']['document']['getRoot']());const _0x4baff0=_0x18f531['getDocumentContext']()['version'],_0x1cd0ec=_0x4f231['model']['document']['history']['getOperations'](_0x4baff0),_0x713f44={'document':_0x4f231['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4286ae=_0x1c1e0c(_0x3d4812,_0x1cd0ec,_0x713f44)['operationsA'];_0x4f231['model']['change'](_0xb0db82=>{if(_0xb0db82['setSelection'](_0x4f231['model']['document']['selection']['focus']),_0x414eaf)_0x4f231['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4286ae);else{for(const _0x1c18c1 of _0x4286ae)_0x1c18c1['baseVersion']=_0x4f231['model']['document']['version'],b(_0x4f231,_0x1c18c1),_0xb0db82['batch']['addOperation'](_0x1c18c1),_0x4f231['model']['applyOperation'](_0x1c18c1);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x5a28e9,_0x359ac8){return _0x5a28e9['filter'](_0x34e434=>{if('rename'==_0x34e434['type']){const _0x1dcd26=_0x34e434['position']['nodeAfter'];return!_0x359ac8['has'](_0x1dcd26);}if(_0x34e434['type']['indexOf']('Attribute')>-0x1){const _0xdc0da3=_0x34e434['range']['start']['nodeAfter'];return!_0x359ac8['has'](_0xdc0da3);}return!0x0;});}['_anchorOperation'](_0x5def78,_0x516390,_0x233f50){const _0x35b27f=_0x516390['clone']();for(const _0x325ebb in _0x516390){const _0x5e00ab=_0x516390[_0x325ebb];_0x5e00ab instanceof _0x473568?_0x516390[_0x325ebb]=new _0x473568(_0x195538(_0x5e00ab['start']),_0x195538(_0x5e00ab['end'])):_0x5e00ab instanceof _0x2a6f0c&&(_0x516390[_0x325ebb]=_0x195538(_0x5e00ab));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x35b27f['type'])){if(_0x35b27f['isDocumentOperation']=!0x1,_0x35b27f['baseVersion']=null,'remove'==_0x35b27f['type']){const _0x126b30=_0x35b27f['sourcePosition'],_0x159edb=_0x35b27f['howMany'];new _0x207911(_0x126b30,_0x159edb)['_execute']();}else _0x35b27f['_execute']();}function _0x195538(_0x903258){if('$graveyard'==_0x903258['root']['rootName'])return _0x903258;const _0xd2becb=[];let _0x3b7b02=_0x903258['root'];for(let _0x213011=0x0;_0x213011<_0x903258['path']['length'];_0x213011++){const _0x373d0b=_0x5def78['get'](_0x3b7b02)||0x0;_0xd2becb[_0x213011]=_0x903258['path'][_0x213011]+_0x373d0b,_0x3b7b02=_0x3b7b02['getChildAtOffset'](_0x903258['path'][_0x213011]);}return new _0x2a6f0c(_0x233f50,_0xd2becb,_0x903258['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x10579e,content:_0x4a3401,version:_0xd07cde,mainView:_0xfe32e6,aiBalloon:_0x21526b}=this['_interactionParams'];_0xfe32e6['areChangesVisible']=!0x1,_0xfe32e6['hideError'](),this['_clearErrorState'](_0xfe32e6,_0x21526b);const _0x520a28=_0xfe32e6;_0x520a28['miniToolbarView']&&_0x520a28['miniToolbarView']['showChangesButton']&&_0x520a28['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x17eb0a}),this['_clearSuggestionContent'](_0xfe32e6),_0xfe32e6['showLoader'](),this['_updateNavigationUI'](),this['_createInteraction'](_0x4a3401,_0xd07cde,_0xfe32e6,_0x21526b,_0x10579e)['catch'](_0x1a3183=>{this['_isAbortError'](_0x1a3183)||console['error']('Error\x20refreshing\x20interaction:',_0x1a3183);});}['_clearSuggestionContent'](_0x40dc00){const _0x3eaff4=_0x40dc00['bodyView']['_children'];for(;_0x3eaff4['length']>0x0;)_0x3eaff4['remove'](_0x3eaff4['first']);_0x40dc00['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0xf4d960){return!!_0xf4d960['message']&&_0xf4d960['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 _0x429ae5=new _0x5cde82(this['editor']['locale']),_0xfb7a3f=new _0x5cde82(this['editor']['locale']),_0x117e6c=new _0x10aa9f(this['editor']['locale']),_0x4ecd67=new _0x5cde82(this['editor']['locale']);_0x429ae5['set']({'icon':_0x384b34,'label':C(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0xfb7a3f['set']({'icon':_0x52404d,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x117e6c['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x4ecd67['set']({'icon':_0x1524bc,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x429ae5['bind']('isEnabled')['to'](this,'isBusy',_0x5ee856=>!_0x5ee856),_0x429ae5['on']('execute',()=>{this['_refreshInteraction']();}),_0xfb7a3f['bind']('isEnabled')['to'](this,'isBusy',_0x2d00e6=>!_0x2d00e6),_0xfb7a3f['on']('execute',()=>{this['_navigateToPrevious']();}),_0x4ecd67['bind']('isEnabled')['to'](this,'isBusy',_0x45b11a=>!_0x45b11a),_0x4ecd67['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0xfb7a3f,this['_navigationCounter']=_0x117e6c,this['_navigationNextButton']=_0x4ecd67,this['_customViews']['add'](_0x429ae5);}['_navigateToPrevious'](){const _0x5de301=this['_interactions']['length'];this['_currentInteractionIndex']<_0x5de301-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x5e8fff){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x5e8fff;const {mainView:_0xf0d087}=this['_interactionParams'],_0x2af998=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x2af998)return;if(_0x2af998['hasError'])return this['_setErrorState'](_0x2af998,_0xf0d087),void this['_updateNavigationUI']();if(!_0x2af998['replies']['length'])return;_0xf0d087['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0xf0d087,this['_interactionParams']['aiBalloon']);const _0x1f504b=_0x2af998['replies'][_0x2af998['replies']['length']-0x1];if(_0x1f504b){const _0x9e7599=this['editor'];this['_clearSuggestionContent'](_0xf0d087);try{const _0x204781=y({'editor':_0x9e7599,'changeGroups':_0x1f504b['changeGroups'],'documentContextContent':_0x1f504b['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0xf0d087),await new Promise(_0x293ca7=>setTimeout(_0x293ca7,0x32)),await _0xf0d087['updateContent']({'parts':_0x204781,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x2c2676){this['_isAbortError'](_0x2c2676)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x2c2676);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x470fbb=this['_interactions']['length'],_0x1ce1fb=_0x470fbb>0x1,_0x30fc88=this['_interactionParams']?.['mainView'];if(_0x1ce1fb){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x30fc88?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x30fc88?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x30fc88?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x34d2a0=_0x470fbb-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x34d2a0+'/'+_0x470fbb),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x470fbb-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x30fc88?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x30fc88?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x30fc88?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x1bdf4a,_0x2d0094){_0x1bdf4a['setLoading'](),_0x2d0094['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0xc0d332,_0xffb7c5){const _0x41a506=C(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0xffb7c5['showError'](_0x41a506),_0xc0d332['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0xffb7c5['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0xbb8e42,_0x1bfd70){_0xbb8e42['clearErrorState'](),_0x1bfd70['balloonView']['toolbar']&&(_0x1bfd70['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x2e0c21,_0xf9712d){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x2e0c21['clearLoading'](),_0xf9712d['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0xd42d38=>{'isEnabled'in _0xd42d38&&(_0xd42d38['isEnabled']=!0x1);});}}class Va extends _0x3711b7{static get['requires'](){return[ui,gi,pi];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4eabf2){super(_0x4eabf2),_0x4eabf2['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class $s{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x3b1cf0,title:_0x44646d,description:_0x279d3d,isParameterized:_0x2eb709,useArgs:_0xf553d5,options:_0x5bd57c}){this['id']=_0x3b1cf0,this['title']=_0x44646d,this['description']=_0x279d3d,this['isParameterized']=_0x2eb709,this['useArgs']=_0xf553d5,this['options']=_0x5bd57c;}}class kr extends $s{['_models']=[];get['models'](){return this['_models'];}set['models'](_0xb190cc){this['_models']=_0xb190cc;}}class wi extends _0x314197(){['_checks'];constructor(_0x1c23f1){super(),this['_checks']=this['_mapCheckDefinitions'](_0x1c23f1);}get['checks'](){return this['_checks'];}['getCheckById'](_0x4b8d76){return this['checks']['find'](_0x1b7904=>_0x1b7904['id']===_0x4b8d76);}['_mapCheckDefinitions'](_0x479968){return _0x479968['map'](_0x4a973a=>'custom'===_0x4a973a['id']?new kr(_0x4a973a):new $s(_0x4a973a));}}class th extends _0x7d5e47(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x3586b0,contentNew:_0x50df98,contentInitial:_0x165442,documentVersion:_0x15e345}){super(),this['id']=_0x3586b0,this['contentNew']=_0x50df98,this['contentInitial']=_0x165442,this['documentVersion']=_0x15e345;}}class eh extends _0x314197(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x24ae69,_0xd5a1c3,_0x24c73d){super(),this['id']=_0x24ae69,this['parent']=_0x24c73d,this['_data']=_0xd5a1c3,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 Rr extends _0x314197(){['id']=_0x5ef33e();['callId'];['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x57fe36,_0x143bd4,_0x33dd21,_0x589152,_0x8a8817){super(),this['_documentData']=_0x57fe36,this['_sourceCheck']=_0x143bd4,this['_aiConnector']=_0x33dd21,this['_reviewParams']=_0x589152,this['_reviewArgs']=_0x8a8817,this['on']('change:status',(_0x10247e,_0x159675,_0x1ddf84)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x1ddf84,'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'](_0xe2526b=>'pending'===_0xe2526b['status']);}get['currentError'](){return this['_currentError'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4c7f30=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x267d31 of _0x4c7f30)'unmodified'!==_0x267d31['data']['operation']&&('error'!==_0x267d31['data']['operation']?'review-metadata'!==_0x267d31['event']?this['_addReviewCheckResult'](_0x267d31['data']['dataId'],_0x267d31['data']['textDelta']):this['callId']=_0x267d31['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x1e7cfd){this['_currentError']=_0x1e7cfd,_0x1e7cfd instanceof Error&&_0x1e7cfd['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'](_0x2aa6a7,_0x5f1a22){const _0x274a97=this['_results']['get'](_0x2aa6a7);if(!_0x274a97)return;const _0x50f2e9=[];_0x5f1a22['forEach']((_0x211ceb,_0x3213c3)=>{const _0x1bb92b=new eh(_0x274a97['id']+'-'+_0x3213c3,_0x211ceb,_0x274a97);_0x1bb92b['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x1bb92b,'status':_0x1bb92b['status']});}),_0x1bb92b['on']('change:isActivated',()=>{_0x1bb92b['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1bb92b}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1bb92b});}),this['_changes']['push'](_0x1bb92b),_0x50f2e9['push'](_0x1bb92b);}),this['fire']('reviewCheckResultReady',{'changes':_0x50f2e9,'result':_0x274a97,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x28ab0d){const _0x4c08f4=this['_changes']['find'](_0x1e95c3=>_0x1e95c3['id']===_0x28ab0d);return!(!_0x4c08f4||'pending'!==_0x4c08f4['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x4b9c1c=>'pending'===_0x4b9c1c['status']);}['markAllChangesAsAccepted'](){for(const _0x226ecc of this['_changes'])'pending'===_0x226ecc['status']&&(_0x226ecc['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x3ae756){const _0x24381d=this['_changes']['find'](_0x507548=>_0x507548['id']===_0x3ae756);_0x24381d&&'pending'===_0x24381d['status']&&(_0x24381d['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1409eb){const _0x1684b9=this['_changes']['find'](_0x13eacd=>_0x13eacd['id']===_0x1409eb);_0x1684b9&&'pending'===_0x1684b9['status']&&(_0x1684b9['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x2488eb){const _0x1fecc0=this['_changes']['find'](_0x425c2f=>_0x425c2f['id']===_0x2488eb);_0x1fecc0&&'pending'===_0x1fecc0['status']&&(_0x1fecc0['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x111743){const _0x2321cf=this['_changes']['find'](_0x52687e=>_0x52687e['id']===_0x111743);_0x2321cf&&'outdated'===_0x2321cf['status']&&(_0x2321cf['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x16e789){this['_changes']['filter'](_0x119e08=>_0x119e08['isActivated']&&_0x119e08['id']!==_0x16e789)['forEach'](_0x2e9b5f=>{_0x2e9b5f['isActivated']=!0x1;});const _0x2b466a=this['_changes']['find'](_0x323e39=>_0x323e39['id']===_0x16e789);_0x2b466a&&'pending'===_0x2b466a['status']&&(_0x2b466a['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0xe858e7=>_0xe858e7['isActivated'])['forEach'](_0x68b750=>{_0x68b750['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x38e325){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x5b9cb4;if(_0x38e325){const _0x13bde4=this['_changes']['find'](_0x3ecd3d=>_0x3ecd3d['id']===_0x38e325);if(_0x13bde4&&_0x13bde4['isRated'])return;_0x13bde4&&(_0x5b9cb4=_0x13bde4['parent']['id'],_0x13bde4['isRated']=!0x0);}const _0x4da724={'positiveCount':this['_changes']['filter'](_0x58ceb6=>'accepted'===_0x58ceb6['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x4da724,this['callId'],_0x5b9cb4);}['_addReviewCheckResult'](_0x2bda5a,_0x2e6e56){const _0x12edbc=this['_documentData']['elements']['get'](_0x2bda5a);if(!_0x12edbc)return;const _0x5bac4e=_0x12edbc['getContent']();if(_0x5bac4e===_0x2e6e56)return;const _0x26d771=new th({'id':_0x2bda5a,'contentInitial':_0x5bac4e,'contentNew':_0x2e6e56,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x26d771['id'],_0x26d771),this['fire']('reviewCheckResultAdded',{'result':_0x26d771,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x2e0e1d=>'pending'===_0x2e0e1d['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x1eaf40=>'pending'===_0x1eaf40['status'])['length']&&(this['status']='finished'));}}class vi extends Rr{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x45f818=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x28a7a4=0x0;_0x28a7a4<this['_reviewParams']['length'];_0x28a7a4++){if(!this['_reviewParams'][_0x28a7a4]||!this['_sourceCheck']['options'][_0x28a7a4])continue;const _0x507569=this['_sourceCheck']['options'][_0x28a7a4],_0x3359d9=_0x507569['data']?.['find'](_0x2b29d3=>_0x2b29d3['id']===this['_reviewParams'][_0x28a7a4]);_0x3359d9&&_0x45f818['push'](_0x3359d9['label']);}return _0x45f818['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x287b4a,_0x4a6bed,_0x10284b){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x4a6bed,_0x287b4a,_0x10284b);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class fi extends Rr{['_prompt'];['_model'];constructor(_0x342320,_0x45b08a,_0x2b9d10,_0x504c98,_0x3edbf1){super(_0x2b9d10,_0x504c98,_0x3edbf1),this['_prompt']=_0x342320,this['_model']=_0x45b08a;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x38d992,_0xbe6295,_0x49947f){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xbe6295,_0x38d992,_0x49947f);}}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 _0x267838{['_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 _0xfb890b=this['context']['config']['get']('ai.reviewMode.translations');if(_0xfb890b){for(const _0x490a61 of Ri)'translate'===_0x490a61['id']&&(_0x490a61['options'][0x0]['data']=_0xfb890b);}const _0x2adbbf=this['_translateReviewChecks'](Ri);this['_aiReviewCheckList']=new wi(_0x2adbbf);const _0x24b182=this['_aiReviewCheckList']['checks']['find'](_0x548579=>'custom'===_0x548579['id']);if(_0x24b182){const _0x3ea23f=await new ki({'connector':this['_aiConnector']})['getAll']();_0x24b182['models']=_0x3ea23f['map'](_0x599f01=>({..._0x599f01,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x599f01['id']['toUpperCase'](),_0x599f01['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x3e09a3,_0x31feaf)=>{const _0x2f1616=this['_aiReviewCheckList']['getCheckById'](_0x31feaf['id']);if(_0x2f1616){this['_onDiffChange'](this['_isDiffOn']),_0x31feaf['isCustom']?this['_currentReviewCheckRun']=new fi(_0x31feaf['args']['prompt'],_0x31feaf['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x2f1616,this['_aiConnector']):this['_currentReviewCheckRun']=new vi(this['_aiReviewModeEditing']['getDocumentData'](),_0x2f1616,this['_aiConnector'],_0x31feaf['params'],_0x31feaf['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x384e22,_0x1a37d0)=>{'data'===_0x1a37d0['status']||'loading'===_0x1a37d0['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x1a37d0)):'finished'===_0x1a37d0['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x1a37d0['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x1a37d0['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x1a37d0['status']?(this['_aiReviewModeUi']['showGeneralErrorView'](),this['_logError'](new _0x239292('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x1a37d0['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x239292('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x1a37d0['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x1a37d0['status']&&'error-chunk'!==_0x1a37d0['status']&&'error-general'!==_0x1a37d0['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x6afd42,_0xa58feb)=>{if(!this['_currentReviewCheckRun'])throw new _0x239292('ai-review-mode-no-current-check-run',this);const _0x4d4c3=this['_aiReviewModeEditing']['diffContent'](_0xa58feb['result']['contentInitial'],_0xa58feb['result']['contentNew']);_0xa58feb['source']['addResultChanges'](_0xa58feb['result']['id'],_0x4d4c3);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x318e78,_0x5274d9)=>{for(const _0x50fafb of _0x5274d9['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x50fafb);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x5274d9['changes'],_0x5274d9['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x163994,_0xbcad8e)=>{this['_aiReviewModeUi']['updateChangeState'](_0xbcad8e['change']['id'],_0xbcad8e['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x2e0001,_0x26d714)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x26d714['change']['id']);const _0x2acc34=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x26d714['change']['id']);if(_0x2acc34){if('content'===this['_changeActivationSource']){const _0x50ebe4=this['_aiReviewModeUi']['getChangeElement'](_0x26d714['change']['id']);_0x50ebe4&&_0x9d44c8(_0x50ebe4['closest']('.ck-ai-review-mode__check-run-result')||_0x50ebe4);}else{if('panel'===this['_changeActivationSource']){const _0x28fab4={'target':_0x2acc34['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x10737b(_0x28fab4);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x26d714['change'],_0x2acc34['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x2c190a){_0x2c190a instanceof Error&&_0x2c190a['message']['includes']('ai-request-aborted')||(_0x2c190a instanceof _0x239292?this['_logError'](_0x2c190a):this['_logError'](new _0x239292('ai-review-mode-check-run-failed',this,{'error':_0x2c190a})));}}else this['_logError'](new _0x239292('ai-review-mode-source-check-not-found',this,{'checkId':_0x31feaf['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 _0x566f37=this['_currentReviewCheckRun']['getActiveChanges']();_0x566f37['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x566f37['map'](_0x499dd4=>_0x499dd4['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x4326b4,_0x4d694e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4d694e['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x4d694e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4d694e['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4d694e['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x25f283,_0x54d377)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x54d377['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x54d377['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x54d377['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x54d377['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x3be61b,_0x2313d2)=>{this['_isDiffOn']=_0x2313d2['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x2bd544,_0x5c2269)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5c2269['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x276ed5,_0x201bee)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x201bee['changeId']));}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x39f7a2,_0x54fa6c)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x54fa6c['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x264583,_0x453bae)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x453bae['changeId']);});}['_onReviewModeRunLeave'](_0x49cd4e=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x49cd4e&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x2179ab=this['_aiReviewModeEditing']['getEditor']();_0x2179ab&&_0x2179ab['editing']['view']['change'](_0x597ae0=>{const _0x25875=_0x2179ab['editing']['view']['document']['getRoot']();_0x597ae0['removeClass']('ck-ai-review-mode-diff',_0x25875),_0x597ae0['removeClass']('ck-ai-review-mode-highlights',_0x25875);});}['_onDiffChange'](_0xe67161){const _0x26c33b=this['_aiReviewModeEditing']['getEditor']();_0xe67161?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x26c33b&&_0x26c33b['editing']['view']['change'](_0x724a0a=>{const _0x5043de=_0x26c33b['editing']['view']['document']['getRoot']();_0x724a0a['removeClass']('ck-ai-review-mode-diff',_0x5043de),_0x724a0a['removeClass']('ck-ai-review-mode-highlights',_0x5043de),_0x724a0a['addClass'](_0xe67161?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x5043de);});}['_translateReviewChecks'](_0x4521e0){return _0x4521e0['map'](_0x461faf=>{const _0x4699e6='AI_REVIEW_CHECK_'+_0x461faf['id']['toUpperCase']()['replaceAll']('-','_'),_0x4de1f1={..._0x461faf,'title':this['_getTranslationWithDefault'](_0x4699e6+'_TITLE',_0x461faf['title']),'description':this['_getTranslationWithDefault'](_0x4699e6+'_DESCRIPTION',_0x461faf['description'])};return _0x461faf['options']&&(_0x4de1f1['options']=_0x461faf['options']['map'](_0xe55779=>({..._0xe55779,'label':this['_getTranslationWithDefault'](_0x4699e6+'_OPTIONS_LABEL',_0xe55779['label']||''),'data':_0xe55779['data']?_0xe55779['data']['map'](_0x291ea0=>({..._0x291ea0,'label':this['_getTranslationWithDefault'](_0x4699e6+'_OPTIONS_DATA_'+_0x291ea0['id']['toUpperCase'](),_0x291ea0['label'])})):void 0x0}))),_0x4de1f1;});}['_getTranslationWithDefault'](_0x10361c,_0x513af0){const _0x37fbdf=C(this['context']['locale'],_0x10361c);return _0x37fbdf===_0x10361c?_0x513af0:_0x37fbdf;}['_logError'](_0x3f1cd1){ot(_0x3f1cd1['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x10aa9f{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x3f0fc8,_0x2ea0af){super(_0x3f0fc8),this['_defaultValue']=_0x2ea0af['default']||(_0x2ea0af['data']['length']>0x0?_0x2ea0af['data'][0x0]['id']:''),this['_defaultLabel']=_0x2ea0af['data']['find'](_0x21d39b=>_0x21d39b['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x1fe5fd(this['locale']);const _0xf0e6cd=this['_prepareListOptions'](_0x2ea0af['data']);_0x43d564(this['_dropdownView'],_0xf0e6cd,{'role':'menu','ariaLabel':_0x2ea0af['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x402d60=>{_0x402d60['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x436731=>{this['formValue']=_0x436731['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x436731['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'](_0x3ef0b9=[]){const _0x422e16=new _0x4c3887();this['resetToDefault']();for(const _0x3ae0ee of _0x3ef0b9){const _0x719d62=new _0x238f2a({'label':_0x3ae0ee['label'],'withText':!0x0,'role':'menuitemradio','id':_0x3ae0ee['id'],'model':_0x3ae0ee});_0x719d62['bind']('isOn')['to'](this,'formValue',_0x1a64a9=>_0x1a64a9===_0x719d62['id']);const _0x3f4bbc={'type':'button','model':_0x719d62};_0x422e16['add'](_0x3f4bbc);}return _0x422e16;}}class Ks extends _0x2ced3c{['_formItem']=null;constructor(_0x566c03,_0x5296ac,_0x1a536b){super(_0x566c03),this['argsKey']=_0x5296ac?.['argsKey'];if('dropdown'===_0x5296ac['formType'])this['_formItem']=new Mr(this['locale'],_0x5296ac);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x1dad38=new _0x4f6c96(this['locale'],{'children':[this['_formItem']],'class':[_0x1a536b?'ck-form__row_with-submit':'']});_0x1a536b&&_0x1dad38['children']['add'](_0x1a536b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x1dad38]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Ps extends _0x317754{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x4ac6c3){super(_0x4ac6c3),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x4c12a2(),this['minRows']=Ps['MIN_ROWS'],this['maxRows']=Ps['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 Qs extends _0x10aa9f{['focusTracker']=new ts();['keystrokes']=new _0x4c12a2();['focusCycler'];['_focusables']=new _0x285700();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0xfc5e5a,_0x13aabc){super(_0xfc5e5a),this['_check']=_0x13aabc,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x13aabc['models']&&_0x13aabc['models']['length']>0x0?_0x13aabc['models'][0x0]['id']:'',this['_defaultLabel']=_0x13aabc['models']&&_0x13aabc['models']['length']>0x0?_0x13aabc['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x2acda0(this['locale'],()=>new Ps(_0xfc5e5a)),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 _0x4c3887(),this['_setModelList'](),_0x43d564(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 _0x4f6c96(this['locale'],{'children':[this['promptInputView']]}),new _0x4f6c96(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x3fc6de,_0x31f055)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x31f055()):_0x31f055();}),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'](_0x6c08b8=>{this['_focusables']['add'](_0x6c08b8),this['focusTracker']['add'](_0x6c08b8['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 _0x33cee5 of this['_getFormValidators']()){const _0x410d93=_0x33cee5();if(_0x410d93)return this['promptInputView']['errorText']=_0x410d93,!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 _0xcd3a88=new _0x5cde82(this['locale']),t=this['locale']['t'];return _0xcd3a88['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0xcd3a88['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xcd3a88;}['_createCancelButtonView'](){const _0x5bef64=new _0x5cde82(this['locale']),t=this['locale']['t'];return _0x5bef64['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x5bef64['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x50f85f=>{_0x50f85f['stopPropagation']();})}}),_0x5bef64['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x5bef64;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x5ea483=this['_check']['models'];if(this['resetToDefault'](),_0x5ea483?.['length']){const _0x4fc7e0=ki['getLocalized'](this['locale'],_0x5ea483);for(const _0x3f9806 of _0x4fc7e0){const _0xc7a6e0=new _0x238f2a({'label':_0x3f9806['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3f9806['id'],'model':_0x3f9806});_0xc7a6e0['bind']('isOn')['to'](this,'modelId',_0x48b850=>_0x48b850===_0x3f9806['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xc7a6e0,'labelView':new Fs(this['locale'],_0x3f9806)});}}}['_createModelSelectionDropdown'](){const _0x2a9036=_0x1fe5fd(this['locale']);return _0x2a9036['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x2a9036['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x2a9036,'execute',_0x216f1e=>{this['modelId']=_0x216f1e['source']['model']['id'],_0x2a9036['buttonView']['label']=_0x216f1e['source']['label'];}),_0x2a9036;}['_createActionsFooterView'](){const _0x43396e=new _0x10aa9f(this['locale']);return _0x43396e['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']]}]}),_0x43396e;}}class Fs extends _0x342201{constructor(_0x52cf92,_0x46e31e){super();const _0x1d244f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1d244f['to']('style'),'id':_0x1d244f['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1d244f['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x46e31e['description']||'']}]}]});}}class zs extends _0x2ced3c{['_formItemsCollection']=new _0x285700();['_customCheckView']=null;constructor(_0x4faa3b,_0x3244c0,_0x30654d){super(_0x4faa3b),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x3244c0['isParameterized']);const _0x1b23b1=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',_0x9055c5=>_0x9055c5),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x4378d7=>_0x4378d7)],'style':{'--ck-ai-review-check-list-item-index':_0x30654d}},'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':_0x3244c0['title']}]},_0x1b23b1]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x3244c0['description']}]}]}]},..._0x3244c0['isParameterized']?[this['_createParameterizedView'](_0x3244c0)]:[],...'custom'===_0x3244c0['id']?[this['_createCustomView'](_0x3244c0)]:[]]}),this['on']('click',()=>{_0x3244c0['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x3244c0['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x2cf367({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x4278e4=>{_0x4278e4['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x329747=new _0x3dad93();return _0x329747['content']=_0x5a11af,_0x329747['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x329747;}['_createParameterizedView'](_0x463925){const _0xb8f39f=new _0x10aa9f(),_0x1de65e=this['_createFormView'](_0x463925);return _0xb8f39f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x1b6437=>!_0x1b6437)]},'children':[_0x1de65e]}),_0xb8f39f;}['_createFormView'](_0x3cacb8){const _0x22ab10=new _0x10aa9f(),_0x5e885c=Array['isArray'](_0x3cacb8['options'])?_0x3cacb8['options']:[],_0x58ae7e=new _0x5cde82(this['locale']),t=this['locale']['t'];_0x58ae7e['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x58ae7e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5d9b39=>{_0x5d9b39['stopPropagation']();})}}),_0x58ae7e['on']('execute',()=>{const _0x5d4b79=[],_0x13283b={};this['_formItemsCollection']['forEach'](_0x270082=>{_0x5d4b79['push'](_0x270082['value']),_0x3cacb8['useArgs']&&_0x3cacb8['options']&&(_0x13283b[_0x270082['argsKey']]=_0x270082['value']);}),this['fire']('runReviewCheck',{'id':_0x3cacb8['id'],'params':_0x5d4b79['length']?_0x5d4b79:void 0x0,'args':Object['keys'](_0x13283b)['length']?_0x13283b:void 0x0});});const _0x27c604=_0x5e885c['length'];return _0x5e885c['forEach']((_0x142705,_0x4ad199)=>{const _0x5ca587=_0x4ad199===_0x27c604-0x1;this['_formItemsCollection']['add'](new Ks(this['locale'],_0x142705,_0x5ca587?_0x58ae7e:null));}),_0x22ab10['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x22ab10;}['_createCustomView'](_0x3317a8){return this['_customCheckView']=new Qs(this['locale'],_0x3317a8),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',_0x52566b=>!_0x52566b)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x22e0a9,_0x5aad3a,_0xaa8439)=>{_0xaa8439||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class Us extends _0x2ced3c{['_checkViews'];constructor(_0x22395d){super(_0x22395d),this['_checkViews']=new _0x285700();const _0x446066=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x446066['if']('isVisible','ck-hidden',_0x383a07=>!_0x383a07)]},'children':this['_checkViews']});}['setChecks'](_0x5f31a4){this['_checkViews']['clear']();for(const [_0xcba06,_0x1a87bc]of _0x5f31a4['entries']()){const _0x26b856=new zs(this['locale'],_0x1a87bc,_0xcba06);_0x26b856['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x26b856);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x4d9f95 of this['_checkViews'])_0x4d9f95 instanceof zs&&_0x4d9f95['resetToDefault']();}}class Bs extends _0x10aa9f{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0xaccc97,_0x176c93){super(_0xaccc97),this['id']=_0x176c93,this['set']('status','pending'),this['set']('changeId',_0x176c93),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':_0x176c93,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4095c0=new _0x10aa9f(this['locale']);return _0x4095c0['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',_0x360ed3=>!_0x360ed3)]}}),_0x4095c0;}['_createAcceptButtonView'](){const _0x49dfdd=new _0x5cde82(this['locale']);return _0x49dfdd['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x49dfdd['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x33bae6=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x33bae6['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x4ded83=>'pending'!==_0x4ded83)]}}),_0x49dfdd;}['_createDismissButtonView'](){const _0x401afb=new _0x5cde82(this['locale']);return _0x401afb['set']({'label':C(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x401afb['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x125b46=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x125b46['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x2a89d6=>'pending'!==_0x2a89d6)]}}),_0x401afb;}['_createInfoButtonView'](){const _0x2e0b0d=new _0x5cde82(this['locale']);return _0x2e0b0d['set']({'label':C(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x4ae3dc,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x2e0b0d['bind']('isOn')['to'](this,'isInfoToggleOn',_0x4b7e64=>_0x4b7e64),_0x2e0b0d['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x2e0b0d;}['_createStatusButtonView'](){const _0x4f5965=new _0x5cde82(this['locale']);return _0x4f5965['set']({'withText':!0x0,'isEnabled':!0x1}),_0x4f5965['bind']('label')['to'](this,'status',_0x2b2873=>C(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x2b2873['toUpperCase']())),_0x4f5965['bind']('icon')['to'](this,'status',_0x2fea9b=>'ACCEPTED'===_0x2fea9b['toUpperCase']()?_0x47bafa:'REJECTED'===_0x2fea9b['toUpperCase']()?_0x27c5a9:_0x44d7c8),_0x4f5965['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x313a17=>'pending'===_0x313a17)],'disabled':'disabled'}}),_0x4f5965;}}class Gs extends _0x5cde82{constructor(_0x247996){super(_0x247996),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 Ys extends _0x2ced3c{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x17e9a7){super(_0x17e9a7),this['_resultViews']=new _0x285700(),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(_0x17e9a7),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 _0x249f0d=this['_createCombinedSkeletonLoader'](),_0x1cb2a8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x1cb2a8['if']('isVisible','ck-hidden',_0x12d6f4=>!_0x12d6f4)]},'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',_0x2c0ff6=>_0x2c0ff6)]},'children':this['_resultViews']},_0x249f0d]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x59c823){const _0x1807c1=new Bs(this['locale'],_0x59c823['id']);_0x1807c1['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x1807c1),_0x1807c1['resultResponseView']['element']['innerHTML']=_0x59c823['contentDiffed'];}['hideResult'](_0x30168a,_0x37a5ca){if('pending'===_0x37a5ca)return;const _0x3e3edb=this['_resultViews']['find'](_0x507e86=>_0x507e86['id']===_0x30168a);_0x3e3edb&&(_0x3e3edb['status']=_0x37a5ca,_0x3e3edb['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x31aadb,_0x5bc515){if('pending'!==_0x5bc515)return;const _0x9bc2cc=this['_resultViews']['find'](_0x31bd65=>_0x31bd65['id']===_0x31aadb);_0x9bc2cc&&(_0x9bc2cc['status']=_0x5bc515,_0x9bc2cc['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x25e483,_0x1c6641){this['headerTitle']=_0x25e483,this['headerSubtitle']=_0x1c6641||'';}['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 _0x58f5c2=new _0x10aa9f(this['locale']),_0x4fbbb3=[];for(let _0x45a66a=0x0;_0x45a66a<0x10;_0x45a66a++){const _0x38894d=this['_createSkeletonLoader']();_0x38894d['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x4fbbb3['push'](_0x38894d);}return _0x58f5c2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x4e549d=>!_0x4e549d)]},'children':_0x4fbbb3}),_0x58f5c2;}['_createErrorView'](){const _0x234953=new _0x10aa9f(this['locale']),_0x25bdc7=new _0x5cde82(this['locale']),t=this['locale']['t'];return _0x234953['delegate']('retryReview')['to'](this),_0x25bdc7['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x25bdc7['on']('execute',()=>{this['fire']('retryReview');}),_0x234953['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x34f5eb=>!_0x34f5eb),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x2ec8ba=>'chunk'===_0x2ec8ba)]},'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',_0x51fbaa=>'chunk'===_0x51fbaa)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x12665e=>'general'!==_0x12665e)]},'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',_0x3ee397=>'chunk'!==_0x3ee397)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x25bdc7]}),_0x234953;}['_createCancelButtonView'](){const _0x113fdc=new _0x5cde82(this['locale']);return _0x113fdc['set']({'label':C(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x2b48d9}),_0x113fdc['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2dbcc1=>_0x2dbcc1),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x398120=>_0x398120)]}}),_0x113fdc['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x113fdc;}['_createToggleDiffButtonView'](){const _0x4415e6=new _0x5cde82(this['locale']);_0x4415e6['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4415e6['bind']('isEnabled')['to'](this,'isError',_0x46a6d8=>!_0x46a6d8),_0x4415e6['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5bd1a2=>!_0x5bd1a2),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x335296=>_0x335296)]}});const _0x41be2d=C(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x2d3347=C(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4415e6['bind']('isOn')['to'](this,'isToggleDiffOn',_0x36ac2f=>_0x36ac2f),_0x4415e6['bind']('icon')['to'](this,'isToggleDiffOn',_0x308541=>_0x308541?_0x554163:_0x320f3e),_0x4415e6['bind']('label')['to'](this,'isToggleDiffOn',_0x1c7f97=>_0x1c7f97?_0x41be2d:_0x2d3347),_0x4415e6['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4415e6;}['_createAcceptAllButtonView'](){const _0x477bb3=new _0x5cde82(this['locale']);return _0x477bb3['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x477bb3['bind']('isEnabled')['to'](this,'isError',_0x31720b=>!_0x31720b),_0x477bb3['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x56bf81=>!_0x56bf81),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x46136a=>_0x46136a)]}}),_0x477bb3['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x477bb3;}['_createExitReviewButtonView'](){const _0x579dc2=new _0x5cde82(this['locale']);return _0x579dc2['set']({'label':C(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x579dc2['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x567f1a=>!_0x567f1a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3d9a1d=>_0x3d9a1d)]}}),_0x579dc2['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x579dc2;}['_createResultHeaderView'](){const _0x584f86=new _0x10aa9f(this['locale']),_0x21c13d=this['_createTitleView']();return _0x584f86['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x32a30f=>_0x32a30f)]},'children':[_0x21c13d,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x584f86;}['_createTitleView'](){const _0x4d9b3c=new _0x10aa9f(this['locale']),_0x15bdf1=new Le();return _0x15bdf1['bind']('isVisible')['to'](this,'isResultReady',_0xa7983f=>!_0xa7983f),_0x4d9b3c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x15bdf1,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2bc77e=>_0x2bc77e)]},'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',_0x4a7666=>!_0x4a7666)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x4d9b3c;}['_createFinishReviewButtonView'](){const _0x1b50e5=new Gs(this['locale']);return _0x1b50e5['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2bace4=>!_0x2bace4)]}}),_0x1b50e5['delegate']('finishReview')['to'](this),_0x1b50e5;}}class Zs extends _0x2ced3c{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x1716c1){super(_0x1716c1),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x2c0a22=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x2c0a22['if']('isVisible','ck-hidden',_0x28284b=>!_0x28284b)]},'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(_0x1716c1,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x27a152=new Gs(this['locale']);return _0x27a152['delegate']('finishReview')['to'](this),_0x27a152;}['_createResultHeaderView'](){const _0x500e70=new _0x10aa9f(this['locale']);return _0x500e70['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']]}]}),_0x500e70;}}class le extends _0x10aa9f{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x546cd2){super(_0x546cd2),this['reviewModeHeader']=new _0x4f9b0c(_0x546cd2,{'label':C(_0x546cd2,'AI_REVIEW_MODE'),'icon':_0x30da4f,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Us(_0x546cd2),this['reviewCheckListView']['delegate'](...Xs)['to'](this),this['reviewCheckResultsView']=new Ys(_0x546cd2),this['reviewCheckResultsView']['delegate'](...Xs)['to'](this),this['reviewCompletedView']=new Zs(_0x546cd2),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'](_0x5bbf85){this['reviewCheckResultsView']['addResult'](_0x5bbf85),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 _0x179f18{['resultItemView'];constructor(_0x40a2f2,_0x2c6c9c){super(_0x40a2f2),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']()),_0x2c6c9c['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0xc122a1){this['resultItemView']['changeId']=_0xc122a1['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0xc122a1['contentDiffed'];}['showBalloon'](_0x4fba1b,_0x55ba59){this['updateContent'](_0x4fba1b),this['show'](),this['pin']({'target':()=>this['_getBestRectPosition'](_0x55ba59)});}['hideBalloon'](){this['hide'](),this['unpin']();}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_setupClickOutsideHandler'](){_0x2cf367({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['_createContentView'](){const _0x1eb42b=new _0x10aa9f();return this['resultItemView']=new Bs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x1eb42b['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']]}]}),_0x1eb42b;}['_getBestRectPosition'](_0x177252){const _0x5443ac=Array['from'](_0x177252['getClientRects']());return _0x5443ac['find'](_0x48f29e=>_0x48f29e['width']>0x0)||_0x5443ac[0x0];}}const Xs=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x267838{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[at];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4576ef){super(_0x4576ef),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new le(this['context']['locale']),this['_reviewModeView']['delegate'](...Xs)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new we(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x1c5077=this['context']['plugins']['get']('AITabs');_0x1c5077['view']['on']('activateTab',(_0x582dce,_0x1642f4)=>{'reviewMode'===_0x1642f4?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x1c5077['view']['addTab']({'id':'reviewMode','buttonLabel':C(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x30da4f,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x165dac){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x165dac),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x391fca){_0x391fca&&('error-general'!==_0x391fca['status']?'error-chunk'!==_0x391fca['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x5bc51c){this['_reviewModeView']['addCheckRunResult'](_0x5bc51c);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x4212a1,_0x766415){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x4212a1,_0x766415);}['setActiveStateInResults'](_0x12385d){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3cc574=>{_0x3cc574['id']===_0x12385d&&_0x3cc574['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5eb74a=>_0x5eb74a['setItemAsInactive']());}['updateChangeState'](_0x4cde64,_0x251183){'accepted'===_0x251183||'rejected'===_0x251183||'outdated'===_0x251183?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x4cde64,_0x251183):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x4cde64,_0x251183);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x33d6d1,_0x435e6c){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x33d6d1,_0x435e6c);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x6ca1d1){const _0x5ac516=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x466c06=>_0x466c06['id']===_0x6ca1d1);return _0x5ac516?_0x5ac516['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const me='reviewmode-';class re extends _0x267838{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x4176c6,c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x1531d8){super(_0x1531d8),this['_domEmitter']=new(_0x14a852())(),this['_eventEmitter']=new(_0x7d5e47())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x4055bb=P(this['context']);_0x4055bb['conversion']['for']('editingDowncast')['markerToElement']({'model':me+'insert','view':(_0x5bf453,{writer:_0x2c1c03})=>{const _0x23e8d1=this['_markers']['get'](_0x5bf453['markerName']),_0x551aa5={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x5bf453['markerName']};return _0x2c1c03['createUIElement']('span',_0x551aa5,function(_0x363739){const _0x2f89e8=this['toDomElement'](_0x363739);return _0x2f89e8['innerHTML']=_0x23e8d1?.['text']||'',_0x2f89e8;});}}),_0x4055bb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-only','view':_0x2fbb68=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x2fbb68['markerName']}})}),_0x4055bb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-context','view':_0x14c961=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x14c961['markerName']}})}),_0x4055bb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-text','view':_0x57326f=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x57326f['markerName']}})}),_0x4055bb['conversion']['for']('dataDowncast')['markerToElement']({'model':me+'suggestion-context','view':(_0x5a4c83,{writer:_0x3e2723})=>_0x3e2723['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x5a4c83['isOpening']?'start':'end')})}),_0x4055bb['conversion']['for']('downcast')['attributeToAttribute']({'model':ct,'view':_0x3ebb99}),this['_domEmitter']['listenTo'](document,'click',(_0x2bc888,_0x218555)=>{const _0x28e9f7=_0x218555['target'],_0x79ae24=this['_findMarkerElement'](_0x28e9f7);if(!_0x79ae24)return;const _0x3361ec=_0x79ae24['getAttribute']('data-marker-id'),_0x5822bf=_0x3361ec['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x3361ec,'changeId':_0x5822bf});}),_0x4055bb['model']['document']['registerPostFixer'](_0x219013=>this['_validateMarkers'](_0x4055bb,_0x219013)),_0x4055bb['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x4055bb));}['getDocumentData'](){const _0x4b6587=this['context']['plugins']['get']('AIEditing'),_0x1aa225=P(this['context']),_0x45f918=_0x1aa225['model'],_0xe01094=new _0x42c406();for(const _0xc54501 of _0x45f918['document']['getRoot']()['getChildren']()){const _0x228012=_0xc54501['_clone'](!0x0);_0xe01094['_appendChild'](_0x228012);}for(const _0x1b2939 of _0x45f918['markers'])_0xe01094['markers']['set'](_0x1b2939['name'],this['_changeRangeOwnerDocument'](_0x1b2939['getRange']()['clone'](),_0xe01094));const _0x32d21a=new _0x1c22cf({'ignoreElementEnd':!0x0,'startPosition':_0x45f918['createPositionAt'](_0xe01094,0x0)}),_0x177409=new Set(),_0x131633=new Map();for(const {item:_0x59851d}of _0x32d21a){if(!_0x59851d['is']('$textProxy'))continue;const _0x31794c=_0x59851d['parent'];if((!_0x31794c||!_0x31794c['is']('element','caption'))&&(_0x31794c&&_0x31794c['is']('element'))){let _0x334ca9=_0x31794c['getAttribute'](ct);_0x334ca9||(_0x334ca9=_0x4b6587['_nextDataId'](_0x177409),_0x31794c['_setAttribute'](ct,_0x334ca9)),_0x177409['add'](_0x334ca9);let _0x53efdd=_0x31794c;for(;_0x53efdd['parent']&&!_0x53efdd['parent']['is']('documentFragment');)_0x53efdd=_0x53efdd['parent'],_0x53efdd['hasAttribute'](ct)&&_0x53efdd['_removeAttribute'](ct);_0x131633['set'](_0x334ca9,{'path':_0x31794c['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x53efdd['_clone'](!0x0),_0x334ca9,_0x1aa225['data'])}),_0x32d21a['jumpTo'](_0x45f918['createPositionAfter'](_0x31794c));}}return{'content':_0x1aa225['data']['processor']['toData'](_0x1aa225['data']['toView'](_0xe01094)),'version':_0x1aa225['model']['document']['version'],'elements':_0x131633};}['diffContent'](_0x8a67ce,_0x1a5c30){const _0x23c50f=[],_0x4de82e=P(this['context']),_0x22944f=_0x4de82e['data']['parse'](_0x8a67ce,'$documentFragment'),_0x276307=_0x4de82e['model']['createPositionAt'](_0x22944f,0x0),_0x136f62=_0x4de82e['data']['parse'](_0x1a5c30,'$documentFragment');if(!this['_hasSameTopLevelElement'](_0x22944f,_0x136f62))return _0x23c50f;const _0x2d13c3=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x8a67ce,_0x1a5c30,{'anchor':_0x276307,'markDeletions':!0x0})['getOperations']()['filter'](_0xa714c1=>'insert'===_0xa714c1['type']||'marker'===_0xa714c1['type']&&_0xa714c1['name']['startsWith']('$markedRemove')),_0x3df4b1=this['_groupAdjacentOperations'](_0x2d13c3);let _0x40ef71=0x0;return _0x4de82e['model']['change'](_0x575eeb=>{for(let _0x7bcd19=0x0;_0x7bcd19<_0x3df4b1['length'];_0x7bcd19++){const _0x218905=_0x3df4b1[_0x7bcd19],_0x36cc9c=_0x575eeb['createDocumentFragment']();for(const _0x2e3996 of _0x22944f['getChildren']())_0x575eeb['append'](_0x2e3996['_clone'](!0x0),_0x36cc9c);for(const _0x3841e2 of _0x218905['operationsIsolated'])if('insert'===_0x3841e2['type']){const _0x5940d4=_0x3841e2;_0x5940d4['baseVersion']=null,_0x5940d4['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x5940d4,_0x36cc9c),_0x575eeb['batch']['addOperation'](_0x3841e2),_0x4de82e['model']['applyOperation'](_0x3841e2);const _0x123464='suggestion:insertion:id:authorId:'+_0x40ef71++,_0x5935fa=_0x4de82e['model']['createRange'](_0x5940d4['position'],_0x5940d4['position']['getShiftedBy'](_0x5940d4['howMany']));_0x36cc9c['markers']['set'](_0x123464,_0x5935fa);}else{if('marker'===_0x3841e2['type']&&_0x3841e2['name']['startsWith']('$markedRemove')){const _0x4da128=_0x3841e2,_0x179f93='suggestion:deletion:id:authorId:'+_0x40ef71++;this['_changeOperationOwnerDocument'](_0x4da128,_0x36cc9c),_0x36cc9c['markers']['set'](_0x179f93,_0x4da128['newRange']);}}const _0xf52a5d=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x218905['operationsIsolated'][0x0]),_0x36cc9c),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x218905['operationsIsolated'][_0x218905['operationsIsolated']['length']-0x1]),_0x36cc9c));_0x36cc9c['markers']['set'](me+'suggestion-context',new _0x473568(_0xf52a5d['start'],_0xf52a5d['end'])),_0x23c50f['push']({..._0x218905,'context':this['_createGetContextFn'](_0x36cc9c,_0x4de82e['data'],{'ellipsisBefore':_0xf52a5d['hasContentBefore'],'ellipsisAfter':_0xf52a5d['hasContentAfter']}),'content':this['_createGetContentFn'](_0x36cc9c,_0x4de82e['data'])});}}),_0x23c50f;}['markChangePositionInEditorContent'](_0x45aa2c,_0x4335a2){if(!_0x45aa2c['length'])return;const _0xebd9a3=_0x45aa2c[0x0]['parent']['id'],_0x3194a7=_0x4335a2['elements']['get'](_0xebd9a3);if(!_0x3194a7)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0xebd9a3);const _0x1c5dc5=_0x3194a7['path'],_0x2877f4=P(this['context']),_0x3e9827=_0x2877f4['model']['document']['history']['getOperations'](_0x4335a2['version']),_0x1f9693=[];for(const _0x4a3efc of _0x45aa2c){const _0x2eed58=_0x4a3efc['operationsIsolated']['map'](_0x1eb61d=>this['_translateOperationToEditorContent'](_0x1eb61d,_0x1c5dc5,_0x2877f4['model']['document']['getRoots']()[0x0]));if(!_0x2eed58||!_0x2eed58['length'])continue;const _0x3e3a7d=_0x2eed58['every'](_0x12c742=>'marker'===_0x12c742['type']&&_0x12c742['name']['startsWith']('$markedRemove')),_0x1fef9c={'document':_0x2877f4['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2cfd83=_0x1c1e0c(_0x2eed58,_0x3e9827,_0x1fef9c)['operationsA'];for(const _0x2aedd3 of _0x2cfd83)if('insert'===_0x2aedd3['type']){const _0x2e7acc=_0x2aedd3,_0x438f4e=_0x2e7acc['nodes'];let _0x2a5fa3='';for(const _0x9e3cc of _0x438f4e)_0x9e3cc&&_0x9e3cc['is']('model:$text')&&(_0x2a5fa3+=_0x9e3cc['data']);_0x1f9693['push']({'start':_0x2e7acc['position'],'end':_0x2e7acc['position'],'type':'insert','groupId':_0x4a3efc['id'],'text':_0x2a5fa3});}else{if('marker'===_0x2aedd3['type']&&_0x2aedd3['name']['startsWith']('$markedRemove')){const _0x1109d9=_0x2aedd3;let _0x1c7ba8='remove-text';if(_0x3e3a7d){const _0x4d6f55=this['_findAdjacentContextDistance'](_0x1109d9['newRange']['start'],'backward',_0x2877f4['model']['schema']),_0x2e6f37=this['_findAdjacentContextDistance'](_0x1109d9['newRange']['end'],'forward',_0x2877f4['model']['schema']);if(_0x4d6f55||_0x2e6f37){const _0x525246=_0x1109d9['newRange']['start']['getShiftedBy'](-_0x4d6f55),_0x3c5663=_0x1109d9['newRange']['end']['getShiftedBy'](_0x2e6f37);_0x1f9693['push']({'start':_0x525246,'end':_0x3c5663,'groupId':_0x4a3efc['id'],'type':'remove-context'});}else _0x1c7ba8='remove-only';}_0x1f9693['push']({'start':_0x1109d9['newRange']['start'],'end':_0x1109d9['newRange']['end'],'groupId':_0x4a3efc['id'],'type':_0x1c7ba8});}}}this['_insertMarkers'](_0x1f9693);}['clearAllMarkers'](){const _0x4ead27=P(this['context']);_0x4ead27['model']['change'](_0x571e5d=>{for(const _0x9d2e61 of this['_markers']['keys']())_0x4ead27['model']['markers']['get'](_0x9d2e61)&&_0x571e5d['removeMarker'](_0x9d2e61);}),this['_markers']['clear']();}['switchToReadOnly'](){P(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){P(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x284817){const _0x2187f2=P(this['context']),_0x318008=_0x2187f2['model'],_0x448399=_0x284817['map'](_0x12570b=>this['_getMarkersDataForGroup'](_0x12570b))['flat']();_0x318008['change'](_0x3e4a54=>{for(const _0x3e0c17 of _0x448399){const _0x1d1e38=_0x2187f2['model']['markers']['get'](_0x3e0c17['id']);_0x1d1e38&&('insert'===_0x3e0c17['type']?_0x318008['insertContent'](_0x3e4a54['createText'](_0x3e0c17['text']||''),_0x1d1e38['getRange']()['start']):'remove-text'!==_0x3e0c17['type']&&'remove-only'!==_0x3e0c17['type']||_0x318008['deleteContent'](_0x318008['createSelection'](_0x1d1e38['getRange']())),_0x3e4a54['removeMarker'](_0x3e0c17['id']),this['_markers']['delete'](_0x3e0c17['id']));}});}['rejectChange'](_0x4ce9cc){const _0x1a7e20=P(this['context']),_0x4bb17f=this['_getMarkersDataForGroup'](_0x4ce9cc);_0x1a7e20['model']['change'](_0x454abb=>{for(const _0x5c05a1 of _0x4bb17f)_0x454abb['removeMarker'](_0x5c05a1['id']),this['_markers']['delete'](_0x5c05a1['id']);});}['getEditor'](){return P(this['context']);}['getMarkerElementForChange'](_0x1c88b2){const _0x59966d=Array['from'](this['_markers']['values']())['filter'](_0x1e7ef6=>_0x1e7ef6['groupId']===_0x1c88b2);if(!_0x59966d['length'])return null;const _0x59ed22=0x1===_0x59966d['length']?_0x59966d[0x0]:this['_sortMarkers'](_0x59966d)[0x0],_0x4fc392=P(this['context']),_0x60391f=_0x4fc392['model']['markers']['get'](_0x59ed22['id']);if(!_0x60391f)return null;const _0x1b8b04=_0x60391f['getRange'](),_0x5ebb27=_0x4fc392['editing']['view']['getDomRoot']();if(!_0x5ebb27||!_0x1b8b04)return null;const _0x3b9204=_0x5ebb27['querySelector']('[data-marker-id=\x22'+_0x59ed22['id']+'\x22]');return _0x3b9204?{'modelRange':_0x1b8b04,'domElement':_0x3b9204}:null;}['_validateMarkers'](_0x5c41f7,_0x38af17){const _0x407c39=Array['from'](this['_markers']['keys']()),_0x2ea6cc=new Map();for(const _0x5f5d2a of _0x407c39){const _0x408055=_0x5c41f7['model']['markers']['get'](_0x5f5d2a);if(!_0x408055)continue;const _0x2ee122=_0x408055['getStart']()['path'][0x0];_0x2ea6cc['has'](_0x2ee122)||_0x2ea6cc['set'](_0x2ee122,[]),_0x2ea6cc['get'](_0x2ee122)['push'](_0x408055);}const _0x3f9d7d=new Set();for(const _0x56f4d5 of _0x5c41f7['model']['document']['differ']['getChanges']()){let _0x506f7d=-0x1,_0x42ee75=null;if('insert'===_0x56f4d5['type'])_0x42ee75=new _0x473568(_0x56f4d5['position'],_0x56f4d5['position']['getShiftedBy'](_0x56f4d5['length'])),_0x506f7d=_0x56f4d5['position']['path'][0x0];else{if('remove'!==_0x56f4d5['type'])continue;_0x42ee75=new _0x473568(_0x56f4d5['position']),_0x506f7d=_0x56f4d5['position']['path'][0x0];}const _0x235732=_0x2ea6cc['get'](_0x506f7d)||[];if(_0x235732['length']){for(const _0x8a2b47 of _0x235732)if(_0x42ee75['root']['rootName']===_0x8a2b47['getRange']()['root']['rootName']&&('insert'!==_0x56f4d5['type']||!_0x42ee75['containsRange'](_0x8a2b47['getRange']()))&&(_0x42ee75['isIntersecting'](_0x8a2b47['getRange']())||_0x42ee75['start']['isTouching'](_0x8a2b47['getRange']()['end'])||_0x42ee75['end']['isTouching'](_0x8a2b47['getRange']()['start']))){const _0xbc9a51=this['_parseMarkerName'](_0x8a2b47['name']);Array['from'](this['_markers']['values']())['filter'](_0x28b6f0=>_0x28b6f0['groupId']===_0xbc9a51['groupId'])['forEach'](_0x12ee62=>_0x3f9d7d['add'](_0x12ee62['id']));}}}if(_0x3f9d7d['size']){for(const _0x49ac02 of _0x3f9d7d)_0x38af17['removeMarker'](_0x49ac02);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xf6885c){for(const {name:_0xa4a899,data:_0x586bb9}of _0xf6885c['model']['document']['differ']['getChangedMarkers']()){if(!_0xa4a899['startsWith'](me))continue;const _0x24933e=_0x586bb9['oldRange'],_0x45d4de=_0x586bb9['newRange'],_0x3ca92d=_0x24933e&&'$graveyard'===_0x24933e['root']['rootName'],_0x1ae570=_0x45d4de&&'$graveyard'===_0x45d4de['root']['rootName'];if(_0x3ca92d&&_0x1ae570)continue;const _0x856687=this['_parseMarkerName'](_0xa4a899);this['_markers']['get'](_0xa4a899)&&(_0x1ae570||!_0x45d4de?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0xa4a899,'changeId':_0x856687['groupId']}):_0x3ca92d&&_0x45d4de&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0xa4a899,'changeId':_0x856687['groupId']}));}}['_parseMarkerName'](_0x13e527){const _0x30152d=_0x13e527['split'](':'),_0x5abcaf=(_0x30152d[0x1]||'')['split']('_');return{'prefix':_0x30152d[0x0],'groupId':_0x5abcaf[0x0],'suffix':_0x5abcaf[0x1]};}['_translateOperationToEditorContent'](_0x3bebe4,_0xb286b2,_0x8b4a66){if('insert'===_0x3bebe4['type']){const _0xa884b=_0x3bebe4;return new te(this['_changePosition'](_0xb286b2['concat'](_0xa884b['position']['offset']),_0x8b4a66),_0xa884b['nodes'],_0xa884b['baseVersion']);}if('marker'===_0x3bebe4['type']&&_0x3bebe4['name']['startsWith']('$markedRemove')){const _0x4462e0=_0x3bebe4;return new _0x55facf(_0x4462e0['name'],_0x4462e0['oldRange'],this['_changeRange'](_0x4462e0['newRange'],_0xb286b2['concat'](_0x4462e0['newRange']['start']['offset']),_0xb286b2['concat'](_0x4462e0['newRange']['end']['offset']),_0x8b4a66),_0x4462e0['_markers'],_0x4462e0['affectsData'],_0x4462e0['baseVersion']);}return _0x3bebe4;}['_groupAdjacentOperations'](_0x1e86a0){if(!_0x1e86a0['length'])return[];const _0x389b55=[];let _0x50687c=0x0,_0x53faa4=0x0,_0x4be342=[];for(let _0xebeddc=0x0;_0xebeddc<=_0x1e86a0['length'];_0xebeddc++){const _0x256d3f=_0x1e86a0[_0xebeddc],_0x3b0eea=_0x1e86a0[_0xebeddc-0x1];!_0x256d3f||_0x3b0eea&&!this['_getOperationEnd'](_0x3b0eea)['isTouching'](this['_getOperationStart'](_0x256d3f))?(_0x389b55['push']({'operations':_0x4be342,'operationsIsolated':_0x4be342['map'](_0xe4e6c5=>this['_shiftOperation'](_0xe4e6c5['clone'](),-_0x53faa4)),'groupOffset':_0x50687c}),_0x4be342=_0x256d3f?[_0x256d3f]:[],_0x53faa4+=_0x50687c,_0x50687c=0x0):_0x4be342['push'](_0x256d3f),_0x256d3f&&'insert'===_0x256d3f['type']&&(_0x50687c+=_0x256d3f['howMany']);}return _0x389b55;}['_findAdjacentContextDistance'](_0x4b3f9a,_0x1098a1,_0x1118ec,_0x1939f6=0x1){const _0x2671c3=new _0x1c22cf({'startPosition':_0x4b3f9a,'direction':_0x1098a1});let _0x5694c7=0x0;for(let _0x7e012d=0x0;_0x7e012d<_0x1939f6;_0x7e012d++){let _0x5ad3e8=0x0,_0x3be759=!0x1,_0x253d09='forward'===_0x1098a1?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x18e751}of _0x2671c3)if(_0x18e751['is']('$textProxy')){const _0x29eb8b=_0x253d09['exec'](_0x18e751['data']);if(_0x29eb8b&&_0x29eb8b['length']){if(_0x5ad3e8+='forward'===_0x1098a1?_0x29eb8b['index']+_0x29eb8b[0x0]['length']:_0x18e751['data']['length']-_0x29eb8b['index'],_0x29eb8b[0x0]['length']!==_0x18e751['data']['length'])break;_0x3be759=!0x0,_0x253d09='forward'===_0x1098a1?/^\w+/:/\w+$/;}else{if(_0x3be759)break;_0x5ad3e8+=_0x18e751['offsetSize'];}}else{if(_0x18e751['is']('element')){_0x1118ec['isInline'](_0x18e751)&&!_0x3be759&&(_0x5ad3e8+=0x1);break;}}_0x5694c7+=_0x5ad3e8,_0x2671c3['jumpTo'](_0x4b3f9a['getShiftedBy']('forward'===_0x1098a1?_0x5694c7:-_0x5694c7));}return _0x5694c7;}['_getChangeContext'](_0x58942b,_0x2453c5){const _0xf6df78=P(this['context'])['model']['schema'],_0x5e1131=this['_findAdjacentContextDistance'](_0x58942b,'backward',_0xf6df78,0x6),_0x577492=this['_findAdjacentContextDistance'](_0x2453c5,'forward',_0xf6df78,0x6),_0x2914b6=_0x58942b['getShiftedBy'](-_0x5e1131),_0x4d7b30=_0x2453c5['getShiftedBy'](_0x577492);return{'start':_0x2914b6,'end':_0x4d7b30,'hasContentBefore':!_0x2914b6['isAtStart'],'hasContentAfter':!_0x4d7b30['isAtEnd']};}['_insertMarkers'](_0x24d496){const _0x15dd04=this['context']['plugins']['get']('AIEditing'),_0x5b3128=new Set();P(this['context'])['model']['change'](_0x2ae3d9=>{for(const _0x218e09 of _0x24d496){const _0x410bb3=''+me+_0x218e09['type']+':'+_0x218e09['groupId']+'_'+_0x15dd04['_nextDataId'](_0x5b3128);this['_markers']['set'](_0x410bb3,{'id':_0x410bb3,'groupId':_0x218e09['groupId'],'type':_0x218e09['type'],'text':_0x218e09['text']}),_0x2ae3d9['addMarker'](_0x410bb3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2ae3d9['createRange'](_0x218e09['start'],_0x218e09['end'])});}});}['_createGetContextFn'](_0x4932a8,_0xf6e84f,_0x56d44e){let _0x2c259d='';return()=>{if(!_0x2c259d){const _0x3b6155=_0xf6e84f['toView'](_0x4932a8,{'showSuggestionHighlights':!0x0}),_0x142fb8=_0x3b6155['getChild'](0x0);if(!_0x142fb8)return'';let _0x42580c=!0x1;const _0x3b0261=[];for(const _0x5b4940 of _0x142fb8['getChildren']())_0x5b4940['is']('element','span')&&_0x5b4940['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x42580c=!0x1),_0x42580c&&_0x3b0261['push'](_0x5b4940),_0x5b4940['is']('element','span')&&_0x5b4940['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x42580c=!0x0);_0x142fb8['_removeChildren'](0x0,_0x142fb8['childCount']),_0x56d44e?.['ellipsisBefore']&&_0x142fb8['_appendChild']('…'),_0x142fb8['_appendChild'](_0x3b0261),_0x56d44e?.['ellipsisAfter']&&_0x142fb8['_appendChild']('…');const _0x46e71a=_0xf6e84f['htmlProcessor']['domConverter']['viewToDom'](_0x3b6155),_0x408b85=_0xf6e84f['htmlProcessor']['htmlWriter']['getHtml'](_0x46e71a);_0x2c259d=_0x408b85;}return _0x2c259d;};}['_createGetContentFn'](_0xd020b1,_0x28e427){let _0x5672b9='';return()=>(_0x5672b9||(_0x5672b9=_0x28e427['stringify'](_0xd020b1,{'showSuggestionHighlights':!0x0})),_0x5672b9);}['_createGetContentUsingDataIdFn'](_0x226c50,_0x27cf32,_0x5883cc){let _0xfbeb25='';return()=>{if(!_0xfbeb25){const _0x2b695b=_0x5883cc['toView'](new _0x42c406(_0x226c50)),_0x100868=_0x5883cc['htmlProcessor']['domConverter']['viewToDom'](_0x2b695b)['querySelector']('[data-id=\x22'+_0x27cf32+'\x22]');_0xfbeb25=_0x100868?.['outerHTML']||'';}return _0xfbeb25;};}['_findMarkerElement'](_0x385a3d,_0x38ce95=0x5){let _0x199c35=_0x385a3d,_0x5cfb25=null;for(let _0x3f0f98=0x0;_0x3f0f98<_0x38ce95&&_0x199c35;_0x3f0f98++){if(!_0x199c35['className']){_0x199c35=_0x199c35['parentElement'];continue;}if(!(''+_0x199c35['className'])['includes']('ck-ai_review-mode-marker_')){_0x199c35=_0x199c35['parentElement'];continue;}if(!_0x199c35['getAttribute']('data-marker-id'))break;_0x5cfb25=_0x199c35;break;}return _0x5cfb25;}['_getMarkersDataForGroup'](_0x6190e0){return Array['from'](this['_markers']['values']())['filter'](_0x5afcc6=>_0x5afcc6['groupId']===_0x6190e0);}['_getOperationStart'](_0x17937d){return'insert'===_0x17937d['type']?_0x17937d['position']:_0x17937d['newRange']['start'];}['_getOperationEnd'](_0xcec552,_0x145ac0=!0x1){return'insert'===_0xcec552['type']?_0x145ac0?_0xcec552['position']:_0xcec552['position']['getShiftedBy'](_0xcec552['howMany']):_0xcec552['newRange']['end'];}['_shiftOperation'](_0x552e5d,_0x313f3b){return'insert'===_0x552e5d['type']?_0x552e5d['position']=_0x552e5d['position']['getShiftedBy'](_0x313f3b):'marker'===_0x552e5d['type']&&_0x552e5d['newRange']&&(_0x552e5d['newRange']=new _0x473568(_0x552e5d['newRange']['start']['getShiftedBy'](_0x313f3b),_0x552e5d['newRange']['end']['getShiftedBy'](_0x313f3b))),_0x552e5d;}['_changeOperationOwnerDocument'](_0x28a3a1,_0x3c0763){'insert'===_0x28a3a1['type']?_0x28a3a1['position']=this['_changePositionOwnerDocument'](_0x28a3a1['position'],_0x3c0763):'marker'===_0x28a3a1['type']&&_0x28a3a1['newRange']&&(_0x28a3a1['newRange']=this['_changeRangeOwnerDocument'](_0x28a3a1['newRange'],_0x3c0763));}['_changePositionOwnerDocument'](_0x47079c,_0x58d79b){return new _0x2a6f0c(_0x58d79b,_0x47079c['path']);}['_changeRangeOwnerDocument'](_0x3d301a,_0x4e7f9b){return new _0x473568(this['_changePositionOwnerDocument'](_0x3d301a['start'],_0x4e7f9b),this['_changePositionOwnerDocument'](_0x3d301a['end'],_0x4e7f9b));}['_changePosition'](_0x1a04f3,_0x3c040a){return new _0x2a6f0c(_0x3c040a,[..._0x1a04f3]);}['_changeRange'](_0x7975fc,_0x1da462,_0x281dd7,_0x167ca2){return new _0x473568(this['_changePosition'](_0x1da462,_0x167ca2),this['_changePosition'](_0x281dd7,_0x167ca2));}['_sortMarkers'](_0x43c8d8){const _0x73137e=_0x57d823=>{switch(_0x57d823){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x43c8d8['sort']((_0xf23448,_0xb708bc)=>_0x73137e(_0xf23448['type'])-_0x73137e(_0xb708bc['type']));}['_hasSameTopLevelElement'](_0x4a0c67,_0x394b07){const _0x350f31=_0x4a0c67['getChild'](0x0),_0x10d4ad=_0x394b07['getChild'](0x0);return!(!_0x350f31||!_0x10d4ad)&&((!_0x350f31['is']('element')||!_0x10d4ad['is']('element')||_0x350f31['name']===_0x10d4ad['name'])&&!(_0x350f31['is']('element')&&!_0x10d4ad['is']('element')||!_0x350f31['is']('element')&&_0x10d4ad['is']('element')));}}class Ga extends _0x267838{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,Ha as AIChat,tt as AIChatController,it as AIChatHistory,yt as AIChatHistoryController,jt as AIChatHistoryUI,et as AIChatUI,s as AIConnector,c as AIEditing,Ma as AIEditorIntegration,Ot as AIQuickActionType,Va as AIQuickActions,ui as AIQuickActionsUI,tr as AIRequestError,$s as AIReviewCheck,th as AIReviewCheckResult,Rr as AIReviewCheckRun,Ga 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,co as ToggleAICommand,Cs as createResizeButton,Qn as getDefaultAICommands};
|