@ckeditor/ckeditor5-ai 47.2.0-alpha.2 → 47.2.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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.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 _0x3145c9,Command as At,ContextPlugin as _0x47d85c,Editor as _0x507c90}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x42428b,IconCheck as _0x4ffa92,IconError as _0x25ebf7,IconSubmit as _0xc5da5d,IconAIHistory as _0x30fbfe,IconMagicWand as _0x2d9e51,IconRobotPencil as _0x452ca2,IconMaximize as _0x20699c,IconMinimize as _0x20c950,IconDocumentWithLoupe as _0x4483a,IconAddComment as _0x3d6660,IconShowChangesOn as _0x55c8cb,IconShowChangesOff as _0x4bbc4b,IconDocument as _0x2b8e0f,IconThreeStars as _0x203677,IconRemove as _0x1589cd,IconDocumentWithCheckmark as _0x18f903,IconDocumentWithCross as _0x1ea5bd,IconLoupe as _0x11baed,IconCancel as _0x88b984,IconStop as _0xcdaaf6,IconAIChat as _0x24f2cd,IconPlus as _0x396e8a,IconPin as _0x35042a,IconThreeHorizontalDots as _0x13de8d,IconChevronRight as _0x287852,IconInfo as _0x401635,IconOutdated as _0x30b921,IconEye as _0x4a8347,IconEyeCrossedOut as _0x351d84,IconAIReview as _0x293db8}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x4c8592,CKEditorError as _0x51167b,ObservableMixin as qt,global as _0x2909f5,isVisible as _0x138911,Rect as _0x401654,Collection as _0x4d07d3,FocusTracker as _0x156d7c,KeystrokeHandler as _0x2ec108,first as nt,toArray as _0x4c715e,EmitterMixin as _0x3f6d88,logWarning as zt,scrollViewportToShowTarget as _0x24e163,logError as _0x36ffad,ResizeObserver as _0x2b8751,_isMotionReduced as _0x4ec3fa,scrollAncestorsToShowTarget as _0x523446,DomEmitterMixin as _0x1aff96}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x36a471,ButtonView as tt,View as st,SpinnerView as _0x1e0886,IconView as _0x202d8c,AutocompleteView as _0x5c4293,ListView as _0x493f65,ListItemGroupView as _0x329354,ListItemView as _0x5374ac,ButtonLabelView as _0x40384f,FocusCycler as _0x3ac126,createLabeledTextarea as _0x1db25d,Dialog as _0xee4d10,createDropdown as _0x3e6542,addMenuToDropdown as _0x2bcc85,MenuBarMenuView as vt,MenuBarMenuListItemButtonView as Kt,DialogViewPosition as _0x4354d0,MenuBarMenuListView as bt,MenuBarMenuListItemView as Pt,UIModel as _0x12ff1d,SplitButtonView as _0x2141f1,BalloonPanelView as _0x5266db,BodyCollection as Et,clickOutsideHandler as ts,ListItemButtonView as _0x526cc2,ViewCollection as it,addListToDropdown as _0x146679,submitHandler as _0x3aecd7,LabeledFieldView as _0x5ef183,createLabeledInputText as _0x5ba2a4,FormHeaderView as _0x3197a7,HighlightedTextView as _0x393c5c,FileDialogButtonView as _0x51e7ac,InputTextView as _0x34a65d,SearchTextView as _0x10a4bf,DropdownMenuButtonView as _0x38fe52,DropdownMenuPanelPositioningFunctions as _0x26b205,BalloonToolbar as Ut,FormRowView as _0x1a7992,TextareaView as _0xd4428c}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as Dt,ClipboardMarkersUtils as _0x335fcd}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as jt,ViewDataTransfer as Bt,ViewUpcastWriter as _0xfd9aac,Matcher as _0x5da802,_DetachOperation as _0x33fea2,_insertIntoModelNodeList as _0x5d6c8d,_removeFromModelNodeList as to,ModelRange as _0x46f2b7,ViewDowncastWriter as dt,transformOperationSets as mt,ModelDocumentFragment as ut,ModelPosition as gt,ModelTreeWalker as _0x2daaa0,InsertOperation as te,MarkerOperation as _0x439787}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x1eea17,escape as Xt,escapeRegExp as _0x7861f9}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x459a7f,InvokeModelWithResponseStreamCommand as _0x1d3fb2,InvokeModelCommand as _0x2404f7}from'@aws-sdk/client-bedrock-runtime';import{createParser as Ct}from'eventsource-parser';import{parseDocument as _0x35b477}from'htmlparser2';import{isTag as _0x32f843,findOne as _0x21c931,getParent as _0x563b16,findAll as _0x2c4c1b,removeElement as _0x456b22,replaceElement as _0x553dad,prepend as _0x54bde9,prependChild as _0x14f4a2,appendChild as _0x317071,append as _0x321f33,find as _0x3ddc03,isComment as _0x3cae27,getChildren as _0x2976a8,textContent as _0x55b460}from'domutils';import _0x1b38df from'dom-serializer';import{Document as _0x46f624,Element as _0x6f6481,Text as _0xa884bf,cloneNode as _0x313448,isDocument as _0x45feba,isText as _0x500a12,NodeWithChildren as _0x54b7fc}from'domhandler';import{MarkdownGfmMdToHtml as _0x865c0a}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x61509a,getAllMarkersDomElementsSorted as _0x25fa50,DocumentCompare as _0xfc3cc0,DATA_ID_MODEL_ATTRIBUTE as _0x353bfc,ConfirmMixin as _0x184722,LateFocusDropdownButtonView as _0x1991f7,DATA_ID_VIEW_ATTRIBUTE as _0x498aa2}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x48fdbf}from'es-toolkit';import{IconThumbUp as _0x53f9d0,IconThumbDown as _0x17130d,IconCopy as _0x32e5dd,IconCheck as _0x24f2e2,IconShowChangesOff as ct,IconShowChangesOn as _0x5d8356,IconWeb as _0x2ab575,IconNextArrow as at,IconPreviousArrow as ht,IconAI as _0x43d7e5,IconClose as _0x40e6cf,IconSelection as _0x5b0af7,IconFileUpload as _0x37b5a4,IconLink as _0x231b46,IconDocument as _0x3239bf,IconBulb as _0x52193b,IconDocumentOutline as _0x172800,IconPaperClip as _0x406574,IconBrowseFiles as _0x741164,IconDropdownArrow as _0x821572,IconAIAskAI as _0xf6bd89,IconAIQuickActions as ot,IconAIChatCommands as Tt,IconAIImproveWriting as Qt,IconAIContinueWriting as Nt,IconAIGrammarCheck as kt,IconAIAdjustLength as yt,IconAIChangeTone as _t,IconAITranslate as xt,IconAIOther as St,IconRefresh as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x193f2e from'morphdom';import{SuggestionsConversion as pt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x39ba65}from'diff';const fi='_ungrouppedCommands';function de(_0x2ae4bf,_0x12f5f0){const _0x2c9e4a=(0x0,_0x12f5f0['t'])('Other');return _0x2ae4bf['length']?'groupId'in _0x2ae4bf[0x0]?_0x2ae4bf:[{'groupId':fi,'groupLabel':_0x2c9e4a,'order':0x1/0x0,'commands':_0x2ae4bf}]:[{'groupId':fi,'groupLabel':_0x2c9e4a,'order':0x1/0x0,'commands':[]}];}const Fn=globalThis['DataTransfer'],Vt='ai-ui';class ge extends _0x3145c9{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x21cdfb}=this,_0x3534c4=['ck-fake-ai-selection'];_0x21cdfb['config']['get']('ai.assistant.useTheme')&&_0x3534c4['push']('ck-ai-assistant-ui_theme'),_0x21cdfb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Vt,'view':{'classes':_0x3534c4,'priority':0xc}}),_0x21cdfb['conversion']['for']('editingDowncast')['markerToElement']({'model':Vt,'view':(_0xffbfd9,{writer:_0x55b88a})=>{if(!_0xffbfd9['markerRange']['isCollapsed'])return null;const _0xa80a95=_0x55b88a['createUIElement']('span');return _0x55b88a['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0xa80a95),_0xa80a95;}});}['afterInit'](){!async function(_0x4427b){const _0x32877d=_0x343012([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]),_0x489b20=0x3dffc4e1,_0x42f667=0x3df8b321^_0x489b20,_0xbf2fb9=window[_0x343012([0x44,0x61,0x74,0x65])][_0x343012([0x6e,0x6f,0x77])](),_0x59e735=_0x4427b[_0x343012([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x7cc4ba=new window[(_0x343012([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x521598=>{_0x59e735[_0x343012([0x6f,0x6e,0x63,0x65])](_0x343012([0x72,0x65,0x61,0x64,0x79]),_0x521598);}),_0x284199={[_0x343012([0x6b,0x74,0x79])]:_0x343012([0x45,0x43]),[_0x343012([0x75,0x73,0x65])]:_0x343012([0x73,0x69,0x67]),[_0x343012([0x63,0x72,0x76])]:_0x343012([0x50,0x2d,0x32,0x35,0x36]),[_0x343012([0x78])]:_0x343012([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]),[_0x343012([0x79])]:_0x343012([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]),[_0x343012([0x61,0x6c,0x67])]:_0x343012([0x45,0x53,0x32,0x35,0x36])},_0xdb5236=_0x59e735[_0x343012([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x343012([0x67,0x65,0x74])](_0x343012([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x3a6cce(){let _0x6c2061,_0x48b312=null,_0x51311c=null;try{if(_0xdb5236==_0x343012([0x47,0x50,0x4c]))return _0x343012([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x6c2061=_0x2bb472(),!_0x6c2061)return _0x343012([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x6c2061[_0x343012([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x51311c=_0x48e9d7(_0x6c2061[_0x343012([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x6c2061[_0x343012([0x6a,0x74,0x69])])),await _0x57a837()?_0x234a69()?_0x41b07e()?_0x343012([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x277c32()?(_0x6c2061[_0x343012([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x343012([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x48b312=_0xbf3454(_0x343012([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x6c2061[_0x343012([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x343012([0x74,0x72,0x69,0x61,0x6c])&&(_0x48b312=_0xbf3454(_0x343012([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x190029()):_0x343012([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x343012([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x343012([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x343012([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x41b07e(){const _0x5c89e1=[_0x343012([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x343012([0x74,0x72,0x69,0x61,0x6c])][_0x343012([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x6c2061[_0x343012([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xbf2fb9/0x3e8:0xe10*_0x42f667;return _0x6c2061[_0x343012([0x65,0x78,0x70])]<_0x5c89e1;}function _0x234a69(){const _0x54551c=_0x6c2061[_0x343012([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x54551c&&(!!_0x54551c[_0x343012([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x343012([0x2a]))||!!_0x54551c[_0x343012([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x343012([0x41,0x49])));}function _0x277c32(){const _0x235d0e=_0x6c2061[_0x343012([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x235d0e||0x0==_0x235d0e[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3bc896}=new URL(window[_0x343012([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x235d0e[_0x343012([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3bc896))return!0x0;const _0x783c51=_0x3bc896[_0x343012([0x73,0x70,0x6c,0x69,0x74])](_0x343012([0x2e]));return _0x235d0e[_0x343012([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4f7a87=>_0x4f7a87[_0x343012([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x343012([0x2a])))[_0x343012([0x6d,0x61,0x70])](_0x2743da=>_0x2743da[_0x343012([0x73,0x70,0x6c,0x69,0x74])](_0x343012([0x2e])))[_0x343012([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5148b1=>_0x5148b1[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x783c51[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x343012([0x6d,0x61,0x70])](_0x570937=>Array(_0x783c51[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x570937[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x343012([0x66,0x69,0x6c,0x6c])](_0x570937[0x0]===_0x343012([0x2a])?_0x343012([0x2a]):'')[_0x343012([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x570937))[_0x343012([0x73,0x6f,0x6d,0x65])](_0x167207=>_0x783c51[_0x343012([0x65,0x76,0x65,0x72,0x79])]((_0x1a4299,_0x56db3d)=>_0x167207[_0x56db3d]===_0x1a4299||_0x167207[_0x56db3d]===_0x343012([0x2a])));}function _0x190029(){return _0x48b312&&_0x51311c?new window[(_0x343012([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x46de3c,_0x53df87)=>{_0x48b312[_0x343012([0x74,0x68,0x65,0x6e])](_0x46de3c,_0x53df87),_0x51311c[_0x343012([0x74,0x68,0x65,0x6e])](_0x9e6bb2=>{_0x9e6bb2!=_0x343012([0x56,0x61,0x6c,0x69,0x64])&&_0x46de3c(_0x9e6bb2);},_0x53df87);}):_0x48b312||_0x51311c||_0x343012([0x56,0x61,0x6c,0x69,0x64]);}}function _0x48e9d7(_0xbda636,_0x283774){return new window[(_0x343012([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3e5d1b=>{if(_0xc70c5b())return _0x3e5d1b(_0x343012([0x56,0x61,0x6c,0x69,0x64]));_0x318f58(),_0x59e735[_0x343012([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x343012([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x377fe7=!0x1;const _0x3831d9=_0x4c8592();function _0x16c4a2(_0x43e25d){return!!_0x43e25d&&(typeof _0x43e25d===_0x343012([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x43e25d===_0x343012([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x43e25d[_0x343012([0x74,0x68,0x65,0x6e])]===_0x343012([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x43e25d[_0x343012([0x63,0x61,0x74,0x63,0x68])]===_0x343012([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x24aec7(_0x1b8f25){_0x53ae05(_0x1b8f25)[_0x343012([0x74,0x68,0x65,0x6e])](_0x153eed=>{if(!_0x153eed||_0x153eed[_0x343012([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x343012([0x6f,0x6b]))return _0x343012([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5367e7(_0x1c44bf(_0x3831d9+_0x283774))!=_0x153eed[_0x343012([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x343012([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x343012([0x56,0x61,0x6c,0x69,0x64]);})[_0x343012([0x74,0x68,0x65,0x6e])](_0x3c3bfd=>(_0x22ab2b(),_0x3c3bfd),()=>{const _0x42f815=_0x3624c8();return null==_0x42f815?(_0x22ab2b(),_0x343012([0x56,0x61,0x6c,0x69,0x64])):_0x343012(_0xbf2fb9-_0x42f815>(0x19f340e1^_0x489b20)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x343012([0x74,0x68,0x65,0x6e])](_0x3e5d1b)[_0x343012([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3e5d1b(_0x343012([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x47c7e9=0x3dc92a61^_0x489b20;function _0x22ab2b(){const _0x311389=_0x343012([0x6c,0x6c,0x63,0x74,0x2d])+_0x5367e7(_0x1c44bf(_0xbda636)),_0x3337c4=_0x45e8e6(_0x5367e7(window[_0x343012([0x4d,0x61,0x74,0x68])][_0x343012([0x63,0x65,0x69,0x6c])](_0xbf2fb9/_0x47c7e9)));window[_0x343012([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x343012([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x311389,_0x3337c4);}function _0x3624c8(){const _0x14b7d0=_0x343012([0x6c,0x6c,0x63,0x74,0x2d])+_0x5367e7(_0x1c44bf(_0xbda636)),_0x1f4f6c=window[_0x343012([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x343012([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x14b7d0);return _0x1f4f6c?window[_0x343012([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x45e8e6(_0x1f4f6c),0x10)*_0x47c7e9:null;}function _0x53ae05(_0x3e8a39){return new window[(_0x343012([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x95ef2b,_0x5326c7)=>{_0x3e8a39[_0x343012([0x74,0x68,0x65,0x6e])](_0x95ef2b,_0x5326c7),window[_0x343012([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5326c7,0x3dfe1021^_0x489b20);});}}_0x59e735[_0x343012([0x6f,0x6e])](_0x343012([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3fba05,_0x603658)=>{if(_0x603658[0x0]!=_0xbda636)return _0x3e5d1b(_0x343012([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x603658[0x1]={..._0x603658[0x1],[_0x343012([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3831d9};},{[_0x343012([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x343012([0x68,0x69,0x67,0x68])}),_0x59e735[_0x343012([0x6f,0x6e])](_0x343012([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x480cd1=>{_0x16c4a2(_0x480cd1[_0x343012([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x377fe7=!0x0,_0x24aec7(_0x480cd1[_0x343012([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x343012([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x343012([0x6c,0x6f,0x77])}),_0x7cc4ba[_0x343012([0x74,0x68,0x65,0x6e])](()=>{_0x377fe7||_0x3e5d1b(_0x343012([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xc70c5b(){return _0x59e735[_0x343012([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x343012([0x76,0x69,0x65,0x77])][_0x343012([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x343012([0x61,0x75,0x74,0x6f]);}function _0x318f58(){_0x59e735[_0x343012([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x343012([0x76,0x69,0x65,0x77])][_0x343012([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x343012([0x61,0x75,0x74,0x6f]);}}function _0xbf3454(_0x55e6d9){const _0x9676a4=[new window[(_0x343012([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x369059=>setTimeout(_0x369059,0x3df6fa2d^_0x489b20)),_0x7cc4ba[_0x343012([0x74,0x68,0x65,0x6e])](()=>new window[(_0x343012([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2db2d9=>{let _0x219a39=0x0;_0x59e735[_0x343012([0x6d,0x6f,0x64,0x65,0x6c])][_0x343012([0x6f,0x6e])](_0x343012([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xb7a2c7,_0x1ae757)=>{_0x1ae757[0x0][_0x343012([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x219a39++,_0x219a39==(0x3dffc519^_0x489b20)&&(_0x2db2d9(),_0xb7a2c7[_0x343012([0x6f,0x66,0x66])]());});}))];return window[_0x343012([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x343012([0x72,0x61,0x63,0x65])](_0x9676a4)[_0x343012([0x74,0x68,0x65,0x6e])](()=>_0x55e6d9);}async function _0xe3b38(){await _0x7cc4ba,_0x59e735[_0x343012([0x6d,0x6f,0x64,0x65,0x6c])][_0x343012([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x268fa,_0x59e735[_0x343012([0x6d,0x6f,0x64,0x65,0x6c])][_0x343012([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x268fa,_0x59e735[_0x343012([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x343012([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x28aa41(_0x3c3414){const _0x34d691=_0x4f9109();_0x59e735[_0x34d691]=_0x343012([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3c3414,_0x3c3414!=_0x343012([0x56,0x61,0x6c,0x69,0x64])&&_0xe3b38();}function _0x4f9109(){const _0x3d7e3a=window[_0x343012([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x343012([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x343012([0x6e,0x6f,0x77])]())[_0x343012([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x343012([0x2e]),'');let _0x823f5f=_0x343012([0x6e]);for(let _0x4b56d5=0x0;_0x4b56d5<_0x3d7e3a[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4b56d5+=0x2){let _0x526f62=window[_0x343012([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3d7e3a[_0x343012([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4b56d5,_0x4b56d5+0x2));_0x526f62>=_0x32877d[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x526f62-=_0x32877d[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x823f5f+=_0x32877d[_0x526f62];}return _0x823f5f;}function _0x2bb472(){const _0x44b3d3=_0xdb5236[_0x343012([0x73,0x70,0x6c,0x69,0x74])](_0x343012([0x2e]));if(0x3!=_0x44b3d3[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x34b7f5(_0x44b3d3[0x1]);function _0x34b7f5(_0x5cf2c1){const _0x3c228a=_0x37a4fc(_0x5cf2c1);return _0x3c228a&&_0x50caba()?_0x3c228a:null;function _0x50caba(){const _0x2afd66=_0x3c228a[_0x343012([0x6a,0x74,0x69])],_0x3705d5=window[_0x343012([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2afd66[_0x343012([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2afd66[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2a63e1={..._0x3c228a,[_0x343012([0x6a,0x74,0x69])]:_0x2afd66[_0x343012([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2afd66[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2a63e1[_0x343012([0x76,0x63])],_0x1c44bf(_0x2a63e1)==_0x3705d5;}}}async function _0x57a837(){let _0x1da857=!0x0;try{const _0x4aac49=_0xdb5236[_0x343012([0x73,0x70,0x6c,0x69,0x74])](_0x343012([0x2e])),[_0xea0949,_0x1ef718,_0x47cc5a]=_0x4aac49;return _0x525fbe(_0xea0949),await _0x403297(_0xea0949,_0x1ef718,_0x47cc5a),_0x1da857;}catch{return!0x1;}function _0x525fbe(_0x502941){const _0x27485e=_0x37a4fc(_0x502941);_0x27485e&&_0x27485e[_0x343012([0x61,0x6c,0x67])]==_0x343012([0x45,0x53,0x32,0x35,0x36])||(_0x1da857=!0x1);}async function _0x403297(_0x3ea508,_0x275a2c,_0xe538b){const _0x2e611e=window[_0x343012([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x343012([0x66,0x72,0x6f,0x6d])](_0x33281c(_0xe538b),_0x5ea129=>_0x5ea129[_0x343012([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5c25df=new window[(_0x343012([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x343012([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3ea508+_0x343012([0x2e])+_0x275a2c),_0x513ec9=window[_0x343012([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x343012([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x513ec9)return;const _0x2440b1=await _0x513ec9[_0x343012([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x343012([0x6a,0x77,0x6b]),_0x284199,{[_0x343012([0x6e,0x61,0x6d,0x65])]:_0x343012([0x45,0x43,0x44,0x53,0x41]),[_0x343012([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x343012([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x343012([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x513ec9[_0x343012([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x343012([0x6e,0x61,0x6d,0x65])]:_0x343012([0x45,0x43,0x44,0x53,0x41]),[_0x343012([0x68,0x61,0x73,0x68])]:{[_0x343012([0x6e,0x61,0x6d,0x65])]:_0x343012([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2440b1,_0x2e611e,_0x5c25df)||(_0x1da857=!0x1);}}function _0x37a4fc(_0x11296b){return _0x11296b[_0x343012([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x343012([0x65,0x79]))?JSON[_0x343012([0x70,0x61,0x72,0x73,0x65])](_0x33281c(_0x11296b)):null;}function _0x33281c(_0x13db80){return window[_0x343012([0x61,0x74,0x6f,0x62])](_0x13db80[_0x343012([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x343012([0x2b]))[_0x343012([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x343012([0x2f])));}function _0x1c44bf(_0x136fd3){let _0x33c609=0x1505;function _0x3c904e(_0x48e9ef){for(let _0x2fc9ce=0x0;_0x2fc9ce<_0x48e9ef[_0x343012([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2fc9ce++){const _0x24b93c=_0x48e9ef[_0x343012([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2fc9ce);_0x33c609=(_0x33c609<<0x5)+_0x33c609+_0x24b93c,_0x33c609&=_0x33c609;}}function _0x135d2c(_0x3bc55f){Array[_0x343012([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3bc55f)?_0x3bc55f[_0x343012([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x135d2c):_0x3bc55f&&typeof _0x3bc55f==_0x343012([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x343012([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3bc55f)[_0x343012([0x73,0x6f,0x72,0x74])]()[_0x343012([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x50ce18,_0x9d8147])=>{_0x3c904e(_0x50ce18),_0x135d2c(_0x9d8147);}):_0x3c904e(window[_0x343012([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3bc55f));}return _0x135d2c(_0x136fd3),_0x33c609>>>0x0;}function _0x5367e7(_0x488a30){return _0x488a30[_0x343012([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x343012([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x343012([0x30]));}function _0x45e8e6(_0x2103de){return _0x2103de[_0x343012([0x73,0x70,0x6c,0x69,0x74])]('')[_0x343012([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x343012([0x6a,0x6f,0x69,0x6e])]('');}function _0x268fa(){}function _0x343012(_0x36633c){return _0x36633c['map'](_0x30f3b9=>String['fromCharCode'](_0x30f3b9))['join']('');}_0x28aa41(await _0x3a6cce());}(this);}['showFakeVisualSelection'](){const _0x4733ff=this['editor']['model'];_0x4733ff['change'](_0x352c4b=>{const _0x358e92=_0x4733ff['document']['selection']['getRanges']();let _0x3dc5d6=0x0;for(const _0x5d25f5 of _0x358e92){const _0x19c131=Vt+':'+_0x3dc5d6;if(_0x4733ff['markers']['has'](_0x19c131))_0x352c4b['updateMarker'](_0x19c131,{'range':_0x5d25f5});else{if(_0x5d25f5['start']['isAtEnd']){const _0x2fc1dd=_0x5d25f5['start']['getLastMatchingPosition'](({item:_0x3eaee2})=>!_0x4733ff['schema']['isContent'](_0x3eaee2),{'boundaries':_0x5d25f5});_0x352c4b['addMarker'](_0x19c131,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x352c4b['createRange'](_0x2fc1dd,_0x5d25f5['end'])});}else _0x352c4b['addMarker'](_0x19c131,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5d25f5});}_0x3dc5d6++;}});}['hideFakeVisualSelection'](){const _0xc9b119=this['editor']['model'],_0x376a5e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Vt));_0x376a5e['length']&&_0xc9b119['change'](_0x882599=>{_0x376a5e['forEach'](_0x919da9=>{_0x882599['removeMarker'](_0x919da9);});});}['insertContent'](_0x2cb77b,_0x351bd2){const _0x2620fe=this['_getAISelection'](),_0x44e9b8=_0x351bd2||_0x2620fe['getFirstRange']();this['editor']['model']['canEditAt'](_0x44e9b8)&&this['editor']['model']['change'](_0x3a3e66=>{this['hideFakeVisualSelection'](),_0x351bd2||this['_resetContentOfSelectedTableCells'](_0x3a3e66,_0x2620fe),this['_pasteHTMLUsingClipboard']({'insertAt':_0x44e9b8,'writer':_0x3a3e66,'html':_0x2cb77b});});}['insertContentBelow'](_0x577218){const {model:_0x1c93ea}=this['editor'],_0x13f6b9=this['_getAISelection']();_0x1c93ea['change'](()=>{const _0x5c2c9e=this['_prepareTableInsertBelowPosition'](_0x577218,_0x13f6b9)||this['_getDefaultInsertBelowPosition'](_0x13f6b9);this['insertContent'](_0x577218,_0x5c2c9e);});}['_getAISelection'](){const _0xdf6941=this['editor']['model'],_0xc32937=Array['from'](_0xdf6941['markers']['getMarkersGroup'](Vt))['map'](_0x2c5bb0=>_0x2c5bb0['getRange']());return _0xdf6941['createSelection'](_0xc32937);}['_pasteHTMLUsingClipboard']({writer:_0x287bfa,html:_0x542cca,insertAt:_0x334015}){const {view:_0x2ea975}=this['editor']['editing'],_0x2e77b8=this['editor']['plugins']['get'](Dt),_0x4746d9=new Fn();_0x4746d9['setData']('text/html',_0x542cca);const _0x4d71ec=new ClipboardEvent('paste',{'clipboardData':_0x4746d9}),_0x1d95b4=new jt(_0x2ea975,_0x4d71ec,{'dataTransfer':new Bt(_0x4746d9)});_0x287bfa['setSelection'](_0x334015);const _0x11a09b=(_0x4184e4,_0x12d62e)=>{_0x12d62e['resultRange']&&_0x287bfa['setSelection'](_0x12d62e['resultRange']);};_0x2e77b8['once']('contentInsertion',_0x11a09b,{'priority':'lowest'}),_0x2ea975['document']['fire']('paste',_0x1d95b4),_0x2e77b8['off']('contentInsertion',_0x11a09b);}['_getDefaultInsertBelowPosition'](_0x4dd755){const {model:_0x48cde6}=this['editor'],_0x2584cc=Array['from'](_0x4dd755['getSelectedBlocks']());return _0x2584cc['length']?_0x48cde6['createPositionAfter'](_0x2584cc['pop']()):_0x4dd755['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3d01d6,_0x11b936){const {model:_0x3f56f5,plugins:_0x4a9e99}=this['editor'];if(_0x4a9e99['has']('TableUtils')){const _0x5e7f2b=_0x4a9e99['get']('TableUtils')['getSelectedTableCells'](_0x11b936);if(_0x5e7f2b['length']){const _0x384c47=this['_getTableRowCountFromContent'](_0x3d01d6),_0x2b8c4e=this['_createEmptyTableRows'](_0x5e7f2b,_0x384c47);return _0x3f56f5['createPositionAt'](_0x2b8c4e,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2583b9){const _0x489b39=this['editor']['plugins']['get']('TableUtils'),_0x4e4c4c=this['editor']['data']['parse'](_0x2583b9),_0x41565b=Array['from'](_0x4e4c4c['getChildren']())['filter'](_0x4e106c=>_0x4e106c['is']('element','table'));let _0x4cb810=0x0;return _0x41565b['forEach'](_0x43dc64=>{_0x4cb810+=_0x489b39['getRows'](_0x43dc64);}),_0x4cb810;}['_createEmptyTableRows'](_0x26a08b,_0x1cc40f){const _0x5e4cf3=this['editor']['plugins']['get']('TableUtils'),_0x2b3bfe=_0x5e4cf3['getRowIndexes'](_0x26a08b),_0x10fd87=_0x5e4cf3['getColumnIndexes'](_0x26a08b),_0x5bac72=_0x2b3bfe['last']+0x1,_0x231f6c=_0x10fd87['first'],_0x4192bc=_0x26a08b[0x0]['findAncestor']('table');for(let _0x33cd80=0x0;_0x33cd80<_0x1cc40f;_0x33cd80++)_0x5e4cf3['insertRows'](_0x4192bc,{'at':_0x5bac72});return _0x4192bc['getChild'](_0x5bac72)['getChild'](_0x231f6c);}['_resetContentOfSelectedTableCells'](_0x234095,_0x152817){const {plugins:_0x11e024}=this['editor'],{model:_0x5b20ed}=_0x234095;if(!_0x11e024['has']('TableUtils'))return;_0x11e024['get']('TableUtils')['getSelectedTableCells'](_0x152817)['length']&&_0x5b20ed['deleteContent'](_0x152817);}}class Ai extends _0x3145c9{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x51167b('aiadapter-text-adapter-not-set',null);}}class Rr extends Error{constructor(_0x3656ee){super(_0x3656ee),this['name']='AIRequestError';}}function Yn(_0x33bb73,_0x522ec2,_0x1346fc){const t=_0x33bb73['t'];switch(_0x522ec2){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',_0x1346fc);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1346fc);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'},_0x1346fc);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 _0x522ec2;}}class wi extends At{['_commandDefinitions'];constructor(_0x55616c,_0x25af61){super(_0x55616c),this['_commandDefinitions']=_0x25af61,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3d0229,_0x4c0734,_0x514c6b)=>{this['isEnabled']&&(this['enabledCommandsIds']=hn(this['_commandDefinitions'],_0x514c6b));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x33e6a2,_0xd82d7a,_0x442d9e)=>{this['enabledCommandsIds']=_0x442d9e?hn(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x11c263=this['editor']['model'];this['_hasContext']=function(_0x5be5b8){const _0x5c7779=_0x5be5b8['document']['selection'];return _0x5c7779['isCollapsed']?0x0!==[..._0x5c7779['getSelectedBlocks']()]['length']&&![..._0x5c7779['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x5be5b8['hasContent'](_0x5c7779['getFirstRange']());}(_0x11c263);const _0xf55f82=_0x11c263['document']['selection'],_0x4bdb0f=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x45b277 of _0xf55f82['getRanges']())for(const _0x47f436 of _0x45b277['getItems']())if(_0x47f436['is']('element')&&_0x4bdb0f['includes'](_0x47f436['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x20d494='',_0x3455bc='',_0x4de12d='custom'){this['editor']['plugins']['get'](pe)['showUI'](_0x20d494,_0x3455bc,_0x4de12d);}}function hn(_0x41d601,_0x2ce103){const _0x4e88ba=new Set();for(const _0x328df4 of _0x41d601['values']())(_0x2ce103||!0x1===_0x328df4['requiresContent'])&&_0x4e88ba['add'](_0x328df4['id']);return Array['from'](_0x4e88ba);}const th=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class gi extends/* #__PURE__ -- @preserve */
|
|
24
|
-
qt(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x160cdf,_0xa5b65c,_0x56c3e6){super(),this['editor']=_0x160cdf,this['textAdapter']=_0xa5b65c,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x56c3e6,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4ba7ea,_0x1c3c72,_0x104b7d)=>{this['view']['value']=this['_sanitizeHTML'](_0x104b7d);}),this['listenTo'](this['view'],'submitPrompt',(_0x3ea258,_0x25094b)=>{const _0x8d3adb=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x25094b,_0x8d3adb,'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:_0x46ab46,query:_0x19e1a4,htmlContent:_0x22b971,label:_0x9064ba,mainActionLabel:_0xa429f1}){this['view']['prompt']=_0x9064ba,this['view']['mainAction']=_0xa429f1,this['initialContext']=_0x22b971,_0x19e1a4&&(this['view']['isRendered']?this['_handleQuery'](_0x19e1a4,_0x22b971,_0x46ab46,_0x9064ba):this['view']['once']('render',()=>{this['_handleQuery'](_0x19e1a4,_0x22b971,_0x46ab46,_0x9064ba);}));}['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'](_0xa96f88,_0x5545df,_0x3191ad,_0xfeab85){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5545df,this['previousQuery']=_0xa96f88,this['previousLabel']=_0xfeab85||_0xa96f88,this['previousActionId']=_0x3191ad,new Promise(_0x75bc13=>{this['textAdapter']['makeRequest']({'query':_0xa96f88,'context':_0x5545df,'onData':_0x59ebd=>{this['currentResponse']=_0x59ebd,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3191ad})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3e2448=>{_0x3e2448 instanceof Rr?this['view']['handleError'](_0x3e2448['message']):this['view']['handleError'](),_0x75bc13();})['finally'](()=>{this['stopProcessing'](),_0x75bc13();});});}['_parseAndNormalizeContent'](_0xc9d4ee,_0x252741=!0x1){const _0x216f43=th['exec'](_0xc9d4ee);_0xc9d4ee=_0x216f43?_0xc9d4ee['substring'](_0x216f43[0x1]['length']):_0xc9d4ee['length']<0x64&&!_0x252741?'':this['_stripMarkdownSyntax'](_0xc9d4ee);const _0x3ab463=this['_domParser']['parseFromString'](_0xc9d4ee,'text/html');if(_0x216f43){const _0x56c12a=Array['from'](_0x3ab463['body']['childNodes']);_0x56c12a['reverse']();for(const _0x1c5559 of _0x56c12a){if(_0x1c5559['nodeType']==Node['ELEMENT_NODE'])break;_0x1c5559['remove']();}}const _0x49e075=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3ab463['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x49e075);const _0x368998=this['editor']['config']['get']('ai.assistant.preserveComments'),_0xb8edfc=this['editor']['data']['toModel'](_0x49e075);return _0x368998||_0xb8edfc['markers']['clear'](),this['editor']['data']['stringify'](_0xb8edfc);}['_normalizeResponseHeadings'](_0x5d3823){const _0x5ed916=new _0xfd9aac(this['editor']['editing']['view']['document']),_0x2d9fc4=new _0x5da802({'name':/^h[1-5]$/}),_0x5315c8=[];let _0xe6c7a6=!0x1;for(const _0xd9dd6c of _0x5d3823)_0xd9dd6c['is']('element')&&_0x2d9fc4['match'](_0xd9dd6c)&&(_0x5315c8['push'](_0xd9dd6c),'h1'==_0xd9dd6c['name']&&(_0xe6c7a6=!0x0));if(_0xe6c7a6){for(const _0x3ae943 of _0x5315c8)_0x5ed916['rename']('h'+(parseInt(_0x3ae943['name'][0x1])+0x1),_0x3ae943);}}['_isH1TagSupportEnabled'](){const {data:_0x3c97bf,editing:_0x5df43b}=this['editor'],_0x341f19=_0x3c97bf['htmlProcessor']['toView']('<h1></h1>'),_0x2f9381=_0x3c97bf['toView'](_0x3c97bf['toModel'](_0x341f19));return!!_0x5df43b['view']['domConverter']['viewToDom'](_0x2f9381)['querySelector']('h1');}['_sanitizeHTML'](_0x57349f){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x57349f),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x104048){const _0x5191ac=_0x104048['trim']();return _0x5191ac['startsWith']('```html')?_0x5191ac['endsWith']('```')?_0x5191ac['substring'](0x7,_0x5191ac['length']-0x3):_0x5191ac['substring'](0x7):_0x104048;}}const Ii={'REPLACE':'replace','INSERT':'insert'};class Er extends _0x36a471{constructor(_0x18fffe){super(_0x18fffe),this['set']('isVisible',!0x1),this['set']('mainAction',Ii['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x5a091b=>Yn(_0x18fffe,'AI_'+_0x5a091b['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0x18fffe,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0x18fffe,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0x18fffe,'Stop'));const _0x251a58=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x251a58['if']('isVisible','ck-hidden',_0x213474=>!_0x213474)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x8adeb5,_0x248807){const _0x5c0c25=new tt(this['locale']);return _0x5c0c25['set']({'label':_0x8adeb5,'class':_0x248807||'','isVisible':!0x0,'withText':!0x0}),_0x5c0c25;}}class Hr extends st{['contentFieldView'];['copyButtonView'];constructor(_0x4d22d1,_0xe748f1=''){super(_0x4d22d1),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4f0f60=this['bindTemplate'];this['contentFieldView']=new $n(_0x4d22d1,_0xe748f1),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4f0f60['if']('isVisible','ck-hidden',_0x3644c3=>!_0x3644c3)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4f0f60['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 _0x4aa835=!0x1;this['on']('change:value',(_0x29e677,_0x502ee8,_0x26a1f1)=>{const _0x5c0e05=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x26a1f1),this['isProcessing']&&_0x5c0e05&&!_0x4aa835&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x31a311,_0x322b86,_0x1ce8f9)=>{_0x4aa835=!0x1,_0x1ce8f9?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4aa835=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4aa835=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5223a5=this['locale'],_0x10f5ad=new tt(this['locale']),_0x53accc='ck-ai-form__copy-button';return _0x10f5ad['set']({'label':Yn(_0x5223a5,'Copy'),'icon':_0x42428b,'class':_0x53accc,'tooltip':!0x0}),_0x10f5ad['bind']('isVisible')['to'](this,'value',_0x137b20=>!!_0x137b20),_0x10f5ad['bind']('isEnabled')['to'](this,'isProcessing',_0x3f0d8e=>!_0x3f0d8e),_0x10f5ad['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x10f5ad['icon']=_0x4ffa92,_0x10f5ad['class']=_0x53accc+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x10f5ad['icon']=_0x42428b,_0x10f5ad['class']=_0x53accc;},0x3e8);}),_0x10f5ad;}['_copyHTMLToClipboard'](_0x1929be){const {window:_0x29907e,document:_0x4702ad}=_0x2909f5;if(_0x29907e['ClipboardItem']){const {Blob:_0x574455,ClipboardItem:_0x4cde63}=_0x29907e,_0x27542a=[new _0x4cde63({'text/html':new _0x574455([_0x1929be['innerHTML']],{'type':'text/html'}),'text/plain':new _0x574455([_0x1929be['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x27542a);}else{const _0x3ba288=_0x4702ad['createElement']('div');_0x3ba288['style']['position']='absolute',_0x3ba288['style']['left']='-9999px',_0x3ba288['innerHTML']='<span>[</span>'+_0x1929be['innerHTML']+'<span>]</span>',_0x4702ad['body']['appendChild'](_0x3ba288);const _0x49a9d9=_0x4702ad['createRange']();_0x49a9d9['setStartAfter'](_0x3ba288['firstElementChild']),_0x49a9d9['setEndBefore'](_0x3ba288['lastElementChild']);const _0x438a08=_0x29907e['getSelection']();_0x438a08['removeAllRanges'](),_0x438a08['addRange'](_0x49a9d9),_0x4702ad['execCommand']('copy'),_0x3ba288['remove']();}}}class $n extends st{constructor(_0x258292,_0x208491=''){super(_0x258292),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x208491,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x371511){this['element']['innerHTML']=_0x371511;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x699b7e=new st(),_0x59bd60=this['locale'],_0x8a4b45=new _0x1e0886();return _0x8a4b45['isVisible']=!0x0,_0x699b7e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x8a4b45,{'text':Yn(_0x59bd60,'AI\x20is\x20writing...')}]}),_0x699b7e['render'](),_0x699b7e;}}class Br extends st{constructor(_0x2aec5b,_0x5c3660=''){super(_0x2aec5b);const _0x3c2622=new _0x202d8c(),_0x138210=this['bindTemplate'];this['set']('text',_0x5c3660),_0x3c2622['content']=_0x25ebf7,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3c2622,{'text':_0x138210['to']('text')}]});}}class Tr extends _0x5c4293{['submitButtonView'];['showHistoryButtonView'];constructor(_0x198526,_0x542925){super(_0x198526,_0x542925),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',(_0x28dfe0,_0x6877aa)=>{_0x28dfe0['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x6877aa());});}['_createSubmitButton'](){const _0x301981=new tt(this['locale']),_0x4aab16=this['locale'];return _0x301981['set']({'icon':_0xc5da5d,'label':Yn(_0x4aab16,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x301981['on']('execute',()=>{this['submit']();}),_0x301981['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x1c3b30,_0x2a0b74)=>!_0x1c3b30&&_0x2a0b74),_0x301981;}['_createShowHistoryButton'](){const _0x88ccc8=new tt(this['locale']),_0x3bedf3=this['resultsView'],_0x226733=this['locale'];_0x88ccc8['set']({'label':Yn(_0x226733,'History'),'withText':!0x1,'icon':_0x30fbfe,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x88ccc8['bind']('isOn')['to'](_0x3bedf3,'isVisible'),_0x88ccc8['bind']('isEnabled')['to'](this,'isEnabled'),_0x88ccc8['on']('execute',()=>{_0x3bedf3['isVisible']=!_0x3bedf3['isVisible'],_0x3bedf3['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4049ee=()=>{_0x2909f5['window']['requestAnimationFrame'](()=>{if(_0x138911(this['element'])){const _0x10974b=new _0x401654(this['queryView']['fieldView']['element']),_0x58620a=_0x10974b['width'],_0x2d1d74='rtl'===_0x226733['uiLanguageDirection']?'left':'right';_0x10974b['excludeScrollbarsAndBorders'](),_0x88ccc8['element']['style'][_0x2d1d74]=_0x58620a-_0x10974b['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4049ee),this['on']('render',_0x4049ee),_0x88ccc8;}['submit'](){const _0x2d3aa2=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2d3aa2);}['focus'](_0x5a40e9){-0x1===_0x5a40e9?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class qr extends _0x493f65{['historyGroupView'];['clearHistoryButton'];constructor(_0x3ffd64){super(_0x3ffd64),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x329354(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x3ffd64,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4d3e25=0x0;for(const _0x3483f1 of this['items'])_0x4d3e25+=_0x3483f1['items']['length'];return{'resultsCount':_0x4d3e25,'totalItemsCount':_0x4d3e25};}['_createClearHistoryButton'](){const _0x4141d4=this['locale'],_0xf57ddb=new tt(this['locale']);return _0xf57ddb['set']({'label':'('+Yn(_0x4141d4,'Clear')+')','withText':!0x0}),_0xf57ddb['on']('execute',()=>this['fire']('clearHistory')),_0xf57ddb;}}class Fr extends _0x5374ac{constructor(_0x1981ef){super();const _0x3a4faf=new _0x40384f(),_0x154f84=new tt(this['locale'],_0x3a4faf);this['children']['add'](_0x154f84),_0x154f84['set']({'label':_0x1981ef['prompt'],'withText':!0x0}),_0x154f84['on']('execute',()=>{this['fire']('execute',{'value':_0x1eea17(_0x1981ef['prompt'])});});}}const Jo='CKEditor/AIFormView/PromptHistory';class Or extends _0x4d07d3{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x5091bb,_0x2b074c)=>{const _0x129871=zo(_0x2b074c['prompt']);for(const _0x4a56e9 of this)if(_0x4a56e9!=_0x2b074c&&zo(_0x4a56e9['prompt'])===_0x129871){this['remove'](_0x4a56e9);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x3e3730=sessionStorage['getItem'](Jo)||'[]';this['addMany'](JSON['parse'](_0x3e3730));}['_saveToSessionStorage'](){sessionStorage['setItem'](Jo,JSON['stringify'](this['map'](_0x5ec432=>_0x5ec432)));}}function zo(_0xab3797){return _0xab3797['toLowerCase']()['trim']();}class Li extends st{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2a1d99,_0x4fa383,_0x1d46f6=''){super(_0x2a1d99),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Ii['REPLACE']),this['_promptHistory']=new Or(),this['errorView']=new Br(_0x2a1d99),this['contentArea']=new Hr(_0x2a1d99,_0x1d46f6),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 _0x156d7c(),this['keystrokes']=new _0x2ec108(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x3ac126({'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 _0x574287=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4fa383],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x574287['if']('isError','ck-hidden',_0x5c7d64=>!_0x5c7d64)]},'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'](_0x41c7eb=0x1){-0x1===_0x41c7eb?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 _0x57fcc5=this['locale'],_0x405758=new Tr(_0x57fcc5,{'queryView':{'label':Yn(_0x57fcc5,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x1db25d,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x57fcc5,'Empty\x20history'),'secondary':Yn(_0x57fcc5,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x405758['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5b7137,_0x101ff8)=>_0x5b7137&&!_0x101ff8),this['listenTo'](_0x405758,'submit',(_0x46781f,_0x1b5254)=>{this['prompt']=_0x1b5254;const _0x48b84c=Xt(_0x1b5254);this['fire']('submitPrompt',_0x48b84c),_0x1b5254['trim']()&&this['_promptHistory']['add']({'prompt':_0x48b84c},0x0);},{'priority':'high'}),_0x405758;}['_createHistoryView'](){const _0x5b32b8=new qr(this['locale']);return _0x5b32b8['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Fr),_0x5b32b8['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x5b32b8;}['_createToolbar'](){const _0x4e3b7a=new Er(this['locale']);return _0x4e3b7a['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xb54162,_0x2a1d05,_0x4dfedd)=>_0xb54162&&!_0x2a1d05&&!!_0x4dfedd),_0x4e3b7a['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4e3b7a['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5dc685,_0x5f2c87,_0x284970)=>_0x5dc685&&!_0x5f2c87&&!!_0x284970),_0x4e3b7a['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4e3b7a['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x365e24,_0x5a4544)=>_0x365e24&&!_0x5a4544),_0x4e3b7a['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4e3b7a['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4e3b7a['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4e3b7a;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x14cbd5=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x14cbd5,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x54e539){const _0x3a1022=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x54e539||Yn(_0x3a1022,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Ft=globalThis['DataTransfer'];class pe extends _0x3145c9{['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[_0x335fcd,ge,Ai,_0xee4d10];}constructor(_0x1fc33d){super(_0x1fc33d),_0x1fc33d['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1fc33d['config']['define']('ai.assistant.contentAreaCssClass',''),_0x1fc33d['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1fc33d['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x7f553}=this;this['_aiAdapter']=_0x7f553['plugins']['get'](Ai),this['_dialog']=_0x7f553['plugins']['get'](_0xee4d10),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4b4032=new wi(_0x7f553,Array['from'](this['_commandDefinitions']['values']()));_0x7f553['commands']['add']('showAIAssistant',_0x4b4032),_0x7f553['ui']['componentFactory']['add']('aiCommands',_0x564c41=>{const _0x5b5c20=_0x3e6542(_0x564c41);return _0x5b5c20['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5b5c20['buttonView']['set']({'label':Yn(_0x564c41,'AI\x20Commands'),'icon':_0x2d9e51,'tooltip':!0x0}),_0x5b5c20['on']('execute',_0x18d51b=>this['_onExecute'](_0x18d51b['source']['id'])),_0x2bcc85(_0x5b5c20,_0x7f553['ui']['view']['body'],function(_0x69f40a){const _0x295dd0=de(_0x69f40a['config']['get']('ai.assistant.commands'),_0x69f40a['locale']),_0x35838b=yi(_0x69f40a,_0x295dd0)['filter'](_0x2d9082=>_0x2d9082['commands']['length']);if(0x1===_0x35838b['length'])return yi(_0x69f40a,_0x35838b[0x0]['commands'])['map'](_0x47e463=>({'id':_0x47e463['id'],'label':_0x47e463['label']}));return _0x35838b['map'](_0x49a60c=>{const {groupId:_0x21890d,groupLabel:_0x5f1e42,commands:_0x417dbb}=_0x49a60c,_0x3d7239=yi(_0x69f40a,_0x417dbb)['map'](_0x1e29f8=>({'id':_0x1e29f8['id'],'label':_0x1e29f8['label']}));return{'id':_0x21890d,'menu':_0x5f1e42||_0x21890d,'children':_0x3d7239};});}(_0x7f553),{'ariaLabel':Yn(_0x564c41,'AI\x20Commands')}),_0x5b5c20['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4b4032['on']('change:enabledCommandsIds',_0x578f77),_0x5b5c20['menuView']['once']('render',_0x578f77),_0x5b5c20;function _0x578f77(){_0x5b5c20['isEnabled']=_0x4b4032['enabledCommandsIds']['length']>0x0;for(const _0x503c35 of _0x5b5c20['menuView']['buttons'])_0x503c35['isEnabled']=_0x4b4032['enabledCommandsIds']['includes'](_0x503c35['id']);}}),_0x7f553['ui']['componentFactory']['add']('menuBar:aiCommands',_0x16bc5b=>{const _0x36ba53=new vt(_0x16bc5b);_0x36ba53['buttonView']['set']({'label':Yn(_0x16bc5b,'AI\x20Commands'),'icon':_0x2d9e51}),_0x36ba53['bind']('isEnabled')['to'](_0x4b4032,'enabledCommandsIds',_0x149979=>_0x149979['length']>0x0);const _0x277f81=de(_0x7f553['config']['get']('ai.assistant.commands'),_0x16bc5b);return this['_populateMenuBarMenu'](_0x4b4032,_0x36ba53,_0x277f81,_0x2f7c86=>this['_onExecute'](_0x2f7c86)),_0x36ba53;}),_0x7f553['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x389dcd=this['_createAIAssistantUIButton'](tt);return _0x389dcd['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x389dcd;}),_0x7f553['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x9ad36b=this['_createAIAssistantUIButton'](Kt);return _0x9ad36b['set']({'role':'menuitemcheckbox'}),_0x9ad36b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x143936=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1aa10f;for(const _0x26fbfe in _0x143936){const _0x11c2b6=_0x26fbfe,_0x38503d=_0x143936[_0x11c2b6];if('aiLicenseKeyValid'==_0x38503d||'aiLicenseKeyInvalid'==_0x38503d||'aiLicenseKeyExpired'==_0x38503d||'aiLicenseKeyDomainLimit'==_0x38503d||'aiLicenseKeyNotAllowed'==_0x38503d||'aiLicenseKeyEvaluationLimit'==_0x38503d||'aiLicenseKeyTrialLimit'==_0x38503d||'aiLicenseKeyUsageLimit'==_0x38503d){delete _0x143936[_0x11c2b6],_0x1aa10f=_0x38503d,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1aa10f&&_0x143936['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1aa10f&&_0x143936['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1aa10f&&_0x143936['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1aa10f&&_0x143936['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1aa10f&&_0x143936['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1aa10f&&_0x143936['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1aa10f&&_0x143936['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x496745='',_0x40810d='',_0x1e108e='custom'){const _0x30d2ec=this['editor'],_0xa15f8c=_0x30d2ec['editing']['view'],_0x27e8ff=_0x30d2ec['plugins']['get'](ge),_0x73a19d=_0x30d2ec['plugins']['get'](_0x335fcd);_0x27e8ff['showFakeVisualSelection']();const _0x5d2367=new Ft(),_0x5d17d8=new ClipboardEvent('copy',{'clipboardData':_0x5d2367}),_0x451a87=new Bt(_0x5d2367),_0x243e05=new jt(_0xa15f8c,_0x5d17d8,{'dataTransfer':_0x451a87});_0x73a19d['_forceMarkersCopy']('comment',()=>{_0xa15f8c['document']['fire']('copy',_0x243e05);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new gi(_0x30d2ec,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xa7b321=_0x451a87['getData']('text/html');const _0x18ee0d=_0x30d2ec['model']['document']['selection'],_0x2746a8=Array['from'](_0x18ee0d['getRanges']());0x1===_0x2746a8['length']&&_0x2746a8[0x0]['isFlat']&&!_0x18ee0d['getSelectedElement']()&&''!==_0xa7b321['replace'](/ /g,'')['trim']()&&(_0xa7b321='<p>'+_0xa7b321+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1e108e,'query':_0x496745,'htmlContent':_0xa7b321,'label':_0x40810d,'mainActionLabel':Ii[_0x30d2ec['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x452ca2,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x4354d0['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x27e8ff['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x128197=new Map(),_0x476835=de(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x272c92 of _0x476835)for(const _0x230265 of _0x272c92['commands'])_0x128197['set'](_0x230265['id'],{..._0x230265,'groupId':_0x272c92['groupId'],'groupLabel':_0x272c92['groupLabel']||_0x272c92['groupId']});return _0x128197;}['_createAIAssistantUIButton'](_0x5c8d55){const _0x4cce62=this['editor'],_0x2ca210=_0x4cce62['commands']['get']('showAIAssistant'),_0x243e45=new _0x5c8d55(_0x4cce62['locale']);return _0x243e45['set']({'label':Yn(_0x4cce62['locale'],'AI\x20Assistant'),'icon':_0x452ca2,'isToggleable':!0x0}),_0x243e45['bind']('isEnabled')['to'](_0x2ca210),_0x243e45['bind']('isOn')['to'](this['_dialog'],'id',_0x25a4fb=>'aiAssistant'===_0x25a4fb),this['listenTo'](_0x243e45,'execute',()=>{_0x243e45['isOn']?this['hideUI']():_0x2ca210['execute']();}),_0x243e45;}['_initView'](){const _0x3e67ad=this['editor']['plugins']['get'](ge);this['_formView']=new Li(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',()=>{_0x3e67ad['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3e67ad['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x8cf003,ui:{ariaLiveAnnouncer:_0x59d0fe}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1c9b67,_0x66d72f,_0x4584e8)=>{const _0x37896f=this['_aiAssistantController']['currentContext'];_0x4584e8?_0x59d0fe['announce'](Yn(_0x8cf003,'AI\x20is\x20writing')):_0x37896f&&_0x59d0fe['announce'](Yn(_0x8cf003,'Generated\x20content:\x20%0',_0x37896f),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x34c0ad,_0x13f7bd,_0x4317a2)=>{if(_0x4317a2){const _0x42b6a4=this['_formView']['errorView']['text'];_0x59d0fe['announce'](Yn(_0x8cf003,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x42b6a4));}});}['_onExecute'](_0xa0cafe){const _0x31335e=this['_commandDefinitions']['get'](_0xa0cafe),_0x4a53ef=this['editor'],_0xc2d158=_0x4a53ef['model']['document']['selection'],_0x35d22d=_0x4a53ef['commands']['get']('showAIAssistant'),_0xaae44f=_0x4a53ef['plugins']['get'](ge),_0x57346b=''+(_0x31335e['groupId']!==fi?_0x31335e['groupLabel']+':\x20':'')+_0x31335e['label'];if(!0x1!==_0x31335e['requiresContent']&&_0xc2d158['isCollapsed']){const _0x1ba66c=nt(_0xc2d158['getSelectedBlocks']())||_0x4a53ef['model']['schema']['getLimitElement'](_0xc2d158);_0x4a53ef['model']['change'](_0x5c7a75=>{_0x5c7a75['setSelection'](_0x1ba66c,'in');});}_0xaae44f['showFakeVisualSelection'](),_0x35d22d['execute'](_0x31335e['prompt'],_0x57346b,'command:'+_0xa0cafe);}['_populateMenuBarMenu'](_0xdd43db,_0x2e7a3b,_0x53a5fa,_0x21e110){const _0x2b7c21=this['editor'],_0xc0c157=_0x2b7c21['locale'],_0x3e07c8=new bt(_0xc0c157),_0x32ff83=yi(_0x2b7c21,_0x53a5fa)['filter'](_0x23641f=>_0x23641f['commands']['length']);0x1===_0x32ff83['length']?this['_getMenuBarGroupButtons']({'command':_0xdd43db,'commands':_0x32ff83[0x0]['commands'],'parentMenuView':_0x2e7a3b,'onExecute':_0x21e110})['forEach'](_0x58fc86=>_0x3e07c8['items']['add'](_0x58fc86)):_0x32ff83['forEach'](({groupId:_0x137df9,groupLabel:_0x292076,commands:_0x2ef799})=>{const _0x698585=new Pt(_0xc0c157,_0x2e7a3b),_0xe2fd08=new vt(_0xc0c157),_0x183ec=new bt(_0xc0c157),_0x34c0ab=this['_getMenuBarGroupButtons']({'command':_0xdd43db,'commands':_0x2ef799,'parentMenuView':_0xe2fd08,'onExecute':_0x21e110});_0xe2fd08['buttonView']['set']({'label':_0x292076||_0x137df9}),_0xe2fd08['delegate']('execute')['to'](_0x2e7a3b),_0x183ec['items']['addMany'](_0x34c0ab),_0xe2fd08['panelView']['children']['add'](_0x183ec),_0x698585['children']['add'](_0xe2fd08),_0x3e07c8['items']['add'](_0x698585);}),_0x2e7a3b['panelView']['children']['add'](_0x3e07c8);}['_getMenuBarGroupButtons']({command:_0x1afacd,commands:_0x1dd4f5,parentMenuView:_0x5d73ed,onExecute:_0x34a542}){const _0x3d265d=this['editor'],_0x55535a=_0x3d265d['locale'];return yi(_0x3d265d,_0x1dd4f5)['map'](_0x4a19d9=>{const _0x11b9b9=new Pt(_0x55535a,_0x5d73ed),_0x17288c=new Kt(_0x55535a);return _0x17288c['set']({'label':_0x4a19d9['label']}),_0x17288c['delegate']('execute')['to'](_0x5d73ed),_0x17288c['on']('execute',()=>_0x34a542(_0x4a19d9['id'])),_0x17288c['bind']('isEnabled')['to'](_0x1afacd,'enabledCommandsIds',_0xdd7566=>_0xdd7566['includes'](_0x4a19d9['id'])),_0x11b9b9['children']['add'](_0x17288c),_0x11b9b9;});}}function vi(_0x58a725,_0x5b6d2f){return void 0x0!==_0x58a725['order']&&void 0x0===_0x5b6d2f['order']?0x1:void 0x0===_0x58a725['order']&&void 0x0!==_0x5b6d2f['order']?-0x1:void 0x0!==_0x58a725['order']&&void 0x0!==_0x5b6d2f['order']?_0x58a725['order']-_0x5b6d2f['order']:0x0;}function yi(_0x593326,_0x8374f3){_0x8374f3['sort'](vi);const _0x19e115={},_0x1f8802=[];for(const _0x3d94a1 of _0x8374f3)if(void 0x0!==_0x3d94a1['order']){if(_0x3d94a1['order']in _0x19e115)throw new _0x51167b('ai-commands-config-order-collision',_0x593326,{'conflictingDefinitions':[_0x3d94a1,_0x19e115[_0x3d94a1['order']]]});_0x19e115[_0x3d94a1['order']]=_0x3d94a1,_0x1f8802['splice'](_0x3d94a1['order'],0x0,_0x3d94a1);}else _0x1f8802['push'](_0x3d94a1);return _0x1f8802;}class qn extends _0x3145c9{static get['requires'](){return[pe,ge];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4f5f4c){super(_0x4f5f4c);const _0x430a9b=_0x4f5f4c['config'],_0x1830a2=_0x4f5f4c['locale'];_0x430a9b['define']('ai.assistant.preserveComments',!0x0),_0x430a9b['define']('ai.assistant.commands',Qn(_0x1830a2)),_0x430a9b['define']('ai.assistant.extraCommandGroups',[]),_0x430a9b['define']('ai.assistant.removeCommands',[]);let _0x5622e6=de(_0x430a9b['get']('ai.assistant.commands'),_0x1830a2);const _0x146fc8=_0x430a9b['get']('ai.assistant.extraCommandGroups'),_0xa59e4c=_0x430a9b['get']('ai.assistant.removeCommands');_0x146fc8['forEach'](_0xc04e9c=>{const _0x49d40e=_0x5622e6['find'](_0x8d63e7=>_0x8d63e7['groupId']===_0xc04e9c['groupId']);_0x49d40e?_0x49d40e['commands']=_0x49d40e['commands']['concat'](_0xc04e9c['commands']):_0x5622e6['push'](_0xc04e9c);}),_0x5622e6=_0x5622e6['filter'](_0x1624cd=>!_0xa59e4c['includes'](_0x1624cd['groupId'])),_0x5622e6['forEach'](_0x4ef578=>{_0x4ef578['commands']=_0x4ef578['commands']['filter'](_0x207673=>!_0xa59e4c['includes'](_0x207673['id']));}),_0x430a9b['set']('ai.assistant.commands',_0x5622e6);}}function Qn(_0x4ce9ea){return[{'groupId':'editOrReview','groupLabel':Yn(_0x4ce9ea,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x4ce9ea,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x4ce9ea,'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(_0x4ce9ea,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x4ce9ea,'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(_0x4ce9ea,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x4ce9ea,'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(_0x4ce9ea,'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(_0x4ce9ea,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x4ce9ea,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x4ce9ea,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x4ce9ea,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x4ce9ea,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x4ce9ea,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x4ce9ea,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x4ce9ea,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x4ce9ea,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x4ce9ea,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x4ce9ea,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x4ce9ea,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x4ce9ea,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x4ce9ea,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x4ce9ea,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x4ce9ea,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x4ce9ea,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x4ce9ea,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x4ce9ea,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x4ce9ea,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ta extends _0x3145c9{['abortController'];static get['requires'](){return[Ai];}constructor(_0x1cf573){super(_0x1cf573),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Ai)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x219ade){return this['sendRequest'](_0x219ade)['catch'](_0x520361=>{if(_0x520361 instanceof Rr)return Promise['reject'](_0x520361);if('AbortError'==_0x520361['name'])return Promise['resolve']();throw console['error'](_0x520361),new _0x51167b('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3b4dae,_0x428736){const _0x1de38=this['editor']['locale'],_0x17dd95={'Content-Type':'application/json'};if('object'==typeof _0x3b4dae)Object['assign'](_0x17dd95,_0x3b4dae);else{if(_0x3b4dae)try{const _0x54153f=await _0x3b4dae(_0x428736);Object['assign'](_0x17dd95,_0x54153f);}catch{return Promise['reject'](new Rr(Yn(_0x1de38,'AI_ERROR_GET_HEADERS')));}}return _0x17dd95;}async['_prepareRequestParameters'](_0x3800ff,_0x3c4257){const _0x53d697=this['editor']['locale'];if('object'==typeof _0x3800ff)return _0x3800ff;try{return await _0x3800ff(_0x3c4257);}catch{return Promise['reject'](new Rr(Yn(_0x53d697,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends ta{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4d7cff){super(_0x4d7cff),_0x4d7cff['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4d7cff['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4d7cff['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4d7cff['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4d7cff['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4d7cff['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0xf20a72,context:_0xb7c766,onData:_0x1bd085,actionId:_0x2584b4}){const _0x11cb2b=this['editor']['locale'],_0x57fa3c=await this['prepareMessages'](_0xf20a72,_0xb7c766,_0x2584b4),_0x4f42c5=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2584b4),_0xd5f393=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2584b4),_0x1c54a8={'messages':_0x57fa3c,..._0xd5f393},_0x49ab2a={'method':'POST','headers':_0x4f42c5,'body':JSON['stringify'](_0x1c54a8),'signal':this['abortController']['signal']},_0x51eb1c=await fetch(this['_apiUrl'],_0x49ab2a);if(_0x51eb1c['ok'])return _0xd5f393['stream']?await this['_readStreamableResponse'](_0x51eb1c,_0x1bd085):await this['_readStaticResponse'](_0x51eb1c,_0x1bd085),Promise['resolve']();{const _0x1f5c94=await _0x51eb1c['text']();return _0x1f5c94['includes']('context_length_exceeded')?Promise['reject'](new Rr(Yn(_0x11cb2b,'AI_ERROR_CONTEXT_LENGTH'))):_0x1f5c94['includes']('Moderation')?Promise['reject'](new Rr(Yn(_0x11cb2b,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1f5c94));}}async['prepareMessages'](_0x56ad36,_0x3fac7a,_0x55edec){let _0x541732,_0x423e11;return _0x3fac7a?(_0x541732='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.',_0x423e11='Instruction:\x0a'+_0x56ad36+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3fac7a):(_0x541732='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.',_0x423e11=_0x56ad36),[{'role':'system','content':_0x541732},{'role':'user','content':_0x423e11}];}async['_readStreamableResponse'](_0x22fc99,_0x583e16){const _0x196ce5=_0x22fc99['body']['getReader'](),_0x57d977=new TextDecoder();let _0x4253dc='',_0x14d083='',_0x57e4c7='',_0x23aa16=!0x1;for(;!_0x23aa16;){const {done:_0x303c6a,value:_0x530ec7}=await _0x196ce5['read'](),_0x1f6a0a=_0x4253dc+_0x57d977['decode'](_0x530ec7);let _0x117be5='';_0x23aa16=_0x303c6a;try{_0x117be5=this['_cleanUpData'](_0x1f6a0a),_0x4253dc='';}catch{_0x4253dc=_0x1f6a0a;continue;}_0x14d083+=_0x117be5,!_0x23aa16&&this['_isBufferIncomplete'](_0x14d083)||_0x14d083&&(_0x57e4c7+=_0x14d083,_0x14d083='',_0x583e16(_0x57e4c7));}return Promise['resolve']();}async['_readStaticResponse'](_0xf0831f,_0x53e5ac){return _0x53e5ac((await _0xf0831f['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x5f1d3c){const _0x392553=_0x5f1d3c['split']('<')['length']!==_0x5f1d3c['split']('>')['length'],_0xeba066=_0x5f1d3c['length']<0x1e;return _0x392553&&_0xeba066;}['_cleanUpData'](_0x2b5907){return _0x2b5907['split'](/\n(?![^{]*\})/g)['map'](_0x2f161f=>_0x2f161f['replace']('data:\x20',''))['filter'](_0x572467=>_0x572467&&_0x572467['length']>0x0&&'[DONE]'!==_0x572467)['map'](_0x54461f=>{const {choices:_0x18a793}=JSON['parse'](_0x54461f);if(_0x18a793[0x0]?.['delta']?.['content'])return _0x18a793[0x0]['delta']['content'];})['filter'](_0x4a4ddd=>_0x4a4ddd)['join']('');}}class zn extends ta{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2a2f90){super(_0x2a2f90),_0x2a2f90['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x2a2f90['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']=_0x2a2f90['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x2a2f90['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2a2f90['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x2a2f90['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x2db06d,context:_0x2c8859,onData:_0x348fca,actionId:_0x1b0c71}){const {model:_0x231b29,stream:_0x2dc282,..._0x33197c}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1b0c71),_0x14b6b3={'prompt':await this['preparePrompt'](_0x2db06d,_0x2c8859,_0x231b29,_0x1b0c71),..._0x33197c};this['_apiUrl']?await this['_processProxyRequest'](_0x14b6b3,_0x231b29,_0x2dc282,_0x348fca,_0x1b0c71):await this['_processAWSRequest'](_0x14b6b3,_0x231b29,_0x2dc282,_0x348fca);}async['preparePrompt'](_0x95abb3,_0x102f6a,_0x569ba8,_0x2cc171){let _0x377737,_0x1a85b1;return _0x102f6a?(_0x377737='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.',_0x1a85b1='Instruction:\x0a'+_0x95abb3+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x102f6a):(_0x377737='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.',_0x1a85b1=_0x95abb3),'meta.llama'==this['getModelFamily'](_0x569ba8)?'<<SYS>>\x0a'+_0x377737+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x1a85b1+'\x0a[/INST]':'Human:\x0a'+_0x377737+'\x0a'+_0x1a85b1+'\x0a\x0aAssistant:';}['getModelFamily'](_0x13c781){if(/^anthropic\.claude/['test'](_0x13c781))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x13c781))return'ai21.j2';if(/^cohere\.command/['test'](_0x13c781))return'cohere.command';if(/^meta\.llama/['test'](_0x13c781))return'meta.llama';throw new Rr(Yn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x13c781));}async['_processProxyRequest'](_0x2e908d,_0x3dbddc,_0x15d26b,_0x8d8557,_0x2c870c){const _0x4feff2={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2c870c),'body':JSON['stringify']({..._0x2e908d,'model':_0x3dbddc,'stream':_0x15d26b}),'signal':this['abortController']['signal']},_0x52d9b9=await fetch(this['_apiUrl'],_0x4feff2);_0x15d26b?await this['_readStreamableResponse'](_0x52d9b9,_0x3dbddc,_0x8d8557):await this['_readStaticResponse'](_0x52d9b9,_0x3dbddc,_0x8d8557);}async['_processAWSRequest'](_0x595f70,_0x34cb68,_0x10324c,_0x36683e){const _0x490d61=new _0x459a7f(this['_bedrockClientConfig']),_0x213665={'body':JSON['stringify'](_0x595f70),'contentType':'application/json','accept':'application/json','modelId':_0x34cb68};let _0x32b1ee;if(_0x10324c){const _0x4c9243=new _0x1d3fb2(_0x213665);_0x32b1ee=await _0x490d61['send'](_0x4c9243,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x32b1ee,_0x34cb68,_0x36683e);}else{const _0x3e725f=new _0x2404f7(_0x213665);_0x32b1ee=await _0x490d61['send'](_0x3e725f,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x32b1ee,_0x34cb68,_0x36683e);}}async['_readAsyncIterableResponse'](_0x32c96f,_0x5919b0,_0x17886e){const _0x1671d9=_0x32c96f['body'],_0x195ea4=new TextDecoder('utf-8');let _0x1ceb63='';for await(const _0x1dc6bb of _0x1671d9)if(_0x1dc6bb['chunk']){const _0x285056=_0x195ea4['decode'](_0x1dc6bb['chunk']['bytes']),_0x1ca326=JSON['parse'](_0x285056);_0x1ceb63+=this['_getGeneratedText'](_0x1ca326,_0x5919b0),_0x17886e(_0x1ceb63);}return Promise['resolve']();}async['_readStreamableResponse'](_0x431351,_0x550c58,_0x48d20a){const _0x47dcfa=_0x431351['body'],_0x3f85b9=new TextDecoder('utf-8'),_0x37f3e4=_0x47dcfa['getReader']();let _0x53091b='',_0x2c4895='',_0x213d73=!0x1;for(;!_0x213d73;){const {done:_0x4d21d2,value:_0xdb9d7f}=await _0x37f3e4['read']();if(_0x213d73=_0x4d21d2,_0x213d73)break;const _0x140e96=(_0x53091b+_0x3f85b9['decode'](_0xdb9d7f))['split']('\x0a')['map'](_0x15be4f=>{try{return _0x53091b='',JSON['parse'](_0x15be4f);}catch{return _0x53091b=_0x15be4f,null;}})['filter'](_0x2b14ce=>null!==_0x2b14ce);_0x140e96['length']&&(_0x2c4895+=_0x140e96['map'](_0x595fd4=>this['_getGeneratedText'](_0x595fd4,_0x550c58))['join'](''),_0x48d20a(_0x2c4895));}return Promise['resolve']();}async['_readStaticResponse'](_0x44a034,_0x418eb8,_0x4ecd62){let _0x2b90ef;return _0x2b90ef=_0x44a034 instanceof Response?await _0x44a034['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x44a034['body'])),(_0x4ecd62(this['_getGeneratedText'](_0x2b90ef,_0x418eb8)),Promise['resolve']());}['_getGeneratedText'](_0x3ebcd3,_0x333e3e){switch(this['getModelFamily'](_0x333e3e)){case'anthropic.claude':return _0x3ebcd3['completion'];case'ai21.j2':return _0x3ebcd3['completions'][0x0]['data']['text'];case'cohere.command':return _0x3ebcd3['generations'][0x0]['text'];case'meta.llama':return _0x3ebcd3['generation'];}}}class na extends tt{constructor(_0x4fcf33,_0x396ad2={}){super(_0x4fcf33),this['isToggleable']=!0x0,this['set']('side',_0x396ad2['side']||'top');const _0x4de404=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x4c715e(_0x396ad2['class']||[]),_0x4de404['to']('side',_0x4c8675=>'ck-tab-button_'+_0x4c8675),_0x4de404['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ha extends st{['children'];constructor(_0xc90f53,_0x48a0df={}){super(_0xc90f53);const _0x5bde49=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x4c715e(_0x48a0df['class']||[]),_0x5bde49['to']('class'),_0x5bde49['if']('isVisible','ck-hidden',_0x566087=>!_0x566087)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends st{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0xe58f89,_0x1e8b66={}){super(_0xe58f89),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x1e8b66['side']||'top'),this['set']('isMaximized',!0x1);const _0x50767c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x4c715e(_0x1e8b66['class']||[]),_0x50767c['to']('side',_0x4389e1=>'ck-tabs_'+_0x4389e1),_0x50767c['to']('class'),_0x50767c['to']('isMaximized',_0x5f0f22=>_0x5f0f22?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x50767c['to']('side',_0x460970=>'ck-tabs__buttons-container_'+_0x460970)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x50767c['to']('side',_0x541d21=>'ck-tabs__panels-container_'+_0x541d21)]},'children':this['panelViews']},..._0x4c715e(_0x1e8b66['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x4719db){const _0x49a746=this['_tabs']['get'](_0x4719db);return _0x49a746||null;}['addTab'](_0x994a2d){const _0x18b2b2=this['_setupButton']({'id':_0x994a2d['id'],'label':_0x994a2d['buttonLabel'],'icon':_0x994a2d['buttonIcon'],'order':_0x994a2d['order']}),_0x206092=new ha(this['locale']);return _0x206092['render'](),_0x994a2d['content']&&_0x206092['children']['add'](_0x994a2d['content']),this['panelViews']['add'](_0x206092),this['_tabs']['set'](_0x994a2d['id'],{'button':_0x18b2b2,'panel':_0x206092,'order':void 0x0!==_0x994a2d['order']?_0x994a2d['order']:null}),this['fire']('addTab:'+_0x994a2d['id'],{'id':_0x994a2d['id'],'button':_0x18b2b2,'panel':_0x206092}),null===this['activeTab']?this['activateTab'](_0x994a2d['id']):this['_hidePanel'](_0x994a2d['id']),{'button':_0x18b2b2,'panel':_0x206092};}['activateTab'](_0x247986){if(null!==_0x247986&&!this['getTab'](_0x247986))throw new _0x51167b('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x247986});this['activeTab']!==_0x247986&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x247986,_0x247986&&this['_showPanel'](_0x247986),this['fire']('activateTab:'+_0x247986,_0x247986));}['showTab'](_0x4d0afc){if(!this['getTab'](_0x4d0afc))throw new _0x51167b('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4d0afc});this['_showPanel'](_0x4d0afc),this['_showButton'](_0x4d0afc),this['fire']('show:'+_0x4d0afc,_0x4d0afc);}['hideTab'](_0x48680b){if(!this['getTab'](_0x48680b))throw new _0x51167b('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x48680b});const _0x32c28b=this['activeTab'];this['_hidePanel'](_0x48680b),this['_hideButton'](_0x48680b);const _0x9b9955=this['getTabIds']();_0x32c28b===_0x48680b&&_0x9b9955['length']>0x1&&this['activateTab'](_0x9b9955['find'](_0x27105a=>_0x27105a!==_0x48680b)),this['fire']('hide:'+_0x48680b,_0x48680b);}['_getPanel'](_0x1aba74){const _0x2984b6=this['_tabs']['get'](_0x1aba74);return _0x2984b6?_0x2984b6['panel']:null;}['_showPanel'](_0x477e4b){null!==this['activeTab']&&this['activeTab']!==_0x477e4b||this['_getPanel'](_0x477e4b)['show']();}['_hidePanel'](_0x1521dc){const _0x3f4a80=this['_getPanel'](_0x1521dc);_0x3f4a80['isVisible']&&(this['activeTab']===_0x1521dc&&(this['activeTab']=null),_0x3f4a80['hide']());}['_getButton'](_0x48142a){const _0x1a2cb1=this['_tabs']['get'](_0x48142a);return _0x1a2cb1?_0x1a2cb1['button']:null;}['_showButton'](_0x4a7517){this['_getButton'](_0x4a7517)['show']();}['_hideButton'](_0x1214a6){this['_getButton'](_0x1214a6)['hide']();}['_setupButton'](_0x50702f){const _0xbaf133=new na(this['locale'],{'side':this['side']}),_0x166009=this['buttonViews'];if(_0xbaf133['set']({'label':_0x50702f['label'],'icon':_0x50702f['icon'],'tooltip':!0x0,'withText':!0x0}),_0xbaf133['bind']('isOn')['to'](this,'activeTab',_0xadd0b1=>_0xadd0b1===_0x50702f['id']),_0xbaf133['bind']('side')['to'](this,'side'),_0x50702f['order']){const _0x17c027=[...this['_tabs']]['reduce']((_0x362188,_0x582ffa)=>{const _0x21bba8=_0x582ffa[0x0],{order:_0x318009}=_0x582ffa[0x1];return!_0x318009||_0x318009>_0x50702f['order']?_0x362188:_0x318009>=_0x362188['order']?{'id':_0x21bba8,'order':_0x318009}:_0x362188;},{'id':'','order':0x0}),_0x36419b=_0x166009['getIndex'](this['_getButton'](_0x17c027['id']));_0x166009['add'](_0xbaf133,_0x36419b+0x1);}else _0x166009['add'](_0xbaf133);return _0xbaf133['on']('execute',()=>{this['activateTab'](_0x50702f['id']);}),_0xbaf133;}}const zi=['overlay','sidebar','custom'],ji=['left','right'];class Ti extends ss{constructor(_0x4e50ea,_0x223d7b={}){super(_0x4e50ea,_0x223d7b),this['set']('type',_0x223d7b['type']||'sidebar'),this['set']('side',_0x223d7b['side']||'right'),this['set']('isVisible',_0x223d7b['visibleByDefault']??!0x0);const _0x5136ac=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x5136ac['if']('type','ck-ai-tabs__overlay',_0x306fe9=>'overlay'===_0x306fe9),_0x5136ac['if']('type','ck-ai-tabs__sidebar',_0x5000b6=>'sidebar'===_0x5000b6),_0x5136ac['if']('isVisible','ck-hidden',_0x2e6d9f=>!_0x2e6d9f)]}}),this['buttonViews']['on']('add',(_0x4d6638,_0x21eddf)=>{_0x21eddf['set']('withText',!0x1);});}}class g extends _0x47d85c{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x39f142){super(_0x39f142);const _0x3c5706=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x3c5706)throw new _0x51167b('ai-tabs-configuration-not-found');if(void 0x0!==_0x3c5706['showResizeButton']&&(this['showResizeButton']=_0x3c5706['showResizeButton']),'sidebar'!==_0x3c5706['type']&&'overlay'!==_0x3c5706['type']||_0x3c5706['side']&&(this['side']=_0x3c5706['side']),'sidebar'===_0x3c5706['type']){if(this['container']=_0x3c5706['element'],this['set']('type','sidebar'),!this['container'])throw new _0x51167b('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x3c5706['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new Ti(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x3c5706['visibleByDefault']||_0x3c5706['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 _0x507c90&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x10b11c){if(_0x10b11c&&this['type']!==_0x10b11c){if(!zi['includes'](_0x10b11c))throw new _0x51167b('ai-tabs-unsupported-ui-type');this['type']=_0x10b11c;}}['switchSide'](_0x208ebd){if(_0x208ebd&&this['side']!==_0x208ebd){if(!ji['includes'](_0x208ebd))throw new _0x51167b('ai-tabs-unsupported-ui-side');this['side']=_0x208ebd;}}['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 l extends _0x47d85c{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x34301d){super(_0x34301d),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 _0x2905ee=this['context']['plugins']['get']('CloudServices');if(!_0x2905ee['token'])throw new _0x51167b('ai-missing-token',this);this['_token']=_0x2905ee['token'];}['startConversation'](_0x184235,_0x3b3b9b){const _0x194a82=this['_sendApiRequest']('/conversations','POST',{'id':_0x184235,'group':_0x3b3b9b});return{'getConversation':async()=>(await _0x194a82['request'])['json'](),'abortController':_0x194a82['abortController']};}['queryAssistant']({message:_0x532d6d,conversationId:_0x37f338,parts:_0x305650,capabilities:_0x490340,model:_0x3e367a,quickActionData:_0xe49fce}){const _0x1c5439={..._0xe49fce&&{'quickActionData':_0xe49fce}},_0x5e8ed4={'prompt':_0x532d6d,'content':_0x305650,'model':_0x3e367a,..._0x490340&&{'capabilities':_0x490340},...Object['keys'](_0x1c5439)['length']>0x0&&{'attributes':_0x1c5439}},_0x203dc7=this['_sendApiRequest']('/conversations/'+_0x37f338+'/messages','POST',_0x5e8ed4);return{'getStream':async()=>{const _0x56e899=(await _0x203dc7['request'])['body'];return this['_getStreamReader'](_0x56e899);},'abortController':_0x203dc7['abortController']};}['executeCustomAction']({content:_0x48d754,message:_0xf1dc5b,model:_0x3d004c,outputFormat:_0x32033a}){const _0x39f8fb={'content':[{'type':'text','content':_0x48d754}],'prompt':_0xf1dc5b,'model':_0x3d004c,'outputFormat':_0x32033a},_0x12e611=this['_sendApiRequest']('/actions/custom/calls','POST',_0x39f8fb);return{'getStream':async()=>{const _0x2cc2cd=(await _0x12e611['request'])['body'];return this['_getStreamReader'](_0x2cc2cd);},'abortController':_0x12e611['abortController']};}['executeAction']({actionName:_0x1afbae,content:_0x39d6c4,args:_0x152471}){const _0x4de61c={'content':[{'type':'text','content':_0x39d6c4}],'args':_0x152471},_0x5519ef=this['_sendApiRequest']('/actions/system/'+_0x1afbae+'/calls','POST',_0x4de61c);return{'getStream':async()=>{const _0x822841=(await _0x5519ef['request'])['body'];return this['_getStreamReader'](_0x822841);},'abortController':_0x5519ef['abortController']};}['uploadFile'](_0x3b422d,_0x42231b,_0x2ff0c4){const _0x323d66=new FormData();_0x323d66['append']('file',_0x42231b,_0x42231b['name']),_0x2ff0c4&&_0x323d66['append']('attributes',JSON['stringify'](_0x2ff0c4));const _0x3f37a8=this['_sendApiRequest']('/conversations/'+_0x3b422d+'/files','POST',_0x323d66);return{'getId':async()=>(await _0x3f37a8['request'])['json'](),'abortController':_0x3f37a8['abortController']};}['fetchDocument'](_0x3627e6,_0x167a2e){const _0xde3e86=this['_sendApiRequest']('/conversations/'+_0x3627e6+'/documents/'+_0x167a2e,'GET');return{'getDocument':async()=>(await _0xde3e86['request'])['json'](),'abortController':_0xde3e86['abortController']};}['uploadDocument'](_0x61f3da,_0x2ea8a2,_0x57d1b6){const _0x5a1377={'content':_0x2ea8a2};_0x57d1b6&&(_0x5a1377['attributes']=_0x57d1b6);const _0x2e6f6c=this['_sendApiRequest']('/conversations/'+_0x61f3da+'/documents','POST',_0x5a1377);return{'getId':async()=>(await _0x2e6f6c['request'])['json'](),'abortController':_0x2e6f6c['abortController']};}['fetchConversations'](_0xebafac,_0x362c31){const _0x53f7ec=new URLSearchParams();_0x53f7ec['append']('excludeEmpty','true'),_0x53f7ec['append']('limit','100'),_0x53f7ec['append']('group',_0xebafac),_0x362c31&&_0x53f7ec['append']('search',_0x362c31);const _0x487803=this['_sendApiRequest']('/conversations?'+_0x53f7ec['toString'](),'GET');return{'getConversations':async()=>{const _0x143914=await _0x487803['request'];return(await _0x143914['json']())['items'];},'abortController':_0x487803['abortController']};}['deleteConversation'](_0x1e7f7c){const _0x419eee=this['_sendApiRequest']('/conversations/'+_0x1e7f7c,'DELETE');return{'execute':async()=>{await _0x419eee['request'];},'abortController':_0x419eee['abortController']};}['updateConversation'](_0x5499de,_0xc021b6){const _0x332cbe=this['_sendApiRequest']('/conversations/'+_0x5499de,'PATCH',_0xc021b6);return{'getResult':async()=>(await _0x332cbe['request'],_0xc021b6),'abortController':_0x332cbe['abortController']};}['fetchConversation'](_0x248af3){const _0x5dcc14=this['_sendApiRequest']('/conversations/'+_0x248af3,'GET');return{'getConversation':async()=>(await _0x5dcc14['request'])['json'](),'abortController':_0x5dcc14['abortController']};}['fetchConversationMessages'](_0x15cd5b){const _0x991435=this['_sendApiRequest']('/conversations/'+_0x15cd5b+'/messages','GET');return{'getMessages':async()=>{const _0x41ae08=await _0x991435['request'];return(await _0x41ae08['json']())['items'];},'abortController':_0x991435['abortController']};}['uploadUrl'](_0x22c7e9,_0x261d2f,_0x2ade84){const _0x23c3b2=this['_sendApiRequest']('/conversations/'+_0x22c7e9+'/web-resources','POST',{'url':_0x261d2f,'attributes':_0x2ade84});return{'getId':async()=>(await _0x23c3b2['request'])['json'](),'abortController':_0x23c3b2['abortController']};}['getModels'](){const _0x223ad9=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x223ad9['request'])['json'](),'abortController':_0x223ad9['abortController']};}['deleteFile'](_0x22b7be,_0x332e7b){const _0x3a7d4c=this['_sendApiRequest']('/conversations/'+_0x22b7be+'/files/'+_0x332e7b,'DELETE');return{'execute':async()=>{await _0x3a7d4c['request'];},'abortController':_0x3a7d4c['abortController']};}['deleteDocument'](_0x285321,_0x54f34e){const _0x226a48=this['_sendApiRequest']('/conversations/'+_0x285321+'/documents/'+_0x54f34e,'DELETE');return{'execute':async()=>{await _0x226a48['request'];},'abortController':_0x226a48['abortController']};}['deleteWebResource'](_0x546e51,_0x4354ba){const _0x5dac0b=this['_sendApiRequest']('/conversations/'+_0x546e51+'/web-resources/'+_0x4354ba,'DELETE');return{'execute':async()=>{await _0x5dac0b['request'];},'abortController':_0x5dac0b['abortController']};}['callSystemReview']({reviewName:_0x538850,content:_0x1258d5,args:_0x2db039}){const _0x32c011=this['_sendApiRequest']('/reviews/system/'+_0x538850+'/calls','POST',{'content':[{'type':'text','content':_0x1258d5}],'args':_0x2db039});return{'getStream':async()=>{const _0x58c89a=(await _0x32c011['request'])['body'];return this['_getStreamReader'](_0x58c89a);},'abortController':_0x32c011['abortController']};}['callCustomReview']({content:_0x23c474,prompt:_0x2f8391,model:_0x4a31f5}){const _0x4fea8e=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x23c474}],'prompt':_0x2f8391,'model':_0x4a31f5});return{'getStream':async()=>{const _0x1b9f4d=(await _0x4fea8e['request'])['body'];return this['_getStreamReader'](_0x1b9f4d);},'abortController':_0x4fea8e['abortController']};}['upsertAIChatRating'](_0xfbd946,_0x10552a,_0x2646ea){const _0x1f2682=this['_sendApiRequest']('/conversations/'+_0xfbd946+'/messages/'+_0x10552a+'/ratings','PUT',{'positiveCount':_0x2646ea['positiveCount'],'totalCount':_0x2646ea['totalCount'],'modificationId':_0x2646ea['modificationId']});return{'execute':async()=>{await _0x1f2682['request'];},'abortController':_0x1f2682['abortController']};}['upsertAIActionRating'](_0x57c12f,_0x5776be,_0x2021da){const _0x10485b=this['_sendApiRequest']('/actions/system/'+_0x57c12f+'/calls/'+_0x5776be+'/ratings','PUT',{'positiveCount':_0x2021da['positiveCount'],'totalCount':_0x2021da['totalCount']});return{'execute':async()=>{await _0x10485b['request'];},'abortController':_0x10485b['abortController']};}['upsertCustomAIActionRating'](_0x372469,_0x5993d9){const _0x30a6c2=this['_sendApiRequest']('/actions/custom/calls/'+_0x372469+'/ratings','PUT',{'positiveCount':_0x5993d9['positiveCount'],'totalCount':_0x5993d9['totalCount']});return{'execute':async()=>{await _0x30a6c2['request'];},'abortController':_0x30a6c2['abortController']};}['upsertAIReviewRating'](_0x17c825,_0x3ba75b,_0x2a091f,_0x3d98b0){const _0x452ebb=this['_sendApiRequest']('/reviews/system/'+_0x17c825+'/calls/'+_0x3ba75b+'/ratings','PUT',{'positiveCount':_0x2a091f['positiveCount'],'totalCount':_0x2a091f['totalCount'],'dataId':_0x3d98b0});return{'execute':async()=>{await _0x452ebb['request'];},'abortController':_0x452ebb['abortController']};}['upsertCustomAIReviewRating'](_0x9aa754,_0x37389f,_0x32d55c){const _0xba8a41=this['_sendApiRequest']('/reviews/custom/calls/'+_0x9aa754+'/ratings','PUT',{'positiveCount':_0x37389f['positiveCount'],'totalCount':_0x37389f['totalCount'],'dataId':_0x32d55c});return{'execute':async()=>{await _0xba8a41['request'];},'abortController':_0xba8a41['abortController']};}['_sendApiRequest'](_0x13f8d2,_0x5b4140,_0x4bf35f){const _0x174b34=new AbortController(),_0xd738c3=_0x4bf35f instanceof FormData,_0x2f3d81={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x4bf35f&&!_0xd738c3&&(_0x2f3d81['Content-Type']='application/json');const _0x22e9c8={'method':_0x5b4140,'headers':_0x2f3d81,'signal':_0x174b34['signal']};return _0x4bf35f&&(_0x22e9c8['body']=_0xd738c3?_0x4bf35f:JSON['stringify'](_0x4bf35f)),{'request':fetch(''+this['_apiUrl']+_0x13f8d2,_0x22e9c8)['catch'](_0x25cfc9=>{this['_handleError'](_0x25cfc9);})['then'](_0x22d9e8=>{if(!_0x22d9e8['ok'])throw new _0x51167b('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x13f8d2,'method':_0x5b4140,'body':_0x4bf35f,'status':(_0x22d9e8||{})['status'],'statusText':(_0x22d9e8||{})['statusText']});return _0x22d9e8;}),'abortController':_0x174b34};}async*['_getStreamReader'](_0x495700){const _0x381125=[],_0x383bf3=_0x495700['getReader'](),_0x2f79f1=Ct({'onError':_0x3b6f94=>{this['_handleError'](_0x3b6f94);},'onEvent':_0x567052=>{_0x567052['data']=JSON['parse'](_0x567052['data']),_0x381125['push'](_0x567052);}});try{let _0x5b2f82=!0x1;for(;!_0x5b2f82;){const {done:_0x23b6bb,value:_0x4856be}=await _0x383bf3['read']();_0x23b6bb&&(_0x5b2f82=!0x0),_0x2f79f1['feed'](this['_decoder']['decode'](_0x4856be,{'stream':!0x0})),yield*_0x381125,_0x381125['length']=0x0;}}catch(_0xf3fc0d){this['_handleError'](_0xf3fc0d);}finally{_0x383bf3['releaseLock'](),_0x2f79f1['reset']();}}['_handleError'](_0x229133){if(_0x229133 instanceof _0x51167b)throw _0x229133;if(_0x229133 instanceof Error&&'AbortError'===_0x229133['name'])throw new _0x51167b('ai-request-aborted',this,{'originalError':_0x229133});throw new _0x51167b('ai-request-failed',this,{'originalError':_0x229133});}}function u(_0x611033,_0x298af9,_0x44cc47){const t=_0x611033['t'];switch(_0x298af9){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'},_0x44cc47);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.'},_0x44cc47);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.'},_0x44cc47);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.'},_0x44cc47);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'},_0x44cc47);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'},_0x44cc47);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x44cc47);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'},_0x44cc47);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x44cc47);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'},_0x44cc47);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x44cc47);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.'},_0x44cc47);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.'},_0x44cc47);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.'},_0x44cc47);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.'},_0x44cc47);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'},_0x44cc47);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.'},_0x44cc47);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 _0x298af9;}}function ms(_0x2740a0,_0x1e3988){const _0x1a8b80=new tt(_0x2740a0),_0x3c64a6=u(_0x2740a0,'AI_TABS_LABEL_MINIMIZE'),_0x1f093c=u(_0x2740a0,'AI_TABS_LABEL_MAXIMIZE');return _0x1a8b80['set']({'withText':!0x1,'icon':_0x20699c,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x1a8b80['bind']('label')['to'](_0x1e3988,'isMaximized',_0x4c23dc=>_0x4c23dc?_0x3c64a6:_0x1f093c),_0x1a8b80['bind']('icon')['to'](_0x1e3988,'isMaximized',_0x1e053f=>_0x1e053f?_0x20c950:_0x20699c),_0x1a8b80['bind']('isOn')['to'](_0x1e3988,'isMaximized'),_0x1a8b80['on']('execute',()=>{_0x1e3988['fire']('resizeTabs');}),_0x1a8b80;}function tr(_0x5a9043){return _0x35b477(_0x5a9043);}function O(_0xcd88a8){return _0x1b38df(_0xcd88a8);}function x(_0x3d03e3,_0x2f0228,_0x5411ef){const _0x176609=null!==_0x2f0228?_0x2886c6=>_0x2886c6['attribs'][_0x3d03e3]===_0x2f0228:_0x230691=>Boolean(_0x230691['attribs'][_0x3d03e3]);return _0x21c931(_0x261b08=>_0x32f843(_0x261b08)&&_0x176609(_0x261b08),_0x5411ef);}function Ne(_0x4406dc,_0x13104c,_0x5ac3b4){const _0x43b6a1=null!==_0x13104c?_0xf102b9=>_0xf102b9['attribs'][_0x4406dc]===_0x13104c:_0x5ca47d=>Boolean(_0x5ca47d['attribs'][_0x4406dc]);return _0x2c4c1b(_0x2e013a=>_0x32f843(_0x2e013a)&&_0x43b6a1(_0x2e013a),_0x5ac3b4);}function D(_0x4b02b0,_0xe2efc1){return _0x4b02b0&&_0x32f843(_0x4b02b0)?_0x4b02b0['attribs'][_0xe2efc1]:null;}function Pe(_0x3884f2,_0x272491,_0x402e8e){_0x32f843(_0x3884f2)&&(null===_0x402e8e?delete _0x3884f2['attribs'][_0x272491]:_0x3884f2['attribs'][_0x272491]=_0x402e8e);}function Be(_0x36c972,_0x43429a,_0x1b4969){const _0x4f7b8d=_0x43429a['cloneNode'](!0x0);'beforebegin'===_0x1b4969?_0x54bde9(_0x36c972,_0x4f7b8d):'afterbegin'===_0x1b4969?_0x14f4a2(_0x36c972,_0x4f7b8d):'beforeend'===_0x1b4969?_0x317071(_0x36c972,_0x4f7b8d):'afterend'===_0x1b4969&&_0x321f33(_0x36c972,_0x4f7b8d);}function Le(_0x5219ea){const _0x2e6341=[];let _0x24c7a6=_0x5219ea;for(;_0x24c7a6;)_0x24c7a6=_0x563b16(_0x24c7a6),_0x24c7a6&&_0x2e6341['push'](_0x24c7a6);return _0x2e6341;}function Jn(_0xb776d5){return _0xb776d5['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function qe(_0x557726){let _0x3cc316=0x0;for(;_0x557726['parentNode'];)_0x557726=_0x557726['parentNode'],_0x3cc316++;return _0x3cc316;}function Ge(_0x2856f6){const _0x4ca8b6=[];let _0x82b2b6=_0x2856f6['nextSibling'];for(;_0x82b2b6;)_0x4ca8b6['push'](_0x82b2b6),_0x82b2b6=_0x82b2b6['nextSibling'];_0x4ca8b6['forEach'](_0xddb53b=>{_0x456b22(_0xddb53b);});}class He extends/* #__PURE__ -- @preserve */
|
|
25
|
-
|
|
26
|
-
qt(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x282323){super(),this['_generateUid']=_0x282323||_0x4c8592;}['merge'](_0x5c6bca,_0x1208b7,_0x2850a1){const _0x302255=_0x5c6bca['cloneNode'](!0x0);if(0x0===_0x1208b7['childNodes']['length']){const _0x233da6=[];return Ne('data-id','new-element',_0x302255)['forEach'](_0x502d57=>{const _0x57be65=this['_generateUid']();Pe(_0x502d57,'data-id',_0x57be65),_0x233da6['push'](_0x57be65);}),this['_removeSpecialComments'](_0x302255),{'parsedContent':_0x302255,'newNodeIds':_0x233da6,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x2850a1&&_0x2850a1['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x302255),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ne('data-id',null,_0x1208b7)['map'](_0x231d34=>D(_0x231d34,'data-id'))['filter'](_0x54171c=>!!_0x54171c));let _0x405ae5=-0x1,_0x890258=!0x1;const _0xe3467e=_0x302255['childNodes'],_0x338804=Array['from'](_0xe3467e)['filter'](_0x5d69c5=>!(0x3===_0x5d69c5['nodeType']&&''===O(_0x5d69c5)['trim']())),_0x5f28e9=_0x338804['length'];for(let _0x5be993=0x0;_0x5be993<_0x5f28e9;_0x5be993++){const _0xd140bd=_0x338804[_0x5be993],_0xb97c4f=_0x338804[_0x5be993+0x1];if(this['_isNewNode'](_0xd140bd)){if(-0x1===_0x405ae5&&(_0x405ae5=_0x5be993),this['_markWrappedElements'](_0xd140bd),!this['_isNewNode'](_0xb97c4f)){const [_0xe8b707,_0xb7b6b3]=this['_findReferenceNode'](_0xd140bd,_0x890258,_0x1208b7);if(_0xe8b707){const _0x37f76d=Array['from'](_0x338804)['slice'](_0x405ae5,_0x5be993+0x1);this['_insertNodes'](_0xe8b707,_0x37f76d,_0xb7b6b3),_0x405ae5=-0x1;}}}else{if(this['_isExistingContentComment'](_0xd140bd))_0x890258=!0x0;else{if(this['_isExistingNode'](_0xd140bd)){const _0x4664af=D(_0xd140bd,'data-id');if(_0x4664af&&this['_existingDataIds']['has'](_0x4664af)){const _0x215c98=x('data-id',_0x4664af,_0x1208b7);this['_replaceNode'](_0x215c98,_0xd140bd);}if(this['_touchedNodesState']['removedIds']['includes'](_0x4664af)){const _0x82f327=this['_touchedNodesState']['removedIds']['indexOf'](_0x4664af);this['_touchedNodesState']['removedIds']['splice'](_0x82f327,0x1);}}else{if(this['_isDelNode'](_0xd140bd)){const _0x4f9181=D(_0xd140bd,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x4f9181)||this['_storeDeletedElementIds'](_0xd140bd);}}}}}for(const _0x2e9aa0 of this['_touchedNodesState']['removedIds']){const _0x3be5a4=x('data-id',_0x2e9aa0,_0x1208b7);if(_0x3be5a4){if(_0x2850a1&&_0x2850a1['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x2e9aa0;const _0x5e248b=_0x2850a1['replaceRemovedWith']['cloneNode'](!0x0);Pe(_0x5e248b,'data-id',_0x2e9aa0),Pe(_0x5e248b,'data-removed','true'),_0x553dad(_0x3be5a4,_0x5e248b);}else _0x456b22(_0x3be5a4);}}if(Ne('data-wrapped-id',null,_0x1208b7)['forEach'](_0x59084b=>{const _0x2681bc=x('data-id',D(_0x59084b,'data-wrapped-id'),_0x1208b7);var _0x3c141c,_0x4a9268;_0x2681bc&&(_0x4a9268=_0x59084b,_0x456b22(_0x3c141c=_0x2681bc),_0x553dad(_0x4a9268,_0x3c141c));}),Ne('data-id','new-element',_0x1208b7)['forEach'](_0x298299=>{const _0x55d6b9=this['_getUid'](_0x298299);Pe(_0x298299,'data-id',_0x55d6b9),this['_touchedNodesState']['newIds']['push'](_0x55d6b9);}),this['_removeSpecialComments'](_0x1208b7),_0x2850a1&&_0x2850a1['markUnstableElements']&&this['_markUnstableElements'](_0x1208b7,_0x2850a1['markUnstableElementsDepth']||0x0),_0x2850a1&&_0x2850a1['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x7c26f9=x('data-id',this['_touchedNodesState']['lastTouchedId'],_0x1208b7);for(;_0x7c26f9;)Ge(_0x7c26f9),_0x7c26f9=_0x7c26f9['parentNode'];}return{'parsedContent':_0x1208b7,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x123129,_0x3748b7,_0x5b8d0a){for(const _0x3fdd65 of _0x3748b7){const _0x4288e3=this['_getUid'](_0x3fdd65);Pe(_0x3fdd65,'data-id',_0x4288e3),this['_touchedNodesState']['newIds']['push'](_0x4288e3),this['_touchedNodesState']['lastTouchedId']=_0x4288e3;}const _0x5d7ef9='afterbegin'===_0x5b8d0a||'afterend'===_0x5b8d0a?_0x3748b7['reverse']():_0x3748b7;for(const _0x548702 of _0x5d7ef9)Be(_0x123129,_0x548702,_0x5b8d0a);}['_replaceNode'](_0x2d7536,_0x4c8afa){if(!_0x2d7536)return;if(_0x21d137=_0x4c8afa,Jn(O(_0x2d7536))===Jn(O(_0x21d137)))return;var _0x21d137;const _0x5d0d7=this['_getUid'](_0x2d7536);Pe(_0x4c8afa,'data-id',_0x5d0d7),this['_touchedNodesState']['modifiedIds']['push'](_0x5d0d7),this['_touchedNodesState']['lastTouchedId']=_0x5d0d7,_0x553dad(_0x2d7536,_0x4c8afa['cloneNode'](!0x0));}['_findReferenceNode'](_0x3ee4e1,_0x2af3cc,_0x3f496c){const _0x6634=this['_findPrevElementWithDataId'](_0x3ee4e1,!0x1);if(_0x6634){const _0x1400e7=this['_getNodeDataId'](_0x6634),_0x44c195=x('data-id',_0x1400e7,_0x3f496c);if(_0x44c195)return[_0x44c195,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x1400e7);}const _0x2dbc6b=this['_findNextElementWithDataId'](_0x3ee4e1,!0x1);if(_0x2dbc6b){const _0x4f4215=this['_getNodeDataId'](_0x2dbc6b),_0x241c10=x('data-id',_0x4f4215,_0x3f496c);if(_0x241c10)return[_0x241c10,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x4f4215);}return _0x2af3cc?_0x3ee4e1['nextSibling']?this['_findFallbackReferenceNode'](_0x3ee4e1,_0x3f496c):[_0x3f496c['childNodes'][_0x3f496c['childNodes']['length']-0x1],'afterend']:[_0x3f496c['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x56a842,_0x379ea1){const _0x408a7c=[],_0x132d3f=this['_findPrevElementWithDataId'](_0x56a842,!0x0);if(_0x132d3f){const _0x52f377=x('data-id',this['_getNodeDataId'](_0x132d3f),_0x379ea1);_0x52f377&&_0x408a7c['push']([_0x52f377,'afterend']);}const _0x2b7d1f=this['_findNextElementWithDataId'](_0x56a842,!0x0);if(_0x2b7d1f){const _0x3ecede=x('data-id',this['_getNodeDataId'](_0x2b7d1f),_0x379ea1);_0x3ecede&&_0x408a7c['push']([_0x3ecede,'beforebegin']);}if(_0x408a7c['length']>0x1)return qe(_0x408a7c[0x0][0x0])<=qe(_0x408a7c[0x1][0x0])?_0x408a7c[0x0]:_0x408a7c[0x1];return 0x1===_0x408a7c['length']?_0x408a7c[0x0]:[_0x379ea1['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x2756f9,_0x5e2326){let _0x47993d=_0x2756f9['nextSibling'],_0x32e6c7=null,_0x496f7d=!0x1;for(;_0x47993d;){if(_0x3cae27(_0x47993d)){if(this['_isDelNode'](_0x47993d)&&(_0x32e6c7=_0x47993d),this['_isExistingContentComment'](_0x47993d)&&_0x5e2326&&!_0x496f7d){_0x496f7d=!0x0,_0x47993d=_0x47993d['nextSibling'];continue;}break;}const _0x22c594=D(_0x47993d,'data-id');if(_0x22c594&&'new-element'!==_0x22c594&&this['_existingDataIds']['has'](_0x22c594)){_0x32e6c7=_0x47993d;break;}_0x47993d=_0x47993d['nextSibling'];}return _0x32e6c7;}['_findPrevElementWithDataId'](_0x449784,_0x2a800e){let _0x46f053=_0x449784['previousSibling'],_0x31a511=null,_0xf93ebb=!0x1;for(;_0x46f053;){if(_0x3cae27(_0x46f053)){if(this['_isDelNode'](_0x46f053)&&(_0x31a511=_0x46f053),this['_isExistingContentComment'](_0x46f053)&&_0x2a800e&&!_0xf93ebb){_0xf93ebb=!0x0,_0x46f053=_0x46f053['previousSibling'];continue;}break;}const _0x4cb8e2=D(_0x46f053,'data-id');if(_0x4cb8e2&&'new-element'!==_0x4cb8e2&&this['_existingDataIds']['has'](_0x4cb8e2)){_0x31a511=_0x46f053;break;}_0x46f053=_0x46f053['previousSibling'];}return _0x31a511;}['_markWrappedElements'](_0x3deca8){_0x32f843(_0x3deca8)&&Ne('data-id',null,_0x3deca8)['forEach'](_0x47c880=>{this['_isExistingNode'](_0x47c880)&&!this['_hasWrappedParent'](_0x47c880)&&(Pe(_0x47c880,'data-wrapped-id',D(_0x47c880,'data-id')),Pe(_0x47c880,'data-id',null));});}['_getNodeDataId'](_0x5a33a0){if(!_0x5a33a0)return null;if(_0x32f843(_0x5a33a0))return D(_0x5a33a0,'data-id');if(_0x3cae27(_0x5a33a0)){const _0x450bd3=O(_0x5a33a0)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x450bd3&&_0x450bd3[0x1])return _0x450bd3[0x1];}return null;}['_storeDeletedElementIds'](_0x57b98f){if(_0x3cae27(_0x57b98f)){const _0x3980b7=O(_0x57b98f)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x3980b7&&_0x3980b7[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x3980b7[0x1]);}}['_getUid'](_0xfa10a1){return this['_isExistingNode'](_0xfa10a1)?D(_0xfa10a1,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x1aa1e5){(function(_0x874135){return _0x3ddc03(_0x14518a=>_0x3cae27(_0x14518a),_0x874135,!0x0,0x1/0x0);}(_0x1aa1e5)['filter'](_0x3d9362=>this['_isDelNode'](_0x3d9362)||this['_isExistingContentComment'](_0x3d9362))['forEach'](_0x4e6432=>{_0x456b22(_0x4e6432);}));}['_markLastTagElementUnstable'](_0xbafe1d){const _0x9cdd72=_0xbafe1d['childNodes'],_0x1cd087=_0x9cdd72[_0x9cdd72['length']-0x1];_0x1cd087&&_0x32f843(_0x1cd087)&&Pe(_0x1cd087,'data-unstable','true');}['_markUnstableElements'](_0x303267,_0x1f8701){const _0x383177=x('data-unstable','true',_0x303267);if(!_0x383177)return;const _0x50ed60=Le(_0x383177)['slice'](0x0,-0x1),_0x528e16=_0x50ed60['length'];let _0x26db85=_0x383177;if(_0x528e16>_0x1f8701){let _0xa6f3f5=_0x528e16,_0x182501=null;for(;_0xa6f3f5>_0x1f8701&&_0xa6f3f5>=0x0;)_0xa6f3f5--,_0x182501=_0x50ed60[_0xa6f3f5];_0x182501&&(_0x26db85=_0x182501,Pe(_0x383177,'data-unstable',null),Pe(_0x182501,'data-unstable','true'));}else{if(_0x528e16<_0x1f8701){let _0x318805=_0x528e16,_0x52cfe2=_0x383177;for(;_0x318805<_0x1f8701;){const _0x4f63ba=_0x52cfe2['childNodes']['filter'](_0x186943=>_0x32f843(_0x186943));if(0x0===_0x4f63ba['length'])break;_0x318805++,_0x52cfe2=_0x4f63ba[_0x4f63ba['length']-0x1];}_0x52cfe2&&(_0x26db85=_0x52cfe2,Pe(_0x383177,'data-unstable',null),Pe(_0x52cfe2,'data-unstable','true'));}}let _0x5e75a5=_0x26db85;for(;_0x5e75a5;){for(;_0x5e75a5['nextSibling'];)_0x5e75a5=_0x5e75a5['nextSibling'],_0x32f843(_0x5e75a5)&&Pe(_0x5e75a5,'data-unstable','true');_0x5e75a5=_0x5e75a5['parentNode'];}}['_isNewNode'](_0x4befb6){return Boolean('new-element'===D(_0x4befb6,'data-id'));}['_isExistingNode'](_0x45e887){return Boolean((D(_0x45e887,'data-id')||'')['length']>0x0&&'new-element'!==D(_0x45e887,'data-id'));}['_isDelNode'](_0x55d09f){return!!_0x55d09f&&Boolean(_0x3cae27(_0x55d09f)&&O(_0x55d09f)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x313e0d){let _0x4607be=_0x313e0d['parentNode'];for(;_0x4607be;){if(D(_0x4607be,'data-wrapped-id'))return!0x0;_0x4607be=_0x4607be['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x4157f5){return Boolean(_0x3cae27(_0x4157f5)&&O(_0x4157f5)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function lt({editor:_0x284954,changeGroups:_0x6c52c,documentContextContent:_0x14f2f4,showDiff:_0x4848cc,trimUnchanged:_0x246928=!0x0}){return _0x6c52c['map'](_0xf95fdf=>{const _0x3dfff8=new _0x46f624([]),_0x2c3e80=new _0x46f624([]);for(const _0xf35638 of _0xf95fdf['changes'])if(_0x4848cc&&'removed'==_0xf35638['type']||_0x2c3e80['children']['push'](_0xf35638['node']['cloneNode'](!0x0)),'new'!=_0xf35638['type']&&(_0x4848cc||'removed'!=_0xf35638['type'])){const _0x2f6ecb=_0x21c931(_0x249d6f=>D(_0x249d6f,'data-id')==_0xf35638['id'],_0x14f2f4,!0x0);_0x2f6ecb&&_0x3dfff8['children']['push'](_0x2f6ecb['cloneNode'](!0x0));}const {content:_0x3dbb1d,hasChanges:_0x32631a}=function(_0x49ca59,_0x5cbef6,_0x359ff7,_0x237be9,_0x460fe7=!0x0){const _0x209264=_0x49ca59['plugins']['get']('DocumentCompare'),_0x14a94c=O(_0x5cbef6),_0xecdf89=O(_0x359ff7),_0x9ec19f=_0x49ca59['data']['parse'](_0x14a94c,'$root'),_0x21b866=_0x49ca59['model']['createPositionAt'](_0x9ec19f,0x0),_0x3f8cd7=_0x209264['getDiff'](_0x14a94c,_0xecdf89,{'anchor':_0x21b866,'markDeletions':_0x237be9}),_0x54eb05=_0x3f8cd7['getOperations']();if(0x0==_0x54eb05['length'])return{'content':_0x5cbef6['cloneNode'](!0x0),'hasChanges':!0x1};_0x237be9?function(_0x3c5755,_0x230699,_0x243598){if(0x0==_0x3c5755['length'])return;const _0x25d934=_0x243598['plugins']['get']('DocumentCompare'),_0x585786=_0x243598['plugins']['get']('SuggestionsConversion');_0x243598['model']['change'](_0x5b4738=>{const _0x21ecd2=new Set();for(let _0x3a7bb3=0x0;_0x3a7bb3<_0x3c5755['length'];_0x3a7bb3++){const _0x4f75db=_0x3c5755[_0x3a7bb3];if(_0x4f75db['baseVersion']=null,_0x4f75db['isDocumentOperation']=!0x1,_0x25d934['isMarkedRemoveOperation'](_0x4f75db)){const _0x5ed6ec=_0x61509a(_0x4f75db['newRange'],_0x243598['model']),_0x35b8fd='suggestion:deletion:'+_0x4c8592()+':$aiSuggestion';_0x230699['markers']['set'](_0x35b8fd,_0x5ed6ec);}else switch(_0x4f75db['type']){case'rename':{if(_0x4f75db['oldName']==_0x4f75db['newName'])break;_0x5b4738['batch']['addOperation'](_0x4f75db),_0x243598['model']['applyOperation'](_0x4f75db);const _0x3bc7a0='$elementName',_0xdbaabe=_0x4f75db['position'],_0x32e2fe=_0x243598['model']['createRange'](_0xdbaabe,_0x243598['model']['createPositionAt'](_0xdbaabe['nodeAfter'],'end')),_0x5812b2='suggestion:attribute:'+_0x3bc7a0+':'+_0x4c8592()+':$aiSuggestion';_0x230699['markers']['set'](_0x5812b2,_0x32e2fe);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x4f75db['oldValue']==_0x4f75db['newValue'])break;_0x5b4738['batch']['addOperation'](_0x4f75db),_0x243598['model']['applyOperation'](_0x4f75db);const _0x27a915=_0x4f75db['key'];if(!_0x585786['isRegisteredAttribute'](_0x27a915))break;const _0x40975b=_0x61509a(_0x4f75db['range'],_0x243598['model']),_0x181b88='suggestion:attribute:'+_0x27a915+':'+_0x4c8592()+':$aiSuggestion';_0x230699['markers']['set'](_0x181b88,_0x40975b);break;}case'insert':{_0x5b4738['batch']['addOperation'](_0x4f75db),_0x243598['model']['applyOperation'](_0x4f75db);if(_0x3c5755[_0x3a7bb3+0x1]&&'move'==_0x3c5755[_0x3a7bb3+0x1]['type']){no(_0x230699,_0x4f75db);break;}const _0x419387=_0x4f75db['position'],_0x25eaf6=_0x4f75db['howMany'],_0x3ab7ce=_0x61509a(_0x243598['model']['createRange'](_0x419387,_0x419387['getShiftedBy'](_0x25eaf6)),_0x243598['model']),_0x2b9f8a='suggestion:insertion:'+_0x4c8592()+':$aiSuggestion';_0x230699['markers']['set'](_0x2b9f8a,_0x3ab7ce);break;}case'split':{_0x5b4738['batch']['addOperation'](_0x4f75db),_0x243598['model']['applyOperation'](_0x4f75db);const _0x476941=_0x4f75db['splitPosition'],_0x222ea0=_0x4f75db['moveTargetPosition'],_0x5d1240=_0x243598['model']['createRange'](_0x476941,_0x222ea0),_0x29edb9='suggestion:insertion:'+_0x4c8592()+':$aiSuggestion';_0x230699['markers']['set'](_0x29edb9,_0x5d1240);break;}case'move':{_0x5b4738['batch']['addOperation'](_0x4f75db),_0x243598['model']['applyOperation'](_0x4f75db),_0x3c5755[_0x3a7bb3-0x1]&&'insert'==_0x3c5755[_0x3a7bb3-0x1]['type']&&no(_0x230699,_0x4f75db);const _0x484105=_0x4f75db['getMovedRangeStart'](),_0x3d44a6=_0x4f75db['howMany'];for(let _0x1ab0da=0x0;_0x1ab0da<_0x3d44a6;_0x1ab0da++){const _0x2972a4=_0x484105['getShiftedBy'](_0x1ab0da)['nodeAfter'];_0x21ecd2['add'](_0x2972a4);}break;}case'remove':{const _0x403f1a=_0x4f75db['sourcePosition'],_0x4e6ecf=_0x4f75db['howMany'],_0x520124=new _0x33fea2(_0x403f1a,_0x4e6ecf);_0x5b4738['batch']['addOperation'](_0x520124),_0x243598['model']['applyOperation'](_0x520124);break;}}}for(const _0x4ca12d of _0x21ecd2){const _0x19ad48=_0x243598['model']['createRangeOn'](_0x4ca12d),_0x569f6d='suggestion:formatBlock:$fakeWrap:'+_0x4c8592()+':$aiSuggestion';_0x230699['markers']['set'](_0x569f6d,_0x61509a(_0x19ad48,_0x243598['model']));}});}(_0x54eb05,_0x9ec19f,_0x49ca59):_0x49ca59['model']['change'](_0x3e0a77=>{for(const _0x19b37c of _0x54eb05)if('remove'==_0x19b37c['type']){const _0xe8f63e=_0x19b37c['sourcePosition'],_0x1eefcf=_0x19b37c['howMany'],_0x52879d=new _0x33fea2(_0xe8f63e,_0x1eefcf);_0x3e0a77['batch']['addOperation'](_0x52879d),_0x49ca59['model']['applyOperation'](_0x52879d);}else{if('marker'==_0x19b37c['type']){const _0x4179f1=_0x19b37c['name'],_0x17a904=_0x19b37c['newRange'];_0x9ec19f['markers']['set'](_0x4179f1,_0x17a904);}else _0x19b37c['baseVersion']=null,_0x19b37c['isDocumentOperation']=!0x1,_0x3e0a77['batch']['addOperation'](_0x19b37c),_0x49ca59['model']['applyOperation'](_0x19b37c);}});if(_0x460fe7){const _0x1477d0=w(_0x49ca59,_0x54eb05,_0x9ec19f);v(_0x49ca59['model'],_0x1477d0),function(_0x20cf4b,_0x6f28d3){const _0x176306=_0x6f28d3['getFirstRange']()['start'];let _0x11910f=_0x6f28d3['getFirstRange']()['end'];const _0x3e8fb8=_0x176306['root'];(_0x11910f['textNode']||_0x11910f['nodeAfter']&&_0x11910f['nodeAfter']['is']('$text'))&&(_0x5d6c8d(_0x11910f,'...'),_0x11910f=_0x11910f['getShiftedBy'](0x3)),(_0x176306['textNode']||_0x176306['nodeBefore']&&_0x176306['nodeBefore']['is']('$text'))&&(_0x5d6c8d(_0x176306,'...'),function(_0x3ce306,_0x375863,_0x101255){for(let [_0x8a8364,_0x45a9dd]of _0x3ce306['markers']){const _0x55df8c=_0x45a9dd['_getTransformedByInsertion'](_0x375863,_0x101255,!0x1);_0x45a9dd=_0x55df8c[0x0],_0x3ce306['markers']['set'](_0x8a8364,_0x45a9dd);}}(_0x3e8fb8,_0x176306,0x3),_0x176306['parent']==_0x11910f['parent']&&(_0x11910f=_0x11910f['getShiftedBy'](0x3)));const _0x29328a=_0x20cf4b['createRange'](_0x20cf4b['createPositionAt'](_0x3e8fb8,0x0),_0x176306),_0x1fdc1b=_0x20cf4b['createRange'](_0x11910f,_0x20cf4b['createPositionAt'](_0x3e8fb8,'end')),_0x17f2ad=[..._0x29328a['getMinimalFlatRanges'](),..._0x1fdc1b['getMinimalFlatRanges']()];_0x17f2ad['reverse']();for(const _0x1bccd2 of _0x17f2ad)to(_0x1bccd2),Zn(_0x3e8fb8,_0x1bccd2);}(_0x49ca59['model'],_0x1477d0);}const _0x1e5315=_0x49ca59['data']['stringify'](_0x9ec19f,{'showSuggestionHighlights':!0x0});return{'content':tr(_0x1e5315),'hasChanges':!0x0};}(_0x284954,_0x3dfff8,_0x2c3e80,_0x4848cc,_0x246928);return{'type':_0xf95fdf['changes'][0x0]['type'],'index':_0xf95fdf['index'],'content':_0x3dbb1d,'hasChanges':_0x32631a};});}function no(_0x39eaf6,_0x3b73f6){for(const [_0x46c62b,_0x382563]of _0x39eaf6['markers']){const _0x4810eb=_0x46f2b7['_createFromRanges'](_0x382563['getTransformedByOperation'](_0x3b73f6));_0x39eaf6['markers']['set'](_0x46c62b,_0x4810eb);}}function w(_0x59f74b,_0x48eff3,_0xb1711b){const _0x31bc48=_0x59f74b['plugins']['get']('DocumentCompare');let _0x24e89f=_0x59f74b['model']['createPositionAt'](_0xb1711b,Number['POSITIVE_INFINITY']),_0x2410f6=_0x59f74b['model']['createPositionAt'](_0xb1711b,0x0);for(const _0x5d5f66 of _0x48eff3){let _0x5f36e7,_0x5901f7;if(_0x31bc48['isMarkedRemoveOperation'](_0x5d5f66))_0x5f36e7=_0x5d5f66['newRange']['start'],_0x5901f7=_0x5d5f66['newRange']['end'];else switch(_0x24e89f=_0x24e89f['getTransformedByOperation'](_0x5d5f66),_0x2410f6=_0x2410f6['getTransformedByOperation'](_0x5d5f66),_0x5d5f66['type']){case'rename':_0x5f36e7=_0x5d5f66['position'],_0x5901f7=_0x5f36e7['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x5f36e7=_0x5d5f66['range']['start'],_0x5901f7=_0x5d5f66['range']['end'];break;case'insert':_0x5f36e7=_0x5d5f66['position'],_0x5901f7=_0x5f36e7['getShiftedBy'](_0x5d5f66['howMany']);break;case'split':_0x5f36e7=_0x5d5f66['splitPosition'],_0x5901f7=_0x5d5f66['moveTargetPosition'];break;case'merge':{const _0x1a7e68=_0x5d5f66['targetPosition']['path']['slice'](0x0,-0x1);_0x5f36e7=_0x59f74b['model']['createPositionFromPath'](_0xb1711b,_0x1a7e68),_0x5901f7=_0x5f36e7['getShiftedBy'](0x1);break;}case'remove':{const _0x39d2c3=_0x5d5f66['howMany'],_0x103160=_0x5d5f66['sourcePosition']['_getTransformedByInsertion'](_0x5d5f66['targetPosition'],_0x39d2c3),_0x4542aa=_0x5d5f66['getMovedRangeStart']();'remove'==_0x5d5f66['type']?(_0x5f36e7=_0x103160,_0x5901f7=_0x103160):(_0x5f36e7=_0x4542aa,_0x5901f7=_0x4542aa['getShiftedBy'](_0x39d2c3));break;}}_0x5f36e7&&_0x5f36e7['isBefore'](_0x24e89f)&&(_0x24e89f=_0x5f36e7['clone'](),_0x24e89f['stickiness']='toNone'),_0x5901f7&&_0x5901f7['isAfter'](_0x2410f6)&&(_0x2410f6=_0x5901f7['clone'](),_0x2410f6['stickiness']='toNone');}return _0x59f74b['model']['createSelection'](_0x59f74b['model']['createRange'](_0x24e89f,_0x2410f6));}function v(_0xf5b53a,_0x3149e2){ro(_0xf5b53a,_0x3149e2,'forward');const _0xc34868=_0x3149e2['getFirstRange']();_0x3149e2['setTo']([]),_0x3149e2['setTo'](_0xc34868,{'backward':!0x0}),ro(_0xf5b53a,_0x3149e2,'backward');}function ro(_0x382101,_0x14f06d,_0x435297){let _0x4a0bda=0x14;for(;_0x4a0bda;){_0x382101['modifySelection'](_0x14f06d,{'unit':'word','direction':_0x435297}),_0x4a0bda--;const _0x4d323d=_0x14f06d['focus']['forward'==_0x435297?'nodeBefore':'nodeAfter'];if(_0x4d323d&&_0x4d323d['is']('element')&&_0x382101['schema']['isBlock'](_0x4d323d)&&_0x382101['schema']['isObject'](_0x4d323d))break;}}function Zn(_0x5cf21d,_0x5e9279){for(const [_0x66c957,_0x6c3b99]of _0x5cf21d['markers']){const _0x1b114a=_0x6c3b99['_getTransformedByDeletion'](_0x5e9279['start'],_0x5e9279['end']['offset']-_0x5e9279['start']['offset']);null!=_0x1b114a?_0x5cf21d['markers']['set'](_0x66c957,_0x1b114a):_0x5cf21d['markers']['delete'](_0x66c957);}}const Wr=['modification-delta','text-delta','web-search','reasoning'],Yr=['conversation-title'];class je extends qt(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x46f624([]);['parsedMergedContent']=new _0x46f624([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x208615,content:_0x4b2966='',isDone:_0x48c09d=!0x1,interactionId:_0x5d51a2,areActionsDisabled:_0x3e9a04,documentContextContent:_0x486c3a,editor:_0x497546,id:_0x498af4}){super(),this['id']=_0x498af4||_0x4c8592(),this['interactionId']=_0x5d51a2,this['type']=_0x208615,this['areActionsDisabled']=!!_0x3e9a04,this['editor']=_0x497546,this['aiResponseParser']=new He(),this['aiResponseApplier']=new Je(),this['documentContextContent']=tr(_0x486c3a||''),this['set']('isDone',_0x48c09d),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x4b2966);}['appendContent'](_0x25442c){this['set']('content',this['content']+_0x25442c);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x2a1069,_0x1e9913){this['changeGroups'][_0x2a1069]['state']=_0x1e9913,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x2a1069,'state':_0x1e9913});}['getContentParts']({showDiff:_0x2988c4,groupIndex:_0x5b2a41}){if(!this['editor'])throw new _0x51167b('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x20299b=this['_getCachedContentParts'](_0x2988c4,_0x5b2a41);if(_0x20299b)return _0x20299b;let _0x223fce=[];if(void 0x0===_0x5b2a41)_0x223fce=this['changeGroups'];else{const _0x2baa0e=this['changeGroups']['find'](({index:_0x2cc608})=>_0x2cc608===_0x5b2a41);if(!_0x2baa0e)throw new _0x51167b('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x5b2a41});_0x223fce=[_0x2baa0e];}const _0x1097d4=lt({'editor':this['editor'],'showDiff':_0x2988c4,'changeGroups':_0x223fce,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x2988c4,_0x1097d4),_0x1097d4;}['_getCachedContentParts'](_0xc0ad5b,_0x1ecc0c){const _0x28b2e8=_0xc0ad5b?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x28b2e8]['length'])return null;const _0x456486=this['cachedSuggestionContentParts'][_0x28b2e8];if(void 0x0===_0x1ecc0c)return _0x48fdbf(_0x456486);{const _0x20efaa=_0x456486['find'](({index:_0x27bbcd})=>_0x27bbcd===_0x1ecc0c);if(_0x20efaa)return[_0x48fdbf(_0x20efaa)];}return null;}['_setCachedContentParts'](_0x437b12,_0x451cd7){const _0x2b405e=_0x437b12?'withDiff':'withoutDiff';_0x451cd7['forEach'](_0x4da823=>{const _0x145937=this['cachedSuggestionContentParts'][_0x2b405e],_0x51cee8=_0x145937['find'](({index:_0x51f8d9})=>_0x51f8d9===_0x4da823['index']);if(_0x51cee8){const _0x416bfc=_0x145937['indexOf'](_0x51cee8);_0x145937['splice'](_0x416bfc,0x1,_0x4da823);}else _0x145937['push'](_0x4da823);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x22eed0=this['changeGroups'];this['updateChangeGroups']();const _0x19ca42=this['_getDifferentChangeGroups'](_0x22eed0,this['changeGroups']);(_0x19ca42['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x19ca42),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0xcd73ec,_0x5dfb2d){const _0x56dc26=[];for(const _0x113ad0 of _0x5dfb2d){const _0x2562b3=_0xcd73ec[_0x113ad0['index']];_0x2562b3?_0x2562b3['changes']['length']!==_0x113ad0['changes']['length']?_0x56dc26['push'](_0x113ad0):_0x2562b3['changes']['forEach']((_0xfc73a3,_0x135174)=>{const _0x522bbd=_0x113ad0['changes'][_0x135174];_0xfc73a3['id']!==_0x522bbd['id']&&_0x56dc26['push'](_0x113ad0);}):_0x56dc26['push'](_0x113ad0);}return _0x56dc26;}['updateChangeGroups'](){const _0x4d3ce1=new _0x6f6481('p',{},[new _0x6f6481('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0xa884bf(u(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0xc7b64c=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x4d3ce1,'cutAfterLastChange':!this['isDone']});if(!_0xc7b64c['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0xc7b64c['parsedContent'];let _0x49c1b8=[];if(_0x2c4c1b(_0x597814=>{const _0x69fc5d=D(_0x597814,'data-id');if(!_0x69fc5d||!_0x446e57(_0x69fc5d))return!0x1;const _0x41a1c4=[_0x597814,...Le(_0x597814)]['at'](-0x2);if(_0x597814!=_0x41a1c4){const _0x47bb5d=D(_0x41a1c4,'data-id');_0x446e57(_0x47bb5d)||(_0x49c1b8['push']({'node':_0x41a1c4,'id':_0x47bb5d,'type':'modified'}),_0xc7b64c['modifiedNodeIds']['push'](_0x47bb5d));}else _0xc7b64c['modifiedNodeIds']['includes'](_0x69fc5d)?_0x49c1b8['push']({'node':_0x597814,'type':'modified','id':_0x69fc5d}):_0xc7b64c['newNodeIds']['includes'](_0x69fc5d)?_0x49c1b8['push']({'node':_0x597814,'type':'new','id':_0x69fc5d,'anchorId':D(_0x597814['previousSibling'],'data-id')}):_0x49c1b8['push']({'node':_0x597814,'type':'removed','id':_0x69fc5d});return!0x0;},this['parsedMergedContent']),_0x49c1b8=_0x49c1b8['filter'](({node:_0x2faf32})=>[...Le(_0x2faf32),_0x2faf32]['every'](_0x555151=>!D(_0x555151,'data-unstable'))),0x0==_0x49c1b8['length'])return;const _0x4c1d68=[[_0x49c1b8[0x0]]];for(let _0x31619f=0x1;_0x31619f<_0x49c1b8['length'];_0x31619f++){const _0x34682e=_0x4c1d68[_0x4c1d68['length']-0x1],_0x1efbdf=_0x34682e[_0x34682e['length']-0x1];_0x49c1b8[_0x31619f]['node']['previousSibling']==_0x1efbdf['node']&&'modified'!=_0x49c1b8[_0x31619f]['type']&&'modified'!=_0x1efbdf['type']?_0x34682e['push'](_0x49c1b8[_0x31619f]):_0x4c1d68['push']([_0x49c1b8[_0x31619f]]);}for(const _0x4bdbec of _0x4c1d68){const _0x3ee324=_0x4bdbec[0x0],_0x3b2e06=_0x4bdbec[_0x4bdbec['length']-0x1],_0x510e77=_0x294825(_0x3ee324['node']['previousSibling']);_0x510e77&&_0x4bdbec['unshift'](_0x510e77);const _0x5e766a=_0x294825(_0x3b2e06['node']['nextSibling']);_0x5e766a&&_0x4bdbec['push'](_0x5e766a);}function _0x446e57(_0x3a0d88){return _0xc7b64c['modifiedNodeIds']['includes'](_0x3a0d88)||_0xc7b64c['newNodeIds']['includes'](_0x3a0d88)||_0xc7b64c['removedNodeIds']['includes'](_0x3a0d88);}function _0x294825(_0x473183){if(_0x473183&&D(_0x473183,'data-id')&&!D(_0x473183,'data-unstable')){const _0x4da3c4=D(_0x473183,'data-id');if(!_0x446e57(_0x4da3c4))return{'node':_0x473183,'type':'context','id':_0x4da3c4};}return null;}this['changeGroups']=_0x4c1d68['map']((_0x117e9e,_0x5c6223)=>({'changes':_0x117e9e,'state':'pending','index':_0x5c6223}));}}function Xi(_0x1c284a){return Object['values'](Wr)['includes'](_0x1c284a);}function Qi(_0x203b46){return Yr['includes'](_0x203b46);}function Zi(_0x5bbfed){return'conversation-title'===_0x5bbfed;}function $i(_0x2eeae4){return'source'===_0x2eeae4;}const Wt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class xi extends _0x3f6d88(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0xd70d8a,editor:_0x3e21c9}){super(),this['id']=_0x4c8592(),this['connector']=_0xd70d8a,this['isStopped']=!0x0,this['editor']=_0x3e21c9;}async['start'](){let _0x5bcb50;const _0x35fb5e=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x54835c=await this['currentRequest']['getStream']();for await(const _0x451971 of _0x54835c){if(this['isStopped'])return;if('error'===_0x451971['event'])return void this['fire']('error',{'error':new _0x51167b('ai-chat-interaction-error',this)});if('message-metadata'!==_0x451971['event']){if('action-metadata'!==_0x451971['event']){if(Zi(_0x451971['event'])&&this['setConversationTitle'](_0x451971['data']['conversationTitle'],!0x0),$i(_0x451971['event']))_0x35fb5e['push'](_0x451971['data']['source']);else{if(Xi(_0x451971['event'])){if(_0x451971['event']!==_0x5bcb50){if(_0x5bcb50=_0x451971['event'],'web-search'===_0x451971['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x451971['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':_0x451971['event'],'interactionId':this['id'],'id':_0x451971['data']?.['id']}),_0x35fb5e['length']>0x0&&'modification-delta'===_0x451971['event']&&(this['currentReply']['sources']=_0x35fb5e['splice'](0x0));}_0x451971['data']['textDelta']&&this['currentReply']['appendContent'](_0x451971['data']['textDelta']);}else Qi(_0x451971['event'])||zt('ai-interaction-invalid-event-type',{'chunk':_0x451971});}}else this['actionCallId']=_0x451971['data']['callId'];}else this['messageId']=_0x451971['data']['messageId'];}}finally{this['isStopped']||(_0x35fb5e['length']>0x0&&(this['currentReply']['sources']=_0x35fb5e['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x1237e1){return this['replies']['find'](_0x59fe08=>_0x59fe08['id']===_0x1237e1);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0xff2471=>_0xff2471['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x3f5c5e){const _0x444818=new je({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x3f5c5e});return this['replies']['push'](_0x444818),_0x444818['delegate'](...Wt)['to'](this),this['fire']('replyCreated',_0x444818),_0x444818;}['setConversationTitle'](_0x2f0e26,_0x45f377=!0x1){this['fire']('setConversationTitle',_0x2f0e26,_0x45f377);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var $t=function(_0x28e9f8){return _0x28e9f8['FILE']='file',_0x28e9f8['DOCUMENT']='document',_0x28e9f8['URL']='web-resource',_0x28e9f8['TEXT']='text',_0x28e9f8['SELECTION']='selection',_0x28e9f8;}({}),Ht=function(_0x55e577){return _0x55e577['TEXT']='text',_0x55e577['MARKDOWN']='markdown',_0x55e577['HTML']='html',_0x55e577;}({});const Jt=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Gt extends qt(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x26ab3b,config:_0x539eb6,ownerId:_0x122ea6}){super(),this['_connector']=_0x26ab3b,this['_config']=_0x539eb6,this['_ownerId']=_0x122ea6;}['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'](_0x294d0e){const _0x1b150a=await this['_createContextItemFromContent'](_0x294d0e);return this['_addToConversationContextItem'](_0x1b150a),'current-document'===_0x1b150a['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x1b150a;}async['_createContextItemFromContent'](_0x1db569){if(_0x1db569['type']===$t['DOCUMENT']){const _0x1de38d=await this['_connector']['fetchDocument'](this['_ownerId'],_0x1db569['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x1db569['type'],'content':_0x1de38d['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x1de38d['attributes']?.['version'],'sessionId':_0x1de38d['attributes']?.['sessionId']};}return{'id':_0x1db569['id'],'uiId':_0x1db569['id'],'label':_0x1db569['attributes']?.['label']||_0x1db569['name']||_0x1db569['url']||_0x1db569['id'],'type':_0x1db569['type'],..._0x1db569?.['attributes']?.['resourceId']?{'resourceId':_0x1db569['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x4b5978){const _0x4fd277=this['_pendingContextItems']['get'](_0x4b5978);_0x4fd277?.['isReadOnly']||this['_removeContextItem'](_0x4b5978);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x1b43bd of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x1b43bd['uiId']);const _0x2ac621=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x2ac621&&this['_addContextItem']({..._0x2ac621,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x20d89d){for(const _0x548831 of _0x20d89d['values']())this['_addToConversationContextItem'](_0x548831);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'](_0x3b9515){return Array['from'](_0x3b9515['values']())['map'](_0x5b9fcc=>this['_mapContextItemToRequestData'](_0x5b9fcc))['filter'](_0x3ea676=>null!==_0x3ea676);}async['addFilesToContext'](_0x518a32,_0x49e58b,_0x39d7e2=$t['FILE']){const _0x27bf79='files-'+_0x4c8592();this['_startUploadOperation'](_0x27bf79);try{await Promise['all'](_0x518a32['map'](async _0x4cd0df=>{const _0x356e29='file-'+_0x4c8592(),_0xc1694c=Xt(_0x4cd0df['name']);try{this['_addContextItem']({'type':_0x39d7e2,'label':_0x49e58b?.['label']||_0xc1694c,'uiId':_0x356e29,'resourceId':_0x49e58b?.['resourceId']},!0x0);const _0x5f2c4e=this['_connector']['uploadFile'](this['_ownerId'],_0x4cd0df,_0x49e58b);this['_ongoingUploads']['set'](_0x356e29,_0x5f2c4e['abortController']);const {id:_0x2333a6}=await _0x5f2c4e['getId']();this['_ongoingUploads']['delete'](_0x356e29),this['_finishContextItemLoading']({'type':_0x39d7e2,'id':_0x2333a6,'label':_0x49e58b?.['label']||_0xc1694c,'uiId':_0x356e29,'resourceId':_0x49e58b?.['resourceId']},!0x1);}catch(_0x112b54){this['_ongoingUploads']['delete'](_0x356e29);if(!_0x112b54['message']['startsWith']('ai-request-aborted')){const _0xf6ca83=new _0x51167b('ai-chat-file-upload-failed',null,{'fileName':_0xc1694c});_0xf6ca83['stack']=_0x112b54['stack'],this['fire']('error',{'error':_0xf6ca83,'fileName':_0xc1694c});}this['_removeContextItem'](_0x356e29);}}));}finally{this['_finishUploadOperation'](_0x27bf79);}}['addCurrentDocumentToContext'](_0x1bff63){if(this['isCurrentDocumentInContext']())return;const _0x56f91f={'type':$t['DOCUMENT'],'uiId':'current-document','label':_0x1bff63,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x56f91f);}async['updateCurrentDocument'](_0x1543f4,_0x217e8c,_0x4d301c,_0x3e6178){const _0x4756fa=this['_pendingContextItems']['get']('current-document');if(_0x4756fa&&_0x1543f4){_0x4756fa['selection']=_0x3e6178?_0x3e6178['map'](_0x258c1e=>({'start':_0x258c1e['start'],'end':_0x258c1e['end']})):[];try{if(_0x4756fa['version']===_0x217e8c)return;const {id:_0x38f781}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x1543f4,{'version':_0x217e8c,'sessionId':_0x4d301c})['getId']();_0x4756fa['id']=_0x38f781,_0x4756fa['content']=_0x1543f4,_0x4756fa['version']=_0x217e8c,_0x4756fa['sessionId']=_0x4d301c;}catch(_0x12e41e){const _0x442c5a=new _0x51167b('ai-chat-document-upload-failed',null);_0x442c5a['stack']=_0x12e41e['stack'],this['fire']('error',{'error':_0x442c5a});}}}['addSelectionToContext'](_0x4b92fb){this['_addContextItem']({'type':$t['SELECTION'],'label':_0x4b92fb,'uiId':'selection','content':_0x4b92fb});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x330b0e,_0xf38ba9){const _0x415445='url-'+_0x4c8592();this['_startUploadOperation'](_0x415445);const _0x517a3d='url-'+_0x4c8592();try{this['_addContextItem']({'type':$t['URL'],'label':_0xf38ba9?.['label']||_0x330b0e,'uiId':_0x517a3d,'resourceId':_0xf38ba9?.['resourceId']},!0x0);const _0x13ed7e=this['_connector']['uploadUrl'](this['_ownerId'],_0x330b0e,_0xf38ba9);this['_ongoingUploads']['set'](_0x517a3d,_0x13ed7e['abortController']);const {id:_0x53b894}=await _0x13ed7e['getId']();this['_ongoingUploads']['delete'](_0x517a3d),this['_finishContextItemLoading']({'type':$t['URL'],'id':_0x53b894,'label':_0xf38ba9?.['label']||_0x330b0e,'uiId':_0x517a3d,'resourceId':_0xf38ba9?.['resourceId']},!0x1);}catch(_0x2876b3){this['_ongoingUploads']['delete'](_0x517a3d),(_0x2876b3['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x51167b('ai-chat-url-upload-failed',this,{'url':_0x330b0e,'originalError':_0x2876b3}),'url':_0x330b0e}),this['_removeContextItem'](_0x517a3d));}finally{this['_finishUploadOperation'](_0x415445);}}async['loadSourceResources'](_0x2d3eb0,_0x10c6cc,_0x3cf671){const _0x3bc91d=this['_addContextOptionsState']['sources']['find'](_0x349154=>_0x349154['id']===_0x2d3eb0);if(!_0x3bc91d)return this['fire']('error',{'error':new _0x51167b('ai-chat-source-not-found',this,{'sourceId':_0x2d3eb0}),'sourceId':_0x2d3eb0}),[];try{const _0x5bf274=(await _0x3bc91d['getResources'](_0x10c6cc))['map'](_0xf1b92=>{const _0x3435f2=this['_isResourceInContext'](_0xf1b92['id']);return{..._0xf1b92,'isInContext':_0x3435f2};});return _0x3bc91d['resources']=_0x5bf274,this['fire']('sourceResourcesLoaded',{'sourceId':_0x2d3eb0,'source':_0x3bc91d,'resources':_0x5bf274,'uid':_0x3cf671}),_0x5bf274;}catch(_0x19b4be){return this['fire']('error',{'error':new _0x51167b('ai-chat-source-resources-load-failed',this,{'sourceId':_0x2d3eb0,'originalError':_0x19b4be}),'sourceId':_0x2d3eb0,'sourceLabel':_0x3bc91d['label']}),[];}}async['addResourceToContext'](_0x5a5878,_0x38811c){if(this['_isResourceInContext'](_0x38811c['id']))return;let _0x3eb7a6=_0x38811c['data'];if(!_0x3eb7a6&&_0x5a5878['getData'])try{_0x3eb7a6=await _0x5a5878['getData'](_0x38811c['id']);}catch(_0x333ccf){return void this['fire']('error',{'error':new _0x51167b('ai-chat-resource-load-failed',this,{'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id'],'originalError':_0x333ccf}),'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id']});}if(_0x3eb7a6)switch(_0x38811c['type']){case $t['URL']:if('string'!=typeof _0x3eb7a6)return void this['fire']('error',{'error':new _0x51167b('ai-chat-context-invalid-data',this,{'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id'],'expectedType':'string','actualType':typeof _0x3eb7a6}),'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id']});await this['addUrlToContext'](_0x3eb7a6,{'label':_0x38811c['label'],'resourceId':_0x38811c['id']});break;case $t['FILE']:if(!(_0x3eb7a6 instanceof File))return void this['fire']('error',{'error':new _0x51167b('ai-chat-context-invalid-data',this,{'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id'],'expectedType':'File','actualType':typeof _0x3eb7a6}),'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id']});await this['addFilesToContext']([_0x3eb7a6],{'label':_0x38811c['label'],'resourceId':_0x38811c['id']});break;case $t['TEXT']:if('object'!=typeof _0x3eb7a6||!('content'in _0x3eb7a6)||!('type'in _0x3eb7a6))return void this['fire']('error',{'error':new _0x51167b('ai-chat-context-invalid-data',this,{'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x3eb7a6}),'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id']});_0x3eb7a6=Gt['_convertTextResourceToFile'](_0x3eb7a6,_0x38811c['label']),await this['addFilesToContext']([_0x3eb7a6],{'label':_0x38811c['label'],'resourceId':_0x38811c['id']},$t['TEXT']);break;default:this['fire']('error',{'error':new _0x51167b('ai-chat-context-unsupported-type',this,{'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id'],'resourceType':_0x38811c['type']}),'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id']});}else this['fire']('error',{'error':new _0x51167b('ai-chat-resource-no-data',this,{'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id']}),'resourceId':_0x38811c['id'],'sourceId':_0x5a5878['id']});}static['_convertTextResourceToFile'](_0x406f25,_0x3e9186){switch(_0x406f25['type']){case Ht['MARKDOWN']:return new File([_0x406f25['content']],_0x3e9186,{'type':'text/markdown'});case Ht['HTML']:return new File([_0x406f25['content']],_0x3e9186,{'type':'text/html'});default:return new File([_0x406f25['content']],_0x3e9186,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x4c3e39){switch(_0x4c3e39['type']){case $t['FILE']:return{'type':$t['FILE'],'id':_0x4c3e39['id']};case $t['URL']:return{'type':$t['URL'],'id':_0x4c3e39['id']};case $t['DOCUMENT']:return{'type':$t['DOCUMENT'],'id':_0x4c3e39['id'],..._0x4c3e39['selection']?.['length']&&{'selection':_0x4c3e39['selection']}};case $t['TEXT']:return{'type':$t['FILE'],'id':_0x4c3e39['id']};default:return null;}}['_addContextItem'](_0x5568ae,_0x105abb=!0x1){if(this['_pendingContextItems']['set'](_0x5568ae['uiId'],_0x5568ae),_0x5568ae['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x5568ae,'isLoading':_0x105abb}),'current-document'===_0x5568ae['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5568ae['resourceId']){const _0x29c29c=this['_findSourceIdsByResourceId'](_0x5568ae['resourceId']);_0x29c29c&&_0x29c29c['forEach'](_0x3ec8f5=>{this['_updateResourceInContextState'](_0x3ec8f5,_0x5568ae['resourceId'],!0x0);});}}['_removeContextItem'](_0x49d8f3){const _0x1f0f7b=this['_pendingContextItems']['get'](_0x49d8f3),_0x4dcca6=this['_ongoingUploads']['get'](_0x49d8f3);if(_0x4dcca6&&(_0x4dcca6['abort'](),this['_ongoingUploads']['delete'](_0x49d8f3)),_0x1f0f7b?.['resourceId']){const _0x5c00a2=this['_findSourceIdsByResourceId'](_0x1f0f7b['resourceId']);_0x5c00a2&&_0x5c00a2['forEach'](_0x57663d=>{this['_updateResourceInContextState'](_0x57663d,_0x1f0f7b['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x49d8f3),this['fire']('contextItemRemoved',{'uiId':_0x49d8f3,'type':_0x1f0f7b?.['type']}),'current-document'===_0x49d8f3&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x267abb,_0x330358){if(this['_pendingContextItems']['has'](_0x267abb['uiId'])&&(this['_pendingContextItems']['set'](_0x267abb['uiId'],_0x267abb),this['fire']('contextItemLoadingEnded',{'contextItem':_0x267abb,'isLoading':_0x330358}),_0x267abb['resourceId'])){const _0xdd7ae6=this['_findSourceIdsByResourceId'](_0x267abb['resourceId']);_0xdd7ae6&&_0xdd7ae6['forEach'](_0x21ce78=>{this['_updateResourceInContextState'](_0x21ce78,_0x267abb['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x3b7b){this['_conversationContextItems']['set'](_0x3b7b['uiId'],_0x3b7b);}['_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'](_0x4a11ac=>({..._0x4a11ac,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x186768=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x186768,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x376585){for(const _0xb423bb of this['_pendingContextItems']['values']())if(_0xb423bb['resourceId']===_0x376585)return!0x0;for(const _0x55ad08 of this['_conversationContextItems']['values']())if(_0x55ad08['resourceId']===_0x376585)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x54d233){const _0x24ee0c=[];for(const _0x1d4925 of this['_addContextOptionsState']['sources']){_0x1d4925['resources']['find'](_0x52216a=>_0x52216a['id']===_0x54d233)&&_0x24ee0c['push'](_0x1d4925['id']);}return 0x0===_0x24ee0c['length']?null:_0x24ee0c;}['_updateResourceInContextState'](_0x3ab88c,_0x4fa3f7,_0x398976){const _0x1d34f0=this['_addContextOptionsState']['sources']['find'](_0x3c16b6=>_0x3c16b6['id']===_0x3ab88c);if(!_0x1d34f0)return;const _0x87f0aa=_0x1d34f0['resources']['find'](_0x523f0c=>_0x523f0c['id']===_0x4fa3f7);_0x87f0aa&&(_0x87f0aa['isInContext']=_0x398976,this['fire']('resourceStateChanged',{'sourceId':_0x3ab88c,'resourceId':_0x4fa3f7,'isInContext':_0x398976}));}['_startUploadOperation'](_0x14c43d){this['_ongoingUploadOperations']['set'](_0x14c43d,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x1d3470){this['_ongoingUploadOperations']['delete'](_0x1d3470),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Zt=['capabilitiesUpdated'];class Yt extends _0x3f6d88(){['_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'](_0x419393){const _0x318083={};return _0x419393&&_0x419393['isWebSearchEnabled']&&(_0x318083['webSearch']={}),_0x419393&&_0x419393['isReasoningEnabled']&&(_0x318083['reasoning']={}),_0x318083;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x33de3c){_0x33de3c!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x33de3c,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x3f50a4){_0x3f50a4!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x3f50a4,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ci extends xi{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x57a888){super(_0x57a888),this['conversationId']=_0x57a888['conversationId'],this['contextItems']=_0x57a888['contextItems'],this['capabilities']=_0x57a888['capabilities'],this['userMessage']=_0x57a888['userMessage'],this['model']=_0x57a888['model'],this['quickActionData']=_0x57a888['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Gt['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Yt['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class p extends _0x3f6d88(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x4cc321){super(),this['options']=_0x4cc321,this['connector']=_0x4cc321['connector'],this['chatModels']=_0x4cc321['chatModels'],this['id']=_0x4cc321['conversationId'];}async['init'](_0x4a0624){try{this['chatContext']=new Gt({'connector':this['connector'],'config':_0x4a0624,'ownerId':this['id']}),this['chatContext']['delegate'](...Jt)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Yt(),this['chatCapabilities']['delegate'](...Zt)['to'](this),this['chatCapabilities']['init']();const _0x338e87=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x338e87});const _0x5d7f4a=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x5d7f4a&&await this['setModel'](_0x5d7f4a);}catch(_0x59d200){const _0x156e28=new _0x51167b('ai-chat-conversation-init-failed',null,{'message':_0x59d200['message']});_0x156e28['stack']=_0x59d200['stack'],this['fire']('error',{'error':_0x156e28});}}async['start'](){if(this['isStarted'])throw new _0x51167b('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x51167b('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x29e599}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x29e599,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x524fce){const _0x5ab29c=new _0x51167b('ai-chat-conversation-start-failed',null,{'message':_0x524fce['message']});_0x5ab29c['stack']=_0x524fce['stack'],this['fire']('error',{'error':_0x5ab29c});}}async['load'](_0xa38332,_0x29a881){try{const _0x283170=await this['connector']['fetchConversation'](_0xa38332)['getConversation'](),_0x15aca9=await this['connector']['fetchConversationMessages'](_0xa38332)['getMessages'](),_0x236bff=_0x15aca9[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x283170['id'],'title'in _0x283170?this['fire']('setConversationTitle',_0x283170['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x202ab9=(await this['chatModels']['getAll']())['find'](_0xdab268=>_0xdab268['id']['toLowerCase']()===_0x236bff['toLowerCase']());return this['selectedModel']=_0x202ab9,this['fire']('modelSelected',{'selectedModel':_0x202ab9,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x15aca9,_0x29a881,_0x236bff),this['currentInteraction']=void 0x0,this;}catch(_0x54be48){const _0x174479=new _0x51167b('ai-chat-conversation-init-from-id-failed',null,{'message':_0x54be48['message'],'conversationId':_0xa38332});throw _0x174479['stack']=_0x54be48['stack'],this['fire']('error',{'error':_0x174479}),_0x174479;}}async['_processMessagesToInteractions'](_0x12a0cc,_0x18ccf6,_0x43b360){let _0xe4747d;for(const _0x3fc03a of _0x12a0cc)if('user'===_0x3fc03a['role']){const _0x4b42a8=await this['_extractContextItems'](_0x3fc03a),_0x39dd2e={'isReasoningEnabled':Object['hasOwn'](_0x3fc03a['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x3fc03a['capabilities'],'webSearch')};_0xe4747d=this['createInteraction']({'userMessage':_0x3fc03a['prompt'],'contextItems':_0x4b42a8,'capabilities':_0x39dd2e,'modelId':_0x43b360,'quickActionData':_0x3fc03a['attributes']?.['quickActionData']}),this['currentInteraction']=_0xe4747d,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x3fc03a['role']&&_0xe4747d)for(const _0x551bbf of _0x3fc03a['content']){const _0x4230c5='text'===_0x551bbf['type']?'text-delta':'modification-delta',_0x35fdf2=_0xe4747d['getDocumentContext']()?.['sessionId']!==_0x18ccf6;_0xe4747d['currentReply']=_0xe4747d['createReply']({'type':_0x4230c5,'isDone':!0x0,'interactionId':_0xe4747d['id'],'areActionsDisabled':_0x35fdf2}),_0xe4747d['currentReply']['appendContent'](_0x551bbf['content']);}}}async['_extractContextItems'](_0x4441d8){const _0x5bae0c=new Map();if(!_0x4441d8['content'])return _0x5bae0c;for(const _0x2fbc2e of _0x4441d8['content']){const _0xc92f5=await this['chatContext']['populateFromMessage'](_0x2fbc2e);_0xc92f5&&_0x5bae0c['set'](_0xc92f5['id'],_0xc92f5);}return _0x5bae0c;}async['handleUserInteraction']({userMessage:_0x49d7cd,quickActionData:_0x2e1a6f}){if(!this['isStarted'])throw new _0x51167b('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x51167b('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x50cfc9=this['chatContext']['getPendingContextItems'](),_0x277564=this['chatCapabilities']['getCapabilitiesConfig'](),_0x132ed6=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x49d7cd,'contextItems':_0x50cfc9,'capabilities':_0x277564,'modelId':_0x132ed6,'quickActionData':_0x2e1a6f}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x39e3d5){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x39e3d5});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5404f1,contextItems:_0x1d2cc1,capabilities:_0x39daeb,modelId:_0x4c858b,quickActionData:_0x6db992}){const _0x97c710=new Ci({'userMessage':_0x5404f1,'contextItems':_0x1d2cc1,'capabilities':_0x39daeb,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x4c858b,'quickActionData':_0x6db992});return _0x97c710['delegate'](...Wt)['to'](this),this['interactions']['push'](_0x97c710),this['fire']('interactionCreated',_0x97c710),_0x97c710;}['getInteraction'](_0x1bf6b3){return this['interactions']['find'](_0xde7a41=>_0xde7a41['id']===_0x1bf6b3);}['removeInteraction'](_0x76ee76){const _0x2637a4=this['getInteraction'](_0x76ee76);_0x2637a4&&(_0x2637a4['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x2637a4),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x2f992b){this['chatContext']['addCurrentDocumentToContext'](_0x2f992b);}async['updateCurrentDocumentInContext']({content:_0x5930de,version:_0x46d12e,sessionId:_0x2db1ac,selections:_0xdf5bf3}){await this['chatContext']['updateCurrentDocument'](_0x5930de,_0x46d12e,_0x2db1ac,_0xdf5bf3);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x2eb742){this['chatContext']['addSelectionToContext'](_0x2eb742);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x215e41){this['chatContext']['addFilesToContext'](_0x215e41);}['addUrlToContext'](_0x370a4b){this['chatContext']['addUrlToContext'](_0x370a4b);}['addResourceToContext'](_0x54bcd2,_0x1e122f){this['chatContext']['addResourceToContext'](_0x54bcd2,_0x1e122f);}['loadSourceResources'](_0xbe84a5,_0xfcc059,_0x3ac425){return this['chatContext']['loadSourceResources'](_0xbe84a5,_0xfcc059,_0x3ac425);}['removeFromContext'](_0x25e43a){this['chatContext']['removeFromContext'](_0x25e43a);}['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'](_0x3e6816){_0x3e6816?!0x1===await this['chatModels']['isAvailable'](_0x3e6816)&&(zt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x3e6816}),_0x3e6816=(await this['chatModels']['getAvailableModels']())[0x0]):(zt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x3e6816=(await this['chatModels']['getAvailableModels']())[0x0]),_0x3e6816['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x3e6816,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x3e6816}));}}function _(_0x11f5a5){if(_0x11f5a5 instanceof _0x507c90)return _0x11f5a5;if(_0x11f5a5?.['editors']&&_0x11f5a5['editors']['get'](0x0))return _0x11f5a5['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.'),_0x11f5a5['editors']['get'](0x0);throw new _0x51167b('ai-get-editor-from-context-no-editor');}const m='ai-selection';class a extends _0x47d85c{['_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 _0x563378=_(this['context']),_0x459a1a=_0x563378['plugins']['has']('RealTimeCollaborationClient')&&_0x563378['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x459a1a||_0x4c8592();}return this['_sessionId'];}['getDocumentData'](){const _0x4fb1dd=_(this['context']),_0x1e1f91=_0x4fb1dd['model'],_0x55ad02=_0x4fb1dd['data']['toView'](_0x1e1f91['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x41318d=new dt(_0x4fb1dd['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x55ad02,_0x41318d);let _0xb26970=_0x4fb1dd['data']['processor']['toData'](_0x55ad02);const _0x4e976c=this['_getMarkersInDocumentOrder'](),_0x49a6f2=[];for(const _0x4281e6 of _0x4e976c){const _0x58358c='<'+_0x4281e6['name']+':start></'+_0x4281e6['name']+':start>',_0x543559=_0xb26970['indexOf'](_0x58358c);_0xb26970=_0xb26970['substring'](0x0,_0x543559)+_0xb26970['substring'](_0x543559+_0x58358c['length']);const _0x55ecad='<'+_0x4281e6['name']+':end></'+_0x4281e6['name']+':end>',_0x141e13=_0xb26970['indexOf'](_0x55ecad);_0xb26970=_0xb26970['substring'](0x0,_0x141e13)+_0xb26970['substring'](_0x141e13+_0x55ecad['length']),_0x49a6f2['push']({'markerName':_0x4281e6['name'],'start':_0x543559,'end':_0x141e13,'htmlFragment':_0xb26970['substring'](_0x543559,_0x141e13)});}return{'content':_0xb26970,'version':_0x4fb1dd['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x49a6f2};}async['afterInit'](){this['context']instanceof _0x507c90?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x345849,_0xc36f9a)=>{_0xc36f9a['on']('ready',()=>{this['_integrateEditor'](_0xc36f9a);});});}['_integrateEditor'](_0x1985fc){_0x1985fc['conversion']['for']('editingDowncast')['markerToHighlight']({'model':m,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x1985fc['conversion']['for']('dataDowncast')['markerToElement']({'model':m,'view':(_0x9b9d51,{writer:_0x5c7590,options:_0x2125dc})=>_0x2125dc['convertAiChatSelectionMarker']?_0x5c7590['createUIElement'](_0x9b9d51['markerName']+':'+(_0x9b9d51['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1af20e,_0x507820,_0x91f6ed=!0x1,_0x3e77a6=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x3e77a6)return!0x1;const _0x1b0f50=_(this['context'])['model'];return _0x1b0f50['change'](_0x198887=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x507820,this['_displayedFakeSelectionLocked']=_0x91f6ed;let _0x42aaa1=0x0;for(let _0x4a4d78 of _0x1af20e){const _0x2e5535=m+':'+_0x42aaa1;if(_0x4a4d78['start']['isAtEnd']){const _0x5f34b4=_0x4a4d78['start']['getLastMatchingPosition'](({item:_0x1da8d1})=>!_0x1b0f50['schema']['isContent'](_0x1da8d1),{'boundaries':_0x4a4d78});_0x4a4d78=_0x198887['createRange'](_0x5f34b4,_0x4a4d78['end']);}_0x198887['addMarker'](_0x2e5535,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4a4d78}),_0x42aaa1++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x5bf796){if(this['_displayedFakeSelectionId']!=_0x5bf796)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x535934=_(this['context']),_0x456df3=_0x535934['model']['markers']['getMarkersGroup'](m);return _0x535934['model']['change'](_0x551470=>{for(const _0x3f2938 of _0x456df3)_0x551470['removeMarker'](_0x3f2938);}),!0x0;}['modelToViewWithIds'](_0x360cd6){const _0x1d238d=_(this['context']),_0x40a706=_0x1d238d['data']['toView'](_0x360cd6),_0x24afc9=new dt(_0x1d238d['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x40a706,_0x24afc9),_0x40a706;}['_setDataIdsOnChildren'](_0x26b678,_0x1ae40c){let _0x4c1705=!0x1;const _0x3eeb5a=new Set();for(const _0x2d32a2 of _0x26b678['getChildren']()){const _0x4be220=_0x2d32a2['is']('emptyElement')||_0x2d32a2['is']('containerElement');if(!_0x2d32a2['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x2d32a2,_0x1ae40c)||_0x4be220)&&(_0x1ae40c['setAttribute']('data-id',this['_nextDataId'](_0x3eeb5a),_0x2d32a2),_0x4c1705=!0x0);}return _0x4c1705;}['_nextDataId'](_0xe0ca9a){let _0x4a501b;do{_0x4a501b='';for(let _0x318449=0x0;_0x318449<0x4;_0x318449++)_0x4a501b+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0xe0ca9a['has'](_0x4a501b));return _0xe0ca9a['add'](_0x4a501b),_0x4a501b;}['getSelectionText'](){const {model:_0x1ed17f}=_(this['context']),_0x56f6c1=_0x1ed17f['document']['selection'],_0x15c971=_0x1ed17f['getSelectedContent'](_0x56f6c1),_0x42eef2=[],_0x4995f0=_0x1ed17f['createRangeIn'](_0x15c971)['getWalker']();for(const {item:_0x19bfa1}of _0x4995f0)_0x19bfa1['is']('$textProxy')?_0x42eef2['push'](_0x19bfa1['data']):_0x19bfa1['is']('element')&&_0x42eef2['length']>0x0&&'\x20'!==_0x42eef2[_0x42eef2['length']-0x1]&&_0x42eef2['push']('\x20');return'\x22'+_0x42eef2['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x1ae26f=_(this['context'])['model'];return Array['from'](_0x1ae26f['markers']['getMarkersGroup'](m))['sort']((_0x3532cd,_0x42b71e)=>_0x3532cd['getStart']()['isBefore'](_0x42b71e['getStart']())?-0x1:_0x3532cd['getStart']()['isAfter'](_0x42b71e['getStart']())?0x1:0x0);}}const f=['applySuggestion','insertSuggestion','showChangeInText'];class nh extends st{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x766671,_0x5d931c){super(_0x766671),this['_dropdownOriginalConfig']=_0x5d931c||[...f],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x1cd678=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x12ff1d({'label':Hn('applySuggestion',_0x766671,this['_partsCount']),'icon':_0x4ffa92,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x12ff1d({'label':Hn('showChangeInText',_0x766671,this['_partsCount']),'icon':_0x4483a,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x12ff1d({'label':Hn('insertSuggestion',_0x766671,this['_partsCount']),'icon':_0x3d6660,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x766671),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',_0x1cd678['if']('isVisible','ck-hidden',_0x59f6e8=>!_0x59f6e8)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x97f088=>'applySuggestion'!==_0x97f088):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x766671);});}['_updateDropdownActions'](_0xbcc78d){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0xbcc78d),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x271a16){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x4bb379=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x271a16):this['_createActionsDropdown'](_0x271a16),_0x3354f6=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x4bb379['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x271a16,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x271a16,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x3354f6});for(const _0x181418 of this['_dropdownCurrentConfig'])_0x4bb379['on'](_0x181418,()=>{this['fire'](_0x181418);});return this['_firstRender']=!0x1,_0x4bb379;}['_createActionsButton'](_0x4aef10){const _0x4bd522=new tt(_0x4aef10);return _0x4bd522['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x4bd522['on']('execute',()=>{_0x4bd522['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x4bd522;}['_createActionsDropdown'](_0x4d1509){const _0x1e12d8=new Gn(_0x4d1509,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x1a93ee=>{switch(_0x1a93ee){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x1e12d8['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x4d1509,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x4d1509,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x1e12d8['bind']('isEnabled')['to'](this),_0x1e12d8;}['updateLabels'](_0x3bcc23){const _0x537b95=this['locale'];this['_partsCount']=_0x3bcc23||this['_partsCount'],this['actionsButton']['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x537b95,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x537b95,this['_partsCount'])}),this['applySuggestionModel']['label']=Hn('applySuggestion',_0x537b95,this['_partsCount']),this['showChangeInTextModel']['label']=Hn('showChangeInText',_0x537b95,this['_partsCount']),this['insertSuggestionModel']['label']=Hn('insertSuggestion',_0x537b95,this['_partsCount']);}}class Gn extends _0x2141f1{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x34c468,_0x143195){super(_0x34c468),this['balloonPanelView']=new _0x5266db(this['locale']),this['bodyCollection']=new Et(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x143195['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',u(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x279be6=_0x143195['listItemModels'][0x0]['actionName'];this['fire'](_0x279be6),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?yn:Pn]}),this['listView']['focus']());}),ts({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x4c3220){const _0x390479=this['locale'],_0x228552=new _0x493f65(_0x390479);for(const _0xc383cd of _0x4c3220){const _0x4f8873=new _0x5374ac(_0x390479),_0x1751e4=new _0x526cc2(_0x390479);_0x1751e4['bind'](...Object['keys'](_0xc383cd))['to'](_0xc383cd),_0x1751e4['delegate']('execute')['to'](_0x228552),_0x4f8873['children']['add'](_0x1751e4),_0x228552['items']['add'](_0x4f8873);}return _0x228552['items']['delegate']('execute')['to'](this),_0x228552['on']('execute',_0x29684e=>{const _0x59a109=_0x29684e['source'];this['fire'](_0x59a109['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x228552;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x2ec108(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x3e86ad,_0x555272)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x555272();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function yn(_0x4b0eb6){return{'top':_0x4b0eb6['bottom'],'left':_0x4b0eb6['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x1e83e4,_0x10fa16){return{'top':_0x1e83e4['bottom'],'left':_0x1e83e4['left']-(_0x10fa16['width']-_0x1e83e4['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Hn(_0xc9201e,_0x8ebf7c,_0x2520a1){switch(_0xc9201e){case'applySuggestion':return u(_0x8ebf7c,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x2520a1);case'showChangeInText':return u(_0x8ebf7c,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x2520a1);case'insertSuggestion':return u(_0x8ebf7c,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x2520a1);}}function Ln(_0xd09057,_0x1fa5f4,_0x45b805){switch(_0xd09057){case'applySuggestion':return u(_0x1fa5f4,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x45b805);case'showChangeInText':return u(_0x1fa5f4,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x45b805);case'insertSuggestion':return u(_0x1fa5f4,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x45b805);}}class ni extends _0x3f6d88(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x520833,availableModels:_0x3eb7bc,defaultModelId:_0x109f95}){super(),this['_connector']=_0x520833,this['_availableModels']=_0x3eb7bc,this['_defaultModelId']=_0x109f95;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x425c5f=this['_connector']['getModels'](),_0x3f2959=await _0x425c5f['list']();this['_modelList']=_0x3f2959['items'];}catch(_0x3a6e92){throw new _0x51167b('ai-models-unable-to-retrieve',null,{'error':_0x3a6e92});}return[...this['_modelList']];}async['getAvailableModels'](){const _0x50b3bf=await this['getAll']();return this['_filterModels'](_0x50b3bf,this['_availableModels']);}async['getModel'](_0x1630bd){const _0x5276ac=await this['getAll']();if(!_0x5276ac['length'])return null;if(_0x1630bd){const _0x39935f=this['_getModelById'](_0x5276ac,_0x1630bd);if(_0x39935f)return _0x39935f;zt('ai-chat-model-id-unrecognized',{'modelId':_0x1630bd,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x1ed4d5=await this['getAvailableModels']();if(!_0x1ed4d5['length'])return null;if(this['_defaultModelId']){const _0x47ab36=this['_getModelById'](_0x1ed4d5,this['_defaultModelId']);if(_0x47ab36)return _0x47ab36;zt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x1ed4d5[0x0]['id']});}return _0x1ed4d5[0x0];}async['isAvailable'](_0x3000f0){return(await this['getAvailableModels']())['some'](_0x46d17c=>_0x46d17c['name']===_0x3000f0['name']&&_0x46d17c['provider']===_0x3000f0['provider']);}['_filterModels'](_0x2bb7ca,_0x2e7bc0){let _0x5cb588;if(_0x2e7bc0){_0x5cb588=[];const _0x9b21bc='string'==typeof _0x2e7bc0?[_0x2e7bc0['toLocaleLowerCase']()]:_0x2e7bc0['map'](_0x20c854=>_0x20c854['toLocaleLowerCase']());for(const _0x842df5 of _0x9b21bc)for(const _0x4f140e of _0x2bb7ca)(_0x4f140e['id']['toLocaleLowerCase']()===_0x842df5||_0x4f140e['name']['toLocaleLowerCase']()===_0x842df5||Me(_0x4f140e)&&'auto'===_0x842df5||_0x4f140e['provider']['toLocaleLowerCase']()===_0x842df5||_0x4f140e['id']['toLocaleLowerCase']()['startsWith'](_0x842df5))&&_0x5cb588['push'](_0x4f140e);}else _0x5cb588=_0x2bb7ca;return _0x5cb588;}['_getModelById'](_0x49162f,_0x491675){return _0x49162f['find'](_0x1db21e=>Me(_0x1db21e)&&'auto'===_0x491675?_0x1db21e:_0x1db21e['id']===_0x491675)||null;}static['getLocalized'](_0x3b4dc1,_0x30f0bb){return _0x30f0bb['map'](_0x6614a1=>{if(Me(_0x6614a1))_0x6614a1['name']=u(_0x3b4dc1,'AI_MODEL_NAME_AUTO'),_0x6614a1['description']=u(_0x3b4dc1,'AI_MODEL_DESCRIPTION_AUTO');else u(_0x3b4dc1,'AI_MODEL_DESCRIPTION_'+_0x6614a1['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x6614a1['description']=u(_0x3b4dc1,'AI_MODEL_DESCRIPTION_'+_0x6614a1['id']['toUpperCase']()));return _0x6614a1;});}}function Me(_0xb04fac){return _0xb04fac['id']['startsWith']('agent');}class C extends ni{async['getAll'](){return(await super['getAll']())['sort']((_0xf51d88,_0x31cdb7)=>{const _0x5a4786=Object['values'](_0xf51d88['capabilities'])['filter'](_0xdb21a2=>_0xdb21a2['enabled'])['length'];return Object['values'](_0x31cdb7['capabilities'])['filter'](_0x8def22=>_0x8def22['enabled'])['length']-_0x5a4786;});}}function A({editor:_0x23d07d,interaction:_0x55987c,reply:_0x296773,groups:_0x54bdb0,transform:_0x41480b,documentCompare:_0x34e382,documentCompareOptions:_0x133468}){const _0x37e5fa=_0x55987c['getDocumentContext']();if(!_0x37e5fa)return[];const _0x323768=_0x37e5fa['content'],_0x5ef22e=_0x37e5fa['version'],_0x4a01cc=_0x296773['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x3a2434}of _0x54bdb0){const _0x516a1f=_0x3a2434['filter'](_0x578d01=>'new'!=_0x578d01['type'])['map'](_0x59c032=>x('data-id',_0x59c032['id'],_0x4a01cc)),_0x128597=_0x3a2434['filter'](_0x5eb115=>'removed'!=_0x5eb115['type'])['map'](_0x1a753a=>_0x1a753a['node']['cloneNode'](!0x0));let _0x4940da=null;if(_0x516a1f['length']){_0x4940da=_0x516a1f[0x0]['previousSibling'];for(let _0x5c1d6e=0x0;_0x5c1d6e<_0x516a1f['length'];_0x5c1d6e++)_0x456b22(_0x516a1f[_0x5c1d6e]);}if(_0x128597['length']){_0x4940da||(_0x3a2434[0x0]['anchorId']?_0x4940da=x('data-id',_0x3a2434[0x0]['anchorId'],_0x4a01cc):(_0x4940da=_0x128597['shift'](),_0x14f4a2(_0x4a01cc,_0x4940da)));for(let _0x4087db=0x0;_0x4087db<_0x128597['length'];_0x4087db++)_0x321f33(_0x4940da,_0x128597[_0x4087db]),_0x4940da=_0x128597[_0x4087db];}}const _0x2fb8db=O(_0x4a01cc),_0x35b37f=_0x34e382['getDiff'](_0x323768,_0x2fb8db,_0x133468)['getOperations']();if(_0x41480b){const _0x10d42c=_0x23d07d['model']['document']['history']['getOperations'](_0x5ef22e),_0x1fb22b={'document':_0x23d07d['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return mt(_0x35b37f,_0x10d42c,_0x1fb22b)['operationsA'];}return _0x35b37f;}function T(_0x524761,_0x234ade){if('marker'!=_0x234ade['type'])return;const _0x4f37b3=_0x524761['model']['markers']['get'](_0x234ade['name']);_0x4f37b3&&(_0x234ade['oldRange']=_0x4f37b3['getRange']());}class Vr extends _0x36a471{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x67ba57,_0x1673eb={},_0xbaf1cd){super(_0x67ba57),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x1673eb};const _0x3dfd61=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3dfd61?'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'](_0xbaf1cd),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 tt(this['locale']),this['likeButton']['set']({'icon':_0x53f9d0,'label':u(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5ce244=>!_0x5ce244),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new tt(this['locale']),this['dislikeButton']['set']({'icon':_0x17130d,'label':u(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x1be29f=>!_0x1be29f),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new tt(this['locale']),this['copyButton']['set']({'icon':_0x32e5dd,'label':u(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x38cb13=>!_0x38cb13);const _0x4d6c48=new _0x202d8c();_0x4d6c48['set']({'content':_0x24f2e2}),_0x4d6c48['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'](_0x4d6c48);}['_setupShowChangesButton'](_0x31cabd){this['showChangesButton']=new tt(this['locale']),this['showChangesButton']['set']({'icon':ct,'label':u(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x31cabd}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x26a6a5=>!_0x26a6a5),this['showChangesButton']['on']('execute',()=>{const _0x4b91dc=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x4b91dc,'icon':_0x4b91dc?_0x5d8356:ct}),this['fire']('toggleShowChanges',_0x4b91dc);});}}class Sr extends st{['showChangesToggleView'];constructor(_0x473229,_0x1aaa12){super(_0x473229),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new $r(_0x473229),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':u(_0x473229,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1aaa12['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x750199=>_0x750199?_0x55c8cb:_0x4bbc4b),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x3ed67d=new _0x202d8c();_0x3ed67d['content']=_0x2b8e0f,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1aaa12['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x3ed67d,{'tag':'span','children':[u(_0x473229,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class $r extends tt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ra{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x2221a8){this['options']={'delay':_0x2221a8['delay']??0x14,'textNodeStyle':_0x2221a8['textNodeStyle'],'onStreamUpdate':_0x2221a8['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x33825f,targetElement:_0x48c2a5,abortSignal:_0x15ebb5}){this['isStreaming']&&this['stop'](),_0x15ebb5?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x313448(_0x33825f,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(zt('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x475bd3=0x0;_0x475bd3<this['currentIndex'];_0x475bd3++)this['nodesList'][_0x475bd3]['shouldBeStreamed']=!0x0;let _0x4592c6=0x0;for(let _0xb7b0ae=this['currentIndex'];_0xb7b0ae<this['nodesList']['length'];_0xb7b0ae++){const _0x4c0b8f=Date['now'](),_0x5bb0ec=this['nodesList'][_0xb7b0ae],_0x26ed6a=_0x4c0b8f-_0x4592c6;_0x5bb0ec['shouldBeStreamed']=!0x0;let _0x41b8b1=_0x5bb0ec['parent'];for(;_0x41b8b1;)_0x41b8b1['shouldBeStreamed']=!0x0,_0x41b8b1=_0x41b8b1['parent'];if(_0x26ed6a<this['options']['delay'])try{const {promise:_0x1f5c60,abortController:_0x1ac12a}=pr(this['options']['delay']-_0x26ed6a);this['timeoutAbortController']=_0x1ac12a,await _0x1f5c60;}catch(_0x457e5e){return;}_0x193f2e(_0x48c2a5,'<'+_0x48c2a5['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x48c2a5['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0xb7b0ae,_0x4592c6=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x458da0}){Array['from'](_0x458da0['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x66db8e=>{_0x66db8e['replaceWith'](_0x66db8e['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x1b8fc4){let _0x21bb90='';if(function(_0x5128ae){return _0x45feba(_0x5128ae);}(_0x1b8fc4)){for(const _0x1a6058 of _0x1b8fc4['children'])_0x21bb90+=this['renderNode'](_0x1a6058);}else{if(dr(_0x1b8fc4)){if(!_0x1b8fc4['shouldBeStreamed'])return'';const _0x40681f=_0x1b8fc4,_0x400a13=Object['entries'](_0x40681f['attribs'])['map'](([_0x30c348,_0x3379ca])=>_0x30c348+'=\x22'+_0x3379ca+'\x22')['join']('\x20');_0x21bb90+='<'+_0x40681f['tagName']+(_0x400a13?'\x20'+_0x400a13:'')+'>';for(const _0x12bfba of _0x2976a8(_0x40681f))_0x21bb90+=this['renderNode'](_0x12bfba);_0x21bb90+='</'+_0x40681f['tagName']+'>';}else{if(!ar(_0x1b8fc4))return'';if(!_0x1b8fc4['shouldBeStreamed'])return'';!function(_0x496674){if(!_0x496674['parent']||!dr(_0x496674['parent']))return!0x1;if(!cr['includes'](_0x496674['parent']['tagName']))return!0x1;return!_0x55b460(_0x496674)['match'](/^\s*[<>]\s*$/);}(_0x1b8fc4)?_0x21bb90+=_0x1b38df(_0x1b8fc4):_0x21bb90+=_0x1b38df(new _0x6f6481('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x1b8fc4]));}}return _0x21bb90;}['getParsedDocumentNodeList'](){const _0x4b5bc8=[];return function(_0x38d577,_0x59c148){const _0x19f5bc=_0x15ac9a=>{if(_0x59c148(_0x15ac9a),_0x15ac9a instanceof _0x54b7fc)for(let _0x3f5926=0x0;_0x3f5926<_0x15ac9a['children']['length'];_0x3f5926++){const _0x2223de=_0x15ac9a['children'][_0x3f5926];_0x19f5bc(_0x2223de);}};for(let _0x5a4f47=0x0;_0x5a4f47<_0x38d577['children']['length'];_0x5a4f47++)_0x19f5bc(_0x38d577['children'][_0x5a4f47]);}(this['document'],_0x1f494f=>{if(ar(_0x1f494f)){const _0x1fd89a=this['splitTextNodeIntoWordNodes'](_0x1f494f);_0x1fd89a['length']&&_0x4b5bc8['push'](..._0x1fd89a);}_0x1f494f['isWordSplitSource']||_0x1f494f['isWordSplitResult']||_0x4b5bc8['push'](_0x1f494f);}),_0x4b5bc8;}['splitTextNodeIntoWordNodes'](_0x3d8dd9){if(_0x3d8dd9['isWordSplitSource']||_0x3d8dd9['isWordSplitResult'])return[];const _0x192160=_0x55b460(_0x3d8dd9)['match'](/(?:\s*\S+\s*)/g),_0x47cbde=[];if(_0x192160&&_0x192160['length']>0x1){for(const _0x4717b3 of _0x192160){const _0x1bd491=new _0xa884bf(_0x4717b3);_0x1bd491['isWordSplitResult']=!0x0,_0x54bde9(_0x3d8dd9,_0x1bd491),_0x47cbde['push'](_0x1bd491);}_0x3d8dd9['isWordSplitSource']=!0x0,_0x456b22(_0x3d8dd9);}return _0x47cbde;}}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(_0x1aec9e){return _0x500a12(_0x1aec9e);}function dr(_0x34774a){return _0x32f843(_0x34774a);}function pr(_0x48fc23){const _0x746bc5=new AbortController();return{'promise':new Promise((_0x3abd5c,_0x1dc889)=>{const _0x350dda=setTimeout(_0x3abd5c,_0x48fc23);_0x746bc5['signal']['addEventListener']('abort',()=>{clearTimeout(_0x350dda),_0x1dc889();});}),'abortController':_0x746bc5};}const Ce=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class oa extends st{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x12de5b,{part:_0x4bd560,uiIndex:_0x5d32e5,areActionsDisabled:_0x2acb0d,availableActions:_0x38c11c}){super(_0x12de5b),this['set']('partDefinition',_0x4bd560),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x222729=>'pending'==_0x222729&&!_0x2acb0d),this['children']=this['createCollection'](),this['htmlStreamer']=new ra({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x12de5b,{'part':_0x4bd560,'uiIndex':_0x5d32e5,'availableActions':_0x38c11c}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ce)['to'](this);const _0xa2ce97=this['bindTemplate'];this['contentView']=new st(),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',_0xa2ce97['to']('state',_0x488b0b=>'ck-ai-suggestion__body__content-part_'+_0x488b0b),_0xa2ce97['to']('isEnabled',_0x3d2c54=>_0x3d2c54?'ck-ai-suggestion__body__content-part_active':void 0x0),_0xa2ce97['if']('isVisible','ck-hidden',_0x217c21=>!_0x217c21)]},'children':this['children'],'on':{'mouseenter':_0xa2ce97['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x4bd560['index']});}),'mouseleave':_0xa2ce97['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x4bd560['index']});})}});}async['updateContent']({part:_0x17800e,renderingStrategy:_0x52ba64,showUnchangedParts:_0x1ce35b=!0x1,abortSignal:_0x43181d}){this['partDefinition']=_0x17800e,this['isVisible']=this['partDefinition']['hasChanges']||_0x1ce35b,this['isVisible']&&('streaming'===_0x52ba64?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x43181d}):this['contentView']['element']['innerHTML']=O(this['partDefinition']['content']));}['toggleHeader'](_0x344970){_0x344970?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends st{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x5501ef,{part:_0x315b5b,uiIndex:_0x57ac15,availableActions:_0x14f637}){super(_0x5501ef),this['set']('partDefinition',_0x315b5b),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x28cd73=new _0x202d8c();_0x28cd73['content']=_0x203677,_0x28cd73['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x912bb6=[];if(_0x14f637['includes']('showChangeInText')){const _0x57639d=new tt(_0x5501ef);_0x57639d['set']({'label':u(_0x5501ef,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4483a}),_0x57639d['bind']('isEnabled')['to'](this),_0x57639d['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x315b5b['index']});}),_0x912bb6['push'](_0x57639d);}if(_0x14f637['includes']('insertSuggestion')){const _0x8e44dd=new tt(_0x5501ef);_0x8e44dd['set']({'label':u(_0x5501ef,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x3d6660}),_0x8e44dd['bind']('isEnabled')['to'](this),_0x8e44dd['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x315b5b['index']});}),_0x912bb6['push'](_0x8e44dd);}const _0x59c5ae=new tt(_0x5501ef);_0x59c5ae['set']({'label':u(_0x5501ef,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x1589cd}),_0x59c5ae['bind']('isEnabled')['to'](this),_0x59c5ae['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x315b5b['index']});}),_0x912bb6['push'](_0x59c5ae),this['_toolbarView']=new _0x36a471(_0x5501ef),this['_toolbarView']['items']['addMany'](_0x912bb6),this['_iconStateAccepted']=new _0x202d8c(),this['_iconStateAccepted']['content']=_0x18f903,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':u(_0x5501ef,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x202d8c(),this['_iconStateRejected']['content']=_0x1ea5bd,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':u(_0x5501ef,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x202d8c(),this['_iconStateOutdated']['content']=_0x1ea5bd,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':u(_0x5501ef,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x52d8eb=new st(_0x5501ef);_0x52d8eb['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[u(_0x5501ef,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x57ac15['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x28cd73,_0x52d8eb,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',(_0x4d2bf1,_0x32e64a,_0x43ae5a,_0xe98606)=>{switch(_0xe98606){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(_0x43ae5a){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 G extends _0x3f6d88(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x299c11){const _0xc6da93=this['createTask'](_0x299c11);return this['queue']['push'](_0xc6da93),this['_processQueue'](),_0xc6da93['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(_0x532413=>{this['once']('_queueEmpty',()=>{_0x532413();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x5e63c8=this['queue']['shift']();try{await _0x5e63c8['callback'](this['_abortController']['signal']),_0x5e63c8['resolve']();}catch(_0xcc00d8){_0x5e63c8['reject'](_0xcc00d8);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0xae408b){let _0x1cacdd,_0x24fce2;const _0x34b250=new Promise((_0x3af590,_0xa14f72)=>{_0x1cacdd=_0x3af590,_0x24fce2=_0xa14f72;});return{'callback':_0xae408b,'resolve':_0x1cacdd,'reject':_0x24fce2,'completePromise':_0x34b250};}}class gr extends st{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x46f023){super();const _0x18d095=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ra({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x46f023,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x18d095['if']('isDone','ck-ai-chat__feed__item_done'),_0x18d095['if']('isVisible','ck-hidden',_0x51db56=>!_0x51db56),'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'](_0xb76d1a=>{_0xb76d1a['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x4d9008,_0x427cab,_0x2145e6){await this['htmlStreamer']['stream']({'document':_0x4d9008,'targetElement':_0x427cab,'abortSignal':_0x2145e6});}}class Se extends gr{constructor(_0x18033a){super(_0x18033a),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x18033a['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x3ac532){this['element']['innerHTML']=_0x3ac532;}}class vr extends st{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x4369a,_0x374efa){super(_0x4369a);const {areActionsDisabled:_0x40831a,showUnchangedParts:_0x1e7de0,availableActions:_0x45ed81}=_0x374efa;this['_areActionsDisabled']=_0x40831a,this['_showUnchangedParts']=_0x1e7de0,this['_availableActions']=_0x45ed81,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new G(),this['_emptyPartsWarningView']=new Se({'id':'empty-parts-warning','initialContent':u(_0x4369a,'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:_0x3d3a41,renderingStrategy:_0x2af441,abortSignal:_0x55e408}){this['_children']['length']?_0x3d3a41['forEach'](_0x2c8097=>{const _0x19f8ef=this['_cachedContentParts']['findIndex'](_0x321c12=>_0x321c12['index']==_0x2c8097['index']);-0x1===_0x19f8ef?this['_cachedContentParts']['push'](_0x2c8097):this['_cachedContentParts'][_0x19f8ef]=_0x2c8097;}):this['_cachedContentParts']=_0x3d3a41;for(const _0x4ca72d of _0x3d3a41['filter'](_0x3dc76f=>_0x3dc76f['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x705baf=>{let _0x14d4e1=this['getPartView'](_0x4ca72d['index']);_0x14d4e1||(_0x14d4e1=new oa(this['locale'],{'part':_0x4ca72d,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x14d4e1['delegate'](...Ce)['to'](this),this['_children']['add'](_0x14d4e1),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x14d4e1['toggleHeader'](this['_children']['length']>0x1),await _0x14d4e1['updateContent']({'part':_0x4ca72d,'renderingStrategy':_0x2af441,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x705baf});});return _0x55e408?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x1f0a01,_0x59438f){const _0x51716f=this['getPartView'](_0x1f0a01);_0x51716f&&(_0x51716f['state']=_0x59438f),this['hasPendingParts']='pending'==_0x59438f||Array['from'](this['_children'])['some'](_0x2bc0b1=>'pending'==_0x2bc0b1['state']);}['getPartView'](_0x44a4bd){return this['_children']['find'](_0x19f691=>_0x19f691['partDefinition']['index']==_0x44a4bd)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0xf30b7b=!this['_cachedContentParts']['find'](({hasChanges:_0x4de69f})=>_0x4de69f),_0x48aafd=!!this['_cachedContentParts']['find'](({hasChanges:_0x1a340d})=>!_0x1a340d);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x48aafd,_0xf30b7b?this['_emptyPartsWarningView']['setContent'](u(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](u(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x3690d0=>_0x3690d0['partDefinition']['hasChanges']);}}class be extends _0x1e0886{constructor(_0x394601=void 0x0){super();const _0x125bae=_0x394601?'ck-ai-spinner_'+_0x394601:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x125bae]}});}}class N extends st{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x4428da,_0x2490bd){super(_0x4428da);const {showDiff:_0x3891cd,areActionsDisabled:_0x1fcc33,miniToolbarConfig:_0x178c00,hideHeader:_0xb018f8,showLoader:_0x349e80,showUnchangedParts:_0x39d851,availableActions:_0x3f6ad8}=_0x2490bd;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x349e80),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0xb018f8||(this['headerView']=new Sr(_0x4428da,{'showDiff':_0x3891cd}),this['headerView']['on']('toggleShowChanges',(_0x2d7c1f,_0x58025f)=>{this['areChangesVisible']=_0x58025f['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x58025f['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new vr(_0x4428da,{'areActionsDisabled':_0x1fcc33,'showUnchangedParts':!!_0x39d851,'availableActions':_0x3f6ad8}),this['bodyView']['delegate'](...Ce)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Vr(_0x4428da,_0x178c00,_0x3891cd),this['miniToolbarView']['delegate'](...Ce)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x138d78,_0x3d15e3)=>{this['areChangesVisible']=_0x3d15e3,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x3d15e3});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new yr(this['locale']),this['children']['add'](this['sourcesView']),_0x349e80&&(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'](_0x2aadf9){await this['bodyView']['updateContentParts'](_0x2aadf9);}['updateSources'](_0x2180e3){this['sourcesView']['children']['addMany'](_0x2180e3['map'](_0x36da26=>new Cr(this['locale'],_0x36da26))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x4e41f0){if(this['errorView']){const _0x48ea15=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x48ea15&&(_0x48ea15['textContent']=_0x4e41f0),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'](_0x524c68){this['miniToolbarView']['items']['add'](_0x524c68);}['removeNavigationItem'](_0x33fe16){this['miniToolbarView']['items']['remove'](_0x33fe16);}['_createLoaderView'](){const _0x4c58bf=new st(this['locale']),_0x33782b=new be('small');_0x33782b['isVisible']=!0x0;const _0xe44e6d=new st(this['locale']);return _0xe44e6d['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[u(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x4c58bf['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x379434=>!_0x379434)]},'children':[_0x33782b,_0xe44e6d]}),_0x4c58bf;}['_createErrorView'](){const _0x83990d=new st(this['locale']),_0x401846=new st(this['locale']);return _0x401846['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[u(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x83990d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0xa2f662=>!_0xa2f662)]},'children':[_0x401846]}),_0x83990d;}}class yr extends st{['children'];constructor(_0x40d47d){super(_0x40d47d),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',_0x2ae1a9=>!_0x2ae1a9)]},'children':this['children']});const _0x2ddb25=new st(this['locale']),_0x588f50=new _0x202d8c();_0x588f50['content']=_0x2ab575,_0x2ddb25['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x588f50,{'tag':'span','children':[{'text':u(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x2ddb25);}}class Cr extends tt{constructor(_0x1cbb25,_0xe08d0b){super(_0x1cbb25),this['set']({'label':_0xe08d0b['title'],'tooltip':_0xe08d0b['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x2a4077=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x2a4077['to'](()=>{window['open'](_0xe08d0b['url'],'_blank');})}}),_0xe08d0b['favicon']){const _0x2acb44=new st(_0x1cbb25);_0x2acb44['setTemplate']({'tag':'img','attributes':{'src':_0xe08d0b['favicon']||_0x2ab575,'alt':_0xe08d0b['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x2acb44);}else this['set']('icon',_0x2ab575);}}class _s extends _0x36a471{constructor(_0x5b7cf3,_0xbd5210=!0x0,_0x3bb1aa=!0x0){super(_0x5b7cf3),this['set']('isLoading',!0x1),_0xbd5210&&(this['applyButton']=this['_createButton'](u(_0x5b7cf3,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x34d972=>!_0x34d972),this['items']['add'](this['applyButton'])),_0x3bb1aa&&(this['suggestButton']=this['_createButton'](u(_0x5b7cf3,'AI_BALLOON_SUGGEST_BUTTON'),_0xbd5210?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x599200=>!_0x599200),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x2f6529,_0x41c73c){const _0x591506=new tt(this['locale']);return _0x591506['set']({'label':_0x2f6529,'class':_0x41c73c||'','isVisible':!0x0,'withText':!0x0}),_0x591506;}}class ps extends st{constructor(_0x3b9678){super(_0x3b9678),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':u(_0x3b9678,'AI_DISCLAIMER_TEXT')}]}]});}}const k=['applySuggestion','insertSuggestion','showNext','showPrevious'];class B extends st{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];constructor(_0x21cd1d,_0x1c7d3c,_0x16c0f7,_0x5d86ef){super(_0x21cd1d),this['_availableActions']=_0x16c0f7,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x5d86ef),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new _0x156d7c(),this['keystrokes']=new _0x2ec108(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x3ac126({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new it(),this['_addContentView'](_0x1c7d3c['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x1c7d3c['showApplyButton'],_0x1c7d3c['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'](_0x1c7d3c['showApplyButton'],_0x1c7d3c['showSuggestButton']);});}['render'](){super['render']();for(const _0x1022fc of this['_focusables'])this['focusTracker']['add'](_0x1022fc['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x24b3a8){-0x1===_0x24b3a8?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x5021c0){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x5021c0,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x3f3d17){this['showError'](_0x3f3d17);}['showBlockingError'](_0x48ec6a){this['showError'](_0x48ec6a),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x48ad99){const _0x51c827=this['_createNextButtonView'](),_0x5aba75=this['_createPreviousButtonView']();_0x48ad99['view']['headerView']['children']['add'](_0x51c827,0x2),_0x48ad99['view']['headerView']['children']['add'](_0x5aba75,0x0),this['_focusables']['addMany']([_0x51c827,_0x5aba75]),this['focusTracker']['add'](_0x51c827['element']),this['focusTracker']['add'](_0x5aba75['element']);}['_addContentView'](_0x16e916){this['_mainView']=_0x16e916,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x371c19){const _0x266365=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x371c19,this['_dialogContent']['add'](this['_mainView'],_0x266365),this['hideError']();}['_addDisclaimerView'](){this['disclaimerView']=new ps(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x98965f=!0x0,_0x141dfc=!0x0){_0x98965f=_0x98965f&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x141dfc=_0x141dfc&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new _s(this['locale'],_0x98965f,_0x141dfc),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x4c9cd4=new tt(this['locale']);return _0x4c9cd4['set']({'icon':at,'tooltip':u(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x4c9cd4['on']('execute',()=>{this['fire']('showNext');}),_0x4c9cd4;}['_createPreviousButtonView'](){const _0x344d15=new tt(this['locale']);return _0x344d15['set']({'icon':ht,'tooltip':u(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x344d15['on']('execute',()=>{this['fire']('showPrevious');}),_0x344d15;}['_createErrorView'](){const _0x5f42bb=new st(this['locale']),_0x44bc15=new st(this['locale']);return _0x44bc15['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x5f42bb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x57881d=>!_0x57881d)]},'children':[_0x44bc15]}),_0x5f42bb;}}const z=0xa;class U extends _0x47d85c{static get['requires'](){return[l,a];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x372e37){const _0x4c5c4d=_(this['context']);if(this['_config']=_0x372e37,this['isOpen'])return void this['_updateBalloon'](_0x372e37);const _0xc5b1be=this['context']['config']['get']('ai.availableReplyActions')||[...f],_0x32f623=_0x4c5c4d?.['commands']['get']('trackChanges'),_0x24b2bc=_0x32f623?.['value'];this['balloonView']=new B(_0x4c5c4d['locale'],_0x372e37,_0xc5b1be,!!_0x24b2bc),this['balloonView']['delegate'](...k)['to'](this),_0x32f623&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x32f623,'value'),this['_showDialog'](_0x372e37);}['close'](){_(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateBalloon'](_0xd10491){const _0x272723=_(this['context']),_0x34a4e2=_0x272723['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x272723['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x34a4e2['view']?.['headerView']&&(_0x34a4e2['view']['headerView']['label']=_0xd10491['title'],_0x34a4e2['view']['headerView']['iconView']&&_0xd10491['icon']&&(_0x34a4e2['view']['headerView']['iconView']['content']=_0xd10491['icon'])),this['balloonView']['updateContent'](_0xd10491['mainView']),this['_setupVisualSelection'](_0xd10491['ranges'],_0xd10491['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x34a4e2['view']&&_0x34a4e2['view']['updatePosition']();},_0x272723['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x32584a,_0x5ec148){this['context']['plugins']['get'](a)['showFakeVisualSelection'](_0x32584a,'ai-balloon-'+_0x5ec148,!0x0,!0x0);}['_showDialog'](_0x5648b4){const _0x107c9b=_(this['context']);this['_setupVisualSelection'](_0x5648b4['ranges'],_0x5648b4['index']);const _0x51e612=this['_getSelectionElements']();_0x51e612&&_0x51e612[0x0]&&_0x24e163({'target':_0x51e612[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x107c9b['plugins']['get']('Dialog')['show']({'title':_0x5648b4['title'],'icon':_0x5648b4['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x5648b4['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x130510=>{_0x5648b4['showRotator']&&this['balloonView']['setupRotator'](_0x130510),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'](_0x2746e0,_0x5554ed){if(!_0x5554ed)return null;const _0x211ce5=this['_getSelectionElements']();if(!_0x211ce5||0x0===_0x211ce5['length'])return{'left':Math['round'](_0x5554ed['left']+_0x5554ed['width']/0x2-_0x2746e0['width']/0x2),'top':Math['round'](_0x5554ed['top']+_0x5554ed['height']/0x2-_0x2746e0['height']/0x2)};const _0x1a83cf=Math['round'](_0x5554ed['left']+_0x5554ed['width']/0x2-_0x2746e0['width']/0x2),_0x4317fd=new _0x401654(_0x211ce5[0x0]),_0x14cc5c=new _0x401654(_0x211ce5[_0x211ce5['length']-0x1]),_0x2c6e3a=_0x2746e0['height'],_0xdc7161=this['_config']['showRotator']?0x8:0x0;return{'left':_0x1a83cf,'top':this['_calculateOptimalTopPosition'](_0x4317fd,_0x14cc5c,_0x2c6e3a,_0xdc7161,_0x5554ed)};}['_calculateOptimalTopPosition'](_0x3294ab,_0x5b2ecb,_0x5eae40,_0x588226=0x0,_0xdee8b2){const _0x2dd5f8=_0x5eae40+_0x588226,_0x5e96e4=new _0x401654(_0x2909f5['window']),_0x34da21=[_0x3294ab['getVisible'](),_0x5b2ecb['getVisible']()]['filter'](_0x5338ca=>_0x5338ca),_0x508397=_0x401654['getBoundingRect'](_0x34da21);if(!_0x508397)return Math['round'](_0xdee8b2['top']+_0xdee8b2['height']/0x2);const _0x38ff49=_0x5e96e4['getIntersection'](_0x508397);if(!_0x38ff49)return Math['round'](_0xdee8b2['top']+_0xdee8b2['height']/0x2);const _0x3b76bc=_0xdee8b2['getVisible'](),_0x289781=_0x3b76bc&&_0x508397['height']>_0x3b76bc['height'],_0x44bf48=_0x38ff49['top'],_0x242a83=_0x38ff49['bottom'];if(_0x289781){const _0x5a79c2=(_0x3b76bc||_0x5e96e4)['height']/0x2-_0x2dd5f8/0x2,_0x4ee8a5=_0x44bf48-z-_0xdee8b2['top'],_0x514539=_0xdee8b2['bottom']-_0x242a83-z;return _0x4ee8a5>=_0x2dd5f8?Math['max'](z,_0x44bf48-_0x2dd5f8-z):_0x514539>=_0x2dd5f8?_0x242a83+z:Math['max'](z,_0x5a79c2);}const _0x5cb893=_0x44bf48-_0x2dd5f8,_0x186610=_0xdee8b2['bottom']-_0x242a83-z,_0xa7e65e=_0x44bf48-z-_0xdee8b2['top'];let _0x1d0639;if(_0x186610>=_0x2dd5f8)_0x1d0639=_0x242a83+z;else{if(_0xa7e65e>=_0x2dd5f8)_0x1d0639=_0x5cb893-z;else _0x1d0639=_0x44bf48+_0x508397['height']/0x2-_0x2dd5f8/0x2;}return _0x1d0639;}['_setupMarkerRemovalListener'](){const _0x194434=_(this['context']);this['listenTo'](_0x194434['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x396db0,data:{newRange:_0x4cdcd1}}of _0x194434['model']['document']['differ']['getChangedMarkers']())if(_0x396db0['startsWith']('ai-selection:')&&(_0x4cdcd1&&(_0x4cdcd1['start']['isEqual'](_0x4cdcd1['end'])||'$graveyard'==_0x4cdcd1['root']['rootName'])||null==_0x4cdcd1)){const _0x5617d5=u(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x5617d5),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x372c0e=_(this['context']);this['stopListening'](_0x372c0e['model']['document']);}['_getSelectionElements'](){const _0x591d15=_(this['context']);return _0x25fa50(_0x591d15['editing'],[..._0x591d15['model']['markers']['getMarkersGroup']('ai-selection'),..._0x591d15['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class i extends _0x47d85c{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[l,U,_0xfc3cc0];}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 C({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x54f43e=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x185a69,_0xf76295)=>{this['_handleUIUserMessage']({'userMessage':_0xf76295});}),this['listenTo'](_0x54f43e,'resizedTabs',(_0x59a9ee,_0x4491b1)=>{this['_setIsMaximized'](_0x4491b1);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x54f43e['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](u(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x3db616,_0x31a5ef)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x31a5ef));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x2b2fef,_0x1dcbd2)=>{this['activeConversation']?.['addUrlToContext'](_0x1dcbd2);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x2663f0,_0x252b84)=>{this['activeConversation']?.['addResourceToContext'](_0x252b84['source'],_0x252b84['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x1c69c3,_0x5eefe6)=>{this['_removeFromContext'](_0x5eefe6);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x4d7932,_0x32825a)=>{this['activeConversation']?.['loadSourceResources'](_0x32825a['sourceId'],_0x32825a['query'],_0x32825a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0xf71ae9,_0x5b4c88)=>{this['activeConversation']?.['setModel'](_0x5b4c88);}),this['listenTo'](this['_aiChatUi'],'like',(_0x2937f3,{replyId:_0x18fe3c})=>{console['log']('Liked\x20response',_0x18fe3c);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x3bcf55,{replyId:_0x2d68cd})=>{console['log']('Disliked\x20response',_0x2d68cd);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x37433f,_0x569b34)=>{this['context']['plugins']['get'](U)['close'](),this['_insertSuggestion'](_0x569b34);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x2de24a,{replyId:_0x2fd7f3,partIndex:_0x1b5caa})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x2fd7f3,_0x1b5caa);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x21b98c,{replyId:_0x284b06,partIndex:_0x5b7d86})=>{const _0x125f7c=this['_getDocumentRangeForReplyChanges'](_0x284b06,_0x5b7d86);_0x125f7c&&'$graveyard'!=_0x125f7c['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x125f7c['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x4a8ef7,_0x2f51b4)=>{this['context']['plugins']['get'](U)['close'](),this['_applySuggestion'](_0x2f51b4);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x34d0e1,{replyId:_0x369483,showDiff:_0x6fc29b})=>{const {reply:_0x84a413}=this['getInteractionAndReplyById'](_0x369483),_0x257a3d=_0x84a413['getContentParts']({'showDiff':_0x6fc29b});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x84a413['id'],'parts':_0x257a3d,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x495e88,{replyId:_0x1b232e,partIndex:_0x20223b})=>{this['_previewedChangeGroup']?.['replyId']==_0x1b232e&&this['_previewedChangeGroup']?.['partIndex']==_0x20223b&&this['context']['plugins']['get'](U)['close']();const {reply:_0x1aea3d}=this['getInteractionAndReplyById'](_0x1b232e);_0x1aea3d['setChangeGroupState'](_0x20223b,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof _0x507c90?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x26a2a9,_0x299b52)=>{_0x299b52['on']('ready',()=>{this['_integrateEditor'](_0x299b52);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x4a1abf){const _0xd79b0a=_(this['context']);if(!_0xd79b0a['plugins']['has']('TrackChanges'))throw new _0x51167b('ai-no-track-changes',null);const _0x7f6778=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x21a1a7,interaction:_0x4c8250}=this['getInteractionAndReplyById'](_0x4a1abf['replyId']),_0x2fcfd4=this['_getDocumentRangeForReplyChanges'](_0x4a1abf['replyId'],_0x4a1abf['partIndex']),_0x549da5=void 0x0!==_0x4a1abf['partIndex']?[_0x21a1a7['changeGroups'][_0x4a1abf['partIndex']]]:_0x21a1a7['changeGroups']['filter'](_0x176e9c=>'pending'==_0x176e9c['state']),_0x2f06db=_0x549da5['map'](_0x7df642=>_0x21a1a7['changeGroups']['indexOf'](_0x7df642));if(!_0x2fcfd4||'$graveyard'==_0x2fcfd4['range']['root']['rootName'])return void _0x2f06db['forEach'](_0xaf2ea6=>_0x21a1a7['setChangeGroupState'](_0xaf2ea6,'outdated'));_0x2f06db['forEach'](_0x5a832d=>_0x21a1a7['setChangeGroupState'](_0x5a832d,'accepted'));const _0x19fa12=A({'editor':_0xd79b0a,'reply':_0x21a1a7,'interaction':_0x4c8250,'groups':_0x549da5,'transform':!0x0,'documentCompare':_0x7f6778,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x1ce349;_0x2fcfd4&&this['_scrollToSuggestionRange'](_0x2fcfd4['range']),_0xd79b0a['model']['change'](_0x53ff79=>{_0x1ce349=_0x53ff79['batch'],_0xd79b0a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x19fa12),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x1ce349,{'interactionId':_0x4c8250['id'],'replyId':_0x21a1a7['id'],'indexes':_0x2f06db['slice']()}),this['_updateRatings'](_0x21a1a7);}['_applySuggestion'](_0xac4e61){const _0x3167cc=_(this['context']),_0x5919ba=this['context']['plugins']['get'](_0xfc3cc0),{reply:_0x308e52,interaction:_0x51b18c}=this['getInteractionAndReplyById'](_0xac4e61['replyId']),_0x7f3132=this['_getDocumentRangeForReplyChanges'](_0xac4e61['replyId'],_0xac4e61['partIndex']),_0x17cb1a=void 0x0!==_0xac4e61['partIndex']?[_0x308e52['changeGroups'][_0xac4e61['partIndex']]]:_0x308e52['changeGroups']['filter'](_0x30f859=>'pending'==_0x30f859['state']),_0x574a4b=_0x17cb1a['map'](_0x398895=>_0x308e52['changeGroups']['indexOf'](_0x398895));if(!_0x7f3132||'$graveyard'==_0x7f3132['range']['root']['rootName'])return void _0x574a4b['forEach'](_0x3dfae7=>_0x308e52['setChangeGroupState'](_0x3dfae7,'outdated'));_0x574a4b['forEach'](_0x5281b5=>_0x308e52['setChangeGroupState'](_0x5281b5,'accepted'));const _0x1c4332=A({'editor':_0x3167cc,'reply':_0x308e52,'interaction':_0x51b18c,'groups':_0x17cb1a,'transform':!0x0,'documentCompare':_0x5919ba,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x24d676;_0x7f3132&&this['_scrollToSuggestionRange'](_0x7f3132['range']),_0x3167cc['model']['change'](_0x20932a=>{_0x24d676=_0x20932a['batch'];for(const _0x37024f of _0x1c4332)_0x37024f['baseVersion']=_0x3167cc['model']['document']['version'],T(_0x3167cc,_0x37024f),_0x20932a['batch']['addOperation'](_0x37024f),_0x3167cc['model']['applyOperation'](_0x37024f);}),this['_batchToChanges']['set'](_0x24d676,{'interactionId':_0x51b18c['id'],'replyId':_0x308e52['id'],'indexes':_0x574a4b['slice']()}),this['_updateRatings'](_0x308e52);}['_openBalloonFor'](_0x2af200,_0x48be6d){const _0x5f0e57=_(this['context']),_0x5954a5=this['_getDocumentRangeForReplyChanges'](_0x2af200,_0x48be6d),_0x41f791=this['context']['plugins']['get'](U);if(!_0x5954a5)return void _0x41f791['close']();const {range:_0x293e48,currentIndex:_0x58c606}=_0x5954a5;if('$graveyard'==_0x293e48['root']['rootName']){const {reply:_0x5ebd5f}=this['getInteractionAndReplyById'](_0x2af200);return _0x5ebd5f['setChangeGroupState'](_0x58c606,'outdated'),void _0x41f791['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x2af200&&this['_previewedChangeGroup']?.['partIndex']==_0x58c606)return;this['stopListening'](_0x41f791),this['_previewedChangeGroup']={'replyId':_0x2af200,'partIndex':_0x58c606};let _0x247843=_0x5f0e57['config']['get']('ai.availableReplyActions')||[...f];_0x5f0e57['plugins']['has']('TrackChanges')||(_0x247843=_0x247843['filter'](_0x20c16a=>'insertSuggestion'!=_0x20c16a));const _0x2d4c41=new N(_0x5f0e57['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x247843});this['stopListening'](_0x2d4c41);const {reply:_0x2fda1a}=this['getInteractionAndReplyById'](_0x2af200),_0x390c6a=_0x2fda1a['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x137fae=>_0x137fae['hasChanges']),_0x3218d7=_0x390c6a['findIndex'](_0x36591f=>_0x36591f['index']==_0x58c606);if(-0x1==_0x3218d7)return;const _0x158510=_0x390c6a[_0x3218d7],_0x5a95dc=_0x390c6a['at']((_0x3218d7-0x1)%_0x390c6a['length'])?.['index'],_0x35a39d=_0x390c6a['at']((_0x3218d7+0x1)%_0x390c6a['length'])?.['index'];_0x2d4c41['updateContent']({'parts':[_0x158510],'renderingStrategy':'static'});const _0x325949=_0x58c606!==_0x5a95dc;this['_scrollToSuggestionRange'](_0x293e48,!0x0),_0x41f791['open']({'index':_0x58c606,'title':u(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x3218d7+0x1)['toString']()),'icon':_0x43d7e5,'mainView':_0x2d4c41,'showRotator':_0x325949,'showApplyButton':!0x0,'showSuggestButton':_0x5f0e57['plugins']['has']('TrackChanges'),'ranges':[_0x293e48]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x2af200,_0x58c606),this['listenTo'](_0x2d4c41,'toggleSuggestionDisplayMode',(_0x6ec299,{showDiff:_0xa5c7b8})=>{this['_balloonShowDiff']=_0xa5c7b8;const {reply:_0x1f253f}=this['getInteractionAndReplyById'](_0x2af200),_0xcfbe0b=_0x1f253f['getContentParts']({'showDiff':_0xa5c7b8,'groupIndex':_0x58c606});_0x2d4c41['updateContent']({'parts':_0xcfbe0b,'renderingStrategy':'static'});}),this['listenTo'](_0x41f791,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x2af200,'partIndex':_0x58c606}),_0x325949?this['_openBalloonFor'](_0x2af200,_0x35a39d):_0x41f791['close']();}),this['listenTo'](_0x41f791,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x2af200,'partIndex':_0x58c606}),_0x325949?this['_openBalloonFor'](_0x2af200,_0x35a39d):_0x41f791['close']();}),_0x325949&&(this['listenTo'](_0x41f791,'showNext',()=>{this['_openBalloonFor'](_0x2af200,_0x35a39d);}),this['listenTo'](_0x41f791,'showPrevious',()=>{this['_openBalloonFor'](_0x2af200,_0x5a95dc);})),this['listenTo'](_0x41f791,'dialogClosed',()=>{this['stopListening'](_0x41f791),this['stopListening'](_0x2d4c41),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x502145,_0x1512aa){const _0x16fa5d=_(this['context']),{reply:_0x57ec77,interaction:_0x580f54}=this['getInteractionAndReplyById'](_0x502145),_0x26ad08=_0x57ec77['changeGroups']['filter'](_0x55f634=>'pending'==_0x55f634['state']),_0x23a581=_0x26ad08['map'](_0x26192f=>_0x57ec77['changeGroups']['indexOf'](_0x26192f));void 0x0===_0x1512aa&&(_0x1512aa=_0x23a581[0x0]);const _0x5d5b33=_0x23a581['indexOf'](_0x1512aa);if(-0x1==_0x5d5b33)return null;const _0x55883d=_0x26ad08[_0x5d5b33],_0x33780c=new _0x46f624([]),_0x3a056d=new _0x46f624([]);for(const _0x313b78 of _0x55883d['changes'])if('removed'!=_0x313b78['type']&&_0x3a056d['children']['push'](_0x313b78['node']['cloneNode'](!0x0)),'new'!=_0x313b78['type']){const _0x161964=_0x21c931(_0xcae7da=>D(_0xcae7da,'data-id')==_0x313b78['id'],_0x57ec77['documentContextContent'],!0x0);_0x33780c['children']['push'](_0x161964['cloneNode'](!0x0));}if(0x0==_0x33780c['children']['length']){if(_0x55883d['changes'][0x0]['anchorId']){const _0x111d32=x('data-id',_0x55883d['changes'][0x0]['anchorId'],_0x57ec77['documentContextContent']);_0x33780c['children']['unshift'](_0x111d32['cloneNode'](!0x0)),_0x3a056d['children']['unshift'](_0x111d32['cloneNode'](!0x0)),_0x111d32['nextSibling']&&(_0x33780c['children']['push'](_0x111d32['nextSibling']['cloneNode'](!0x0)),_0x3a056d['children']['push'](_0x111d32['nextSibling']['cloneNode'](!0x0)));}else{const _0x734510=_0x57ec77['documentContextContent']['children'][0x0];if(!_0x734510)return null;_0x33780c['children']['push'](_0x734510['cloneNode'](!0x0)),_0x3a056d['children']['push'](_0x734510['cloneNode'](!0x0));}}const _0x145414=_0x580f54['getDocumentContext'](),_0x4cd15b=_0x16fa5d['data']['parse'](_0x145414['content']),_0xfa2ad4=O(_0x33780c),_0x3b1156=_0x16fa5d['data']['parse'](_0xfa2ad4),_0x22e8d4=_0x16fa5d['data']['parse'](_0xfa2ad4),_0x194c99=_0x16fa5d['model']['createPositionAt'](_0x3b1156,0x0),_0x3cefa2=O(_0x3a056d),_0x3cafab={'anchor':_0x194c99,'markDeletions':!0x1},_0x3207cd=_0x16fa5d['plugins']['get'](_0xfc3cc0)['getDiff'](_0xfa2ad4,_0x3cefa2,_0x3cafab)['getOperations']();if(!_0x3207cd['length'])return null;_0x16fa5d['model']['change'](_0x4dd7e7=>{for(const _0x41fc8f of _0x3207cd)if('remove'==_0x41fc8f['type']){const _0x104180=_0x41fc8f['sourcePosition'],_0x526d5f=_0x41fc8f['howMany'],_0x21b940=new _0x33fea2(_0x104180,_0x526d5f);_0x4dd7e7['batch']['addOperation'](_0x21b940),_0x16fa5d['model']['applyOperation'](_0x21b940);}else'marker'!==_0x41fc8f['type']&&(_0x41fc8f['baseVersion']=null,_0x41fc8f['isDocumentOperation']=!0x1,_0x4dd7e7['batch']['addOperation'](_0x41fc8f),_0x16fa5d['model']['applyOperation'](_0x41fc8f));});const _0x4d2b69=w(_0x16fa5d,_0x3207cd,_0x3b1156);v(_0x16fa5d['model'],_0x4d2b69);const _0x56c3eb=_0x4d2b69['getFirstRange']()['start']['path']['slice'](),_0x4cf556=_0x4d2b69['getFirstRange']()['end']['path']['slice'](),_0x4fff5d=[];let _0x1b9c78=_0x3b1156,_0x5322d3=_0x22e8d4;for(let _0x35d85b=0x0;_0x35d85b<_0x4cf556['length'];_0x35d85b++){const _0x33d2df=_0x1b9c78['maxOffset']-_0x4cf556[_0x35d85b];_0x4fff5d[_0x35d85b]=_0x5322d3['maxOffset']-_0x33d2df,_0x1b9c78=_0x1b9c78['getChildAtOffset'](_0x4cf556[_0x35d85b]),_0x5322d3=_0x5322d3['getChildAtOffset'](_0x4fff5d[_0x35d85b]);}const _0x21ce6f=_0x16fa5d['model']['createRange'](_0x16fa5d['model']['createPositionFromPath'](_0x22e8d4,_0x56c3eb),_0x16fa5d['model']['createPositionFromPath'](_0x22e8d4,_0x4fff5d)),_0x288042=_0x22e8d4['getChild'](0x0)['getAttribute'](_0x353bfc),_0x488303=Array['from'](_0x4cd15b['getChildren']())['find'](_0xb329e9=>_0xb329e9['getAttribute'](_0x353bfc)==_0x288042)['getPath'](),_0x241c6d=_0x21ce6f['start']['path']['slice'](),_0x2cb946=_0x21ce6f['end']['path']['slice']();_0x241c6d[0x0]=_0x488303[0x0]+_0x241c6d[0x0],_0x2cb946[0x0]=_0x488303[0x0]+_0x2cb946[0x0];let _0x37b14d=_0x16fa5d['model']['createRange'](_0x16fa5d['model']['createPositionFromPath'](_0x16fa5d['model']['document']['getRoot'](),_0x241c6d),_0x16fa5d['model']['createPositionFromPath'](_0x16fa5d['model']['document']['getRoot'](),_0x2cb946));const _0x387011=_0x16fa5d['model']['document']['history']['getOperations'](_0x145414['version']);for(const _0x4e86d6 of _0x387011)_0x37b14d=_0x46f2b7['_createFromRanges'](_0x37b14d['getTransformedByOperation'](_0x4e86d6));return{'range':_0x37b14d,'currentIndex':_0x1512aa};}['_integrateEditor'](_0x1e7430){if(!_0x1e7430['plugins']['has']('Undo'))return;const _0x33d415=_0x1e7430['commands']['get']('undo'),_0x540ce8=_0x1e7430['commands']['get']('redo');this['listenTo'](_0x33d415,'revert',(_0x15bef7,_0x650b99,_0x4faa4d)=>{const _0x12e317=this['_batchToChanges']['get'](_0x650b99);if(!_0x12e317)return;const _0xa2211e=this['activeConversation']['getInteraction'](_0x12e317['interactionId'])['getReply'](_0x12e317['replyId']);_0x12e317['indexes']['forEach'](_0x3a74d1=>_0xa2211e['setChangeGroupState'](_0x3a74d1,'pending')),this['_batchToChanges']['delete'](_0x650b99),this['_batchToChanges']['set'](_0x4faa4d,_0x12e317);}),this['listenTo'](_0x540ce8,'revert',(_0x1ad653,_0x37008b,_0x19a798)=>{const _0x49fcd1=this['_batchToChanges']['get'](_0x37008b);if(!_0x49fcd1)return;const _0x3ff284=this['activeConversation']['getInteraction'](_0x49fcd1['interactionId'])['getReply'](_0x49fcd1['replyId']);_0x49fcd1['indexes']['forEach'](_0x313e3e=>_0x3ff284['setChangeGroupState'](_0x313e3e,'accepted')),this['_batchToChanges']['delete'](_0x37008b),this['_batchToChanges']['set'](_0x19a798,_0x49fcd1);});}async['loadConversation'](_0x375ab2){this['context']['plugins']['get'](U)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x3eca87=this['context']['plugins']['get'](g);this['updateConversationTitle']('\x20'),_0x3eca87['view']['activateTab']('chat'),await this['_startConversationSafely'](_0x375ab2);const {sessionId:_0x4a4d5a}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x375ab2,_0x4a4d5a),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](u(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x3bd45a){console['error']('Failed\x20to\x20load\x20conversation',_0x3bd45a);}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x1abd4c){this['activeConversation']['id']===_0x1abd4c&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x1ff33c=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x1ff33c),this['activeConversation']?.['addCurrentDocumentToContext'](u(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x3b387e,quickActionData:_0x54c33d}){await this['_handleUIUserMessage']({'userMessage':_0x3b387e,'quickActionData':_0x54c33d});}['getGroupId'](){const _0x592bd7=this['context']['config']['get']('collaboration.channelId');if(!_0x592bd7)throw new _0x51167b('ai-chat-missing-channel-id',this);return _0x592bd7;}async['_startConversationSafely'](_0x4a00fa){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x4a00fa);}catch(_0x52397b){_0x36ffad('ai-chat-conversation-start-failed',_0x52397b),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x5210f7){const _0x26d34a=this['context']['plugins']['get'](U);let _0x398c20;_0x26d34a['isOpen']&&_0x26d34a['close'](),_0x5210f7||!this['activeConversation']?_0x398c20=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x398c20=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x249192=this['getGroupId'](),_0x3c3af7=_0x5210f7||_0x4c8592();this['activeConversation']=new p({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x398c20,'conversationId':_0x3c3af7,'group':_0x249192,'getEditor':()=>_(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x4ec26a,_0x263da5)=>{this['_aiChatUi']['createConversation'](_0x263da5),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x5210f7||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](u(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x64483e,_0xac56ac)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xac56ac['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x5846bb,_0x927d02)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x927d02);}),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',(_0x3a0c15,_0x3dab77)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3dab77,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x37c5f3,_0x2a7f3a)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2a7f3a,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x443bca,_0x5c75de)=>{this['_aiChatUi']['removeFeedInteraction'](_0x5c75de['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x2d4e73,_0x47bcc0,_0x38667a)=>{this['updateConversationTitle'](_0x47bcc0,_0x38667a);}),this['activeConversation']['on']('replyCreated',(_0x19255d,_0x140c7e)=>{'text-delta'===_0x140c7e['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x140c7e):this['_aiChatUi']['addFeedItemAISuggestion'](_0x140c7e);}),this['activeConversation']['on']('replyContentUpdated',async(_0x16f273,_0x2deb96)=>{await this['_updateReplyContent']({'reply':_0x2deb96});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x9a6f08,{reply:_0x31f744,index:_0x437618,state:_0xee7edb})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x31f744['id'],'index':_0x437618,'state':_0xee7edb});}),this['activeConversation']['on']('contextItemAdded',(_0x9c7ce5,_0x143e4f)=>{if(this['_aiChatUi']['addContextItem'](_0x143e4f['contextItem'],_0x143e4f['isLoading']),'selection'===_0x143e4f['contextItem']['type']){const _0x2d875c=[..._(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x2d875c,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x5f57ff,_0x1bbe69)=>{this['_aiChatUi']['removeContextItem'](_0x1bbe69['uiId']),'current-document'==_0x1bbe69['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x1bbe69['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x5a4e37,_0x36d9c0)=>{this['_aiChatUi']['setContextItemLoading'](_0x36d9c0['contextItem']['uiId'],_0x36d9c0['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x2380a7,_0x3b56fe)=>{this['_aiChatUi']['setConversationContext'](_0x3b56fe['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x599a84,_0x49b64e)=>{this['_aiChatUi']['setAddContextOptions'](_0x49b64e['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x1b7565,_0xbd2287)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0xbd2287['sourceId'],_0xbd2287['source'],_0xbd2287['resources'],_0xbd2287['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x401a79,_0x1662ed)=>{this['_aiChatUi']['updateResourceState'](_0x1662ed['sourceId'],_0x1662ed['resourceId'],_0x1662ed['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x50408b,_0x9e7b24)=>{this['_aiChatUi']['updateCapabilities'](_0x9e7b24);}),this['activeConversation']['on']('modelSelected',(_0x227049,_0x449a1b)=>{this['_aiChatUi']['setSelectedModel'](_0x449a1b['selectedModel'],_0x449a1b['isDisabled']);}),this['activeConversation']['on']('error',(_0x3ce261,{error:_0xf17609,interactionId:_0x2e7f08,fileName:_0xf9e6d2,url:_0x58bf39,sourceId:_0x391cb6,sourceLabel:_0x3aacc0})=>{const _0x9e6104=_0x2e7f08?_0x2e7f08+':'+_0x4c8592():_0x4c8592();_0xf17609['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':u(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x9e6104}):_0xf17609['message']['startsWith']('ai-chat-conversation-init-failed')||_0xf17609['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':u(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x9e6104}),this['_logError'](_0xf17609)):_0xf17609['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':u(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0xf9e6d2),'id':_0x9e6104}):_0xf17609['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':u(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x58bf39),'id':_0x9e6104}):_0xf17609['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':u(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x9e6104}):_0xf17609['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':u(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x9e6104}):_0xf17609['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x391cb6&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x391cb6),this['_aiChatUi']['addFeedItemError']({'errorMessage':u(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x3aacc0||'source'),'id':_0x9e6104}),this['_logError'](_0xf17609)):_0xf17609['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':u(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x9e6104}),this['_logError'](_0xf17609)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':u(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x9e6104}),this['_logError'](_0xf17609));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x5210f7||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x4d32b0,quickActionData:_0x2226fa}){if(!this['activeConversation'])throw new _0x51167b('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':_0x4d32b0,'quickActionData':_0x2226fa}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x389e16=_(this['context'])['model'],_0x106b82=Array['from'](_0x389e16['markers']['getMarkersGroup'](m));_0x389e16['change'](_0x28e1a6=>{_0x106b82['forEach'](_0x340c35=>_0x28e1a6['removeMarker'](_0x340c35));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x300f1e){this['_aiChatUi']['setIsMaximized'](_0x300f1e);}['_logError'](_0x1de098){_0x36ffad(_0x1de098['message']);}['_removeFromContext'](_0x439e70){this['activeConversation']?.['removeFromContext'](_0x439e70);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x5408d8){const [_0x51c54d,_0x42165e]=_0x5408d8['split'](':'),_0x3c1326=this['activeConversation']['getInteraction'](_0x51c54d),_0x38f9e5=_0x3c1326['getReply'](_0x42165e);return{'interaction':_0x3c1326,'reply':_0x38f9e5};}['_scrollToSuggestionRange'](_0x130dbb,_0x15a706=!0x1){const _0x49db19=_(this['context']),_0x1e400f={'target':_0x49db19['editing']['view']['domConverter']['viewRangeToDom'](_0x49db19['editing']['mapper']['toViewRange'](_0x130dbb)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x15a706};_0x15a706&&(_0x1e400f['alignToTop']=!0x0),_0x24e163(_0x1e400f);}['updateConversationTitle'](_0x5dc130,_0x3c6e47=!0x1){this['_aiChatUi']['setConversationTitle'](_0x5dc130||u(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x3c6e47);}async['_updateReplyContent']({reply:_0x990b45,renderingStrategy:_0x2a9acc}){const {id:_0x80d084,isDone:_0x1652fd,type:_0x5c956e,parsedContent:_0x469525}=_0x990b45;if('modification-delta'===_0x5c956e){const _0x8f5d16=_0x990b45['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x80d084,'parts':_0x8f5d16,'renderingStrategy':_0x2a9acc,'isDone':_0x1652fd});}else'text-delta'===_0x5c956e&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x80d084,'parsedContent':_0x469525,'renderingStrategy':_0x2a9acc,'isDone':_0x1652fd});_0x1652fd&&_0x990b45['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x80d084,_0x990b45['sources']);}async['_stopLastInteraction'](){const _0x545442=this['activeConversation']?.['lastInteraction'];_0x545442&&(_0x545442['stop'](),this['_aiChatUi']['stopInteraction'](_0x545442));}async['_flushLastInteractionUI'](){const _0x50cd77=this['activeConversation']?.['lastInteraction'];if(_0x50cd77){for await(const _0x32c3b1 of _0x50cd77['replies'])await this['_updateReplyContent']({'reply':_0x32c3b1,'renderingStrategy':'static'});}}['_updateRatings'](_0x3777ba){const _0x49a12f={'positiveCount':_0x3777ba['changeGroups']['filter'](_0x48916f=>'accepted'===_0x48916f['state'])['length'],'totalCount':_0x3777ba['changeGroups']['length'],'modificationId':_0x3777ba['id']},_0x1e76f4=this['activeConversation']['getInteraction'](_0x3777ba['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x1e76f4,_0x49a12f);}}const j=[...Ce,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ue extends gr{['containerView'];['actionsView'];constructor(_0x167184,_0x4e8105){super(_0x4e8105),this['set']('isTrackChangesOn',!0x1),this['containerView']=new N(_0x167184,{'showDiff':_0x4e8105['showDiff'],'areActionsDisabled':_0x4e8105['areActionsDisabled'],'availableActions':_0x4e8105['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0xd1c22c,_0x3cb293)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3cb293['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',(_0x194714,{index:_0x449117})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x449117});}),this['containerView']['on']('insertSuggestion',(_0x4fd466,{index:_0x241bd5})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x241bd5});}),this['containerView']['on']('rejectSuggestion',(_0x34dd2f,{index:_0x42b05a})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x42b05a});}),this['containerView']['on']('mouseOverSuggestion',(_0x439acb,{index:_0x1340cf})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1340cf});}),this['containerView']['on']('mouseLeaveSuggestion',(_0xc27bf5,{index:_0x396b8c})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x396b8c});}),this['actionsView']=new nh(_0x167184,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']});}),_0x4e8105['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'](_0x49e365){await this['containerView']['updateContent'](_0x49e365),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x465a9b,_0xb983ba){this['containerView']['bodyView']['updatePartState'](_0x465a9b,_0xb983ba);}['updateSources'](_0x2286ba){this['containerView']['updateSources'](_0x2286ba);}['getPartView'](_0x2001bb){return this['containerView']['bodyView']['getPartView'](_0x2001bb);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class fe extends gr{['replyContainer'];constructor(_0x33469e,_0x43d018){super(_0x43d018),this['locale']=_0x33469e,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new st(),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':tr(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x16a6d1,renderingStrategy:_0xff5a7,abortSignal:_0x264ea3}){'streaming'===_0xff5a7?await this['streamIntoElement'](_0x16a6d1,this['replyContainer']['element'],_0x264ea3):this['replyContainer']['element']['innerHTML']=_0x1b38df(_0x16a6d1);}['updateSources'](_0x468d7b){const _0x1cc5db=new yr(this['locale']);_0x1cc5db['children']['addMany'](_0x468d7b['map'](_0x5bb05d=>new Cr(this['locale'],_0x5bb05d))),_0x1cc5db['isVisible']=!0x0,this['children']['add'](_0x1cc5db);}}const xn={'file':_0x37b5a4,'document':_0x3239bf,'web-resource':_0x231b46,'text':_0x37b5a4,'selection':_0x5b0af7},Zr='ck-ai-chat-context-chip',ca='ck-ai-chat-context-chip_wide',la='ck-ai-chat-context-chip_document',da='ck-ai-chat-context-chip__label',ua='ck-ai-chat-context-chip__type-icon',Ia='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Co extends tt{constructor(_0x5d82c2,_0x54ed36,_0x45189b,_0x31829e,_0x319c1f=!0x1){super(_0x5d82c2),this['_isAnimationOnEnterEnabled']=_0x31829e,this['_initializeProperties'](_0x54ed36,_0x45189b,_0x319c1f),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'](_0x37d2b0,_0x48079f,_0x49c3f5){this['set']('label',_0x37d2b0['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x37d2b0['type']),this['set']('id',_0x37d2b0['uiId']),this['set']('readonly',_0x48079f),this['set']('isLoading',_0x49c3f5);}['_setupTemplate'](){const _0x11cb9d=this['_createIconView'](),_0x1c74bd=this['_createRemoveButton'](),_0x34ea98=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x34ea98),'children':this['_createTemplateChildren'](_0x11cb9d,_0x1c74bd,_0x34ea98)});}['_createTemplateAttributes'](_0x37b802){return{'class':[Zr,_0x37b802['if']('itemType',la,_0x8a66f3=>'document'==_0x8a66f3),_0x37b802['if']('itemType',ca,_0xd2954d=>'selection'==_0xd2954d)],'data-cke-tooltip-text':_0x37b802['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Ia};}['_createTemplateChildren'](_0x128931,_0x231e83,_0x117a53){const _0x47b9fe=this['_createLabelElement'](_0x117a53),_0x1fb6e0=this['_createLoaderIcon']();return this['readonly']?[_0x128931,_0x47b9fe]:[_0x128931,_0x1fb6e0,_0x47b9fe,_0x231e83];}['_createLabelElement'](_0x4dcc45){return{'tag':'span','attributes':{'class':da},'children':[{'text':_0x4dcc45['to']('label')}]};}['_createRemoveButton'](){const _0x24b8e5=new tt(this['locale']);return _0x24b8e5['set']({'label':u(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x40e6cf}),this['_setupRemoveButtonEvent'](_0x24b8e5),_0x24b8e5;}['_setupRemoveButtonEvent'](_0x49479b){_0x49479b['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x170e17=this['bindTemplate'],_0x49318f=new _0x202d8c();return _0x49318f['content']=xn[this['itemType']],_0x49318f['extendTemplate']({'attributes':{'class':[ua,_0x170e17['if']('isLoading','ck-hidden',_0x11ad3f=>_0x11ad3f)]}}),_0x49318f;}['_handleAnimationEndOnce'](_0x1f934b,_0x569f59){if(!_0x1f934b)return;const _0x59a580=()=>{_0x569f59(),_0x1f934b['removeEventListener']('animationend',_0x59a580),_0x1f934b['removeEventListener']('webkitAnimationEnd',_0x59a580);};_0x1f934b['addEventListener']('animationend',_0x59a580),_0x1f934b['addEventListener']('webkitAnimationEnd',_0x59a580);}['_createLoaderIcon'](){const _0x577e89=new be('small');return _0x577e89['bind']('isVisible')['to'](this,'isLoading',_0x1e9e7a=>_0x1e9e7a),_0x577e89;}}function In(_0x2dde51){if(!_0x2dde51)return _0x2dde51;if(_0x2dde51['length']<=0x78)return _0x2dde51;const _0xe8ef31=_0x2dde51['slice'](0x0,0x78),_0x149093=_0xe8ef31['lastIndexOf']('\x20');return(_0x149093>0x0?_0xe8ef31['slice'](0x0,_0x149093):_0xe8ef31)+'…';}const ln={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class mo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x22ed77,_0x167192,_0x144f03,_0x5aba92,_0x39cbf6){this['_locale']=_0x22ed77,this['_visibleChips']=_0x167192,this['_config']={...ln,..._0x144f03,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x144f03['cssClasses']}},this['_overflowChips']=new _0x4d07d3(),this['_bodyCollection']=_0x5aba92,this['_parentView']=_0x39cbf6||null;}['setContainerElement'](_0x285529){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x285529,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 _0x2a76d2=[...this['_visibleChips'],...this['_overflowChips']],_0x6e8f42=this['_createCalculationContainer'](),_0x51bbf1=this['_calculateOverflowInContainer'](_0x6e8f42,_0x2a76d2),_0x4bb611=_0x6e8f42['_ancestorsToRestore'];_0x4bb611&&this['_restoreAncestorVisibility'](_0x4bb611),_0x6e8f42['remove'](),this['_applyOverflowResults'](_0x2a76d2,_0x51bbf1);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),ts({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x1e8f3f=new tt(this['_locale']);_0x1e8f3f['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x467b1e=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x467b1e['push'](this['_config']['cssClasses']['controlsButton']),_0x1e8f3f['extendTemplate']({'attributes':{'class':_0x467b1e}}),_0x1e8f3f;}['_createShowMoreBalloonPanelView'](){const _0x45bc03=new _0x5266db(this['_locale']);return _0x45bc03['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x45bc03),_0x45bc03;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0xf0c5fd=>{_0xf0c5fd['disableAnimationOnEnter']();});const _0x13553f=new st(this['_locale']);_0x13553f['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x13553f);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x2db75=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x2db75?'':'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'](_0x18d787){const _0xd9f513=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x22c617=this['_containerElement']?.['classList'];if(_0x22c617){const _0x17af68=_0x22c617[0x0]||'',_0x576535=_0x18d787['querySelector']('.'+_0x17af68),_0x350d5c=_0x18d787['querySelector'](_0xd9f513);return _0x576535||_0x350d5c||_0x18d787;}return _0x18d787['querySelector'](_0xd9f513)||_0x18d787;}['_calculateContainerWidth'](){const _0x5776c3=this['_parentView']?.['element']||this['_containerElement'];if(!_0x5776c3)return an;const _0x4b6f3c=window['getComputedStyle'](_0x5776c3)['width'];if('auto'===_0x4b6f3c||'0px'===_0x4b6f3c||!_0x4b6f3c){const _0x30d0a7=_0x5776c3['parentElement'];if(_0x30d0a7){const _0x46320d=window['getComputedStyle'](_0x30d0a7);return'auto'!==_0x46320d['width']?_0x46320d['width']:an;}return an;}return _0x4b6f3c;}['_applyCalculationStyles'](_0x40d784,_0x3db37b){this['_config']['cssClasses']['calculationContainer']&&_0x40d784['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x40d784['style']['width']=_0x3db37b,_0x40d784['style']['position']='absolute',_0x40d784['style']['top']='-9999px',_0x40d784['style']['left']='-9999px',_0x40d784['style']['opacity']='0',_0x40d784['style']['pointerEvents']='none',_0x40d784['style']['zIndex']='-1',_0x40d784['style']['visibility']='visible\x20!important',_0x40d784['style']['display']='block\x20!important',_0x40d784['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x3086b7){_0x3086b7['forEach'](({element:_0x6e76b3,originalDisplay:_0x4cd53a,originalVisibility:_0x4f26ad})=>{_0x6e76b3['style']['display']=_0x4cd53a,_0x6e76b3['style']['visibility']=_0x4f26ad;});}['_makeAncestorsVisible'](_0x4d6ca6){const _0x3a9f02=[];let _0x50598f=_0x4d6ca6;for(;_0x50598f&&_0x50598f!==document['body'];){const _0x5dd2db=window['getComputedStyle'](_0x50598f);'none'!==_0x5dd2db['display']&&'hidden'!==_0x5dd2db['visibility']||(_0x3a9f02['push']({'element':_0x50598f,'originalDisplay':_0x50598f['style']['display'],'originalVisibility':_0x50598f['style']['visibility']}),_0x50598f['style']['display']='block',_0x50598f['style']['visibility']='visible'),_0x50598f=_0x50598f['parentElement'];}return _0x3a9f02;}['_createContainerElements'](){let _0x1941bd,_0x389a02;return this['_parentView']?.['element']?(_0x1941bd=this['_parentView']['element']['cloneNode'](!0x0),_0x389a02=this['_findTargetContainer'](_0x1941bd)):(_0x1941bd=document['createElement']('div'),_0x389a02=_0x1941bd),{'calculationContainer':_0x1941bd,'targetContainer':_0x389a02};}['_createCalculationContainer'](){const {calculationContainer:_0x23b007,targetContainer:_0x34df76}=this['_createContainerElements'](),_0x213b77=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x23b007,_0x213b77);const _0x3f5fad=this['_parentView']?.['element']||this['_containerElement'],_0xb5aa8b=_0x3f5fad?.['parentElement'];_0xb5aa8b?_0xb5aa8b['appendChild'](_0x23b007):document['body']['appendChild'](_0x23b007),_0x23b007['_targetContainer']=_0x34df76;const _0x153190=this['_makeAncestorsVisible'](_0xb5aa8b||null);return _0x23b007['offsetWidth'],_0x23b007['_ancestorsToRestore']=_0x153190,_0x23b007;}['_calculateOverflowInContainer'](_0x2b76f1,_0x387c06){const _0x2d45f2=_0x2b76f1['_targetContainer']||_0x2b76f1,_0x2ab874=[],{rowCount:_0x5cd458}=this['_renderChipsAndCountRows'](_0x2d45f2,_0x387c06);if(_0x5cd458<=this['_config']['maxVisibleRows'])return _0x2ab874;const _0x45fc77=_0x387c06['slice']();for(;_0x45fc77['length']>0x0;){if(this['_testButtonFit'](_0x2b76f1,_0x2d45f2,_0x45fc77)){const _0x3643f8=_0x387c06['filter'](_0x519c63=>!_0x45fc77['includes'](_0x519c63));_0x2ab874['push'](..._0x3643f8);break;}if(!_0x45fc77['pop']())break;}return _0x2ab874;}['_renderChipsAndCountRows'](_0x39319d,_0x42bbcd){_0x39319d['innerHTML']='',_0x42bbcd['forEach'](_0x1a7a02=>{if(_0x1a7a02['element']){const _0x238df8=_0x1a7a02['element']['cloneNode'](!0x0);_0x39319d['appendChild'](_0x238df8);}}),_0x39319d['offsetWidth'];const _0x54790f=_0x39319d['children'],_0x5295a8=[];return Array['from'](_0x54790f)['forEach'](_0x10ad92=>{const _0x38c208=_0x10ad92['getBoundingClientRect']()['top'];_0x5295a8['some'](_0x46502e=>Math['abs'](_0x46502e-_0x38c208)<this['_config']['rowDetectionTolerance'])||_0x5295a8['push'](_0x38c208);}),{'rowCount':_0x5295a8['length']};}['_createMockButton'](){const _0x306600=document['createElement']('button');return _0x306600['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x306600['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x306600['textContent']='+\x201',_0x306600;}['_testButtonFit'](_0x4d55e2,_0x131d91,_0xd3065e){this['_renderChipsAndCountRows'](_0x131d91,_0xd3065e);const _0x169005=this['_createMockButton']();_0x4d55e2['appendChild'](_0x169005),_0x4d55e2['offsetWidth'];const _0x30da41=[..._0x131d91['children'],_0x169005],_0x5930aa=[];_0x30da41['forEach'](_0x569b66=>{const _0x334435=_0x569b66['getBoundingClientRect']()['top'];_0x5930aa['some'](_0x11e6ff=>Math['abs'](_0x11e6ff-_0x334435)<this['_config']['rowDetectionTolerance'])||_0x5930aa['push'](_0x334435);});const _0x251cb5=_0x5930aa['length'];return _0x169005['remove'](),_0x251cb5<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x3cfc8f,_0x10e818){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x3cfc8f['forEach'](_0xd37df2=>{_0x10e818['includes'](_0xd37df2)?this['_overflowChips']['add'](_0xd37df2):this['_visibleChips']['add'](_0xd37df2);});}['_updateOverflowUI'](_0x333e81){if(_0x333e81>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x333e81>0x0&&this['_showMoreButtonView']){const _0x53dfae=''+this['_config']['showMoreLabelPrefix']+(_0x333e81<0x63?_0x333e81:'99');this['_showMoreButtonView']['label']=_0x53dfae;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x9648f7,_0x56a6a7){this['_distributeChips'](_0x9648f7,_0x56a6a7),this['_updateOverflowUI'](_0x56a6a7['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x48cf3b=>{_0x48cf3b[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 _0x19f1a5=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x19f1a5['width']||0x0===_0x19f1a5['height'])return!0x1;const _0x1b77e4=window['innerHeight']||document['documentElement']['clientHeight'],_0x135324=window['innerWidth']||document['documentElement']['clientWidth'],_0x3c24ea=0xc8;return _0x19f1a5['bottom']>=-0xc8&&_0x19f1a5['top']<=_0x1b77e4+_0x3c24ea&&_0x19f1a5['right']>=-0xc8&&_0x19f1a5['left']<=_0x135324+_0x3c24ea;}}const Aa='ck-ai-chat__feed__context-chips',ga='ck-ai-chat-context-chips-wrapper',Ea='ck-ai-chat-context-chips-wrapper-balloon',ma='ck-ai-chat-controls-button',pa='ck-ai-chat-controls_context_show-more-button',Ta='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends st{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x57449c,_0x4b8ef3,_0x584f66){super(_0x57449c),this['_bodyCollection']=_0x584f66,this['_createContextChips'](_0x4b8ef3);const _0x4f00fb={'cssClasses':{'showMoreButton':pa,'showMoreBalloon':Ta,'overflowContainer':Ea,'controlsButton':ma}};this['_overflowManager']=new mo(_0x57449c,this['_contextChips'],_0x4f00fb,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Aa,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':ga},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x884cd3=this['element']['querySelector']('.'+ga);_0x884cd3&&(this['_overflowManager']['setContainerElement'](_0x884cd3),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x22731d){for(const _0x425130 of _0x22731d){const _0x1de358=new Co(this['locale'],_0x425130,!0x0,!0x1);this['_contextChips']['add'](_0x1de358);}}}class ke extends gr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x381fc1,_0x5ed764,_0x419bd4){super(_0x5ed764),this['_locale']=_0x381fc1,this['_bodyCollection']=_0x419bd4,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'](_0x343997=>!_0x343997['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new st(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 F extends gr{['capabilities'];constructor(_0x29415b,_0x226e77){super(_0x226e77);const {isWebSearchEnabled:_0x43fb7e,isReasoningEnabled:_0xdf6165}=_0x226e77['capabilities'],_0x3ef3d9=[];let _0x5ebff4='';_0x43fb7e&&_0xdf6165?(_0x5ebff4=u(_0x29415b,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x3ef3d9['push'](_a(_0x2ab575)),_0x3ef3d9['push'](_a(_0x52193b))):_0x43fb7e?(_0x5ebff4=u(_0x29415b,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x3ef3d9['push'](_a(_0x2ab575))):_0xdf6165&&(_0x5ebff4=u(_0x29415b,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x3ef3d9['push'](_a(_0x52193b))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x5ebff4?'':'ck-hidden']}});const _0x2c708f=new st();_0x2c708f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x3ef3d9,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x5ebff4]}]}),this['children']['add'](_0x2c708f),this['capabilities']=_0x226e77['capabilities'];}}function _a(_0x2198cf){const _0x535939=new _0x202d8c();return _0x535939['content']=_0x2198cf,_0x535939;}const ls=['wheel','touchstart','pointerdown','keydown'],us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ve{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x300284){this['element']=_0x300284,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x18c518 of ls){const _0x2d6cba='keydown'!==_0x18c518;this['element']['addEventListener'](_0x18c518,this['_onUserEvent']['bind'](this),{'passive':_0x2d6cba,'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'](_0x9d1869){if(this['isRunning']){if('keydown'===_0x9d1869['type']){const _0x101c57=_0x9d1869['key'];if(!us['includes'](_0x101c57))return;}_0x9d1869 instanceof WheelEvent?_0x9d1869['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x3d2e23,scrollHeight:_0xaad1d8,clientHeight:_0x3c7826}=this['element'];return _0xaad1d8-_0x3d2e23-_0x3c7826<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class ye extends st{constructor(_0x41e04b,_0xefa42a){super(_0x41e04b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0xefa42a)});}['_createSkeletonItems'](_0x554034){const _0x320fc1=['ck','ck-ai-skeleton__item'];return _0x554034['map'](_0x2eee70=>{let _0x40ef58='';switch(_0x2eee70['attributes']['align']){case'right':_0x40ef58='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x40ef58='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x40ef58='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x2eee70['tag'],'attributes':{'class':[..._0x320fc1,_0x2eee70['attributes']['class']?_0x2eee70['attributes']['class']:''],'style':'width:\x20'+_0x2eee70['attributes']['width']+';\x20height:\x20'+_0x2eee70['attributes']['height']+';'+_0x40ef58}};});}}const _e={'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':$e(0x5,'100%','44px','right'),'aiChatResources':$e(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 $e(_0xf1ab40,_0x351189,_0x30a151,_0x9b53cc){return new Array(_0xf1ab40)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x351189,'height':_0x30a151,'align':_0x9b53cc}}));}class ki extends st{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x4f0087,_0x5a79de){super(_0x4f0087),this['_bodyCollection']=_0x5a79de,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...j)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ve(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x47f7dc,_0x15c835){let _0x2da54f;'ai-reply'===_0x47f7dc?_0x2da54f=new fe(this['locale'],_0x15c835):'ai-suggestion-reply'===_0x47f7dc?(_0x2da54f=new ue(this['locale'],_0x15c835),_0x2da54f['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x2da54f='user-message'===_0x47f7dc?new ke(this['locale'],_0x15c835,this['_bodyCollection']):'interaction-header'===_0x47f7dc?new F(this['locale'],_0x15c835):new Se(_0x15c835),this['children']['add'](_0x2da54f);}async['updateReplyItem']({id:_0x4e6dfc,parsedContent:_0x13546d,renderingStrategy:_0xce2516,abortSignal:_0x49f0a0}){const _0x2de44e=this['getItemById'](_0x4e6dfc);if(!(_0x2de44e instanceof fe))throw new _0x51167b('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x2de44e,'id':_0x4e6dfc,'parsedContent':_0x13546d});await _0x2de44e['updateContent']({'parsedContent':_0x13546d,'renderingStrategy':_0xce2516,'abortSignal':_0x49f0a0});}async['updateWebSources'](_0x56a928,_0x1a9148){const _0x2d0be9=this['getItemById'](_0x56a928);if(_0x2d0be9 instanceof ue)_0x2d0be9['updateSources'](_0x1a9148);else{if(!(_0x2d0be9 instanceof fe))throw new _0x51167b('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x2d0be9,'id':_0x56a928,'sources':_0x1a9148});_0x2d0be9['updateSources'](_0x1a9148);}}async['updateSuggestionItem']({id:_0x533b61,parts:_0x64f9f2,renderingStrategy:_0x33f392,abortSignal:_0x48be8a}){const _0x19005a=this['getItemById'](_0x533b61);if(!(_0x19005a instanceof ue))throw new _0x51167b('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x19005a,'id':_0x533b61,'parts':_0x64f9f2});await _0x19005a['updateContent']({'parts':_0x64f9f2,'renderingStrategy':_0x33f392,'abortSignal':_0x48be8a});}['updateSuggestionPartState']({id:_0x292c09,index:_0x273def,state:_0x375424}){const _0x40b981=this['getItemById'](_0x292c09);if(!(_0x40b981 instanceof ue))throw new _0x51167b('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x292c09});_0x40b981['updatePartState'](_0x273def,_0x375424);}['markItemAsDone'](_0x442b4a){this['getItemById'](_0x442b4a)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x394572=>_0x394572['options']['id']);}['removeItem'](_0x3e07d1){this['children']['remove'](this['getItemById'](_0x3e07d1));}['scrollToSuggestion'](_0x5e8add,_0x4364ef){const _0x5a214a=this['getItemById'](_0x5e8add);if(!(_0x5a214a instanceof ue))return void zt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x5e8add,'partIndex':_0x4364ef});const _0x2cd988=_0x5a214a['getPartView'](_0x4364ef);_0x2cd988?_0x24e163({'target':_0x2cd988['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):zt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x5e8add,'partIndex':_0x4364ef});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x5763f7=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x5763f7,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x1b8d05=new ye(this['locale'],_e['aiFeed']);return _0x1b8d05['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x550880=>!_0x550880)]}}),_0x1b8d05;}['_createFeedItems'](){const _0x1a2492=new st(this['locale']);return _0x1a2492['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1a2492;}['_createFeedLoader'](){const _0x5510dd=new st(this['locale']);return _0x5510dd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x3ea269=>!_0x3ea269)]},'children':this['_createLoaderChildren']()}),_0x5510dd;}['_createLoaderChildren'](){const _0x566ef8=new be();return _0x566ef8['isVisible']=!0x0,[_0x566ef8,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x173884){const _0x348164=this['children']['find'](_0x172527=>_0x172527['options']['id']['includes'](_0x173884));if(!_0x348164)throw new _0x51167b('ai-chat-feed-view-item-not-found',this,{'id':_0x173884});return _0x348164;}['setLoadingMessage'](_0x59c86d){this['set']('loadingMessage',_0x59c86d);}['toggleLoadingSkeleton'](_0x7ad7b3){this['set']('isLoadingSkeletonVisible',_0x7ad7b3);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ar extends _0x493f65{['filter'](){let _0x47764a=0x0;for(const _0x3929a4 of this['items'])_0x47764a+=_0x3929a4['items']['length'];return{'resultsCount':_0x47764a,'totalItemsCount':_0x47764a};}}class es extends _0x5c4293{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x11d893,_0xcda4d1){super(_0x11d893,{'queryView':{'label':'','creator':_0x1db25d,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ar(_0x11d893),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0xcda4d1,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=es['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=es['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x146c3b,_0x3e8e10)=>!_0x146c3b&&!_0x3e8e10),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x427531,_0x42768d)=>{this['isUploadInProgress']||this['isEmpty']||_0x427531['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x42768d());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xbd21fc=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xbd21fc)return this['queryView']['errorText']=u(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x1f95ba=Xt(_0xbd21fc);this['fire']('sendUserMessage',_0x1f95ba),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x942722){this['queryView']['fieldView']['set']('placeholder',_0x942722);}['_createSubmitButton'](){const _0x366050=new tt(this['locale']);return _0x366050['set']({'icon':_0xc5da5d,'label':u(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x366050['on']('execute',()=>{this['submit']();}),_0x366050;}['setIsUploadInProgress'](_0x14f692){this['isUploadInProgress']=_0x14f692;}['_setUpAddContextButtonPositioning'](){const _0x5d605e=this['locale'],_0x41a60b=()=>{_0x2909f5['window']['requestAnimationFrame'](()=>{if(_0x138911(this['element'])){const _0x31a748=new _0x401654(this['queryView']['fieldView']['element']),_0x2cea17=new _0x401654(this['_addContextButtonView']['element']),_0x456a1f=_0x31a748['width'],_0x283f5a='rtl'===_0x5d605e['uiLanguageDirection']?'right':'left';_0x31a748['excludeScrollbarsAndBorders']();const _0x53c6ed=_0x456a1f-_0x31a748['width']+0x1;this['_addContextButtonView']['element']['style'][_0x283f5a]='calc('+(_0x456a1f-_0x2cea17['width']-_0x53c6ed)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x41a60b),this['on']('render',()=>{_0x41a60b(),this['_queryViewResizeObserver']=new _0x2b8751(this['queryView']['fieldView']['element'],()=>{_0x41a60b();});});}}const Ca='ck-ai-chat__prompt-capabilities',wa='ck-ai-chat-controls-button',fa='ck-ai-chat-controls-button--commands',Sa='ck-ai-chat-controls__model-selection',Oa='ck-ai-chat-controls__model-selection__item-name',Ra='ck-ai-chat-controls__model-selection__item-description',ba='ck-ai-chat-controls__model-selection__item-capabilities',Na='n';class is extends st{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0xc9cc02){super(_0xc9cc02),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',_0x5bce2e=>_0x5bce2e),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x36c98c=>_0x36c98c?this['_modelSelectionDropdown']['buttonView']['label']:u(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2bc5e1=>_0x2bc5e1),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x3b0f15=>_0x3b0f15),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x200453=>!_0x200453),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x25d725=>u(this['locale'],_0x25d725?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x2ce9de=>_0x2ce9de),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x1762bc=>!_0x1762bc),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x27d289=>u(this['locale'],_0x27d289?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Ca]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x4d07d3(),_0x146679(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x598700,_0x3913dc){if(this['set']('modelSelectorVisible',!(_0x3913dc&&_0x598700['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x598700?.['length']){const _0x33c415=ni['getLocalized'](this['locale'],_0x598700);for(const _0x3eb7e3 of _0x33c415){const _0x1a04de=new _0x12ff1d({'label':_0x3eb7e3['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3eb7e3['id'],'model':_0x3eb7e3});_0x1a04de['bind']('isOn')['to'](this,'activeModelId',_0x535e41=>_0x535e41===_0x3eb7e3['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1a04de,'labelView':new ka(this['locale'],_0x3eb7e3)});}}}['setWebSearch'](_0x13216c){this['set']('webSearchActive',_0x13216c);}['setReasoning'](_0x2a2953){this['set']('reasoningActive',_0x2a2953);}['setModel'](_0x5d00c9){if(!_0x5d00c9)return;this['activeModelId']=_0x5d00c9['id'],this['activeModelName']=_0x5d00c9['name']||_0x5d00c9['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x5d00c9['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x5d00c9['name']);const _0x31c02f=_0x5d00c9['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x31c02f),this['_webSearchButton']['set']('isVisible',_0x31c02f);const _0x87bf95=_0x5d00c9['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x87bf95),this['_reasoningButton']['set']('isVisible',_0x87bf95);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x31f55d){this['set']('modelSelectorEnabled',!0x1),_0x31f55d&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x4073f0=new tt();return _0x4073f0['set']({'label':u(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x2ab575,'class':wa,'isToggleable':!0x0,'tooltipPosition':Na}),_0x4073f0['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x4073f0;}['_createReasoningButton'](){const _0x1fb2ce=new tt();return _0x1fb2ce['set']({'label':u(this['locale'],'AI_CHAT_REASONING'),'icon':_0x52193b,'class':wa,'isToggleable':!0x0,'tooltipPosition':Na}),_0x1fb2ce['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x1fb2ce;}['_createCommandsButton'](){const _0x29c122=new tt();return _0x29c122['set']({'label':u(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x43d7e5,'withText':!0x0,'class':wa,'isToggleable':!0x0,'tooltip':u(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Na}),_0x29c122['extendTemplate']({'attributes':{'class':[fa]}}),_0x29c122['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x29c122;}['_createModelSelectionDropdown'](){const _0x3312c2=_0x3e6542(this['locale']);return _0x3312c2['set']({'panelPosition':'ne','class':[Sa]}),_0x3312c2['buttonView']['set']({'label':u(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Na}),this['listenTo'](_0x3312c2,'execute',_0x276d74=>{this['fire']('selectModel',_0x276d74['source']['model']);}),_0x3312c2;}['_createModelNameView'](){const _0x240e9e=new yo(this['locale']);return _0x240e9e['bind']('text')['to'](this,'activeModelName',_0x20f3f0=>_0x20f3f0??''),_0x240e9e['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x1a2a05,_0x4e07c8)=>!_0x1a2a05&&!_0x4e07c8?.['toLowerCase']()['startsWith']('agent')),_0x240e9e;}}let ka=class extends _0x40384f{constructor(_0x4a73e4,_0x9266d3){super();const _0x4c4482=this['bindTemplate'],_0x29ff27=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4c4482['to']('style'),'id':_0x4c4482['to']('id')},'children':[{'tag':'div','attributes':{'class':[Oa]},'children':[{'text':_0x4c4482['to']('text')}]},{'tag':'div','attributes':{'class':[Ra]},'children':[{'tag':'span','children':[{'text':_0x9266d3['description']}]}]},{'tag':'div','attributes':{'class':[ba]},'children':_0x29ff27}]}),_0x29ff27['addMany'](this['_getCapabilityParts'](_0x4a73e4,_0x2ab575,'AI_CHAT_SEARCH_WEB',_0x9266d3['capabilities']['webSearch']?.['enabled']??!0x1)),_0x29ff27['addMany'](this['_getCapabilityParts'](_0x4a73e4,_0x52193b,'AI_CHAT_REASONING',_0x9266d3['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x18a1bd,_0x5b671f,_0x46d3f1,_0x2b558b){const _0x55f255=new _0x202d8c();_0x55f255['content']=_0x5b671f;const _0x5cff7d=new st(_0x18a1bd);_0x5cff7d['setTemplate']({'tag':'span','children':[{'text':u(_0x18a1bd,_0x46d3f1)+':\x20'}]});const _0x330441=new st(_0x18a1bd);return _0x330441['setTemplate']({'tag':'span','children':[{'text':u(_0x18a1bd,_0x2b558b?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x55f255,_0x5cff7d,_0x330441];}};class yo extends st{constructor(_0x4de86b){super(_0x4de86b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3f389c=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x3f389c['if']('isVisible','ck-hidden',_0x553a79=>!_0x553a79)]},'children':[{'text':_0x3f389c['to']('text')}]});}}const ya='ck-ai-chat-context-controls__url-form',va='ck-ai-chat-context-controls__url-input-section';class xo extends st{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x42fd4c){super(_0x42fd4c),this['focusTracker']=new _0x156d7c(),this['keystrokes']=new _0x2ec108(),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 _0x3ac126({'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'](_0x5c30e4=>{this['focusTracker']['add'](_0x5c30e4['element']),this['keystrokes']['listenTo'](_0x5c30e4['element']);}),_0x3aecd7({'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'](_0x1059d6){this['urlInputField']['errorText']=_0x1059d6,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x3e8717=new tt(this['locale']);return _0x3e8717['set']({'icon':ht,'tooltip':u(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x3e8717;}['_createUrlInputField'](){const _0x5eb7b8=new _0x5ef183(this['locale'],_0x5ba2a4);return _0x5eb7b8['set']({'label':u(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x5eb7b8['fieldView']['set']({'placeholder':u(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x5eb7b8;}['_createConfirmButton'](){const _0x2145ff=new tt(this['locale']);return _0x2145ff['set']({'icon':_0x24f2e2,'tooltip':u(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x2145ff;}['_setupTemplate'](){const _0xfabf6c=new _0x3197a7(this['locale'],{'label':u(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0xfabf6c['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ya,'tabindex':'-1'},'children':[_0xfabf6c,{'tag':'div','attributes':{'class':va},'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',_0x27265b=>{_0x27265b['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x11cf53,_0xc5ed2)=>{this['clear'](),this['fire']('cancel'),_0xc5ed2();});}['_handleSubmit'](){const _0x2dd639=this['getValue']()['trim']();_0x2dd639?this['_isValidUrl'](_0x2dd639)?(this['clearError'](),this['fire']('submitUrl',_0x2dd639)):this['setError'](u(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](u(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x165205=this['getValue']()['trim'](),_0x305eaa=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x165205['length']>0x0&&!_0x305eaa;}['_isValidUrl'](_0x4364dd){try{return!!new URL(_0x4364dd);}catch{return!0x1;}}}const xa='ck-ai-chat-resources__item',La='ck-ai-chat-resources__item--in-context',Da='ck-ai-chat-resources__item-title',Pa='ck-ai-chat-resources__item__icon';class Qo extends _0x5374ac{['resource'];['_titleView'];['_iconView'];constructor(_0x4f85e5,_0x517152){super(_0x4f85e5),this['resource']=_0x517152,this['set']('isInContext',!!_0x517152['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x278ac){if(_0x278ac['isInContext'])return _0x24f2e2;switch(_0x278ac['type']){case $t['DOCUMENT']:return _0x3239bf;case $t['URL']:return _0x231b46;case $t['FILE']:case $t['TEXT']:return _0x37b5a4;default:return _0x172800;}}['highlightText'](_0x2acc8c){if(!_0x2acc8c||''===_0x2acc8c['trim']())return void this['_titleView']['highlightText'](null);const _0x39029d=new RegExp(_0x7861f9(_0x2acc8c),'gi');this['_titleView']['highlightText'](_0x39029d);}['updateResourceState'](_0x285460){this['resource']['isInContext']=_0x285460,this['isInContext']=_0x285460,this['_updateIcon']();}['_createTitleView'](){const _0x6dd67=new _0x393c5c();return _0x6dd67['text']=this['resource']['label'],_0x6dd67['extendTemplate']({'tag':'span','attributes':{'class':[Da]}}),_0x6dd67;}['_createIconView'](){const _0x5343d8=new _0x202d8c();return _0x5343d8['content']=this['getResourceIcon'](this['resource']),_0x5343d8;}['_setupTemplate'](){const _0x419c77=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[xa,_0x419c77['if']('isVisible','ck-hidden',_0x2afdc5=>!_0x2afdc5),_0x419c77['if']('isInContext',La)]},'children':[{'tag':'div','attributes':{'class':[Pa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x419c77['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Ha='ck-ai-chat-resources__list';class Lr extends _0x493f65{['_source'];constructor(_0x54f0e3,_0x3bd5b1){super(_0x54f0e3),this['_source']=_0x3bd5b1,this['extendTemplate']({'attributes':{'class':[Ha]}});}['setResources'](_0x1455be,_0x350bc0){this['items']['clear']();let _0x3de3c9=_0x1455be;if(this['_source']['useDefaultFiltering']&&_0x350bc0&&''!==_0x350bc0['trim']()){const _0x4191c5=new RegExp(_0x350bc0['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x3de3c9=_0x1455be['filter'](_0x1d402a=>_0x4191c5['test'](_0x1d402a['label']));}for(const _0x2c0d30 of _0x3de3c9){const _0xb4c478=new Qo(this['locale'],_0x2c0d30);_0xb4c478['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x2c0d30);}),this['items']['add'](_0xb4c478);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x350bc0);}['highlightText'](_0x3ac84c){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x4c24c6=>{_0x4c24c6['highlightText'](_0x3ac84c);});}['updateResourceState'](_0x54801b,_0x1368e7){for(const _0x3695cd of this['items']){const _0x562581=_0x3695cd;_0x562581['resource']['id']===_0x54801b&&_0x562581['updateResourceState'](_0x1368e7);}}['_handleResourceSelection'](_0x31e516,_0x5cf871){this['fire']('addResourceToContext',{'source':_0x31e516,'resource':_0x5cf871});}}class Ur extends _0x5ef183{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x7dd512){const t=_0x7dd512['t'],_0x3e2668={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x5ba2a4,'label':u(_0x7dd512,'AI_CHAT_SEARCH_RESOURCES')};super(_0x7dd512,_0x3e2668['creator']),this['label']=_0x3e2668['label'],this['_viewConfig']=_0x3e2668,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x7dd512,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4b47ee){this['fire']('search',_0x4b47ee);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x202d8c(),this['iconView']['content']=_0x11baed,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0xe2580e,t){this['resetButtonView']=new tt(_0xe2580e),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x88b984,'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',_0x3bc018=>!_0x3bc018),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 Zo extends st{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x47d9ff,_0x189bde){super(_0x47d9ff),this['_source']=_0x189bde['source'],this['_searchInputVisibleFrom']=_0x189bde['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 it([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Ur(this['locale']);}['_createSearchSection'](){const _0x257aff=new st(this['locale']);return _0x257aff['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2124ca,_0x54b6a7)=>{this['loadResources'](_0x54b6a7),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x54b6a7);}),_0x257aff;}['_createResourcesListView'](){const _0x2bcb4a=new Lr(this['locale'],this['_source']);return _0x2bcb4a['delegate']('addResourceToContext')['to'](this),_0x2bcb4a['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x2bcb4a;}['_createSkeletonView'](){const _0xc6eb11=new ye(this['locale'],_e['aiChatResources']);return _0xc6eb11['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xf7f359=>!_0xf7f359)]}}),_0xc6eb11;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x59c0d5){const _0x81842f=_0x4c8592();this['_latestLoadResourcesUid']=_0x81842f,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x59c0d5,'uid':_0x81842f}),this['isLoading']=!0x0;}['setResources'](_0x365eb0,_0x24c266){if(_0x24c266&&_0x24c266!==this['_latestLoadResourcesUid'])return;const _0x8f2400=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x365eb0,_0x8f2400),_0x365eb0['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x57a7f1,_0x9258f0){this['_resourcesListView']['updateResourceState'](_0x57a7f1,_0x9258f0);}}const Ma='ck-ai-chat-context-controls__source-balloon-panel',Ua='ck-button-icon\x20ck-button-back',Va='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class wo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x66979d,_0x1b1b80,_0x519fbb){this['_locale']=_0x66979d,this['_bodyCollection']=_0x1b1b80,this['_config']=_0x519fbb;}['showSourceResourcesBalloon'](_0x4368e2){let _0x19dd3a=this['_sourceResourceBalloons']['get'](_0x4368e2['id']);_0x19dd3a||(_0x19dd3a=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x4368e2['id'],_0x19dd3a),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x19dd3a)),this['_addSourceResourceContent'](_0x19dd3a,_0x4368e2),_0x19dd3a['show']();const _0x34c042=this['_config']['getTargetElement']();_0x34c042&&_0x19dd3a['pin']({'target':_0x34c042,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x529a95,_0x55a925,_0x2361be){const _0x1ffc13=this['_sourceResourceBalloons']['get'](_0x529a95);if(!_0x1ffc13)return;const _0x3b4dd4=this['_getResourcesViewFromBalloon'](_0x1ffc13);_0x3b4dd4&&(_0x3b4dd4['setResources'](_0x55a925,_0x2361be),_0x3b4dd4['once']('change:isLoading',()=>{_0x1ffc13['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x15163e){const _0x70fddf=this['_sourceResourceBalloons']['get'](_0x15163e);_0x70fddf&&requestAnimationFrame(()=>{_0x70fddf['hide'](),this['_sourceResourceBalloons']['delete'](_0x15163e),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x2726b9 of this['_sourceResourceBalloons']['values']())if(_0x2726b9['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x56e78c,_0x24b63c,_0x853ad7){const _0xbb5d98=this['_sourceResourceBalloons']['get'](_0x56e78c);if(!_0xbb5d98||!_0xbb5d98['isVisible'])return;const _0x2766ae=this['_config']['getTargetElement']();if(!_0x2766ae)return;_0xbb5d98['pin']({'target':_0x2766ae,'limiter':this['_config']['getLimiterElement']()});const _0x28ee01=this['_getResourcesViewFromBalloon'](_0xbb5d98);_0x28ee01&&_0x28ee01['updateResourceState'](_0x24b63c,_0x853ad7);}['destroy'](){for(const _0x4c2734 of this['_sourceResourceBalloons']['values']())_0x4c2734['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x2327c7=new _0x5266db(this['_locale']);return _0x2327c7['extendTemplate']({'attributes':{'class':Ma}}),this['_bodyCollection']['add'](_0x2327c7),_0x2327c7;}['_addSourceResourceContent'](_0x42cad6,_0x3ad34f){_0x42cad6['content']['clear']();const _0x48cf24=this['_createBalloonHeader'](_0x42cad6,_0x3ad34f);_0x42cad6['content']['add'](_0x48cf24);const _0x552640=this['_createBalloonResourcesView'](_0x3ad34f);_0x42cad6['content']['add'](_0x552640);}['_createBalloonHeader'](_0x6a1826,_0x110678){const _0xceee99=this['_createBackButton'](_0x6a1826),_0x45453e=new _0x3197a7(this['_locale'],{'label':_0x110678['label'],'class':Va});return _0x45453e['children']['add'](_0xceee99,0x0),_0x45453e;}['_createBackButton'](_0x43b945){const _0x36fabb=new tt(this['_locale']);return _0x36fabb['set']({'icon':ht,'tooltip':u(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Ua}),_0x36fabb['on']('execute',()=>{_0x43b945['hide'](),this['_config']['onBackToContext']();}),_0x36fabb;}['_createBalloonResourcesView'](_0x4cc77a){const _0x58f2d1=new Zo(this['_locale'],{'source':_0x4cc77a,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x58f2d1['on']('loadSourceResources',(_0x2c466c,_0x41d90e)=>{this['_config']['onLoadSourceResources'](_0x41d90e);}),_0x58f2d1['on']('addResourceToContext',(_0xb9d0d2,_0x264929)=>{this['_config']['onResourceSelected'](_0x264929['source'],_0x264929['resource']),this['closeSourceResourceBalloon'](_0x4cc77a['id']);}),_0x58f2d1;}['_getResourcesViewFromBalloon'](_0x184ac9){const _0x5a6ca9=_0x184ac9['content']['get'](0x1);return _0x5a6ca9 instanceof Zo?_0x5a6ca9:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x10e5c5){ts({'emitter':_0x10e5c5,'contextElements':[_0x10e5c5['element']],'callback':()=>{_0x10e5c5['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x10e5c5['isVisible']});}}const as=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],po='ck-ai-chat-context-controls',Bo='ck-ai-chat-context-controls__pending-contexts',bo='ck-ai-chat-context-controls__add-context-balloon-panel',To='ck-ai-chat-context-controls__add-context-button',Ao='ck-ai-chat-context-controls__url-balloon-panel',ko='ck-ai-chat-context-controls__balloon-button',Eo='ck-ai-chat-context-controls__balloon-button-source',vo='ck-ai-chat-controls-button',Vo='ck-ai-chat-context-chips-wrapper-balloon',go='ck-ai-chat-controls_context_show-more-button',fo='ck-ai-chat-context-controls__show-more-balloon-panel',Io='ck-ai-chat',Po=[_0x5266db['defaultPositions']['northArrowSouthWest'],_0x5266db['defaultPositions']['northArrowSouth'],_0x5266db['defaultPositions']['northArrowSouthEast'],_0x5266db['defaultPositions']['southArrowNorthWest'],_0x5266db['defaultPositions']['southArrowNorth'],_0x5266db['defaultPositions']['southArrowNorthEast']];class os extends st{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x1facf9,_0x317e26){super(_0x1facf9),this['bodyCollection']=_0x317e26['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1facf9),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1facf9),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1facf9),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1facf9,_0x317e26);const _0x2dad1a={'cssClasses':{'showMoreButton':go,'showMoreBalloon':fo,'overflowContainer':Vo,'controlsButton':vo}};this['_overflowManager']=new mo(_0x1facf9,this['_currentContextsChips'],_0x2dad1a,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'](_0x198803,_0x16d0e6){const _0xaf3e47=this['_createContextButton'](_0x198803,'current',!0x0,_0x16d0e6);this['_addContextToCollection'](_0xaf3e47,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x5edf61){this['_removeContextFromCollection'](_0x5edf61,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x5edf61,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x4bc19b,_0x379255){let _0x28f825=this['_currentContextsChips']['find'](_0x31711b=>_0x31711b['id']===_0x4bc19b);_0x28f825||(_0x28f825=this['_overflowManager']['overflowChips']['find'](_0x263e5c=>_0x263e5c['id']===_0x4bc19b)),_0x28f825&&(_0x28f825['isLoading']=_0x379255);}['setConversationContext'](_0x338792){this['_conversationContextsChips']['clear']();for(const _0x223f14 of _0x338792){const _0x2e064c=this['_createContextButton'](_0x223f14,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x2e064c,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x52ec06,_0x4616cd,_0x44920b){this['_resourcesBalloonView']['updateResourceState'](_0x52ec06,_0x4616cd,_0x44920b);}['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'](_0x100513){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x100513),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x3590a9,_0x54292c,_0x1169c0,_0x38c7c1){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x3590a9,_0x1169c0,_0x38c7c1);}['closeSourceResourceBalloon'](_0x409a1f){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x409a1f),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x1ccda){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x1ccda),this['_setAddContextButtonEnabled'](_0x1ccda);}['_setAddContextButtonEnabled'](_0x224990){const _0x2aa1f9=!_0x224990['document']['isHidden']&&_0x224990['document']['enabled'],_0x340d04=_0x224990['urls']['enabled'],_0x47ff07=_0x224990['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x2aa1f9||_0x340d04||_0x47ff07;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[po,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Bo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x330985){const _0x323872=new tt(_0x330985);return _0x323872['set']({'label':u(_0x330985,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':vo+'\x20'+To,'icon':_0x406574,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x323872;}['_createAddContextBalloonPanelView'](_0x479ad7){return this['_createBaseBalloonPanel'](_0x479ad7,bo);}['_createUrlBalloonPanelView'](_0x58b45b){const _0x306547=this['_createBaseBalloonPanel'](_0x58b45b,Ao);return this['_addUrlContent'](_0x306547,_0x58b45b),_0x306547;}['_createResourcesBalloonView'](_0x52d676,_0x3875b3){const _0x11a645={'searchInputVisibleFrom':_0x3875b3['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Po});},'onResourceSelected':(_0x5c11d2,_0x952b20)=>{this['fire']('addResourceToContext',{'source':_0x5c11d2,'resource':_0x952b20});},'onLoadSourceResources':_0x301245=>{this['fire']('loadSourceResources',_0x301245);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new wo(_0x52d676,_0x3875b3['bodyCollection'],_0x11a645);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Io)||document['body'];}['_createBaseBalloonPanel'](_0x442a09,_0x234ac8){const _0x2853c0=new _0x5266db(_0x442a09);return _0x2853c0['extendTemplate']({'attributes':{'class':_0x234ac8}}),this['bodyCollection']['add'](_0x2853c0),_0x2853c0;}['_setBalloonPanelContent'](_0x260295,_0x59665c,_0x452813){if(_0x260295['content']['clear'](),!_0x452813['document']['isHidden']&&_0x452813['document']['enabled']){const _0x51f68a=this['_createBalloonButton'](_0x59665c,{'label':u(_0x59665c,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x3239bf});_0x51f68a['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x260295['content']['add'](_0x51f68a);}if(_0x452813['urls']['enabled']){const _0x31cb2b=this['_createBalloonButton'](_0x59665c,{'label':u(_0x59665c,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x231b46});_0x31cb2b['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Po}),this['_urlInputView']['focus']();}),_0x260295['content']['add'](_0x31cb2b);}if(_0x452813['files']['enabled']){const _0x55bb75=new _0x51e7ac(_0x59665c);_0x55bb75['set']({'label':u(_0x59665c,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x741164,'withText':!0x0,'tooltip':!0x0,'class':ko,'allowMultipleFiles':!0x0}),_0x55bb75['on']('done',(_0x35a0cf,_0x47d550)=>{this['fire']('addFileToContext',_0x47d550),this['hideAddContextBalloonPanel']();}),_0x55bb75['tooltip']=!0x0,_0x260295['content']['add'](_0x55bb75);}for(const _0x5bb5ba of _0x452813['sources']){const _0x3946fb=this['_createBalloonButton'](_0x59665c,{'label':_0x5bb5ba['label'],'icon':_0x5bb5ba['icon']||_0x172800,'type':'source'});_0x260295['content']['add'](_0x3946fb),_0x3946fb['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x5bb5ba);});}}['_addUrlContent'](_0x59336e,_0x1a1e60){this['_urlInputView']=new xo(_0x1a1e60),this['_urlInputView']['on']('submitUrl',(_0x494cef,_0xb1f262)=>{this['_handleUrlSubmit'](_0xb1f262);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Po});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Po});}),_0x59336e['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x2bfd46,_0x2c69f4){const _0x3948e1='source'===_0x2c69f4['type']?new Ga(_0x2bfd46):new tt(_0x2bfd46);return _0x3948e1['set']({'label':_0x2c69f4['label'],'icon':_0x2c69f4['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':ko}),_0x3948e1;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){ts({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x5dbe51){const _0x59b7a2=this['_addContextBalloonConfig'];_0x59b7a2['buttonView']['isOn']=_0x5dbe51,_0x5dbe51?_0x59b7a2['balloonView']['show']():_0x59b7a2['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x44bffc,buttonView:_0x515530,hideMethod:_0x1803bc}=this['_addContextBalloonConfig'];ts({'emitter':_0x44bffc,'contextElements':[_0x44bffc['element'],_0x515530['element']],'callback':()=>{_0x1803bc();},'activator':()=>_0x515530['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x335b91,_0x4366c3,_0x249afc=!0x1,_0x511db9=!0x1){const _0x41f6ae='conversation'===_0x4366c3||!0x0===_0x335b91['isReadOnly'],_0x4823b4=new Co(this['locale'],_0x335b91,_0x41f6ae,_0x249afc,_0x511db9);return _0x41f6ae||_0x4823b4['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x4823b4['id']);}),_0x4823b4;}['_addContextToCollection'](_0x1d0feb,_0xe5c30d){_0xe5c30d['add'](_0x1d0feb,0x0);}['_removeContextFromCollection'](_0x4a3f91,_0x52bae3){const _0x4812e6=_0x52bae3['find'](_0x31aaf7=>_0x31aaf7['id']===_0x4a3f91);_0x4812e6&&_0x52bae3['remove'](_0x4812e6);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Po}));}['_handleUrlSubmit'](_0xeabbfe){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0xeabbfe);}}class Ga extends tt{['arrowView'];constructor(_0x489e8a){super(_0x489e8a),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Eo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x4e5583=new _0x202d8c();return _0x4e5583['content']=_0x821572,_0x4e5583['extendTemplate']({'attributes':{'class':Eo+'__arrow'}}),_0x4e5583;}}class rs extends st{['_cancelButtonView'];['_loaderView'];constructor(_0x5d772c){super(_0x5d772c),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 _0x427c74=new tt(this['locale']);return _0x427c74['set']({'label':u(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0xcdaaf6}),_0x427c74['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x427c74;}['_createLoaderView'](){const _0x34822b=new st(this['locale']);return _0x34822b['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':u(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x34822b;}}class Ri extends st{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x49e261,_0x13fb38){super(_0x49e261),this['_contextPanelView']=this['_createContextPanelView'](_0x49e261,{'bodyCollection':_0x13fb38['bodyCollection'],'searchInputVisibleFrom':_0x13fb38['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x49e261),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x49e261),this['_loaderView']=this['_createLoaderView'](_0x49e261),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x49e261),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...as)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x100f72=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x100f72['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x100f72['if']('isLoading','ck-hidden',_0x5da2ff=>_0x5da2ff||!this['isModelAvailable']),_0x100f72['if']('isModelAvailable','ck-hidden',_0x5b321e=>!_0x5b321e||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x100f72['if']('isLoading','ck-hidden',_0x588095=>!_0x588095)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x100f72['if']('isModelAvailable','ck-hidden',_0x52cca3=>_0x52cca3)]},'children':[this['_modelUnavailableMessageView']]}]}),ts({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x444446,_0x3d0609){return new os(_0x444446,_0x3d0609);}['_createPromptInputView'](_0x4fb90d){return new es(_0x4fb90d,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x2b97f7){return new is(_0x2b97f7);}['_createLoaderView'](_0x4f92ae){return new rs(_0x4f92ae);}['_createModelUnavailableMessageView'](_0x13b823){const _0x465d46=new hs(_0x13b823);return _0x465d46['delegate']('startConversation')['to'](this),_0x465d46;}['_handlePromptInputFocus'](_0x43f88e,_0x2b2131,_0x25d062){_0x25d062?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x6a48f1,_0x593a81){this['_contextPanelView']['addContextItem'](_0x6a48f1,_0x593a81);}['removeContextItem'](_0x543dbb){this['_contextPanelView']['removeContextItem'](_0x543dbb);}['setContextItemLoading'](_0x5d212,_0x55e9bf){this['_contextPanelView']['setContextItemLoading'](_0x5d212,_0x55e9bf);}['setIsUploadInProgress'](_0x158bbb){this['_promptInputView']['setIsUploadInProgress'](_0x158bbb);}['setConversationContext'](_0x26aabc){this['_contextPanelView']['setConversationContext'](_0x26aabc);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x357500,_0x4fa0eb,_0x5dc1d4){this['_contextPanelView']['updateResourceState'](_0x357500,_0x4fa0eb,_0x5dc1d4);}['setWebSearch'](_0x5a3a01){this['_promptCapabilitiesView']['setWebSearch'](_0x5a3a01);}['setReasoning'](_0x5d739f){this['_promptCapabilitiesView']['setReasoning'](_0x5d739f);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x49dda8){this['_contextPanelView']['setAddContextOptions'](_0x49dda8);}['setInputPlaceholder'](_0x4d2944){this['_promptInputView']['setPlaceholderText'](_0x4d2944);}['setModelList'](_0x3f0eee,_0x46c8d0){this['_displayedModels']=_0x3f0eee,this['_promptCapabilitiesView']['setModelList'](_0x3f0eee,_0x46c8d0);}['setModel'](_0x39d32a){(_0x39d32a?this['_displayedModels']['find'](_0x488b65=>_0x488b65['id']===_0x39d32a['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x39d32a)):_0x39d32a?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x617d28){this['_promptCapabilitiesView']['disableModelSelector'](_0x617d28);}['populateSourceResourceBalloon'](_0xbf7de6,_0x3c2849,_0x322858,_0x3c25ff){this['_contextPanelView']['populateSourceResourceBalloon'](_0xbf7de6,_0x3c2849,_0x322858,_0x3c25ff);}['closeSourceResourceBalloon'](_0x3212ed){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3212ed);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class hs extends st{constructor(_0x3fd5b4){super(_0x3fd5b4);const _0x28e598=new tt(_0x3fd5b4);_0x28e598['set']({'label':u(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x28e598['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':u(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x28e598]}]});}}class Si extends _0x3197a7{['conversationStartButton'];['resizeButton'];constructor(_0x23bf9e,_0x551e5d){super(_0x23bf9e,{'label':u(_0x23bf9e,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x24f2cd}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x23bf9e),this['children']['add'](this['conversationStartButton']),_0x551e5d&&(this['resizeButton']=ms(_0x23bf9e,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x34f880){const _0x14ccf3=new tt(_0x34f880);return _0x14ccf3['set']({'label':u(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x396e8a,'class':'ck-ai-chat__start-conversation'}),_0x14ccf3['on']('execute',()=>{this['fire']('startConversation');}),_0x14ccf3;}}class Bi extends st{constructor(_0x3cd454){super(_0x3cd454),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':u(_0x3cd454,'AI_DISCLAIMER_TEXT')}]}]});}}class H extends st{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0xb48a52,_0x4988a6){super(_0xb48a52),this['_bodyCollection']=new Et(_0xb48a52),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Si(_0xb48a52,_0x4988a6['showResizeButton']),this['chatHeader']['delegate'](...j)['to'](this),this['chatFeed']=new ki(_0xb48a52,this['_bodyCollection']),this['chatFeed']['delegate'](...j)['to'](this),this['chatControls']=new Ri(_0xb48a52,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x4988a6['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...j)['to'](this),this['chatDisclaimer']=new Bi(_0xb48a52),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0xb48a52['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x28221d,_0x14ea4c,_0x25aaef,_0x5ee734){this['chatControls']['populateSourceResourceBalloon'](_0x28221d,_0x14ea4c,_0x25aaef,_0x5ee734);}['closeSourceResourceBalloon'](_0x2cc574){this['chatControls']['closeSourceResourceBalloon'](_0x2cc574);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class s extends _0x47d85c{static get['requires'](){return[g];}['_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(_0x19f6bc){super(_0x19f6bc);const _0xfb4713=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new G(),this['_view']=new H(this['context']['locale'],{'showResizeButton':_0xfb4713['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...j)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x3f0321,{showDiff:_0x4b66f3})=>{this['showDiff']=_0x4b66f3;}),_0xfb4713['view']['addTab']({'id':'chat','buttonLabel':u(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x24f2cd,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0xe0c6d=>_0xe0c6d),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x42a84e=>_0x42a84e),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x24f922){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x24f922['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':u(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x3966fa,staticMessage:_0x213b41}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3966fa,'initialContent':'<p>'+_0x213b41+'</p>'});}['addFeedItemUserMessage'](_0x3a0f22){const _0x205c41=_0x3a0f22['quickActionData']?.['displayedPrompt']||_0x3a0f22['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x3a0f22['contextItems']['values']()),'initialContent':'<p>'+_0x205c41+'</p>','id':_0x3a0f22['id']});}['addFeedItemError']({errorMessage:_0x322d8f,id:_0x3959e4}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x322d8f+'</p>','id':_0x3959e4});}['addFeedItemAIReply'](_0x38825c){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x38825c['interactionId']+':'+_0x38825c['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x3b840f){const _0x3a3669=_(this['context']);let _0x19a3d1=_0x3a3669['config']['get']('ai.availableReplyActions')||[...f];if(_0x3a3669['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x448937=_0x3a3669['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x448937,'value');}}else _0x19a3d1=_0x19a3d1['filter'](_0x41e9f0=>'insertSuggestion'!=_0x41e9f0);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x3b840f['interactionId']+':'+_0x3b840f['id'],'areActionsDisabled':_0x3b840f['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x19a3d1}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x1553b4,_0x1064a7){const _0x3269ee=this['_view']['chatFeed']['children']['last'];if(_0x3269ee instanceof F)return this['_view']['chatFeed']['children']['remove'](_0x3269ee),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1553b4['id'],'capabilities':{'isWebSearchEnabled':_0x3269ee['capabilities']['isWebSearchEnabled']||_0x1064a7['isWebSearchEnabled'],'isReasoningEnabled':_0x3269ee['capabilities']['isReasoningEnabled']||_0x1064a7['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1553b4['id'],'capabilities':_0x1064a7});}['updateFeedInteractionHeader'](_0x16ebf1){const _0x425c50=this['_view']['chatFeed']['children']['find'](_0x2226fd=>_0x2226fd['options']['id']==_0x16ebf1['id']&&_0x2226fd instanceof F);_0x425c50&&_0x425c50['set']('isVisible',_0x16ebf1['isVisible']);}async['updateFeedItemAIReplyContent'](_0x441e1b){const _0x706f12=_0x441e1b['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1828e7=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x441e1b,'abortSignal':_0x1828e7,'renderingStrategy':_0x706f12}),_0x441e1b['isDone']&&this['markFeedItemAsDone'](_0x441e1b['id']);});}['updateFeedItemAIReplySources'](_0x424b95,_0x1ecd8e){this['_view']['chatFeed']['updateWebSources'](_0x424b95,_0x1ecd8e);}async['updateFeedItemAIReplySuggestionContent'](_0x5f04b9){const _0x1635bd=_0x5f04b9['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x26a133=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x5f04b9,'abortSignal':_0x26a133,'renderingStrategy':_0x1635bd}),_0x5f04b9['isDone']&&this['markFeedItemAsDone'](_0x5f04b9['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x2cec12){this['_view']['chatFeed']['updateSuggestionPartState'](_0x2cec12);}['markFeedItemAsDone'](_0x1e9191){this['_view']['chatFeed']['markItemAsDone'](_0x1e9191);}['removeFeedInteraction'](_0x3d0a36){this['_view']['chatFeed']['getItemIds']()['filter'](_0x2cc62b=>_0x2cc62b['startsWith'](_0x3d0a36))['forEach'](_0x30d9ad=>this['_view']['chatFeed']['removeItem'](_0x30d9ad));}['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'](_0xf3620b){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x1d2413=>_0x1d2413['startsWith'](_0xf3620b['id']))['forEach'](_0x11fa8c=>this['markFeedItemAsDone'](_0x11fa8c)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x58cc8a,_0x45e281){this['_view']['chatControls']['addContextItem'](_0x58cc8a,_0x45e281);}['removeContextItem'](_0xd18234){this['_view']['chatControls']['removeContextItem'](_0xd18234);}['setContextItemLoading'](_0x3eefd6,_0x1f4c4f){this['_view']['chatControls']['setContextItemLoading'](_0x3eefd6,_0x1f4c4f);}['setIsUploadInProgress'](_0x440002){this['_view']['chatControls']['setIsUploadInProgress'](_0x440002);}['setConversationContext'](_0x248918){this['_view']['chatControls']['setConversationContext'](_0x248918);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x8090fd,_0x37f77d,_0x435f9d){this['_view']['chatControls']['updateResourceState'](_0x8090fd,_0x37f77d,_0x435f9d);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x1a21ea){this['_view']['chatControls']['setAddContextOptions'](_0x1a21ea);}['updateCapabilities'](_0x4a3ec8){this['_view']['chatControls']['setWebSearch'](_0x4a3ec8['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x4a3ec8['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x4a3ec8));}['setSelectedModel'](_0x397873,_0x149936){this['_view']['chatControls']['setModel'](_0x397873),_0x149936&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x181c7e){this['feedItemRenderingStrategy']=_0x181c7e;}['toggleLoadingSkeleton'](_0x739596){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x739596);}['resetConversationTitle'](){this['setConversationTitle'](u(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x5f0669,_0x4b7a3e=!0x1){if(_0x4b7a3e&&!_0x4ec3fa()&&_0x5f0669['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x5f0669);this['_view']['chatHeader']['label']=_0x5f0669;}['setLoadingMessage'](_0x3e726f){const _0x3c3c8e=this['_getLoadingMessage'](_0x3e726f);this['_view']['chatFeed']['setLoadingMessage'](_0x3c3c8e);}['_animateConversationTitle'](_0x29969d){let _0x210d59=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x29969d[_0x210d59],_0x210d59++,_0x210d59===_0x29969d['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x167c8e){this['_view']['chatHeader']['isMaximized']=_0x167c8e;}['_getLoadingMessage'](_0x232203){return _0x232203?_0x232203['isWebSearchEnabled']&&_0x232203['isReasoningEnabled']?u(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x232203['isWebSearchEnabled']?u(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x232203['isReasoningEnabled']?u(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):u(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x41743e){return _0x41743e?_0x41743e['isWebSearchEnabled']&&_0x41743e['isReasoningEnabled']?u(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x41743e['isWebSearchEnabled']?u(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x41743e['isReasoningEnabled']?u(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):u(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):u(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x43923f,_0x2b737e,_0xe8a29,_0x881d94){this['_view']['populateSourceResourceBalloon'](_0x43923f,_0x2b737e,_0xe8a29,_0x881d94);}['closeSourceResourceBalloon'](_0x56fc8b){this['_view']['closeSourceResourceBalloon'](_0x56fc8b);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0xf4f336,_0x2a2dfd){this['_view']['chatFeed']['scrollToSuggestion'](_0xf4f336,_0x2a2dfd);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Wi extends _0x493f65{['sections'];constructor(_0x5947fb,_0xaeada8){super(_0x5947fb),this['sections']=_0xaeada8,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5479bb){let _0x3b8050=0x0,_0x31d626=0x0;for(const _0x4a776b of this['sections']){const {resultsCount:_0x4e40c7,totalItemsCount:_0x8125a}=_0x4a776b['filter'](_0x5479bb);_0x3b8050+=_0x4e40c7,_0x31d626+=_0x8125a;}return{'resultsCount':_0x3b8050,'totalItemsCount':_0x31d626};}}class qi extends _0x5374ac{['title'];['itemsViews'];['_itemsListView'];constructor(_0x482a30,{title:_0xcccba6,items:_0x45fcfd}){super(_0x482a30);const _0x3e95e5=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0xcccba6,this['itemsViews']=_0x45fcfd;const _0x546564=new st(_0x482a30);_0x546564['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x493f65(_0x482a30),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x3e95e5['if']('isVisible','ck-hidden',_0x1ec58b=>!_0x1ec58b)]},'children':[_0x546564,this['_itemsListView']]});}['filter'](_0x3faa11){const _0x54abf9=this['itemsViews']['length'];let _0x115942=0x0;for(const _0x5a8f0e of this['itemsViews']){if(_0x3faa11){const _0x454937=_0x5a8f0e['isMatching'](_0x3faa11);_0x5a8f0e['isVisible']=!!_0x454937,_0x5a8f0e['highlightText'](_0x3faa11);}else _0x5a8f0e['isVisible']=!0x0,_0x5a8f0e['highlightText'](null);_0x5a8f0e['isVisible']&&_0x115942++;}return this['isVisible']=_0x115942>0x0,{'resultsCount':_0x115942,'totalItemsCount':_0x54abf9};}['getItem'](_0x2a464e){return this['itemsViews']['find'](_0x4b79cf=>_0x4b79cf['id']===_0x2a464e);}['removeItem'](_0x4fac9c){const _0x88db6a=this['itemsViews']['indexOf'](_0x4fac9c);-0x1!==_0x88db6a&&(this['itemsViews']['splice'](_0x88db6a,0x1),this['_itemsListView']['items']['remove'](_0x4fac9c));}}class Ji extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x184722(_0x5374ac){['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(_0x3b2c05,_0x3462d3){super(_0x3b2c05);const _0x251e3d=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3462d3['pinned']),this['set']('loadingState',null),this['id']=_0x3462d3['id'];const {title:_0x498b29,createdAt:_0x203a0a,active:_0x59d070=!0x1}=_0x3462d3;this['_titleView']=new _0x393c5c(),this['_titleView']['text']=_0x498b29,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x39fbf6=this['_createCheckView'](),_0x5cb02c=this['_createPinButtonView'](_0x3b2c05),_0x1b2190=this['_createMenuDropdownView'](),_0x385f0e=this['_createEditInputView'](_0x3b2c05,_0x498b29),_0x1ac58e=this['_createAcceptEditButtonView'](_0x3b2c05,_0x385f0e),_0x487da8=this['_createCancelEditButtonView'](_0x3b2c05,_0x385f0e);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x5cb02c),this['actions']['add'](_0x1b2190),this['on']('change:isEdit',(_0xb3e05a,_0xbc4a47,_0x533516)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x533516?(this['actions']['add'](_0x1ac58e),this['actions']['add'](_0x487da8),this['mainContent']['add'](_0x385f0e),_0x385f0e['element']['focus']()):(this['actions']['add'](_0x5cb02c),this['actions']['add'](_0x1b2190),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x59d070?'ck-ai-chat-history__item--active':'',_0x251e3d['if']('isVisible','ck-hidden',_0x3c4e58=>!_0x3c4e58),_0x251e3d['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',_0x251e3d['if']('loadingState','ck-hidden',_0x1e8eb4=>!!_0x1e8eb4)]},'children':_0x59d070?[_0x39fbf6]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x251e3d['if']('loadingState','ck-hidden',_0x37cbaa=>!_0x37cbaa)]},'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',_0x251e3d['if']('loadingState','ck-hidden',_0x3b2221=>!!_0x3b2221)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x251e3d['if']('loadingState','ck-hidden',_0x23dc27=>!_0x23dc27)]},'children':[{'text':_0x251e3d['to']('loadingState',_0x2ea993=>_0x2ea993?u(this['locale'],Ji['LOADING_LABELS'][_0x2ea993]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x203a0a]}]},{'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'](_0x2f1419){this['_titleView']['text']=Xt(_0x2f1419);}['updateLoadingState'](_0x3c3b5f,_0x11ab4a){this['set']('loadingState',_0x11ab4a?_0x3c3b5f:null);}['_createCheckView'](){const _0x2fd686=new _0x202d8c();return _0x2fd686['set']({'content':_0x4ffa92}),_0x2fd686;}['_createPinButtonView'](_0x1c9b02){const _0x3b0042=new tt(_0x1c9b02);return _0x3b0042['set']({'label':u(_0x1c9b02,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x35042a,'withText':!0x1,'tooltip':!0x0}),_0x3b0042['bind']('isOn')['to'](this,'pinned'),_0x3b0042['on']('execute',()=>{const _0x5c2305=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x5c2305});}),_0x3b0042;}['_createMenuDropdownView'](){const _0x1f4db1=_0x3e6542(this['locale'],_0x1991f7),_0x2e1a1c=_0x1f4db1['panelView']['children'];_0x1f4db1['buttonView']['set']({'label':u(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x13de8d}),_0x1f4db1['panelPosition']='sw';const _0x4cf004=new tt(this['locale']);_0x4cf004['label']=u(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x4cf004['withText']=!0x0,_0x4cf004['on']('execute',()=>{this['isEdit']=!0x0;});const _0xc6289e=new tt(this['locale']);_0xc6289e['label']=u(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0xc6289e['withText']=!0x0,_0xc6289e['on']('execute',()=>{this['showConfirm'](u(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x38b7ee=new _0x493f65(this['locale']),_0x18b63d=new _0x5374ac(this['locale']);_0x18b63d['children']['add'](_0x4cf004);const _0x5d596=new _0x5374ac(this['locale']);return _0x5d596['children']['add'](_0xc6289e),_0x38b7ee['items']['addMany']([_0x18b63d,_0x5d596]),_0x2e1a1c['add'](_0x38b7ee),_0x1f4db1;}['_createEditInputView'](_0x267269,_0x195e83){const _0x4d42da=new _0x34a65d(_0x267269),_0x534b3f=_0x4d42da['bindTemplate'];return _0x4d42da['value']=_0x195e83,_0x4d42da['extendTemplate']({'on':{'keydown':_0x534b3f['to'](_0x5a1583=>{'Enter'==_0x5a1583['key']&&this['_commitEditInputValue'](_0x4d42da);})}}),_0x4d42da;}['_createAcceptEditButtonView'](_0x5992a0,_0x23e1a9){const _0x3cc36c=new tt(_0x5992a0);return _0x3cc36c['set']({'icon':_0x4ffa92,'withText':!0x1,'tooltip':u(_0x5992a0,'AI_CHAT_HISTORY_ACCEPT')}),_0x3cc36c['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x3cc36c['on']('execute',()=>{this['_commitEditInputValue'](_0x23e1a9);}),_0x3cc36c;}['_commitEditInputValue'](_0xf57bac){const _0x294cdc=_0xf57bac['element']['value']||'';this['_titleView']['text']=_0x294cdc,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x294cdc});}['_createCancelEditButtonView'](_0x961e72,_0xab14ee){const _0x428fd8=new tt(_0x961e72);return _0x428fd8['set']({'icon':_0x88b984,'withText':!0x1,'tooltip':u(_0x961e72,'AI_CHAT_HISTORY_CANCEL')}),_0x428fd8['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x428fd8['on']('execute',()=>{this['isEdit']=!0x1,_0xab14ee['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x428fd8;}['_createSpinnerView'](){const _0x5ad2e8=new be('tiny');return _0x5ad2e8['isVisible']=!0x0,_0x5ad2e8;}['isMatching'](_0xb15863){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0xb15863)?{'title':!0x0}:null;}['highlightText'](_0x11c9c4){this['_titleView']['highlightText'](_0x11c9c4);}}class W extends st{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x8197c4,_0x55e262){super(_0x8197c4),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0xd44881=new _0x3197a7(_0x8197c4,{'label':u(_0x8197c4,'AI_CHAT_HISTORY_HEADING'),'icon':_0x30fbfe,'class':'ck-ai-header\x20ck-ai-header_history'});_0x55e262&&(this['resizeButton']=ms(_0x8197c4,this),_0xd44881['children']['add'](this['resizeButton'])),this['sectionsView']=new Wi(_0x8197c4,[]),this['sectionsView']['delegate'](...Ki)['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':[_0xd44881,{'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 _0xcec1fc=new _0x10a4bf(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':u(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x36917=>u(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x36917),'secondary':u(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0xcec1fc['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0xcec1fc['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x2b0eb1=>!_0x2b0eb1)]}}),_0xcec1fc;}['_createSkeletonView'](){const _0x3049ce=new ye(this['locale'],_e['aiHistory']);return _0x3049ce['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x238620=>!_0x238620)]}}),_0x3049ce;}['_createErrorView'](){const _0x198871=new st(this['locale']),_0x3511f0=new tt(this['locale']);return _0x3511f0['set']({'withText':!0x1,'icon':_0x88b984,'class':'ck-ai-chat-error__dismiss-button'}),_0x3511f0['bind']('isVisible')['to'](this,'hasItems',_0x18a551=>!!_0x18a551),_0x3511f0['on']('execute',()=>{this['errorMessage']='';}),_0x198871['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x1bc902=>!_0x1bc902)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x3511f0]}),_0x198871;}['_createEmptyStateView'](){const _0x5388cd=new tt(this['locale']);_0x5388cd['set']({'label':u(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x396e8a,'class':'ck-ai-chat__start-conversation'}),_0x5388cd['on']('execute',()=>{this['fire']('openChat');});const _0x1835e7=new st(this['locale']);return _0x1835e7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x566df6=>!_0x566df6)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[u(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x5388cd]}),_0x1835e7;}['_createListItemViews'](_0x1317a4,_0x49e8e8){const _0x4da8ba=[];for(const _0x21523d of _0x1317a4){const _0x31a292=new Ji(_0x49e8e8,_0x21523d);_0x31a292['delegate'](...Ki)['to'](this),_0x4da8ba['push'](_0x31a292);}return _0x4da8ba;}['updateHistoryItemsWithCategories'](_0x13a7e8){const _0x574155=this['locale']||'en',_0x500f42=[];for(const _0x2ee90e of _0x13a7e8){const _0x244ab7=this['_createListItemViews'](_0x2ee90e['items'],_0x574155);_0x500f42['push'](new qi(_0x574155,{'title':_0x2ee90e['title'],'items':_0x244ab7}));}this['sectionsView']['sections']=_0x500f42,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x500f42),this['hasItems']=_0x13a7e8['some'](_0x2c1daf=>_0x2c1daf['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x34a8ca){for(const _0x421f90 of this['sectionsView']['sections']){const _0x49a952=_0x421f90['getItem'](_0x34a8ca);if(_0x49a952){if(_0x421f90['removeItem'](_0x49a952),0x0===_0x421f90['itemsViews']['length']){const _0xfa2f0e=this['sectionsView']['sections']['indexOf'](_0x421f90);-0x1!==_0xfa2f0e&&(this['sectionsView']['sections']['splice'](_0xfa2f0e,0x1),this['sectionsView']['items']['remove'](_0x421f90));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x3d7d18,_0x1c7652){for(const _0x328464 of this['sectionsView']['sections']){const _0x314214=_0x328464['getItem'](_0x3d7d18);if(_0x314214){_0x314214['updateTitle'](_0x1c7652);break;}}}['updateItemLoadingState'](_0x1891a6,_0x56ff76,_0x4d2155){for(const _0x307576 of this['sectionsView']['sections']){const _0x4dc064=_0x307576['getItem'](_0x1891a6);if(_0x4dc064){_0x4dc064['updateLoadingState'](_0x56ff76,_0x4d2155);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x3d7746=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x3d7746);}}}const Ki=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class K extends _0x47d85c{static get['requires'](){return[g];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x512353){super(_0x512353);const _0x2c7fdc=this['context']['plugins']['get']('AITabs');this['_historyView']=new W(this['context']['locale'],_0x2c7fdc['showResizeButton']),this['_historyView']['delegate'](...Ki)['to'](this),_0x2c7fdc['view']['addTab']({'id':'history','buttonLabel':u(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x30fbfe,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x7106f6){this['_historyView']['removeHistoryItem'](_0x7106f6);}['updateItems'](_0x2a77a8){this['_historyView']['updateHistoryItemsWithCategories'](_0x2a77a8);}['updateItemTitle'](_0x2078ac,_0x1f98d3){this['_historyView']['updateItemTitle'](_0x2078ac,_0x1f98d3);}['updateItemLoadingState'](_0x3b6d64,_0x584c68,_0x3a0ef5){this['_historyView']['updateItemLoadingState'](_0x3b6d64,_0x584c68,_0x3a0ef5);}['setLoadingSkeleton'](_0x200e78){this['_historyView']['isLoading']=_0x200e78;}['showError'](_0x3ed7b1){this['_historyView']['errorMessage']=_0x3ed7b1;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x2b10a6){this['_historyView']['isMaximized']=_0x2b10a6;}}class Ie extends qt(){['id'];['createdAt'];constructor({id:_0x49db54,title:_0x3d80cb,createdAt:_0x1fb43d,updatedAt:_0x1b6978,pinned:_0x8930b4}){super(),this['id']=_0x49db54,this['createdAt']=new Date(_0x1fb43d),this['set']('title',_0x3d80cb),this['set']('updatedAt',_0x1b6978?new Date(_0x1b6978):null),this['set']('pinned',_0x8930b4||!0x1);}['updateTitle'](_0x290935){this['set']('title',Xt(_0x290935)),this['updatedAt']=new Date();}['updatePinned'](_0x2ae655){this['set']('pinned',_0x2ae655),this['updatedAt']=new Date();}}class Y extends _0x3f6d88(){['items']=[];['connector'];['group'];constructor({connector:_0x58f11a,group:_0x593408}){super(),this['connector']=_0x58f11a,this['group']=_0x593408;}async['init'](){try{const _0x5653ea=this['connector']['fetchConversations'](this['group']),_0x9e9790=await _0x5653ea['getConversations']();this['loadItems'](_0x9e9790);}catch(_0xc14e11){this['fire']('error',{'error':_0xc14e11,'operation':'init'});}}['addItem'](_0x3d5d8b){this['items']['push'](_0x3d5d8b);}async['removeItem'](_0x53a787){const _0xdbbc0c=this['items']['findIndex'](_0x592f0b=>_0x592f0b['id']===_0x53a787);if(-0x1===_0xdbbc0c)return!0x1;try{return await this['connector']['deleteConversation'](_0x53a787)['execute'](),this['items']['splice'](_0xdbbc0c,0x1),this['fire']('itemRemoved',{'itemId':_0x53a787}),!0x0;}catch(_0x48c501){return this['fire']('error',{'error':_0x48c501,'operation':'removeItem','itemId':_0x53a787}),!0x1;}}['getItem'](_0x17c4be){return this['items']['find'](_0x275623=>_0x275623['id']===_0x17c4be);}async['updateItemTitle'](_0x33ec4e,_0xa8caae){const _0x20cd10=this['getItem'](_0x33ec4e);if(!_0x20cd10)return!0x1;try{return await this['connector']['updateConversation'](_0x33ec4e,{'title':_0xa8caae})['getResult'](),_0x20cd10['updateTitle'](_0xa8caae),this['fire']('itemUpdated',{'itemId':_0x33ec4e,'updates':{'title':_0xa8caae}}),!0x0;}catch(_0xef60c0){return this['fire']('error',{'error':_0xef60c0,'operation':'updateItemTitle','itemId':_0x33ec4e}),!0x1;}}async['updateItemPinned'](_0x2576b9,_0x2189be){const _0x4b2de7=this['getItem'](_0x2576b9);if(!_0x4b2de7)return!0x1;try{return await this['connector']['updateConversation'](_0x2576b9,{'pinned':_0x2189be})['getResult'](),_0x4b2de7['updatePinned'](_0x2189be),this['fire']('itemUpdated',{'itemId':_0x2576b9,'updates':{'pinned':_0x2189be}}),!0x0;}catch(_0x26c231){return this['fire']('error',{'error':_0x26c231,'operation':'updateItemPinned','itemId':_0x2576b9}),!0x1;}}['loadItems'](_0x338184){try{this['items']=[],_0x338184['map'](_0x451965=>{this['addItem'](new Ie(_0x451965));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x57cab0){this['fire']('error',{'error':_0x57cab0,'operation':'loadItems'});}}['getItems'](_0x32e4f1={}){const _0x1b1a93=void 0x0!==_0x32e4f1['pinned']&&_0x32e4f1['pinned'],_0x453540=_0x32e4f1['from']?new Date(_0x32e4f1['from']['getFullYear'](),_0x32e4f1['from']['getMonth'](),_0x32e4f1['from']['getDate']()):null,_0x240a2b=_0x32e4f1['to']?new Date(_0x32e4f1['to']['getFullYear'](),_0x32e4f1['to']['getMonth'](),_0x32e4f1['to']['getDate']()):null;return this['items']['filter'](_0x407fbe=>{if(_0x407fbe['pinned']!==_0x1b1a93)return!0x1;if(_0x240a2b){const _0x57a44e=new Date(_0x407fbe['createdAt']['getFullYear'](),_0x407fbe['createdAt']['getMonth'](),_0x407fbe['createdAt']['getDate']());return _0x453540?_0x453540['getTime']()===_0x240a2b['getTime']()?_0x57a44e['getTime']()===_0x453540['getTime']():_0x57a44e<_0x240a2b&&_0x57a44e>=_0x453540:_0x57a44e<_0x240a2b;}return!0x0;});}}class J extends _0x47d85c{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[l,i,K,g];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](l),this['_aiChatHistoryUi']=this['context']['plugins']['get'](K),this['_aiChatController']=this['context']['plugins']['get'](i);const _0x3775b1=this['context']['plugins']['get'](g),_0x29800f=this['_aiChatController']['getGroupId']();this['history']=new Y({'connector':this['_aiConnector'],'group':_0x29800f}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x35bced,_0x166ebf)=>{this['_setItemLoading'](_0x166ebf['id'],'remove'),this['_handleRemove'](_0x166ebf['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3f40ff,_0x50165a)=>{this['_setItemLoading'](_0x50165a['id'],'rename'),this['_handleEditTitle'](_0x50165a['id'],_0x50165a['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x455f42,_0x596273)=>{void 0x0!==_0x596273['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x596273['itemId'],_0x596273['updates']['title']),void 0x0!==_0x596273['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x596273['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x5a0c5f,_0x947f5)=>{this['_aiChatController']['handleRemovedConversation'](_0x947f5['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x947f5['itemId']),this['_clearItemLoading'](_0x947f5['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x51c7e2,_0x16c1b8)=>{this['_handleHistoryErrorUI'](_0x16c1b8['error'],_0x16c1b8['operation'],_0x16c1b8['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x97885b,_0x36f3b1)=>{this['_handleSelectConversation'](_0x36f3b1['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0xe1601b,_0x172788)=>{const _0x4f668d=_0x172788['pinned']?'pin':'unpin';this['_setItemLoading'](_0x172788['id'],_0x4f668d),this['_handleTogglePin'](_0x172788['id'],_0x172788['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x3775b1['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x3775b1['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x3775b1,'resizedTabs',(_0xbfce97,_0x1a3ab9)=>{this['_setIsMaximized'](_0x1a3ab9);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x3775b1['resize']();});}async['_handleEditTitle'](_0x13cf1a,_0x156592){await this['history']['updateItemTitle'](_0x13cf1a,_0x156592);}async['_handleTogglePin'](_0x337b50,_0x27424e){await this['history']['updateItemPinned'](_0x337b50,_0x27424e);}async['_handleRemove'](_0x221907){await this['history']['removeItem'](_0x221907);}async['_handleSelectConversation'](_0x343bb6){await this['_aiChatController']['loadConversation'](_0x343bb6);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x56aaf7=this['_aiChatController']['activeConversation']?.['id'],_0xadc03d=this['_getCategorizedItems']()['map'](_0xac9d9c=>({'title':_0xac9d9c['title'],'items':_0xac9d9c['items']['map'](_0x17f861=>({'id':_0x17f861['id'],'title':_0x17f861['title']||u(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x17f861['createdAt'])['toLocaleDateString'](),'active':_0x17f861['id']===_0x56aaf7,'pinned':_0x17f861['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0xadc03d);}['_setItemLoading'](_0x41d3d6,_0x2f4e3f){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x41d3d6,_0x2f4e3f,!0x0);}['_clearItemLoading'](_0x5eac4b){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x5eac4b,null,!0x1);}['_handleHistoryErrorUI'](_0xfaf0be,_0x5f38fc,_0x48924e){const _0x4df9d3=this['_generateErrorMessage'](_0x5f38fc,_0x48924e);this['_aiChatHistoryUi']['showError'](_0x4df9d3),_0x48924e&&this['_clearItemLoading'](_0x48924e),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x5701b6,_0x16fa1c){const _0x46e190=_0x16fa1c?this['history']['getItem'](_0x16fa1c):null,_0x28d2f2=_0x46e190?.['title']||u(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x5701b6){case'updateItemTitle':return u(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x28d2f2);case'updateItemPinned':{const _0x2fa8e4=u(this['context']['locale'],_0x46e190?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return u(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x2fa8e4,_0x28d2f2]);}case'removeItem':return u(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x28d2f2);case'init':case'loadItems':return u(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return u(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x4b8d64=new Date(),_0x4eb4fe=new Date(_0x4b8d64['getFullYear'](),_0x4b8d64['getMonth'](),_0x4b8d64['getDate']()),_0x4aa236=new Date(_0x4eb4fe);_0x4aa236['setDate'](_0x4aa236['getDate']()-0x1);const _0x49b2df=new Date(_0x4eb4fe);_0x49b2df['setDate'](_0x49b2df['getDate']()-0xe);const _0x27d787=this['history']['getItems']({'pinned':!0x0}),_0x3b8117=this['history']['getItems']({'from':_0x4eb4fe,'to':_0x4eb4fe}),_0x365c9d=this['history']['getItems']({'from':_0x4aa236,'to':_0x4aa236}),_0x26e133=this['history']['getItems']({'from':_0x49b2df,'to':_0x4aa236}),_0x35d716=this['history']['getItems']({'to':_0x49b2df}),_0x2bdd73=[];return _0x27d787['length']>0x0&&_0x2bdd73['push']({'title':u(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x27d787}),_0x3b8117['length']>0x0&&_0x2bdd73['push']({'title':u(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x3b8117}),_0x365c9d['length']>0x0&&_0x2bdd73['push']({'title':u(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x365c9d}),_0x26e133['length']>0x0&&_0x2bdd73['push']({'title':u(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x26e133}),_0x35d716['length']>0x0&&_0x2bdd73['push']({'title':u(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x35d716}),_0x2bdd73;}['_setIsMaximized'](_0xd27158){this['_aiChatHistoryUi']['setIsMaximized'](_0xd27158);}}class o extends _0x47d85c{static get['requires'](){return[J,K];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ba extends _0x47d85c{static get['requires'](){return[i,a,s,o];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3696c9){super(_0x3696c9),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'](i)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](i)['startConversation']();}async['sendMessage']({message:_0x553f51,quickActionData:_0x380697}){await this['context']['plugins']['get'](i)['sendMessage']({'message':_0x553f51,'quickActionData':_0x380697});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](i)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](i)['focusPromptInput']();}}class io extends At{constructor(_0x4ac309){super(_0x4ac309);const _0x4e4878=_0x4ac309['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4e4878,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x18bbc7=this['editor']['plugins']['get']('AITabs')['view'];_0x18bbc7['isVisible']=!_0x18bbc7['isVisible'];}}class ft extends _0x3145c9{static get['requires'](){return[g];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x316db4=this['editor'];_0x316db4['commands']['add']('toggleAi',new io(_0x316db4)),_0x316db4['ui']['componentFactory']['add']('toggleAi',()=>{const _0x512450=this['_createAIUIButton'](tt);return _0x512450['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x512450;}),_0x316db4['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x5d0fbc=this['_createAIUIButton'](Kt);return _0x5d0fbc['set']({'role':'menuitemcheckbox'}),_0x5d0fbc;});}['_createAIUIButton'](_0x35a97f){const _0x561593=this['editor'],_0x380ee6=_0x561593['commands']['get']('toggleAi'),_0x1ac5c8=new _0x35a97f(_0x561593['locale']);return _0x1ac5c8['set']({'label':u(_0x561593['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0xf6bd89,'isToggleable':!0x0}),_0x1ac5c8['bind']('isEnabled')['to'](_0x380ee6),_0x1ac5c8['bind']('isOn')['to'](_0x380ee6,'value',_0x2ded1f=>!!_0x2ded1f),this['listenTo'](_0x1ac5c8,'execute',()=>{_0x380ee6['execute']();}),_0x1ac5c8;}}class Ka extends _0x3145c9{static get['requires'](){return[ft,pt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Ot(_0x212b83,_0x42f602,_0x1d1554=!0x1,_0xd888e1=!0x0,_0xc6921a=!0x0){return()=>{const _0x4da5ec=_0x212b83['locale'],_0x49a22d=new tt(_0x4da5ec),_0x28036f=_0x49a22d['bindTemplate'];_0xc6921a&&_0x49a22d['extendTemplate']({'on':{'mouseenter':_0x28036f['to'](()=>{_0x49a22d['focus']();})}});const _0x10d72a=_0x42f602['icon']??_0x42f602['parent']?.['icon'];return _0x49a22d['set']({'label':_0x42f602['displayedPrompt'],'withText':_0x1d1554,'role':'menuitem','icon':_0xd888e1?_0x10d72a??ot:void 0x0,'tooltip':!_0x1d1554,'class':'ck-ai-quick-actions-button'}),_0x49a22d['on']('execute',()=>{_0x212b83['editing']['view']['focus'](),_0x212b83['commands']['execute']('aiQuickAction',_0x42f602);}),_0x49a22d;};}const qs='menu',ys='menuitem';class co extends st{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x49a450,_0x32bc1e,_0x4a800e,_0x29ced3){const _0x42167d=_0x49a450['locale'];super(_0x42167d),this['_bodyCollection']=_0x29ced3;const _0x4e083b=this['_createListItems'](_0x49a450,_0x32bc1e,_0x4a800e);this['optionsListView']=new _0x493f65(_0x42167d),this['optionsListView']['role']=qs,this['optionsListView']['items']['addMany'](_0x4e083b),this['focusTracker']=new _0x156d7c(),this['keystrokes']=new _0x2ec108(),this['_focusables']=_0x4e083b,this['focusCycler']=new _0x3ac126({'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':_0x42167d['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x46efb1,_0x26d642,_0x578dcb){const _0x2bdf2b=new it();return _0x26d642['forEach'](_0xf665a6=>{'actions'in _0xf665a6?_0x2bdf2b['add'](this['_createActionGroupButton'](_0x46efb1,_0xf665a6,_0x578dcb)):_0x2bdf2b['add'](this['_createActionButton'](_0x46efb1,_0xf665a6));}),_0x2bdf2b;}['_createActionButton'](_0x56e85a,_0x28caf9){const _0x4553e3=new _0x5374ac(this['locale']),_0x3d43cf=Ot(_0x56e85a,_0x28caf9,!0x0,void 0x0!==_0x28caf9['icon'])();return _0x4553e3['children']['add'](_0x3d43cf),_0x4553e3;}['_createActionGroupButton'](_0x1176a6,_0x2d4a9e,_0x3b9d00){const _0x48496b=new _0x5374ac(this['locale']),_0x589d41=new _0x38fe52(this['locale']),_0x2c7434=_0x589d41['bindTemplate'],_0x4e121e='rtl'===_0x3b9d00['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x151225=this['_createGroupActionsList'](_0x1176a6,_0x2d4a9e['actions'],_0x3b9d00);_0x589d41['set']({'label':_0x2d4a9e['label'],'withText':!0x0,'role':ys,'icon':_0x2d4a9e['icon']??ot}),_0x589d41['extendTemplate']({'on':{'mouseenter':_0x2c7434['to'](()=>{_0x589d41['focus']();})}});const _0x113117=new _0x5266db(this['locale']);return _0x113117['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x2c7434['to'](_0x10a9ec=>{_0x10a9ec['key']==_0x4e121e&&(_0x589d41['focus'](),this['_hideNestedPanel'](_0x113117));})}}),_0x589d41['bind']('isOn')['to'](_0x113117,'isVisible'),this['_bodyCollection']['add'](_0x113117),_0x113117['content']['add'](_0x151225),this['_setupGroupMenuBehavior'](_0x589d41,_0x113117),_0x48496b['children']['add'](_0x589d41),_0x48496b;}['_createGroupActionsList'](_0x3429b0,_0x3c8d02,_0x242b0c){const _0x16c202=new _0x493f65(this['locale']);return _0x16c202['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x3c8d02['forEach'](_0x1d26be=>{const _0x9a216a=new _0x5374ac(this['locale']),_0x166d2b=Ot(_0x3429b0,_0x1d26be,!0x0,!0x1)();_0x9a216a['children']['add'](_0x166d2b),_0x242b0c['focusTracker']['add'](_0x166d2b),_0x16c202['items']['add'](_0x9a216a);}),_0x16c202;}['_setupGroupMenuBehavior'](_0x5a225a,_0x6988a2){const _0xfc5edf=_0x5a225a['bindTemplate'],_0x387555='rtl'===_0x5a225a['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x5a225a['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0xfc5edf['to'](()=>{this['_showNestedPanel'](_0x6988a2,_0x5a225a);}),'mouseleave':_0xfc5edf['to'](_0x185972=>{const _0x566bee=_0x185972['relatedTarget'];this['_isMovingToNestedMenu'](_0x566bee,_0x6988a2)||this['_hideNestedPanel'](_0x6988a2);}),'keydown':_0xfc5edf['to'](_0x4ead0c=>{_0x4ead0c['key']==_0x387555&&(this['_showNestedPanel'](_0x6988a2,_0x5a225a),_0x6988a2['content']['get'](0x0)['focus']());})}}),_0x6988a2['on']('render',()=>{_0x6988a2['element']?.['addEventListener']('mouseleave',_0x25702e=>{const _0x38216a=_0x25702e['relatedTarget'];_0x5a225a['element']?.['contains'](_0x38216a)||this['_isMovingToNestedMenu'](_0x38216a,_0x6988a2)||this['_hideNestedPanel'](_0x6988a2);});});}['_showNestedPanel'](_0x121e89,_0x4a4bb4){this['_openNestedPanels']['forEach'](_0x222d43=>{_0x222d43!==_0x121e89&&_0x222d43['isVisible']&&_0x222d43['hide']();}),_0x121e89['show'](),_0x121e89['pin']({'positions':[_0x26b205['eastSouth']],'target':_0x4a4bb4['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x121e89);}['_hideNestedPanel'](_0x2e9e97){_0x2e9e97['hide'](),this['_openNestedPanels']['delete'](_0x2e9e97);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x173d6d=>_0x173d6d['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x3dbfff,_0x224fd1){if(!_0x3dbfff)return!0x1;if(_0x224fd1['element']?.['contains'](_0x3dbfff))return!0x0;const _0x25300d=_0x3dbfff;return _0x25300d['closest']&&(null!==_0x25300d['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x25300d['closest']('.ck-ai-quick-actions-group-list')||null!==_0x25300d['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function wt(_0x10c512,_0x285507,_0x2787b2,_0x28b825){return()=>{const _0x16faaf=_0x10c512['locale'],_0x5cefd2=_0x3e6542(_0x16faaf);_0x5cefd2['buttonView']['set']({'icon':_0x2787b2['icon']??ot,'label':_0x2787b2['label'],'tooltip':!0x0}),_0x5cefd2['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1c3211=new co(_0x10c512,_0x285507,_0x5cefd2,_0x28b825);return _0x5cefd2['panelView']['children']['add'](_0x1c3211),_0x5cefd2;};}const Rt='<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>',Mt='<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>',Lt='<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 It=function(_0xce8a00){return _0xce8a00['CHAT']='CHAT',_0xce8a00['ACTION']='ACTION',_0xce8a00['REVIEW']='REVIEW',_0xce8a00;}({}),Wa=function(_0x1b0ff4){return _0x1b0ff4['CHAT']='AIChat',_0x1b0ff4['ACTION']='AIActions',_0x1b0ff4['REVIEW']='AIReviewMode',_0x1b0ff4;}({});class ii extends _0x3145c9{static get['requires'](){return[Ut];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x631b57){return function(_0x4f1bc){const _0x385064=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4f1bc['uiLanguage']),_0x21509a=_0x385064||'English',_0x5588b1=[{'id':'ask-ai','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Tt},{'id':'chat-commands','label':u(_0x4f1bc,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Tt,'actions':[{'id':'explain','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Rt['replace']('%0',_0x21509a),'type':'CHAT'},{'id':'summarize','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Mt['replace']('%0',_0x21509a),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Lt['replace']('%0',_0x21509a),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Qt},{'id':'continue','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Nt},{'id':'fix-grammar','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':kt},{'id':'adjust-length','label':u(_0x4f1bc,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':yt,'actions':[{'id':'make-shorter','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':u(_0x4f1bc,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_t,'actions':[{'id':'make-tone-casual','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':u(_0x4f1bc,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':xt,'actions':[{'id':'translate-to-english','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':u(_0x4f1bc,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':u(_0x4f1bc,'AI_QUICK_ACTIONS_OTHER'),'icon':St,'actions':[]}];return _0x5588b1;}(_0x631b57);}['_getDefaultAndCustomActions'](){const _0x6215df=ii['getDefaultQuickActions'](this['editor']['locale']),_0x4ef76a=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x4f474d=>({..._0x4f474d,'icon':void 0x0}));return _0x6215df['find'](_0x757f78=>'other'===_0x757f78['id'])['actions']['push'](..._0x4ef76a),_0x6215df;}['_initializeQuickActionsComponentsAndCommands'](){const _0x4e8515=new Et(this['editor']['locale']);_0x4e8515['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x4e8515),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x4e8515);}['_initializeQuickActionsDropdown'](_0x2cdfda){this['editor']['ui']['componentFactory']['add']('aiQuickActions',wt(this['editor'],this['_quickActionsDefinition'],{'icon':ot,'label':u(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x2cdfda));}['_prepareQuickActionsDefinition'](_0x923be7){this['_quickActionsDefinition']=_0x923be7['map'](_0x909665=>{if('actions'in _0x909665){const _0x2c730d=_0x909665;return{..._0x2c730d,'actions':_0x2c730d['actions']['map'](_0x5bc979=>{const {actions:_0x249744,..._0x5115e5}=_0x2c730d;return{..._0x5bc979,'parent':_0x5115e5};})['filter'](_0x4e2f67=>this['_shouldIncludeAction'](_0x4e2f67))};}return _0x909665;})['filter'](_0x2f56af=>'actions'in _0x2f56af?_0x2f56af['actions']['length']>0x0:this['_shouldIncludeAction'](_0x2f56af));}['_shouldIncludeAction'](_0x41a738){const _0x487936=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Wa[_0x41a738['type']])&&!_0x487936['includes'](_0x41a738['id']);}['_initializeQuickActionsComponents'](_0xe9e98c){this['_quickActionsDefinition']['forEach'](_0x95e1f3=>{if('actions'in _0x95e1f3){const _0x49b257=wt(this['editor'],_0x95e1f3['actions'],_0x95e1f3,_0xe9e98c);this['editor']['ui']['componentFactory']['add'](_0x95e1f3['id'],_0x49b257),_0x95e1f3['actions']['forEach'](_0x414eb3=>{const _0x3da205=Ot(this['editor'],_0x414eb3);this['editor']['ui']['componentFactory']['add'](_0x414eb3['id'],_0x3da205);});}else{const _0x41139c=Ot(this['editor'],_0x95e1f3,!0x1,!0x0,!0x1);this['editor']['ui']['componentFactory']['add'](_0x95e1f3['id'],_0x41139c);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x41744f=>{const _0x4e9a94=new vt(_0x41744f),_0x10de04=u(_0x41744f,'AI_QUICK_ACTIONS_HEADING');_0x4e9a94['buttonView']['set']({'label':_0x10de04,'icon':ot});const _0xa7f144=new bt(_0x41744f);_0xa7f144['set']({'ariaLabel':_0x10de04,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x45202d=>{if('actions'in _0x45202d){const _0x24d224=_0x45202d,_0x321b56=new Pt(_0x41744f,_0x4e9a94),_0x202dac=new vt(_0x41744f),_0x9f7646=new bt(_0x41744f);_0x202dac['buttonView']['set']({'label':_0x24d224['label'],'icon':_0x24d224['icon']}),_0x24d224['actions']['forEach'](_0x38df20=>{const _0x4846af=new Pt(_0x41744f,_0x202dac),_0x3a0d92=new Kt(_0x41744f);_0x3a0d92['set']({'label':_0x38df20['displayedPrompt'],'icon':_0x38df20['icon'],'role':'menuitem'}),_0x3a0d92['on']('execute',()=>{this['_executeQuickAction'](_0x38df20);}),_0x3a0d92['delegate']('execute')['to'](_0x202dac),_0x4846af['children']['add'](_0x3a0d92),_0x9f7646['items']['add'](_0x4846af);}),_0x202dac['panelView']['children']['add'](_0x9f7646),_0x321b56['children']['add'](_0x202dac),_0xa7f144['items']['add'](_0x321b56);}else{const _0x8f5a6a=_0x45202d,_0x3d523b=new Pt(_0x41744f,_0x4e9a94),_0x3de32b=new Kt(_0x41744f);_0x3de32b['set']({'label':_0x8f5a6a['displayedPrompt'],'icon':_0x8f5a6a['icon'],'role':'menuitem'}),_0x3de32b['on']('execute',()=>{this['_executeQuickAction'](_0x8f5a6a);}),_0x3de32b['delegate']('execute')['to'](_0x4e9a94),_0x3d523b['children']['add'](_0x3de32b),_0xa7f144['items']['add'](_0x3d523b);}});const _0x2564d1=Object['values'](Wa)['some'](_0x2a6eb1=>this['editor']['plugins']['has'](_0x2a6eb1));return _0x4e9a94['set']({'isEnabled':_0x2564d1}),_0x4e9a94['panelView']['children']['add'](_0xa7f144),_0x4e9a94;});}['_executeQuickAction'](_0x451cd4){const _0x52f852=this['editor'];_0x52f852['editing']['view']['focus'](),_0x52f852['commands']['execute']('aiQuickAction',_0x451cd4);const _0x12940a=_0x52f852['ui']['view']['menuBarView'];_0x12940a&&_0x12940a['close']&&_0x12940a['close']();}}class ci extends At{['execute'](_0x364390){switch(this['_expandSelectionIfCollapsed'](),_0x364390['type']){case It['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x236209=u(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x51167b('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x236209});}this['_handleAIChatAction'](_0x364390);break;case It['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x228980=u(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x51167b('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x228980});}this['_handleAIActionsAction'](_0x364390);break;case It['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x955b96=u(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x51167b('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x955b96});}this['_handleAIReviewAction'](_0x364390);}}async['_handleAIChatAction'](_0x311dd0){const _0x2ef134=this['editor']['plugins']['get']('AIChat'),_0x29c00e=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x311dd0['id'])_0x29c00e['removeSelectionFromChatContext'](),await _0x2ef134['addSelectionToChatContext'](),_0x2ef134['focusPromptInput']();else await _0x2ef134['startConversation'](),_0x29c00e['removeSelectionFromChatContext'](),await _0x2ef134['addSelectionToChatContext'](),_0x2ef134['focusPromptInput'](),await _0x2ef134['sendMessage']({'message':_0x311dd0['prompt']||_0x311dd0['displayedPrompt'],'quickActionData':{'id':_0x311dd0['id'],'displayedPrompt':_0x311dd0['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x556e81=this['editor'],_0x1b2848=_0x556e81['model']['document']['selection'];if(!_0x1b2848['isCollapsed'])return;const _0x46ae53=nt(_0x1b2848['getSelectedBlocks']())||_0x556e81['model']['schema']['getLimitElement'](_0x1b2848);_0x556e81['model']['change'](_0x3065f0=>{_0x3065f0['setSelection'](_0x46ae53,'in');});}['_handleAIActionsActionLabel'](_0x125a57){return _0x125a57['parent']?.['label']&&'other'!==_0x125a57['parent']?.['id']?_0x125a57['parent']['label']+':\x20'+_0x125a57['displayedPrompt']:_0x125a57['displayedPrompt'];}async['_handleAIActionsAction'](_0x329a15){const _0x28c503=this['editor']['plugins']['get']('AIActions'),_0x545ef5=_0x329a15['prompt']?{'userMessage':_0x329a15['prompt'],'model':_0x329a15['model']}:{'actionName':_0x329a15['actionName']||_0x329a15['id'],'args':_0x329a15['args']},_0x307071=this['_handleAIActionsActionLabel'](_0x329a15);await _0x28c503['executeAction'](_0x545ef5,_0x307071,_0x329a15['icon']);}async['_handleAIReviewAction'](_0x6b8b97){console['log']('handleAIReviewAction',_0x6b8b97);}}class ti extends _0x3145c9{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x460a07=this['editor'],_0x556f90=new ci(this['editor']);if(_0x460a07['commands']['add']('aiQuickAction',_0x556f90),_0x460a07['plugins']['has']('AIChat')){const _0x19323a=this['editor']['plugins']['get']('AIChat');_0x460a07['model']['document']['selection']['on']('change:range',(_0x5d48df,_0x5230e4)=>{_0x5230e4['directChange']&&_0x19323a['removeSelectionFromChatContext']();});}}}class xe extends je{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x5aa791=this['documentContextContent']['children']['map'](_0x49cd65=>({'node':_0x49cd65,'id':D(_0x49cd65,'data-id')})),_0x32ed1c=this['parsedMergedContent']['children']['map'](_0x3e15d9=>({'node':_0x3e15d9,'id':D(_0x3e15d9,'data-id')||_0x4c8592()})),_0x1f1e13=_0x39ba65(_0x5aa791,_0x32ed1c,{'comparator':(_0x5d6d22,_0x3406bb)=>_0x5d6d22['id']==_0x3406bb['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x1f1e13['length']&&_0x1f1e13[_0x1f1e13['length']-0x1]['removed'];)_0x1f1e13['pop']();}const _0x3f930c=_0x1f1e13['map'](_0x3b6ba9=>{const _0x10118a=_0x3b6ba9['added']?'new':_0x3b6ba9['removed']?'removed':'modified';return{'node':_0x3b6ba9['value'][0x0]['node'],'type':_0x10118a,'id':_0x3b6ba9['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x3f930c,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x3f7e37,_0x295698){return _0x295698;}}class et extends xi{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x30af6e){super(_0x30af6e),this['content']=_0x30af6e['content'],this['version']=_0x30af6e['version'],this['actionName']=_0x30af6e['actionName'],this['args']=_0x30af6e['args'],this['userMessage']=_0x30af6e['userMessage'],this['model']=_0x30af6e['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':$t['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0xb436f9){const _0x37082e=new xe({'editor':this['editor'],'documentContextContent':this['content'],..._0xb436f9});return this['replies']['push'](_0x37082e),_0x37082e['delegate'](...Wt)['to'](this),this['fire']('replyCreated',_0x37082e),_0x37082e;}}class ri extends _0x3145c9{static get['requires'](){return[l,_0xee4d10,a,U,_0xfc3cc0];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new it();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x224cb7){super(_0x224cb7),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new G(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x1263c2,_0x378979,_0x3e35e6){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x568ed4,anchorData:_0xb52085}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x1263c2,_0x568ed4,_0xb52085,_0x378979,_0x3e35e6);}}const {modelFragment:_0x1a6cfc,anchorData:_0x1c6529}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x1263c2,_0x1a6cfc,_0x1c6529,_0x378979,_0x3e35e6);}['_getExecuteDataRegular'](){const _0x13a46d=this['editor']['model']['document']['selection'];if(_0x13a46d['isCollapsed']){const _0x4d5fc0=nt(_0x13a46d['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x13a46d);this['editor']['model']['change'](_0x2e172c=>{_0x2e172c['setSelection'](_0x4d5fc0,'in');});}const _0x205ae2=_0x13a46d['getFirstRange'](),_0x5a416f=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x13a46d),_0x205ae2['start'],_0x205ae2['end']),_0x362f26=_0x13a46d['getFirstRange']()['start'],_0x5984e6=new Map();let _0xf66706=_0x5a416f;for(let _0x2b048c=0x0;_0x2b048c<_0x362f26['path']['length'];_0x2b048c++)_0x5984e6['set'](_0xf66706,_0x362f26['path'][_0x2b048c]),_0xf66706=_0xf66706['getChild'](0x0);return{'modelFragment':_0x5a416f,'anchorData':_0x5984e6};}['_getExecuteDataInTable'](){const _0xbc94fe=this['editor']['model']['document']['selection'],_0x4e5302=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x40fba7=_0xbc94fe['getFirstRange']()['start']['parent']['parent'],_0x8b05d2=this['_wrapWithCommonAncestors'](_0x4e5302,this['editor']['model']['createPositionBefore'](_0x40fba7),this['editor']['model']['createPositionAfter'](_0x40fba7)),_0x17aad0=_0xbc94fe['getFirstRange']()['start'],_0x28d193=new Map();let _0x328e19=_0x8b05d2;for(let _0x2b3a62=0x0;_0x2b3a62<_0x17aad0['path']['length'];_0x2b3a62++)if(_0x28d193['set'](_0x328e19,_0x17aad0['path'][_0x2b3a62]),_0x2b3a62<_0x17aad0['path']['length']-0x1)_0x328e19=_0x328e19['getChild'](0x0);else{let _0x34a3c4=_0x328e19['nextSibling'];for(;_0x34a3c4;)_0x28d193['set'](_0x34a3c4,_0x17aad0['path'][_0x2b3a62]),_0x34a3c4=_0x34a3c4['nextSibling'];}return{'modelFragment':_0x8b05d2,'anchorData':_0x28d193};}['_executeAction'](_0x439bb2,_0x402197,_0x417dc8,_0x4ed53,_0x42d765){const _0xf11451=this['editor']['plugins']['get'](a),_0x5a3ecf=this['editor']['plugins']['get'](U),_0x11c328=this['editor']['model']['document']['selection'],_0x13a1b1=_0xf11451['modelToViewWithIds'](_0x402197),_0x22c801=this['editor']['data']['processor']['toData'](_0x13a1b1),_0x3328a1=this['editor']['model']['document']['version'],_0x348a9d=[..._0x11c328['getRanges']()];let _0x2d046c=this['editor']['config']['get']('ai.availableReplyActions')||[...f];this['editor']['plugins']['has']('TrackChanges')||(_0x2d046c=_0x2d046c['filter'](_0x5c3108=>'insertSuggestion'!=_0x5c3108));const _0x2caff6=new N(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x2d046c});return _0x5a3ecf['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x4ed53,'icon':_0x42d765||ot,'mainView':_0x2caff6,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x348a9d}),this['_setLoadingState'](_0x2caff6,_0x5a3ecf),this['listenTo'](_0x5a3ecf,'applySuggestion',()=>{this['_applyChanges'](_0x402197,_0x417dc8,!0x1);}),this['listenTo'](_0x5a3ecf,'insertSuggestion',()=>{this['_applyChanges'](_0x402197,_0x417dc8,!0x0);}),this['listenTo'](_0x5a3ecf,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x5a3ecf,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x50822a=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x2a6020=_0x50822a['changeGroups'][0x0];_0x2a6020&&'pending'===_0x2a6020['state']&&_0x50822a['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x5a3ecf);}),this['_createInteraction'](_0x22c801,_0x3328a1,_0x2caff6,_0x5a3ecf,_0x439bb2);}['_wrapWithCommonAncestors'](_0x570b03,_0x3aa67f,_0x14b218){const _0x470102=this['editor']['model']['createRange'](_0x3aa67f,_0x14b218)['getCommonAncestor'](),_0xe34c86=_0x470102['is']('documentFragment')?[]:_0x470102['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0xe34c86['length']){const _0x54dd30=_0xe34c86['map'](_0x4248d4=>_0x4248d4['_clone'](!0x1));for(let _0x2fee3d=0x1;_0x2fee3d<_0x54dd30['length'];_0x2fee3d++)_0x54dd30[_0x2fee3d-0x1]['_appendChild'](_0x54dd30[_0x2fee3d]);return _0x54dd30[_0x54dd30['length']-0x1]['_appendChild'](_0x570b03),new ut(_0x54dd30[0x0]);}return _0x570b03;}async['_createInteraction'](_0x27c2bd,_0x4425fb,_0x4123e5,_0xcc738a,_0x42a412){const _0x5a7da0=this['editor'];this['_interactionParams']={'action':_0x42a412,'content':_0x27c2bd,'version':_0x4425fb,'mainView':_0x4123e5,'aiBalloon':_0xcc738a};const _0x3b25e4=new et({'connector':this['_aiConnector'],'editor':_0x5a7da0,'content':_0x27c2bd,'version':_0x4425fb,..._0x42a412});this['_interactions']['push'](_0x3b25e4),_0x4123e5['hideError']();const _0xa629e0=(_0x82089,_0x125b2c,_0x3e8a01=!0x1,_0x481f78='streaming')=>this['_promiseQueue']['enqueue'](async _0x337fe2=>{try{const _0xb673c1=lt({'editor':_0x5a7da0,'changeGroups':_0x82089['changeGroups'],'documentContextContent':_0x82089['documentContextContent'],'showDiff':_0x3e8a01,'trimUnchanged':!0x1});await _0x125b2c['updateContent']({'parts':_0xb673c1,'renderingStrategy':_0x481f78,'abortSignal':_0x337fe2});}catch(_0x1962bd){if(this['_isAbortError'](_0x1962bd))return;throw _0x1962bd;}});this['_interaction']['on']('replyCreated',(_0x212b26,_0x471359)=>{_0x4123e5['hideLoader'](),_0xa629e0(_0x471359,_0x4123e5)['catch'](_0x50f5bd=>{this['_isAbortError'](_0x50f5bd)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x50f5bd),this['_setErrorState'](_0x3b25e4,_0x4123e5));});}),this['_interaction']['on']('replyContentUpdated',(_0x445f6c,_0xf5bb6e)=>{_0xa629e0(_0xf5bb6e,_0x4123e5)['catch'](_0x3655ce=>{this['_isAbortError'](_0x3655ce)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x3655ce),this['_setErrorState'](_0x3b25e4,_0x4123e5));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x4123e5,_0xcc738a),this['_updateNavigationUI']();}catch(_0x3b68f8){this['_isAbortError'](_0x3b68f8)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x3b68f8),this['_setErrorState'](_0x3b25e4,_0x4123e5));}}),this['listenTo'](_0x4123e5,'toggleSuggestionDisplayMode',(_0x325d51,{showDiff:_0x20e62e})=>{this['_balloonShowDiff']=_0x20e62e;const _0x3e36ff=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x3e36ff&&_0xa629e0(_0x3e36ff,_0x4123e5,_0x20e62e,'static')['catch'](_0x41e744=>{this['_isAbortError'](_0x41e744)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x41e744),this['_setErrorState'](_0x3b25e4,_0x4123e5));});}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x1a0059,{reply:_0x17ad2e})=>{const _0x24ee9a={'positiveCount':_0x17ad2e['changeGroups']['filter'](_0x1a757f=>'accepted'===_0x1a757f['state'])['length'],'totalCount':_0x17ad2e['changeGroups']['length']},_0x6a52e3=this['_interaction']['actionCallId'],_0xa43d3=this['_interaction']['actionName'];_0xa43d3?this['_aiConnector']['upsertAIActionRating'](_0xa43d3,_0x6a52e3,_0x24ee9a):this['_aiConnector']['upsertCustomAIActionRating'](_0x6a52e3,_0x24ee9a);}),this['_setLoadingState'](_0x4123e5,_0xcc738a);try{const _0x42b134=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x42b134;}catch(_0xec56c6){if(this['_isAbortError'](_0xec56c6))return;_0x4123e5['hideLoader'](),this['_setErrorState'](_0x3b25e4,_0x4123e5);}}['_applyChanges'](_0x594ff3,_0x5ef700,_0x46c1a7){const _0xa93889=this['editor'];if(_0x46c1a7&&!_0xa93889['plugins']['has']('TrackChanges'))throw new _0x51167b('ai-no-track-changes',null);const _0x384506=this['editor']['plugins']['get'](_0xfc3cc0),_0x51cb88=this['_interaction'],_0x2730d6=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x1c0513=_0x2730d6['changeGroups'];_0x2730d6['setChangeGroupState'](0x0,'accepted');let _0x38e4ca=A({'editor':_0xa93889,'reply':_0x2730d6,'interaction':_0x51cb88,'groups':_0x1c0513,'transform':!0x1,'documentCompare':_0x384506,'documentCompareOptions':{'anchor':_0xa93889['model']['createPositionAt'](_0x594ff3,0x0),'markDeletions':_0x46c1a7}});_0x38e4ca=this['_filterOperationsOutsideRange'](_0x38e4ca,_0x5ef700);for(const _0x3c6985 of _0x38e4ca)this['_anchorOperation'](_0x5ef700,_0x3c6985,_0xa93889['model']['document']['getRoot']());const _0x46c2d5=_0x51cb88['getDocumentContext']()['version'],_0x4199ac=_0xa93889['model']['document']['history']['getOperations'](_0x46c2d5),_0xb582f9={'document':_0xa93889['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x25b92c=mt(_0x38e4ca,_0x4199ac,_0xb582f9)['operationsA'];_0xa93889['model']['change'](_0x51d22e=>{if(_0x51d22e['setSelection'](_0xa93889['model']['document']['selection']['focus']),_0x46c1a7)_0xa93889['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x25b92c);else{for(const _0x487114 of _0x25b92c)_0x487114['baseVersion']=_0xa93889['model']['document']['version'],T(_0xa93889,_0x487114),_0x51d22e['batch']['addOperation'](_0x487114),_0xa93889['model']['applyOperation'](_0x487114);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x32add2,_0xf15c5){return _0x32add2['filter'](_0x3d573e=>{if('rename'==_0x3d573e['type']){const _0xdfe0ee=_0x3d573e['position']['nodeAfter'];return!_0xf15c5['has'](_0xdfe0ee);}if(_0x3d573e['type']['indexOf']('Attribute')>-0x1){const _0x241860=_0x3d573e['range']['start']['nodeAfter'];return!_0xf15c5['has'](_0x241860);}return!0x0;});}['_anchorOperation'](_0x23cf56,_0x14dbf2,_0x5d088f){const _0x5fa0a=_0x14dbf2['clone']();for(const _0x4e75dd in _0x14dbf2){const _0x1ee3c7=_0x14dbf2[_0x4e75dd];_0x1ee3c7 instanceof _0x46f2b7?_0x14dbf2[_0x4e75dd]=new _0x46f2b7(_0x2df8fe(_0x1ee3c7['start']),_0x2df8fe(_0x1ee3c7['end'])):_0x1ee3c7 instanceof gt&&(_0x14dbf2[_0x4e75dd]=_0x2df8fe(_0x1ee3c7));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x5fa0a['type'])){if(_0x5fa0a['isDocumentOperation']=!0x1,_0x5fa0a['baseVersion']=null,'remove'==_0x5fa0a['type']){const _0x273f24=_0x5fa0a['sourcePosition'],_0x514259=_0x5fa0a['howMany'];new _0x33fea2(_0x273f24,_0x514259)['_execute']();}else _0x5fa0a['_execute']();}function _0x2df8fe(_0x4f7610){if('$graveyard'==_0x4f7610['root']['rootName'])return _0x4f7610;const _0x514999=[];let _0x58d74e=_0x4f7610['root'];for(let _0x2b1401=0x0;_0x2b1401<_0x4f7610['path']['length'];_0x2b1401++){const _0x14a518=_0x23cf56['get'](_0x58d74e)||0x0;_0x514999[_0x2b1401]=_0x4f7610['path'][_0x2b1401]+_0x14a518,_0x58d74e=_0x58d74e['getChildAtOffset'](_0x4f7610['path'][_0x2b1401]);}return new gt(_0x5d088f,_0x514999,_0x4f7610['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x42ee3b,content:_0x586c6f,version:_0x407fb4,mainView:_0x4fe671,aiBalloon:_0x53c96f}=this['_interactionParams'];_0x4fe671['areChangesVisible']=!0x1,_0x4fe671['hideError'](),this['_clearErrorState'](_0x4fe671,_0x53c96f);const _0x4ef907=_0x4fe671;_0x4ef907['miniToolbarView']&&_0x4ef907['miniToolbarView']['showChangesButton']&&_0x4ef907['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':ct}),this['_clearSuggestionContent'](_0x4fe671),_0x4fe671['showLoader'](),this['_updateNavigationUI'](),this['_createInteraction'](_0x586c6f,_0x407fb4,_0x4fe671,_0x53c96f,_0x42ee3b)['catch'](_0x27e5d4=>{this['_isAbortError'](_0x27e5d4)||console['error']('Error\x20refreshing\x20interaction:',_0x27e5d4);});}['_clearSuggestionContent'](_0x18dbd7){const _0x451ec8=_0x18dbd7['bodyView']['_children'];for(;_0x451ec8['length']>0x0;)_0x451ec8['remove'](_0x451ec8['first']);_0x18dbd7['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x39d58e){return!!_0x39d58e['message']&&_0x39d58e['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 _0x369e4b=new tt(this['editor']['locale']),_0xac8a4f=new tt(this['editor']['locale']),_0x179f87=new st(this['editor']['locale']),_0x2328ff=new tt(this['editor']['locale']);_0x369e4b['set']({'icon':rt,'label':u(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0xac8a4f['set']({'icon':ht,'tooltip':u(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x179f87['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x2328ff['set']({'icon':at,'tooltip':u(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x369e4b['bind']('isEnabled')['to'](this,'isBusy',_0x5224c7=>!_0x5224c7),_0x369e4b['on']('execute',()=>{this['_refreshInteraction']();}),_0xac8a4f['bind']('isEnabled')['to'](this,'isBusy',_0xf25208=>!_0xf25208),_0xac8a4f['on']('execute',()=>{this['_navigateToPrevious']();}),_0x2328ff['bind']('isEnabled')['to'](this,'isBusy',_0x4c1a02=>!_0x4c1a02),_0x2328ff['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0xac8a4f,this['_navigationCounter']=_0x179f87,this['_navigationNextButton']=_0x2328ff,this['_customViews']['add'](_0x369e4b);}['_navigateToPrevious'](){const _0x50f661=this['_interactions']['length'];this['_currentInteractionIndex']<_0x50f661-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x2a23c6){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x2a23c6;const {mainView:_0x2b532f}=this['_interactionParams'],_0x3bf78b=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3bf78b)return;if(_0x3bf78b['hasError'])return this['_setErrorState'](_0x3bf78b,_0x2b532f),void this['_updateNavigationUI']();if(!_0x3bf78b['replies']['length'])return;_0x2b532f['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x2b532f,this['_interactionParams']['aiBalloon']);const _0x4f1536=_0x3bf78b['replies'][_0x3bf78b['replies']['length']-0x1];if(_0x4f1536){const _0x3da461=this['editor'];this['_clearSuggestionContent'](_0x2b532f);try{const _0x3540a8=lt({'editor':_0x3da461,'changeGroups':_0x4f1536['changeGroups'],'documentContextContent':_0x4f1536['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x2b532f),await new Promise(_0x4b40c9=>setTimeout(_0x4b40c9,0x32)),await _0x2b532f['updateContent']({'parts':_0x3540a8,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x1e82b1){this['_isAbortError'](_0x1e82b1)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x1e82b1);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x28bec2=this['_interactions']['length'],_0x358c4a=_0x28bec2>0x1,_0xa94332=this['_interactionParams']?.['mainView'];if(_0x358c4a){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0xa94332?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0xa94332?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0xa94332?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x9daf91=_0x28bec2-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x9daf91+'/'+_0x28bec2),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x28bec2-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0xa94332?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0xa94332?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0xa94332?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0xb69b54,_0x59a41b){_0xb69b54['setLoading'](),_0x59a41b['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x474de8,_0x3ed97f){const _0x2f9e5a=u(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x3ed97f['showError'](_0x2f9e5a),_0x474de8['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x3ed97f['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x573513,_0x16622a){_0x573513['clearErrorState'](),_0x16622a['balloonView']['toolbar']&&(_0x16622a['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x5f37c9,_0x3426bf){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x5f37c9['clearLoading'](),_0x3426bf['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x3ec357=>{'isEnabled'in _0x3ec357&&(_0x3ec357['isEnabled']=!0x1);});}}class Fa extends _0x3145c9{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x55b451){super(_0x55b451),_0x55b451['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class vs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x1156b6,title:_0x35073e,description:_0x18ac89,isParameterized:_0x27bfbe,useArgs:_0xf4a11b,options:_0xf7e12}){this['id']=_0x1156b6,this['title']=_0x35073e,this['description']=_0x18ac89,this['isParameterized']=_0x27bfbe,this['useArgs']=_0xf4a11b,this['options']=_0xf7e12;}}class kr extends vs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x440ecd){this['_models']=_0x440ecd;}}class si extends qt(){['_checks'];constructor(_0x366204){super(),this['_checks']=this['_mapCheckDefinitions'](_0x366204);}get['checks'](){return this['_checks'];}['getCheckById'](_0x40a3d7){return this['checks']['find'](_0x559f53=>_0x559f53['id']===_0x40a3d7);}['_mapCheckDefinitions'](_0x57d833){return _0x57d833['map'](_0x106dc4=>'custom'===_0x106dc4['id']?new kr(_0x106dc4):new vs(_0x106dc4));}}class Cs extends _0x3f6d88(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x178c98,contentNew:_0x1180e3,contentInitial:_0x5c93c2,documentVersion:_0x34b47c}){super(),this['id']=_0x178c98,this['contentNew']=_0x1180e3,this['contentInitial']=_0x5c93c2,this['documentVersion']=_0x34b47c;}}class Rs extends qt(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x2858a2,_0x3648e0,_0x49e2d5){super(),this['id']=_0x2858a2,this['parent']=_0x49e2d5,this['_data']=_0x3648e0,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 xs extends qt(){['id']=_0x4c8592();['callId'];['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x10c66a,_0x4912a1,_0x5be3a2,_0x787082,_0x49a4b1){super(),this['_documentData']=_0x10c66a,this['_sourceCheck']=_0x4912a1,this['_aiConnector']=_0x5be3a2,this['_reviewParams']=_0x787082,this['_reviewArgs']=_0x49a4b1,this['on']('change:status',(_0x2cff78,_0x8f09c5,_0x19dca6)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x19dca6,'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'](_0x532c4b=>'pending'===_0x532c4b['status']);}get['currentError'](){return this['_currentError'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x214039=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x243172 of _0x214039)'unmodified'!==_0x243172['data']['operation']&&('error'!==_0x243172['data']['operation']?'review-metadata'!==_0x243172['event']?this['_addReviewCheckResult'](_0x243172['data']['dataId'],_0x243172['data']['textDelta']):this['callId']=_0x243172['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x4058a2){this['_currentError']=_0x4058a2,_0x4058a2 instanceof Error&&_0x4058a2['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'](_0x312321,_0x598076){const _0xe51e10=this['_results']['get'](_0x312321);if(!_0xe51e10)return;const _0x279951=[];_0x598076['forEach']((_0x1d29e6,_0x52f373)=>{const _0x5358fe=new Rs(_0xe51e10['id']+'-'+_0x52f373,_0x1d29e6,_0xe51e10);_0x5358fe['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x5358fe,'status':_0x5358fe['status']});}),_0x5358fe['on']('change:isActivated',()=>{_0x5358fe['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x5358fe}):this['fire']('reviewCheckResultDeactivated',{'change':_0x5358fe});}),this['_changes']['push'](_0x5358fe),_0x279951['push'](_0x5358fe);}),this['fire']('reviewCheckResultReady',{'changes':_0x279951,'result':_0xe51e10,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x59dccf){const _0x132366=this['_changes']['find'](_0x306a27=>_0x306a27['id']===_0x59dccf);return!(!_0x132366||'pending'!==_0x132366['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x53eefb=>'pending'===_0x53eefb['status']);}['markAllChangesAsAccepted'](){for(const _0x4186ab of this['_changes'])'pending'===_0x4186ab['status']&&(_0x4186ab['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x280eb8){const _0x1afeac=this['_changes']['find'](_0x7479fe=>_0x7479fe['id']===_0x280eb8);_0x1afeac&&'pending'===_0x1afeac['status']&&(_0x1afeac['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1d56b5){const _0x3060b1=this['_changes']['find'](_0x4ca626=>_0x4ca626['id']===_0x1d56b5);_0x3060b1&&'pending'===_0x3060b1['status']&&(_0x3060b1['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0xeee2e4){const _0x5e3e0f=this['_changes']['find'](_0x26e5e1=>_0x26e5e1['id']===_0xeee2e4);_0x5e3e0f&&'pending'===_0x5e3e0f['status']&&(_0x5e3e0f['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x457142){const _0x328d1d=this['_changes']['find'](_0x5c7f30=>_0x5c7f30['id']===_0x457142);_0x328d1d&&'outdated'===_0x328d1d['status']&&(_0x328d1d['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x5218ed){this['_changes']['filter'](_0x4a7c23=>_0x4a7c23['isActivated']&&_0x4a7c23['id']!==_0x5218ed)['forEach'](_0x2d4296=>{_0x2d4296['isActivated']=!0x1;});const _0x43cea8=this['_changes']['find'](_0x4066b9=>_0x4066b9['id']===_0x5218ed);_0x43cea8&&'pending'===_0x43cea8['status']&&(_0x43cea8['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x536406=>_0x536406['isActivated'])['forEach'](_0x36dfd8=>{_0x36dfd8['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x1cfe66){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x129a62;if(_0x1cfe66){const _0x4773a2=this['_changes']['find'](_0x4cf4a9=>_0x4cf4a9['id']===_0x1cfe66);if(_0x4773a2&&_0x4773a2['isRated'])return;_0x4773a2&&(_0x129a62=_0x4773a2['parent']['id'],_0x4773a2['isRated']=!0x0);}const _0x2f442d={'positiveCount':this['_changes']['filter'](_0x3f1558=>'accepted'===_0x3f1558['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x2f442d,this['callId'],_0x129a62);}['_addReviewCheckResult'](_0x5e5c19,_0x45b3a7){const _0x5d207b=this['_documentData']['elements']['get'](_0x5e5c19);if(!_0x5d207b)return;const _0x2a2ae1=_0x5d207b['getContent']();if(_0x2a2ae1===_0x45b3a7)return;const _0x5f34cc=new Cs({'id':_0x5e5c19,'contentInitial':_0x2a2ae1,'contentNew':_0x45b3a7,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x5f34cc['id'],_0x5f34cc),this['fire']('reviewCheckResultAdded',{'result':_0x5f34cc,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x5d4b9c=>'pending'===_0x5d4b9c['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x598b77=>'pending'===_0x598b77['status'])['length']&&(this['status']='finished'));}}class hi extends xs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1a955a=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x527f2c=0x0;_0x527f2c<this['_reviewParams']['length'];_0x527f2c++){if(!this['_reviewParams'][_0x527f2c]||!this['_sourceCheck']['options'][_0x527f2c])continue;const _0x6b9358=this['_sourceCheck']['options'][_0x527f2c],_0x42d3cc=_0x6b9358['data']?.['find'](_0x3951da=>_0x3951da['id']===this['_reviewParams'][_0x527f2c]);_0x42d3cc&&_0x1a955a['push'](_0x42d3cc['label']);}return _0x1a955a['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x53ed83,_0x4aa363,_0x48284f){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x4aa363,_0x53ed83,_0x48284f);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class oi extends xs{['_prompt'];['_model'];constructor(_0x193571,_0x5e173e,_0x4381c4,_0x217540,_0x5f7261){super(_0x4381c4,_0x217540,_0x5f7261),this['_prompt']=_0x193571,this['_model']=_0x5e173e;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x40fb01,_0x5338fe,_0x34c7c2){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x5338fe,_0x40fb01,_0x34c7c2);}}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 ee extends _0x47d85c{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[l];}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 _0x574859=this['context']['config']['get']('ai.reviewMode.translations');if(_0x574859){for(const _0x4672ae of ai)'translate'===_0x4672ae['id']&&(_0x4672ae['options'][0x0]['data']=_0x574859);}const _0x34af20=this['_translateReviewChecks'](ai);this['_aiReviewCheckList']=new si(_0x34af20);const _0x2bcfb7=this['_aiReviewCheckList']['checks']['find'](_0x585d23=>'custom'===_0x585d23['id']);if(_0x2bcfb7){const _0x4ae753=await new ni({'connector':this['_aiConnector']})['getAll']();_0x2bcfb7['models']=_0x4ae753['map'](_0x42904c=>({..._0x42904c,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x42904c['id']['toUpperCase'](),_0x42904c['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x221d30,_0x284896)=>{const _0x2a0aa6=this['_aiReviewCheckList']['getCheckById'](_0x284896['id']);if(_0x2a0aa6){this['_onDiffChange'](this['_isDiffOn']),_0x284896['isCustom']?this['_currentReviewCheckRun']=new oi(_0x284896['args']['prompt'],_0x284896['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x2a0aa6,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x2a0aa6,this['_aiConnector'],_0x284896['params'],_0x284896['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x383278,_0x455eb5)=>{'data'===_0x455eb5['status']||'loading'===_0x455eb5['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x455eb5)):'finished'===_0x455eb5['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x455eb5['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x455eb5['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x455eb5['status']?(this['_aiReviewModeUi']['showGeneralErrorView'](),this['_logError'](new _0x51167b('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x455eb5['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x51167b('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x455eb5['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x455eb5['status']&&'error-chunk'!==_0x455eb5['status']&&'error-general'!==_0x455eb5['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x176304,_0x28b441)=>{if(!this['_currentReviewCheckRun'])throw new _0x51167b('ai-review-mode-no-current-check-run',this);const _0x1e0723=this['_aiReviewModeEditing']['diffContent'](_0x28b441['result']['contentInitial'],_0x28b441['result']['contentNew']);_0x28b441['source']['addResultChanges'](_0x28b441['result']['id'],_0x1e0723);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x5cf786,_0x5b6577)=>{for(const _0x573654 of _0x5b6577['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x573654);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x5b6577['changes'],_0x5b6577['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x466d4b,_0x1755f1)=>{this['_aiReviewModeUi']['updateChangeState'](_0x1755f1['change']['id'],_0x1755f1['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x2e2396,_0x400456)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x400456['change']['id']);const _0x208776=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x400456['change']['id']);if(_0x208776){if('content'===this['_changeActivationSource']){const _0xa200a3=this['_aiReviewModeUi']['getChangeElement'](_0x400456['change']['id']);_0xa200a3&&_0x523446(_0xa200a3['closest']('.ck-ai-review-mode__check-run-result')||_0xa200a3);}else{if('panel'===this['_changeActivationSource']){const _0x52293f={'target':_0x208776['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x24e163(_0x52293f);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x400456['change'],_0x208776['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x2dbbb0){_0x2dbbb0 instanceof Error&&_0x2dbbb0['message']['includes']('ai-request-aborted')||(_0x2dbbb0 instanceof _0x51167b?this['_logError'](_0x2dbbb0):this['_logError'](new _0x51167b('ai-review-mode-check-run-failed',this,{'error':_0x2dbbb0})));}}else this['_logError'](new _0x51167b('ai-review-mode-source-check-not-found',this,{'checkId':_0x284896['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 _0x4ed4e0=this['_currentReviewCheckRun']['getActiveChanges']();_0x4ed4e0['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x4ed4e0['map'](_0x4dd4ab=>_0x4dd4ab['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x2835f1,_0x116d11)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x116d11['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x116d11['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x116d11['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x116d11['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x3b5d9f,_0x3d8aa5)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x3d8aa5['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x3d8aa5['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x3d8aa5['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x3d8aa5['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x142ba2,_0x4c2c94)=>{this['_isDiffOn']=_0x4c2c94['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x12d228,_0x365753)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x365753['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x39d15c,_0x1c1d0c)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1c1d0c['changeId']));}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x3f038f,_0x193f96)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x193f96['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x2a5f7a,_0x50aa59)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x50aa59['changeId']);});}['_onReviewModeRunLeave'](_0x520788=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x520788&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x4e1f3e=this['_aiReviewModeEditing']['getEditor']();_0x4e1f3e&&_0x4e1f3e['editing']['view']['change'](_0x3addde=>{const _0x3425fa=_0x4e1f3e['editing']['view']['document']['getRoot']();_0x3addde['removeClass']('ck-ai-review-mode-diff',_0x3425fa),_0x3addde['removeClass']('ck-ai-review-mode-highlights',_0x3425fa);});}['_onDiffChange'](_0x365075){const _0x13a774=this['_aiReviewModeEditing']['getEditor']();_0x365075?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x13a774&&_0x13a774['editing']['view']['change'](_0x1931ad=>{const _0x30a01b=_0x13a774['editing']['view']['document']['getRoot']();_0x1931ad['removeClass']('ck-ai-review-mode-diff',_0x30a01b),_0x1931ad['removeClass']('ck-ai-review-mode-highlights',_0x30a01b),_0x1931ad['addClass'](_0x365075?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x30a01b);});}['_translateReviewChecks'](_0x2e2907){return _0x2e2907['map'](_0x13bce8=>{const _0xb74f7d='AI_REVIEW_CHECK_'+_0x13bce8['id']['toUpperCase']()['replaceAll']('-','_'),_0x473a63={..._0x13bce8,'title':this['_getTranslationWithDefault'](_0xb74f7d+'_TITLE',_0x13bce8['title']),'description':this['_getTranslationWithDefault'](_0xb74f7d+'_DESCRIPTION',_0x13bce8['description'])};return _0x13bce8['options']&&(_0x473a63['options']=_0x13bce8['options']['map'](_0x96f176=>({..._0x96f176,'label':this['_getTranslationWithDefault'](_0xb74f7d+'_OPTIONS_LABEL',_0x96f176['label']||''),'data':_0x96f176['data']?_0x96f176['data']['map'](_0x4c4147=>({..._0x4c4147,'label':this['_getTranslationWithDefault'](_0xb74f7d+'_OPTIONS_DATA_'+_0x4c4147['id']['toUpperCase'](),_0x4c4147['label'])})):void 0x0}))),_0x473a63;});}['_getTranslationWithDefault'](_0xd0e080,_0x3fd972){const _0x26788f=u(this['context']['locale'],_0xd0e080);return _0x26788f===_0xd0e080?_0x3fd972:_0x26788f;}['_logError'](_0x1e7803){_0x36ffad(_0x1e7803['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class jr extends st{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x104de9,_0x41effe){super(_0x104de9),this['_defaultValue']=_0x41effe['default']||(_0x41effe['data']['length']>0x0?_0x41effe['data'][0x0]['id']:''),this['_defaultLabel']=_0x41effe['data']['find'](_0x52faed=>_0x52faed['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x3e6542(this['locale']);const _0x4d25e1=this['_prepareListOptions'](_0x41effe['data']);_0x146679(this['_dropdownView'],_0x4d25e1,{'role':'menu','ariaLabel':_0x41effe['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4223e8=>{_0x4223e8['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x527f15=>{this['formValue']=_0x527f15['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x527f15['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'](_0x542d99=[]){const _0x5f1063=new _0x4d07d3();this['resetToDefault']();for(const _0x25a88e of _0x542d99){const _0x3333d0=new _0x12ff1d({'label':_0x25a88e['label'],'withText':!0x0,'role':'menuitemradio','id':_0x25a88e['id'],'model':_0x25a88e});_0x3333d0['bind']('isOn')['to'](this,'formValue',_0x1fd2d0=>_0x1fd2d0===_0x3333d0['id']);const _0x4c42d2={'type':'button','model':_0x3333d0};_0x5f1063['add'](_0x4c42d2);}return _0x5f1063;}}class Ks extends _0x5374ac{['_formItem']=null;constructor(_0x1cb425,_0xa61de2,_0x12fead){super(_0x1cb425),this['argsKey']=_0xa61de2?.['argsKey'];if('dropdown'===_0xa61de2['formType'])this['_formItem']=new jr(this['locale'],_0xa61de2);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x354391=new _0x1a7992(this['locale'],{'children':[this['_formItem']],'class':[_0x12fead?'ck-form__row_with-submit':'']});_0x12fead&&_0x354391['children']['add'](_0x12fead),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x354391]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Fs extends _0xd4428c{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0xf1d442){super(_0xf1d442),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x2ec108(),this['minRows']=Fs['MIN_ROWS'],this['maxRows']=Fs['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 Ns extends st{['focusTracker']=new _0x156d7c();['keystrokes']=new _0x2ec108();['focusCycler'];['_focusables']=new it();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x56d839,_0x368d06){super(_0x56d839),this['_check']=_0x368d06,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x368d06['models']&&_0x368d06['models']['length']>0x0?_0x368d06['models'][0x0]['id']:'',this['_defaultLabel']=_0x368d06['models']&&_0x368d06['models']['length']>0x0?_0x368d06['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x5ef183(this['locale'],()=>new Fs(_0x56d839)),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 _0x4d07d3(),this['_setModelList'](),_0x146679(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 _0x1a7992(this['locale'],{'children':[this['promptInputView']]}),new _0x1a7992(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0xb548ab,_0x4f619d)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x4f619d()):_0x4f619d();}),this['focusCycler']=new _0x3ac126({'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'](_0x28e824=>{this['_focusables']['add'](_0x28e824),this['focusTracker']['add'](_0x28e824['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 _0x58a724 of this['_getFormValidators']()){const _0x4d8437=_0x58a724();if(_0x4d8437)return this['promptInputView']['errorText']=_0x4d8437,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return u(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x2d1fc9=new tt(this['locale']),t=this['locale']['t'];return _0x2d1fc9['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x2d1fc9['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x2d1fc9;}['_createCancelButtonView'](){const _0x330ebb=new tt(this['locale']),t=this['locale']['t'];return _0x330ebb['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x330ebb['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3d74a6=>{_0x3d74a6['stopPropagation']();})}}),_0x330ebb['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x330ebb;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x56cc6b=this['_check']['models'];if(this['resetToDefault'](),_0x56cc6b?.['length']){const _0x141c37=ni['getLocalized'](this['locale'],_0x56cc6b);for(const _0x276edf of _0x141c37){const _0x2f2c3d=new _0x12ff1d({'label':_0x276edf['name'],'withText':!0x0,'role':'menuitemradio','id':_0x276edf['id'],'model':_0x276edf});_0x2f2c3d['bind']('isOn')['to'](this,'modelId',_0xcd20f8=>_0xcd20f8===_0x276edf['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2f2c3d,'labelView':new Os(this['locale'],_0x276edf)});}}}['_createModelSelectionDropdown'](){const _0x59a5da=_0x3e6542(this['locale']);return _0x59a5da['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x59a5da['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x59a5da,'execute',_0x527e38=>{this['modelId']=_0x527e38['source']['model']['id'],_0x59a5da['buttonView']['label']=_0x527e38['source']['label'];}),_0x59a5da;}['_createActionsFooterView'](){const _0x32a398=new st(this['locale']);return _0x32a398['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']]}]}),_0x32a398;}}class Os extends _0x40384f{constructor(_0x1bdacb,_0x4aa963){super();const _0x37e42b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x37e42b['to']('style'),'id':_0x37e42b['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x37e42b['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x4aa963['description']||'']}]}]});}}class zs extends _0x5374ac{['_formItemsCollection']=new it();['_customCheckView']=null;constructor(_0x206194,_0x22eca8,_0x2e13ce){super(_0x206194),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x22eca8['isParameterized']);const _0x59d59b=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',_0x51402d=>_0x51402d),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x4f259a=>_0x4f259a)],'style':{'--ck-ai-review-check-list-item-index':_0x2e13ce}},'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':_0x22eca8['title']}]},_0x59d59b]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x22eca8['description']}]}]}]},..._0x22eca8['isParameterized']?[this['_createParameterizedView'](_0x22eca8)]:[],...'custom'===_0x22eca8['id']?[this['_createCustomView'](_0x22eca8)]:[]]}),this['on']('click',()=>{_0x22eca8['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x22eca8['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&ts({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x5e6bfd=>{_0x5e6bfd['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x1a6367=new _0x202d8c();return _0x1a6367['content']=_0x287852,_0x1a6367['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x1a6367;}['_createParameterizedView'](_0x57650d){const _0x461fb0=new st(),_0x215562=this['_createFormView'](_0x57650d);return _0x461fb0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x163c43=>!_0x163c43)]},'children':[_0x215562]}),_0x461fb0;}['_createFormView'](_0x4e11d8){const _0x58c1ee=new st(),_0x4b19c9=Array['isArray'](_0x4e11d8['options'])?_0x4e11d8['options']:[],_0x41925a=new tt(this['locale']),t=this['locale']['t'];_0x41925a['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x41925a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4f5441=>{_0x4f5441['stopPropagation']();})}}),_0x41925a['on']('execute',()=>{const _0x5ca0ab=[],_0x305fa0={};this['_formItemsCollection']['forEach'](_0x4d8f8a=>{_0x5ca0ab['push'](_0x4d8f8a['value']),_0x4e11d8['useArgs']&&_0x4e11d8['options']&&(_0x305fa0[_0x4d8f8a['argsKey']]=_0x4d8f8a['value']);}),this['fire']('runReviewCheck',{'id':_0x4e11d8['id'],'params':_0x5ca0ab['length']?_0x5ca0ab:void 0x0,'args':Object['keys'](_0x305fa0)['length']?_0x305fa0:void 0x0});});const _0x1d8754=_0x4b19c9['length'];return _0x4b19c9['forEach']((_0x17430e,_0x213e23)=>{const _0x2c8c69=_0x213e23===_0x1d8754-0x1;this['_formItemsCollection']['add'](new Ks(this['locale'],_0x17430e,_0x2c8c69?_0x41925a:null));}),_0x58c1ee['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x58c1ee;}['_createCustomView'](_0x3398b3){return this['_customCheckView']=new Ns(this['locale'],_0x3398b3),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',_0x26a474=>!_0x26a474)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x5d0df9,_0x33bb4f,_0x2f42c7)=>{_0x2f42c7||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class Qs extends _0x5374ac{['_checkViews'];constructor(_0x18bf05){super(_0x18bf05),this['_checkViews']=new it();const _0x5689d2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x5689d2['if']('isVisible','ck-hidden',_0x48b765=>!_0x48b765)]},'children':this['_checkViews']});}['setChecks'](_0x47bbf7){this['_checkViews']['clear']();for(const [_0xc90789,_0x26e58e]of _0x47bbf7['entries']()){const _0x5c9201=new zs(this['locale'],_0x26e58e,_0xc90789);_0x5c9201['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x5c9201);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x9587aa of this['_checkViews'])_0x9587aa instanceof zs&&_0x9587aa['resetToDefault']();}}class Bs extends st{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0x343408,_0x5e4a3c){super(_0x343408),this['id']=_0x5e4a3c,this['set']('status','pending'),this['set']('changeId',_0x5e4a3c),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':_0x5e4a3c,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1597c3=new st(this['locale']);return _0x1597c3['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',_0x3fa68f=>!_0x3fa68f)]}}),_0x1597c3;}['_createAcceptButtonView'](){const _0x462a4f=new tt(this['locale']);return _0x462a4f['set']({'label':u(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x462a4f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5b1737=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x5b1737['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0xd5af85=>'pending'!==_0xd5af85)]}}),_0x462a4f;}['_createDismissButtonView'](){const _0x7703dd=new tt(this['locale']);return _0x7703dd['set']({'label':u(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x7703dd['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x165a3e=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x165a3e['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x52fea9=>'pending'!==_0x52fea9)]}}),_0x7703dd;}['_createInfoButtonView'](){const _0x106371=new tt(this['locale']);return _0x106371['set']({'label':u(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x401635,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x106371['bind']('isOn')['to'](this,'isInfoToggleOn',_0x5bc2d4=>_0x5bc2d4),_0x106371['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x106371;}['_createStatusButtonView'](){const _0x1fa0b7=new tt(this['locale']);return _0x1fa0b7['set']({'withText':!0x0,'isEnabled':!0x1}),_0x1fa0b7['bind']('label')['to'](this,'status',_0x20fc17=>u(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x20fc17['toUpperCase']())),_0x1fa0b7['bind']('icon')['to'](this,'status',_0x3ca4f9=>'ACCEPTED'===_0x3ca4f9['toUpperCase']()?_0x4ffa92:'REJECTED'===_0x3ca4f9['toUpperCase']()?_0x88b984:_0x30b921),_0x1fa0b7['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0xf55f21=>'pending'===_0xf55f21)],'disabled':'disabled'}}),_0x1fa0b7;}}class Gs extends tt{constructor(_0x142666){super(_0x142666),this['set']({'label':u(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Xs extends _0x5374ac{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x4741ca){super(_0x4741ca),this['_resultViews']=new it(),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 Bi(_0x4741ca),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 _0xc0ffc1=this['_createCombinedSkeletonLoader'](),_0x48ed4d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x48ed4d['if']('isVisible','ck-hidden',_0x1cb12e=>!_0x1cb12e)]},'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',_0x2c4336=>_0x2c4336)]},'children':this['_resultViews']},_0xc0ffc1]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x5e27df){const _0x1e2122=new Bs(this['locale'],_0x5e27df['id']);_0x1e2122['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x1e2122),_0x1e2122['resultResponseView']['element']['innerHTML']=_0x5e27df['contentDiffed'];}['hideResult'](_0x438ae2,_0x49f677){if('pending'===_0x49f677)return;const _0x2f05ef=this['_resultViews']['find'](_0x55833e=>_0x55833e['id']===_0x438ae2);_0x2f05ef&&(_0x2f05ef['status']=_0x49f677,_0x2f05ef['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x4ce7d2,_0x1f7871){if('pending'!==_0x1f7871)return;const _0xcc4677=this['_resultViews']['find'](_0x27e98d=>_0x27e98d['id']===_0x4ce7d2);_0xcc4677&&(_0xcc4677['status']=_0x1f7871,_0xcc4677['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x5ab81b,_0x5e64de){this['headerTitle']=_0x5ab81b,this['headerSubtitle']=_0x5e64de||'';}['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 ye(this['locale'],_e['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x28afef=new st(this['locale']),_0x37d0a6=[];for(let _0x28229b=0x0;_0x28229b<0x10;_0x28229b++){const _0x188191=this['_createSkeletonLoader']();_0x188191['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x37d0a6['push'](_0x188191);}return _0x28afef['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5535d7=>!_0x5535d7)]},'children':_0x37d0a6}),_0x28afef;}['_createErrorView'](){const _0x2dbf71=new st(this['locale']),_0x58ff18=new tt(this['locale']),t=this['locale']['t'];return _0x2dbf71['delegate']('retryReview')['to'](this),_0x58ff18['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x58ff18['on']('execute',()=>{this['fire']('retryReview');}),_0x2dbf71['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x1712e3=>!_0x1712e3),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x588a56=>'chunk'===_0x588a56)]},'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',_0x55492f=>'chunk'===_0x55492f)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x175d9e=>'general'!==_0x175d9e)]},'children':[{'text':u(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x105427=>'chunk'!==_0x105427)]},'children':[{'text':u(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x58ff18]}),_0x2dbf71;}['_createCancelButtonView'](){const _0x1c365b=new tt(this['locale']);return _0x1c365b['set']({'label':u(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0xcdaaf6}),_0x1c365b['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2b2a49=>_0x2b2a49),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x11b239=>_0x11b239)]}}),_0x1c365b['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x1c365b;}['_createToggleDiffButtonView'](){const _0x394e66=new tt(this['locale']);_0x394e66['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x394e66['bind']('isEnabled')['to'](this,'isError',_0x4033ca=>!_0x4033ca),_0x394e66['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1581fc=>!_0x1581fc),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x139f74=>_0x139f74)]}});const _0x333440=u(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x12aec5=u(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x394e66['bind']('isOn')['to'](this,'isToggleDiffOn',_0x46bb59=>_0x46bb59),_0x394e66['bind']('icon')['to'](this,'isToggleDiffOn',_0x4837e3=>_0x4837e3?_0x4a8347:_0x351d84),_0x394e66['bind']('label')['to'](this,'isToggleDiffOn',_0x5b390a=>_0x5b390a?_0x333440:_0x12aec5),_0x394e66['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x394e66;}['_createAcceptAllButtonView'](){const _0x1fd68b=new tt(this['locale']);return _0x1fd68b['set']({'label':u(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x1fd68b['bind']('isEnabled')['to'](this,'isError',_0x973348=>!_0x973348),_0x1fd68b['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2397e4=>!_0x2397e4),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2f3bd6=>_0x2f3bd6)]}}),_0x1fd68b['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x1fd68b;}['_createExitReviewButtonView'](){const _0x38bccc=new tt(this['locale']);return _0x38bccc['set']({'label':u(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x38bccc['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x33e4cb=>!_0x33e4cb),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1f2ce9=>_0x1f2ce9)]}}),_0x38bccc['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x38bccc;}['_createResultHeaderView'](){const _0x8b1dca=new st(this['locale']),_0x407dc9=this['_createTitleView']();return _0x8b1dca['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x25bc52=>_0x25bc52)]},'children':[_0x407dc9,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x8b1dca;}['_createTitleView'](){const _0x4d3312=new st(this['locale']),_0x2c96db=new be();return _0x2c96db['bind']('isVisible')['to'](this,'isResultReady',_0x4b6d14=>!_0x4b6d14),_0x4d3312['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x2c96db,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x335f86=>_0x335f86)]},'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',_0x2d6342=>!_0x2d6342)]},'children':[{'text':u(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x4d3312;}['_createFinishReviewButtonView'](){const _0x355008=new Gs(this['locale']);return _0x355008['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x291954=>!_0x291954)]}}),_0x355008['delegate']('finishReview')['to'](this),_0x355008;}}class Ys extends _0x5374ac{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x166c71){super(_0x166c71),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x1477fc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x1477fc['if']('isVisible','ck-hidden',_0x5d809f=>!_0x5d809f)]},'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':u(_0x166c71,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x584fad=new Gs(this['locale']);return _0x584fad['delegate']('finishReview')['to'](this),_0x584fad;}['_createResultHeaderView'](){const _0x21cf77=new st(this['locale']);return _0x21cf77['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':u(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x21cf77;}}class le extends st{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x108353){super(_0x108353),this['reviewModeHeader']=new _0x3197a7(_0x108353,{'label':u(_0x108353,'AI_REVIEW_MODE'),'icon':_0x293db8,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Qs(_0x108353),this['reviewCheckListView']['delegate'](...Us)['to'](this),this['reviewCheckResultsView']=new Xs(_0x108353),this['reviewCheckResultsView']['delegate'](...Us)['to'](this),this['reviewCompletedView']=new Ys(_0x108353),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'](_0x201c39){this['reviewCheckResultsView']['addResult'](_0x201c39),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 _0x5266db{['resultItemView'];constructor(_0x3cc11f,_0x3aa617){super(_0x3cc11f),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']()),_0x3aa617['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x525c60){this['resultItemView']['changeId']=_0x525c60['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x525c60['contentDiffed'];}['showBalloon'](_0x1f8b65,_0x4a7458){this['updateContent'](_0x1f8b65),this['show'](),this['pin']({'target':()=>this['_getBestRectPosition'](_0x4a7458)});}['hideBalloon'](){this['hide'](),this['unpin']();}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_setupClickOutsideHandler'](){ts({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['_createContentView'](){const _0x697526=new st();return this['resultItemView']=new Bs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x697526['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']]}]}),_0x697526;}['_getBestRectPosition'](_0x17993d){const _0x1e7262=Array['from'](_0x17993d['getClientRects']());return _0x1e7262['find'](_0xeab496=>_0xeab496['width']>0x0)||_0x1e7262[0x0];}}const Us=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x47d85c{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[g];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x371668){super(_0x371668),this['_bodyCollection']=new Et(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new le(this['context']['locale']),this['_reviewModeView']['delegate'](...Us)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new we(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x14b1af=this['context']['plugins']['get']('AITabs');_0x14b1af['view']['on']('activateTab',(_0x35a19a,_0x3da8c3)=>{'reviewMode'===_0x3da8c3?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x14b1af['view']['addTab']({'id':'reviewMode','buttonLabel':u(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x293db8,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x57c751){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x57c751),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x160ff1){_0x160ff1&&('error-general'!==_0x160ff1['status']?'error-chunk'!==_0x160ff1['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x283c5d){this['_reviewModeView']['addCheckRunResult'](_0x283c5d);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x1c27f0,_0x4f6e28){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x1c27f0,_0x4f6e28);}['setActiveStateInResults'](_0x201a50){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5130f0=>{_0x5130f0['id']===_0x201a50&&_0x5130f0['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5ee849=>_0x5ee849['setItemAsInactive']());}['updateChangeState'](_0x11f099,_0xdc593e){'accepted'===_0xdc593e||'rejected'===_0xdc593e||'outdated'===_0xdc593e?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x11f099,_0xdc593e):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x11f099,_0xdc593e);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x3965eb,_0x3ff7e6){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x3965eb,_0x3ff7e6);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x148596){const _0x41872c=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x1b20b6=>_0x1b20b6['id']===_0x148596);return _0x41872c?_0x41872c['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const me='reviewmode-';class re extends _0x47d85c{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0xfc3cc0,a];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x59b8bf){super(_0x59b8bf),this['_domEmitter']=new(_0x1aff96())(),this['_eventEmitter']=new(_0x3f6d88())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x2325d8=_(this['context']);_0x2325d8['conversion']['for']('editingDowncast')['markerToElement']({'model':me+'insert','view':(_0x424d9e,{writer:_0x4781c2})=>{const _0x38dd14=this['_markers']['get'](_0x424d9e['markerName']),_0x282c69={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x424d9e['markerName']};return _0x4781c2['createUIElement']('span',_0x282c69,function(_0x3f36b9){const _0x146502=this['toDomElement'](_0x3f36b9);return _0x146502['innerHTML']=_0x38dd14?.['text']||'',_0x146502;});}}),_0x2325d8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-only','view':_0x18287d=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x18287d['markerName']}})}),_0x2325d8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-context','view':_0x3f1d77=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x3f1d77['markerName']}})}),_0x2325d8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-text','view':_0x323242=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x323242['markerName']}})}),_0x2325d8['conversion']['for']('dataDowncast')['markerToElement']({'model':me+'suggestion-context','view':(_0x311278,{writer:_0x4650ce})=>_0x4650ce['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x311278['isOpening']?'start':'end')})}),_0x2325d8['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x353bfc,'view':_0x498aa2}),this['_domEmitter']['listenTo'](document,'click',(_0x2f8abb,_0x2ac647)=>{const _0x13bade=_0x2ac647['target'],_0x4d4edb=this['_findMarkerElement'](_0x13bade);if(!_0x4d4edb)return;const _0xc7de5c=_0x4d4edb['getAttribute']('data-marker-id'),_0x3b6975=_0xc7de5c['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0xc7de5c,'changeId':_0x3b6975});}),_0x2325d8['model']['document']['registerPostFixer'](_0x294c24=>this['_validateMarkers'](_0x2325d8,_0x294c24)),_0x2325d8['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x2325d8));}['getDocumentData'](){const _0x2038bf=this['context']['plugins']['get']('AIEditing'),_0x593481=_(this['context']),_0x2dbf35=_0x593481['model'],_0x1f7c53=new ut();for(const _0x3668ba of _0x2dbf35['document']['getRoot']()['getChildren']()){const _0x50e39b=_0x3668ba['_clone'](!0x0);_0x1f7c53['_appendChild'](_0x50e39b);}for(const _0x5b30ff of _0x2dbf35['markers'])_0x1f7c53['markers']['set'](_0x5b30ff['name'],this['_changeRangeOwnerDocument'](_0x5b30ff['getRange']()['clone'](),_0x1f7c53));const _0x43b52b=new _0x2daaa0({'ignoreElementEnd':!0x0,'startPosition':_0x2dbf35['createPositionAt'](_0x1f7c53,0x0)}),_0x65a97a=new Set(),_0x492345=new Map();for(const {item:_0x2a7858}of _0x43b52b){if(!_0x2a7858['is']('$textProxy'))continue;const _0x3bd70c=_0x2a7858['parent'];if((!_0x3bd70c||!_0x3bd70c['is']('element','caption'))&&(_0x3bd70c&&_0x3bd70c['is']('element'))){let _0x206670=_0x3bd70c['getAttribute'](_0x353bfc);_0x206670||(_0x206670=_0x2038bf['_nextDataId'](_0x65a97a),_0x3bd70c['_setAttribute'](_0x353bfc,_0x206670)),_0x65a97a['add'](_0x206670);let _0x15742d=_0x3bd70c;for(;_0x15742d['parent']&&!_0x15742d['parent']['is']('documentFragment');)_0x15742d=_0x15742d['parent'],_0x15742d['hasAttribute'](_0x353bfc)&&_0x15742d['_removeAttribute'](_0x353bfc);_0x492345['set'](_0x206670,{'path':_0x3bd70c['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x15742d['_clone'](!0x0),_0x206670,_0x593481['data'])}),_0x43b52b['jumpTo'](_0x2dbf35['createPositionAfter'](_0x3bd70c));}}return{'content':_0x593481['data']['processor']['toData'](_0x593481['data']['toView'](_0x1f7c53)),'version':_0x593481['model']['document']['version'],'elements':_0x492345};}['diffContent'](_0x12cb6b,_0x8e3915){const _0x300d93=[],_0x313a69=_(this['context']),_0x445e73=_0x313a69['data']['parse'](_0x12cb6b,'$documentFragment'),_0xfb02e2=_0x313a69['model']['createPositionAt'](_0x445e73,0x0),_0x2a5b05=_0x313a69['data']['parse'](_0x8e3915,'$documentFragment');if(!this['_hasSameTopLevelElement'](_0x445e73,_0x2a5b05))return _0x300d93;const _0x499ff1=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x12cb6b,_0x8e3915,{'anchor':_0xfb02e2,'markDeletions':!0x0})['getOperations']()['filter'](_0x1c92fd=>'insert'===_0x1c92fd['type']||'marker'===_0x1c92fd['type']&&_0x1c92fd['name']['startsWith']('$markedRemove')),_0xecafaa=this['_groupAdjacentOperations'](_0x499ff1);let _0xdcce20=0x0;return _0x313a69['model']['change'](_0x636f90=>{for(let _0x59923b=0x0;_0x59923b<_0xecafaa['length'];_0x59923b++){const _0x271bda=_0xecafaa[_0x59923b],_0x248cb3=_0x636f90['createDocumentFragment']();for(const _0x49f002 of _0x445e73['getChildren']())_0x636f90['append'](_0x49f002['_clone'](!0x0),_0x248cb3);for(const _0x130fff of _0x271bda['operationsIsolated'])if('insert'===_0x130fff['type']){const _0x2d0e8f=_0x130fff;_0x2d0e8f['baseVersion']=null,_0x2d0e8f['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x2d0e8f,_0x248cb3),_0x636f90['batch']['addOperation'](_0x130fff),_0x313a69['model']['applyOperation'](_0x130fff);const _0x31e626='suggestion:insertion:id:authorId:'+_0xdcce20++,_0xadd598=_0x313a69['model']['createRange'](_0x2d0e8f['position'],_0x2d0e8f['position']['getShiftedBy'](_0x2d0e8f['howMany']));_0x248cb3['markers']['set'](_0x31e626,_0xadd598);}else{if('marker'===_0x130fff['type']&&_0x130fff['name']['startsWith']('$markedRemove')){const _0x292cf6=_0x130fff,_0x5f2a1a='suggestion:deletion:id:authorId:'+_0xdcce20++;this['_changeOperationOwnerDocument'](_0x292cf6,_0x248cb3),_0x248cb3['markers']['set'](_0x5f2a1a,_0x292cf6['newRange']);}}const _0x3b0165=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x271bda['operationsIsolated'][0x0]),_0x248cb3),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x271bda['operationsIsolated'][_0x271bda['operationsIsolated']['length']-0x1]),_0x248cb3));_0x248cb3['markers']['set'](me+'suggestion-context',new _0x46f2b7(_0x3b0165['start'],_0x3b0165['end'])),_0x300d93['push']({..._0x271bda,'context':this['_createGetContextFn'](_0x248cb3,_0x313a69['data'],{'ellipsisBefore':_0x3b0165['hasContentBefore'],'ellipsisAfter':_0x3b0165['hasContentAfter']}),'content':this['_createGetContentFn'](_0x248cb3,_0x313a69['data'])});}}),_0x300d93;}['markChangePositionInEditorContent'](_0x552d37,_0x2e584a){if(!_0x552d37['length'])return;const _0x4aca0d=_0x552d37[0x0]['parent']['id'],_0x3cc60d=_0x2e584a['elements']['get'](_0x4aca0d);if(!_0x3cc60d)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x4aca0d);const _0x1cbaad=_0x3cc60d['path'],_0x281853=_(this['context']),_0x13e908=_0x281853['model']['document']['history']['getOperations'](_0x2e584a['version']),_0x6fbf7b=[];for(const _0x18737b of _0x552d37){const _0x180b31=_0x18737b['operationsIsolated']['map'](_0x156c46=>this['_translateOperationToEditorContent'](_0x156c46,_0x1cbaad,_0x281853['model']['document']['getRoots']()[0x0]));if(!_0x180b31||!_0x180b31['length'])continue;const _0x3df1cb=_0x180b31['every'](_0x2f1dcb=>'marker'===_0x2f1dcb['type']&&_0x2f1dcb['name']['startsWith']('$markedRemove')),_0x19743e={'document':_0x281853['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x15bc14=mt(_0x180b31,_0x13e908,_0x19743e)['operationsA'];for(const _0x472f41 of _0x15bc14)if('insert'===_0x472f41['type']){const _0x5c5d3d=_0x472f41,_0x3ee00d=_0x5c5d3d['nodes'];let _0xa898c1='';for(const _0xff690b of _0x3ee00d)_0xff690b&&_0xff690b['is']('model:$text')&&(_0xa898c1+=_0xff690b['data']);_0x6fbf7b['push']({'start':_0x5c5d3d['position'],'end':_0x5c5d3d['position'],'type':'insert','groupId':_0x18737b['id'],'text':_0xa898c1});}else{if('marker'===_0x472f41['type']&&_0x472f41['name']['startsWith']('$markedRemove')){const _0x40b86f=_0x472f41;let _0x43c6d7='remove-text';if(_0x3df1cb){const _0x4ac932=this['_findAdjacentContextDistance'](_0x40b86f['newRange']['start'],'backward',_0x281853['model']['schema']),_0x231f69=this['_findAdjacentContextDistance'](_0x40b86f['newRange']['end'],'forward',_0x281853['model']['schema']);if(_0x4ac932||_0x231f69){const _0x264210=_0x40b86f['newRange']['start']['getShiftedBy'](-_0x4ac932),_0x384a37=_0x40b86f['newRange']['end']['getShiftedBy'](_0x231f69);_0x6fbf7b['push']({'start':_0x264210,'end':_0x384a37,'groupId':_0x18737b['id'],'type':'remove-context'});}else _0x43c6d7='remove-only';}_0x6fbf7b['push']({'start':_0x40b86f['newRange']['start'],'end':_0x40b86f['newRange']['end'],'groupId':_0x18737b['id'],'type':_0x43c6d7});}}}this['_insertMarkers'](_0x6fbf7b);}['clearAllMarkers'](){const _0x2eaca5=_(this['context']);_0x2eaca5['model']['change'](_0x464b68=>{for(const _0x4c77a9 of this['_markers']['keys']())_0x2eaca5['model']['markers']['get'](_0x4c77a9)&&_0x464b68['removeMarker'](_0x4c77a9);}),this['_markers']['clear']();}['switchToReadOnly'](){_(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){_(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x359d5e){const _0x55aeda=_(this['context']),_0x4fc48d=_0x55aeda['model'],_0x511c99=_0x359d5e['map'](_0x449ef1=>this['_getMarkersDataForGroup'](_0x449ef1))['flat']();_0x4fc48d['change'](_0xf68b0c=>{for(const _0x1ab601 of _0x511c99){const _0x179959=_0x55aeda['model']['markers']['get'](_0x1ab601['id']);_0x179959&&('insert'===_0x1ab601['type']?_0x4fc48d['insertContent'](_0xf68b0c['createText'](_0x1ab601['text']||''),_0x179959['getRange']()['start']):'remove-text'!==_0x1ab601['type']&&'remove-only'!==_0x1ab601['type']||_0x4fc48d['deleteContent'](_0x4fc48d['createSelection'](_0x179959['getRange']())),_0xf68b0c['removeMarker'](_0x1ab601['id']),this['_markers']['delete'](_0x1ab601['id']));}});}['rejectChange'](_0x54a11a){const _0x66ff73=_(this['context']),_0x151731=this['_getMarkersDataForGroup'](_0x54a11a);_0x66ff73['model']['change'](_0x37ffd2=>{for(const _0x4cd1f5 of _0x151731)_0x37ffd2['removeMarker'](_0x4cd1f5['id']),this['_markers']['delete'](_0x4cd1f5['id']);});}['getEditor'](){return _(this['context']);}['getMarkerElementForChange'](_0x391ab7){const _0x1ee3bc=Array['from'](this['_markers']['values']())['filter'](_0x3d14f5=>_0x3d14f5['groupId']===_0x391ab7);if(!_0x1ee3bc['length'])return null;const _0x3aa246=0x1===_0x1ee3bc['length']?_0x1ee3bc[0x0]:this['_sortMarkers'](_0x1ee3bc)[0x0],_0x55d6af=_(this['context']),_0x3100fc=_0x55d6af['model']['markers']['get'](_0x3aa246['id']);if(!_0x3100fc)return null;const _0x51d4d1=_0x3100fc['getRange'](),_0x1fcc62=_0x55d6af['editing']['view']['getDomRoot']();if(!_0x1fcc62||!_0x51d4d1)return null;const _0x522802=_0x1fcc62['querySelector']('[data-marker-id=\x22'+_0x3aa246['id']+'\x22]');return _0x522802?{'modelRange':_0x51d4d1,'domElement':_0x522802}:null;}['_validateMarkers'](_0x5003b1,_0x559156){const _0x142bcb=Array['from'](this['_markers']['keys']()),_0x46ea67=new Map();for(const _0x1c8507 of _0x142bcb){const _0x1af3c5=_0x5003b1['model']['markers']['get'](_0x1c8507);if(!_0x1af3c5)continue;const _0x48429c=_0x1af3c5['getStart']()['path'][0x0];_0x46ea67['has'](_0x48429c)||_0x46ea67['set'](_0x48429c,[]),_0x46ea67['get'](_0x48429c)['push'](_0x1af3c5);}const _0x2e8c7e=new Set();for(const _0x465c6e of _0x5003b1['model']['document']['differ']['getChanges']()){let _0x17cf5c=-0x1,_0x216dd3=null;if('insert'===_0x465c6e['type'])_0x216dd3=new _0x46f2b7(_0x465c6e['position'],_0x465c6e['position']['getShiftedBy'](_0x465c6e['length'])),_0x17cf5c=_0x465c6e['position']['path'][0x0];else{if('remove'!==_0x465c6e['type'])continue;_0x216dd3=new _0x46f2b7(_0x465c6e['position']),_0x17cf5c=_0x465c6e['position']['path'][0x0];}const _0x35ebfc=_0x46ea67['get'](_0x17cf5c)||[];if(_0x35ebfc['length']){for(const _0x4b6014 of _0x35ebfc)if(_0x216dd3['root']['rootName']===_0x4b6014['getRange']()['root']['rootName']&&('insert'!==_0x465c6e['type']||!_0x216dd3['containsRange'](_0x4b6014['getRange']()))&&(_0x216dd3['isIntersecting'](_0x4b6014['getRange']())||_0x216dd3['start']['isTouching'](_0x4b6014['getRange']()['end'])||_0x216dd3['end']['isTouching'](_0x4b6014['getRange']()['start']))){const _0x13ef11=this['_parseMarkerName'](_0x4b6014['name']);Array['from'](this['_markers']['values']())['filter'](_0x36195c=>_0x36195c['groupId']===_0x13ef11['groupId'])['forEach'](_0x5c3744=>_0x2e8c7e['add'](_0x5c3744['id']));}}}if(_0x2e8c7e['size']){for(const _0x254ea2 of _0x2e8c7e)_0x559156['removeMarker'](_0x254ea2);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x2618ba){for(const {name:_0x2bd5ff,data:_0x1ced8e}of _0x2618ba['model']['document']['differ']['getChangedMarkers']()){if(!_0x2bd5ff['startsWith'](me))continue;const _0x5893ed=_0x1ced8e['oldRange'],_0x291f4b=_0x1ced8e['newRange'],_0x3bc335=_0x5893ed&&'$graveyard'===_0x5893ed['root']['rootName'],_0x2df203=_0x291f4b&&'$graveyard'===_0x291f4b['root']['rootName'];if(_0x3bc335&&_0x2df203)continue;const _0x48b0ae=this['_parseMarkerName'](_0x2bd5ff);this['_markers']['get'](_0x2bd5ff)&&(_0x2df203||!_0x291f4b?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x2bd5ff,'changeId':_0x48b0ae['groupId']}):_0x3bc335&&_0x291f4b&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x2bd5ff,'changeId':_0x48b0ae['groupId']}));}}['_parseMarkerName'](_0x2da61b){const _0x49168a=_0x2da61b['split'](':'),_0x8423ac=(_0x49168a[0x1]||'')['split']('_');return{'prefix':_0x49168a[0x0],'groupId':_0x8423ac[0x0],'suffix':_0x8423ac[0x1]};}['_translateOperationToEditorContent'](_0x5d0515,_0x277a28,_0x29d616){if('insert'===_0x5d0515['type']){const _0x46ff7e=_0x5d0515;return new te(this['_changePosition'](_0x277a28['concat'](_0x46ff7e['position']['offset']),_0x29d616),_0x46ff7e['nodes'],_0x46ff7e['baseVersion']);}if('marker'===_0x5d0515['type']&&_0x5d0515['name']['startsWith']('$markedRemove')){const _0x54d008=_0x5d0515;return new _0x439787(_0x54d008['name'],_0x54d008['oldRange'],this['_changeRange'](_0x54d008['newRange'],_0x277a28['concat'](_0x54d008['newRange']['start']['offset']),_0x277a28['concat'](_0x54d008['newRange']['end']['offset']),_0x29d616),_0x54d008['_markers'],_0x54d008['affectsData'],_0x54d008['baseVersion']);}return _0x5d0515;}['_groupAdjacentOperations'](_0x442b39){if(!_0x442b39['length'])return[];const _0x2ae656=[];let _0x145de8=0x0,_0x43e582=0x0,_0x37b082=[];for(let _0x51ae96=0x0;_0x51ae96<=_0x442b39['length'];_0x51ae96++){const _0x5bc5f2=_0x442b39[_0x51ae96],_0x50c679=_0x442b39[_0x51ae96-0x1];!_0x5bc5f2||_0x50c679&&!this['_getOperationEnd'](_0x50c679)['isTouching'](this['_getOperationStart'](_0x5bc5f2))?(_0x2ae656['push']({'operations':_0x37b082,'operationsIsolated':_0x37b082['map'](_0x3adce0=>this['_shiftOperation'](_0x3adce0['clone'](),-_0x43e582)),'groupOffset':_0x145de8}),_0x37b082=_0x5bc5f2?[_0x5bc5f2]:[],_0x43e582+=_0x145de8,_0x145de8=0x0):_0x37b082['push'](_0x5bc5f2),_0x5bc5f2&&'insert'===_0x5bc5f2['type']&&(_0x145de8+=_0x5bc5f2['howMany']);}return _0x2ae656;}['_findAdjacentContextDistance'](_0x3cd997,_0x1fd35a,_0x1d0e88,_0x1ccaef=0x1){const _0x12e40c=new _0x2daaa0({'startPosition':_0x3cd997,'direction':_0x1fd35a});let _0x2f5526=0x0;for(let _0x1c8515=0x0;_0x1c8515<_0x1ccaef;_0x1c8515++){let _0x489e3b=0x0,_0x52d4f6=!0x1,_0x4a1e03='forward'===_0x1fd35a?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x42dafa}of _0x12e40c)if(_0x42dafa['is']('$textProxy')){const _0x1dcdbb=_0x4a1e03['exec'](_0x42dafa['data']);if(_0x1dcdbb&&_0x1dcdbb['length']){if(_0x489e3b+='forward'===_0x1fd35a?_0x1dcdbb['index']+_0x1dcdbb[0x0]['length']:_0x42dafa['data']['length']-_0x1dcdbb['index'],_0x1dcdbb[0x0]['length']!==_0x42dafa['data']['length'])break;_0x52d4f6=!0x0,_0x4a1e03='forward'===_0x1fd35a?/^\w+/:/\w+$/;}else{if(_0x52d4f6)break;_0x489e3b+=_0x42dafa['offsetSize'];}}else{if(_0x42dafa['is']('element')){_0x1d0e88['isInline'](_0x42dafa)&&!_0x52d4f6&&(_0x489e3b+=0x1);break;}}_0x2f5526+=_0x489e3b,_0x12e40c['jumpTo'](_0x3cd997['getShiftedBy']('forward'===_0x1fd35a?_0x2f5526:-_0x2f5526));}return _0x2f5526;}['_getChangeContext'](_0x2bfc44,_0x4337c6){const _0x20a7d6=_(this['context'])['model']['schema'],_0x35292b=this['_findAdjacentContextDistance'](_0x2bfc44,'backward',_0x20a7d6,0x6),_0x3223d5=this['_findAdjacentContextDistance'](_0x4337c6,'forward',_0x20a7d6,0x6),_0x54d735=_0x2bfc44['getShiftedBy'](-_0x35292b),_0x4309fb=_0x4337c6['getShiftedBy'](_0x3223d5);return{'start':_0x54d735,'end':_0x4309fb,'hasContentBefore':!_0x54d735['isAtStart'],'hasContentAfter':!_0x4309fb['isAtEnd']};}['_insertMarkers'](_0x22d398){const _0x409d43=this['context']['plugins']['get']('AIEditing'),_0x2673d5=new Set();_(this['context'])['model']['change'](_0x5aec90=>{for(const _0x49357f of _0x22d398){const _0x1058fb=''+me+_0x49357f['type']+':'+_0x49357f['groupId']+'_'+_0x409d43['_nextDataId'](_0x2673d5);this['_markers']['set'](_0x1058fb,{'id':_0x1058fb,'groupId':_0x49357f['groupId'],'type':_0x49357f['type'],'text':_0x49357f['text']}),_0x5aec90['addMarker'](_0x1058fb,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5aec90['createRange'](_0x49357f['start'],_0x49357f['end'])});}});}['_createGetContextFn'](_0x289193,_0x439dad,_0x1d77a6){let _0x563d6e='';return()=>{if(!_0x563d6e){const _0x2c488b=_0x439dad['toView'](_0x289193,{'showSuggestionHighlights':!0x0}),_0x2a6bef=_0x2c488b['getChild'](0x0);if(!_0x2a6bef)return'';let _0x540a3e=!0x1;const _0x1afec6=[];for(const _0x23d0e7 of _0x2a6bef['getChildren']())_0x23d0e7['is']('element','span')&&_0x23d0e7['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x540a3e=!0x1),_0x540a3e&&_0x1afec6['push'](_0x23d0e7),_0x23d0e7['is']('element','span')&&_0x23d0e7['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x540a3e=!0x0);_0x2a6bef['_removeChildren'](0x0,_0x2a6bef['childCount']),_0x1d77a6?.['ellipsisBefore']&&_0x2a6bef['_appendChild']('…'),_0x2a6bef['_appendChild'](_0x1afec6),_0x1d77a6?.['ellipsisAfter']&&_0x2a6bef['_appendChild']('…');const _0x36fcce=_0x439dad['htmlProcessor']['domConverter']['viewToDom'](_0x2c488b),_0x3ede1b=_0x439dad['htmlProcessor']['htmlWriter']['getHtml'](_0x36fcce);_0x563d6e=_0x3ede1b;}return _0x563d6e;};}['_createGetContentFn'](_0x31648f,_0x33d088){let _0x234bd5='';return()=>(_0x234bd5||(_0x234bd5=_0x33d088['stringify'](_0x31648f,{'showSuggestionHighlights':!0x0})),_0x234bd5);}['_createGetContentUsingDataIdFn'](_0x1089db,_0x47cbe1,_0x1193df){let _0x5219fc='';return()=>{if(!_0x5219fc){const _0x16d331=_0x1193df['toView'](new ut(_0x1089db)),_0x79672=_0x1193df['htmlProcessor']['domConverter']['viewToDom'](_0x16d331)['querySelector']('[data-id=\x22'+_0x47cbe1+'\x22]');_0x5219fc=_0x79672?.['outerHTML']||'';}return _0x5219fc;};}['_findMarkerElement'](_0x13cbb3,_0x42d47f=0x5){let _0x53ee3e=_0x13cbb3,_0x47c8f6=null;for(let _0x525ac9=0x0;_0x525ac9<_0x42d47f&&_0x53ee3e;_0x525ac9++){if(!_0x53ee3e['className']){_0x53ee3e=_0x53ee3e['parentElement'];continue;}if(!(''+_0x53ee3e['className'])['includes']('ck-ai_review-mode-marker_')){_0x53ee3e=_0x53ee3e['parentElement'];continue;}if(!_0x53ee3e['getAttribute']('data-marker-id'))break;_0x47c8f6=_0x53ee3e;break;}return _0x47c8f6;}['_getMarkersDataForGroup'](_0x335bb6){return Array['from'](this['_markers']['values']())['filter'](_0x24e1dd=>_0x24e1dd['groupId']===_0x335bb6);}['_getOperationStart'](_0x2f4514){return'insert'===_0x2f4514['type']?_0x2f4514['position']:_0x2f4514['newRange']['start'];}['_getOperationEnd'](_0x1527f4,_0x1e9663=!0x1){return'insert'===_0x1527f4['type']?_0x1e9663?_0x1527f4['position']:_0x1527f4['position']['getShiftedBy'](_0x1527f4['howMany']):_0x1527f4['newRange']['end'];}['_shiftOperation'](_0x261242,_0x486048){return'insert'===_0x261242['type']?_0x261242['position']=_0x261242['position']['getShiftedBy'](_0x486048):'marker'===_0x261242['type']&&_0x261242['newRange']&&(_0x261242['newRange']=new _0x46f2b7(_0x261242['newRange']['start']['getShiftedBy'](_0x486048),_0x261242['newRange']['end']['getShiftedBy'](_0x486048))),_0x261242;}['_changeOperationOwnerDocument'](_0xf4da84,_0x417aef){'insert'===_0xf4da84['type']?_0xf4da84['position']=this['_changePositionOwnerDocument'](_0xf4da84['position'],_0x417aef):'marker'===_0xf4da84['type']&&_0xf4da84['newRange']&&(_0xf4da84['newRange']=this['_changeRangeOwnerDocument'](_0xf4da84['newRange'],_0x417aef));}['_changePositionOwnerDocument'](_0x54e68d,_0x40523a){return new gt(_0x40523a,_0x54e68d['path']);}['_changeRangeOwnerDocument'](_0x1fd35f,_0x17560e){return new _0x46f2b7(this['_changePositionOwnerDocument'](_0x1fd35f['start'],_0x17560e),this['_changePositionOwnerDocument'](_0x1fd35f['end'],_0x17560e));}['_changePosition'](_0x35a9ab,_0x5ad5d9){return new gt(_0x5ad5d9,[..._0x35a9ab]);}['_changeRange'](_0x105acf,_0x4975a1,_0x424807,_0xc22070){return new _0x46f2b7(this['_changePosition'](_0x4975a1,_0xc22070),this['_changePosition'](_0x424807,_0xc22070));}['_sortMarkers'](_0x3c76c5){const _0x3c0fde=_0x20c6ca=>{switch(_0x20c6ca){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x3c76c5['sort']((_0x389633,_0x2f2308)=>_0x3c0fde(_0x389633['type'])-_0x3c0fde(_0x2f2308['type']));}['_hasSameTopLevelElement'](_0xf5e29e,_0x1a3f1d){const _0x4c3593=_0xf5e29e['getChild'](0x0),_0x40649e=_0x1a3f1d['getChild'](0x0);return!(!_0x4c3593||!_0x40649e)&&((!_0x4c3593['is']('element')||!_0x40649e['is']('element')||_0x4c3593['name']===_0x40649e['name'])&&!(_0x4c3593['is']('element')&&!_0x40649e['is']('element')||!_0x4c3593['is']('element')&&_0x40649e['is']('element')));}}class Ya extends _0x47d85c{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,Ai as AIAdapter,qn as AIAssistant,pe as AIAssistantUI,U as AIBalloon,Ba as AIChat,i as AIChatController,o as AIChatHistory,J as AIChatHistoryController,K as AIChatHistoryUI,s as AIChatUI,l as AIConnector,a as AIEditing,Ka as AIEditorIntegration,It as AIQuickActionType,Fa as AIQuickActions,ii as AIQuickActionsUI,Rr as AIRequestError,vs as AIReviewCheck,Cs as AIReviewCheckResult,xs as AIReviewCheckRun,Ya as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,g as AITabs,ta as AITextAdapter,ft as AIToggleButtonUI,zn as AWSTextAdapter,Xn as OpenAITextAdapter,wi as ShowAIAssistantCommand,io as ToggleAICommand,ms as createResizeButton,Qn as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x5f3288,Command as Nt,ContextPlugin as _0x171820,Editor as st}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x308403,IconCheck as _0x547952,IconError as _0x129806,IconSubmit as _0x2a3f1e,IconAIHistory as Ht,IconMagicWand as _0x1dd138,IconRobotPencil as _0x4c398b,IconMaximize as _0x2e7c4e,IconMinimize as to,IconDocumentWithLoupe as _0x13603c,IconAddComment as _0x4c5817,IconShowChangesOn as _0xe9dd5d,IconShowChangesOff as _0x41d5a1,IconDocument as _0x391967,IconThreeStars as _0xa2a32e,IconRemove as _0xdc18ef,IconDocumentWithCheckmark as _0x368b6c,IconDocumentWithCross as _0x43e783,IconLoupe as _0x5a0eff,IconCancel as _0x510307,IconStop as _0x4c89d2,IconAIChat as _t,IconPlus as _0x5c1cc1,IconPin as _0x324381,IconThreeHorizontalDots as _0x56f15d,IconChevronRight as _0x3ced14,IconInfo as _0x136575,IconOutdated as _0x50e8a9,IconEye as _0x58391f,IconEyeCrossedOut as _0x3b8dda,IconAIReview as _0x3451c9}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x223274,CKEditorError as _0x29f184,ObservableMixin as _0x4572ab,global as _0x110318,isVisible as _0x4b2614,Rect as _0x31eb3f,Collection as _0x5d69ef,FocusTracker as ts,KeystrokeHandler as _0x1f1bc5,first as _0x592c76,toArray as _0x7703f2,EmitterMixin as _0x135bec,logWarning as _0xadd6c3,scrollViewportToShowTarget as _0x2992c3,logError as ot,ResizeObserver as _0x474d80,_isMotionReduced as It,scrollAncestorsToShowTarget as _0x38bec5,DomEmitterMixin as _0x556252}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x541968,ButtonView as _0x14ee0a,View as _0x19a8c6,SpinnerView as _0x577daf,IconView as _0x50b9df,AutocompleteView as _0x4dc60c,ListView as _0x556745,ListItemGroupView as _0x4372b2,ListItemView as _0x2269a3,ButtonLabelView as _0x53816d,FocusCycler as $t,createLabeledTextarea as _0x5c1a66,Dialog as _0x10183e,createDropdown as _0x10d828,addMenuToDropdown as _0x12a70a,MenuBarMenuView as _0x38710d,MenuBarMenuListItemButtonView as _0x5b3955,DialogViewPosition as _0x2ccaf1,MenuBarMenuListView as ti,MenuBarMenuListItemView as _0x44e2e2,UIModel as _0x3cd526,SplitButtonView as _0x37ad52,BalloonPanelView as _0x500981,BodyCollection as qt,clickOutsideHandler as _0x29a34e,ListItemButtonView as _0x8cd418,ViewCollection as _0xf07a6b,addListToDropdown as _0x21ea2c,submitHandler as _0x1e2b1f,LabeledFieldView as _0x5cba56,createLabeledInputText as th,FormHeaderView as _0x5720b1,HighlightedTextView as _0x39d67c,FileDialogButtonView as _0xbecc3f,InputTextView as _0x2efa28,SearchTextView as _0x3bb44f,DropdownMenuButtonView as _0x36e81a,DropdownMenuPanelPositioningFunctions as _0x3e8342,BalloonToolbar as zt,FormRowView as _0x222658,TextareaView as _0xf80c43}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x49596b,ClipboardMarkersUtils as _0x41836c}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x162ba2,ViewDataTransfer as _0x1cb9e3,ViewUpcastWriter as _0x27088e,Matcher as _0x5cfc1b,_DetachOperation as _0x1609ec,_insertIntoModelNodeList as _0x5c757f,_removeFromModelNodeList as _0x41016b,ModelRange as _0x59485f,ViewDowncastWriter as kt,transformOperationSets as _0x33bff0,ModelDocumentFragment as _0x25eb17,ModelPosition as _0x58772b,ModelTreeWalker as _0x1fbb34,InsertOperation as te,MarkerOperation as _0x339507}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4efc88,escape as _0x4e9308,escapeRegExp as _0x418237}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x5791f9,InvokeModelWithResponseStreamCommand as _0x3f5e91,InvokeModelCommand as _0x41e453}from'@aws-sdk/client-bedrock-runtime';import{createParser as wt}from'eventsource-parser';import{parseDocument as _0x2817be}from'htmlparser2';import{isTag as _0x41757a,findOne as gt,getParent as _0xb3e946,findAll as _0x23a287,removeElement as _0x33c6d9,replaceElement as _0x173cd4,prepend as _0x53ea51,prependChild as _0x51c386,appendChild as _0x54c92e,append as _0x2b81f1,find as _0x3bb1ba,isComment as _0x5581e1,getChildren as _0x119327,textContent as _0x54cfdd}from'domutils';import _0xec369b from'dom-serializer';import{Document as mt,Element as _0x2c5bc4,Text as _0x2e2b16,cloneNode as _0x54d7fb,isDocument as _0x25fa62,isText as _0x23320c,NodeWithChildren as _0x4b2d52}from'domhandler';import{MarkdownGfmMdToHtml as _0x3205a1}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0xf3fa2c,getAllMarkersDomElementsSorted as _0x1bb7e4,DocumentCompare as _0x2b3cb3,DATA_ID_MODEL_ATTRIBUTE as ct,ConfirmMixin as _0x36aabc,LateFocusDropdownButtonView as _0xfe9b05,DATA_ID_VIEW_ATTRIBUTE as _0x413d9f}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x5e9a78}from'es-toolkit';import{IconThumbUp as _0x3e3995,IconThumbDown as _0x51e959,IconCopy as _0x4a0fe1,IconCheck as _0x270303,IconShowChangesOff as _0x490482,IconShowChangesOn as _0x11ea32,IconWeb as _0x2870b9,IconNextArrow as _0x346a5d,IconPreviousArrow as _0x25d049,IconAI as Ct,IconClose as _0x5e2897,IconSelection as _0x4d97da,IconFileUpload as _0x5b8c8e,IconLink as _0x339b47,IconDocument as _0x776ddc,IconBulb as _0x49c2da,IconDocumentOutline as _0x625012,IconPaperClip as _0x3725c8,IconBrowseFiles as _0x44b793,IconDropdownArrow as _0xf874d9,IconAIAskAI as _0x9ba23f,IconAIQuickActions as _0x32dec3,IconAIChatCommands as Ut,IconAIImproveWriting as Mt,IconAIContinueWriting as Kt,IconAIGrammarCheck as Rt,IconAIAdjustLength as Qt,IconAIChangeTone as xt,IconAITranslate as Dt,IconAIOther as Lt,IconRefresh as _0x395185}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x556937 from'morphdom';import{SuggestionsConversion as Pt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x1896dd}from'diff';const ei='_ungrouppedCommands';function z(_0xb517a5,_0x443c00){const _0x492418=(0x0,_0x443c00['t'])('Other');return _0xb517a5['length']?'groupId'in _0xb517a5[0x0]?_0xb517a5:[{'groupId':ei,'groupLabel':_0x492418,'order':0x1/0x0,'commands':_0xb517a5}]:[{'groupId':ei,'groupLabel':_0x492418,'order':0x1/0x0,'commands':[]}];}const Fn=globalThis['DataTransfer'],q='ai-ui';class F extends _0x5f3288{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4fe82d}=this,_0x2442b2=['ck-fake-ai-selection'];_0x4fe82d['config']['get']('ai.assistant.useTheme')&&_0x2442b2['push']('ck-ai-assistant-ui_theme'),_0x4fe82d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':q,'view':{'classes':_0x2442b2,'priority':0xc}}),_0x4fe82d['conversion']['for']('editingDowncast')['markerToElement']({'model':q,'view':(_0x232371,{writer:_0x157392})=>{if(!_0x232371['markerRange']['isCollapsed'])return null;const _0x5bbe67=_0x157392['createUIElement']('span');return _0x157392['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5bbe67),_0x5bbe67;}});}['afterInit'](){!async function(_0x4586e3){const _0xa2f423=_0x20441b([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x3c84b6=0x3dffc4e1,_0x411f7e=0x3df8b339^_0x3c84b6,_0x5e9bf7=window[_0x20441b([0x44,0x61,0x74,0x65])][_0x20441b([0x6e,0x6f,0x77])](),_0x31bff6=_0x4586e3[_0x20441b([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2754fa=new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5dfcf6=>{_0x31bff6[_0x20441b([0x6f,0x6e,0x63,0x65])](_0x20441b([0x72,0x65,0x61,0x64,0x79]),_0x5dfcf6);}),_0x42cc1a={[_0x20441b([0x6b,0x74,0x79])]:_0x20441b([0x45,0x43]),[_0x20441b([0x75,0x73,0x65])]:_0x20441b([0x73,0x69,0x67]),[_0x20441b([0x63,0x72,0x76])]:_0x20441b([0x50,0x2d,0x32,0x35,0x36]),[_0x20441b([0x78])]:_0x20441b([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x20441b([0x79])]:_0x20441b([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x20441b([0x61,0x6c,0x67])]:_0x20441b([0x45,0x53,0x32,0x35,0x36])},_0x2f3cb7=_0x31bff6[_0x20441b([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x20441b([0x67,0x65,0x74])](_0x20441b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x507a09(){let _0x325178,_0x5364d8=null,_0x1d1316=null;try{if(_0x2f3cb7==_0x20441b([0x47,0x50,0x4c]))return _0x20441b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x325178=_0x3e6e7c(),!_0x325178)return _0x20441b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x325178[_0x20441b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1d1316=_0x449e07(_0x325178[_0x20441b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x325178[_0x20441b([0x6a,0x74,0x69])])),await _0x1e87fe()?_0x38c4d5()?_0x2f5397()?_0x20441b([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2e46e3()?(_0x325178[_0x20441b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x20441b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x5364d8=_0x20aa61(_0x20441b([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x325178[_0x20441b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x20441b([0x74,0x72,0x69,0x61,0x6c])&&(_0x5364d8=_0x20aa61(_0x20441b([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x47fa12()):_0x20441b([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x20441b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x20441b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x20441b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2f5397(){const _0xc39afb=[_0x20441b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x20441b([0x74,0x72,0x69,0x61,0x6c])][_0x20441b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x325178[_0x20441b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5e9bf7/0x3e8:0xe10*_0x411f7e;return _0x325178[_0x20441b([0x65,0x78,0x70])]<_0xc39afb;}function _0x38c4d5(){const _0x5116ee=_0x325178[_0x20441b([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5116ee&&(!!_0x5116ee[_0x20441b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x20441b([0x2a]))||!!_0x5116ee[_0x20441b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x20441b([0x41,0x49])));}function _0x2e46e3(){const _0xa9a8e9=_0x325178[_0x20441b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0xa9a8e9||0x0==_0xa9a8e9[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x468216}=new URL(window[_0x20441b([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0xa9a8e9[_0x20441b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x468216))return!0x0;const _0x1c939f=_0x468216[_0x20441b([0x73,0x70,0x6c,0x69,0x74])](_0x20441b([0x2e]));return _0xa9a8e9[_0x20441b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x27f991=>_0x27f991[_0x20441b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x20441b([0x2a])))[_0x20441b([0x6d,0x61,0x70])](_0x2b129f=>_0x2b129f[_0x20441b([0x73,0x70,0x6c,0x69,0x74])](_0x20441b([0x2e])))[_0x20441b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5cda11=>_0x5cda11[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x1c939f[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x20441b([0x6d,0x61,0x70])](_0x2ff4d0=>Array(_0x1c939f[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2ff4d0[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x20441b([0x66,0x69,0x6c,0x6c])](_0x2ff4d0[0x0]===_0x20441b([0x2a])?_0x20441b([0x2a]):'')[_0x20441b([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2ff4d0))[_0x20441b([0x73,0x6f,0x6d,0x65])](_0x599c03=>_0x1c939f[_0x20441b([0x65,0x76,0x65,0x72,0x79])]((_0x1bd925,_0x44fbbd)=>_0x599c03[_0x44fbbd]===_0x1bd925||_0x599c03[_0x44fbbd]===_0x20441b([0x2a])));}function _0x47fa12(){return _0x5364d8&&_0x1d1316?new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x9371cd,_0x17415d)=>{_0x5364d8[_0x20441b([0x74,0x68,0x65,0x6e])](_0x9371cd,_0x17415d),_0x1d1316[_0x20441b([0x74,0x68,0x65,0x6e])](_0x52dd95=>{_0x52dd95!=_0x20441b([0x56,0x61,0x6c,0x69,0x64])&&_0x9371cd(_0x52dd95);},_0x17415d);}):_0x5364d8||_0x1d1316||_0x20441b([0x56,0x61,0x6c,0x69,0x64]);}}function _0x449e07(_0xf4f5ae,_0x342f2c){return new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x203465=>{if(_0x5e44eb())return _0x203465(_0x20441b([0x56,0x61,0x6c,0x69,0x64]));_0x1afb24(),_0x31bff6[_0x20441b([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x20441b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x2bb168=!0x1;const _0x48d3a0=_0x223274();function _0x73fcf6(_0x52ca30){return!!_0x52ca30&&(typeof _0x52ca30===_0x20441b([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x52ca30===_0x20441b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x52ca30[_0x20441b([0x74,0x68,0x65,0x6e])]===_0x20441b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x52ca30[_0x20441b([0x63,0x61,0x74,0x63,0x68])]===_0x20441b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x34649a(_0xdd1535){_0x435be2(_0xdd1535)[_0x20441b([0x74,0x68,0x65,0x6e])](_0x336bfa=>{if(!_0x336bfa||_0x336bfa[_0x20441b([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x20441b([0x6f,0x6b]))return _0x20441b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x31c13e(_0x3de129(_0x48d3a0+_0x342f2c))!=_0x336bfa[_0x20441b([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x20441b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x20441b([0x56,0x61,0x6c,0x69,0x64]);})[_0x20441b([0x74,0x68,0x65,0x6e])](_0x156bbb=>(_0x5119fa(),_0x156bbb),()=>{const _0x453b3d=_0x224525();return null==_0x453b3d?(_0x5119fa(),_0x20441b([0x56,0x61,0x6c,0x69,0x64])):_0x20441b(_0x5e9bf7-_0x453b3d>(0x19f340e1^_0x3c84b6)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x20441b([0x74,0x68,0x65,0x6e])](_0x203465)[_0x20441b([0x63,0x61,0x74,0x63,0x68])](()=>{_0x203465(_0x20441b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x10601f=0x3dc92a61^_0x3c84b6;function _0x5119fa(){const _0x45fdbf=_0x20441b([0x6c,0x6c,0x63,0x74,0x2d])+_0x31c13e(_0x3de129(_0xf4f5ae)),_0x406f37=_0x5d743d(_0x31c13e(window[_0x20441b([0x4d,0x61,0x74,0x68])][_0x20441b([0x63,0x65,0x69,0x6c])](_0x5e9bf7/_0x10601f)));window[_0x20441b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x20441b([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x45fdbf,_0x406f37);}function _0x224525(){const _0x51d4e3=_0x20441b([0x6c,0x6c,0x63,0x74,0x2d])+_0x31c13e(_0x3de129(_0xf4f5ae)),_0x5b30a1=window[_0x20441b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x20441b([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x51d4e3);return _0x5b30a1?window[_0x20441b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5d743d(_0x5b30a1),0x10)*_0x10601f:null;}function _0x435be2(_0x4f36ca){return new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x15c54d,_0xa771ed)=>{_0x4f36ca[_0x20441b([0x74,0x68,0x65,0x6e])](_0x15c54d,_0xa771ed),window[_0x20441b([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0xa771ed,0x3dfe1021^_0x3c84b6);});}}_0x31bff6[_0x20441b([0x6f,0x6e])](_0x20441b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3679ef,_0x599258)=>{if(_0x599258[0x0]!=_0xf4f5ae)return _0x203465(_0x20441b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x599258[0x1]={..._0x599258[0x1],[_0x20441b([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x48d3a0};},{[_0x20441b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x20441b([0x68,0x69,0x67,0x68])}),_0x31bff6[_0x20441b([0x6f,0x6e])](_0x20441b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xcd8b4c=>{_0x73fcf6(_0xcd8b4c[_0x20441b([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x2bb168=!0x0,_0x34649a(_0xcd8b4c[_0x20441b([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x20441b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x20441b([0x6c,0x6f,0x77])}),_0x2754fa[_0x20441b([0x74,0x68,0x65,0x6e])](()=>{_0x2bb168||_0x203465(_0x20441b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5e44eb(){return _0x31bff6[_0x20441b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x20441b([0x76,0x69,0x65,0x77])][_0x20441b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x20441b([0x61,0x75,0x74,0x6f]);}function _0x1afb24(){_0x31bff6[_0x20441b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x20441b([0x76,0x69,0x65,0x77])][_0x20441b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x20441b([0x61,0x75,0x74,0x6f]);}}function _0x20aa61(_0x99bd5e){const _0xfd1214=[new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x55b102=>setTimeout(_0x55b102,0x3df6fa2d^_0x3c84b6)),_0x2754fa[_0x20441b([0x74,0x68,0x65,0x6e])](()=>new window[(_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4dead0=>{let _0x1b77e0=0x0;_0x31bff6[_0x20441b([0x6d,0x6f,0x64,0x65,0x6c])][_0x20441b([0x6f,0x6e])](_0x20441b([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3caf43,_0x2eb771)=>{_0x2eb771[0x0][_0x20441b([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1b77e0++,_0x1b77e0==(0x3dffc519^_0x3c84b6)&&(_0x4dead0(),_0x3caf43[_0x20441b([0x6f,0x66,0x66])]());});}))];return window[_0x20441b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x20441b([0x72,0x61,0x63,0x65])](_0xfd1214)[_0x20441b([0x74,0x68,0x65,0x6e])](()=>_0x99bd5e);}async function _0x1ab77b(){await _0x2754fa,_0x31bff6[_0x20441b([0x6d,0x6f,0x64,0x65,0x6c])][_0x20441b([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x82a304,_0x31bff6[_0x20441b([0x6d,0x6f,0x64,0x65,0x6c])][_0x20441b([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x82a304,_0x31bff6[_0x20441b([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x20441b([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x522fb7(_0x34e54a){const _0x94309d=_0x3fddd1();_0x31bff6[_0x94309d]=_0x20441b([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x34e54a,_0x34e54a!=_0x20441b([0x56,0x61,0x6c,0x69,0x64])&&_0x1ab77b();}function _0x3fddd1(){const _0x1d0eb3=window[_0x20441b([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x20441b([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x20441b([0x6e,0x6f,0x77])]())[_0x20441b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x20441b([0x2e]),'');let _0xc63675=_0x20441b([0x6e]);for(let _0x36af64=0x0;_0x36af64<_0x1d0eb3[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x36af64+=0x2){let _0x8fe65b=window[_0x20441b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1d0eb3[_0x20441b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x36af64,_0x36af64+0x2));_0x8fe65b>=_0xa2f423[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x8fe65b-=_0xa2f423[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xc63675+=_0xa2f423[_0x8fe65b];}return _0xc63675;}function _0x3e6e7c(){const _0x247ff6=_0x2f3cb7[_0x20441b([0x73,0x70,0x6c,0x69,0x74])](_0x20441b([0x2e]));if(0x3!=_0x247ff6[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x40c74e(_0x247ff6[0x1]);function _0x40c74e(_0x55ba3c){const _0x181737=_0x2054a1(_0x55ba3c);return _0x181737&&_0x541e14()?_0x181737:null;function _0x541e14(){const _0x4a76a5=_0x181737[_0x20441b([0x6a,0x74,0x69])],_0x272abc=window[_0x20441b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4a76a5[_0x20441b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4a76a5[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x44ae6c={..._0x181737,[_0x20441b([0x6a,0x74,0x69])]:_0x4a76a5[_0x20441b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4a76a5[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x44ae6c[_0x20441b([0x76,0x63])],_0x3de129(_0x44ae6c)==_0x272abc;}}}async function _0x1e87fe(){let _0x1c3bd4=!0x0;try{const _0x210ebf=_0x2f3cb7[_0x20441b([0x73,0x70,0x6c,0x69,0x74])](_0x20441b([0x2e])),[_0x441c6e,_0x5f5022,_0x4c42f7]=_0x210ebf;return _0x1a1b22(_0x441c6e),await _0xb3f1f6(_0x441c6e,_0x5f5022,_0x4c42f7),_0x1c3bd4;}catch{return!0x1;}function _0x1a1b22(_0x2068d3){const _0x24d94b=_0x2054a1(_0x2068d3);_0x24d94b&&_0x24d94b[_0x20441b([0x61,0x6c,0x67])]==_0x20441b([0x45,0x53,0x32,0x35,0x36])||(_0x1c3bd4=!0x1);}async function _0xb3f1f6(_0x4665c9,_0x501df4,_0x220b7b){const _0x568a47=window[_0x20441b([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x20441b([0x66,0x72,0x6f,0x6d])](_0xb17f26(_0x220b7b),_0x1b77cf=>_0x1b77cf[_0x20441b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x143bc9=new window[(_0x20441b([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x20441b([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4665c9+_0x20441b([0x2e])+_0x501df4),_0x1cfb60=window[_0x20441b([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x20441b([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1cfb60)return;const _0x2b63fa=await _0x1cfb60[_0x20441b([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x20441b([0x6a,0x77,0x6b]),_0x42cc1a,{[_0x20441b([0x6e,0x61,0x6d,0x65])]:_0x20441b([0x45,0x43,0x44,0x53,0x41]),[_0x20441b([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x20441b([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x20441b([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1cfb60[_0x20441b([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x20441b([0x6e,0x61,0x6d,0x65])]:_0x20441b([0x45,0x43,0x44,0x53,0x41]),[_0x20441b([0x68,0x61,0x73,0x68])]:{[_0x20441b([0x6e,0x61,0x6d,0x65])]:_0x20441b([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2b63fa,_0x568a47,_0x143bc9)||(_0x1c3bd4=!0x1);}}function _0x2054a1(_0x4972c0){return _0x4972c0[_0x20441b([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x20441b([0x65,0x79]))?JSON[_0x20441b([0x70,0x61,0x72,0x73,0x65])](_0xb17f26(_0x4972c0)):null;}function _0xb17f26(_0x855849){return window[_0x20441b([0x61,0x74,0x6f,0x62])](_0x855849[_0x20441b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x20441b([0x2b]))[_0x20441b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x20441b([0x2f])));}function _0x3de129(_0x471ca4){let _0x13f8c8=0x1505;function _0x2a448e(_0x540896){for(let _0x24096d=0x0;_0x24096d<_0x540896[_0x20441b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x24096d++){const _0x18761e=_0x540896[_0x20441b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x24096d);_0x13f8c8=(_0x13f8c8<<0x5)+_0x13f8c8+_0x18761e,_0x13f8c8&=_0x13f8c8;}}function _0x23693d(_0xd53199){Array[_0x20441b([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xd53199)?_0xd53199[_0x20441b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x23693d):_0xd53199&&typeof _0xd53199==_0x20441b([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x20441b([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xd53199)[_0x20441b([0x73,0x6f,0x72,0x74])]()[_0x20441b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x246eb6,_0x54e5da])=>{_0x2a448e(_0x246eb6),_0x23693d(_0x54e5da);}):_0x2a448e(window[_0x20441b([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xd53199));}return _0x23693d(_0x471ca4),_0x13f8c8>>>0x0;}function _0x31c13e(_0x3c74ca){return _0x3c74ca[_0x20441b([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x20441b([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x20441b([0x30]));}function _0x5d743d(_0x3c3889){return _0x3c3889[_0x20441b([0x73,0x70,0x6c,0x69,0x74])]('')[_0x20441b([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x20441b([0x6a,0x6f,0x69,0x6e])]('');}function _0x82a304(){}function _0x20441b(_0x5eb23f){return _0x5eb23f['map'](_0x33d5ed=>String['fromCharCode'](_0x33d5ed))['join']('');}_0x522fb7(await _0x507a09());}(this);}['showFakeVisualSelection'](){const _0x49a1ce=this['editor']['model'];_0x49a1ce['change'](_0xb75c43=>{const _0x50ce05=_0x49a1ce['document']['selection']['getRanges']();let _0x5c338c=0x0;for(const _0x3b286b of _0x50ce05){const _0x55fab6=q+':'+_0x5c338c;if(_0x49a1ce['markers']['has'](_0x55fab6))_0xb75c43['updateMarker'](_0x55fab6,{'range':_0x3b286b});else{if(_0x3b286b['start']['isAtEnd']){const _0x5b26df=_0x3b286b['start']['getLastMatchingPosition'](({item:_0x135f81})=>!_0x49a1ce['schema']['isContent'](_0x135f81),{'boundaries':_0x3b286b});_0xb75c43['addMarker'](_0x55fab6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xb75c43['createRange'](_0x5b26df,_0x3b286b['end'])});}else _0xb75c43['addMarker'](_0x55fab6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3b286b});}_0x5c338c++;}});}['hideFakeVisualSelection'](){const _0x518329=this['editor']['model'],_0x22e973=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](q));_0x22e973['length']&&_0x518329['change'](_0x58104b=>{_0x22e973['forEach'](_0x14ec03=>{_0x58104b['removeMarker'](_0x14ec03);});});}['insertContent'](_0x1d2835,_0x544073){const _0x5add61=this['_getAISelection'](),_0x79469e=_0x544073||_0x5add61['getFirstRange']();this['editor']['model']['canEditAt'](_0x79469e)&&this['editor']['model']['change'](_0x3e4035=>{this['hideFakeVisualSelection'](),_0x544073||this['_resetContentOfSelectedTableCells'](_0x3e4035,_0x5add61),this['_pasteHTMLUsingClipboard']({'insertAt':_0x79469e,'writer':_0x3e4035,'html':_0x1d2835});});}['insertContentBelow'](_0x57bfe1){const {model:_0x5f187e}=this['editor'],_0x4f59a9=this['_getAISelection']();_0x5f187e['change'](()=>{const _0x121fc6=this['_prepareTableInsertBelowPosition'](_0x57bfe1,_0x4f59a9)||this['_getDefaultInsertBelowPosition'](_0x4f59a9);this['insertContent'](_0x57bfe1,_0x121fc6);});}['_getAISelection'](){const _0x13fbe7=this['editor']['model'],_0x20c247=Array['from'](_0x13fbe7['markers']['getMarkersGroup'](q))['map'](_0x47782b=>_0x47782b['getRange']());return _0x13fbe7['createSelection'](_0x20c247);}['_pasteHTMLUsingClipboard']({writer:_0xfab793,html:_0x3ac6da,insertAt:_0x24c906}){const {view:_0x47e889}=this['editor']['editing'],_0x101039=this['editor']['plugins']['get'](_0x49596b),_0x27ea5e=new Fn();_0x27ea5e['setData']('text/html',_0x3ac6da);const _0x3b79e6=new ClipboardEvent('paste',{'clipboardData':_0x27ea5e}),_0x306f87=new _0x162ba2(_0x47e889,_0x3b79e6,{'dataTransfer':new _0x1cb9e3(_0x27ea5e)});_0xfab793['setSelection'](_0x24c906);const _0x29dcce=(_0x3fbe7d,_0x4c551c)=>{_0x4c551c['resultRange']&&_0xfab793['setSelection'](_0x4c551c['resultRange']);};_0x101039['once']('contentInsertion',_0x29dcce,{'priority':'lowest'}),_0x47e889['document']['fire']('paste',_0x306f87),_0x101039['off']('contentInsertion',_0x29dcce);}['_getDefaultInsertBelowPosition'](_0x3fce80){const {model:_0x241104}=this['editor'],_0x376957=Array['from'](_0x3fce80['getSelectedBlocks']());return _0x376957['length']?_0x241104['createPositionAfter'](_0x376957['pop']()):_0x3fce80['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5249c2,_0x1e30c3){const {model:_0x567c4f,plugins:_0x199897}=this['editor'];if(_0x199897['has']('TableUtils')){const _0x120175=_0x199897['get']('TableUtils')['getSelectedTableCells'](_0x1e30c3);if(_0x120175['length']){const _0x484573=this['_getTableRowCountFromContent'](_0x5249c2),_0x1dfbfb=this['_createEmptyTableRows'](_0x120175,_0x484573);return _0x567c4f['createPositionAt'](_0x1dfbfb,0x0);}}return null;}['_getTableRowCountFromContent'](_0x4cfaae){const _0x1679f8=this['editor']['plugins']['get']('TableUtils'),_0x598b4c=this['editor']['data']['parse'](_0x4cfaae),_0x31c4bb=Array['from'](_0x598b4c['getChildren']())['filter'](_0x30f495=>_0x30f495['is']('element','table'));let _0x1a2619=0x0;return _0x31c4bb['forEach'](_0x1c1b7c=>{_0x1a2619+=_0x1679f8['getRows'](_0x1c1b7c);}),_0x1a2619;}['_createEmptyTableRows'](_0x1eca9d,_0x1fa1ef){const _0x5259fe=this['editor']['plugins']['get']('TableUtils'),_0x278200=_0x5259fe['getRowIndexes'](_0x1eca9d),_0x20e0bf=_0x5259fe['getColumnIndexes'](_0x1eca9d),_0xdcd605=_0x278200['last']+0x1,_0x3c90b7=_0x20e0bf['first'],_0x11f027=_0x1eca9d[0x0]['findAncestor']('table');for(let _0xb83bc9=0x0;_0xb83bc9<_0x1fa1ef;_0xb83bc9++)_0x5259fe['insertRows'](_0x11f027,{'at':_0xdcd605});return _0x11f027['getChild'](_0xdcd605)['getChild'](_0x3c90b7);}['_resetContentOfSelectedTableCells'](_0x4b486d,_0x348e1a){const {plugins:_0x2b9f60}=this['editor'],{model:_0x531310}=_0x4b486d;if(!_0x2b9f60['has']('TableUtils'))return;_0x2b9f60['get']('TableUtils')['getSelectedTableCells'](_0x348e1a)['length']&&_0x531310['deleteContent'](_0x348e1a);}}class ni extends _0x5f3288{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x29f184('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x1c2c10){super(_0x1c2c10),this['name']='AIRequestError';}}function Yn(_0x38c7a1,_0x9da892,_0x5d6f55){const t=_0x38c7a1['t'];switch(_0x9da892){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x5d6f55);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5d6f55);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x5d6f55);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x9da892;}}class ai extends Nt{['_commandDefinitions'];constructor(_0x240955,_0x413b9c){super(_0x240955),this['_commandDefinitions']=_0x413b9c,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x107c98,_0x2e349c,_0x3aa273)=>{this['isEnabled']&&(this['enabledCommandsIds']=cs(this['_commandDefinitions'],_0x3aa273));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x14f9e9,_0x3b2e0c,_0x4dc4eb)=>{this['enabledCommandsIds']=_0x4dc4eb?cs(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x114ccb=this['editor']['model'];this['_hasContext']=function(_0x13a4d0){const _0x22edcf=_0x13a4d0['document']['selection'];return _0x22edcf['isCollapsed']?0x0!==[..._0x22edcf['getSelectedBlocks']()]['length']&&![..._0x22edcf['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x13a4d0['hasContent'](_0x22edcf['getFirstRange']());}(_0x114ccb);const _0x50bff1=_0x114ccb['document']['selection'],_0x400dc1=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x12c2c7 of _0x50bff1['getRanges']())for(const _0x1fb736 of _0x12c2c7['getItems']())if(_0x1fb736['is']('element')&&_0x400dc1['includes'](_0x1fb736['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x76de00='',_0x323110='',_0x5a3d33='custom'){this['editor']['plugins']['get'](G)['showUI'](_0x76de00,_0x323110,_0x5a3d33);}}function cs(_0x5a2799,_0x5822f9){const _0x26ec0b=new Set();for(const _0x4953a5 of _0x5a2799['values']())(_0x5822f9||!0x1===_0x4953a5['requiresContent'])&&_0x26ec0b['add'](_0x4953a5['id']);return Array['from'](_0x26ec0b);}const as=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class oi extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x4572ab(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x38a64c,_0x5189d0,_0x369daa){super(),this['editor']=_0x38a64c,this['textAdapter']=_0x5189d0,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x369daa,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x284d51,_0x4114c8,_0xe121b5)=>{this['view']['value']=this['_sanitizeHTML'](_0xe121b5);}),this['listenTo'](this['view'],'submitPrompt',(_0x29378e,_0x23632b)=>{const _0x3bf661=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x23632b,_0x3bf661,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x19b346,query:_0x5f1dfe,htmlContent:_0x4a4181,label:_0x339171,mainActionLabel:_0x271bfe}){this['view']['prompt']=_0x339171,this['view']['mainAction']=_0x271bfe,this['initialContext']=_0x4a4181,_0x5f1dfe&&(this['view']['isRendered']?this['_handleQuery'](_0x5f1dfe,_0x4a4181,_0x19b346,_0x339171):this['view']['once']('render',()=>{this['_handleQuery'](_0x5f1dfe,_0x4a4181,_0x19b346,_0x339171);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x20371a,_0x14ad04,_0x287560,_0x23049e){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x14ad04,this['previousQuery']=_0x20371a,this['previousLabel']=_0x23049e||_0x20371a,this['previousActionId']=_0x287560,new Promise(_0x4106a7=>{this['textAdapter']['makeRequest']({'query':_0x20371a,'context':_0x14ad04,'onData':_0x11e89c=>{this['currentResponse']=_0x11e89c,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x287560})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3c5351=>{_0x3c5351 instanceof tr?this['view']['handleError'](_0x3c5351['message']):this['view']['handleError'](),_0x4106a7();})['finally'](()=>{this['stopProcessing'](),_0x4106a7();});});}['_parseAndNormalizeContent'](_0x1e87ea,_0x1b8f24=!0x1){const _0x25cddc=as['exec'](_0x1e87ea);_0x1e87ea=_0x25cddc?_0x1e87ea['substring'](_0x25cddc[0x1]['length']):_0x1e87ea['length']<0x64&&!_0x1b8f24?'':this['_stripMarkdownSyntax'](_0x1e87ea);const _0xdb7968=this['_domParser']['parseFromString'](_0x1e87ea,'text/html');if(_0x25cddc){const _0x3e7410=Array['from'](_0xdb7968['body']['childNodes']);_0x3e7410['reverse']();for(const _0x422fb0 of _0x3e7410){if(_0x422fb0['nodeType']==Node['ELEMENT_NODE'])break;_0x422fb0['remove']();}}const _0x4c1338=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xdb7968['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4c1338);const _0x28d0dc=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x225d5f=this['editor']['data']['toModel'](_0x4c1338);return _0x28d0dc||_0x225d5f['markers']['clear'](),this['editor']['data']['stringify'](_0x225d5f);}['_normalizeResponseHeadings'](_0x4301e8){const _0x5d8a09=new _0x27088e(this['editor']['editing']['view']['document']),_0x15592d=new _0x5cfc1b({'name':/^h[1-5]$/}),_0x13f831=[];let _0x34a2ea=!0x1;for(const _0x4c41c3 of _0x4301e8)_0x4c41c3['is']('element')&&_0x15592d['match'](_0x4c41c3)&&(_0x13f831['push'](_0x4c41c3),'h1'==_0x4c41c3['name']&&(_0x34a2ea=!0x0));if(_0x34a2ea){for(const _0x538325 of _0x13f831)_0x5d8a09['rename']('h'+(parseInt(_0x538325['name'][0x1])+0x1),_0x538325);}}['_isH1TagSupportEnabled'](){const {data:_0x523a9c,editing:_0x54e744}=this['editor'],_0x304664=_0x523a9c['htmlProcessor']['toView']('<h1></h1>'),_0x5520ef=_0x523a9c['toView'](_0x523a9c['toModel'](_0x304664));return!!_0x54e744['view']['domConverter']['viewToDom'](_0x5520ef)['querySelector']('h1');}['_sanitizeHTML'](_0x5eda09){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5eda09),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5eae0f){const _0x302506=_0x5eae0f['trim']();return _0x302506['startsWith']('```html')?_0x302506['endsWith']('```')?_0x302506['substring'](0x7,_0x302506['length']-0x3):_0x302506['substring'](0x7):_0x5eae0f;}}const ci={'REPLACE':'replace','INSERT':'insert'};class wr extends _0x541968{constructor(_0x7849f2){super(_0x7849f2),this['set']('isVisible',!0x1),this['set']('mainAction',ci['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1163b3=>Yn(_0x7849f2,'AI_'+_0x1163b3['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0x7849f2,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0x7849f2,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0x7849f2,'Stop'));const _0x42b97a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x42b97a['if']('isVisible','ck-hidden',_0x318a77=>!_0x318a77)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x48d112,_0x3b7495){const _0x2be9fe=new _0x14ee0a(this['locale']);return _0x2be9fe['set']({'label':_0x48d112,'class':_0x3b7495||'','isVisible':!0x0,'withText':!0x0}),_0x2be9fe;}}class yr extends _0x19a8c6{['contentFieldView'];['copyButtonView'];constructor(_0x26ed52,_0x4204d5=''){super(_0x26ed52),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x305c75=this['bindTemplate'];this['contentFieldView']=new $n(_0x26ed52,_0x4204d5),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x305c75['if']('isVisible','ck-hidden',_0x55dcc0=>!_0x55dcc0)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x305c75['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x5a022f=!0x1;this['on']('change:value',(_0x56f10c,_0x5dc4b0,_0x5eeecf)=>{const _0x12bdbc=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x5eeecf),this['isProcessing']&&_0x12bdbc&&!_0x5a022f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1d5298,_0x1f117a,_0x2e399a)=>{_0x5a022f=!0x1,_0x2e399a?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5a022f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5a022f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1743f0=this['locale'],_0x4d9588=new _0x14ee0a(this['locale']),_0x44b61f='ck-ai-form__copy-button';return _0x4d9588['set']({'label':Yn(_0x1743f0,'Copy'),'icon':_0x308403,'class':_0x44b61f,'tooltip':!0x0}),_0x4d9588['bind']('isVisible')['to'](this,'value',_0x574173=>!!_0x574173),_0x4d9588['bind']('isEnabled')['to'](this,'isProcessing',_0x5e101b=>!_0x5e101b),_0x4d9588['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4d9588['icon']=_0x547952,_0x4d9588['class']=_0x44b61f+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4d9588['icon']=_0x308403,_0x4d9588['class']=_0x44b61f;},0x3e8);}),_0x4d9588;}['_copyHTMLToClipboard'](_0x17784b){const {window:_0x11ee8,document:_0x175da8}=_0x110318;if(_0x11ee8['ClipboardItem']){const {Blob:_0x39a5ad,ClipboardItem:_0xfe915b}=_0x11ee8,_0x41fae0=[new _0xfe915b({'text/html':new _0x39a5ad([_0x17784b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x39a5ad([_0x17784b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x41fae0);}else{const _0x4f6a0f=_0x175da8['createElement']('div');_0x4f6a0f['style']['position']='absolute',_0x4f6a0f['style']['left']='-9999px',_0x4f6a0f['innerHTML']='<span>[</span>'+_0x17784b['innerHTML']+'<span>]</span>',_0x175da8['body']['appendChild'](_0x4f6a0f);const _0x2c50c0=_0x175da8['createRange']();_0x2c50c0['setStartAfter'](_0x4f6a0f['firstElementChild']),_0x2c50c0['setEndBefore'](_0x4f6a0f['lastElementChild']);const _0x8fb0af=_0x11ee8['getSelection']();_0x8fb0af['removeAllRanges'](),_0x8fb0af['addRange'](_0x2c50c0),_0x175da8['execCommand']('copy'),_0x4f6a0f['remove']();}}}class $n extends _0x19a8c6{constructor(_0x36579c,_0x4b5a76=''){super(_0x36579c),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4b5a76,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x510803){this['element']['innerHTML']=_0x510803;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xe69dd6=new _0x19a8c6(),_0x5f1c03=this['locale'],_0x45dcf9=new _0x577daf();return _0x45dcf9['isVisible']=!0x0,_0xe69dd6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x45dcf9,{'text':Yn(_0x5f1c03,'AI\x20is\x20writing...')}]}),_0xe69dd6['render'](),_0xe69dd6;}}class gr extends _0x19a8c6{constructor(_0x2f4507,_0x569252=''){super(_0x2f4507);const _0x45211a=new _0x50b9df(),_0x3c4ec0=this['bindTemplate'];this['set']('text',_0x569252),_0x45211a['content']=_0x129806,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x45211a,{'text':_0x3c4ec0['to']('text')}]});}}class Er extends _0x4dc60c{['submitButtonView'];['showHistoryButtonView'];constructor(_0x367839,_0x465bb7){super(_0x367839,_0x465bb7),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x211006,_0x275bc2)=>{_0x211006['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x275bc2());});}['_createSubmitButton'](){const _0x49e99c=new _0x14ee0a(this['locale']),_0x41525c=this['locale'];return _0x49e99c['set']({'icon':_0x2a3f1e,'label':Yn(_0x41525c,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x49e99c['on']('execute',()=>{this['submit']();}),_0x49e99c['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x34d37e,_0x22bbf2)=>!_0x34d37e&&_0x22bbf2),_0x49e99c;}['_createShowHistoryButton'](){const _0x371bbc=new _0x14ee0a(this['locale']),_0x52113d=this['resultsView'],_0x307dd6=this['locale'];_0x371bbc['set']({'label':Yn(_0x307dd6,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x371bbc['bind']('isOn')['to'](_0x52113d,'isVisible'),_0x371bbc['bind']('isEnabled')['to'](this,'isEnabled'),_0x371bbc['on']('execute',()=>{_0x52113d['isVisible']=!_0x52113d['isVisible'],_0x52113d['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5bfc31=()=>{_0x110318['window']['requestAnimationFrame'](()=>{if(_0x4b2614(this['element'])){const _0x487183=new _0x31eb3f(this['queryView']['fieldView']['element']),_0x4d315b=_0x487183['width'],_0x2d954e='rtl'===_0x307dd6['uiLanguageDirection']?'left':'right';_0x487183['excludeScrollbarsAndBorders'](),_0x371bbc['element']['style'][_0x2d954e]=_0x4d315b-_0x487183['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5bfc31),this['on']('render',_0x5bfc31),_0x371bbc;}['submit'](){const _0x372eed=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x372eed);}['focus'](_0x25555c){-0x1===_0x25555c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x556745{['historyGroupView'];['clearHistoryButton'];constructor(_0x212293){super(_0x212293),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x4372b2(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x212293,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xf0f594=0x0;for(const _0x13f1be of this['items'])_0xf0f594+=_0x13f1be['items']['length'];return{'resultsCount':_0xf0f594,'totalItemsCount':_0xf0f594};}['_createClearHistoryButton'](){const _0x4a03a4=this['locale'],_0x255aa9=new _0x14ee0a(this['locale']);return _0x255aa9['set']({'label':'('+Yn(_0x4a03a4,'Clear')+')','withText':!0x0}),_0x255aa9['on']('execute',()=>this['fire']('clearHistory')),_0x255aa9;}}class Ar extends _0x2269a3{constructor(_0x243cb8){super();const _0x1aa558=new _0x53816d(),_0x2544e7=new _0x14ee0a(this['locale'],_0x1aa558);this['children']['add'](_0x2544e7),_0x2544e7['set']({'label':_0x243cb8['prompt'],'withText':!0x0}),_0x2544e7['on']('execute',()=>{this['fire']('execute',{'value':_0x4efc88(_0x243cb8['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Pr extends _0x5d69ef{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x14a37b,_0x5226d4)=>{const _0x327a91=fo(_0x5226d4['prompt']);for(const _0xef4b56 of this)if(_0xef4b56!=_0x5226d4&&fo(_0xef4b56['prompt'])===_0x327a91){this['remove'](_0xef4b56);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0xffd772=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0xffd772));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x205b5a=>_0x205b5a)));}}function fo(_0x291e88){return _0x291e88['toLowerCase']()['trim']();}class ri extends _0x19a8c6{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x55ad1c,_0x144516,_0x197a47=''){super(_0x55ad1c),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ci['REPLACE']),this['_promptHistory']=new Pr(),this['errorView']=new gr(_0x55ad1c),this['contentArea']=new yr(_0x55ad1c,_0x197a47),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new ts(),this['keystrokes']=new _0x1f1bc5(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x178827=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x144516],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x178827['if']('isError','ck-hidden',_0x463c03=>!_0x463c03)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x30f23b=0x1){-0x1===_0x30f23b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x4a3a74=this['locale'],_0x5a6c9d=new Er(_0x4a3a74,{'queryView':{'label':Yn(_0x4a3a74,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x5c1a66,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x4a3a74,'Empty\x20history'),'secondary':Yn(_0x4a3a74,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5a6c9d['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x19d376,_0x4da405)=>_0x19d376&&!_0x4da405),this['listenTo'](_0x5a6c9d,'submit',(_0xc08c1c,_0x3fb938)=>{this['prompt']=_0x3fb938;const _0x481b17=_0x4e9308(_0x3fb938);this['fire']('submitPrompt',_0x481b17),_0x3fb938['trim']()&&this['_promptHistory']['add']({'prompt':_0x481b17},0x0);},{'priority':'high'}),_0x5a6c9d;}['_createHistoryView'](){const _0xa78ac0=new vr(this['locale']);return _0xa78ac0['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0xa78ac0['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xa78ac0;}['_createToolbar'](){const _0x1a2a39=new wr(this['locale']);return _0x1a2a39['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x16d587,_0x594f8c,_0xe41e53)=>_0x16d587&&!_0x594f8c&&!!_0xe41e53),_0x1a2a39['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1a2a39['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xab72bb,_0x57bb70,_0xcdde93)=>_0xab72bb&&!_0x57bb70&&!!_0xcdde93),_0x1a2a39['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1a2a39['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4cce42,_0x41ce8c)=>_0x4cce42&&!_0x41ce8c),_0x1a2a39['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1a2a39['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1a2a39['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1a2a39;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4a9f1f=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x4a9f1f,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5154f8){const _0x21072c=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5154f8||Yn(_0x21072c,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const J=globalThis['DataTransfer'];class G extends _0x5f3288{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x41836c,F,ni,_0x10183e];}constructor(_0x487185){super(_0x487185),_0x487185['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x487185['config']['define']('ai.assistant.contentAreaCssClass',''),_0x487185['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x487185['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xc8de38}=this;this['_aiAdapter']=_0xc8de38['plugins']['get'](ni),this['_dialog']=_0xc8de38['plugins']['get'](_0x10183e),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2f3c11=new ai(_0xc8de38,Array['from'](this['_commandDefinitions']['values']()));_0xc8de38['commands']['add']('showAIAssistant',_0x2f3c11),_0xc8de38['ui']['componentFactory']['add']('aiCommands',_0x279341=>{const _0x5b4e85=_0x10d828(_0x279341);return _0x5b4e85['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5b4e85['buttonView']['set']({'label':Yn(_0x279341,'AI\x20Commands'),'icon':_0x1dd138,'tooltip':!0x0}),_0x5b4e85['on']('execute',_0x4dbdec=>this['_onExecute'](_0x4dbdec['source']['id'])),_0x12a70a(_0x5b4e85,_0xc8de38['ui']['view']['body'],function(_0x52f4f3){const _0x4b9ece=z(_0x52f4f3['config']['get']('ai.assistant.commands'),_0x52f4f3['locale']),_0x9f383b=hi(_0x52f4f3,_0x4b9ece)['filter'](_0x2a3ee0=>_0x2a3ee0['commands']['length']);if(0x1===_0x9f383b['length'])return hi(_0x52f4f3,_0x9f383b[0x0]['commands'])['map'](_0x5cf01e=>({'id':_0x5cf01e['id'],'label':_0x5cf01e['label']}));return _0x9f383b['map'](_0x20fbd4=>{const {groupId:_0x4676c2,groupLabel:_0xee2c16,commands:_0xd14582}=_0x20fbd4,_0x56c2cc=hi(_0x52f4f3,_0xd14582)['map'](_0x27ae0d=>({'id':_0x27ae0d['id'],'label':_0x27ae0d['label']}));return{'id':_0x4676c2,'menu':_0xee2c16||_0x4676c2,'children':_0x56c2cc};});}(_0xc8de38),{'ariaLabel':Yn(_0x279341,'AI\x20Commands')}),_0x5b4e85['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2f3c11['on']('change:enabledCommandsIds',_0x2fe602),_0x5b4e85['menuView']['once']('render',_0x2fe602),_0x5b4e85;function _0x2fe602(){_0x5b4e85['isEnabled']=_0x2f3c11['enabledCommandsIds']['length']>0x0;for(const _0x279c48 of _0x5b4e85['menuView']['buttons'])_0x279c48['isEnabled']=_0x2f3c11['enabledCommandsIds']['includes'](_0x279c48['id']);}}),_0xc8de38['ui']['componentFactory']['add']('menuBar:aiCommands',_0x26ca10=>{const _0x2b5c11=new _0x38710d(_0x26ca10);_0x2b5c11['buttonView']['set']({'label':Yn(_0x26ca10,'AI\x20Commands'),'icon':_0x1dd138}),_0x2b5c11['bind']('isEnabled')['to'](_0x2f3c11,'enabledCommandsIds',_0x2a2c38=>_0x2a2c38['length']>0x0);const _0x3ed822=z(_0xc8de38['config']['get']('ai.assistant.commands'),_0x26ca10);return this['_populateMenuBarMenu'](_0x2f3c11,_0x2b5c11,_0x3ed822,_0x312bba=>this['_onExecute'](_0x312bba)),_0x2b5c11;}),_0xc8de38['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x3b13ab=this['_createAIAssistantUIButton'](_0x14ee0a);return _0x3b13ab['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x3b13ab;}),_0xc8de38['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1c99eb=this['_createAIAssistantUIButton'](_0x5b3955);return _0x1c99eb['set']({'role':'menuitemcheckbox'}),_0x1c99eb;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xf8191=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x333bf6;for(const _0xbca7bf in _0xf8191){const _0xc5303a=_0xbca7bf,_0x4b137a=_0xf8191[_0xc5303a];if('aiLicenseKeyValid'==_0x4b137a||'aiLicenseKeyInvalid'==_0x4b137a||'aiLicenseKeyExpired'==_0x4b137a||'aiLicenseKeyDomainLimit'==_0x4b137a||'aiLicenseKeyNotAllowed'==_0x4b137a||'aiLicenseKeyEvaluationLimit'==_0x4b137a||'aiLicenseKeyTrialLimit'==_0x4b137a||'aiLicenseKeyUsageLimit'==_0x4b137a){delete _0xf8191[_0xc5303a],_0x333bf6=_0x4b137a,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x333bf6&&_0xf8191['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x333bf6&&_0xf8191['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x333bf6&&_0xf8191['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x333bf6&&_0xf8191['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x333bf6&&_0xf8191['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x333bf6&&_0xf8191['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x333bf6&&_0xf8191['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5c9814='',_0x34861c='',_0x5b1199='custom'){const _0x114aba=this['editor'],_0x595354=_0x114aba['editing']['view'],_0x505858=_0x114aba['plugins']['get'](F),_0x370e25=_0x114aba['plugins']['get'](_0x41836c);_0x505858['showFakeVisualSelection']();const _0x33f052=new J(),_0x25e628=new ClipboardEvent('copy',{'clipboardData':_0x33f052}),_0x5add08=new _0x1cb9e3(_0x33f052),_0x2df38f=new _0x162ba2(_0x595354,_0x25e628,{'dataTransfer':_0x5add08});_0x370e25['_forceMarkersCopy']('comment',()=>{_0x595354['document']['fire']('copy',_0x2df38f);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new oi(_0x114aba,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4533a9=_0x5add08['getData']('text/html');const _0x4a97bc=_0x114aba['model']['document']['selection'],_0x43086d=Array['from'](_0x4a97bc['getRanges']());0x1===_0x43086d['length']&&_0x43086d[0x0]['isFlat']&&!_0x4a97bc['getSelectedElement']()&&''!==_0x4533a9['replace'](/ /g,'')['trim']()&&(_0x4533a9='<p>'+_0x4533a9+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5b1199,'query':_0x5c9814,'htmlContent':_0x4533a9,'label':_0x34861c,'mainActionLabel':ci[_0x114aba['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4c398b,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2ccaf1['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x505858['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x4ff12d=new Map(),_0x36ceaf=z(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x495090 of _0x36ceaf)for(const _0x43b6b1 of _0x495090['commands'])_0x4ff12d['set'](_0x43b6b1['id'],{..._0x43b6b1,'groupId':_0x495090['groupId'],'groupLabel':_0x495090['groupLabel']||_0x495090['groupId']});return _0x4ff12d;}['_createAIAssistantUIButton'](_0x1ab3b1){const _0x36b242=this['editor'],_0x9fc1de=_0x36b242['commands']['get']('showAIAssistant'),_0x5cbfdf=new _0x1ab3b1(_0x36b242['locale']);return _0x5cbfdf['set']({'label':Yn(_0x36b242['locale'],'AI\x20Assistant'),'icon':_0x4c398b,'isToggleable':!0x0}),_0x5cbfdf['bind']('isEnabled')['to'](_0x9fc1de),_0x5cbfdf['bind']('isOn')['to'](this['_dialog'],'id',_0x1dc921=>'aiAssistant'===_0x1dc921),this['listenTo'](_0x5cbfdf,'execute',()=>{_0x5cbfdf['isOn']?this['hideUI']():_0x9fc1de['execute']();}),_0x5cbfdf;}['_initView'](){const _0x524200=this['editor']['plugins']['get'](F);this['_formView']=new ri(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x524200['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x524200['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x198d85,ui:{ariaLiveAnnouncer:_0x5b7828}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x3958f6,_0x3c3361,_0xd7a8a6)=>{const _0x51bbef=this['_aiAssistantController']['currentContext'];_0xd7a8a6?_0x5b7828['announce'](Yn(_0x198d85,'AI\x20is\x20writing')):_0x51bbef&&_0x5b7828['announce'](Yn(_0x198d85,'Generated\x20content:\x20%0',_0x51bbef),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x33bb84,_0xba2117,_0x54290e)=>{if(_0x54290e){const _0x5383fd=this['_formView']['errorView']['text'];_0x5b7828['announce'](Yn(_0x198d85,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5383fd));}});}['_onExecute'](_0x54b23f){const _0x3ac885=this['_commandDefinitions']['get'](_0x54b23f),_0xd3918a=this['editor'],_0x41c0fa=_0xd3918a['model']['document']['selection'],_0x61a57f=_0xd3918a['commands']['get']('showAIAssistant'),_0x4e874d=_0xd3918a['plugins']['get'](F),_0xfb9bc2=''+(_0x3ac885['groupId']!==ei?_0x3ac885['groupLabel']+':\x20':'')+_0x3ac885['label'];if(!0x1!==_0x3ac885['requiresContent']&&_0x41c0fa['isCollapsed']){const _0x4984ed=_0x592c76(_0x41c0fa['getSelectedBlocks']())||_0xd3918a['model']['schema']['getLimitElement'](_0x41c0fa);_0xd3918a['model']['change'](_0x494d01=>{_0x494d01['setSelection'](_0x4984ed,'in');});}_0x4e874d['showFakeVisualSelection'](),_0x61a57f['execute'](_0x3ac885['prompt'],_0xfb9bc2,'command:'+_0x54b23f);}['_populateMenuBarMenu'](_0x3a4f13,_0x38e56d,_0x1af6f2,_0x1093e3){const _0x3ee745=this['editor'],_0x4ab132=_0x3ee745['locale'],_0x51affb=new ti(_0x4ab132),_0xb10f7d=hi(_0x3ee745,_0x1af6f2)['filter'](_0x30ca83=>_0x30ca83['commands']['length']);0x1===_0xb10f7d['length']?this['_getMenuBarGroupButtons']({'command':_0x3a4f13,'commands':_0xb10f7d[0x0]['commands'],'parentMenuView':_0x38e56d,'onExecute':_0x1093e3})['forEach'](_0x2e2a5e=>_0x51affb['items']['add'](_0x2e2a5e)):_0xb10f7d['forEach'](({groupId:_0x389803,groupLabel:_0x1b30df,commands:_0x1cde89})=>{const _0xf265af=new _0x44e2e2(_0x4ab132,_0x38e56d),_0x3b42c6=new _0x38710d(_0x4ab132),_0x28c83f=new ti(_0x4ab132),_0x38f885=this['_getMenuBarGroupButtons']({'command':_0x3a4f13,'commands':_0x1cde89,'parentMenuView':_0x3b42c6,'onExecute':_0x1093e3});_0x3b42c6['buttonView']['set']({'label':_0x1b30df||_0x389803}),_0x3b42c6['delegate']('execute')['to'](_0x38e56d),_0x28c83f['items']['addMany'](_0x38f885),_0x3b42c6['panelView']['children']['add'](_0x28c83f),_0xf265af['children']['add'](_0x3b42c6),_0x51affb['items']['add'](_0xf265af);}),_0x38e56d['panelView']['children']['add'](_0x51affb);}['_getMenuBarGroupButtons']({command:_0x897810,commands:_0x506f48,parentMenuView:_0x3bb7ed,onExecute:_0x1eaee0}){const _0x14a1e5=this['editor'],_0x3a1577=_0x14a1e5['locale'];return hi(_0x14a1e5,_0x506f48)['map'](_0x57b06e=>{const _0x86eb74=new _0x44e2e2(_0x3a1577,_0x3bb7ed),_0x3de153=new _0x5b3955(_0x3a1577);return _0x3de153['set']({'label':_0x57b06e['label']}),_0x3de153['delegate']('execute')['to'](_0x3bb7ed),_0x3de153['on']('execute',()=>_0x1eaee0(_0x57b06e['id'])),_0x3de153['bind']('isEnabled')['to'](_0x897810,'enabledCommandsIds',_0x5e8358=>_0x5e8358['includes'](_0x57b06e['id'])),_0x86eb74['children']['add'](_0x3de153),_0x86eb74;});}}function li(_0x2dcb3f,_0x4db420){return void 0x0!==_0x2dcb3f['order']&&void 0x0===_0x4db420['order']?0x1:void 0x0===_0x2dcb3f['order']&&void 0x0!==_0x4db420['order']?-0x1:void 0x0!==_0x2dcb3f['order']&&void 0x0!==_0x4db420['order']?_0x2dcb3f['order']-_0x4db420['order']:0x0;}function hi(_0x1afaee,_0x3f342e){_0x3f342e['sort'](li);const _0x159091={},_0x5e4364=[];for(const _0x339fb5 of _0x3f342e)if(void 0x0!==_0x339fb5['order']){if(_0x339fb5['order']in _0x159091)throw new _0x29f184('ai-commands-config-order-collision',_0x1afaee,{'conflictingDefinitions':[_0x339fb5,_0x159091[_0x339fb5['order']]]});_0x159091[_0x339fb5['order']]=_0x339fb5,_0x5e4364['splice'](_0x339fb5['order'],0x0,_0x339fb5);}else _0x5e4364['push'](_0x339fb5);return _0x5e4364;}class qn extends _0x5f3288{static get['requires'](){return[G,F];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1c13c6){super(_0x1c13c6);const _0x1037d4=_0x1c13c6['config'],_0x2b769c=_0x1c13c6['locale'];_0x1037d4['define']('ai.assistant.preserveComments',!0x0),_0x1037d4['define']('ai.assistant.commands',Qn(_0x2b769c)),_0x1037d4['define']('ai.assistant.extraCommandGroups',[]),_0x1037d4['define']('ai.assistant.removeCommands',[]);let _0x22e455=z(_0x1037d4['get']('ai.assistant.commands'),_0x2b769c);const _0x133ce4=_0x1037d4['get']('ai.assistant.extraCommandGroups'),_0x16aa84=_0x1037d4['get']('ai.assistant.removeCommands');_0x133ce4['forEach'](_0x8bd528=>{const _0x304044=_0x22e455['find'](_0x26d9c6=>_0x26d9c6['groupId']===_0x8bd528['groupId']);_0x304044?_0x304044['commands']=_0x304044['commands']['concat'](_0x8bd528['commands']):_0x22e455['push'](_0x8bd528);}),_0x22e455=_0x22e455['filter'](_0x3ade7a=>!_0x16aa84['includes'](_0x3ade7a['groupId'])),_0x22e455['forEach'](_0x4b7d13=>{_0x4b7d13['commands']=_0x4b7d13['commands']['filter'](_0x31a0ae=>!_0x16aa84['includes'](_0x31a0ae['id']));}),_0x1037d4['set']('ai.assistant.commands',_0x22e455);}}function Qn(_0x3735c8){return[{'groupId':'editOrReview','groupLabel':Yn(_0x3735c8,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x3735c8,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x3735c8,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Yn(_0x3735c8,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x3735c8,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Yn(_0x3735c8,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x3735c8,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Yn(_0x3735c8,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Yn(_0x3735c8,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x3735c8,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x3735c8,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x3735c8,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x3735c8,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x3735c8,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x3735c8,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x3735c8,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x3735c8,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x3735c8,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x3735c8,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x3735c8,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x3735c8,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x3735c8,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x3735c8,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x3735c8,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x3735c8,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x3735c8,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x3735c8,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x3735c8,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ue extends _0x5f3288{['abortController'];static get['requires'](){return[ni];}constructor(_0x21d0e4){super(_0x21d0e4),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](ni)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4049b8){return this['sendRequest'](_0x4049b8)['catch'](_0xf5279c=>{if(_0xf5279c instanceof tr)return Promise['reject'](_0xf5279c);if('AbortError'==_0xf5279c['name'])return Promise['resolve']();throw console['error'](_0xf5279c),new _0x29f184('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x36b2d9,_0xaa49b8){const _0x51192d=this['editor']['locale'],_0x4c905c={'Content-Type':'application/json'};if('object'==typeof _0x36b2d9)Object['assign'](_0x4c905c,_0x36b2d9);else{if(_0x36b2d9)try{const _0x41a465=await _0x36b2d9(_0xaa49b8);Object['assign'](_0x4c905c,_0x41a465);}catch{return Promise['reject'](new tr(Yn(_0x51192d,'AI_ERROR_GET_HEADERS')));}}return _0x4c905c;}async['_prepareRequestParameters'](_0x200658,_0x22a1dd){const _0xd934d4=this['editor']['locale'];if('object'==typeof _0x200658)return _0x200658;try{return await _0x200658(_0x22a1dd);}catch{return Promise['reject'](new tr(Yn(_0xd934d4,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends ue{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x12d561){super(_0x12d561),_0x12d561['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x12d561['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x12d561['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x12d561['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x12d561['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x12d561['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x29c0cc,context:_0x2a80fa,onData:_0x383f83,actionId:_0x1b4f78}){const _0x4923df=this['editor']['locale'],_0x82317c=await this['prepareMessages'](_0x29c0cc,_0x2a80fa,_0x1b4f78),_0x2d4abc=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1b4f78),_0x5154aa=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1b4f78),_0x4a2b4c={'messages':_0x82317c,..._0x5154aa},_0xccf0c8={'method':'POST','headers':_0x2d4abc,'body':JSON['stringify'](_0x4a2b4c),'signal':this['abortController']['signal']},_0x56ab4a=await fetch(this['_apiUrl'],_0xccf0c8);if(_0x56ab4a['ok'])return _0x5154aa['stream']?await this['_readStreamableResponse'](_0x56ab4a,_0x383f83):await this['_readStaticResponse'](_0x56ab4a,_0x383f83),Promise['resolve']();{const _0x4c9c6c=await _0x56ab4a['text']();return _0x4c9c6c['includes']('context_length_exceeded')?Promise['reject'](new tr(Yn(_0x4923df,'AI_ERROR_CONTEXT_LENGTH'))):_0x4c9c6c['includes']('Moderation')?Promise['reject'](new tr(Yn(_0x4923df,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x4c9c6c));}}async['prepareMessages'](_0x26f9d6,_0x1ce24c,_0x264181){let _0x46e133,_0x396cf8;return _0x1ce24c?(_0x46e133='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x396cf8='Instruction:\x0a'+_0x26f9d6+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1ce24c):(_0x46e133='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x396cf8=_0x26f9d6),[{'role':'system','content':_0x46e133},{'role':'user','content':_0x396cf8}];}async['_readStreamableResponse'](_0x394f5c,_0x32b642){const _0x39fd7b=_0x394f5c['body']['getReader'](),_0x8ec23a=new TextDecoder();let _0x46bb12='',_0x3f1c0a='',_0x1a9a27='',_0x49b556=!0x1;for(;!_0x49b556;){const {done:_0x5d9436,value:_0x5c4dd8}=await _0x39fd7b['read'](),_0x5db132=_0x46bb12+_0x8ec23a['decode'](_0x5c4dd8);let _0x4f9166='';_0x49b556=_0x5d9436;try{_0x4f9166=this['_cleanUpData'](_0x5db132),_0x46bb12='';}catch{_0x46bb12=_0x5db132;continue;}_0x3f1c0a+=_0x4f9166,!_0x49b556&&this['_isBufferIncomplete'](_0x3f1c0a)||_0x3f1c0a&&(_0x1a9a27+=_0x3f1c0a,_0x3f1c0a='',_0x32b642(_0x1a9a27));}return Promise['resolve']();}async['_readStaticResponse'](_0x4833cb,_0x27b7b2){return _0x27b7b2((await _0x4833cb['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x250966){const _0x21778b=_0x250966['split']('<')['length']!==_0x250966['split']('>')['length'],_0x1eb19b=_0x250966['length']<0x1e;return _0x21778b&&_0x1eb19b;}['_cleanUpData'](_0x31f78b){return _0x31f78b['split'](/\n(?![^{]*\})/g)['map'](_0x2f6d6e=>_0x2f6d6e['replace']('data:\x20',''))['filter'](_0x5216f5=>_0x5216f5&&_0x5216f5['length']>0x0&&'[DONE]'!==_0x5216f5)['map'](_0x124f38=>{const {choices:_0x211c53}=JSON['parse'](_0x124f38);if(_0x211c53[0x0]?.['delta']?.['content'])return _0x211c53[0x0]['delta']['content'];})['filter'](_0x405f94=>_0x405f94)['join']('');}}class zn extends ue{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x42bb0f){super(_0x42bb0f),_0x42bb0f['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x42bb0f['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x42bb0f['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x42bb0f['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x42bb0f['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x42bb0f['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x2c4c57,context:_0xc28c8b,onData:_0x4343c8,actionId:_0x1cd7ee}){const {model:_0x37d9d8,stream:_0x3ef6b4,..._0x21ba9e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1cd7ee),_0x2d75a9={'prompt':await this['preparePrompt'](_0x2c4c57,_0xc28c8b,_0x37d9d8,_0x1cd7ee),..._0x21ba9e};this['_apiUrl']?await this['_processProxyRequest'](_0x2d75a9,_0x37d9d8,_0x3ef6b4,_0x4343c8,_0x1cd7ee):await this['_processAWSRequest'](_0x2d75a9,_0x37d9d8,_0x3ef6b4,_0x4343c8);}async['preparePrompt'](_0x59d67e,_0x4ed276,_0x36becc,_0x3dcc20){let _0xa11b,_0x1add56;return _0x4ed276?(_0xa11b='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x1add56='Instruction:\x0a'+_0x59d67e+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4ed276):(_0xa11b='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x1add56=_0x59d67e),'meta.llama'==this['getModelFamily'](_0x36becc)?'<<SYS>>\x0a'+_0xa11b+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x1add56+'\x0a[/INST]':'Human:\x0a'+_0xa11b+'\x0a'+_0x1add56+'\x0a\x0aAssistant:';}['getModelFamily'](_0x28e6f0){if(/^anthropic\.claude/['test'](_0x28e6f0))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x28e6f0))return'ai21.j2';if(/^cohere\.command/['test'](_0x28e6f0))return'cohere.command';if(/^meta\.llama/['test'](_0x28e6f0))return'meta.llama';throw new tr(Yn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x28e6f0));}async['_processProxyRequest'](_0x42cc96,_0x454bc0,_0x5994bd,_0x2a5f7b,_0x534f06){const _0x2d5939={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x534f06),'body':JSON['stringify']({..._0x42cc96,'model':_0x454bc0,'stream':_0x5994bd}),'signal':this['abortController']['signal']},_0x188637=await fetch(this['_apiUrl'],_0x2d5939);_0x5994bd?await this['_readStreamableResponse'](_0x188637,_0x454bc0,_0x2a5f7b):await this['_readStaticResponse'](_0x188637,_0x454bc0,_0x2a5f7b);}async['_processAWSRequest'](_0x466e56,_0x488fc3,_0x1e5dab,_0x5462cf){const _0x1d12f0=new _0x5791f9(this['_bedrockClientConfig']),_0x547d6e={'body':JSON['stringify'](_0x466e56),'contentType':'application/json','accept':'application/json','modelId':_0x488fc3};let _0x6dbc5b;if(_0x1e5dab){const _0x95b627=new _0x3f5e91(_0x547d6e);_0x6dbc5b=await _0x1d12f0['send'](_0x95b627,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x6dbc5b,_0x488fc3,_0x5462cf);}else{const _0x59a90a=new _0x41e453(_0x547d6e);_0x6dbc5b=await _0x1d12f0['send'](_0x59a90a,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x6dbc5b,_0x488fc3,_0x5462cf);}}async['_readAsyncIterableResponse'](_0x1393ab,_0x240bfe,_0x2cd42c){const _0x34165c=_0x1393ab['body'],_0x5ca063=new TextDecoder('utf-8');let _0x393f5f='';for await(const _0x1e99e8 of _0x34165c)if(_0x1e99e8['chunk']){const _0x7e6f6=_0x5ca063['decode'](_0x1e99e8['chunk']['bytes']),_0x8e0611=JSON['parse'](_0x7e6f6);_0x393f5f+=this['_getGeneratedText'](_0x8e0611,_0x240bfe),_0x2cd42c(_0x393f5f);}return Promise['resolve']();}async['_readStreamableResponse'](_0x3968ca,_0x5a2298,_0x24a130){const _0xf89f54=_0x3968ca['body'],_0x14cc28=new TextDecoder('utf-8'),_0x160f67=_0xf89f54['getReader']();let _0x1f3e2e='',_0x2a33f2='',_0x3af77b=!0x1;for(;!_0x3af77b;){const {done:_0xf52a3e,value:_0x38a821}=await _0x160f67['read']();if(_0x3af77b=_0xf52a3e,_0x3af77b)break;const _0x108310=(_0x1f3e2e+_0x14cc28['decode'](_0x38a821))['split']('\x0a')['map'](_0x42ee17=>{try{return _0x1f3e2e='',JSON['parse'](_0x42ee17);}catch{return _0x1f3e2e=_0x42ee17,null;}})['filter'](_0xc0ad26=>null!==_0xc0ad26);_0x108310['length']&&(_0x2a33f2+=_0x108310['map'](_0x5ea8e7=>this['_getGeneratedText'](_0x5ea8e7,_0x5a2298))['join'](''),_0x24a130(_0x2a33f2));}return Promise['resolve']();}async['_readStaticResponse'](_0x34b07a,_0x318103,_0x3f45c0){let _0x2ee128;return _0x2ee128=_0x34b07a instanceof Response?await _0x34b07a['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x34b07a['body'])),(_0x3f45c0(this['_getGeneratedText'](_0x2ee128,_0x318103)),Promise['resolve']());}['_getGeneratedText'](_0x5606c4,_0x1f7963){switch(this['getModelFamily'](_0x1f7963)){case'anthropic.claude':return _0x5606c4['completion'];case'ai21.j2':return _0x5606c4['completions'][0x0]['data']['text'];case'cohere.command':return _0x5606c4['generations'][0x0]['text'];case'meta.llama':return _0x5606c4['generation'];}}}class ia extends _0x14ee0a{constructor(_0x17e46e,_0x32d736={}){super(_0x17e46e),this['isToggleable']=!0x0,this['set']('side',_0x32d736['side']||'top');const _0x5161a3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x7703f2(_0x32d736['class']||[]),_0x5161a3['to']('side',_0x1dcba4=>'ck-tab-button_'+_0x1dcba4),_0x5161a3['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x19a8c6{['children'];constructor(_0x3b2701,_0x554830={}){super(_0x3b2701);const _0x38f5e8=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x7703f2(_0x554830['class']||[]),_0x38f5e8['to']('class'),_0x38f5e8['if']('isVisible','ck-hidden',_0x4f4362=>!_0x4f4362)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x19a8c6{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x2f8d25,_0x28ade4={}){super(_0x2f8d25),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x28ade4['side']||'top'),this['set']('isMaximized',!0x1);const _0x11b6c6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x7703f2(_0x28ade4['class']||[]),_0x11b6c6['to']('side',_0x1454b6=>'ck-tabs_'+_0x1454b6),_0x11b6c6['to']('class'),_0x11b6c6['to']('isMaximized',_0x256d08=>_0x256d08?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x11b6c6['to']('side',_0x5cb765=>'ck-tabs__buttons-container_'+_0x5cb765)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x11b6c6['to']('side',_0x2b1ffd=>'ck-tabs__panels-container_'+_0x2b1ffd)]},'children':this['panelViews']},..._0x7703f2(_0x28ade4['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x4d60b1){const _0x58a359=this['_tabs']['get'](_0x4d60b1);return _0x58a359||null;}['addTab'](_0x49ac2d){const _0x23a4fd=this['_setupButton']({'id':_0x49ac2d['id'],'label':_0x49ac2d['buttonLabel'],'icon':_0x49ac2d['buttonIcon'],'order':_0x49ac2d['order']}),_0x40468b=new ea(this['locale']);return _0x40468b['render'](),_0x49ac2d['content']&&_0x40468b['children']['add'](_0x49ac2d['content']),this['panelViews']['add'](_0x40468b),this['_tabs']['set'](_0x49ac2d['id'],{'button':_0x23a4fd,'panel':_0x40468b,'order':void 0x0!==_0x49ac2d['order']?_0x49ac2d['order']:null}),this['fire']('addTab:'+_0x49ac2d['id'],{'id':_0x49ac2d['id'],'button':_0x23a4fd,'panel':_0x40468b}),null===this['activeTab']?this['activateTab'](_0x49ac2d['id']):this['_hidePanel'](_0x49ac2d['id']),{'button':_0x23a4fd,'panel':_0x40468b};}['activateTab'](_0x47c63f){if(null!==_0x47c63f&&!this['getTab'](_0x47c63f))throw new _0x29f184('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x47c63f});this['activeTab']!==_0x47c63f&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x47c63f,_0x47c63f&&this['_showPanel'](_0x47c63f),this['fire']('activateTab:'+_0x47c63f,_0x47c63f));}['showTab'](_0x13ccfb){if(!this['getTab'](_0x13ccfb))throw new _0x29f184('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x13ccfb});this['_showPanel'](_0x13ccfb),this['_showButton'](_0x13ccfb),this['fire']('show:'+_0x13ccfb,_0x13ccfb);}['hideTab'](_0x4e3db2){if(!this['getTab'](_0x4e3db2))throw new _0x29f184('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4e3db2});const _0x3f8f47=this['activeTab'];this['_hidePanel'](_0x4e3db2),this['_hideButton'](_0x4e3db2);const _0x234979=this['getTabIds']();_0x3f8f47===_0x4e3db2&&_0x234979['length']>0x1&&this['activateTab'](_0x234979['find'](_0x2d272a=>_0x2d272a!==_0x4e3db2)),this['fire']('hide:'+_0x4e3db2,_0x4e3db2);}['_getPanel'](_0x5c5faa){const _0x66a43c=this['_tabs']['get'](_0x5c5faa);return _0x66a43c?_0x66a43c['panel']:null;}['_showPanel'](_0x55e00d){null!==this['activeTab']&&this['activeTab']!==_0x55e00d||this['_getPanel'](_0x55e00d)['show']();}['_hidePanel'](_0x44b75a){const _0x1c9f9f=this['_getPanel'](_0x44b75a);_0x1c9f9f['isVisible']&&(this['activeTab']===_0x44b75a&&(this['activeTab']=null),_0x1c9f9f['hide']());}['_getButton'](_0x482f11){const _0x5c1548=this['_tabs']['get'](_0x482f11);return _0x5c1548?_0x5c1548['button']:null;}['_showButton'](_0x1855c5){this['_getButton'](_0x1855c5)['show']();}['_hideButton'](_0x5b8afc){this['_getButton'](_0x5b8afc)['hide']();}['_setupButton'](_0x26f58c){const _0xf0dfd8=new ia(this['locale'],{'side':this['side']}),_0x356a2e=this['buttonViews'];if(_0xf0dfd8['set']({'label':_0x26f58c['label'],'icon':_0x26f58c['icon'],'tooltip':!0x0,'withText':!0x0}),_0xf0dfd8['bind']('isOn')['to'](this,'activeTab',_0x47aa43=>_0x47aa43===_0x26f58c['id']),_0xf0dfd8['bind']('side')['to'](this,'side'),_0x26f58c['order']){const _0x49568c=[...this['_tabs']]['reduce']((_0x2e6e4f,_0x3cde8d)=>{const _0x436ee7=_0x3cde8d[0x0],{order:_0x424149}=_0x3cde8d[0x1];return!_0x424149||_0x424149>_0x26f58c['order']?_0x2e6e4f:_0x424149>=_0x2e6e4f['order']?{'id':_0x436ee7,'order':_0x424149}:_0x2e6e4f;},{'id':'','order':0x0}),_0x330968=_0x356a2e['getIndex'](this['_getButton'](_0x49568c['id']));_0x356a2e['add'](_0xf0dfd8,_0x330968+0x1);}else _0x356a2e['add'](_0xf0dfd8);return _0xf0dfd8['on']('execute',()=>{this['activateTab'](_0x26f58c['id']);}),_0xf0dfd8;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends ss{constructor(_0xab13d9,_0x1af9b3={}){super(_0xab13d9,_0x1af9b3),this['set']('type',_0x1af9b3['type']||'sidebar'),this['set']('side',_0x1af9b3['side']||'right'),this['set']('isVisible',_0x1af9b3['visibleByDefault']??!0x0);const _0x78555b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x78555b['if']('type','ck-ai-tabs__overlay',_0x3ee6e4=>'overlay'===_0x3ee6e4),_0x78555b['if']('type','ck-ai-tabs__sidebar',_0x4d4f46=>'sidebar'===_0x4d4f46),_0x78555b['if']('isVisible','ck-hidden',_0x24cf3e=>!_0x24cf3e)]}}),this['buttonViews']['on']('add',(_0x7481f8,_0x4cce3e)=>{_0x4cce3e['set']('withText',!0x1);});}}class at extends _0x171820{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xedfaf2){super(_0xedfaf2);const _0x4f06f2=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x4f06f2)throw new _0x29f184('ai-tabs-configuration-not-found');if(void 0x0!==_0x4f06f2['showResizeButton']&&(this['showResizeButton']=_0x4f06f2['showResizeButton']),'sidebar'!==_0x4f06f2['type']&&'overlay'!==_0x4f06f2['type']||_0x4f06f2['side']&&(this['side']=_0x4f06f2['side']),'sidebar'===_0x4f06f2['type']){if(this['container']=_0x4f06f2['element'],this['set']('type','sidebar'),!this['container'])throw new _0x29f184('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x4f06f2['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new bi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x4f06f2['visibleByDefault']||_0x4f06f2['visibleByDefault']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof st&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x28d02c){if(_0x28d02c&&this['type']!==_0x28d02c){if(!Ti['includes'](_0x28d02c))throw new _0x29f184('ai-tabs-unsupported-ui-type');this['type']=_0x28d02c;}}['switchSide'](_0x5dad00){if(_0x5dad00&&this['side']!==_0x5dad00){if(!yi['includes'](_0x5dad00))throw new _0x29f184('ai-tabs-unsupported-ui-side');this['side']=_0x5dad00;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class s extends _0x171820{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x266a2d){super(_0x266a2d),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x331973=this['context']['plugins']['get']('CloudServices');if(!_0x331973['token'])throw new _0x29f184('ai-missing-token',this);this['_token']=_0x331973['token'];}['startConversation'](_0x2566b8,_0x5c75b3){const _0x44ff86=this['_sendApiRequest']('/conversations','POST',{'id':_0x2566b8,'group':_0x5c75b3});return{'getConversation':async()=>(await _0x44ff86['request'])['json'](),'abortController':_0x44ff86['abortController']};}['queryAssistant']({message:_0x5acd0f,conversationId:_0x387f9e,parts:_0x1e505e,capabilities:_0xca70e2,model:_0x2ecc8c,quickActionData:_0x18594a}){const _0x384f4c={..._0x18594a&&{'quickActionData':_0x18594a}},_0x40d266={'prompt':_0x5acd0f,'content':_0x1e505e,'model':_0x2ecc8c,..._0xca70e2&&{'capabilities':_0xca70e2},...Object['keys'](_0x384f4c)['length']>0x0&&{'attributes':_0x384f4c}},_0x2610c8=this['_sendApiRequest']('/conversations/'+_0x387f9e+'/messages','POST',_0x40d266);return{'getStream':async()=>{const _0x4c2669=(await _0x2610c8['request'])['body'];return this['_getStreamReader'](_0x4c2669);},'abortController':_0x2610c8['abortController']};}['executeCustomAction']({content:_0x24a878,message:_0x45f2e3,model:_0x5d6c0d,outputFormat:_0x58b2d2}){const _0x1d8694={'content':[{'type':'text','content':_0x24a878}],'prompt':_0x45f2e3,'model':_0x5d6c0d,'outputFormat':_0x58b2d2},_0x4e9273=this['_sendApiRequest']('/actions/custom/calls','POST',_0x1d8694);return{'getStream':async()=>{const _0x34c050=(await _0x4e9273['request'])['body'];return this['_getStreamReader'](_0x34c050);},'abortController':_0x4e9273['abortController']};}['executeAction']({actionName:_0x410873,content:_0x368590,args:_0x4cf347}){const _0x205676={'content':[{'type':'text','content':_0x368590}],'args':_0x4cf347},_0x24d68c=this['_sendApiRequest']('/actions/system/'+_0x410873+'/calls','POST',_0x205676);return{'getStream':async()=>{const _0x35c72f=(await _0x24d68c['request'])['body'];return this['_getStreamReader'](_0x35c72f);},'abortController':_0x24d68c['abortController']};}['uploadFile'](_0x5e6e9d,_0x1baefb,_0x4ae4e4){const _0x233726=new FormData();_0x233726['append']('file',_0x1baefb,_0x1baefb['name']),_0x4ae4e4&&_0x233726['append']('attributes',JSON['stringify'](_0x4ae4e4));const _0x505d65=this['_sendApiRequest']('/conversations/'+_0x5e6e9d+'/files','POST',_0x233726);return{'getId':async()=>(await _0x505d65['request'])['json'](),'abortController':_0x505d65['abortController']};}['fetchDocument'](_0xae1550,_0x228a4f){const _0x4f4e4d=this['_sendApiRequest']('/conversations/'+_0xae1550+'/documents/'+_0x228a4f,'GET');return{'getDocument':async()=>(await _0x4f4e4d['request'])['json'](),'abortController':_0x4f4e4d['abortController']};}['uploadDocument'](_0x495913,_0x28bc3a,_0x267600){const _0x389569={'content':_0x28bc3a};_0x267600&&(_0x389569['attributes']=_0x267600);const _0x2b1f39=this['_sendApiRequest']('/conversations/'+_0x495913+'/documents','POST',_0x389569);return{'getId':async()=>(await _0x2b1f39['request'])['json'](),'abortController':_0x2b1f39['abortController']};}['fetchConversations'](_0x5aab4e,_0x9f6343){const _0x5e7709=new URLSearchParams();_0x5e7709['append']('excludeEmpty','true'),_0x5e7709['append']('limit','100'),_0x5e7709['append']('group',_0x5aab4e),_0x9f6343&&_0x5e7709['append']('search',_0x9f6343);const _0x2ee9db=this['_sendApiRequest']('/conversations?'+_0x5e7709['toString'](),'GET');return{'getConversations':async()=>{const _0x4b4599=await _0x2ee9db['request'];return(await _0x4b4599['json']())['items'];},'abortController':_0x2ee9db['abortController']};}['deleteConversation'](_0x114d14){const _0x5831b7=this['_sendApiRequest']('/conversations/'+_0x114d14,'DELETE');return{'execute':async()=>{await _0x5831b7['request'];},'abortController':_0x5831b7['abortController']};}['updateConversation'](_0x1ead45,_0x3d8ae8){const _0x705ed7=this['_sendApiRequest']('/conversations/'+_0x1ead45,'PATCH',_0x3d8ae8);return{'getResult':async()=>(await _0x705ed7['request'],_0x3d8ae8),'abortController':_0x705ed7['abortController']};}['fetchConversation'](_0x500291){const _0x1b109f=this['_sendApiRequest']('/conversations/'+_0x500291,'GET');return{'getConversation':async()=>(await _0x1b109f['request'])['json'](),'abortController':_0x1b109f['abortController']};}['fetchConversationMessages'](_0x467a91){const _0x459238=this['_sendApiRequest']('/conversations/'+_0x467a91+'/messages','GET');return{'getMessages':async()=>{const _0x31b332=await _0x459238['request'];return(await _0x31b332['json']())['items'];},'abortController':_0x459238['abortController']};}['uploadUrl'](_0x3f5758,_0x42e932,_0x41ce56){const _0x5b6ad9=this['_sendApiRequest']('/conversations/'+_0x3f5758+'/web-resources','POST',{'url':_0x42e932,'attributes':_0x41ce56});return{'getId':async()=>(await _0x5b6ad9['request'])['json'](),'abortController':_0x5b6ad9['abortController']};}['getModels'](){const _0x5f48ed=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x5f48ed['request'])['json'](),'abortController':_0x5f48ed['abortController']};}['deleteFile'](_0x2fee8c,_0xc80490){const _0x1d4002=this['_sendApiRequest']('/conversations/'+_0x2fee8c+'/files/'+_0xc80490,'DELETE');return{'execute':async()=>{await _0x1d4002['request'];},'abortController':_0x1d4002['abortController']};}['deleteDocument'](_0x1563d2,_0x3c592a){const _0x1c8de7=this['_sendApiRequest']('/conversations/'+_0x1563d2+'/documents/'+_0x3c592a,'DELETE');return{'execute':async()=>{await _0x1c8de7['request'];},'abortController':_0x1c8de7['abortController']};}['deleteWebResource'](_0x43a5bf,_0x127d47){const _0x1c1e25=this['_sendApiRequest']('/conversations/'+_0x43a5bf+'/web-resources/'+_0x127d47,'DELETE');return{'execute':async()=>{await _0x1c1e25['request'];},'abortController':_0x1c1e25['abortController']};}['callSystemReview']({reviewName:_0x289e2b,content:_0x2ba963,args:_0x74f9e1}){const _0x377277=this['_sendApiRequest']('/reviews/system/'+_0x289e2b+'/calls','POST',{'content':[{'type':'text','content':_0x2ba963}],'args':_0x74f9e1});return{'getStream':async()=>{const _0x43dd71=(await _0x377277['request'])['body'];return this['_getStreamReader'](_0x43dd71);},'abortController':_0x377277['abortController']};}['callCustomReview']({content:_0x49f815,prompt:_0x4858bf,model:_0x221a13}){const _0x45bc71=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x49f815}],'prompt':_0x4858bf,'model':_0x221a13});return{'getStream':async()=>{const _0x500e45=(await _0x45bc71['request'])['body'];return this['_getStreamReader'](_0x500e45);},'abortController':_0x45bc71['abortController']};}['upsertAIChatRating'](_0x37e35f,_0xf36160,_0x64341a){const _0x306408=this['_sendApiRequest']('/conversations/'+_0x37e35f+'/messages/'+_0xf36160+'/ratings','PUT',{'positiveCount':_0x64341a['positiveCount'],'totalCount':_0x64341a['totalCount'],'modificationId':_0x64341a['modificationId']});return{'execute':async()=>{await _0x306408['request'];},'abortController':_0x306408['abortController']};}['upsertAIActionRating'](_0x3cb9cd,_0x3e96a9,_0x315335){const _0x3360b0=this['_sendApiRequest']('/actions/system/'+_0x3cb9cd+'/calls/'+_0x3e96a9+'/ratings','PUT',{'positiveCount':_0x315335['positiveCount'],'totalCount':_0x315335['totalCount']});return{'execute':async()=>{await _0x3360b0['request'];},'abortController':_0x3360b0['abortController']};}['upsertCustomAIActionRating'](_0x279f17,_0x3161f9){const _0x33e743=this['_sendApiRequest']('/actions/custom/calls/'+_0x279f17+'/ratings','PUT',{'positiveCount':_0x3161f9['positiveCount'],'totalCount':_0x3161f9['totalCount']});return{'execute':async()=>{await _0x33e743['request'];},'abortController':_0x33e743['abortController']};}['upsertAIReviewRating'](_0x1f6500,_0x43f926,_0x3bc178,_0x330776){const _0x5499c0=this['_sendApiRequest']('/reviews/system/'+_0x1f6500+'/calls/'+_0x43f926+'/ratings','PUT',{'positiveCount':_0x3bc178['positiveCount'],'totalCount':_0x3bc178['totalCount'],'dataId':_0x330776});return{'execute':async()=>{await _0x5499c0['request'];},'abortController':_0x5499c0['abortController']};}['upsertCustomAIReviewRating'](_0x4886e3,_0xd38230,_0x20884e){const _0x510fcb=this['_sendApiRequest']('/reviews/custom/calls/'+_0x4886e3+'/ratings','PUT',{'positiveCount':_0xd38230['positiveCount'],'totalCount':_0xd38230['totalCount'],'dataId':_0x20884e});return{'execute':async()=>{await _0x510fcb['request'];},'abortController':_0x510fcb['abortController']};}['_sendApiRequest'](_0x4fc8d2,_0x3b11f6,_0x147495){const _0x3a27b4=new AbortController(),_0x5e379c=_0x147495 instanceof FormData,_0x4da716={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x147495&&!_0x5e379c&&(_0x4da716['Content-Type']='application/json');const _0x2eb01b={'method':_0x3b11f6,'headers':_0x4da716,'signal':_0x3a27b4['signal']};return _0x147495&&(_0x2eb01b['body']=_0x5e379c?_0x147495:JSON['stringify'](_0x147495)),{'request':fetch(''+this['_apiUrl']+_0x4fc8d2,_0x2eb01b)['catch'](_0x3a5f39=>{this['_handleError'](_0x3a5f39);})['then'](_0x1b4538=>{if(!_0x1b4538['ok'])throw new _0x29f184('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x4fc8d2,'method':_0x3b11f6,'body':_0x147495,'status':(_0x1b4538||{})['status'],'statusText':(_0x1b4538||{})['statusText']});return _0x1b4538;}),'abortController':_0x3a27b4};}async*['_getStreamReader'](_0x4d00d5){const _0x53573b=[],_0x463cfe=_0x4d00d5['getReader'](),_0x5ed130=wt({'onError':_0x4e5c2f=>{this['_handleError'](_0x4e5c2f);},'onEvent':_0x382e0b=>{_0x382e0b['data']=JSON['parse'](_0x382e0b['data']),_0x53573b['push'](_0x382e0b);}});try{let _0xc5b35=!0x1;for(;!_0xc5b35;){const {done:_0x5bc776,value:_0x473200}=await _0x463cfe['read']();_0x5bc776&&(_0xc5b35=!0x0),_0x5ed130['feed'](this['_decoder']['decode'](_0x473200,{'stream':!0x0})),yield*_0x53573b,_0x53573b['length']=0x0;}}catch(_0x592f59){this['_handleError'](_0x592f59);}finally{_0x463cfe['releaseLock'](),_0x5ed130['reset']();}}['_handleError'](_0x1d6c0d){if(_0x1d6c0d instanceof _0x29f184)throw _0x1d6c0d;if(_0x1d6c0d instanceof Error&&'AbortError'===_0x1d6c0d['name'])throw new _0x29f184('ai-request-aborted',this,{'originalError':_0x1d6c0d});throw new _0x29f184('ai-request-failed',this,{'originalError':_0x1d6c0d});}}function C(_0xcab497,_0x5ac55d,_0xafb028){const t=_0xcab497['t'];switch(_0x5ac55d){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Proposed\x20changes'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20details'});case'AI_MINI_TOOLBAR_LIKE':return t({'id':'AI_MINI_TOOLBAR_LIKE','string':'I\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_DISLIKE':return t({'id':'AI_MINI_TOOLBAR_DISLIKE','string':'I\x20don\x27t\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_COPY':return t({'id':'AI_MINI_TOOLBAR_COPY','string':'Copy\x20to\x20clipboard'});case'AI_SUGGESTION_CONTENT_PART_TITLE':return t({'id':'AI_SUGGESTION_CONTENT_PART_TITLE','string':'Change\x20%0'},_0xafb028);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0xafb028);case'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES','string':'Unable\x20to\x20load\x20resources\x20from\x20%0.\x20Please\x20try\x20again.'},_0xafb028);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0xafb028);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0xafb028);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0xafb028);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0xafb028);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0xafb028);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0xafb028);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0xafb028);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0xafb028);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0xafb028);case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY','string':'Please\x20try\x20a\x20different\x20phrase\x20or\x20check\x20the\x20spelling.'});case'AI_CHAT_HISTORY_EMPTY_MESSAGE':return t({'id':'AI_CHAT_HISTORY_EMPTY_MESSAGE','string':'Your\x20chat\x20history\x20for\x20current\x20document\x20will\x20appear\x20here.'});case'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON':return t({'id':'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON','string':'Go\x20to\x20chat'});case'AI_CHAT_HISTORY_PIN_BUTTON':return t({'id':'AI_CHAT_HISTORY_PIN_BUTTON','string':'Pin'});case'AI_CHAT_HISTORY_SHOW_MORE_ITEMS':return t({'id':'AI_CHAT_HISTORY_SHOW_MORE_ITEMS','string':'Show\x20more\x20items'});case'AI_CHAT_HISTORY_EDIT_NAME':return t({'id':'AI_CHAT_HISTORY_EDIT_NAME','string':'Edit\x20name'});case'AI_CHAT_HISTORY_REMOVE':return t({'id':'AI_CHAT_HISTORY_REMOVE','string':'Remove'});case'AI_CHAT_HISTORY_REMOVE_CONFIRM':return t({'id':'AI_CHAT_HISTORY_REMOVE_CONFIRM','string':'Do\x20you\x20want\x20to\x20remove\x20this\x20chat?'});case'AI_CHAT_HISTORY_ACCEPT':return t({'id':'AI_CHAT_HISTORY_ACCEPT','string':'Accept'});case'AI_CHAT_HISTORY_CANCEL':return t({'id':'AI_CHAT_HISTORY_CANCEL','string':'Cancel'});case'AI_CHAT_HISTORY_LOADING_REMOVING':return t({'id':'AI_CHAT_HISTORY_LOADING_REMOVING','string':'Removing\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_RENAMING':return t({'id':'AI_CHAT_HISTORY_LOADING_RENAMING','string':'Renaming\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_PINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_PINNING','string':'Pinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_UNPINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_UNPINNING','string':'Unpinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_CATEGORY_PINNED':return t({'id':'AI_CHAT_HISTORY_CATEGORY_PINNED','string':'Pinned'});case'AI_CHAT_HISTORY_CATEGORY_TODAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_TODAY','string':'Today'});case'AI_CHAT_HISTORY_CATEGORY_YESTERDAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_YESTERDAY','string':'Yesterday'});case'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS','string':'Last\x2014\x20days'});case'AI_CHAT_HISTORY_CATEGORY_LATER':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LATER','string':'Later'});case'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE','string':'Failed\x20to\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20later.'},_0xafb028);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Failed\x20to\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0xafb028);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Failed\x20to\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0xafb028);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Failed\x20to\x20load\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_PIN_ACTION':return t({'id':'AI_CHAT_HISTORY_PIN_ACTION','string':'pin'});case'AI_CHAT_HISTORY_UNPIN_ACTION':return t({'id':'AI_CHAT_HISTORY_UNPIN_ACTION','string':'unpin'});case'AI_BALLOON_HEADER_TITLE':return t({'id':'AI_BALLOON_HEADER_TITLE','string':'Change\x20%0'},_0xafb028);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_MODEL_DESCRIPTION_AUTO':return t({'id':'AI_MODEL_DESCRIPTION_AUTO','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU','string':'Cost-efficient\x20model\x20for\x20quick\x20interactions\x20with\x20improved\x20reasoning'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET','string':'Advanced\x20model\x20with\x20improved\x20creativity,\x20reliability,\x20and\x20reasoning'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0xafb028);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});default:return _0x5ac55d;}}function Cs(_0x43d349,_0x3413a8){const _0x1e567a=new _0x14ee0a(_0x43d349),_0x5a68ba=C(_0x43d349,'AI_TABS_LABEL_MINIMIZE'),_0x103c80=C(_0x43d349,'AI_TABS_LABEL_MAXIMIZE');return _0x1e567a['set']({'withText':!0x1,'icon':_0x2e7c4e,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x1e567a['bind']('label')['to'](_0x3413a8,'isMaximized',_0x3643ba=>_0x3643ba?_0x5a68ba:_0x103c80),_0x1e567a['bind']('icon')['to'](_0x3413a8,'isMaximized',_0x38de5a=>_0x38de5a?to:_0x2e7c4e),_0x1e567a['bind']('isOn')['to'](_0x3413a8,'isMaximized'),_0x1e567a['on']('execute',()=>{_0x3413a8['fire']('resizeTabs');}),_0x1e567a;}function Ye(_0x4ca1de){return _0x2817be(_0x4ca1de);}function ut(_0x4555e3){return _0xec369b(_0x4555e3);}function ft(_0x487375,_0xd98b6c,_0xfb0d8a){const _0x1da462=null!==_0xd98b6c?_0x43c2ca=>_0x43c2ca['attribs'][_0x487375]===_0xd98b6c:_0x508175=>Boolean(_0x508175['attribs'][_0x487375]);return gt(_0xe6126d=>_0x41757a(_0xe6126d)&&_0x1da462(_0xe6126d),_0xfb0d8a);}function Be(_0x56055e,_0x44b0c2,_0xaba9ed){const _0x18df7f=null!==_0x44b0c2?_0xd32ec0=>_0xd32ec0['attribs'][_0x56055e]===_0x44b0c2:_0x5e6ec0=>Boolean(_0x5e6ec0['attribs'][_0x56055e]);return _0x23a287(_0xca1a0a=>_0x41757a(_0xca1a0a)&&_0x18df7f(_0xca1a0a),_0xaba9ed);}function pt(_0x1991af,_0x2a6b3c){return _0x1991af&&_0x41757a(_0x1991af)?_0x1991af['attribs'][_0x2a6b3c]:null;}function Qe(_0x43e6d9,_0x323295,_0x3143d8){_0x41757a(_0x43e6d9)&&(null===_0x3143d8?delete _0x43e6d9['attribs'][_0x323295]:_0x43e6d9['attribs'][_0x323295]=_0x3143d8);}function ze(_0x2cc288,_0x4d0fd4,_0xcb9e27){const _0x1431d4=_0x4d0fd4['cloneNode'](!0x0);'beforebegin'===_0xcb9e27?_0x53ea51(_0x2cc288,_0x1431d4):'afterbegin'===_0xcb9e27?_0x51c386(_0x2cc288,_0x1431d4):'beforeend'===_0xcb9e27?_0x54c92e(_0x2cc288,_0x1431d4):'afterend'===_0xcb9e27&&_0x2b81f1(_0x2cc288,_0x1431d4);}function Ae(_0x1aaecd){const _0x55cc1f=[];let _0x30bab1=_0x1aaecd;for(;_0x30bab1;)_0x30bab1=_0xb3e946(_0x30bab1),_0x30bab1&&_0x55cc1f['push'](_0x30bab1);return _0x55cc1f;}function Jn(_0x59bc75){return _0x59bc75['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ze(_0x1924d3){let _0x548e07=0x0;for(;_0x1924d3['parentNode'];)_0x1924d3=_0x1924d3['parentNode'],_0x548e07++;return _0x548e07;}function Is(_0x15d8cc){const _0x43d17c=[];let _0x22a61a=_0x15d8cc['nextSibling'];for(;_0x22a61a;)_0x43d17c['push'](_0x22a61a),_0x22a61a=_0x22a61a['nextSibling'];_0x43d17c['forEach'](_0x1483d1=>{_0x33c6d9(_0x1483d1);});}class Oe extends/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x4572ab(){['_m2html'];constructor(){super(),this['_m2html']=new _0x3205a1();}['convertMarkdownToHTML'](_0xdc9d31){const _0xfa3da4=this['_m2html']['parse'](_0xdc9d31);return this['parseAndNormalizeHTML'](_0xfa3da4);}['parseAndNormalizeHTML'](_0xd0606){return this['_parseHTML'](_0xd0606);}['_parseHTML'](_0x13b071){const _0x27fe80=Ye('<dummy>'+_0x13b071['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x27fe80['children']=_0x27fe80['children'][0x0]['children'],_0x27fe80;}}class Ne extends/* #__PURE__ -- @preserve */
|
|
26
|
+
_0x4572ab(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x5dec53){super(),this['_generateUid']=_0x5dec53||_0x223274;}['merge'](_0x5651a7,_0x1ab9d8,_0x58cc19){const _0x1dbaa5=_0x5651a7['cloneNode'](!0x0);if(0x0===_0x1ab9d8['childNodes']['length']){const _0x443d60=[];return Be('data-id','new-element',_0x1dbaa5)['forEach'](_0x404c07=>{const _0x49f5b8=this['_generateUid']();Qe(_0x404c07,'data-id',_0x49f5b8),_0x443d60['push'](_0x49f5b8);}),this['_removeSpecialComments'](_0x1dbaa5),{'parsedContent':_0x1dbaa5,'newNodeIds':_0x443d60,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x58cc19&&_0x58cc19['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1dbaa5),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Be('data-id',null,_0x1ab9d8)['map'](_0xa606fd=>pt(_0xa606fd,'data-id'))['filter'](_0x102b7d=>!!_0x102b7d));let _0x37fc13=-0x1,_0x12e09c=!0x1;const _0xdb1d36=_0x1dbaa5['childNodes'],_0x1fba2a=Array['from'](_0xdb1d36)['filter'](_0x1f78a5=>!(0x3===_0x1f78a5['nodeType']&&''===ut(_0x1f78a5)['trim']())),_0x43a782=_0x1fba2a['length'];for(let _0x24e5f5=0x0;_0x24e5f5<_0x43a782;_0x24e5f5++){const _0x4d5de3=_0x1fba2a[_0x24e5f5],_0x5e01d8=_0x1fba2a[_0x24e5f5+0x1];if(this['_isNewNode'](_0x4d5de3)){if(-0x1===_0x37fc13&&(_0x37fc13=_0x24e5f5),this['_markWrappedElements'](_0x4d5de3),!this['_isNewNode'](_0x5e01d8)){const [_0x42269f,_0x4461ac]=this['_findReferenceNode'](_0x4d5de3,_0x12e09c,_0x1ab9d8);if(_0x42269f){const _0x3f4feb=Array['from'](_0x1fba2a)['slice'](_0x37fc13,_0x24e5f5+0x1);this['_insertNodes'](_0x42269f,_0x3f4feb,_0x4461ac),_0x37fc13=-0x1;}}}else{if(this['_isExistingContentComment'](_0x4d5de3))_0x12e09c=!0x0;else{if(this['_isExistingNode'](_0x4d5de3)){const _0x290eaa=pt(_0x4d5de3,'data-id');if(_0x290eaa&&this['_existingDataIds']['has'](_0x290eaa)){const _0x1cd6f8=ft('data-id',_0x290eaa,_0x1ab9d8);this['_replaceNode'](_0x1cd6f8,_0x4d5de3);}if(this['_touchedNodesState']['removedIds']['includes'](_0x290eaa)){const _0x48fe3f=this['_touchedNodesState']['removedIds']['indexOf'](_0x290eaa);this['_touchedNodesState']['removedIds']['splice'](_0x48fe3f,0x1);}}else{if(this['_isDelNode'](_0x4d5de3)){const _0x4f13c0=pt(_0x4d5de3,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x4f13c0)||this['_storeDeletedElementIds'](_0x4d5de3);}}}}}for(const _0x59c4e4 of this['_touchedNodesState']['removedIds']){const _0x18902d=ft('data-id',_0x59c4e4,_0x1ab9d8);if(_0x18902d){if(_0x58cc19&&_0x58cc19['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x59c4e4;const _0x1bf9a4=_0x58cc19['replaceRemovedWith']['cloneNode'](!0x0);Qe(_0x1bf9a4,'data-id',_0x59c4e4),Qe(_0x1bf9a4,'data-removed','true'),_0x173cd4(_0x18902d,_0x1bf9a4);}else _0x33c6d9(_0x18902d);}}if(Be('data-wrapped-id',null,_0x1ab9d8)['forEach'](_0x36588c=>{const _0x31da1e=ft('data-id',pt(_0x36588c,'data-wrapped-id'),_0x1ab9d8);var _0xd66e82,_0x62b597;_0x31da1e&&(_0x62b597=_0x36588c,_0x33c6d9(_0xd66e82=_0x31da1e),_0x173cd4(_0x62b597,_0xd66e82));}),Be('data-id','new-element',_0x1ab9d8)['forEach'](_0x3a764c=>{const _0x52eaa0=this['_getUid'](_0x3a764c);Qe(_0x3a764c,'data-id',_0x52eaa0),this['_touchedNodesState']['newIds']['push'](_0x52eaa0);}),this['_removeSpecialComments'](_0x1ab9d8),_0x58cc19&&_0x58cc19['markUnstableElements']&&this['_markUnstableElements'](_0x1ab9d8,_0x58cc19['markUnstableElementsDepth']||0x0),_0x58cc19&&_0x58cc19['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x59c29b=ft('data-id',this['_touchedNodesState']['lastTouchedId'],_0x1ab9d8);for(;_0x59c29b;)Is(_0x59c29b),_0x59c29b=_0x59c29b['parentNode'];}return{'parsedContent':_0x1ab9d8,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0xddd4f1,_0x35a86c,_0x3a7554){for(const _0x3eedc0 of _0x35a86c){const _0x51662a=this['_getUid'](_0x3eedc0);Qe(_0x3eedc0,'data-id',_0x51662a),this['_touchedNodesState']['newIds']['push'](_0x51662a),this['_touchedNodesState']['lastTouchedId']=_0x51662a;}const _0x3d128c='afterbegin'===_0x3a7554||'afterend'===_0x3a7554?_0x35a86c['reverse']():_0x35a86c;for(const _0x549b2e of _0x3d128c)ze(_0xddd4f1,_0x549b2e,_0x3a7554);}['_replaceNode'](_0x5a19ac,_0x1c3781){if(!_0x5a19ac)return;if(_0x3ca5c5=_0x1c3781,Jn(ut(_0x5a19ac))===Jn(ut(_0x3ca5c5)))return;var _0x3ca5c5;const _0x56df65=this['_getUid'](_0x5a19ac);Qe(_0x1c3781,'data-id',_0x56df65),this['_touchedNodesState']['modifiedIds']['push'](_0x56df65),this['_touchedNodesState']['lastTouchedId']=_0x56df65,_0x173cd4(_0x5a19ac,_0x1c3781['cloneNode'](!0x0));}['_findReferenceNode'](_0x129490,_0x17c2d8,_0x1846a4){const _0x406394=this['_findPrevElementWithDataId'](_0x129490,!0x1);if(_0x406394){const _0x975e82=this['_getNodeDataId'](_0x406394),_0x2f06c0=ft('data-id',_0x975e82,_0x1846a4);if(_0x2f06c0)return[_0x2f06c0,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x975e82);}const _0x167e88=this['_findNextElementWithDataId'](_0x129490,!0x1);if(_0x167e88){const _0x5695e1=this['_getNodeDataId'](_0x167e88),_0xdb82ea=ft('data-id',_0x5695e1,_0x1846a4);if(_0xdb82ea)return[_0xdb82ea,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x5695e1);}return _0x17c2d8?_0x129490['nextSibling']?this['_findFallbackReferenceNode'](_0x129490,_0x1846a4):[_0x1846a4['childNodes'][_0x1846a4['childNodes']['length']-0x1],'afterend']:[_0x1846a4['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x114241,_0x4a0769){const _0x4e6323=[],_0x377def=this['_findPrevElementWithDataId'](_0x114241,!0x0);if(_0x377def){const _0x6c29c6=ft('data-id',this['_getNodeDataId'](_0x377def),_0x4a0769);_0x6c29c6&&_0x4e6323['push']([_0x6c29c6,'afterend']);}const _0x29ffd0=this['_findNextElementWithDataId'](_0x114241,!0x0);if(_0x29ffd0){const _0x5b67ee=ft('data-id',this['_getNodeDataId'](_0x29ffd0),_0x4a0769);_0x5b67ee&&_0x4e6323['push']([_0x5b67ee,'beforebegin']);}if(_0x4e6323['length']>0x1)return Ze(_0x4e6323[0x0][0x0])<=Ze(_0x4e6323[0x1][0x0])?_0x4e6323[0x0]:_0x4e6323[0x1];return 0x1===_0x4e6323['length']?_0x4e6323[0x0]:[_0x4a0769['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x587197,_0x3d0967){let _0x32ecbf=_0x587197['nextSibling'],_0x1af09f=null,_0x9ede4c=!0x1;for(;_0x32ecbf;){if(_0x5581e1(_0x32ecbf)){if(this['_isDelNode'](_0x32ecbf)&&(_0x1af09f=_0x32ecbf),this['_isExistingContentComment'](_0x32ecbf)&&_0x3d0967&&!_0x9ede4c){_0x9ede4c=!0x0,_0x32ecbf=_0x32ecbf['nextSibling'];continue;}break;}const _0x6dc487=pt(_0x32ecbf,'data-id');if(_0x6dc487&&'new-element'!==_0x6dc487&&this['_existingDataIds']['has'](_0x6dc487)){_0x1af09f=_0x32ecbf;break;}_0x32ecbf=_0x32ecbf['nextSibling'];}return _0x1af09f;}['_findPrevElementWithDataId'](_0x1596ea,_0xf9f2f6){let _0x222e84=_0x1596ea['previousSibling'],_0x51182c=null,_0x2b81bf=!0x1;for(;_0x222e84;){if(_0x5581e1(_0x222e84)){if(this['_isDelNode'](_0x222e84)&&(_0x51182c=_0x222e84),this['_isExistingContentComment'](_0x222e84)&&_0xf9f2f6&&!_0x2b81bf){_0x2b81bf=!0x0,_0x222e84=_0x222e84['previousSibling'];continue;}break;}const _0xee7392=pt(_0x222e84,'data-id');if(_0xee7392&&'new-element'!==_0xee7392&&this['_existingDataIds']['has'](_0xee7392)){_0x51182c=_0x222e84;break;}_0x222e84=_0x222e84['previousSibling'];}return _0x51182c;}['_markWrappedElements'](_0x5c4cd3){_0x41757a(_0x5c4cd3)&&Be('data-id',null,_0x5c4cd3)['forEach'](_0x113a44=>{this['_isExistingNode'](_0x113a44)&&!this['_hasWrappedParent'](_0x113a44)&&(Qe(_0x113a44,'data-wrapped-id',pt(_0x113a44,'data-id')),Qe(_0x113a44,'data-id',null));});}['_getNodeDataId'](_0x1f481c){if(!_0x1f481c)return null;if(_0x41757a(_0x1f481c))return pt(_0x1f481c,'data-id');if(_0x5581e1(_0x1f481c)){const _0x4b67e2=ut(_0x1f481c)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4b67e2&&_0x4b67e2[0x1])return _0x4b67e2[0x1];}return null;}['_storeDeletedElementIds'](_0x4042a6){if(_0x5581e1(_0x4042a6)){const _0x5afada=ut(_0x4042a6)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x5afada&&_0x5afada[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x5afada[0x1]);}}['_getUid'](_0x1945ea){return this['_isExistingNode'](_0x1945ea)?pt(_0x1945ea,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x4936f7){(function(_0x4382c6){return _0x3bb1ba(_0x4a7d5d=>_0x5581e1(_0x4a7d5d),_0x4382c6,!0x0,0x1/0x0);}(_0x4936f7)['filter'](_0x498975=>this['_isDelNode'](_0x498975)||this['_isExistingContentComment'](_0x498975))['forEach'](_0x4bc022=>{_0x33c6d9(_0x4bc022);}));}['_markLastTagElementUnstable'](_0x130f8d){const _0x2e4ef0=_0x130f8d['childNodes'],_0x1cc900=_0x2e4ef0[_0x2e4ef0['length']-0x1];_0x1cc900&&_0x41757a(_0x1cc900)&&Qe(_0x1cc900,'data-unstable','true');}['_markUnstableElements'](_0x4ac0,_0x3b8bc7){const _0x407670=ft('data-unstable','true',_0x4ac0);if(!_0x407670)return;const _0x5be2d9=Ae(_0x407670)['slice'](0x0,-0x1),_0x5182fa=_0x5be2d9['length'];let _0x3a4a0a=_0x407670;if(_0x5182fa>_0x3b8bc7){let _0x2f45fd=_0x5182fa,_0x4c148f=null;for(;_0x2f45fd>_0x3b8bc7&&_0x2f45fd>=0x0;)_0x2f45fd--,_0x4c148f=_0x5be2d9[_0x2f45fd];_0x4c148f&&(_0x3a4a0a=_0x4c148f,Qe(_0x407670,'data-unstable',null),Qe(_0x4c148f,'data-unstable','true'));}else{if(_0x5182fa<_0x3b8bc7){let _0x4019b4=_0x5182fa,_0x1a517e=_0x407670;for(;_0x4019b4<_0x3b8bc7;){const _0x1e7505=_0x1a517e['childNodes']['filter'](_0x4aa731=>_0x41757a(_0x4aa731));if(0x0===_0x1e7505['length'])break;_0x4019b4++,_0x1a517e=_0x1e7505[_0x1e7505['length']-0x1];}_0x1a517e&&(_0x3a4a0a=_0x1a517e,Qe(_0x407670,'data-unstable',null),Qe(_0x1a517e,'data-unstable','true'));}}let _0x110721=_0x3a4a0a;for(;_0x110721;){for(;_0x110721['nextSibling'];)_0x110721=_0x110721['nextSibling'],_0x41757a(_0x110721)&&Qe(_0x110721,'data-unstable','true');_0x110721=_0x110721['parentNode'];}}['_isNewNode'](_0x363935){return Boolean('new-element'===pt(_0x363935,'data-id'));}['_isExistingNode'](_0x3ebe46){return Boolean((pt(_0x3ebe46,'data-id')||'')['length']>0x0&&'new-element'!==pt(_0x3ebe46,'data-id'));}['_isDelNode'](_0x3e0fc9){return!!_0x3e0fc9&&Boolean(_0x5581e1(_0x3e0fc9)&&ut(_0x3e0fc9)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x1a8edb){let _0x42b23d=_0x1a8edb['parentNode'];for(;_0x42b23d;){if(pt(_0x42b23d,'data-wrapped-id'))return!0x0;_0x42b23d=_0x42b23d['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x37bc88){return Boolean(_0x5581e1(_0x37bc88)&&ut(_0x37bc88)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function y({editor:_0x24a2ad,changeGroups:_0x31474f,documentContextContent:_0x3405e7,showDiff:_0x3a80a4,trimUnchanged:_0x56a39d=!0x0}){return _0x31474f['map'](_0x48d3e6=>{const _0x38bd01=new mt([]),_0x14bc6d=new mt([]);for(const _0x21ad09 of _0x48d3e6['changes'])if(_0x3a80a4&&'removed'==_0x21ad09['type']||_0x14bc6d['children']['push'](_0x21ad09['node']['cloneNode'](!0x0)),'new'!=_0x21ad09['type']&&(_0x3a80a4||'removed'!=_0x21ad09['type'])){const _0x529b3d=gt(_0x206fc7=>pt(_0x206fc7,'data-id')==_0x21ad09['id'],_0x3405e7,!0x0);_0x529b3d&&_0x38bd01['children']['push'](_0x529b3d['cloneNode'](!0x0));}const {content:_0x125b98,hasChanges:_0x26ce35}=function(_0x28750f,_0x25da10,_0x356491,_0x3dfb27,_0x15fe0a=!0x0){const _0x465226=_0x28750f['plugins']['get']('DocumentCompare'),_0x4612a4=ut(_0x25da10),_0x27952d=ut(_0x356491),_0x9e2af8=_0x28750f['data']['parse'](_0x4612a4,'$root'),_0xcde9a3=_0x28750f['model']['createPositionAt'](_0x9e2af8,0x0),_0x585e9d=_0x465226['getDiff'](_0x4612a4,_0x27952d,{'anchor':_0xcde9a3,'markDeletions':_0x3dfb27}),_0x4f897b=_0x585e9d['getOperations']();if(0x0==_0x4f897b['length'])return{'content':_0x25da10['cloneNode'](!0x0),'hasChanges':!0x1};_0x3dfb27?function(_0x238e97,_0x2e5db1,_0x5c47f8){if(0x0==_0x238e97['length'])return;const _0x3d37b9=_0x5c47f8['plugins']['get']('DocumentCompare'),_0x2785f7=_0x5c47f8['plugins']['get']('SuggestionsConversion');_0x5c47f8['model']['change'](_0x2ced09=>{const _0xd0721b=new Set();for(let _0x11bb8d=0x0;_0x11bb8d<_0x238e97['length'];_0x11bb8d++){const _0x4ad7b8=_0x238e97[_0x11bb8d];if(_0x4ad7b8['baseVersion']=null,_0x4ad7b8['isDocumentOperation']=!0x1,_0x3d37b9['isMarkedRemoveOperation'](_0x4ad7b8)){const _0x641127=_0xf3fa2c(_0x4ad7b8['newRange'],_0x5c47f8['model']),_0x202707='suggestion:deletion:'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x202707,_0x641127);}else switch(_0x4ad7b8['type']){case'rename':{if(_0x4ad7b8['oldName']==_0x4ad7b8['newName'])break;_0x2ced09['batch']['addOperation'](_0x4ad7b8),_0x5c47f8['model']['applyOperation'](_0x4ad7b8);const _0x34264a='$elementName',_0x5e9c0a=_0x4ad7b8['position'],_0x5e19cf=_0x5c47f8['model']['createRange'](_0x5e9c0a,_0x5c47f8['model']['createPositionAt'](_0x5e9c0a['nodeAfter'],'end')),_0x22a228='suggestion:attribute:'+_0x34264a+':'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x22a228,_0x5e19cf);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x4ad7b8['oldValue']==_0x4ad7b8['newValue'])break;_0x2ced09['batch']['addOperation'](_0x4ad7b8),_0x5c47f8['model']['applyOperation'](_0x4ad7b8);const _0x349975=_0x4ad7b8['key'];if(!_0x2785f7['isRegisteredAttribute'](_0x349975))break;const _0x2e94ec=_0xf3fa2c(_0x4ad7b8['range'],_0x5c47f8['model']),_0x1ee536='suggestion:attribute:'+_0x349975+':'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x1ee536,_0x2e94ec);break;}case'insert':{_0x2ced09['batch']['addOperation'](_0x4ad7b8),_0x5c47f8['model']['applyOperation'](_0x4ad7b8);if(_0x238e97[_0x11bb8d+0x1]&&'move'==_0x238e97[_0x11bb8d+0x1]['type']){ro(_0x2e5db1,_0x4ad7b8);break;}const _0x5537ed=_0x4ad7b8['position'],_0x2d9e59=_0x4ad7b8['howMany'],_0xa76c2d=_0xf3fa2c(_0x5c47f8['model']['createRange'](_0x5537ed,_0x5537ed['getShiftedBy'](_0x2d9e59)),_0x5c47f8['model']),_0x2375a9='suggestion:insertion:'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x2375a9,_0xa76c2d);break;}case'split':{_0x2ced09['batch']['addOperation'](_0x4ad7b8),_0x5c47f8['model']['applyOperation'](_0x4ad7b8);const _0x4327d2=_0x4ad7b8['splitPosition'],_0x57fe49=_0x4ad7b8['moveTargetPosition'],_0x365dff=_0x5c47f8['model']['createRange'](_0x4327d2,_0x57fe49),_0x306998='suggestion:insertion:'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x306998,_0x365dff);break;}case'move':{_0x2ced09['batch']['addOperation'](_0x4ad7b8),_0x5c47f8['model']['applyOperation'](_0x4ad7b8),_0x238e97[_0x11bb8d-0x1]&&'insert'==_0x238e97[_0x11bb8d-0x1]['type']&&ro(_0x2e5db1,_0x4ad7b8);const _0x85608e=_0x4ad7b8['getMovedRangeStart'](),_0x4a5560=_0x4ad7b8['howMany'];for(let _0x1e21c0=0x0;_0x1e21c0<_0x4a5560;_0x1e21c0++){const _0x236650=_0x85608e['getShiftedBy'](_0x1e21c0)['nodeAfter'];_0xd0721b['add'](_0x236650);}break;}case'remove':{const _0x44c724=_0x4ad7b8['sourcePosition'],_0x1bfa7e=_0x4ad7b8['howMany'],_0x1c9186=new _0x1609ec(_0x44c724,_0x1bfa7e);_0x2ced09['batch']['addOperation'](_0x1c9186),_0x5c47f8['model']['applyOperation'](_0x1c9186);break;}}}for(const _0x4a24d7 of _0xd0721b){const _0x439bf9=_0x5c47f8['model']['createRangeOn'](_0x4a24d7),_0x5c28ce='suggestion:formatBlock:$fakeWrap:'+_0x223274()+':$aiSuggestion';_0x2e5db1['markers']['set'](_0x5c28ce,_0xf3fa2c(_0x439bf9,_0x5c47f8['model']));}});}(_0x4f897b,_0x9e2af8,_0x28750f):_0x28750f['model']['change'](_0x4c84d0=>{for(const _0x5aafa7 of _0x4f897b)if('remove'==_0x5aafa7['type']){const _0x10fe92=_0x5aafa7['sourcePosition'],_0x4e3bd3=_0x5aafa7['howMany'],_0x4f3177=new _0x1609ec(_0x10fe92,_0x4e3bd3);_0x4c84d0['batch']['addOperation'](_0x4f3177),_0x28750f['model']['applyOperation'](_0x4f3177);}else{if('marker'==_0x5aafa7['type']){const _0x5eab5e=_0x5aafa7['name'],_0x8dd74e=_0x5aafa7['newRange'];_0x9e2af8['markers']['set'](_0x5eab5e,_0x8dd74e);}else _0x5aafa7['baseVersion']=null,_0x5aafa7['isDocumentOperation']=!0x1,_0x4c84d0['batch']['addOperation'](_0x5aafa7),_0x28750f['model']['applyOperation'](_0x5aafa7);}});if(_0x15fe0a){const _0x2f2c04=lt(_0x28750f,_0x4f897b,_0x9e2af8);dt(_0x28750f['model'],_0x2f2c04),function(_0x413495,_0x4c91d4){const _0xa7aad2=_0x4c91d4['getFirstRange']()['start'];let _0x5738c6=_0x4c91d4['getFirstRange']()['end'];const _0x488b9d=_0xa7aad2['root'];(_0x5738c6['textNode']||_0x5738c6['nodeAfter']&&_0x5738c6['nodeAfter']['is']('$text'))&&(_0x5c757f(_0x5738c6,'...'),_0x5738c6=_0x5738c6['getShiftedBy'](0x3)),(_0xa7aad2['textNode']||_0xa7aad2['nodeBefore']&&_0xa7aad2['nodeBefore']['is']('$text'))&&(_0x5c757f(_0xa7aad2,'...'),function(_0x575b21,_0x16735f,_0xca4473){for(let [_0x23d1fe,_0x564877]of _0x575b21['markers']){const _0x5d6e20=_0x564877['_getTransformedByInsertion'](_0x16735f,_0xca4473,!0x1);_0x564877=_0x5d6e20[0x0],_0x575b21['markers']['set'](_0x23d1fe,_0x564877);}}(_0x488b9d,_0xa7aad2,0x3),_0xa7aad2['parent']==_0x5738c6['parent']&&(_0x5738c6=_0x5738c6['getShiftedBy'](0x3)));const _0x5b68dc=_0x413495['createRange'](_0x413495['createPositionAt'](_0x488b9d,0x0),_0xa7aad2),_0x3fe19e=_0x413495['createRange'](_0x5738c6,_0x413495['createPositionAt'](_0x488b9d,'end')),_0x554530=[..._0x5b68dc['getMinimalFlatRanges'](),..._0x3fe19e['getMinimalFlatRanges']()];_0x554530['reverse']();for(const _0x4e7225 of _0x554530)_0x41016b(_0x4e7225),Zn(_0x488b9d,_0x4e7225);}(_0x28750f['model'],_0x2f2c04);}const _0x452a89=_0x28750f['data']['stringify'](_0x9e2af8,{'showSuggestionHighlights':!0x0});return{'content':Ye(_0x452a89),'hasChanges':!0x0};}(_0x24a2ad,_0x38bd01,_0x14bc6d,_0x3a80a4,_0x56a39d);return{'type':_0x48d3e6['changes'][0x0]['type'],'index':_0x48d3e6['index'],'content':_0x125b98,'hasChanges':_0x26ce35};});}function ro(_0x265132,_0x3ae5d9){for(const [_0xc4cebf,_0x1e8db1]of _0x265132['markers']){const _0x49e46a=_0x59485f['_createFromRanges'](_0x1e8db1['getTransformedByOperation'](_0x3ae5d9));_0x265132['markers']['set'](_0xc4cebf,_0x49e46a);}}function lt(_0x4a999d,_0x46a736,_0x4835cf){const _0xc9f90e=_0x4a999d['plugins']['get']('DocumentCompare');let _0x3db96a=_0x4a999d['model']['createPositionAt'](_0x4835cf,Number['POSITIVE_INFINITY']),_0x5bcb9e=_0x4a999d['model']['createPositionAt'](_0x4835cf,0x0);for(const _0xf6d93f of _0x46a736){let _0x2da51c,_0x4704ea;if(_0xc9f90e['isMarkedRemoveOperation'](_0xf6d93f))_0x2da51c=_0xf6d93f['newRange']['start'],_0x4704ea=_0xf6d93f['newRange']['end'];else switch(_0x3db96a=_0x3db96a['getTransformedByOperation'](_0xf6d93f),_0x5bcb9e=_0x5bcb9e['getTransformedByOperation'](_0xf6d93f),_0xf6d93f['type']){case'rename':_0x2da51c=_0xf6d93f['position'],_0x4704ea=_0x2da51c['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x2da51c=_0xf6d93f['range']['start'],_0x4704ea=_0xf6d93f['range']['end'];break;case'insert':_0x2da51c=_0xf6d93f['position'],_0x4704ea=_0x2da51c['getShiftedBy'](_0xf6d93f['howMany']);break;case'split':_0x2da51c=_0xf6d93f['splitPosition'],_0x4704ea=_0xf6d93f['moveTargetPosition'];break;case'merge':{const _0x45c5b2=_0xf6d93f['targetPosition']['path']['slice'](0x0,-0x1);_0x2da51c=_0x4a999d['model']['createPositionFromPath'](_0x4835cf,_0x45c5b2),_0x4704ea=_0x2da51c['getShiftedBy'](0x1);break;}case'remove':{const _0x2af53=_0xf6d93f['howMany'],_0x4bee9b=_0xf6d93f['sourcePosition']['_getTransformedByInsertion'](_0xf6d93f['targetPosition'],_0x2af53),_0x2be519=_0xf6d93f['getMovedRangeStart']();'remove'==_0xf6d93f['type']?(_0x2da51c=_0x4bee9b,_0x4704ea=_0x4bee9b):(_0x2da51c=_0x2be519,_0x4704ea=_0x2be519['getShiftedBy'](_0x2af53));break;}}_0x2da51c&&_0x2da51c['isBefore'](_0x3db96a)&&(_0x3db96a=_0x2da51c['clone'](),_0x3db96a['stickiness']='toNone'),_0x4704ea&&_0x4704ea['isAfter'](_0x5bcb9e)&&(_0x5bcb9e=_0x4704ea['clone'](),_0x5bcb9e['stickiness']='toNone');}return _0x4a999d['model']['createSelection'](_0x4a999d['model']['createRange'](_0x3db96a,_0x5bcb9e));}function dt(_0x10b3be,_0x3da522){so(_0x10b3be,_0x3da522,'forward');const _0xa260a6=_0x3da522['getFirstRange']();_0x3da522['setTo']([]),_0x3da522['setTo'](_0xa260a6,{'backward':!0x0}),so(_0x10b3be,_0x3da522,'backward');}function so(_0x5b8dd4,_0x39f3c5,_0x480295){let _0x35f092=0x14;for(;_0x35f092;){_0x5b8dd4['modifySelection'](_0x39f3c5,{'unit':'word','direction':_0x480295}),_0x35f092--;const _0x53dbf0=_0x39f3c5['focus']['forward'==_0x480295?'nodeBefore':'nodeAfter'];if(_0x53dbf0&&_0x53dbf0['is']('element')&&_0x5b8dd4['schema']['isBlock'](_0x53dbf0)&&_0x5b8dd4['schema']['isObject'](_0x53dbf0))break;}}function Zn(_0x4e0691,_0x25d558){for(const [_0x359bd4,_0x59edde]of _0x4e0691['markers']){const _0x6fbec6=_0x59edde['_getTransformedByDeletion'](_0x25d558['start'],_0x25d558['end']['offset']-_0x25d558['start']['offset']);null!=_0x6fbec6?_0x4e0691['markers']['set'](_0x359bd4,_0x6fbec6):_0x4e0691['markers']['delete'](_0x359bd4);}}const Ur=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class de extends _0x4572ab(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new mt([]);['parsedMergedContent']=new mt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x517560,content:_0x37e398='',isDone:_0x3e57bc=!0x1,interactionId:_0x207a7b,areActionsDisabled:_0x54056e,documentContextContent:_0x19fd5b,editor:_0x1b9880,id:_0x5c3441}){super(),this['id']=_0x5c3441||_0x223274(),this['interactionId']=_0x207a7b,this['type']=_0x517560,this['areActionsDisabled']=!!_0x54056e,this['editor']=_0x1b9880,this['aiResponseParser']=new Oe(),this['aiResponseApplier']=new Ne(),this['documentContextContent']=Ye(_0x19fd5b||''),this['set']('isDone',_0x3e57bc),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x37e398);}['appendContent'](_0x12a5c0){this['set']('content',this['content']+_0x12a5c0);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x1cb6bb,_0x3bc45a){this['changeGroups'][_0x1cb6bb]['state']=_0x3bc45a,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x1cb6bb,'state':_0x3bc45a});}['getContentParts']({showDiff:_0xf4ad0e,groupIndex:_0x534eda}){if(!this['editor'])throw new _0x29f184('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x104549=this['_getCachedContentParts'](_0xf4ad0e,_0x534eda);if(_0x104549)return _0x104549;let _0x41f001=[];if(void 0x0===_0x534eda)_0x41f001=this['changeGroups'];else{const _0x1a604e=this['changeGroups']['find'](({index:_0x38b661})=>_0x38b661===_0x534eda);if(!_0x1a604e)throw new _0x29f184('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x534eda});_0x41f001=[_0x1a604e];}const _0x318426=y({'editor':this['editor'],'showDiff':_0xf4ad0e,'changeGroups':_0x41f001,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0xf4ad0e,_0x318426),_0x318426;}['_getCachedContentParts'](_0x4eb0e4,_0x30481e){const _0x4915fd=_0x4eb0e4?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x4915fd]['length'])return null;const _0x5ed114=this['cachedSuggestionContentParts'][_0x4915fd];if(void 0x0===_0x30481e)return _0x5e9a78(_0x5ed114);{const _0x3d50f1=_0x5ed114['find'](({index:_0x57700d})=>_0x57700d===_0x30481e);if(_0x3d50f1)return[_0x5e9a78(_0x3d50f1)];}return null;}['_setCachedContentParts'](_0x2e9260,_0x2f7b93){const _0x5e6de1=_0x2e9260?'withDiff':'withoutDiff';_0x2f7b93['forEach'](_0x3f100a=>{const _0x191e70=this['cachedSuggestionContentParts'][_0x5e6de1],_0x5b982d=_0x191e70['find'](({index:_0x241fbf})=>_0x241fbf===_0x3f100a['index']);if(_0x5b982d){const _0x4a907e=_0x191e70['indexOf'](_0x5b982d);_0x191e70['splice'](_0x4a907e,0x1,_0x3f100a);}else _0x191e70['push'](_0x3f100a);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x47bb13=this['changeGroups'];this['updateChangeGroups']();const _0x325679=this['_getDifferentChangeGroups'](_0x47bb13,this['changeGroups']);(_0x325679['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x325679),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x299a4c,_0xef219){const _0x4571a5=[];for(const _0x5eed2d of _0xef219){const _0x1c506c=_0x299a4c[_0x5eed2d['index']];_0x1c506c?_0x1c506c['changes']['length']!==_0x5eed2d['changes']['length']?_0x4571a5['push'](_0x5eed2d):_0x1c506c['changes']['forEach']((_0x14ce42,_0x2dbbc4)=>{const _0x124523=_0x5eed2d['changes'][_0x2dbbc4];_0x14ce42['id']!==_0x124523['id']&&_0x4571a5['push'](_0x5eed2d);}):_0x4571a5['push'](_0x5eed2d);}return _0x4571a5;}['updateChangeGroups'](){const _0x8aa3aa=new _0x2c5bc4('p',{},[new _0x2c5bc4('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x2e2b16(C(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x145e6e=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x8aa3aa,'cutAfterLastChange':!this['isDone']});if(!_0x145e6e['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x145e6e['parsedContent'];let _0xc1627a=[];if(_0x23a287(_0x388c15=>{const _0xfa379f=pt(_0x388c15,'data-id');if(!_0xfa379f||!_0x3ccbce(_0xfa379f))return!0x1;const _0x4d0447=[_0x388c15,...Ae(_0x388c15)]['at'](-0x2);if(_0x388c15!=_0x4d0447){const _0x100da2=pt(_0x4d0447,'data-id');_0x3ccbce(_0x100da2)||(_0xc1627a['push']({'node':_0x4d0447,'id':_0x100da2,'type':'modified'}),_0x145e6e['modifiedNodeIds']['push'](_0x100da2));}else _0x145e6e['modifiedNodeIds']['includes'](_0xfa379f)?_0xc1627a['push']({'node':_0x388c15,'type':'modified','id':_0xfa379f}):_0x145e6e['newNodeIds']['includes'](_0xfa379f)?_0xc1627a['push']({'node':_0x388c15,'type':'new','id':_0xfa379f,'anchorId':pt(_0x388c15['previousSibling'],'data-id')}):_0xc1627a['push']({'node':_0x388c15,'type':'removed','id':_0xfa379f});return!0x0;},this['parsedMergedContent']),_0xc1627a=_0xc1627a['filter'](({node:_0xc739b5})=>[...Ae(_0xc739b5),_0xc739b5]['every'](_0x49a958=>!pt(_0x49a958,'data-unstable'))),0x0==_0xc1627a['length'])return;const _0x37f52e=[[_0xc1627a[0x0]]];for(let _0x1b250d=0x1;_0x1b250d<_0xc1627a['length'];_0x1b250d++){const _0x12f186=_0x37f52e[_0x37f52e['length']-0x1],_0x36f95f=_0x12f186[_0x12f186['length']-0x1];_0xc1627a[_0x1b250d]['node']['previousSibling']==_0x36f95f['node']&&'modified'!=_0xc1627a[_0x1b250d]['type']&&'modified'!=_0x36f95f['type']?_0x12f186['push'](_0xc1627a[_0x1b250d]):_0x37f52e['push']([_0xc1627a[_0x1b250d]]);}for(const _0x1ae02d of _0x37f52e){const _0x3f189c=_0x1ae02d[0x0],_0x30a61c=_0x1ae02d[_0x1ae02d['length']-0x1],_0x353f4f=_0x24a957(_0x3f189c['node']['previousSibling']);_0x353f4f&&_0x1ae02d['unshift'](_0x353f4f);const _0x5b3767=_0x24a957(_0x30a61c['node']['nextSibling']);_0x5b3767&&_0x1ae02d['push'](_0x5b3767);}function _0x3ccbce(_0x8f06f2){return _0x145e6e['modifiedNodeIds']['includes'](_0x8f06f2)||_0x145e6e['newNodeIds']['includes'](_0x8f06f2)||_0x145e6e['removedNodeIds']['includes'](_0x8f06f2);}function _0x24a957(_0x505195){if(_0x505195&&pt(_0x505195,'data-id')&&!pt(_0x505195,'data-unstable')){const _0x24ae94=pt(_0x505195,'data-id');if(!_0x3ccbce(_0x24ae94))return{'node':_0x505195,'type':'context','id':_0x24ae94};}return null;}this['changeGroups']=_0x37f52e['map']((_0x1305fc,_0xc2c37f)=>({'changes':_0x1305fc,'state':'pending','index':_0xc2c37f}));}}function $i(_0x48358f){return Object['values'](Ur)['includes'](_0x48358f);}function Zi(_0x411e59){return Wr['includes'](_0x411e59);}function Ee(_0x407811){return'conversation-title'===_0x407811;}function Fe(_0x5efebc){return'source'===_0x5efebc;}const Vt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class Jt extends _0x135bec(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x2bd4c6,editor:_0x16ecbe}){super(),this['id']=_0x223274(),this['connector']=_0x2bd4c6,this['isStopped']=!0x0,this['editor']=_0x16ecbe;}async['start'](){let _0x142fa5;const _0x4356f7=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x482328=await this['currentRequest']['getStream']();for await(const _0x2091a9 of _0x482328){if(this['isStopped'])return;if('error'===_0x2091a9['event'])return void this['fire']('error',{'error':new _0x29f184('ai-chat-interaction-error',this)});if('message-metadata'!==_0x2091a9['event']){if('action-metadata'!==_0x2091a9['event']){if(Ee(_0x2091a9['event'])&&this['setConversationTitle'](_0x2091a9['data']['conversationTitle'],!0x0),Fe(_0x2091a9['event']))_0x4356f7['push'](_0x2091a9['data']['source']);else{if($i(_0x2091a9['event'])){if(_0x2091a9['event']!==_0x142fa5){if(_0x142fa5=_0x2091a9['event'],'web-search'===_0x2091a9['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x2091a9['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x2091a9['event'],'interactionId':this['id'],'id':_0x2091a9['data']?.['id']}),_0x4356f7['length']>0x0&&'modification-delta'===_0x2091a9['event']&&(this['currentReply']['sources']=_0x4356f7['splice'](0x0));}_0x2091a9['data']['textDelta']&&this['currentReply']['appendContent'](_0x2091a9['data']['textDelta']);}else Zi(_0x2091a9['event'])||_0xadd6c3('ai-interaction-invalid-event-type',{'chunk':_0x2091a9});}}else this['actionCallId']=_0x2091a9['data']['callId'];}else this['messageId']=_0x2091a9['data']['messageId'];}}finally{this['isStopped']||(_0x4356f7['length']>0x0&&(this['currentReply']['sources']=_0x4356f7['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x2ab42b){return this['replies']['find'](_0x59cc4b=>_0x59cc4b['id']===_0x2ab42b);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x5e2872=>_0x5e2872['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x367fa2){const _0x44c6ba=new de({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x367fa2});return this['replies']['push'](_0x44c6ba),_0x44c6ba['delegate'](...Vt)['to'](this),this['fire']('replyCreated',_0x44c6ba),_0x44c6ba;}['setConversationTitle'](_0x2d8737,_0x3280c3=!0x1){this['fire']('setConversationTitle',_0x2d8737,_0x3280c3);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Xt=function(_0x258123){return _0x258123['FILE']='file',_0x258123['DOCUMENT']='document',_0x258123['URL']='web-resource',_0x258123['TEXT']='text',_0x258123['SELECTION']='selection',_0x258123;}({}),Ie=function(_0x43d9f4){return _0x43d9f4['TEXT']='text',_0x43d9f4['MARKDOWN']='markdown',_0x43d9f4['HTML']='html',_0x43d9f4;}({});const xi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ci extends _0x4572ab(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x4e2976,config:_0x22e83d,ownerId:_0x2fb14e}){super(),this['_connector']=_0x4e2976,this['_config']=_0x22e83d,this['_ownerId']=_0x2fb14e;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0xdb5f4){const _0x98706a=await this['_createContextItemFromContent'](_0xdb5f4);return this['_addToConversationContextItem'](_0x98706a),'current-document'===_0x98706a['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x98706a;}async['_createContextItemFromContent'](_0xedfb00){if(_0xedfb00['type']===Xt['DOCUMENT']){const _0x104da=await this['_connector']['fetchDocument'](this['_ownerId'],_0xedfb00['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0xedfb00['type'],'content':_0x104da['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x104da['attributes']?.['version'],'sessionId':_0x104da['attributes']?.['sessionId']};}return{'id':_0xedfb00['id'],'uiId':_0xedfb00['id'],'label':_0xedfb00['attributes']?.['label']||_0xedfb00['name']||_0xedfb00['url']||_0xedfb00['id'],'type':_0xedfb00['type'],..._0xedfb00?.['attributes']?.['resourceId']?{'resourceId':_0xedfb00['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0xa69160){const _0x27a29f=this['_pendingContextItems']['get'](_0xa69160);_0x27a29f?.['isReadOnly']||this['_removeContextItem'](_0xa69160);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x538074 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x538074['uiId']);const _0x1b6b1d=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x1b6b1d&&this['_addContextItem']({..._0x1b6b1d,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x11061b){for(const _0x52f7f0 of _0x11061b['values']())this['_addToConversationContextItem'](_0x52f7f0);this['clearPendingContextItems'](),this['fire']('contextSent',{'contextItems':Array['from'](this['getSentContextItems']()['values']())});}['isCurrentDocumentInContext'](){return this['_pendingContextItems']['has']('current-document');}['isSelectionInContext'](){return this['_pendingContextItems']['has']('selection');}['isCurrentDocumentInConversation'](){return this['_conversationContextItems']['has']('current-document');}static['mapContextItemsToRequestData'](_0x32446f){return Array['from'](_0x32446f['values']())['map'](_0x497246=>this['_mapContextItemToRequestData'](_0x497246))['filter'](_0x5d3919=>null!==_0x5d3919);}async['addFilesToContext'](_0x599ec4,_0x3717e8,_0x1eb8c7=Xt['FILE']){const _0x2e0911='files-'+_0x223274();this['_startUploadOperation'](_0x2e0911);try{await Promise['all'](_0x599ec4['map'](async _0x3ea413=>{const _0x23e974='file-'+_0x223274(),_0x237289=_0x4e9308(_0x3ea413['name']);try{this['_addContextItem']({'type':_0x1eb8c7,'label':_0x3717e8?.['label']||_0x237289,'uiId':_0x23e974,'resourceId':_0x3717e8?.['resourceId']},!0x0);const _0x50c837=this['_connector']['uploadFile'](this['_ownerId'],_0x3ea413,_0x3717e8);this['_ongoingUploads']['set'](_0x23e974,_0x50c837['abortController']);const {id:_0xcd1980}=await _0x50c837['getId']();this['_ongoingUploads']['delete'](_0x23e974),this['_finishContextItemLoading']({'type':_0x1eb8c7,'id':_0xcd1980,'label':_0x3717e8?.['label']||_0x237289,'uiId':_0x23e974,'resourceId':_0x3717e8?.['resourceId']},!0x1);}catch(_0x27dce0){this['_ongoingUploads']['delete'](_0x23e974);if(!_0x27dce0['message']['startsWith']('ai-request-aborted')){const _0x27301d=new _0x29f184('ai-chat-file-upload-failed',null,{'fileName':_0x237289});_0x27301d['stack']=_0x27dce0['stack'],this['fire']('error',{'error':_0x27301d,'fileName':_0x237289});}this['_removeContextItem'](_0x23e974);}}));}finally{this['_finishUploadOperation'](_0x2e0911);}}['addCurrentDocumentToContext'](_0x1bc6fd){if(this['isCurrentDocumentInContext']())return;const _0x78d30f={'type':Xt['DOCUMENT'],'uiId':'current-document','label':_0x1bc6fd,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x78d30f);}async['updateCurrentDocument'](_0x35c8cc,_0x941b5f,_0x4d2251,_0x20affb){const _0x4e637c=this['_pendingContextItems']['get']('current-document');if(_0x4e637c&&_0x35c8cc){_0x4e637c['selection']=_0x20affb?_0x20affb['map'](_0x438efc=>({'start':_0x438efc['start'],'end':_0x438efc['end']})):[];try{if(_0x4e637c['version']===_0x941b5f)return;const {id:_0x59d296}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x35c8cc,{'version':_0x941b5f,'sessionId':_0x4d2251})['getId']();_0x4e637c['id']=_0x59d296,_0x4e637c['content']=_0x35c8cc,_0x4e637c['version']=_0x941b5f,_0x4e637c['sessionId']=_0x4d2251;}catch(_0x352df4){const _0x8b99ee=new _0x29f184('ai-chat-document-upload-failed',null);_0x8b99ee['stack']=_0x352df4['stack'],this['fire']('error',{'error':_0x8b99ee});}}}['addSelectionToContext'](_0x23b645){this['_addContextItem']({'type':Xt['SELECTION'],'label':_0x23b645,'uiId':'selection','content':_0x23b645});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x35f491,_0x3abee4){const _0x577cf8='url-'+_0x223274();this['_startUploadOperation'](_0x577cf8);const _0x642bf7='url-'+_0x223274();try{this['_addContextItem']({'type':Xt['URL'],'label':_0x3abee4?.['label']||_0x35f491,'uiId':_0x642bf7,'resourceId':_0x3abee4?.['resourceId']},!0x0);const _0x2d29fb=this['_connector']['uploadUrl'](this['_ownerId'],_0x35f491,_0x3abee4);this['_ongoingUploads']['set'](_0x642bf7,_0x2d29fb['abortController']);const {id:_0x46fa48}=await _0x2d29fb['getId']();this['_ongoingUploads']['delete'](_0x642bf7),this['_finishContextItemLoading']({'type':Xt['URL'],'id':_0x46fa48,'label':_0x3abee4?.['label']||_0x35f491,'uiId':_0x642bf7,'resourceId':_0x3abee4?.['resourceId']},!0x1);}catch(_0x1914ba){this['_ongoingUploads']['delete'](_0x642bf7),(_0x1914ba['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x29f184('ai-chat-url-upload-failed',this,{'url':_0x35f491,'originalError':_0x1914ba}),'url':_0x35f491}),this['_removeContextItem'](_0x642bf7));}finally{this['_finishUploadOperation'](_0x577cf8);}}async['loadSourceResources'](_0xf31d8a,_0x4933f1,_0x28e7c7){const _0x575567=this['_addContextOptionsState']['sources']['find'](_0x23159b=>_0x23159b['id']===_0xf31d8a);if(!_0x575567)return this['fire']('error',{'error':new _0x29f184('ai-chat-source-not-found',this,{'sourceId':_0xf31d8a}),'sourceId':_0xf31d8a}),[];try{const _0x5db05e=(await _0x575567['getResources'](_0x4933f1))['map'](_0x2ece56=>{const _0x4e14e8=this['_isResourceInContext'](_0x2ece56['id']);return{..._0x2ece56,'isInContext':_0x4e14e8};});return _0x575567['resources']=_0x5db05e,this['fire']('sourceResourcesLoaded',{'sourceId':_0xf31d8a,'source':_0x575567,'resources':_0x5db05e,'uid':_0x28e7c7}),_0x5db05e;}catch(_0x306d95){return this['fire']('error',{'error':new _0x29f184('ai-chat-source-resources-load-failed',this,{'sourceId':_0xf31d8a,'originalError':_0x306d95}),'sourceId':_0xf31d8a,'sourceLabel':_0x575567['label']}),[];}}async['addResourceToContext'](_0x27673c,_0x69167a){if(this['_isResourceInContext'](_0x69167a['id']))return;let _0x5424da=_0x69167a['data'];if(!_0x5424da&&_0x27673c['getData'])try{_0x5424da=await _0x27673c['getData'](_0x69167a['id']);}catch(_0x4cc727){return void this['fire']('error',{'error':new _0x29f184('ai-chat-resource-load-failed',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id'],'originalError':_0x4cc727}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});}if(_0x5424da)switch(_0x69167a['type']){case Xt['URL']:if('string'!=typeof _0x5424da)return void this['fire']('error',{'error':new _0x29f184('ai-chat-context-invalid-data',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id'],'expectedType':'string','actualType':typeof _0x5424da}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});await this['addUrlToContext'](_0x5424da,{'label':_0x69167a['label'],'resourceId':_0x69167a['id']});break;case Xt['FILE']:if(!(_0x5424da instanceof File))return void this['fire']('error',{'error':new _0x29f184('ai-chat-context-invalid-data',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id'],'expectedType':'File','actualType':typeof _0x5424da}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});await this['addFilesToContext']([_0x5424da],{'label':_0x69167a['label'],'resourceId':_0x69167a['id']});break;case Xt['TEXT']:if('object'!=typeof _0x5424da||!('content'in _0x5424da)||!('type'in _0x5424da))return void this['fire']('error',{'error':new _0x29f184('ai-chat-context-invalid-data',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x5424da}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});_0x5424da=Ci['_convertTextResourceToFile'](_0x5424da,_0x69167a['label']),await this['addFilesToContext']([_0x5424da],{'label':_0x69167a['label'],'resourceId':_0x69167a['id']},Xt['TEXT']);break;default:this['fire']('error',{'error':new _0x29f184('ai-chat-context-unsupported-type',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id'],'resourceType':_0x69167a['type']}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});}else this['fire']('error',{'error':new _0x29f184('ai-chat-resource-no-data',this,{'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']}),'resourceId':_0x69167a['id'],'sourceId':_0x27673c['id']});}static['_convertTextResourceToFile'](_0x16ea10,_0x20ef49){switch(_0x16ea10['type']){case Ie['MARKDOWN']:return new File([_0x16ea10['content']],_0x20ef49,{'type':'text/markdown'});case Ie['HTML']:return new File([_0x16ea10['content']],_0x20ef49,{'type':'text/html'});default:return new File([_0x16ea10['content']],_0x20ef49,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x35bd43){switch(_0x35bd43['type']){case Xt['FILE']:return{'type':Xt['FILE'],'id':_0x35bd43['id']};case Xt['URL']:return{'type':Xt['URL'],'id':_0x35bd43['id']};case Xt['DOCUMENT']:return{'type':Xt['DOCUMENT'],'id':_0x35bd43['id'],..._0x35bd43['selection']?.['length']&&{'selection':_0x35bd43['selection']}};case Xt['TEXT']:return{'type':Xt['FILE'],'id':_0x35bd43['id']};default:return null;}}['_addContextItem'](_0x18c739,_0x4cfcd1=!0x1){if(this['_pendingContextItems']['set'](_0x18c739['uiId'],_0x18c739),_0x18c739['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x18c739,'isLoading':_0x4cfcd1}),'current-document'===_0x18c739['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x18c739['resourceId']){const _0x35bcc6=this['_findSourceIdsByResourceId'](_0x18c739['resourceId']);_0x35bcc6&&_0x35bcc6['forEach'](_0x3ae0b3=>{this['_updateResourceInContextState'](_0x3ae0b3,_0x18c739['resourceId'],!0x0);});}}['_removeContextItem'](_0x29625f){const _0x5c84f1=this['_pendingContextItems']['get'](_0x29625f),_0x51a5a5=this['_ongoingUploads']['get'](_0x29625f);if(_0x51a5a5&&(_0x51a5a5['abort'](),this['_ongoingUploads']['delete'](_0x29625f)),_0x5c84f1?.['resourceId']){const _0x10b738=this['_findSourceIdsByResourceId'](_0x5c84f1['resourceId']);_0x10b738&&_0x10b738['forEach'](_0x2f82a0=>{this['_updateResourceInContextState'](_0x2f82a0,_0x5c84f1['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x29625f),this['fire']('contextItemRemoved',{'uiId':_0x29625f,'type':_0x5c84f1?.['type']}),'current-document'===_0x29625f&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x2b1cd7,_0x1f297e){if(this['_pendingContextItems']['has'](_0x2b1cd7['uiId'])&&(this['_pendingContextItems']['set'](_0x2b1cd7['uiId'],_0x2b1cd7),this['fire']('contextItemLoadingEnded',{'contextItem':_0x2b1cd7,'isLoading':_0x1f297e}),_0x2b1cd7['resourceId'])){const _0x4cfc7b=this['_findSourceIdsByResourceId'](_0x2b1cd7['resourceId']);_0x4cfc7b&&_0x4cfc7b['forEach'](_0x273344=>{this['_updateResourceInContextState'](_0x273344,_0x2b1cd7['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x4b1276){this['_conversationContextItems']['set'](_0x4b1276['uiId'],_0x4b1276);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x1dcad7=>({..._0x1dcad7,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x165d7e=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x165d7e,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x228802){for(const _0x653dda of this['_pendingContextItems']['values']())if(_0x653dda['resourceId']===_0x228802)return!0x0;for(const _0x4f53e7 of this['_conversationContextItems']['values']())if(_0x4f53e7['resourceId']===_0x228802)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x3a5964){const _0x4b396a=[];for(const _0x66861b of this['_addContextOptionsState']['sources']){_0x66861b['resources']['find'](_0x44463e=>_0x44463e['id']===_0x3a5964)&&_0x4b396a['push'](_0x66861b['id']);}return 0x0===_0x4b396a['length']?null:_0x4b396a;}['_updateResourceInContextState'](_0x26b6ad,_0x17cfc7,_0x1d675b){const _0x42fa6f=this['_addContextOptionsState']['sources']['find'](_0x56e0df=>_0x56e0df['id']===_0x26b6ad);if(!_0x42fa6f)return;const _0x405383=_0x42fa6f['resources']['find'](_0x4acda5=>_0x4acda5['id']===_0x17cfc7);_0x405383&&(_0x405383['isInContext']=_0x1d675b,this['fire']('resourceStateChanged',{'sourceId':_0x26b6ad,'resourceId':_0x17cfc7,'isInContext':_0x1d675b}));}['_startUploadOperation'](_0x46727e){this['_ongoingUploadOperations']['set'](_0x46727e,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x1d55b0){this['_ongoingUploadOperations']['delete'](_0x1d55b0),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Mi=['capabilitiesUpdated'];class Di extends _0x135bec(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x40e2e4){const _0x208e5e={};return _0x40e2e4&&_0x40e2e4['isWebSearchEnabled']&&(_0x208e5e['webSearch']={}),_0x40e2e4&&_0x40e2e4['isReasoningEnabled']&&(_0x208e5e['reasoning']={}),_0x208e5e;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0xab7bdc){_0xab7bdc!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0xab7bdc,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x403803){_0x403803!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x403803,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Si extends Jt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x2e71fc){super(_0x2e71fc),this['conversationId']=_0x2e71fc['conversationId'],this['contextItems']=_0x2e71fc['contextItems'],this['capabilities']=_0x2e71fc['capabilities'],this['userMessage']=_0x2e71fc['userMessage'],this['model']=_0x2e71fc['model'],this['quickActionData']=_0x2e71fc['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ci['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Di['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class nt extends _0x135bec(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x2c0d81){super(),this['options']=_0x2c0d81,this['connector']=_0x2c0d81['connector'],this['chatModels']=_0x2c0d81['chatModels'],this['id']=_0x2c0d81['conversationId'];}async['init'](_0xd8158e){try{this['chatContext']=new Ci({'connector':this['connector'],'config':_0xd8158e,'ownerId':this['id']}),this['chatContext']['delegate'](...xi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Di(),this['chatCapabilities']['delegate'](...Mi)['to'](this),this['chatCapabilities']['init']();const _0x58510b=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x58510b});const _0x3d0bea=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x3d0bea&&await this['setModel'](_0x3d0bea);}catch(_0x296481){const _0x32b936=new _0x29f184('ai-chat-conversation-init-failed',null,{'message':_0x296481['message']});_0x32b936['stack']=_0x296481['stack'],this['fire']('error',{'error':_0x32b936});}}async['start'](){if(this['isStarted'])throw new _0x29f184('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x29f184('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x2cd1a7}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x2cd1a7,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x3b4398){const _0x1e7ea2=new _0x29f184('ai-chat-conversation-start-failed',null,{'message':_0x3b4398['message']});_0x1e7ea2['stack']=_0x3b4398['stack'],this['fire']('error',{'error':_0x1e7ea2});}}async['load'](_0x3146b5,_0x116f43){try{const _0x1047a6=await this['connector']['fetchConversation'](_0x3146b5)['getConversation'](),_0xe5047b=await this['connector']['fetchConversationMessages'](_0x3146b5)['getMessages'](),_0xfef690=_0xe5047b[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x1047a6['id'],'title'in _0x1047a6?this['fire']('setConversationTitle',_0x1047a6['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x124c4c=(await this['chatModels']['getAll']())['find'](_0x303807=>_0x303807['id']['toLowerCase']()===_0xfef690['toLowerCase']());return this['selectedModel']=_0x124c4c,this['fire']('modelSelected',{'selectedModel':_0x124c4c,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xe5047b,_0x116f43,_0xfef690),this['currentInteraction']=void 0x0,this;}catch(_0xe2206f){const _0x3ad55f=new _0x29f184('ai-chat-conversation-init-from-id-failed',null,{'message':_0xe2206f['message'],'conversationId':_0x3146b5});throw _0x3ad55f['stack']=_0xe2206f['stack'],this['fire']('error',{'error':_0x3ad55f}),_0x3ad55f;}}async['_processMessagesToInteractions'](_0x31495a,_0x42ae9b,_0x18f6ea){let _0x3ed384;for(const _0x8d4e8a of _0x31495a)if('user'===_0x8d4e8a['role']){const _0x222ef7=await this['_extractContextItems'](_0x8d4e8a),_0x37cc7b={'isReasoningEnabled':Object['hasOwn'](_0x8d4e8a['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x8d4e8a['capabilities'],'webSearch')};_0x3ed384=this['createInteraction']({'userMessage':_0x8d4e8a['prompt'],'contextItems':_0x222ef7,'capabilities':_0x37cc7b,'modelId':_0x18f6ea,'quickActionData':_0x8d4e8a['attributes']?.['quickActionData']}),this['currentInteraction']=_0x3ed384,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x8d4e8a['role']&&_0x3ed384)for(const _0x23a38e of _0x8d4e8a['content']){const _0x2632b3='text'===_0x23a38e['type']?'text-delta':'modification-delta',_0x23c768=_0x3ed384['getDocumentContext']()?.['sessionId']!==_0x42ae9b;_0x3ed384['currentReply']=_0x3ed384['createReply']({'type':_0x2632b3,'isDone':!0x0,'interactionId':_0x3ed384['id'],'areActionsDisabled':_0x23c768}),_0x3ed384['currentReply']['appendContent'](_0x23a38e['content']);}}}async['_extractContextItems'](_0x26c9ba){const _0x5df8fe=new Map();if(!_0x26c9ba['content'])return _0x5df8fe;for(const _0xf70e61 of _0x26c9ba['content']){const _0x52e093=await this['chatContext']['populateFromMessage'](_0xf70e61);_0x52e093&&_0x5df8fe['set'](_0x52e093['id'],_0x52e093);}return _0x5df8fe;}async['handleUserInteraction']({userMessage:_0x266c2a,quickActionData:_0x13dabc}){if(!this['isStarted'])throw new _0x29f184('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x29f184('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x2e9427=this['chatContext']['getPendingContextItems'](),_0x248a12=this['chatCapabilities']['getCapabilitiesConfig'](),_0x514142=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x266c2a,'contextItems':_0x2e9427,'capabilities':_0x248a12,'modelId':_0x514142,'quickActionData':_0x13dabc}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0xdb8d22){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0xdb8d22});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x10b899,contextItems:_0x3448d3,capabilities:_0x38f3eb,modelId:_0x5e64c2,quickActionData:_0x5e6441}){const _0x1d3dcc=new Si({'userMessage':_0x10b899,'contextItems':_0x3448d3,'capabilities':_0x38f3eb,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x5e64c2,'quickActionData':_0x5e6441});return _0x1d3dcc['delegate'](...Vt)['to'](this),this['interactions']['push'](_0x1d3dcc),this['fire']('interactionCreated',_0x1d3dcc),_0x1d3dcc;}['getInteraction'](_0x33d852){return this['interactions']['find'](_0x26f0cd=>_0x26f0cd['id']===_0x33d852);}['removeInteraction'](_0x418569){const _0x29c3be=this['getInteraction'](_0x418569);_0x29c3be&&(_0x29c3be['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x29c3be),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x5f41c6){this['chatContext']['addCurrentDocumentToContext'](_0x5f41c6);}async['updateCurrentDocumentInContext']({content:_0x537781,version:_0x52ab69,sessionId:_0x365678,selections:_0xba3522}){await this['chatContext']['updateCurrentDocument'](_0x537781,_0x52ab69,_0x365678,_0xba3522);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x377ff5){this['chatContext']['addSelectionToContext'](_0x377ff5);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x248a8e){this['chatContext']['addFilesToContext'](_0x248a8e);}['addUrlToContext'](_0x4b3197){this['chatContext']['addUrlToContext'](_0x4b3197);}['addResourceToContext'](_0x92a8fb,_0x9f8ee1){this['chatContext']['addResourceToContext'](_0x92a8fb,_0x9f8ee1);}['loadSourceResources'](_0xf3991a,_0x1ca647,_0x2a6edd){return this['chatContext']['loadSourceResources'](_0xf3991a,_0x1ca647,_0x2a6edd);}['removeFromContext'](_0xc1e4e7){this['chatContext']['removeFromContext'](_0xc1e4e7);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x952157){_0x952157?!0x1===await this['chatModels']['isAvailable'](_0x952157)&&(_0xadd6c3('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x952157}),_0x952157=(await this['chatModels']['getAvailableModels']())[0x0]):(_0xadd6c3('ai-chat-conversation-set-model-null',{'conversation':this}),_0x952157=(await this['chatModels']['getAvailableModels']())[0x0]),_0x952157['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x952157,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x952157}));}}function P(_0x6cd75c){if(_0x6cd75c instanceof st)return _0x6cd75c;if(_0x6cd75c?.['editors']&&_0x6cd75c['editors']['get'](0x0))return _0x6cd75c['editors']['length']>0x1&&console['warn']('AIChat:\x20Multiple\x20editor\x20instances\x20detected.\x20Only\x20the\x20first\x20editor\x20instance\x20will\x20be\x20used\x20for\x20AI\x20operations.\x20This\x20configuration\x20is\x20not\x20fully\x20supported\x20and\x20may\x20lead\x20to\x20unexpected\x20behavior.'),_0x6cd75c['editors']['get'](0x0);throw new _0x29f184('ai-get-editor-from-context-no-editor');}const rt='ai-selection';class c extends _0x171820{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x30e6c1=P(this['context']),_0x405781=_0x30e6c1['plugins']['has']('RealTimeCollaborationClient')&&_0x30e6c1['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x405781||_0x223274();}return this['_sessionId'];}['getDocumentData'](){const _0x4b15a8=P(this['context']),_0x44dbe3=_0x4b15a8['model'],_0x3e3be3=_0x4b15a8['data']['toView'](_0x44dbe3['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x53b317=new kt(_0x4b15a8['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x3e3be3,_0x53b317);let _0x3a3c93=_0x4b15a8['data']['processor']['toData'](_0x3e3be3);const _0xf09f4e=this['_getMarkersInDocumentOrder'](),_0x108596=[];for(const _0x13a14b of _0xf09f4e){const _0x5bc2e1='<'+_0x13a14b['name']+':start></'+_0x13a14b['name']+':start>',_0x46427c=_0x3a3c93['indexOf'](_0x5bc2e1);_0x3a3c93=_0x3a3c93['substring'](0x0,_0x46427c)+_0x3a3c93['substring'](_0x46427c+_0x5bc2e1['length']);const _0x57ce82='<'+_0x13a14b['name']+':end></'+_0x13a14b['name']+':end>',_0x6137d5=_0x3a3c93['indexOf'](_0x57ce82);_0x3a3c93=_0x3a3c93['substring'](0x0,_0x6137d5)+_0x3a3c93['substring'](_0x6137d5+_0x57ce82['length']),_0x108596['push']({'markerName':_0x13a14b['name'],'start':_0x46427c,'end':_0x6137d5,'htmlFragment':_0x3a3c93['substring'](_0x46427c,_0x6137d5)});}return{'content':_0x3a3c93,'version':_0x4b15a8['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x108596};}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x7cbdd0,_0x4a2ed3)=>{_0x4a2ed3['on']('ready',()=>{this['_integrateEditor'](_0x4a2ed3);});});}['_integrateEditor'](_0x24b2e2){_0x24b2e2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':rt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x24b2e2['conversion']['for']('dataDowncast')['markerToElement']({'model':rt,'view':(_0x28649b,{writer:_0x4839f7,options:_0x4f6bc2})=>_0x4f6bc2['convertAiChatSelectionMarker']?_0x4839f7['createUIElement'](_0x28649b['markerName']+':'+(_0x28649b['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1a27e5,_0x33c5ed,_0x1957d8=!0x1,_0xe9002a=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0xe9002a)return!0x1;const _0x38201b=P(this['context'])['model'];return _0x38201b['change'](_0x2b3691=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x33c5ed,this['_displayedFakeSelectionLocked']=_0x1957d8;let _0x3bbd57=0x0;for(let _0x56b718 of _0x1a27e5){const _0x202dba=rt+':'+_0x3bbd57;if(_0x56b718['start']['isAtEnd']){const _0x1ed6a7=_0x56b718['start']['getLastMatchingPosition'](({item:_0x2505e9})=>!_0x38201b['schema']['isContent'](_0x2505e9),{'boundaries':_0x56b718});_0x56b718=_0x2b3691['createRange'](_0x1ed6a7,_0x56b718['end']);}_0x2b3691['addMarker'](_0x202dba,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x56b718}),_0x3bbd57++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x20a83f){if(this['_displayedFakeSelectionId']!=_0x20a83f)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x4d61bb=P(this['context']),_0x466825=_0x4d61bb['model']['markers']['getMarkersGroup'](rt);return _0x4d61bb['model']['change'](_0x391918=>{for(const _0x1105a8 of _0x466825)_0x391918['removeMarker'](_0x1105a8);}),!0x0;}['modelToViewWithIds'](_0x572abe){const _0xd77f0b=P(this['context']),_0x4fea0c=_0xd77f0b['data']['toView'](_0x572abe),_0x34f24a=new kt(_0xd77f0b['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x4fea0c,_0x34f24a),_0x4fea0c;}['_setDataIdsOnChildren'](_0xbd64f5,_0x1f5f0f){let _0x14e39d=!0x1;const _0x25cf6c=new Set();for(const _0x245a29 of _0xbd64f5['getChildren']()){const _0x4b1b99=_0x245a29['is']('emptyElement')||_0x245a29['is']('containerElement');if(!_0x245a29['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x245a29,_0x1f5f0f)||_0x4b1b99)&&(_0x1f5f0f['setAttribute']('data-id',this['_nextDataId'](_0x25cf6c),_0x245a29),_0x14e39d=!0x0);}return _0x14e39d;}['_nextDataId'](_0x23ff43){let _0x32ef94;do{_0x32ef94='';for(let _0x308abc=0x0;_0x308abc<0x4;_0x308abc++)_0x32ef94+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x23ff43['has'](_0x32ef94));return _0x23ff43['add'](_0x32ef94),_0x32ef94;}['getSelectionText'](){const {model:_0x488f55}=P(this['context']),_0x4624ae=_0x488f55['document']['selection'],_0x22b37d=_0x488f55['getSelectedContent'](_0x4624ae),_0x48f446=[],_0x137b96=_0x488f55['createRangeIn'](_0x22b37d)['getWalker']();for(const {item:_0x5963b3}of _0x137b96)_0x5963b3['is']('$textProxy')?_0x48f446['push'](_0x5963b3['data']):_0x5963b3['is']('element')&&_0x48f446['length']>0x0&&'\x20'!==_0x48f446[_0x48f446['length']-0x1]&&_0x48f446['push']('\x20');return'\x22'+_0x48f446['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x46174c=P(this['context'])['model'];return Array['from'](_0x46174c['markers']['getMarkersGroup'](rt))['sort']((_0x56b862,_0x2cb29f)=>_0x56b862['getStart']()['isBefore'](_0x2cb29f['getStart']())?-0x1:_0x56b862['getStart']()['isAfter'](_0x2cb29f['getStart']())?0x1:0x0);}}const k=['applySuggestion','insertSuggestion','showChangeInText'];class nh extends _0x19a8c6{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x1db654,_0x37daf7){super(_0x1db654),this['_dropdownOriginalConfig']=_0x37daf7||[...k],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x237c40=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x3cd526({'label':Hn('applySuggestion',_0x1db654,this['_partsCount']),'icon':_0x547952,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x3cd526({'label':Hn('showChangeInText',_0x1db654,this['_partsCount']),'icon':_0x13603c,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x3cd526({'label':Hn('insertSuggestion',_0x1db654,this['_partsCount']),'icon':_0x4c5817,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x1db654),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x237c40['if']('isVisible','ck-hidden',_0x3c42d7=>!_0x3c42d7)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x353cb6=>'applySuggestion'!==_0x353cb6):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x1db654);});}['_updateDropdownActions'](_0x490612){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x490612),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x2c08ac){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0xf81ae8=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x2c08ac):this['_createActionsDropdown'](_0x2c08ac),_0xe84bed=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0xf81ae8['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x2c08ac,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x2c08ac,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0xe84bed});for(const _0x4002e1 of this['_dropdownCurrentConfig'])_0xf81ae8['on'](_0x4002e1,()=>{this['fire'](_0x4002e1);});return this['_firstRender']=!0x1,_0xf81ae8;}['_createActionsButton'](_0x2fee22){const _0x3f42d4=new _0x14ee0a(_0x2fee22);return _0x3f42d4['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x3f42d4['on']('execute',()=>{_0x3f42d4['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x3f42d4;}['_createActionsDropdown'](_0x5a1559){const _0x448147=new Gn(_0x5a1559,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x1adc51=>{switch(_0x1adc51){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x448147['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x5a1559,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x5a1559,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x448147['bind']('isEnabled')['to'](this),_0x448147;}['updateLabels'](_0x2f82ed){const _0x1e9be4=this['locale'];this['_partsCount']=_0x2f82ed||this['_partsCount'],this['actionsButton']['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x1e9be4,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x1e9be4,this['_partsCount'])}),this['applySuggestionModel']['label']=Hn('applySuggestion',_0x1e9be4,this['_partsCount']),this['showChangeInTextModel']['label']=Hn('showChangeInText',_0x1e9be4,this['_partsCount']),this['insertSuggestionModel']['label']=Hn('insertSuggestion',_0x1e9be4,this['_partsCount']);}}class Gn extends _0x37ad52{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x4989b2,_0x3e9f29){super(_0x4989b2),this['balloonPanelView']=new _0x500981(this['locale']),this['bodyCollection']=new qt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x3e9f29['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',C(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0xa1456=_0x3e9f29['listItemModels'][0x0]['actionName'];this['fire'](_0xa1456),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?yn:Pn]}),this['listView']['focus']());}),_0x29a34e({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x183ee3){const _0x1d7fe4=this['locale'],_0x178dcc=new _0x556745(_0x1d7fe4);for(const _0x1ae12a of _0x183ee3){const _0x11305e=new _0x2269a3(_0x1d7fe4),_0x3c541f=new _0x8cd418(_0x1d7fe4);_0x3c541f['bind'](...Object['keys'](_0x1ae12a))['to'](_0x1ae12a),_0x3c541f['delegate']('execute')['to'](_0x178dcc),_0x11305e['children']['add'](_0x3c541f),_0x178dcc['items']['add'](_0x11305e);}return _0x178dcc['items']['delegate']('execute')['to'](this),_0x178dcc['on']('execute',_0x389815=>{const _0x12609a=_0x389815['source'];this['fire'](_0x12609a['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x178dcc;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x1f1bc5(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x47c2bd,_0x4aea26)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x4aea26();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function yn(_0x4bc876){return{'top':_0x4bc876['bottom'],'left':_0x4bc876['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x14c26e,_0x57975d){return{'top':_0x14c26e['bottom'],'left':_0x14c26e['left']-(_0x57975d['width']-_0x14c26e['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Hn(_0x3eef8a,_0x582d2b,_0x5f6c3f){switch(_0x3eef8a){case'applySuggestion':return C(_0x582d2b,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x5f6c3f);case'showChangeInText':return C(_0x582d2b,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x5f6c3f);case'insertSuggestion':return C(_0x582d2b,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x5f6c3f);}}function Ln(_0x46e82f,_0x11776f,_0x261435){switch(_0x46e82f){case'applySuggestion':return C(_0x11776f,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x261435);case'showChangeInText':return C(_0x11776f,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x261435);case'insertSuggestion':return C(_0x11776f,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x261435);}}class ki extends _0x135bec(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x374a44,availableModels:_0x189db8,defaultModelId:_0x2504e8}){super(),this['_connector']=_0x374a44,this['_availableModels']=_0x189db8,this['_defaultModelId']=_0x2504e8;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x413cf9=this['_connector']['getModels'](),_0xdf76f0=await _0x413cf9['list']();this['_modelList']=_0xdf76f0['items'];}catch(_0x310f2d){throw new _0x29f184('ai-models-unable-to-retrieve',null,{'error':_0x310f2d});}return[...this['_modelList']];}async['getAvailableModels'](){const _0x11f304=await this['getAll']();return this['_filterModels'](_0x11f304,this['_availableModels']);}async['getModel'](_0x1e41a8){const _0x3ae725=await this['getAll']();if(!_0x3ae725['length'])return null;if(_0x1e41a8){const _0x2b51dc=this['_getModelById'](_0x3ae725,_0x1e41a8);if(_0x2b51dc)return _0x2b51dc;_0xadd6c3('ai-chat-model-id-unrecognized',{'modelId':_0x1e41a8,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x5cfde2=await this['getAvailableModels']();if(!_0x5cfde2['length'])return null;if(this['_defaultModelId']){const _0x5cddca=this['_getModelById'](_0x5cfde2,this['_defaultModelId']);if(_0x5cddca)return _0x5cddca;_0xadd6c3('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x5cfde2[0x0]['id']});}return _0x5cfde2[0x0];}async['isAvailable'](_0x3b8ea0){return(await this['getAvailableModels']())['some'](_0x19d37b=>_0x19d37b['name']===_0x3b8ea0['name']&&_0x19d37b['provider']===_0x3b8ea0['provider']);}['_filterModels'](_0xbbcbe8,_0x5530b4){let _0x4ec7f5;if(_0x5530b4){_0x4ec7f5=[];const _0x1284a6='string'==typeof _0x5530b4?[_0x5530b4['toLocaleLowerCase']()]:_0x5530b4['map'](_0x45591f=>_0x45591f['toLocaleLowerCase']());for(const _0x49cdaf of _0x1284a6)for(const _0xb3b676 of _0xbbcbe8)(_0xb3b676['id']['toLocaleLowerCase']()===_0x49cdaf||_0xb3b676['name']['toLocaleLowerCase']()===_0x49cdaf||Me(_0xb3b676)&&'auto'===_0x49cdaf||_0xb3b676['provider']['toLocaleLowerCase']()===_0x49cdaf||_0xb3b676['id']['toLocaleLowerCase']()['startsWith'](_0x49cdaf))&&_0x4ec7f5['push'](_0xb3b676);}else _0x4ec7f5=_0xbbcbe8;return _0x4ec7f5;}['_getModelById'](_0x126bdb,_0x579ab8){return _0x126bdb['find'](_0x31eda5=>Me(_0x31eda5)&&'auto'===_0x579ab8?_0x31eda5:_0x31eda5['id']===_0x579ab8)||null;}static['getLocalized'](_0x29488c,_0xe3da35){return _0xe3da35['map'](_0x3a48d3=>{if(Me(_0x3a48d3))_0x3a48d3['name']=C(_0x29488c,'AI_MODEL_NAME_AUTO'),_0x3a48d3['description']=C(_0x29488c,'AI_MODEL_DESCRIPTION_AUTO');else C(_0x29488c,'AI_MODEL_DESCRIPTION_'+_0x3a48d3['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x3a48d3['description']=C(_0x29488c,'AI_MODEL_DESCRIPTION_'+_0x3a48d3['id']['toUpperCase']()));return _0x3a48d3;});}}function Me(_0x337d03){return _0x337d03['id']['startsWith']('agent');}class ht extends ki{async['getAll'](){return(await super['getAll']())['sort']((_0x377c9c,_0x4b3e46)=>{const _0x53f642=Object['values'](_0x377c9c['capabilities'])['filter'](_0x4cf1b9=>_0x4cf1b9['enabled'])['length'];return Object['values'](_0x4b3e46['capabilities'])['filter'](_0x53e745=>_0x53e745['enabled'])['length']-_0x53f642;});}}function v({editor:_0xef13da,interaction:_0x3497f9,reply:_0x36000b,groups:_0xbff433,transform:_0x3bc4ba,documentCompare:_0x4a516c,documentCompareOptions:_0x29438d}){const _0x53760f=_0x3497f9['getDocumentContext']();if(!_0x53760f)return[];const _0x19108f=_0x53760f['content'],_0x487147=_0x53760f['version'],_0x43e1ea=_0x36000b['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x329661}of _0xbff433){const _0x2490a0=_0x329661['filter'](_0x5ad617=>'new'!=_0x5ad617['type'])['map'](_0x525470=>ft('data-id',_0x525470['id'],_0x43e1ea)),_0x2bcdda=_0x329661['filter'](_0x12d037=>'removed'!=_0x12d037['type'])['map'](_0x73079c=>_0x73079c['node']['cloneNode'](!0x0));let _0x5dc0fe=null;if(_0x2490a0['length']){_0x5dc0fe=_0x2490a0[0x0]['previousSibling'];for(let _0x37a78d=0x0;_0x37a78d<_0x2490a0['length'];_0x37a78d++)_0x33c6d9(_0x2490a0[_0x37a78d]);}if(_0x2bcdda['length']){_0x5dc0fe||(_0x329661[0x0]['anchorId']?_0x5dc0fe=ft('data-id',_0x329661[0x0]['anchorId'],_0x43e1ea):(_0x5dc0fe=_0x2bcdda['shift'](),_0x51c386(_0x43e1ea,_0x5dc0fe)));for(let _0x4c62b8=0x0;_0x4c62b8<_0x2bcdda['length'];_0x4c62b8++)_0x2b81f1(_0x5dc0fe,_0x2bcdda[_0x4c62b8]),_0x5dc0fe=_0x2bcdda[_0x4c62b8];}}const _0x194986=ut(_0x43e1ea),_0x2f3ffd=_0x4a516c['getDiff'](_0x19108f,_0x194986,_0x29438d)['getOperations']();if(_0x3bc4ba){const _0x1ad245=_0xef13da['model']['document']['history']['getOperations'](_0x487147),_0x6f9987={'document':_0xef13da['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x33bff0(_0x2f3ffd,_0x1ad245,_0x6f9987)['operationsA'];}return _0x2f3ffd;}function b(_0x2752ed,_0x294dcc){if('marker'!=_0x294dcc['type'])return;const _0x32e6aa=_0x2752ed['model']['markers']['get'](_0x294dcc['name']);_0x32e6aa&&(_0x294dcc['oldRange']=_0x32e6aa['getRange']());}class Vr extends _0x541968{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x51bc72,_0x868022={},_0x5502ac){super(_0x51bc72),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x868022};const _0x38d8cb=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x38d8cb?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](_0x5502ac),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['_setupRatingButtons'](){this['likeButton']=new _0x14ee0a(this['locale']),this['likeButton']['set']({'icon':_0x3e3995,'label':C(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x13e749=>!_0x13e749),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x14ee0a(this['locale']),this['dislikeButton']['set']({'icon':_0x51e959,'label':C(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5bc822=>!_0x5bc822),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x14ee0a(this['locale']),this['copyButton']['set']({'icon':_0x4a0fe1,'label':C(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x7a7a09=>!_0x7a7a09);const _0x4a30b3=new _0x50b9df();_0x4a30b3['set']({'content':_0x270303}),_0x4a30b3['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x4a30b3);}['_setupShowChangesButton'](_0x387ddf){this['showChangesButton']=new _0x14ee0a(this['locale']),this['showChangesButton']['set']({'icon':_0x490482,'label':C(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x387ddf}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x55aeb8=>!_0x55aeb8),this['showChangesButton']['on']('execute',()=>{const _0x185a31=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x185a31,'icon':_0x185a31?_0x11ea32:_0x490482}),this['fire']('toggleShowChanges',_0x185a31);});}}class Lr extends _0x19a8c6{['showChangesToggleView'];constructor(_0x2c2382,_0x19de1c){super(_0x2c2382),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0x2c2382),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':C(_0x2c2382,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x19de1c['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x248413=>_0x248413?_0xe9dd5d:_0x41d5a1),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x51ddf9=new _0x50b9df();_0x51ddf9['content']=_0x391967,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x19de1c['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x51ddf9,{'tag':'span','children':[C(_0x2c2382,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0x14ee0a{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x14c1f1){this['options']={'delay':_0x14c1f1['delay']??0x14,'textNodeStyle':_0x14c1f1['textNodeStyle'],'onStreamUpdate':_0x14c1f1['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x3e029f,targetElement:_0x7dd7b6,abortSignal:_0x52f3bd}){this['isStreaming']&&this['stop'](),_0x52f3bd?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x54d7fb(_0x3e029f,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0xadd6c3('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x56c930=0x0;_0x56c930<this['currentIndex'];_0x56c930++)this['nodesList'][_0x56c930]['shouldBeStreamed']=!0x0;let _0x53eda1=0x0;for(let _0x115489=this['currentIndex'];_0x115489<this['nodesList']['length'];_0x115489++){const _0x5f072b=Date['now'](),_0x16ec59=this['nodesList'][_0x115489],_0xf92c70=_0x5f072b-_0x53eda1;_0x16ec59['shouldBeStreamed']=!0x0;let _0x5da324=_0x16ec59['parent'];for(;_0x5da324;)_0x5da324['shouldBeStreamed']=!0x0,_0x5da324=_0x5da324['parent'];if(_0xf92c70<this['options']['delay'])try{const {promise:_0x18b148,abortController:_0x30a716}=pr(this['options']['delay']-_0xf92c70);this['timeoutAbortController']=_0x30a716,await _0x18b148;}catch(_0x15ff16){return;}_0x556937(_0x7dd7b6,'<'+_0x7dd7b6['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x7dd7b6['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x115489,_0x53eda1=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x35a61f}){Array['from'](_0x35a61f['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x33da46=>{_0x33da46['replaceWith'](_0x33da46['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x2464f3){let _0x1b9bbe='';if(function(_0xd3bae3){return _0x25fa62(_0xd3bae3);}(_0x2464f3)){for(const _0x538e4c of _0x2464f3['children'])_0x1b9bbe+=this['renderNode'](_0x538e4c);}else{if(dr(_0x2464f3)){if(!_0x2464f3['shouldBeStreamed'])return'';const _0x2b1cf7=_0x2464f3,_0x424f1c=Object['entries'](_0x2b1cf7['attribs'])['map'](([_0x5c9920,_0x51d4e8])=>_0x5c9920+'=\x22'+_0x51d4e8+'\x22')['join']('\x20');_0x1b9bbe+='<'+_0x2b1cf7['tagName']+(_0x424f1c?'\x20'+_0x424f1c:'')+'>';for(const _0x51c58c of _0x119327(_0x2b1cf7))_0x1b9bbe+=this['renderNode'](_0x51c58c);_0x1b9bbe+='</'+_0x2b1cf7['tagName']+'>';}else{if(!ar(_0x2464f3))return'';if(!_0x2464f3['shouldBeStreamed'])return'';!function(_0x61a7b2){if(!_0x61a7b2['parent']||!dr(_0x61a7b2['parent']))return!0x1;if(!cr['includes'](_0x61a7b2['parent']['tagName']))return!0x1;return!_0x54cfdd(_0x61a7b2)['match'](/^\s*[<>]\s*$/);}(_0x2464f3)?_0x1b9bbe+=_0xec369b(_0x2464f3):_0x1b9bbe+=_0xec369b(new _0x2c5bc4('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x2464f3]));}}return _0x1b9bbe;}['getParsedDocumentNodeList'](){const _0x53c44a=[];return function(_0x3e3065,_0x5177a6){const _0x37a026=_0x244de4=>{if(_0x5177a6(_0x244de4),_0x244de4 instanceof _0x4b2d52)for(let _0x244b19=0x0;_0x244b19<_0x244de4['children']['length'];_0x244b19++){const _0xbbe8ce=_0x244de4['children'][_0x244b19];_0x37a026(_0xbbe8ce);}};for(let _0x17f211=0x0;_0x17f211<_0x3e3065['children']['length'];_0x17f211++)_0x37a026(_0x3e3065['children'][_0x17f211]);}(this['document'],_0x52e0fd=>{if(ar(_0x52e0fd)){const _0x282c14=this['splitTextNodeIntoWordNodes'](_0x52e0fd);_0x282c14['length']&&_0x53c44a['push'](..._0x282c14);}_0x52e0fd['isWordSplitSource']||_0x52e0fd['isWordSplitResult']||_0x53c44a['push'](_0x52e0fd);}),_0x53c44a;}['splitTextNodeIntoWordNodes'](_0x33b941){if(_0x33b941['isWordSplitSource']||_0x33b941['isWordSplitResult'])return[];const _0x11686d=_0x54cfdd(_0x33b941)['match'](/(?:\s*\S+\s*)/g),_0xa0c8b9=[];if(_0x11686d&&_0x11686d['length']>0x1){for(const _0x5e9eb0 of _0x11686d){const _0x28ff8c=new _0x2e2b16(_0x5e9eb0);_0x28ff8c['isWordSplitResult']=!0x0,_0x53ea51(_0x33b941,_0x28ff8c),_0xa0c8b9['push'](_0x28ff8c);}_0x33b941['isWordSplitSource']=!0x0,_0x33c6d9(_0x33b941);}return _0xa0c8b9;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0x6fc3e5){return _0x23320c(_0x6fc3e5);}function dr(_0x42012f){return _0x41757a(_0x42012f);}function pr(_0x251845){const _0x2dc171=new AbortController();return{'promise':new Promise((_0x1e820d,_0x9cc7cd)=>{const _0x195101=setTimeout(_0x1e820d,_0x251845);_0x2dc171['signal']['addEventListener']('abort',()=>{clearTimeout(_0x195101),_0x9cc7cd();});}),'abortController':_0x2dc171};}const Te=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x19a8c6{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x4ec6b9,{part:_0x3c4f99,uiIndex:_0x9dd9a7,areActionsDisabled:_0x3d2708,availableActions:_0x130aa6}){super(_0x4ec6b9),this['set']('partDefinition',_0x3c4f99),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x6b6da0=>'pending'==_0x6b6da0&&!_0x3d2708),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x4ec6b9,{'part':_0x3c4f99,'uiIndex':_0x9dd9a7,'availableActions':_0x130aa6}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Te)['to'](this);const _0xb454bd=this['bindTemplate'];this['contentView']=new _0x19a8c6(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0xb454bd['to']('state',_0x59cf08=>'ck-ai-suggestion__body__content-part_'+_0x59cf08),_0xb454bd['to']('isEnabled',_0x12fd15=>_0x12fd15?'ck-ai-suggestion__body__content-part_active':void 0x0),_0xb454bd['if']('isVisible','ck-hidden',_0x2a74e8=>!_0x2a74e8)]},'children':this['children'],'on':{'mouseenter':_0xb454bd['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3c4f99['index']});}),'mouseleave':_0xb454bd['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3c4f99['index']});})}});}async['updateContent']({part:_0x58843a,renderingStrategy:_0x4ec509,showUnchangedParts:_0x5437d8=!0x1,abortSignal:_0x41a335}){this['partDefinition']=_0x58843a,this['isVisible']=this['partDefinition']['hasChanges']||_0x5437d8,this['isVisible']&&('streaming'===_0x4ec509?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x41a335}):this['contentView']['element']['innerHTML']=ut(this['partDefinition']['content']));}['toggleHeader'](_0x52f041){_0x52f041?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x19a8c6{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0xc9921,{part:_0x35b324,uiIndex:_0x504279,availableActions:_0x87f1cc}){super(_0xc9921),this['set']('partDefinition',_0x35b324),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x58e676=new _0x50b9df();_0x58e676['content']=_0xa2a32e,_0x58e676['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x4f460d=[];if(_0x87f1cc['includes']('showChangeInText')){const _0x30af3f=new _0x14ee0a(_0xc9921);_0x30af3f['set']({'label':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x13603c}),_0x30af3f['bind']('isEnabled')['to'](this),_0x30af3f['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x35b324['index']});}),_0x4f460d['push'](_0x30af3f);}if(_0x87f1cc['includes']('insertSuggestion')){const _0xcc43be=new _0x14ee0a(_0xc9921);_0xcc43be['set']({'label':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4c5817}),_0xcc43be['bind']('isEnabled')['to'](this),_0xcc43be['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x35b324['index']});}),_0x4f460d['push'](_0xcc43be);}const _0x505ff1=new _0x14ee0a(_0xc9921);_0x505ff1['set']({'label':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0xdc18ef}),_0x505ff1['bind']('isEnabled')['to'](this),_0x505ff1['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x35b324['index']});}),_0x4f460d['push'](_0x505ff1),this['_toolbarView']=new _0x541968(_0xc9921),this['_toolbarView']['items']['addMany'](_0x4f460d),this['_iconStateAccepted']=new _0x50b9df(),this['_iconStateAccepted']['content']=_0x368b6c,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x50b9df(),this['_iconStateRejected']['content']=_0x43e783,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x50b9df(),this['_iconStateOutdated']['content']=_0x43e783,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x58c48d=new _0x19a8c6(_0xc9921);_0x58c48d['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[C(_0xc9921,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x504279['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x58e676,_0x58c48d,this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0xa4beb7,_0xe0079a,_0x5f6e7,_0xddc3e)=>{switch(_0xddc3e){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x5f6e7){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class _ extends _0x135bec(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x550b16){const _0x3dd81f=this['createTask'](_0x550b16);return this['queue']['push'](_0x3dd81f),this['_processQueue'](),_0x3dd81f['completePromise'];}['abort'](){this['isProcessing']&&(this['_abortController']['abort'](),this['_abortController']=void 0x0,this['queue']=[],this['fire']('_queueEmpty'),this['isProcessing']=!0x1);}get['queueEmptyPromise'](){return this['queue']['length']||this['isProcessing']?new Promise(_0x47b428=>{this['once']('_queueEmpty',()=>{_0x47b428();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x10b7e0=this['queue']['shift']();try{await _0x10b7e0['callback'](this['_abortController']['signal']),_0x10b7e0['resolve']();}catch(_0x2c84e1){_0x10b7e0['reject'](_0x2c84e1);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x1a3209){let _0x66bf4c,_0x3e7d3c;const _0x32366e=new Promise((_0x12cda6,_0x3063ea)=>{_0x66bf4c=_0x12cda6,_0x3e7d3c=_0x3063ea;});return{'callback':_0x1a3209,'resolve':_0x66bf4c,'reject':_0x3e7d3c,'completePromise':_0x32366e};}}class jr extends _0x19a8c6{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x7dc0b8){super();const _0x6bd62c=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x7dc0b8,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x6bd62c['if']('isDone','ck-ai-chat__feed__item_done'),_0x6bd62c['if']('isVisible','ck-hidden',_0x202175=>!_0x202175),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){this['htmlStreamer']['cleanUpAnimations']({'targetElement':this['element']}),this['element']['querySelectorAll']('[data-id]')['forEach'](_0x105f5f=>{_0x105f5f['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x1e9184,_0x2edc5e,_0x9f4823){await this['htmlStreamer']['stream']({'document':_0x1e9184,'targetElement':_0x2edc5e,'abortSignal':_0x9f4823});}}class _e extends jr{constructor(_0xedaaf7){super(_0xedaaf7),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0xedaaf7['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x36fdcb){this['element']['innerHTML']=_0x36fdcb;}}class Dr extends _0x19a8c6{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x49b4d8,_0x436a9a){super(_0x49b4d8);const {areActionsDisabled:_0x5ee65a,showUnchangedParts:_0x163a76,availableActions:_0x56f3dd}=_0x436a9a;this['_areActionsDisabled']=_0x5ee65a,this['_showUnchangedParts']=_0x163a76,this['_availableActions']=_0x56f3dd,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _(),this['_emptyPartsWarningView']=new _e({'id':'empty-parts-warning','initialContent':C(_0x49b4d8,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x2d51d1,renderingStrategy:_0x1e6e48,abortSignal:_0xf141c6}){this['_children']['length']?_0x2d51d1['forEach'](_0x39eaa3=>{const _0x4a8df2=this['_cachedContentParts']['findIndex'](_0x4af2b2=>_0x4af2b2['index']==_0x39eaa3['index']);-0x1===_0x4a8df2?this['_cachedContentParts']['push'](_0x39eaa3):this['_cachedContentParts'][_0x4a8df2]=_0x39eaa3;}):this['_cachedContentParts']=_0x2d51d1;for(const _0x149636 of _0x2d51d1['filter'](_0x1316d1=>_0x1316d1['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x37b5dd=>{let _0x2db011=this['getPartView'](_0x149636['index']);_0x2db011||(_0x2db011=new na(this['locale'],{'part':_0x149636,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x2db011['delegate'](...Te)['to'](this),this['_children']['add'](_0x2db011),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x2db011['toggleHeader'](this['_children']['length']>0x1),await _0x2db011['updateContent']({'part':_0x149636,'renderingStrategy':_0x1e6e48,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x37b5dd});});return _0xf141c6?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x3e5c33,_0x3144be){const _0x5c2df4=this['getPartView'](_0x3e5c33);_0x5c2df4&&(_0x5c2df4['state']=_0x3144be),this['hasPendingParts']='pending'==_0x3144be||Array['from'](this['_children'])['some'](_0x4e9bea=>'pending'==_0x4e9bea['state']);}['getPartView'](_0x576e28){return this['_children']['find'](_0x4ccee6=>_0x4ccee6['partDefinition']['index']==_0x576e28)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x59e8be=!this['_cachedContentParts']['find'](({hasChanges:_0x2d810a})=>_0x2d810a),_0x1c8a22=!!this['_cachedContentParts']['find'](({hasChanges:_0x363873})=>!_0x363873);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x1c8a22,_0x59e8be?this['_emptyPartsWarningView']['setContent'](C(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](C(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x3fe1b7=>_0x3fe1b7['partDefinition']['hasChanges']);}}class Le extends _0x577daf{constructor(_0x1c282e=void 0x0){super();const _0x21af3e=_0x1c282e?'ck-ai-spinner_'+_0x1c282e:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x21af3e]}});}}class e extends _0x19a8c6{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x5cf0cc,_0x273b21){super(_0x5cf0cc);const {showDiff:_0x3b6e2a,areActionsDisabled:_0x4c32f5,miniToolbarConfig:_0x10e1d8,hideHeader:_0x6b32a,showLoader:_0x3645c2,showUnchangedParts:_0x259e55,availableActions:_0x13f772}=_0x273b21;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x3645c2),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x6b32a||(this['headerView']=new Lr(_0x5cf0cc,{'showDiff':_0x3b6e2a}),this['headerView']['on']('toggleShowChanges',(_0x5d3617,_0xac51bd)=>{this['areChangesVisible']=_0xac51bd['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0xac51bd['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x5cf0cc,{'areActionsDisabled':_0x4c32f5,'showUnchangedParts':!!_0x259e55,'availableActions':_0x13f772}),this['bodyView']['delegate'](...Te)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Vr(_0x5cf0cc,_0x10e1d8,_0x3b6e2a),this['miniToolbarView']['delegate'](...Te)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x3420ad,_0x371823)=>{this['areChangesVisible']=_0x371823,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x371823});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new Sr(this['locale']),this['children']['add'](this['sourcesView']),_0x3645c2&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x2d6afc){await this['bodyView']['updateContentParts'](_0x2d6afc);}['updateSources'](_0x4e51c8){this['sourcesView']['children']['addMany'](_0x4e51c8['map'](_0x5d0c13=>new Fr(this['locale'],_0x5d0c13))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x178bb8){if(this['errorView']){const _0x46744b=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x46744b&&(_0x46744b['textContent']=_0x178bb8),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x59fe52){this['miniToolbarView']['items']['add'](_0x59fe52);}['removeNavigationItem'](_0x1f0b34){this['miniToolbarView']['items']['remove'](_0x1f0b34);}['_createLoaderView'](){const _0x230673=new _0x19a8c6(this['locale']),_0x49a690=new Le('small');_0x49a690['isVisible']=!0x0;const _0x43e1a1=new _0x19a8c6(this['locale']);return _0x43e1a1['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[C(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x230673['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x5c59ba=>!_0x5c59ba)]},'children':[_0x49a690,_0x43e1a1]}),_0x230673;}['_createErrorView'](){const _0x4b37b8=new _0x19a8c6(this['locale']),_0x3a97f1=new _0x19a8c6(this['locale']);return _0x3a97f1['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[C(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x4b37b8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x2d0662=>!_0x2d0662)]},'children':[_0x3a97f1]}),_0x4b37b8;}}class Sr extends _0x19a8c6{['children'];constructor(_0x4a79fc){super(_0x4a79fc),this['children']=this['createCollection'](),this['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources',this['bindTemplate']['if']('isVisible','ck-hidden',_0x5a5f56=>!_0x5a5f56)]},'children':this['children']});const _0x214135=new _0x19a8c6(this['locale']),_0x80de2c=new _0x50b9df();_0x80de2c['content']=_0x2870b9,_0x214135['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x80de2c,{'tag':'span','children':[{'text':C(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x214135);}}class Fr extends _0x14ee0a{constructor(_0x47a290,_0x543f64){super(_0x47a290),this['set']({'label':_0x543f64['title'],'tooltip':_0x543f64['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x16b9de=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x16b9de['to'](()=>{window['open'](_0x543f64['url'],'_blank');})}}),_0x543f64['favicon']){const _0x342856=new _0x19a8c6(_0x47a290);_0x342856['setTemplate']({'tag':'img','attributes':{'src':_0x543f64['favicon']||_0x2870b9,'alt':_0x543f64['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x342856);}else this['set']('icon',_0x2870b9);}}class es extends _0x541968{constructor(_0x446b73,_0x4c7b5c=!0x0,_0x2dcdaa=!0x0){super(_0x446b73),this['set']('isLoading',!0x1),_0x4c7b5c&&(this['applyButton']=this['_createButton'](C(_0x446b73,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0xc47651=>!_0xc47651),this['items']['add'](this['applyButton'])),_0x2dcdaa&&(this['suggestButton']=this['_createButton'](C(_0x446b73,'AI_BALLOON_SUGGEST_BUTTON'),_0x4c7b5c?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x19cd79=>!_0x19cd79),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0xb75ed7,_0x141f14){const _0x73ced0=new _0x14ee0a(this['locale']);return _0x73ced0['set']({'label':_0xb75ed7,'class':_0x141f14||'','isVisible':!0x0,'withText':!0x0}),_0x73ced0;}}class os extends _0x19a8c6{constructor(_0x152be1){super(_0x152be1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':C(_0x152be1,'AI_DISCLAIMER_TEXT')}]}]});}}const O=['applySuggestion','insertSuggestion','showNext','showPrevious'];class R extends _0x19a8c6{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];constructor(_0x4d6c9d,_0x5ccdb9,_0x139030,_0x552b2b){super(_0x4d6c9d),this['_availableActions']=_0x139030,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x552b2b),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new ts(),this['keystrokes']=new _0x1f1bc5(),this['_focusables']=this['createCollection'](),this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0xf07a6b(),this['_addContentView'](_0x5ccdb9['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x5ccdb9['showApplyButton'],_0x5ccdb9['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x5ccdb9['showApplyButton'],_0x5ccdb9['showSuggestButton']);});}['render'](){super['render']();for(const _0x32b93d of this['_focusables'])this['focusTracker']['add'](_0x32b93d['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x5df067){-0x1===_0x5df067?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x43605c){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x43605c,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x256192){this['showError'](_0x256192);}['showBlockingError'](_0x2d4ac3){this['showError'](_0x2d4ac3),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x5217eb){const _0x1bf722=this['_createNextButtonView'](),_0xcdedf1=this['_createPreviousButtonView']();_0x5217eb['view']['headerView']['children']['add'](_0x1bf722,0x2),_0x5217eb['view']['headerView']['children']['add'](_0xcdedf1,0x0),this['_focusables']['addMany']([_0x1bf722,_0xcdedf1]),this['focusTracker']['add'](_0x1bf722['element']),this['focusTracker']['add'](_0xcdedf1['element']);}['_addContentView'](_0x500ad5){this['_mainView']=_0x500ad5,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0xe7e130){const _0x237a1c=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0xe7e130,this['_dialogContent']['add'](this['_mainView'],_0x237a1c),this['hideError']();}['_addDisclaimerView'](){this['disclaimerView']=new os(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x3983a7=!0x0,_0x1c26b1=!0x0){_0x3983a7=_0x3983a7&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x1c26b1=_0x1c26b1&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new es(this['locale'],_0x3983a7,_0x1c26b1),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x3c822b=new _0x14ee0a(this['locale']);return _0x3c822b['set']({'icon':_0x346a5d,'tooltip':C(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x3c822b['on']('execute',()=>{this['fire']('showNext');}),_0x3c822b;}['_createPreviousButtonView'](){const _0x17fbb5=new _0x14ee0a(this['locale']);return _0x17fbb5['set']({'icon':_0x25d049,'tooltip':C(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x17fbb5['on']('execute',()=>{this['fire']('showPrevious');}),_0x17fbb5;}['_createErrorView'](){const _0x5ec967=new _0x19a8c6(this['locale']),_0x2b4998=new _0x19a8c6(this['locale']);return _0x2b4998['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x5ec967['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x47c91d=>!_0x47c91d)]},'children':[_0x2b4998]}),_0x5ec967;}}const x=0xa;class w extends _0x171820{static get['requires'](){return[s,c];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x33dfaa){const _0x3f2deb=P(this['context']);if(this['_config']=_0x33dfaa,this['isOpen'])return void this['_updateBalloon'](_0x33dfaa);const _0x1e4213=this['context']['config']['get']('ai.availableReplyActions')||[...k],_0x20e818=_0x3f2deb?.['commands']['get']('trackChanges'),_0x17175e=_0x20e818?.['value'];this['balloonView']=new R(_0x3f2deb['locale'],_0x33dfaa,_0x1e4213,!!_0x17175e),this['balloonView']['delegate'](...O)['to'](this),_0x20e818&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x20e818,'value'),this['_showDialog'](_0x33dfaa);}['close'](){P(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateBalloon'](_0x565204){const _0x3c0247=P(this['context']),_0x2bb23d=_0x3c0247['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x3c0247['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x2bb23d['view']?.['headerView']&&(_0x2bb23d['view']['headerView']['label']=_0x565204['title'],_0x2bb23d['view']['headerView']['iconView']&&_0x565204['icon']&&(_0x2bb23d['view']['headerView']['iconView']['content']=_0x565204['icon'])),this['balloonView']['updateContent'](_0x565204['mainView']),this['_setupVisualSelection'](_0x565204['ranges'],_0x565204['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x2bb23d['view']&&_0x2bb23d['view']['updatePosition']();},_0x3c0247['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x4e561f,_0x389b5c){this['context']['plugins']['get'](c)['showFakeVisualSelection'](_0x4e561f,'ai-balloon-'+_0x389b5c,!0x0,!0x0);}['_showDialog'](_0x4c9469){const _0xa54556=P(this['context']);this['_setupVisualSelection'](_0x4c9469['ranges'],_0x4c9469['index']);const _0x97faa8=this['_getSelectionElements']();_0x97faa8&&_0x97faa8[0x0]&&_0x2992c3({'target':_0x97faa8[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0xa54556['plugins']['get']('Dialog')['show']({'title':_0x4c9469['title'],'icon':_0x4c9469['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x4c9469['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x125148=>{_0x4c9469['showRotator']&&this['balloonView']['setupRotator'](_0x125148),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x278659,_0xc029cf){if(!_0xc029cf)return null;const _0x46d9fa=this['_getSelectionElements']();if(!_0x46d9fa||0x0===_0x46d9fa['length'])return{'left':Math['round'](_0xc029cf['left']+_0xc029cf['width']/0x2-_0x278659['width']/0x2),'top':Math['round'](_0xc029cf['top']+_0xc029cf['height']/0x2-_0x278659['height']/0x2)};const _0x49a804=Math['round'](_0xc029cf['left']+_0xc029cf['width']/0x2-_0x278659['width']/0x2),_0x1bd9b1=new _0x31eb3f(_0x46d9fa[0x0]),_0x54ae21=new _0x31eb3f(_0x46d9fa[_0x46d9fa['length']-0x1]),_0x419c79=_0x278659['height'],_0x28edd7=this['_config']['showRotator']?0x8:0x0;return{'left':_0x49a804,'top':this['_calculateOptimalTopPosition'](_0x1bd9b1,_0x54ae21,_0x419c79,_0x28edd7,_0xc029cf)};}['_calculateOptimalTopPosition'](_0x433cf7,_0x3424e5,_0x258691,_0x2cdc3f=0x0,_0x4f6360){const _0x3d892e=_0x258691+_0x2cdc3f,_0x5514ae=new _0x31eb3f(_0x110318['window']),_0x4e4011=[_0x433cf7['getVisible'](),_0x3424e5['getVisible']()]['filter'](_0x3d0824=>_0x3d0824),_0x21ae7a=_0x31eb3f['getBoundingRect'](_0x4e4011);if(!_0x21ae7a)return Math['round'](_0x4f6360['top']+_0x4f6360['height']/0x2);const _0x2526bd=_0x5514ae['getIntersection'](_0x21ae7a);if(!_0x2526bd)return Math['round'](_0x4f6360['top']+_0x4f6360['height']/0x2);const _0x4596b8=_0x4f6360['getVisible'](),_0x1b122b=_0x4596b8&&_0x21ae7a['height']>_0x4596b8['height'],_0x543be3=_0x2526bd['top'],_0x2ef8ba=_0x2526bd['bottom'];if(_0x1b122b){const _0x1a8e0c=(_0x4596b8||_0x5514ae)['height']/0x2-_0x3d892e/0x2,_0x46f16e=_0x543be3-x-_0x4f6360['top'],_0x32cb02=_0x4f6360['bottom']-_0x2ef8ba-x;return _0x46f16e>=_0x3d892e?Math['max'](x,_0x543be3-_0x3d892e-x):_0x32cb02>=_0x3d892e?_0x2ef8ba+x:Math['max'](x,_0x1a8e0c);}const _0x17c49a=_0x543be3-_0x3d892e,_0x27e308=_0x4f6360['bottom']-_0x2ef8ba-x,_0x87d7d4=_0x543be3-x-_0x4f6360['top'];let _0x5e897a;if(_0x27e308>=_0x3d892e)_0x5e897a=_0x2ef8ba+x;else{if(_0x87d7d4>=_0x3d892e)_0x5e897a=_0x17c49a-x;else _0x5e897a=_0x543be3+_0x21ae7a['height']/0x2-_0x3d892e/0x2;}return _0x5e897a;}['_setupMarkerRemovalListener'](){const _0x3876a9=P(this['context']);this['listenTo'](_0x3876a9['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x3bb7e5,data:{newRange:_0x30d302}}of _0x3876a9['model']['document']['differ']['getChangedMarkers']())if(_0x3bb7e5['startsWith']('ai-selection:')&&(_0x30d302&&(_0x30d302['start']['isEqual'](_0x30d302['end'])||'$graveyard'==_0x30d302['root']['rootName'])||null==_0x30d302)){const _0x5d5bf1=C(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x5d5bf1),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x68a96d=P(this['context']);this['stopListening'](_0x68a96d['model']['document']);}['_getSelectionElements'](){const _0x50778b=P(this['context']);return _0x1bb7e4(_0x50778b['editing'],[..._0x50778b['model']['markers']['getMarkersGroup']('ai-selection'),..._0x50778b['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class tt extends _0x171820{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[s,w,_0x2b3cb3];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new ht({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x9b819e=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x46c152,_0x115cbd)=>{this['_handleUIUserMessage']({'userMessage':_0x115cbd});}),this['listenTo'](_0x9b819e,'resizedTabs',(_0x42cd36,_0x1f167b)=>{this['_setIsMaximized'](_0x1f167b);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x9b819e['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x1c2b52,_0x3afbe1)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x3afbe1));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x3722f5,_0x2b96f1)=>{this['activeConversation']?.['addUrlToContext'](_0x2b96f1);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x8f8db4,_0x1b33cf)=>{this['activeConversation']?.['addResourceToContext'](_0x1b33cf['source'],_0x1b33cf['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x4a20c4,_0xcfc6a4)=>{this['_removeFromContext'](_0xcfc6a4);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x14438d,_0xd9c35c)=>{this['activeConversation']?.['loadSourceResources'](_0xd9c35c['sourceId'],_0xd9c35c['query'],_0xd9c35c['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x2b09a9,_0x15f4b1)=>{this['activeConversation']?.['setModel'](_0x15f4b1);}),this['listenTo'](this['_aiChatUi'],'like',(_0x3b2262,{replyId:_0x133969})=>{console['log']('Liked\x20response',_0x133969);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x4ccfc6,{replyId:_0x3527b0})=>{console['log']('Disliked\x20response',_0x3527b0);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0xbe0e5f,_0x5e343e)=>{this['context']['plugins']['get'](w)['close'](),this['_insertSuggestion'](_0x5e343e);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x59adc5,{replyId:_0x3e8230,partIndex:_0x2890fc})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x3e8230,_0x2890fc);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x39bbf7,{replyId:_0x2d30a0,partIndex:_0x5ad317})=>{const _0x39651c=this['_getDocumentRangeForReplyChanges'](_0x2d30a0,_0x5ad317);_0x39651c&&'$graveyard'!=_0x39651c['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x39651c['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x8a3451,_0x5af701)=>{this['context']['plugins']['get'](w)['close'](),this['_applySuggestion'](_0x5af701);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x59b4a1,{replyId:_0x4d1ceb,showDiff:_0xc52dbb})=>{const {reply:_0x1fb09b}=this['getInteractionAndReplyById'](_0x4d1ceb),_0x242db0=_0x1fb09b['getContentParts']({'showDiff':_0xc52dbb});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1fb09b['id'],'parts':_0x242db0,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x2315ae,{replyId:_0xf8c846,partIndex:_0x1b01ce})=>{this['_previewedChangeGroup']?.['replyId']==_0xf8c846&&this['_previewedChangeGroup']?.['partIndex']==_0x1b01ce&&this['context']['plugins']['get'](w)['close']();const {reply:_0x40ca1e}=this['getInteractionAndReplyById'](_0xf8c846);_0x40ca1e['setChangeGroupState'](_0x1b01ce,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x41c96f,_0x49be6a)=>{_0x49be6a['on']('ready',()=>{this['_integrateEditor'](_0x49be6a);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x474f38){const _0x3e7865=P(this['context']);if(!_0x3e7865['plugins']['has']('TrackChanges'))throw new _0x29f184('ai-no-track-changes',null);const _0x10d9c2=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x2de679,interaction:_0x8f28e8}=this['getInteractionAndReplyById'](_0x474f38['replyId']),_0x6b6f35=this['_getDocumentRangeForReplyChanges'](_0x474f38['replyId'],_0x474f38['partIndex']),_0x5596b7=void 0x0!==_0x474f38['partIndex']?[_0x2de679['changeGroups'][_0x474f38['partIndex']]]:_0x2de679['changeGroups']['filter'](_0x12f3cc=>'pending'==_0x12f3cc['state']),_0x187d43=_0x5596b7['map'](_0x2d8dc7=>_0x2de679['changeGroups']['indexOf'](_0x2d8dc7));if(!_0x6b6f35||'$graveyard'==_0x6b6f35['range']['root']['rootName'])return void _0x187d43['forEach'](_0x225067=>_0x2de679['setChangeGroupState'](_0x225067,'outdated'));_0x187d43['forEach'](_0x16c27a=>_0x2de679['setChangeGroupState'](_0x16c27a,'accepted'));const _0x42983c=v({'editor':_0x3e7865,'reply':_0x2de679,'interaction':_0x8f28e8,'groups':_0x5596b7,'transform':!0x0,'documentCompare':_0x10d9c2,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x367f74;_0x6b6f35&&this['_scrollToSuggestionRange'](_0x6b6f35['range']),_0x3e7865['model']['change'](_0x540ecd=>{_0x367f74=_0x540ecd['batch'],_0x3e7865['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x42983c),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x367f74,{'interactionId':_0x8f28e8['id'],'replyId':_0x2de679['id'],'indexes':_0x187d43['slice']()}),this['_updateRatings'](_0x2de679);}['_applySuggestion'](_0xba1317){const _0x4bceb1=P(this['context']),_0x2c4aab=this['context']['plugins']['get'](_0x2b3cb3),{reply:_0x18b567,interaction:_0x5a99f4}=this['getInteractionAndReplyById'](_0xba1317['replyId']),_0x3d7772=this['_getDocumentRangeForReplyChanges'](_0xba1317['replyId'],_0xba1317['partIndex']),_0x193070=void 0x0!==_0xba1317['partIndex']?[_0x18b567['changeGroups'][_0xba1317['partIndex']]]:_0x18b567['changeGroups']['filter'](_0x524153=>'pending'==_0x524153['state']),_0x3daad5=_0x193070['map'](_0x4d997c=>_0x18b567['changeGroups']['indexOf'](_0x4d997c));if(!_0x3d7772||'$graveyard'==_0x3d7772['range']['root']['rootName'])return void _0x3daad5['forEach'](_0x53483c=>_0x18b567['setChangeGroupState'](_0x53483c,'outdated'));_0x3daad5['forEach'](_0x448880=>_0x18b567['setChangeGroupState'](_0x448880,'accepted'));const _0x94a68e=v({'editor':_0x4bceb1,'reply':_0x18b567,'interaction':_0x5a99f4,'groups':_0x193070,'transform':!0x0,'documentCompare':_0x2c4aab,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x2c79d0;_0x3d7772&&this['_scrollToSuggestionRange'](_0x3d7772['range']),_0x4bceb1['model']['change'](_0x46017b=>{_0x2c79d0=_0x46017b['batch'];for(const _0x4cbb01 of _0x94a68e)_0x4cbb01['baseVersion']=_0x4bceb1['model']['document']['version'],b(_0x4bceb1,_0x4cbb01),_0x46017b['batch']['addOperation'](_0x4cbb01),_0x4bceb1['model']['applyOperation'](_0x4cbb01);}),this['_batchToChanges']['set'](_0x2c79d0,{'interactionId':_0x5a99f4['id'],'replyId':_0x18b567['id'],'indexes':_0x3daad5['slice']()}),this['_updateRatings'](_0x18b567);}['_openBalloonFor'](_0x40ca4d,_0x30efa0){const _0x30a888=P(this['context']),_0x238292=this['_getDocumentRangeForReplyChanges'](_0x40ca4d,_0x30efa0),_0x1ebef1=this['context']['plugins']['get'](w);if(!_0x238292)return void _0x1ebef1['close']();const {range:_0x12a62e,currentIndex:_0x28d7b6}=_0x238292;if('$graveyard'==_0x12a62e['root']['rootName']){const {reply:_0x579200}=this['getInteractionAndReplyById'](_0x40ca4d);return _0x579200['setChangeGroupState'](_0x28d7b6,'outdated'),void _0x1ebef1['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x40ca4d&&this['_previewedChangeGroup']?.['partIndex']==_0x28d7b6)return;this['stopListening'](_0x1ebef1),this['_previewedChangeGroup']={'replyId':_0x40ca4d,'partIndex':_0x28d7b6};let _0x26d08d=_0x30a888['config']['get']('ai.availableReplyActions')||[...k];_0x30a888['plugins']['has']('TrackChanges')||(_0x26d08d=_0x26d08d['filter'](_0x1666b9=>'insertSuggestion'!=_0x1666b9));const _0x3f06e1=new e(_0x30a888['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x26d08d});this['stopListening'](_0x3f06e1);const {reply:_0x5a962c}=this['getInteractionAndReplyById'](_0x40ca4d),_0x1ab365=_0x5a962c['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x5d7561=>_0x5d7561['hasChanges']),_0x2d0c36=_0x1ab365['findIndex'](_0x1c96c8=>_0x1c96c8['index']==_0x28d7b6);if(-0x1==_0x2d0c36)return;const _0x4aa67b=_0x1ab365[_0x2d0c36],_0x4d5220=_0x1ab365['at']((_0x2d0c36-0x1)%_0x1ab365['length'])?.['index'],_0x4a7016=_0x1ab365['at']((_0x2d0c36+0x1)%_0x1ab365['length'])?.['index'];_0x3f06e1['updateContent']({'parts':[_0x4aa67b],'renderingStrategy':'static'});const _0x2c0c71=_0x28d7b6!==_0x4d5220;this['_scrollToSuggestionRange'](_0x12a62e,!0x0),_0x1ebef1['open']({'index':_0x28d7b6,'title':C(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x2d0c36+0x1)['toString']()),'icon':Ct,'mainView':_0x3f06e1,'showRotator':_0x2c0c71,'showApplyButton':!0x0,'showSuggestButton':_0x30a888['plugins']['has']('TrackChanges'),'ranges':[_0x12a62e]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x40ca4d,_0x28d7b6),this['listenTo'](_0x3f06e1,'toggleSuggestionDisplayMode',(_0x2cd176,{showDiff:_0x448985})=>{this['_balloonShowDiff']=_0x448985;const {reply:_0x25f80e}=this['getInteractionAndReplyById'](_0x40ca4d),_0x10e01e=_0x25f80e['getContentParts']({'showDiff':_0x448985,'groupIndex':_0x28d7b6});_0x3f06e1['updateContent']({'parts':_0x10e01e,'renderingStrategy':'static'});}),this['listenTo'](_0x1ebef1,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x40ca4d,'partIndex':_0x28d7b6}),_0x2c0c71?this['_openBalloonFor'](_0x40ca4d,_0x4a7016):_0x1ebef1['close']();}),this['listenTo'](_0x1ebef1,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x40ca4d,'partIndex':_0x28d7b6}),_0x2c0c71?this['_openBalloonFor'](_0x40ca4d,_0x4a7016):_0x1ebef1['close']();}),_0x2c0c71&&(this['listenTo'](_0x1ebef1,'showNext',()=>{this['_openBalloonFor'](_0x40ca4d,_0x4a7016);}),this['listenTo'](_0x1ebef1,'showPrevious',()=>{this['_openBalloonFor'](_0x40ca4d,_0x4d5220);})),this['listenTo'](_0x1ebef1,'dialogClosed',()=>{this['stopListening'](_0x1ebef1),this['stopListening'](_0x3f06e1),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x453e09,_0x3ce7a5){const _0x431cb0=P(this['context']),{reply:_0x31ac0a,interaction:_0x5e78a3}=this['getInteractionAndReplyById'](_0x453e09),_0x13c3b0=_0x31ac0a['changeGroups']['filter'](_0x18d2df=>'pending'==_0x18d2df['state']),_0x4aa017=_0x13c3b0['map'](_0x17e9af=>_0x31ac0a['changeGroups']['indexOf'](_0x17e9af));void 0x0===_0x3ce7a5&&(_0x3ce7a5=_0x4aa017[0x0]);const _0x2a4ea5=_0x4aa017['indexOf'](_0x3ce7a5);if(-0x1==_0x2a4ea5)return null;const _0x4301bc=_0x13c3b0[_0x2a4ea5],_0x332856=new mt([]),_0x384182=new mt([]);for(const _0x3064f7 of _0x4301bc['changes'])if('removed'!=_0x3064f7['type']&&_0x384182['children']['push'](_0x3064f7['node']['cloneNode'](!0x0)),'new'!=_0x3064f7['type']){const _0x5737d7=gt(_0x28dc66=>pt(_0x28dc66,'data-id')==_0x3064f7['id'],_0x31ac0a['documentContextContent'],!0x0);_0x332856['children']['push'](_0x5737d7['cloneNode'](!0x0));}if(0x0==_0x332856['children']['length']){if(_0x4301bc['changes'][0x0]['anchorId']){const _0x424264=ft('data-id',_0x4301bc['changes'][0x0]['anchorId'],_0x31ac0a['documentContextContent']);_0x332856['children']['unshift'](_0x424264['cloneNode'](!0x0)),_0x384182['children']['unshift'](_0x424264['cloneNode'](!0x0)),_0x424264['nextSibling']&&(_0x332856['children']['push'](_0x424264['nextSibling']['cloneNode'](!0x0)),_0x384182['children']['push'](_0x424264['nextSibling']['cloneNode'](!0x0)));}else{const _0x5334f9=_0x31ac0a['documentContextContent']['children'][0x0];if(!_0x5334f9)return null;_0x332856['children']['push'](_0x5334f9['cloneNode'](!0x0)),_0x384182['children']['push'](_0x5334f9['cloneNode'](!0x0));}}const _0x22faf8=_0x5e78a3['getDocumentContext'](),_0xf9850c=_0x431cb0['data']['parse'](_0x22faf8['content']),_0x1dba5b=ut(_0x332856),_0x2ecfc7=_0x431cb0['data']['parse'](_0x1dba5b),_0x11b166=_0x431cb0['data']['parse'](_0x1dba5b),_0x485949=_0x431cb0['model']['createPositionAt'](_0x2ecfc7,0x0),_0x5e9a4c=ut(_0x384182),_0xde13c3={'anchor':_0x485949,'markDeletions':!0x1},_0x462b5e=_0x431cb0['plugins']['get'](_0x2b3cb3)['getDiff'](_0x1dba5b,_0x5e9a4c,_0xde13c3)['getOperations']();if(!_0x462b5e['length'])return null;_0x431cb0['model']['change'](_0x5310dc=>{for(const _0x368e15 of _0x462b5e)if('remove'==_0x368e15['type']){const _0x5a2201=_0x368e15['sourcePosition'],_0x25468f=_0x368e15['howMany'],_0x91a752=new _0x1609ec(_0x5a2201,_0x25468f);_0x5310dc['batch']['addOperation'](_0x91a752),_0x431cb0['model']['applyOperation'](_0x91a752);}else'marker'!==_0x368e15['type']&&(_0x368e15['baseVersion']=null,_0x368e15['isDocumentOperation']=!0x1,_0x5310dc['batch']['addOperation'](_0x368e15),_0x431cb0['model']['applyOperation'](_0x368e15));});const _0x1e533c=lt(_0x431cb0,_0x462b5e,_0x2ecfc7);dt(_0x431cb0['model'],_0x1e533c);const _0x1a8088=_0x1e533c['getFirstRange']()['start']['path']['slice'](),_0x2f3d89=_0x1e533c['getFirstRange']()['end']['path']['slice'](),_0x4833e4=[];let _0x58d988=_0x2ecfc7,_0x2e449f=_0x11b166;for(let _0x58bb49=0x0;_0x58bb49<_0x2f3d89['length'];_0x58bb49++){const _0x10f3e0=_0x58d988['maxOffset']-_0x2f3d89[_0x58bb49];_0x4833e4[_0x58bb49]=_0x2e449f['maxOffset']-_0x10f3e0,_0x58d988=_0x58d988['getChildAtOffset'](_0x2f3d89[_0x58bb49]),_0x2e449f=_0x2e449f['getChildAtOffset'](_0x4833e4[_0x58bb49]);}const _0x34242d=_0x431cb0['model']['createRange'](_0x431cb0['model']['createPositionFromPath'](_0x11b166,_0x1a8088),_0x431cb0['model']['createPositionFromPath'](_0x11b166,_0x4833e4)),_0xf97a30=_0x11b166['getChild'](0x0)['getAttribute'](ct),_0x1ec0c4=Array['from'](_0xf9850c['getChildren']())['find'](_0x5003a7=>_0x5003a7['getAttribute'](ct)==_0xf97a30)['getPath'](),_0x2e7d46=_0x34242d['start']['path']['slice'](),_0x153994=_0x34242d['end']['path']['slice']();_0x2e7d46[0x0]=_0x1ec0c4[0x0]+_0x2e7d46[0x0],_0x153994[0x0]=_0x1ec0c4[0x0]+_0x153994[0x0];let _0xb6b3a0=_0x431cb0['model']['createRange'](_0x431cb0['model']['createPositionFromPath'](_0x431cb0['model']['document']['getRoot'](),_0x2e7d46),_0x431cb0['model']['createPositionFromPath'](_0x431cb0['model']['document']['getRoot'](),_0x153994));const _0x23b745=_0x431cb0['model']['document']['history']['getOperations'](_0x22faf8['version']);for(const _0xcf040a of _0x23b745)_0xb6b3a0=_0x59485f['_createFromRanges'](_0xb6b3a0['getTransformedByOperation'](_0xcf040a));return{'range':_0xb6b3a0,'currentIndex':_0x3ce7a5};}['_integrateEditor'](_0x147664){if(!_0x147664['plugins']['has']('Undo'))return;const _0x2d9043=_0x147664['commands']['get']('undo'),_0x5df0a8=_0x147664['commands']['get']('redo');this['listenTo'](_0x2d9043,'revert',(_0x206388,_0x38b12a,_0x5809a1)=>{const _0x792068=this['_batchToChanges']['get'](_0x38b12a);if(!_0x792068)return;const _0x4237f5=this['activeConversation']['getInteraction'](_0x792068['interactionId'])['getReply'](_0x792068['replyId']);_0x792068['indexes']['forEach'](_0x27c352=>_0x4237f5['setChangeGroupState'](_0x27c352,'pending')),this['_batchToChanges']['delete'](_0x38b12a),this['_batchToChanges']['set'](_0x5809a1,_0x792068);}),this['listenTo'](_0x5df0a8,'revert',(_0x5cd782,_0x366446,_0x51b0c1)=>{const _0xe5f4d0=this['_batchToChanges']['get'](_0x366446);if(!_0xe5f4d0)return;const _0x1c74bc=this['activeConversation']['getInteraction'](_0xe5f4d0['interactionId'])['getReply'](_0xe5f4d0['replyId']);_0xe5f4d0['indexes']['forEach'](_0x5072d7=>_0x1c74bc['setChangeGroupState'](_0x5072d7,'accepted')),this['_batchToChanges']['delete'](_0x366446),this['_batchToChanges']['set'](_0x51b0c1,_0xe5f4d0);});}async['loadConversation'](_0x5d148c){this['context']['plugins']['get'](w)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x365079=this['context']['plugins']['get'](at);this['updateConversationTitle']('\x20'),_0x365079['view']['activateTab']('chat'),await this['_startConversationSafely'](_0x5d148c);const {sessionId:_0x49f0b0}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x5d148c,_0x49f0b0),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x235f71){console['error']('Failed\x20to\x20load\x20conversation',_0x235f71);}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x819943){this['activeConversation']['id']===_0x819943&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x55d412=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x55d412),this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x21a615,quickActionData:_0x19fa52}){await this['_handleUIUserMessage']({'userMessage':_0x21a615,'quickActionData':_0x19fa52});}['getGroupId'](){const _0x28381a=this['context']['config']['get']('collaboration.channelId');if(!_0x28381a)throw new _0x29f184('ai-chat-missing-channel-id',this);return _0x28381a;}async['_startConversationSafely'](_0x153a5a){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x153a5a);}catch(_0x41025c){ot('ai-chat-conversation-start-failed',_0x41025c),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x3171a5){const _0x33fe8b=this['context']['plugins']['get'](w);let _0x441457;_0x33fe8b['isOpen']&&_0x33fe8b['close'](),_0x3171a5||!this['activeConversation']?_0x441457=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x441457=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x28f908=this['getGroupId'](),_0x1fa388=_0x3171a5||_0x223274();this['activeConversation']=new nt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x441457,'conversationId':_0x1fa388,'group':_0x28f908,'getEditor':()=>P(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x1681be,_0x3e94aa)=>{this['_aiChatUi']['createConversation'](_0x3e94aa),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x3171a5||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x34f9d4,_0xf9cb79)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xf9cb79['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x2b177a,_0x15cd43)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x15cd43);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x2747b0,_0x4088bb)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4088bb,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x5495ce,_0x387f0a)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x387f0a,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x9a72b9,_0x9fb2fd)=>{this['_aiChatUi']['removeFeedInteraction'](_0x9fb2fd['id']);}),this['activeConversation']['on']('setConversationTitle',(_0xc76af,_0x49326c,_0x1ea676)=>{this['updateConversationTitle'](_0x49326c,_0x1ea676);}),this['activeConversation']['on']('replyCreated',(_0x97817,_0x5cdf53)=>{'text-delta'===_0x5cdf53['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x5cdf53):this['_aiChatUi']['addFeedItemAISuggestion'](_0x5cdf53);}),this['activeConversation']['on']('replyContentUpdated',async(_0x143bcf,_0x60fe06)=>{await this['_updateReplyContent']({'reply':_0x60fe06});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x3cf803,{reply:_0x3debd4,index:_0x383c9b,state:_0x5df72a})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x3debd4['id'],'index':_0x383c9b,'state':_0x5df72a});}),this['activeConversation']['on']('contextItemAdded',(_0x2eed9a,_0x4a70d8)=>{if(this['_aiChatUi']['addContextItem'](_0x4a70d8['contextItem'],_0x4a70d8['isLoading']),'selection'===_0x4a70d8['contextItem']['type']){const _0x219c30=[...P(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x219c30,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x4d4827,_0x4e167b)=>{this['_aiChatUi']['removeContextItem'](_0x4e167b['uiId']),'current-document'==_0x4e167b['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x4e167b['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x520fad,_0x44ca90)=>{this['_aiChatUi']['setContextItemLoading'](_0x44ca90['contextItem']['uiId'],_0x44ca90['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x5799bc,_0x4d53e0)=>{this['_aiChatUi']['setConversationContext'](_0x4d53e0['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x54ae42,_0x2ce9fd)=>{this['_aiChatUi']['setAddContextOptions'](_0x2ce9fd['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x2ebd42,_0x5cbdf7)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x5cbdf7['sourceId'],_0x5cbdf7['source'],_0x5cbdf7['resources'],_0x5cbdf7['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x443569,_0x273d7c)=>{this['_aiChatUi']['updateResourceState'](_0x273d7c['sourceId'],_0x273d7c['resourceId'],_0x273d7c['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x3a9919,_0x381e7c)=>{this['_aiChatUi']['updateCapabilities'](_0x381e7c);}),this['activeConversation']['on']('modelSelected',(_0x40ce8f,_0x1ef93d)=>{this['_aiChatUi']['setSelectedModel'](_0x1ef93d['selectedModel'],_0x1ef93d['isDisabled']);}),this['activeConversation']['on']('error',(_0x3e5f3e,{error:_0x5a6d83,interactionId:_0x50c2a0,fileName:_0x41a828,url:_0x25fddf,sourceId:_0x3aa024,sourceLabel:_0x2e59ac})=>{const _0x257928=_0x50c2a0?_0x50c2a0+':'+_0x223274():_0x223274();_0x5a6d83['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':C(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x257928}):_0x5a6d83['message']['startsWith']('ai-chat-conversation-init-failed')||_0x5a6d83['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x257928}),this['_logError'](_0x5a6d83)):_0x5a6d83['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x41a828),'id':_0x257928}):_0x5a6d83['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x25fddf),'id':_0x257928}):_0x5a6d83['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x257928}):_0x5a6d83['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x257928}):_0x5a6d83['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x3aa024&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x3aa024),this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x2e59ac||'source'),'id':_0x257928}),this['_logError'](_0x5a6d83)):_0x5a6d83['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x257928}),this['_logError'](_0x5a6d83)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x257928}),this['_logError'](_0x5a6d83));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x3171a5||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0xe69143,quickActionData:_0x5a6fa8}){if(!this['activeConversation'])throw new _0x29f184('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0xe69143,'quickActionData':_0x5a6fa8}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x568932=P(this['context'])['model'],_0x2f6d7e=Array['from'](_0x568932['markers']['getMarkersGroup'](rt));_0x568932['change'](_0x95124a=>{_0x2f6d7e['forEach'](_0xa61141=>_0x95124a['removeMarker'](_0xa61141));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x170a49){this['_aiChatUi']['setIsMaximized'](_0x170a49);}['_logError'](_0xb7d713){ot(_0xb7d713['message']);}['_removeFromContext'](_0x5cb363){this['activeConversation']?.['removeFromContext'](_0x5cb363);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x3768d0){const [_0x14d993,_0x8b75c4]=_0x3768d0['split'](':'),_0x52044e=this['activeConversation']['getInteraction'](_0x14d993),_0x4b0b33=_0x52044e['getReply'](_0x8b75c4);return{'interaction':_0x52044e,'reply':_0x4b0b33};}['_scrollToSuggestionRange'](_0x2b4e1f,_0x305a09=!0x1){const _0x29c2c2=P(this['context']),_0x40b6f0={'target':_0x29c2c2['editing']['view']['domConverter']['viewRangeToDom'](_0x29c2c2['editing']['mapper']['toViewRange'](_0x2b4e1f)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x305a09};_0x305a09&&(_0x40b6f0['alignToTop']=!0x0),_0x2992c3(_0x40b6f0);}['updateConversationTitle'](_0x521b69,_0x340aad=!0x1){this['_aiChatUi']['setConversationTitle'](_0x521b69||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x340aad);}async['_updateReplyContent']({reply:_0x5a4310,renderingStrategy:_0x46839c}){const {id:_0xf20fd5,isDone:_0x528663,type:_0x45b010,parsedContent:_0x3ed136}=_0x5a4310;if('modification-delta'===_0x45b010){const _0x1424b2=_0x5a4310['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xf20fd5,'parts':_0x1424b2,'renderingStrategy':_0x46839c,'isDone':_0x528663});}else'text-delta'===_0x45b010&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0xf20fd5,'parsedContent':_0x3ed136,'renderingStrategy':_0x46839c,'isDone':_0x528663});_0x528663&&_0x5a4310['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0xf20fd5,_0x5a4310['sources']);}async['_stopLastInteraction'](){const _0x2ac8b4=this['activeConversation']?.['lastInteraction'];_0x2ac8b4&&(_0x2ac8b4['stop'](),this['_aiChatUi']['stopInteraction'](_0x2ac8b4));}async['_flushLastInteractionUI'](){const _0xce8f2b=this['activeConversation']?.['lastInteraction'];if(_0xce8f2b){for await(const _0x599d8e of _0xce8f2b['replies'])await this['_updateReplyContent']({'reply':_0x599d8e,'renderingStrategy':'static'});}}['_updateRatings'](_0x401eaa){const _0x26f35d={'positiveCount':_0x401eaa['changeGroups']['filter'](_0x17760d=>'accepted'===_0x17760d['state'])['length'],'totalCount':_0x401eaa['changeGroups']['length'],'modificationId':_0x401eaa['id']},_0xe4111b=this['activeConversation']['getInteraction'](_0x401eaa['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0xe4111b,_0x26f35d);}}const St=[...Te,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ge extends jr{['containerView'];['actionsView'];constructor(_0x4b57ae,_0xe8f36a){super(_0xe8f36a),this['set']('isTrackChangesOn',!0x1),this['containerView']=new e(_0x4b57ae,{'showDiff':_0xe8f36a['showDiff'],'areActionsDisabled':_0xe8f36a['areActionsDisabled'],'availableActions':_0xe8f36a['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x1027d9,_0x4e9ca2)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4e9ca2['showDiff']});}),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0xdcf016,{index:_0x18dbbc})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x18dbbc});}),this['containerView']['on']('insertSuggestion',(_0x5634e2,{index:_0x267496})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x267496});}),this['containerView']['on']('rejectSuggestion',(_0x1c2488,{index:_0x114c17})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x114c17});}),this['containerView']['on']('mouseOverSuggestion',(_0x5844a9,{index:_0x2f174a})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2f174a});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x913ea9,{index:_0x409436})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x409436});}),this['actionsView']=new nh(_0x4b57ae,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0xe8f36a['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x16d3ce){await this['containerView']['updateContent'](_0x16d3ce),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x37e4d2,_0x55b9f9){this['containerView']['bodyView']['updatePartState'](_0x37e4d2,_0x55b9f9);}['updateSources'](_0x123e32){this['containerView']['updateSources'](_0x123e32);}['getPartView'](_0x1ed6c6){return this['containerView']['bodyView']['getPartView'](_0x1ed6c6);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class ke extends jr{['replyContainer'];constructor(_0x44adff,_0x6540ec){super(_0x6540ec),this['locale']=_0x44adff,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x19a8c6(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Ye(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x3fd9d8,renderingStrategy:_0xdb27b7,abortSignal:_0x283d32}){'streaming'===_0xdb27b7?await this['streamIntoElement'](_0x3fd9d8,this['replyContainer']['element'],_0x283d32):this['replyContainer']['element']['innerHTML']=_0xec369b(_0x3fd9d8);}['updateSources'](_0x53632f){const _0x425711=new Sr(this['locale']);_0x425711['children']['addMany'](_0x53632f['map'](_0x1f9088=>new Fr(this['locale'],_0x1f9088))),_0x425711['isVisible']=!0x0,this['children']['add'](_0x425711);}}const xn={'file':_0x5b8c8e,'document':_0x776ddc,'web-resource':_0x339b47,'text':_0x5b8c8e,'selection':_0x4d97da},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Jr='ck-ai-chat-context-chip_document',Zr='ck-ai-chat-context-chip__label',ra='ck-ai-chat-context-chip__type-icon',oa='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class bo extends _0x14ee0a{constructor(_0xd4a1ed,_0x175da4,_0x5b4305,_0x5da634,_0x21660d=!0x1){super(_0xd4a1ed),this['_isAnimationOnEnterEnabled']=_0x5da634,this['_initializeProperties'](_0x175da4,_0x5b4305,_0x21660d),this['_setupTemplate']();}['render'](){super['render'](),this['_isAnimationOnEnterEnabled']&&this['element']&&(this['element']['classList']['add']('ck-ai-chat-context-chip_new-chip'),this['_handleAnimationEndOnce'](this['element'],()=>{this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}));}['disableAnimationOnEnter'](){this['_isAnimationOnEnterEnabled']=!0x1,this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}['_initializeProperties'](_0x5afbac,_0x3981c7,_0x127cfb){this['set']('label',_0x5afbac['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x5afbac['type']),this['set']('id',_0x5afbac['uiId']),this['set']('readonly',_0x3981c7),this['set']('isLoading',_0x127cfb);}['_setupTemplate'](){const _0x5b2132=this['_createIconView'](),_0x375d3e=this['_createRemoveButton'](),_0x2b8fa8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x2b8fa8),'children':this['_createTemplateChildren'](_0x5b2132,_0x375d3e,_0x2b8fa8)});}['_createTemplateAttributes'](_0x495a6e){return{'class':[$r,_0x495a6e['if']('itemType',Jr,_0x313f9b=>'document'==_0x313f9b),_0x495a6e['if']('itemType',Qr,_0x52cd25=>'selection'==_0x52cd25)],'data-cke-tooltip-text':_0x495a6e['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':oa};}['_createTemplateChildren'](_0x12301c,_0x5efe5b,_0x28c214){const _0x3c4164=this['_createLabelElement'](_0x28c214),_0x3bdeaf=this['_createLoaderIcon']();return this['readonly']?[_0x12301c,_0x3c4164]:[_0x12301c,_0x3bdeaf,_0x3c4164,_0x5efe5b];}['_createLabelElement'](_0x48d8bf){return{'tag':'span','attributes':{'class':Zr},'children':[{'text':_0x48d8bf['to']('label')}]};}['_createRemoveButton'](){const _0x1c6a8b=new _0x14ee0a(this['locale']);return _0x1c6a8b['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x5e2897}),this['_setupRemoveButtonEvent'](_0x1c6a8b),_0x1c6a8b;}['_setupRemoveButtonEvent'](_0x43d7db){_0x43d7db['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x4b1fef=this['bindTemplate'],_0xa8ecca=new _0x50b9df();return _0xa8ecca['content']=xn[this['itemType']],_0xa8ecca['extendTemplate']({'attributes':{'class':[ra,_0x4b1fef['if']('isLoading','ck-hidden',_0x3f97c6=>_0x3f97c6)]}}),_0xa8ecca;}['_handleAnimationEndOnce'](_0x269a2d,_0x551f2a){if(!_0x269a2d)return;const _0x450054=()=>{_0x551f2a(),_0x269a2d['removeEventListener']('animationend',_0x450054),_0x269a2d['removeEventListener']('webkitAnimationEnd',_0x450054);};_0x269a2d['addEventListener']('animationend',_0x450054),_0x269a2d['addEventListener']('webkitAnimationEnd',_0x450054);}['_createLoaderIcon'](){const _0x308aa3=new Le('small');return _0x308aa3['bind']('isVisible')['to'](this,'isLoading',_0x24e123=>_0x24e123),_0x308aa3;}}function In(_0x557043){if(!_0x557043)return _0x557043;if(_0x557043['length']<=0x78)return _0x557043;const _0x5a6564=_0x557043['slice'](0x0,0x78),_0x1173a9=_0x5a6564['lastIndexOf']('\x20');return(_0x1173a9>0x0?_0x5a6564['slice'](0x0,_0x1173a9):_0x5a6564)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ao{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x4d1f54,_0x2d2f93,_0x47c15f,_0x479bfb,_0x4d320c){this['_locale']=_0x4d1f54,this['_visibleChips']=_0x2d2f93,this['_config']={...hn,..._0x47c15f,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x47c15f['cssClasses']}},this['_overflowChips']=new _0x5d69ef(),this['_bodyCollection']=_0x479bfb,this['_parentView']=_0x4d320c||null;}['setContainerElement'](_0x489046){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x489046,this['_setupVisibilityObserver']();}get['showMoreButtonView'](){return this['_showMoreButtonView'];}get['overflowChips'](){return this['_overflowChips'];}['reorganizeChips'](){requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});}['showBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_updateBalloonContent'](),this['_showMoreButtonView']['isOn']=!0x0,this['_showMoreBalloonPanelView']['show'](),this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')}));}['hideBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_showMoreButtonView']['isOn']=!0x1,this['_showMoreBalloonPanelView']['hide']());}['clear'](){this['_overflowChips']['clear'](),this['hideBalloonPanel'](),this['_updateShowMoreButtonVisibility'](),this['_showMoreButtonView']&&(this['_showMoreButtonView']['label']=''),this['_showMoreBalloonPanelView']&&this['_showMoreBalloonPanelView']['content']['clear']();}['destroy'](){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_showMoreButtonView']&&(this['_showMoreButtonView']['destroy'](),this['_showMoreButtonView']=null),this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['destroy'](),this['_showMoreBalloonPanelView']=null);}['_checkAndHandleOverflow'](){if(!this['_containerElement'])return;if(!this['_isContainerVisible']())return void(this['_pendingCalculation']=!0x0);this['_pendingCalculation']=!0x1;const _0x3213bb=[...this['_visibleChips'],...this['_overflowChips']],_0x2959b6=this['_createCalculationContainer'](),_0x610e9a=this['_calculateOverflowInContainer'](_0x2959b6,_0x3213bb),_0x364cfb=_0x2959b6['_ancestorsToRestore'];_0x364cfb&&this['_restoreAncestorVisibility'](_0x364cfb),_0x2959b6['remove'](),this['_applyOverflowResults'](_0x3213bb,_0x610e9a);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x29a34e({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x5c5ecd=new _0x14ee0a(this['_locale']);_0x5c5ecd['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x16e1d3=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x16e1d3['push'](this['_config']['cssClasses']['controlsButton']),_0x5c5ecd['extendTemplate']({'attributes':{'class':_0x16e1d3}}),_0x5c5ecd;}['_createShowMoreBalloonPanelView'](){const _0x3b0db1=new _0x500981(this['_locale']);return _0x3b0db1['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x3b0db1),_0x3b0db1;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x401c6a=>{_0x401c6a['disableAnimationOnEnter']();});const _0x596f77=new _0x19a8c6(this['_locale']);_0x596f77['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x596f77);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x856b3b=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x856b3b?'':'none');}['_repinBalloonPanel'](){this['_showMoreButtonView']?.['isOn']&&this['_showMoreBalloonPanelView']?.['isVisible']&&this['_showMoreButtonView']['element']&&this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')});}['_findTargetContainer'](_0x22a927){const _0x4039a6=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2449a6=this['_containerElement']?.['classList'];if(_0x2449a6){const _0x164303=_0x2449a6[0x0]||'',_0xbedf2=_0x22a927['querySelector']('.'+_0x164303),_0x365af9=_0x22a927['querySelector'](_0x4039a6);return _0xbedf2||_0x365af9||_0x22a927;}return _0x22a927['querySelector'](_0x4039a6)||_0x22a927;}['_calculateContainerWidth'](){const _0x498ca2=this['_parentView']?.['element']||this['_containerElement'];if(!_0x498ca2)return an;const _0x16d180=window['getComputedStyle'](_0x498ca2)['width'];if('auto'===_0x16d180||'0px'===_0x16d180||!_0x16d180){const _0x5ac163=_0x498ca2['parentElement'];if(_0x5ac163){const _0x4eddda=window['getComputedStyle'](_0x5ac163);return'auto'!==_0x4eddda['width']?_0x4eddda['width']:an;}return an;}return _0x16d180;}['_applyCalculationStyles'](_0x445ec6,_0x51c1f7){this['_config']['cssClasses']['calculationContainer']&&_0x445ec6['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x445ec6['style']['width']=_0x51c1f7,_0x445ec6['style']['position']='absolute',_0x445ec6['style']['top']='-9999px',_0x445ec6['style']['left']='-9999px',_0x445ec6['style']['opacity']='0',_0x445ec6['style']['pointerEvents']='none',_0x445ec6['style']['zIndex']='-1',_0x445ec6['style']['visibility']='visible\x20!important',_0x445ec6['style']['display']='block\x20!important',_0x445ec6['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x39d157){_0x39d157['forEach'](({element:_0x2fe5ce,originalDisplay:_0x44d1f1,originalVisibility:_0x4178b0})=>{_0x2fe5ce['style']['display']=_0x44d1f1,_0x2fe5ce['style']['visibility']=_0x4178b0;});}['_makeAncestorsVisible'](_0x3d8357){const _0x3e7cfb=[];let _0x41aecc=_0x3d8357;for(;_0x41aecc&&_0x41aecc!==document['body'];){const _0x286a97=window['getComputedStyle'](_0x41aecc);'none'!==_0x286a97['display']&&'hidden'!==_0x286a97['visibility']||(_0x3e7cfb['push']({'element':_0x41aecc,'originalDisplay':_0x41aecc['style']['display'],'originalVisibility':_0x41aecc['style']['visibility']}),_0x41aecc['style']['display']='block',_0x41aecc['style']['visibility']='visible'),_0x41aecc=_0x41aecc['parentElement'];}return _0x3e7cfb;}['_createContainerElements'](){let _0x3a0227,_0x54fa49;return this['_parentView']?.['element']?(_0x3a0227=this['_parentView']['element']['cloneNode'](!0x0),_0x54fa49=this['_findTargetContainer'](_0x3a0227)):(_0x3a0227=document['createElement']('div'),_0x54fa49=_0x3a0227),{'calculationContainer':_0x3a0227,'targetContainer':_0x54fa49};}['_createCalculationContainer'](){const {calculationContainer:_0x27d82c,targetContainer:_0x2d7ef7}=this['_createContainerElements'](),_0x57c766=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x27d82c,_0x57c766);const _0x2d343c=this['_parentView']?.['element']||this['_containerElement'],_0x270ac7=_0x2d343c?.['parentElement'];_0x270ac7?_0x270ac7['appendChild'](_0x27d82c):document['body']['appendChild'](_0x27d82c),_0x27d82c['_targetContainer']=_0x2d7ef7;const _0x49a3fa=this['_makeAncestorsVisible'](_0x270ac7||null);return _0x27d82c['offsetWidth'],_0x27d82c['_ancestorsToRestore']=_0x49a3fa,_0x27d82c;}['_calculateOverflowInContainer'](_0x485370,_0x4a88cf){const _0x3ec540=_0x485370['_targetContainer']||_0x485370,_0x14cab3=[],{rowCount:_0x564d35}=this['_renderChipsAndCountRows'](_0x3ec540,_0x4a88cf);if(_0x564d35<=this['_config']['maxVisibleRows'])return _0x14cab3;const _0x5723b7=_0x4a88cf['slice']();for(;_0x5723b7['length']>0x0;){if(this['_testButtonFit'](_0x485370,_0x3ec540,_0x5723b7)){const _0x5a9ed0=_0x4a88cf['filter'](_0x72ba5a=>!_0x5723b7['includes'](_0x72ba5a));_0x14cab3['push'](..._0x5a9ed0);break;}if(!_0x5723b7['pop']())break;}return _0x14cab3;}['_renderChipsAndCountRows'](_0x2d5427,_0x3d51c5){_0x2d5427['innerHTML']='',_0x3d51c5['forEach'](_0x145a5d=>{if(_0x145a5d['element']){const _0x444a3f=_0x145a5d['element']['cloneNode'](!0x0);_0x2d5427['appendChild'](_0x444a3f);}}),_0x2d5427['offsetWidth'];const _0x204bd3=_0x2d5427['children'],_0x556c70=[];return Array['from'](_0x204bd3)['forEach'](_0xa6e373=>{const _0x54a055=_0xa6e373['getBoundingClientRect']()['top'];_0x556c70['some'](_0x7e4639=>Math['abs'](_0x7e4639-_0x54a055)<this['_config']['rowDetectionTolerance'])||_0x556c70['push'](_0x54a055);}),{'rowCount':_0x556c70['length']};}['_createMockButton'](){const _0x5614ca=document['createElement']('button');return _0x5614ca['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x5614ca['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x5614ca['textContent']='+\x201',_0x5614ca;}['_testButtonFit'](_0x1418ac,_0x292074,_0x48970d){this['_renderChipsAndCountRows'](_0x292074,_0x48970d);const _0x5b9781=this['_createMockButton']();_0x1418ac['appendChild'](_0x5b9781),_0x1418ac['offsetWidth'];const _0x21925b=[..._0x292074['children'],_0x5b9781],_0x259cd5=[];_0x21925b['forEach'](_0x3245c4=>{const _0x30e9b2=_0x3245c4['getBoundingClientRect']()['top'];_0x259cd5['some'](_0x4d0b4f=>Math['abs'](_0x4d0b4f-_0x30e9b2)<this['_config']['rowDetectionTolerance'])||_0x259cd5['push'](_0x30e9b2);});const _0x18d83f=_0x259cd5['length'];return _0x5b9781['remove'](),_0x18d83f<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x3683e1,_0x34301b){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x3683e1['forEach'](_0x3b544a=>{_0x34301b['includes'](_0x3b544a)?this['_overflowChips']['add'](_0x3b544a):this['_visibleChips']['add'](_0x3b544a);});}['_updateOverflowUI'](_0xeae082){if(_0xeae082>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0xeae082>0x0&&this['_showMoreButtonView']){const _0xb93e54=''+this['_config']['showMoreLabelPrefix']+(_0xeae082<0x63?_0xeae082:'99');this['_showMoreButtonView']['label']=_0xb93e54;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x284954,_0x3c146e){this['_distributeChips'](_0x284954,_0x3c146e),this['_updateOverflowUI'](_0x3c146e['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x11479f=>{_0x11479f[0x0]['isIntersecting']&&this['_pendingCalculation']&&requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});},{'threshold':0.01,'rootMargin':'50px'}),this['_intersectionObserver']['observe'](this['_containerElement']));}['_isContainerVisible'](){if(!this['_containerElement'])return!0x1;if(!this['_containerElement']['isConnected'])return!0x1;const _0x3abbeb=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x3abbeb['width']||0x0===_0x3abbeb['height'])return!0x1;const _0x49af58=window['innerHeight']||document['documentElement']['clientHeight'],_0xc0931d=window['innerWidth']||document['documentElement']['clientWidth'],_0x195492=0xc8;return _0x3abbeb['bottom']>=-0xc8&&_0x3abbeb['top']<=_0x49af58+_0x195492&&_0x3abbeb['right']>=-0xc8&&_0x3abbeb['left']<=_0xc0931d+_0x195492;}}const ca='ck-ai-chat__feed__context-chips',la='ck-ai-chat-context-chips-wrapper',da='ck-ai-chat-context-chips-wrapper-balloon',ua='ck-ai-chat-controls-button',_a='ck-ai-chat-controls_context_show-more-button',Ia='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x19a8c6{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x186edd,_0x3e8763,_0x6ece7a){super(_0x186edd),this['_bodyCollection']=_0x6ece7a,this['_createContextChips'](_0x3e8763);const _0x598a70={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Ia,'overflowContainer':da,'controlsButton':ua}};this['_overflowManager']=new Ao(_0x186edd,this['_contextChips'],_0x598a70,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[ca,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':la},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x1b6311=this['element']['querySelector']('.'+la);_0x1b6311&&(this['_overflowManager']['setContainerElement'](_0x1b6311),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x1a2ac0){for(const _0x47b550 of _0x1a2ac0){const _0xf1d93b=new bo(this['locale'],_0x47b550,!0x0,!0x1);this['_contextChips']['add'](_0xf1d93b);}}}class ve extends jr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x35f769,_0x20d4b1,_0x2c4343){super(_0x20d4b1),this['_locale']=_0x35f769,this['_bodyCollection']=_0x2c4343,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new ah(this['_locale'],this['options']['contextItems']['filter'](_0x238d8c=>!_0x238d8c['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x19a8c6(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Et extends jr{['capabilities'];constructor(_0x5e03f7,_0x52f761){super(_0x52f761);const {isWebSearchEnabled:_0x5b924c,isReasoningEnabled:_0x306fbc}=_0x52f761['capabilities'],_0xc14e0f=[];let _0x4f9698='';_0x5b924c&&_0x306fbc?(_0x4f9698=C(_0x5e03f7,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0xc14e0f['push'](aa(_0x2870b9)),_0xc14e0f['push'](aa(_0x49c2da))):_0x5b924c?(_0x4f9698=C(_0x5e03f7,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0xc14e0f['push'](aa(_0x2870b9))):_0x306fbc&&(_0x4f9698=C(_0x5e03f7,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0xc14e0f['push'](aa(_0x49c2da))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x4f9698?'':'ck-hidden']}});const _0x44fbbf=new _0x19a8c6();_0x44fbbf['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0xc14e0f,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x4f9698]}]}),this['children']['add'](_0x44fbbf),this['capabilities']=_0x52f761['capabilities'];}}function aa(_0x3220cc){const _0x5dba1f=new _0x50b9df();return _0x5dba1f['content']=_0x3220cc,_0x5dba1f;}const ws=['wheel','touchstart','pointerdown','keydown'],fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class be{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x400822){this['element']=_0x400822,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x5123f3 of ws){const _0x360b9c='keydown'!==_0x5123f3;this['element']['addEventListener'](_0x5123f3,this['_onUserEvent']['bind'](this),{'passive':_0x360b9c,'signal':this['abortController']['signal']});}}['start'](){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}['stop'](){requestAnimationFrame(()=>{this['_stop']();});}['destroy'](){this['_stop'](),this['abortController']['abort']();}['_stop'](){null!==this['animationFrameId']&&(cancelAnimationFrame(this['animationFrameId']),this['animationFrameId']=null),this['isRunning']&&(this['isRunning']=!0x1),this['isUserPaused']=!0x1;}['_onUserEvent'](_0x272ab5){if(this['isRunning']){if('keydown'===_0x272ab5['type']){const _0x3cb6c6=_0x272ab5['key'];if(!fs['includes'](_0x3cb6c6))return;}_0x272ab5 instanceof WheelEvent?_0x272ab5['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x1ae269,scrollHeight:_0x6252ce,clientHeight:_0x519895}=this['element'];return _0x6252ce-_0x1ae269-_0x519895<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class je extends _0x19a8c6{constructor(_0x28a8cf,_0x2e520f){super(_0x28a8cf),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2e520f)});}['_createSkeletonItems'](_0x39ec33){const _0x237d7b=['ck','ck-ai-skeleton__item'];return _0x39ec33['map'](_0x1a8361=>{let _0x15808b='';switch(_0x1a8361['attributes']['align']){case'right':_0x15808b='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x15808b='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x15808b='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x1a8361['tag'],'attributes':{'class':[..._0x237d7b,_0x1a8361['attributes']['class']?_0x1a8361['attributes']['class']:''],'style':'width:\x20'+_0x1a8361['attributes']['width']+';\x20height:\x20'+_0x1a8361['attributes']['height']+';'+_0x15808b}};});}}const Ce={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0xbc4bc8,_0x17bee6,_0x5499d4,_0x41c3f1){return new Array(_0xbc4bc8)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x17bee6,'height':_0x5499d4,'align':_0x41c3f1}}));}class ji extends _0x19a8c6{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x14377b,_0x5da7aa){super(_0x14377b),this['_bodyCollection']=_0x5da7aa,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...St)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new be(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x5b1593,_0xe5afd6){let _0x5a0cad;'ai-reply'===_0x5b1593?_0x5a0cad=new ke(this['locale'],_0xe5afd6):'ai-suggestion-reply'===_0x5b1593?(_0x5a0cad=new ge(this['locale'],_0xe5afd6),_0x5a0cad['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x5a0cad='user-message'===_0x5b1593?new ve(this['locale'],_0xe5afd6,this['_bodyCollection']):'interaction-header'===_0x5b1593?new Et(this['locale'],_0xe5afd6):new _e(_0xe5afd6),this['children']['add'](_0x5a0cad);}async['updateReplyItem']({id:_0x12d096,parsedContent:_0x21aa13,renderingStrategy:_0x4c38ef,abortSignal:_0x1606a3}){const _0x18f429=this['getItemById'](_0x12d096);if(!(_0x18f429 instanceof ke))throw new _0x29f184('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x18f429,'id':_0x12d096,'parsedContent':_0x21aa13});await _0x18f429['updateContent']({'parsedContent':_0x21aa13,'renderingStrategy':_0x4c38ef,'abortSignal':_0x1606a3});}async['updateWebSources'](_0x3e28cc,_0x5aa837){const _0x23d4b6=this['getItemById'](_0x3e28cc);if(_0x23d4b6 instanceof ge)_0x23d4b6['updateSources'](_0x5aa837);else{if(!(_0x23d4b6 instanceof ke))throw new _0x29f184('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x23d4b6,'id':_0x3e28cc,'sources':_0x5aa837});_0x23d4b6['updateSources'](_0x5aa837);}}async['updateSuggestionItem']({id:_0x2d71e4,parts:_0x2c3707,renderingStrategy:_0x3b730b,abortSignal:_0x88068d}){const _0x221dce=this['getItemById'](_0x2d71e4);if(!(_0x221dce instanceof ge))throw new _0x29f184('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x221dce,'id':_0x2d71e4,'parts':_0x2c3707});await _0x221dce['updateContent']({'parts':_0x2c3707,'renderingStrategy':_0x3b730b,'abortSignal':_0x88068d});}['updateSuggestionPartState']({id:_0x1f01d6,index:_0x338001,state:_0x32dbe5}){const _0x1c4dbd=this['getItemById'](_0x1f01d6);if(!(_0x1c4dbd instanceof ge))throw new _0x29f184('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1f01d6});_0x1c4dbd['updatePartState'](_0x338001,_0x32dbe5);}['markItemAsDone'](_0x2a286b){this['getItemById'](_0x2a286b)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x284f00=>_0x284f00['options']['id']);}['removeItem'](_0x1c9836){this['children']['remove'](this['getItemById'](_0x1c9836));}['scrollToSuggestion'](_0x1a490a,_0xe379a9){const _0x511f5e=this['getItemById'](_0x1a490a);if(!(_0x511f5e instanceof ge))return void _0xadd6c3('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x1a490a,'partIndex':_0xe379a9});const _0x1be1a0=_0x511f5e['getPartView'](_0xe379a9);_0x1be1a0?_0x2992c3({'target':_0x1be1a0['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0xadd6c3('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x1a490a,'partIndex':_0xe379a9});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x5a67aa=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x5a67aa,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x1895d9=new je(this['locale'],Ce['aiFeed']);return _0x1895d9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x579dcb=>!_0x579dcb)]}}),_0x1895d9;}['_createFeedItems'](){const _0x5eab5f=new _0x19a8c6(this['locale']);return _0x5eab5f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x5eab5f;}['_createFeedLoader'](){const _0x4d8ce5=new _0x19a8c6(this['locale']);return _0x4d8ce5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x4474ae=>!_0x4474ae)]},'children':this['_createLoaderChildren']()}),_0x4d8ce5;}['_createLoaderChildren'](){const _0x41cb5a=new Le();return _0x41cb5a['isVisible']=!0x0,[_0x41cb5a,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4112db){const _0x25b7d9=this['children']['find'](_0x5378d9=>_0x5378d9['options']['id']['includes'](_0x4112db));if(!_0x25b7d9)throw new _0x29f184('ai-chat-feed-view-item-not-found',this,{'id':_0x4112db});return _0x25b7d9;}['setLoadingMessage'](_0x13bc0b){this['set']('loadingMessage',_0x13bc0b);}['toggleLoadingSkeleton'](_0x2cb937){this['set']('isLoadingSkeletonVisible',_0x2cb937);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x556745{['filter'](){let _0x395972=0x0;for(const _0x14bbf2 of this['items'])_0x395972+=_0x14bbf2['items']['length'];return{'resultsCount':_0x395972,'totalItemsCount':_0x395972};}}class ds extends _0x4dc60c{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x547ee1,_0x168cb6){super(_0x547ee1,{'queryView':{'label':'','creator':_0x5c1a66,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x547ee1),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x168cb6,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ds['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ds['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x880bc2,_0x1ca06d)=>!_0x880bc2&&!_0x1ca06d),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x238fc6,_0x4421b1)=>{this['isUploadInProgress']||this['isEmpty']||_0x238fc6['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4421b1());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x1277aa=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x1277aa)return this['queryView']['errorText']=C(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x161f8f=_0x4e9308(_0x1277aa);this['fire']('sendUserMessage',_0x161f8f),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x2d119b){this['queryView']['fieldView']['set']('placeholder',_0x2d119b);}['_createSubmitButton'](){const _0xee0d2f=new _0x14ee0a(this['locale']);return _0xee0d2f['set']({'icon':_0x2a3f1e,'label':C(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0xee0d2f['on']('execute',()=>{this['submit']();}),_0xee0d2f;}['setIsUploadInProgress'](_0x249422){this['isUploadInProgress']=_0x249422;}['_setUpAddContextButtonPositioning'](){const _0xe7dca3=this['locale'],_0x1d8404=()=>{_0x110318['window']['requestAnimationFrame'](()=>{if(_0x4b2614(this['element'])){const _0x159df3=new _0x31eb3f(this['queryView']['fieldView']['element']),_0x59c04e=new _0x31eb3f(this['_addContextButtonView']['element']),_0x1ec5b5=_0x159df3['width'],_0x5d08f5='rtl'===_0xe7dca3['uiLanguageDirection']?'right':'left';_0x159df3['excludeScrollbarsAndBorders']();const _0x563108=_0x1ec5b5-_0x159df3['width']+0x1;this['_addContextButtonView']['element']['style'][_0x5d08f5]='calc('+(_0x1ec5b5-_0x59c04e['width']-_0x563108)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x1d8404),this['on']('render',()=>{_0x1d8404(),this['_queryViewResizeObserver']=new _0x474d80(this['queryView']['fieldView']['element'],()=>{_0x1d8404();});});}}const Aa='ck-ai-chat__prompt-capabilities',ga='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls-button--commands',ma='ck-ai-chat-controls__model-selection',pa='ck-ai-chat-controls__model-selection__item-name',Ta='ck-ai-chat-controls__model-selection__item-description',Ca='ck-ai-chat-controls__model-selection__item-capabilities',wa='n';class ps extends _0x19a8c6{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0xaab24f){super(_0xaab24f),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelSelectorVisible',_0x146eb2=>_0x146eb2),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x458e19=>_0x458e19?this['_modelSelectionDropdown']['buttonView']['label']:C(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x37d67c=>_0x37d67c),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x3c4c7b=>_0x3c4c7b),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x5f5aab=>!_0x5f5aab),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x513bc1=>C(this['locale'],_0x513bc1?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0xfbb6cf=>_0xfbb6cf),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x322ec7=>!_0x322ec7),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1a9590=>C(this['locale'],_0x1a9590?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Aa]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x5d69ef(),_0x21ea2c(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x55b6d9,_0x4593a3){if(this['set']('modelSelectorVisible',!(_0x4593a3&&_0x55b6d9['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x55b6d9?.['length']){const _0x156a37=ki['getLocalized'](this['locale'],_0x55b6d9);for(const _0x578770 of _0x156a37){const _0x3deb51=new _0x3cd526({'label':_0x578770['name'],'withText':!0x0,'role':'menuitemradio','id':_0x578770['id'],'model':_0x578770});_0x3deb51['bind']('isOn')['to'](this,'activeModelId',_0x27622b=>_0x27622b===_0x578770['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x3deb51,'labelView':new fa(this['locale'],_0x578770)});}}}['setWebSearch'](_0x572b32){this['set']('webSearchActive',_0x572b32);}['setReasoning'](_0x4401d3){this['set']('reasoningActive',_0x4401d3);}['setModel'](_0x3105bc){if(!_0x3105bc)return;this['activeModelId']=_0x3105bc['id'],this['activeModelName']=_0x3105bc['name']||_0x3105bc['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x3105bc['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x3105bc['name']);const _0x20801a=_0x3105bc['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x20801a),this['_webSearchButton']['set']('isVisible',_0x20801a);const _0x167de8=_0x3105bc['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x167de8),this['_reasoningButton']['set']('isVisible',_0x167de8);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x4ae748){this['set']('modelSelectorEnabled',!0x1),_0x4ae748&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x47b5c7=new _0x14ee0a();return _0x47b5c7['set']({'label':C(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x2870b9,'class':ga,'isToggleable':!0x0,'tooltipPosition':wa}),_0x47b5c7['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x47b5c7;}['_createReasoningButton'](){const _0xf07d17=new _0x14ee0a();return _0xf07d17['set']({'label':C(this['locale'],'AI_CHAT_REASONING'),'icon':_0x49c2da,'class':ga,'isToggleable':!0x0,'tooltipPosition':wa}),_0xf07d17['on']('execute',()=>{this['fire']('toggleReasoning');}),_0xf07d17;}['_createCommandsButton'](){const _0x5675f3=new _0x14ee0a();return _0x5675f3['set']({'label':C(this['locale'],'AI_CHAT_COMMANDS'),'icon':Ct,'withText':!0x0,'class':ga,'isToggleable':!0x0,'tooltip':C(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':wa}),_0x5675f3['extendTemplate']({'attributes':{'class':[Ea]}}),_0x5675f3['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x5675f3;}['_createModelSelectionDropdown'](){const _0x30618d=_0x10d828(this['locale']);return _0x30618d['set']({'panelPosition':'ne','class':[ma]}),_0x30618d['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':wa}),this['listenTo'](_0x30618d,'execute',_0x150916=>{this['fire']('selectModel',_0x150916['source']['model']);}),_0x30618d;}['_createModelNameView'](){const _0x1e9d05=new Ko(this['locale']);return _0x1e9d05['bind']('text')['to'](this,'activeModelName',_0x519213=>_0x519213??''),_0x1e9d05['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x5242d8,_0x51a0ad)=>!_0x5242d8&&!_0x51a0ad?.['toLowerCase']()['startsWith']('agent')),_0x1e9d05;}}let fa=class extends _0x53816d{constructor(_0x3f9862,_0x4120f3){super();const _0x1268d5=this['bindTemplate'],_0x4cd2c3=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1268d5['to']('style'),'id':_0x1268d5['to']('id')},'children':[{'tag':'div','attributes':{'class':[pa]},'children':[{'text':_0x1268d5['to']('text')}]},{'tag':'div','attributes':{'class':[Ta]},'children':[{'tag':'span','children':[{'text':_0x4120f3['description']}]}]},{'tag':'div','attributes':{'class':[Ca]},'children':_0x4cd2c3}]}),_0x4cd2c3['addMany'](this['_getCapabilityParts'](_0x3f9862,_0x2870b9,'AI_CHAT_SEARCH_WEB',_0x4120f3['capabilities']['webSearch']?.['enabled']??!0x1)),_0x4cd2c3['addMany'](this['_getCapabilityParts'](_0x3f9862,_0x49c2da,'AI_CHAT_REASONING',_0x4120f3['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x47a321,_0xb626ce,_0x134b48,_0x1be93a){const _0x3dba87=new _0x50b9df();_0x3dba87['content']=_0xb626ce;const _0xf12eb9=new _0x19a8c6(_0x47a321);_0xf12eb9['setTemplate']({'tag':'span','children':[{'text':C(_0x47a321,_0x134b48)+':\x20'}]});const _0x4932eb=new _0x19a8c6(_0x47a321);return _0x4932eb['setTemplate']({'tag':'span','children':[{'text':C(_0x47a321,_0x1be93a?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3dba87,_0xf12eb9,_0x4932eb];}};class Ko extends _0x19a8c6{constructor(_0x2b853b){super(_0x2b853b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x663d68=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x663d68['if']('isVisible','ck-hidden',_0x21aa3a=>!_0x21aa3a)]},'children':[{'text':_0x663d68['to']('text')}]});}}const Sa='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class To extends _0x19a8c6{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x35207f){super(_0x35207f),this['focusTracker']=new ts(),this['keystrokes']=new _0x1f1bc5(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x3c4593=>{this['focusTracker']['add'](_0x3c4593['element']),this['keystrokes']['listenTo'](_0x3c4593['element']);}),_0x1e2b1f({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x514b7c){this['urlInputField']['errorText']=_0x514b7c,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x3cbbfb=new _0x14ee0a(this['locale']);return _0x3cbbfb['set']({'icon':_0x25d049,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x3cbbfb;}['_createUrlInputField'](){const _0x4f035e=new _0x5cba56(this['locale'],th);return _0x4f035e['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x4f035e['fieldView']['set']({'placeholder':C(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x4f035e;}['_createConfirmButton'](){const _0x58d4ee=new _0x14ee0a(this['locale']);return _0x58d4ee['set']({'icon':_0x270303,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x58d4ee;}['_setupTemplate'](){const _0x6f04d5=new _0x5720b1(this['locale'],{'label':C(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x6f04d5['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Sa,'tabindex':'-1'},'children':[_0x6f04d5,{'tag':'div','attributes':{'class':Oa},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x180d8b=>{_0x180d8b['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x1bc2a3,_0x24c5be)=>{this['clear'](),this['fire']('cancel'),_0x24c5be();});}['_handleSubmit'](){const _0x96f346=this['getValue']()['trim']();_0x96f346?this['_isValidUrl'](_0x96f346)?(this['clearError'](),this['fire']('submitUrl',_0x96f346)):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x30a2b1=this['getValue']()['trim'](),_0x5cf220=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x30a2b1['length']>0x0&&!_0x5cf220;}['_isValidUrl'](_0x31689d){try{return!!new URL(_0x31689d);}catch{return!0x1;}}}const Ra='ck-ai-chat-resources__item',ba='ck-ai-chat-resources__item--in-context',Na='ck-ai-chat-resources__item-title',ka='ck-ai-chat-resources__item__icon';class tc extends _0x2269a3{['resource'];['_titleView'];['_iconView'];constructor(_0x2f88a9,_0x44ee66){super(_0x2f88a9),this['resource']=_0x44ee66,this['set']('isInContext',!!_0x44ee66['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x3d3ff7){if(_0x3d3ff7['isInContext'])return _0x270303;switch(_0x3d3ff7['type']){case Xt['DOCUMENT']:return _0x776ddc;case Xt['URL']:return _0x339b47;case Xt['FILE']:case Xt['TEXT']:return _0x5b8c8e;default:return _0x625012;}}['highlightText'](_0x59faaf){if(!_0x59faaf||''===_0x59faaf['trim']())return void this['_titleView']['highlightText'](null);const _0x22d2c1=new RegExp(_0x418237(_0x59faaf),'gi');this['_titleView']['highlightText'](_0x22d2c1);}['updateResourceState'](_0x332df8){this['resource']['isInContext']=_0x332df8,this['isInContext']=_0x332df8,this['_updateIcon']();}['_createTitleView'](){const _0x54ceb5=new _0x39d67c();return _0x54ceb5['text']=this['resource']['label'],_0x54ceb5['extendTemplate']({'tag':'span','attributes':{'class':[Na]}}),_0x54ceb5;}['_createIconView'](){const _0x590715=new _0x50b9df();return _0x590715['content']=this['getResourceIcon'](this['resource']),_0x590715;}['_setupTemplate'](){const _0x5f0ed4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ra,_0x5f0ed4['if']('isVisible','ck-hidden',_0x2c295=>!_0x2c295),_0x5f0ed4['if']('isInContext',ba)]},'children':[{'tag':'div','attributes':{'class':[ka]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x5f0ed4['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const ya='ck-ai-chat-resources__list';class Rr extends _0x556745{['_source'];constructor(_0x799932,_0x176893){super(_0x799932),this['_source']=_0x176893,this['extendTemplate']({'attributes':{'class':[ya]}});}['setResources'](_0x4f032c,_0x430642){this['items']['clear']();let _0x12ba75=_0x4f032c;if(this['_source']['useDefaultFiltering']&&_0x430642&&''!==_0x430642['trim']()){const _0x5ef366=new RegExp(_0x430642['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x12ba75=_0x4f032c['filter'](_0x3378c1=>_0x5ef366['test'](_0x3378c1['label']));}for(const _0xb1e195 of _0x12ba75){const _0x3ccc33=new tc(this['locale'],_0xb1e195);_0x3ccc33['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0xb1e195);}),this['items']['add'](_0x3ccc33);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x430642);}['highlightText'](_0x22fc90){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x518a3f=>{_0x518a3f['highlightText'](_0x22fc90);});}['updateResourceState'](_0x244585,_0x4d1ad1){for(const _0x544cae of this['items']){const _0x15ea72=_0x544cae;_0x15ea72['resource']['id']===_0x244585&&_0x15ea72['updateResourceState'](_0x4d1ad1);}}['_handleResourceSelection'](_0x213eda,_0xb755f5){this['fire']('addResourceToContext',{'source':_0x213eda,'resource':_0xb755f5});}}class qr extends _0x5cba56{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x3e6d57){const t=_0x3e6d57['t'],_0xcbf35e={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':C(_0x3e6d57,'AI_CHAT_SEARCH_RESOURCES')};super(_0x3e6d57,_0xcbf35e['creator']),this['label']=_0xcbf35e['label'],this['_viewConfig']=_0xcbf35e,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x3e6d57,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x302d7b){this['fire']('search',_0x302d7b);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x50b9df(),this['iconView']['content']=_0x5a0eff,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x2b7a72,t){this['resetButtonView']=new _0x14ee0a(_0x2b7a72),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x510307,'class':'ck-search__reset','isVisible':!0x1,'tooltip':!0x0}),this['resetButtonView']['on']('execute',()=>{this['reset'](),this['focus'](),this['fire']('reset');}),this['resetButtonView']['bind']('isVisible')['to'](this['fieldView'],'isEmpty',_0x19ba7e=>!_0x19ba7e),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Or extends _0x19a8c6{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x18c56c,_0x3dcfba){super(_0x18c56c),this['_source']=_0x3dcfba['source'],this['_searchInputVisibleFrom']=_0x3dcfba['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0xf07a6b([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new qr(this['locale']);}['_createSearchSection'](){const _0x46d15c=new _0x19a8c6(this['locale']);return _0x46d15c['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1318c9,_0x4bab4e)=>{this['loadResources'](_0x4bab4e),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x4bab4e);}),_0x46d15c;}['_createResourcesListView'](){const _0xdfa8=new Rr(this['locale'],this['_source']);return _0xdfa8['delegate']('addResourceToContext')['to'](this),_0xdfa8['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0xdfa8;}['_createSkeletonView'](){const _0xa23d64=new je(this['locale'],Ce['aiChatResources']);return _0xa23d64['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xa944e4=>!_0xa944e4)]}}),_0xa23d64;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x380672){const _0x459f1e=_0x223274();this['_latestLoadResourcesUid']=_0x459f1e,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x380672,'uid':_0x459f1e}),this['isLoading']=!0x0;}['setResources'](_0x173421,_0x5cefb9){if(_0x5cefb9&&_0x5cefb9!==this['_latestLoadResourcesUid'])return;const _0x5a6de3=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x173421,_0x5a6de3),_0x173421['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x59569b,_0x2df02f){this['_resourcesListView']['updateResourceState'](_0x59569b,_0x2df02f);}}const va='ck-ai-chat-context-controls__source-balloon-panel',xa='ck-button-icon\x20ck-button-back',La='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class ko{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x4a1b82,_0x1521ba,_0x1b3414){this['_locale']=_0x4a1b82,this['_bodyCollection']=_0x1521ba,this['_config']=_0x1b3414;}['showSourceResourcesBalloon'](_0x56394d){let _0x3a9939=this['_sourceResourceBalloons']['get'](_0x56394d['id']);_0x3a9939||(_0x3a9939=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x56394d['id'],_0x3a9939),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x3a9939)),this['_addSourceResourceContent'](_0x3a9939,_0x56394d),_0x3a9939['show']();const _0x28a5b2=this['_config']['getTargetElement']();_0x28a5b2&&_0x3a9939['pin']({'target':_0x28a5b2,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x4eff3c,_0x13accc,_0x2c158a){const _0x1edd87=this['_sourceResourceBalloons']['get'](_0x4eff3c);if(!_0x1edd87)return;const _0x12de0b=this['_getResourcesViewFromBalloon'](_0x1edd87);_0x12de0b&&(_0x12de0b['setResources'](_0x13accc,_0x2c158a),_0x12de0b['once']('change:isLoading',()=>{_0x1edd87['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x5194cc){const _0x246ce0=this['_sourceResourceBalloons']['get'](_0x5194cc);_0x246ce0&&requestAnimationFrame(()=>{_0x246ce0['hide'](),this['_sourceResourceBalloons']['delete'](_0x5194cc),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0xf06264 of this['_sourceResourceBalloons']['values']())if(_0xf06264['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x8e3aa8,_0x9c123a,_0x5acf5a){const _0x59284b=this['_sourceResourceBalloons']['get'](_0x8e3aa8);if(!_0x59284b||!_0x59284b['isVisible'])return;const _0x4c4937=this['_config']['getTargetElement']();if(!_0x4c4937)return;_0x59284b['pin']({'target':_0x4c4937,'limiter':this['_config']['getLimiterElement']()});const _0x4205f4=this['_getResourcesViewFromBalloon'](_0x59284b);_0x4205f4&&_0x4205f4['updateResourceState'](_0x9c123a,_0x5acf5a);}['destroy'](){for(const _0x59f1a7 of this['_sourceResourceBalloons']['values']())_0x59f1a7['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0xdd7c2c=new _0x500981(this['_locale']);return _0xdd7c2c['extendTemplate']({'attributes':{'class':va}}),this['_bodyCollection']['add'](_0xdd7c2c),_0xdd7c2c;}['_addSourceResourceContent'](_0x5669fd,_0x3a06b3){_0x5669fd['content']['clear']();const _0x194d39=this['_createBalloonHeader'](_0x5669fd,_0x3a06b3);_0x5669fd['content']['add'](_0x194d39);const _0x519dd5=this['_createBalloonResourcesView'](_0x3a06b3);_0x5669fd['content']['add'](_0x519dd5);}['_createBalloonHeader'](_0x46854d,_0x2f5c89){const _0x495277=this['_createBackButton'](_0x46854d),_0x2a0e39=new _0x5720b1(this['_locale'],{'label':_0x2f5c89['label'],'class':La});return _0x2a0e39['children']['add'](_0x495277,0x0),_0x2a0e39;}['_createBackButton'](_0x55e9ca){const _0x25dea8=new _0x14ee0a(this['_locale']);return _0x25dea8['set']({'icon':_0x25d049,'tooltip':C(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':xa}),_0x25dea8['on']('execute',()=>{_0x55e9ca['hide'](),this['_config']['onBackToContext']();}),_0x25dea8;}['_createBalloonResourcesView'](_0x33d8b1){const _0x17103b=new Or(this['_locale'],{'source':_0x33d8b1,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x17103b['on']('loadSourceResources',(_0x33ca74,_0x37fe6f)=>{this['_config']['onLoadSourceResources'](_0x37fe6f);}),_0x17103b['on']('addResourceToContext',(_0x1d4858,_0x3de587)=>{this['_config']['onResourceSelected'](_0x3de587['source'],_0x3de587['resource']),this['closeSourceResourceBalloon'](_0x33d8b1['id']);}),_0x17103b;}['_getResourcesViewFromBalloon'](_0x14555d){const _0x29a4d8=_0x14555d['content']['get'](0x1);return _0x29a4d8 instanceof Or?_0x29a4d8:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x5be58d){_0x29a34e({'emitter':_0x5be58d,'contextElements':[_0x5be58d['element']],'callback':()=>{_0x5be58d['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x5be58d['isVisible']});}}const ms=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],Eo='ck-ai-chat-context-controls',vo='ck-ai-chat-context-controls__pending-contexts',Vo='ck-ai-chat-context-controls__add-context-balloon-panel',Io='ck-ai-chat-context-controls__add-context-button',Po='ck-ai-chat-context-controls__url-balloon-panel',Ro='ck-ai-chat-context-controls__balloon-button',Uo='ck-ai-chat-context-controls__balloon-button-source',Lo='ck-ai-chat-controls-button',No='ck-ai-chat-context-chips-wrapper-balloon',Oo='ck-ai-chat-controls_context_show-more-button',Mo='ck-ai-chat-context-controls__show-more-balloon-panel',Ho='ck-ai-chat',jo=[_0x500981['defaultPositions']['northArrowSouthWest'],_0x500981['defaultPositions']['northArrowSouth'],_0x500981['defaultPositions']['northArrowSouthEast'],_0x500981['defaultPositions']['southArrowNorthWest'],_0x500981['defaultPositions']['southArrowNorth'],_0x500981['defaultPositions']['southArrowNorthEast']];class us extends _0x19a8c6{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x13636d,_0x42f690){super(_0x13636d),this['bodyCollection']=_0x42f690['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x13636d),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x13636d),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x13636d),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x13636d,_0x42f690);const _0x3e6f8a={'cssClasses':{'showMoreButton':Oo,'showMoreBalloon':Mo,'overflowContainer':No,'controlsButton':Lo}};this['_overflowManager']=new Ao(_0x13636d,this['_currentContextsChips'],_0x3e6f8a,this['bodyCollection'],this),this['_addContextBalloonConfig']={'buttonView':this['addContextButtonView'],'balloonView':this['_addContextBalloonPanelView'],'hideMethod':this['hideAddContextBalloonPanel']['bind'](this),'showMethod':this['showAddContextBalloonPanel']['bind'](this)},this['_setupTemplate'](),this['_bindEventHandlers']();}['render'](){super['render'](),this['_setupAllBalloonClickOutsideHandlers'](),this['_overflowManager']['setContainerElement'](this['element']),this['_overflowManager']['reorganizeChips']();}['destroy'](){super['destroy'](),this['_overflowManager']['destroy'](),this['_resourcesBalloonView']['destroy']();}['addContextItem'](_0x26a8e4,_0x294d1b){const _0x6098df=this['_createContextButton'](_0x26a8e4,'current',!0x0,_0x294d1b);this['_addContextToCollection'](_0x6098df,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x40ad61){this['_removeContextFromCollection'](_0x40ad61,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x40ad61,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x4227c8,_0x266501){let _0x2924c0=this['_currentContextsChips']['find'](_0x474007=>_0x474007['id']===_0x4227c8);_0x2924c0||(_0x2924c0=this['_overflowManager']['overflowChips']['find'](_0x115778=>_0x115778['id']===_0x4227c8)),_0x2924c0&&(_0x2924c0['isLoading']=_0x266501);}['setConversationContext'](_0x18d181){this['_conversationContextsChips']['clear']();for(const _0x3ea7c9 of _0x18d181){const _0x55ce80=this['_createContextButton'](_0x3ea7c9,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x55ce80,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x4afa5c,_0xdc0e7f,_0x5a9d4b){this['_resourcesBalloonView']['updateResourceState'](_0x4afa5c,_0xdc0e7f,_0x5a9d4b);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon'](_0x9c4e83){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x9c4e83),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x544be5,_0x5ca372,_0x2a28cc,_0x458053){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x544be5,_0x2a28cc,_0x458053);}['closeSourceResourceBalloon'](_0x15d32d){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x15d32d),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x1d9f31){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x1d9f31),this['_setAddContextButtonEnabled'](_0x1d9f31);}['_setAddContextButtonEnabled'](_0x179542){const _0x58961d=!_0x179542['document']['isHidden']&&_0x179542['document']['enabled'],_0x339d45=_0x179542['urls']['enabled'],_0x164676=_0x179542['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x58961d||_0x339d45||_0x164676;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Eo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':vo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x243ca2){const _0x46a5c9=new _0x14ee0a(_0x243ca2);return _0x46a5c9['set']({'label':C(_0x243ca2,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Lo+'\x20'+Io,'icon':_0x3725c8,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x46a5c9;}['_createAddContextBalloonPanelView'](_0x3d79ad){return this['_createBaseBalloonPanel'](_0x3d79ad,Vo);}['_createUrlBalloonPanelView'](_0x221855){const _0x312e61=this['_createBaseBalloonPanel'](_0x221855,Po);return this['_addUrlContent'](_0x312e61,_0x221855),_0x312e61;}['_createResourcesBalloonView'](_0x21d430,_0x3d2f2d){const _0x1c5c1b={'searchInputVisibleFrom':_0x3d2f2d['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});},'onResourceSelected':(_0x1972e1,_0xf030f0)=>{this['fire']('addResourceToContext',{'source':_0x1972e1,'resource':_0xf030f0});},'onLoadSourceResources':_0xaedb7b=>{this['fire']('loadSourceResources',_0xaedb7b);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new ko(_0x21d430,_0x3d2f2d['bodyCollection'],_0x1c5c1b);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ho)||document['body'];}['_createBaseBalloonPanel'](_0x59fc6a,_0x30cfe1){const _0x4a5716=new _0x500981(_0x59fc6a);return _0x4a5716['extendTemplate']({'attributes':{'class':_0x30cfe1}}),this['bodyCollection']['add'](_0x4a5716),_0x4a5716;}['_setBalloonPanelContent'](_0x25f1de,_0x11452f,_0x16b131){if(_0x25f1de['content']['clear'](),!_0x16b131['document']['isHidden']&&_0x16b131['document']['enabled']){const _0xbc8436=this['_createBalloonButton'](_0x11452f,{'label':C(_0x11452f,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x776ddc});_0xbc8436['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x25f1de['content']['add'](_0xbc8436);}if(_0x16b131['urls']['enabled']){const _0x5212e0=this['_createBalloonButton'](_0x11452f,{'label':C(_0x11452f,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x339b47});_0x5212e0['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}),this['_urlInputView']['focus']();}),_0x25f1de['content']['add'](_0x5212e0);}if(_0x16b131['files']['enabled']){const _0x29e96f=new _0xbecc3f(_0x11452f);_0x29e96f['set']({'label':C(_0x11452f,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x44b793,'withText':!0x0,'tooltip':!0x0,'class':Ro,'allowMultipleFiles':!0x0}),_0x29e96f['on']('done',(_0x378296,_0x2f95ec)=>{this['fire']('addFileToContext',_0x2f95ec),this['hideAddContextBalloonPanel']();}),_0x29e96f['tooltip']=!0x0,_0x25f1de['content']['add'](_0x29e96f);}for(const _0x394ef8 of _0x16b131['sources']){const _0x96a74b=this['_createBalloonButton'](_0x11452f,{'label':_0x394ef8['label'],'icon':_0x394ef8['icon']||_0x625012,'type':'source'});_0x25f1de['content']['add'](_0x96a74b),_0x96a74b['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x394ef8);});}}['_addUrlContent'](_0x13d5be,_0x39a990){this['_urlInputView']=new To(_0x39a990),this['_urlInputView']['on']('submitUrl',(_0x31c1c7,_0x7ea80a)=>{this['_handleUrlSubmit'](_0x7ea80a);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});}),_0x13d5be['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x519237,_0x58d143){const _0x1fd6aa='source'===_0x58d143['type']?new Da(_0x519237):new _0x14ee0a(_0x519237);return _0x1fd6aa['set']({'label':_0x58d143['label'],'icon':_0x58d143['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ro}),_0x1fd6aa;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x29a34e({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x20d781){const _0x231cd6=this['_addContextBalloonConfig'];_0x231cd6['buttonView']['isOn']=_0x20d781,_0x20d781?_0x231cd6['balloonView']['show']():_0x231cd6['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x22ed01,buttonView:_0x2226f3,hideMethod:_0x56dbf3}=this['_addContextBalloonConfig'];_0x29a34e({'emitter':_0x22ed01,'contextElements':[_0x22ed01['element'],_0x2226f3['element']],'callback':()=>{_0x56dbf3();},'activator':()=>_0x2226f3['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x45fcbe,_0x463a61,_0x43b1d9=!0x1,_0x32474a=!0x1){const _0x59d47a='conversation'===_0x463a61||!0x0===_0x45fcbe['isReadOnly'],_0x43596a=new bo(this['locale'],_0x45fcbe,_0x59d47a,_0x43b1d9,_0x32474a);return _0x59d47a||_0x43596a['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x43596a['id']);}),_0x43596a;}['_addContextToCollection'](_0x227a33,_0x247d03){_0x247d03['add'](_0x227a33,0x0);}['_removeContextFromCollection'](_0x342561,_0x4b8667){const _0x574d63=_0x4b8667['find'](_0xbacc7c=>_0xbacc7c['id']===_0x342561);_0x574d63&&_0x4b8667['remove'](_0x574d63);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}));}['_handleUrlSubmit'](_0x49d9a8){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x49d9a8);}}class Da extends _0x14ee0a{['arrowView'];constructor(_0x52239e){super(_0x52239e),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Uo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x570a0c=new _0x50b9df();return _0x570a0c['content']=_0xf874d9,_0x570a0c['extendTemplate']({'attributes':{'class':Uo+'__arrow'}}),_0x570a0c;}}class bs extends _0x19a8c6{['_cancelButtonView'];['_loaderView'];constructor(_0x3b2ea1){super(_0x3b2ea1),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_loaderView']=this['_createLoaderView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-loader-wrapper','ck-reset_all']},'children':[this['_loaderView'],this['_cancelButtonView']]});}['_createCancelButtonView'](){const _0xc70e2e=new _0x14ee0a(this['locale']);return _0xc70e2e['set']({'label':C(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x4c89d2}),_0xc70e2e['on']('execute',()=>{this['fire']('abortPromptStream');}),_0xc70e2e;}['_createLoaderView'](){const _0x5ec841=new _0x19a8c6(this['locale']);return _0x5ec841['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':C(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x5ec841;}}class Bi extends _0x19a8c6{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x3b1e1e,_0x32beb6){super(_0x3b1e1e),this['_contextPanelView']=this['_createContextPanelView'](_0x3b1e1e,{'bodyCollection':_0x32beb6['bodyCollection'],'searchInputVisibleFrom':_0x32beb6['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x3b1e1e),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x3b1e1e),this['_loaderView']=this['_createLoaderView'](_0x3b1e1e),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x3b1e1e),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...ms)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x11ba23=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x11ba23['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x11ba23['if']('isLoading','ck-hidden',_0x1e61f5=>_0x1e61f5||!this['isModelAvailable']),_0x11ba23['if']('isModelAvailable','ck-hidden',_0x488756=>!_0x488756||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x11ba23['if']('isLoading','ck-hidden',_0x35f4f2=>!_0x35f4f2)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x11ba23['if']('isModelAvailable','ck-hidden',_0x52b17c=>_0x52b17c)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x29a34e({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x4df9db,_0x497191){return new us(_0x4df9db,_0x497191);}['_createPromptInputView'](_0x392209){return new ds(_0x392209,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x4f29a5){return new ps(_0x4f29a5);}['_createLoaderView'](_0x592e8f){return new bs(_0x592e8f);}['_createModelUnavailableMessageView'](_0x425ba9){const _0x585090=new gs(_0x425ba9);return _0x585090['delegate']('startConversation')['to'](this),_0x585090;}['_handlePromptInputFocus'](_0x377684,_0x2c999c,_0x2a106a){_0x2a106a?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3c1b0e,_0x34467d){this['_contextPanelView']['addContextItem'](_0x3c1b0e,_0x34467d);}['removeContextItem'](_0x2f3ef6){this['_contextPanelView']['removeContextItem'](_0x2f3ef6);}['setContextItemLoading'](_0x2734ca,_0x16a323){this['_contextPanelView']['setContextItemLoading'](_0x2734ca,_0x16a323);}['setIsUploadInProgress'](_0x357a2d){this['_promptInputView']['setIsUploadInProgress'](_0x357a2d);}['setConversationContext'](_0x364c29){this['_contextPanelView']['setConversationContext'](_0x364c29);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x2adef2,_0x49611a,_0x3e44bf){this['_contextPanelView']['updateResourceState'](_0x2adef2,_0x49611a,_0x3e44bf);}['setWebSearch'](_0x2152cc){this['_promptCapabilitiesView']['setWebSearch'](_0x2152cc);}['setReasoning'](_0x31785a){this['_promptCapabilitiesView']['setReasoning'](_0x31785a);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x491e93){this['_contextPanelView']['setAddContextOptions'](_0x491e93);}['setInputPlaceholder'](_0x15f4dd){this['_promptInputView']['setPlaceholderText'](_0x15f4dd);}['setModelList'](_0x3738ec,_0x2a12ff){this['_displayedModels']=_0x3738ec,this['_promptCapabilitiesView']['setModelList'](_0x3738ec,_0x2a12ff);}['setModel'](_0x3efc78){(_0x3efc78?this['_displayedModels']['find'](_0x214dcd=>_0x214dcd['id']===_0x3efc78['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3efc78)):_0x3efc78?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x24d4b2){this['_promptCapabilitiesView']['disableModelSelector'](_0x24d4b2);}['populateSourceResourceBalloon'](_0x5a5e93,_0x4b1eca,_0x940c8e,_0x555f72){this['_contextPanelView']['populateSourceResourceBalloon'](_0x5a5e93,_0x4b1eca,_0x940c8e,_0x555f72);}['closeSourceResourceBalloon'](_0x3470a1){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3470a1);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class gs extends _0x19a8c6{constructor(_0x555aea){super(_0x555aea);const _0x38daaf=new _0x14ee0a(_0x555aea);_0x38daaf['set']({'label':C(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x38daaf['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':C(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x38daaf]}]});}}class Fi extends _0x5720b1{['conversationStartButton'];['resizeButton'];constructor(_0x4a95b9,_0x56c60d){super(_0x4a95b9,{'label':C(_0x4a95b9,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_t}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x4a95b9),this['children']['add'](this['conversationStartButton']),_0x56c60d&&(this['resizeButton']=Cs(_0x4a95b9,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x92779f){const _0x48edee=new _0x14ee0a(_0x92779f);return _0x48edee['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5c1cc1,'class':'ck-ai-chat__start-conversation'}),_0x48edee['on']('execute',()=>{this['fire']('startConversation');}),_0x48edee;}}class Vi extends _0x19a8c6{constructor(_0x1c2ebc){super(_0x1c2ebc),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':C(_0x1c2ebc,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0x19a8c6{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x1912d0,_0x11d67a){super(_0x1912d0),this['_bodyCollection']=new qt(_0x1912d0),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Fi(_0x1912d0,_0x11d67a['showResizeButton']),this['chatHeader']['delegate'](...St)['to'](this),this['chatFeed']=new ji(_0x1912d0,this['_bodyCollection']),this['chatFeed']['delegate'](...St)['to'](this),this['chatControls']=new Bi(_0x1912d0,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x11d67a['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...St)['to'](this),this['chatDisclaimer']=new Vi(_0x1912d0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x1912d0['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x258ead,_0x2bf621,_0x112c68,_0x2d3cb8){this['chatControls']['populateSourceResourceBalloon'](_0x258ead,_0x2bf621,_0x112c68,_0x2d3cb8);}['closeSourceResourceBalloon'](_0x3f6ad1){this['chatControls']['closeSourceResourceBalloon'](_0x3f6ad1);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class et extends _0x171820{static get['requires'](){return[at];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x9012b8){super(_0x9012b8);const _0x515254=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x515254['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...St)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x1f42a3,{showDiff:_0xdec8ba})=>{this['showDiff']=_0xdec8ba;}),_0x515254['view']['addTab']({'id':'chat','buttonLabel':C(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_t,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0xee490e=>_0xee490e),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x10c012=>_0x10c012),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x527b45){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x527b45['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':C(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x263b81,staticMessage:_0x19289a}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x263b81,'initialContent':'<p>'+_0x19289a+'</p>'});}['addFeedItemUserMessage'](_0x501962){const _0x34ff07=_0x501962['quickActionData']?.['displayedPrompt']||_0x501962['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x501962['contextItems']['values']()),'initialContent':'<p>'+_0x34ff07+'</p>','id':_0x501962['id']});}['addFeedItemError']({errorMessage:_0x21c5de,id:_0x13962b}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x21c5de+'</p>','id':_0x13962b});}['addFeedItemAIReply'](_0xc545e7){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xc545e7['interactionId']+':'+_0xc545e7['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x466e36){const _0x304f86=P(this['context']);let _0x5bc02a=_0x304f86['config']['get']('ai.availableReplyActions')||[...k];if(_0x304f86['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x592b67=_0x304f86['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x592b67,'value');}}else _0x5bc02a=_0x5bc02a['filter'](_0x4bbedd=>'insertSuggestion'!=_0x4bbedd);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x466e36['interactionId']+':'+_0x466e36['id'],'areActionsDisabled':_0x466e36['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x5bc02a}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x2d937f,_0x20f644){const _0x351a14=this['_view']['chatFeed']['children']['last'];if(_0x351a14 instanceof Et)return this['_view']['chatFeed']['children']['remove'](_0x351a14),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x2d937f['id'],'capabilities':{'isWebSearchEnabled':_0x351a14['capabilities']['isWebSearchEnabled']||_0x20f644['isWebSearchEnabled'],'isReasoningEnabled':_0x351a14['capabilities']['isReasoningEnabled']||_0x20f644['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x2d937f['id'],'capabilities':_0x20f644});}['updateFeedInteractionHeader'](_0x2ec047){const _0x39b4c8=this['_view']['chatFeed']['children']['find'](_0xfb580b=>_0xfb580b['options']['id']==_0x2ec047['id']&&_0xfb580b instanceof Et);_0x39b4c8&&_0x39b4c8['set']('isVisible',_0x2ec047['isVisible']);}async['updateFeedItemAIReplyContent'](_0x595a40){const _0x1f36e6=_0x595a40['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1c54a8=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x595a40,'abortSignal':_0x1c54a8,'renderingStrategy':_0x1f36e6}),_0x595a40['isDone']&&this['markFeedItemAsDone'](_0x595a40['id']);});}['updateFeedItemAIReplySources'](_0x5397b7,_0x57f57e){this['_view']['chatFeed']['updateWebSources'](_0x5397b7,_0x57f57e);}async['updateFeedItemAIReplySuggestionContent'](_0x1f1a2d){const _0x118034=_0x1f1a2d['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x27b7a0=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x1f1a2d,'abortSignal':_0x27b7a0,'renderingStrategy':_0x118034}),_0x1f1a2d['isDone']&&this['markFeedItemAsDone'](_0x1f1a2d['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x508df7){this['_view']['chatFeed']['updateSuggestionPartState'](_0x508df7);}['markFeedItemAsDone'](_0x17e82c){this['_view']['chatFeed']['markItemAsDone'](_0x17e82c);}['removeFeedInteraction'](_0x392a97){this['_view']['chatFeed']['getItemIds']()['filter'](_0x35c2f8=>_0x35c2f8['startsWith'](_0x392a97))['forEach'](_0x1d16f9=>this['_view']['chatFeed']['removeItem'](_0x1d16f9));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x90f4e4){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x8c3a53=>_0x8c3a53['startsWith'](_0x90f4e4['id']))['forEach'](_0x3d0418=>this['markFeedItemAsDone'](_0x3d0418)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0xddbbbd,_0x5cc186){this['_view']['chatControls']['addContextItem'](_0xddbbbd,_0x5cc186);}['removeContextItem'](_0x420647){this['_view']['chatControls']['removeContextItem'](_0x420647);}['setContextItemLoading'](_0x5b70ab,_0x3d3adc){this['_view']['chatControls']['setContextItemLoading'](_0x5b70ab,_0x3d3adc);}['setIsUploadInProgress'](_0x65efa6){this['_view']['chatControls']['setIsUploadInProgress'](_0x65efa6);}['setConversationContext'](_0x3caa85){this['_view']['chatControls']['setConversationContext'](_0x3caa85);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x1c6f22,_0x3a6dc7,_0x2a5adb){this['_view']['chatControls']['updateResourceState'](_0x1c6f22,_0x3a6dc7,_0x2a5adb);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x130986){this['_view']['chatControls']['setAddContextOptions'](_0x130986);}['updateCapabilities'](_0x5d079e){this['_view']['chatControls']['setWebSearch'](_0x5d079e['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x5d079e['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x5d079e));}['setSelectedModel'](_0x244d2a,_0x45ca37){this['_view']['chatControls']['setModel'](_0x244d2a),_0x45ca37&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x109172){this['feedItemRenderingStrategy']=_0x109172;}['toggleLoadingSkeleton'](_0x50970c){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x50970c);}['resetConversationTitle'](){this['setConversationTitle'](C(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x1c9149,_0x40868d=!0x1){if(_0x40868d&&!It()&&_0x1c9149['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x1c9149);this['_view']['chatHeader']['label']=_0x1c9149;}['setLoadingMessage'](_0x375d92){const _0x3b5340=this['_getLoadingMessage'](_0x375d92);this['_view']['chatFeed']['setLoadingMessage'](_0x3b5340);}['_animateConversationTitle'](_0x2f3ba0){let _0x47d925=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x2f3ba0[_0x47d925],_0x47d925++,_0x47d925===_0x2f3ba0['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x516b84){this['_view']['chatHeader']['isMaximized']=_0x516b84;}['_getLoadingMessage'](_0x3e16a8){return _0x3e16a8?_0x3e16a8['isWebSearchEnabled']&&_0x3e16a8['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x3e16a8['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x3e16a8['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x1a9b41){return _0x1a9b41?_0x1a9b41['isWebSearchEnabled']&&_0x1a9b41['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x1a9b41['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x1a9b41['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x24b0ae,_0x21a851,_0x46be25,_0x3219ee){this['_view']['populateSourceResourceBalloon'](_0x24b0ae,_0x21a851,_0x46be25,_0x3219ee);}['closeSourceResourceBalloon'](_0x5c6d68){this['_view']['closeSourceResourceBalloon'](_0x5c6d68);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x127baf,_0x33f95a){this['_view']['chatFeed']['scrollToSuggestion'](_0x127baf,_0x33f95a);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Ji extends _0x556745{['sections'];constructor(_0xd7a5a,_0xe69186){super(_0xd7a5a),this['sections']=_0xe69186,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x391af4){let _0x463364=0x0,_0x806d82=0x0;for(const _0x773f33 of this['sections']){const {resultsCount:_0x358c06,totalItemsCount:_0x50cc76}=_0x773f33['filter'](_0x391af4);_0x463364+=_0x358c06,_0x806d82+=_0x50cc76;}return{'resultsCount':_0x463364,'totalItemsCount':_0x806d82};}}class Ki extends _0x2269a3{['title'];['itemsViews'];['_itemsListView'];constructor(_0x5d4d33,{title:_0x43de46,items:_0x4eebe9}){super(_0x5d4d33);const _0x595413=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x43de46,this['itemsViews']=_0x4eebe9;const _0x45a078=new _0x19a8c6(_0x5d4d33);_0x45a078['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x556745(_0x5d4d33),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x595413['if']('isVisible','ck-hidden',_0x4f9a20=>!_0x4f9a20)]},'children':[_0x45a078,this['_itemsListView']]});}['filter'](_0x1ca0cb){const _0x3e309b=this['itemsViews']['length'];let _0xdf09e2=0x0;for(const _0x589441 of this['itemsViews']){if(_0x1ca0cb){const _0x1cbe34=_0x589441['isMatching'](_0x1ca0cb);_0x589441['isVisible']=!!_0x1cbe34,_0x589441['highlightText'](_0x1ca0cb);}else _0x589441['isVisible']=!0x0,_0x589441['highlightText'](null);_0x589441['isVisible']&&_0xdf09e2++;}return this['isVisible']=_0xdf09e2>0x0,{'resultsCount':_0xdf09e2,'totalItemsCount':_0x3e309b};}['getItem'](_0x20451a){return this['itemsViews']['find'](_0x1b8211=>_0x1b8211['id']===_0x20451a);}['removeItem'](_0x2ad9d5){const _0x44e5b5=this['itemsViews']['indexOf'](_0x2ad9d5);-0x1!==_0x44e5b5&&(this['itemsViews']['splice'](_0x44e5b5,0x1),this['_itemsListView']['items']['remove'](_0x2ad9d5));}}class Qi extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x36aabc(_0x2269a3){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x3907e9,_0x5a41a5){super(_0x3907e9);const _0x56404b=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x5a41a5['pinned']),this['set']('loadingState',null),this['id']=_0x5a41a5['id'];const {title:_0x1e76db,createdAt:_0x52bd33,active:_0x58baa2=!0x1}=_0x5a41a5;this['_titleView']=new _0x39d67c(),this['_titleView']['text']=_0x1e76db,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x479aa5=this['_createCheckView'](),_0x25b351=this['_createPinButtonView'](_0x3907e9),_0x48d8d4=this['_createMenuDropdownView'](),_0x68e6a5=this['_createEditInputView'](_0x3907e9,_0x1e76db),_0x2215ad=this['_createAcceptEditButtonView'](_0x3907e9,_0x68e6a5),_0x207d84=this['_createCancelEditButtonView'](_0x3907e9,_0x68e6a5);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x25b351),this['actions']['add'](_0x48d8d4),this['on']('change:isEdit',(_0x5c4e2a,_0x1a1bba,_0x46d682)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x46d682?(this['actions']['add'](_0x2215ad),this['actions']['add'](_0x207d84),this['mainContent']['add'](_0x68e6a5),_0x68e6a5['element']['focus']()):(this['actions']['add'](_0x25b351),this['actions']['add'](_0x48d8d4),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x58baa2?'ck-ai-chat-history__item--active':'',_0x56404b['if']('isVisible','ck-hidden',_0x738dff=>!_0x738dff),_0x56404b['if']('isEdit','ck-ai-chat-history__item--edit')],'role':'listitem'},'children':[{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-check-container']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-check',_0x56404b['if']('loadingState','ck-hidden',_0x2cfaf3=>!!_0x2cfaf3)]},'children':_0x58baa2?[_0x479aa5]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x56404b['if']('loadingState','ck-hidden',_0x4f8718=>!_0x4f8718)]},'children':[this['_createSpinnerView']()]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-row']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-content']},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-title',_0x56404b['if']('loadingState','ck-hidden',_0x2e6874=>!!_0x2e6874)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x56404b['if']('loadingState','ck-hidden',_0x54356b=>!_0x54356b)]},'children':[{'text':_0x56404b['to']('loadingState',_0x1e473e=>_0x1e473e?C(this['locale'],Qi['LOADING_LABELS'][_0x1e473e]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x52bd33]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-actions']},'children':this['actions']}]}]}),this['on']('click',()=>{this['isEdit']||this['fire']('selectConversation',{'id':this['id']});});}['updateTitle'](_0x1199cc){this['_titleView']['text']=_0x4e9308(_0x1199cc);}['updateLoadingState'](_0x415a82,_0x25fbbd){this['set']('loadingState',_0x25fbbd?_0x415a82:null);}['_createCheckView'](){const _0x5eca09=new _0x50b9df();return _0x5eca09['set']({'content':_0x547952}),_0x5eca09;}['_createPinButtonView'](_0x27b200){const _0x3fec88=new _0x14ee0a(_0x27b200);return _0x3fec88['set']({'label':C(_0x27b200,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x324381,'withText':!0x1,'tooltip':!0x0}),_0x3fec88['bind']('isOn')['to'](this,'pinned'),_0x3fec88['on']('execute',()=>{const _0x303bd3=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x303bd3});}),_0x3fec88;}['_createMenuDropdownView'](){const _0x57ecc0=_0x10d828(this['locale'],_0xfe9b05),_0x5d95f5=_0x57ecc0['panelView']['children'];_0x57ecc0['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x56f15d}),_0x57ecc0['panelPosition']='sw';const _0x3c76f1=new _0x14ee0a(this['locale']);_0x3c76f1['label']=C(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x3c76f1['withText']=!0x0,_0x3c76f1['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3b003f=new _0x14ee0a(this['locale']);_0x3b003f['label']=C(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3b003f['withText']=!0x0,_0x3b003f['on']('execute',()=>{this['showConfirm'](C(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5b8790=new _0x556745(this['locale']),_0x12f656=new _0x2269a3(this['locale']);_0x12f656['children']['add'](_0x3c76f1);const _0x4841f9=new _0x2269a3(this['locale']);return _0x4841f9['children']['add'](_0x3b003f),_0x5b8790['items']['addMany']([_0x12f656,_0x4841f9]),_0x5d95f5['add'](_0x5b8790),_0x57ecc0;}['_createEditInputView'](_0x1566dd,_0x45c2ed){const _0x54b331=new _0x2efa28(_0x1566dd),_0x9423df=_0x54b331['bindTemplate'];return _0x54b331['value']=_0x45c2ed,_0x54b331['extendTemplate']({'on':{'keydown':_0x9423df['to'](_0x4761ec=>{'Enter'==_0x4761ec['key']&&this['_commitEditInputValue'](_0x54b331);})}}),_0x54b331;}['_createAcceptEditButtonView'](_0xcc0391,_0x926359){const _0xe55d1b=new _0x14ee0a(_0xcc0391);return _0xe55d1b['set']({'icon':_0x547952,'withText':!0x1,'tooltip':C(_0xcc0391,'AI_CHAT_HISTORY_ACCEPT')}),_0xe55d1b['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0xe55d1b['on']('execute',()=>{this['_commitEditInputValue'](_0x926359);}),_0xe55d1b;}['_commitEditInputValue'](_0x56d9c3){const _0x508201=_0x56d9c3['element']['value']||'';this['_titleView']['text']=_0x508201,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x508201});}['_createCancelEditButtonView'](_0x59db9b,_0x57af83){const _0xbb8164=new _0x14ee0a(_0x59db9b);return _0xbb8164['set']({'icon':_0x510307,'withText':!0x1,'tooltip':C(_0x59db9b,'AI_CHAT_HISTORY_CANCEL')}),_0xbb8164['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0xbb8164['on']('execute',()=>{this['isEdit']=!0x1,_0x57af83['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0xbb8164;}['_createSpinnerView'](){const _0x5b5229=new Le('tiny');return _0x5b5229['isVisible']=!0x0,_0x5b5229;}['isMatching'](_0x2fea35){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x2fea35)?{'title':!0x0}:null;}['highlightText'](_0x21ecf0){this['_titleView']['highlightText'](_0x21ecf0);}}class vt extends _0x19a8c6{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x407c9e,_0x9c5e63){super(_0x407c9e),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x40367b=new _0x5720b1(_0x407c9e,{'label':C(_0x407c9e,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x9c5e63&&(this['resizeButton']=Cs(_0x407c9e,this),_0x40367b['children']['add'](this['resizeButton'])),this['sectionsView']=new Ji(_0x407c9e,[]),this['sectionsView']['delegate'](...Xi)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[_0x40367b,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x20286a=new _0x3bb44f(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5f3b70=>C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5f3b70),'secondary':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x20286a['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x20286a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x22cb9b=>!_0x22cb9b)]}}),_0x20286a;}['_createSkeletonView'](){const _0x91cad2=new je(this['locale'],Ce['aiHistory']);return _0x91cad2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3f8bdb=>!_0x3f8bdb)]}}),_0x91cad2;}['_createErrorView'](){const _0x1b372e=new _0x19a8c6(this['locale']),_0x22bc58=new _0x14ee0a(this['locale']);return _0x22bc58['set']({'withText':!0x1,'icon':_0x510307,'class':'ck-ai-chat-error__dismiss-button'}),_0x22bc58['bind']('isVisible')['to'](this,'hasItems',_0x1f2b61=>!!_0x1f2b61),_0x22bc58['on']('execute',()=>{this['errorMessage']='';}),_0x1b372e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x7fb3f0=>!_0x7fb3f0)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x22bc58]}),_0x1b372e;}['_createEmptyStateView'](){const _0x358611=new _0x14ee0a(this['locale']);_0x358611['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5c1cc1,'class':'ck-ai-chat__start-conversation'}),_0x358611['on']('execute',()=>{this['fire']('openChat');});const _0x3458d5=new _0x19a8c6(this['locale']);return _0x3458d5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x2f2f5e=>!_0x2f2f5e)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[C(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x358611]}),_0x3458d5;}['_createListItemViews'](_0x5cb095,_0x201de9){const _0x22efc4=[];for(const _0x30a330 of _0x5cb095){const _0x14e338=new Qi(_0x201de9,_0x30a330);_0x14e338['delegate'](...Xi)['to'](this),_0x22efc4['push'](_0x14e338);}return _0x22efc4;}['updateHistoryItemsWithCategories'](_0x2c0329){const _0x42907e=this['locale']||'en',_0x5efdbb=[];for(const _0x1666f5 of _0x2c0329){const _0x1f8f01=this['_createListItemViews'](_0x1666f5['items'],_0x42907e);_0x5efdbb['push'](new Ki(_0x42907e,{'title':_0x1666f5['title'],'items':_0x1f8f01}));}this['sectionsView']['sections']=_0x5efdbb,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x5efdbb),this['hasItems']=_0x2c0329['some'](_0x3eba2d=>_0x3eba2d['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x37c4f4){for(const _0x41c8dd of this['sectionsView']['sections']){const _0x124266=_0x41c8dd['getItem'](_0x37c4f4);if(_0x124266){if(_0x41c8dd['removeItem'](_0x124266),0x0===_0x41c8dd['itemsViews']['length']){const _0x2e9c08=this['sectionsView']['sections']['indexOf'](_0x41c8dd);-0x1!==_0x2e9c08&&(this['sectionsView']['sections']['splice'](_0x2e9c08,0x1),this['sectionsView']['items']['remove'](_0x41c8dd));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x128e1e,_0x337c99){for(const _0x5f0f9d of this['sectionsView']['sections']){const _0x4331b8=_0x5f0f9d['getItem'](_0x128e1e);if(_0x4331b8){_0x4331b8['updateTitle'](_0x337c99);break;}}}['updateItemLoadingState'](_0x3351b6,_0x2e6b62,_0x3b69c6){for(const _0xb3839b of this['sectionsView']['sections']){const _0x3ecc3a=_0xb3839b['getItem'](_0x3351b6);if(_0x3ecc3a){_0x3ecc3a['updateLoadingState'](_0x2e6b62,_0x3b69c6);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x2505da=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x2505da);}}}const Xi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class jt extends _0x171820{static get['requires'](){return[at];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x46ab7c){super(_0x46ab7c);const _0x2c07c3=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x2c07c3['showResizeButton']),this['_historyView']['delegate'](...Xi)['to'](this),_0x2c07c3['view']['addTab']({'id':'history','buttonLabel':C(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x120ac7){this['_historyView']['removeHistoryItem'](_0x120ac7);}['updateItems'](_0x3346e3){this['_historyView']['updateHistoryItemsWithCategories'](_0x3346e3);}['updateItemTitle'](_0x18cf03,_0x3bdc9a){this['_historyView']['updateItemTitle'](_0x18cf03,_0x3bdc9a);}['updateItemLoadingState'](_0x4b9a5b,_0x141002,_0x12520b){this['_historyView']['updateItemLoadingState'](_0x4b9a5b,_0x141002,_0x12520b);}['setLoadingSkeleton'](_0x5c48f7){this['_historyView']['isLoading']=_0x5c48f7;}['showError'](_0x3e3659){this['_historyView']['errorMessage']=_0x3e3659;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x534b79){this['_historyView']['isMaximized']=_0x534b79;}}class De extends _0x4572ab(){['id'];['createdAt'];constructor({id:_0x504071,title:_0xdfdfd3,createdAt:_0x16edcc,updatedAt:_0x5d7083,pinned:_0x3ccf4c}){super(),this['id']=_0x504071,this['createdAt']=new Date(_0x16edcc),this['set']('title',_0xdfdfd3),this['set']('updatedAt',_0x5d7083?new Date(_0x5d7083):null),this['set']('pinned',_0x3ccf4c||!0x1);}['updateTitle'](_0x2cc687){this['set']('title',_0x4e9308(_0x2cc687)),this['updatedAt']=new Date();}['updatePinned'](_0x144ae0){this['set']('pinned',_0x144ae0),this['updatedAt']=new Date();}}class Tt extends _0x135bec(){['items']=[];['connector'];['group'];constructor({connector:_0x569805,group:_0x822aee}){super(),this['connector']=_0x569805,this['group']=_0x822aee;}async['init'](){try{const _0x3a7a89=this['connector']['fetchConversations'](this['group']),_0x13c593=await _0x3a7a89['getConversations']();this['loadItems'](_0x13c593);}catch(_0x3aaa34){this['fire']('error',{'error':_0x3aaa34,'operation':'init'});}}['addItem'](_0x65cd47){this['items']['push'](_0x65cd47);}async['removeItem'](_0x3e9e0c){const _0x25db53=this['items']['findIndex'](_0x418b2e=>_0x418b2e['id']===_0x3e9e0c);if(-0x1===_0x25db53)return!0x1;try{return await this['connector']['deleteConversation'](_0x3e9e0c)['execute'](),this['items']['splice'](_0x25db53,0x1),this['fire']('itemRemoved',{'itemId':_0x3e9e0c}),!0x0;}catch(_0x339cbb){return this['fire']('error',{'error':_0x339cbb,'operation':'removeItem','itemId':_0x3e9e0c}),!0x1;}}['getItem'](_0x37cca7){return this['items']['find'](_0x25177c=>_0x25177c['id']===_0x37cca7);}async['updateItemTitle'](_0x1c878a,_0x249aa4){const _0x54b766=this['getItem'](_0x1c878a);if(!_0x54b766)return!0x1;try{return await this['connector']['updateConversation'](_0x1c878a,{'title':_0x249aa4})['getResult'](),_0x54b766['updateTitle'](_0x249aa4),this['fire']('itemUpdated',{'itemId':_0x1c878a,'updates':{'title':_0x249aa4}}),!0x0;}catch(_0x18aed1){return this['fire']('error',{'error':_0x18aed1,'operation':'updateItemTitle','itemId':_0x1c878a}),!0x1;}}async['updateItemPinned'](_0x3b9c5c,_0x262002){const _0x379347=this['getItem'](_0x3b9c5c);if(!_0x379347)return!0x1;try{return await this['connector']['updateConversation'](_0x3b9c5c,{'pinned':_0x262002})['getResult'](),_0x379347['updatePinned'](_0x262002),this['fire']('itemUpdated',{'itemId':_0x3b9c5c,'updates':{'pinned':_0x262002}}),!0x0;}catch(_0x3331b7){return this['fire']('error',{'error':_0x3331b7,'operation':'updateItemPinned','itemId':_0x3b9c5c}),!0x1;}}['loadItems'](_0x52f6ab){try{this['items']=[],_0x52f6ab['map'](_0x43cfa3=>{this['addItem'](new De(_0x43cfa3));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x397fb6){this['fire']('error',{'error':_0x397fb6,'operation':'loadItems'});}}['getItems'](_0x26c1b5={}){const _0x393ced=void 0x0!==_0x26c1b5['pinned']&&_0x26c1b5['pinned'],_0x167d7e=_0x26c1b5['from']?new Date(_0x26c1b5['from']['getFullYear'](),_0x26c1b5['from']['getMonth'](),_0x26c1b5['from']['getDate']()):null,_0x44fb68=_0x26c1b5['to']?new Date(_0x26c1b5['to']['getFullYear'](),_0x26c1b5['to']['getMonth'](),_0x26c1b5['to']['getDate']()):null;return this['items']['filter'](_0x4b8beb=>{if(_0x4b8beb['pinned']!==_0x393ced)return!0x1;if(_0x44fb68){const _0x33f29a=new Date(_0x4b8beb['createdAt']['getFullYear'](),_0x4b8beb['createdAt']['getMonth'](),_0x4b8beb['createdAt']['getDate']());return _0x167d7e?_0x167d7e['getTime']()===_0x44fb68['getTime']()?_0x33f29a['getTime']()===_0x167d7e['getTime']():_0x33f29a<_0x44fb68&&_0x33f29a>=_0x167d7e:_0x33f29a<_0x44fb68;}return!0x0;});}}class yt extends _0x171820{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[s,tt,jt,at];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](s),this['_aiChatHistoryUi']=this['context']['plugins']['get'](jt),this['_aiChatController']=this['context']['plugins']['get'](tt);const _0xbba085=this['context']['plugins']['get'](at),_0x36c65d=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x36c65d}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x26ac45,_0x577c13)=>{this['_setItemLoading'](_0x577c13['id'],'remove'),this['_handleRemove'](_0x577c13['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0xfd69db,_0xd1759e)=>{this['_setItemLoading'](_0xd1759e['id'],'rename'),this['_handleEditTitle'](_0xd1759e['id'],_0xd1759e['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x2a2fdb,_0x10a925)=>{void 0x0!==_0x10a925['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x10a925['itemId'],_0x10a925['updates']['title']),void 0x0!==_0x10a925['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x10a925['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x2b3eed,_0x2f4c62)=>{this['_aiChatController']['handleRemovedConversation'](_0x2f4c62['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x2f4c62['itemId']),this['_clearItemLoading'](_0x2f4c62['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x5679da,_0x1e34ba)=>{this['_handleHistoryErrorUI'](_0x1e34ba['error'],_0x1e34ba['operation'],_0x1e34ba['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x11280a,_0x138356)=>{this['_handleSelectConversation'](_0x138356['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x420da4,_0x2d116a)=>{const _0x2e346b=_0x2d116a['pinned']?'pin':'unpin';this['_setItemLoading'](_0x2d116a['id'],_0x2e346b),this['_handleTogglePin'](_0x2d116a['id'],_0x2d116a['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0xbba085['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0xbba085['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0xbba085,'resizedTabs',(_0x1f94ab,_0x29c39e)=>{this['_setIsMaximized'](_0x29c39e);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0xbba085['resize']();});}async['_handleEditTitle'](_0x36b7cb,_0x5d57ad){await this['history']['updateItemTitle'](_0x36b7cb,_0x5d57ad);}async['_handleTogglePin'](_0xfd71dd,_0x29d424){await this['history']['updateItemPinned'](_0xfd71dd,_0x29d424);}async['_handleRemove'](_0x25b21f){await this['history']['removeItem'](_0x25b21f);}async['_handleSelectConversation'](_0x11defa){await this['_aiChatController']['loadConversation'](_0x11defa);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x1131ce=this['_aiChatController']['activeConversation']?.['id'],_0x1fd4ed=this['_getCategorizedItems']()['map'](_0x352d27=>({'title':_0x352d27['title'],'items':_0x352d27['items']['map'](_0x874cb9=>({'id':_0x874cb9['id'],'title':_0x874cb9['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x874cb9['createdAt'])['toLocaleDateString'](),'active':_0x874cb9['id']===_0x1131ce,'pinned':_0x874cb9['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x1fd4ed);}['_setItemLoading'](_0x4149b6,_0x1dd968){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4149b6,_0x1dd968,!0x0);}['_clearItemLoading'](_0x1b203d){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1b203d,null,!0x1);}['_handleHistoryErrorUI'](_0x7205e0,_0x3e6710,_0x5d233f){const _0x1b7aa3=this['_generateErrorMessage'](_0x3e6710,_0x5d233f);this['_aiChatHistoryUi']['showError'](_0x1b7aa3),_0x5d233f&&this['_clearItemLoading'](_0x5d233f),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x38d2ab,_0x288d11){const _0xbecaf7=_0x288d11?this['history']['getItem'](_0x288d11):null,_0x3803a0=_0xbecaf7?.['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x38d2ab){case'updateItemTitle':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3803a0);case'updateItemPinned':{const _0x585687=C(this['context']['locale'],_0xbecaf7?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x585687,_0x3803a0]);}case'removeItem':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3803a0);case'init':case'loadItems':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x2cd49e=new Date(),_0x459b2e=new Date(_0x2cd49e['getFullYear'](),_0x2cd49e['getMonth'](),_0x2cd49e['getDate']()),_0x2cc678=new Date(_0x459b2e);_0x2cc678['setDate'](_0x2cc678['getDate']()-0x1);const _0x351091=new Date(_0x459b2e);_0x351091['setDate'](_0x351091['getDate']()-0xe);const _0x1b1bb2=this['history']['getItems']({'pinned':!0x0}),_0x54c73e=this['history']['getItems']({'from':_0x459b2e,'to':_0x459b2e}),_0x290284=this['history']['getItems']({'from':_0x2cc678,'to':_0x2cc678}),_0x45e7c=this['history']['getItems']({'from':_0x351091,'to':_0x2cc678}),_0x4cb8a7=this['history']['getItems']({'to':_0x351091}),_0x134a32=[];return _0x1b1bb2['length']>0x0&&_0x134a32['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x1b1bb2}),_0x54c73e['length']>0x0&&_0x134a32['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x54c73e}),_0x290284['length']>0x0&&_0x134a32['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x290284}),_0x45e7c['length']>0x0&&_0x134a32['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x45e7c}),_0x4cb8a7['length']>0x0&&_0x134a32['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x4cb8a7}),_0x134a32;}['_setIsMaximized'](_0x2e88ec){this['_aiChatHistoryUi']['setIsMaximized'](_0x2e88ec);}}class it extends _0x171820{static get['requires'](){return[yt,jt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Pa extends _0x171820{static get['requires'](){return[tt,c,et,it];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x278904){super(_0x278904),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](tt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](tt)['startConversation']();}async['sendMessage']({message:_0x4ecc8d,quickActionData:_0x291724}){await this['context']['plugins']['get'](tt)['sendMessage']({'message':_0x4ecc8d,'quickActionData':_0x291724});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](tt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](tt)['focusPromptInput']();}}class go extends Nt{constructor(_0x9f1866){super(_0x9f1866);const _0x4235e5=_0x9f1866['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4235e5,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0xc9c6e4=this['editor']['plugins']['get']('AITabs')['view'];_0xc9c6e4['isVisible']=!_0xc9c6e4['isVisible'];}}class bt extends _0x5f3288{static get['requires'](){return[at];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x46b4af=this['editor'];_0x46b4af['commands']['add']('toggleAi',new go(_0x46b4af)),_0x46b4af['ui']['componentFactory']['add']('toggleAi',()=>{const _0x2c9cd2=this['_createAIUIButton'](_0x14ee0a);return _0x2c9cd2['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x2c9cd2;}),_0x46b4af['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x496514=this['_createAIUIButton'](_0x5b3955);return _0x496514['set']({'role':'menuitemcheckbox'}),_0x496514;});}['_createAIUIButton'](_0x1d465b){const _0x475b3b=this['editor'],_0x534c60=_0x475b3b['commands']['get']('toggleAi'),_0x66739a=new _0x1d465b(_0x475b3b['locale']);return _0x66739a['set']({'label':C(_0x475b3b['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x9ba23f,'isToggleable':!0x0}),_0x66739a['bind']('isEnabled')['to'](_0x534c60),_0x66739a['bind']('isOn')['to'](_0x534c60,'value',_0xc91052=>!!_0xc91052),this['listenTo'](_0x66739a,'execute',()=>{_0x534c60['execute']();}),_0x66739a;}}class Ha extends _0x5f3288{static get['requires'](){return[bt,Pt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Gt(_0xb28d37,_0x5e841c,_0x51078a=!0x1,_0x45237c=!0x0,_0x287659=!0x0){return()=>{const _0x18176b=_0xb28d37['locale'],_0x169f77=new _0x14ee0a(_0x18176b),_0x4d1f75=_0x169f77['bindTemplate'];_0x287659&&_0x169f77['extendTemplate']({'on':{'mouseenter':_0x4d1f75['to'](()=>{_0x169f77['focus']();})}});const _0x5a4c92=_0x5e841c['icon']??_0x5e841c['parent']?.['icon'];return _0x169f77['set']({'label':_0x5e841c['displayedPrompt'],'withText':_0x51078a,'role':'menuitem','icon':_0x45237c?_0x5a4c92??_0x32dec3:void 0x0,'tooltip':!_0x51078a,'class':'ck-ai-quick-actions-button'}),_0x169f77['on']('execute',()=>{_0xb28d37['editing']['view']['focus'](),_0xb28d37['commands']['execute']('aiQuickAction',_0x5e841c);}),_0x169f77;};}const Ls='menu',Ns='menuitem';class co extends _0x19a8c6{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x55f861,_0x50edb4,_0x2529c8,_0x3b2909){const _0x367422=_0x55f861['locale'];super(_0x367422),this['_bodyCollection']=_0x3b2909;const _0x4c92f5=this['_createListItems'](_0x55f861,_0x50edb4,_0x2529c8);this['optionsListView']=new _0x556745(_0x367422),this['optionsListView']['role']=Ls,this['optionsListView']['items']['addMany'](_0x4c92f5),this['focusTracker']=new ts(),this['keystrokes']=new _0x1f1bc5(),this['_focusables']=_0x4c92f5,this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x367422['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x471fc7,_0x140d09,_0x3486e0){const _0xa875c9=new _0xf07a6b();return _0x140d09['forEach'](_0x203b03=>{'actions'in _0x203b03?_0xa875c9['add'](this['_createActionGroupButton'](_0x471fc7,_0x203b03,_0x3486e0)):_0xa875c9['add'](this['_createActionButton'](_0x471fc7,_0x203b03));}),_0xa875c9;}['_createActionButton'](_0x43914b,_0x2ab9de){const _0x43c729=new _0x2269a3(this['locale']),_0x1dc20e=Gt(_0x43914b,_0x2ab9de,!0x0,void 0x0!==_0x2ab9de['icon'])();return _0x43c729['children']['add'](_0x1dc20e),_0x43c729;}['_createActionGroupButton'](_0x5ae9b5,_0x5e985f,_0x3312f6){const _0x3333da=new _0x2269a3(this['locale']),_0x30d18e=new _0x36e81a(this['locale']),_0x5312b2=_0x30d18e['bindTemplate'],_0x10ea4d='rtl'===_0x3312f6['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x14eba8=this['_createGroupActionsList'](_0x5ae9b5,_0x5e985f['actions'],_0x3312f6);_0x30d18e['set']({'label':_0x5e985f['label'],'withText':!0x0,'role':Ns,'icon':_0x5e985f['icon']??_0x32dec3}),_0x30d18e['extendTemplate']({'on':{'mouseenter':_0x5312b2['to'](()=>{_0x30d18e['focus']();})}});const _0x499c42=new _0x500981(this['locale']);return _0x499c42['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x5312b2['to'](_0xe4e219=>{_0xe4e219['key']==_0x10ea4d&&(_0x30d18e['focus'](),this['_hideNestedPanel'](_0x499c42));})}}),_0x30d18e['bind']('isOn')['to'](_0x499c42,'isVisible'),this['_bodyCollection']['add'](_0x499c42),_0x499c42['content']['add'](_0x14eba8),this['_setupGroupMenuBehavior'](_0x30d18e,_0x499c42),_0x3333da['children']['add'](_0x30d18e),_0x3333da;}['_createGroupActionsList'](_0x51e181,_0x349d54,_0x475b83){const _0x4303f4=new _0x556745(this['locale']);return _0x4303f4['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x349d54['forEach'](_0xb0b8f9=>{const _0x51192e=new _0x2269a3(this['locale']),_0x35e74f=Gt(_0x51e181,_0xb0b8f9,!0x0,!0x1)();_0x51192e['children']['add'](_0x35e74f),_0x475b83['focusTracker']['add'](_0x35e74f),_0x4303f4['items']['add'](_0x51192e);}),_0x4303f4;}['_setupGroupMenuBehavior'](_0x3c9aaa,_0x1e93ff){const _0x137d7b=_0x3c9aaa['bindTemplate'],_0x4798d1='rtl'===_0x3c9aaa['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x3c9aaa['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x137d7b['to'](()=>{this['_showNestedPanel'](_0x1e93ff,_0x3c9aaa);}),'mouseleave':_0x137d7b['to'](_0xd72d89=>{const _0x31b1de=_0xd72d89['relatedTarget'];this['_isMovingToNestedMenu'](_0x31b1de,_0x1e93ff)||this['_hideNestedPanel'](_0x1e93ff);}),'keydown':_0x137d7b['to'](_0x4d3f2d=>{_0x4d3f2d['key']==_0x4798d1&&(this['_showNestedPanel'](_0x1e93ff,_0x3c9aaa),_0x1e93ff['content']['get'](0x0)['focus']());})}}),_0x1e93ff['on']('render',()=>{_0x1e93ff['element']?.['addEventListener']('mouseleave',_0x8b5d4d=>{const _0x8d6caf=_0x8b5d4d['relatedTarget'];_0x3c9aaa['element']?.['contains'](_0x8d6caf)||this['_isMovingToNestedMenu'](_0x8d6caf,_0x1e93ff)||this['_hideNestedPanel'](_0x1e93ff);});});}['_showNestedPanel'](_0x33ca3e,_0x456e8a){this['_openNestedPanels']['forEach'](_0x33d15b=>{_0x33d15b!==_0x33ca3e&&_0x33d15b['isVisible']&&_0x33d15b['hide']();}),_0x33ca3e['show'](),_0x33ca3e['pin']({'positions':[_0x3e8342['eastSouth']],'target':_0x456e8a['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x33ca3e);}['_hideNestedPanel'](_0x13c036){_0x13c036['hide'](),this['_openNestedPanels']['delete'](_0x13c036);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x502e97=>_0x502e97['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0xae9f98,_0x4d4815){if(!_0xae9f98)return!0x1;if(_0x4d4815['element']?.['contains'](_0xae9f98))return!0x0;const _0x50b4b1=_0xae9f98;return _0x50b4b1['closest']&&(null!==_0x50b4b1['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x50b4b1['closest']('.ck-ai-quick-actions-group-list')||null!==_0x50b4b1['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Yt(_0x3d3123,_0x244d3e,_0x630bc8,_0x35797e){return()=>{const _0x5628c1=_0x3d3123['locale'],_0x345763=_0x10d828(_0x5628c1);_0x345763['buttonView']['set']({'icon':_0x630bc8['icon']??_0x32dec3,'label':_0x630bc8['label'],'tooltip':!0x0}),_0x345763['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x398085=new co(_0x3d3123,_0x244d3e,_0x345763,_0x35797e);return _0x345763['panelView']['children']['add'](_0x398085),_0x345763;};}const Ft='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Wt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Bt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Ot=function(_0x4f6815){return _0x4f6815['CHAT']='CHAT',_0x4f6815['ACTION']='ACTION',_0x4f6815['REVIEW']='REVIEW',_0x4f6815;}({}),Ma=function(_0x3c88a7){return _0x3c88a7['CHAT']='AIChat',_0x3c88a7['ACTION']='AIActions',_0x3c88a7['REVIEW']='AIReviewMode',_0x3c88a7;}({});class ui extends _0x5f3288{static get['requires'](){return[zt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x368928){return function(_0xc30915){const _0x2c38fa=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0xc30915['uiLanguage']),_0x12f660=_0x2c38fa||'English',_0x59f84f=[{'id':'ask-ai','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Ut},{'id':'chat-commands','label':C(_0xc30915,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Ut,'actions':[{'id':'explain','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ft['replace']('%0',_0x12f660),'type':'CHAT'},{'id':'summarize','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Wt['replace']('%0',_0x12f660),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Bt['replace']('%0',_0x12f660),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Mt},{'id':'continue','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Kt},{'id':'fix-grammar','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Rt},{'id':'adjust-length','label':C(_0xc30915,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':C(_0xc30915,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':xt,'actions':[{'id':'make-tone-casual','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Dt,'actions':[{'id':'translate-to-english','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':C(_0xc30915,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':C(_0xc30915,'AI_QUICK_ACTIONS_OTHER'),'icon':Lt,'actions':[]}];return _0x59f84f;}(_0x368928);}['_getDefaultAndCustomActions'](){const _0x3a4102=ui['getDefaultQuickActions'](this['editor']['locale']),_0x15bafe=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x156c4b=>({..._0x156c4b,'icon':void 0x0}));return _0x3a4102['find'](_0x2fbb98=>'other'===_0x2fbb98['id'])['actions']['push'](..._0x15bafe),_0x3a4102;}['_initializeQuickActionsComponentsAndCommands'](){const _0x3fbbce=new qt(this['editor']['locale']);_0x3fbbce['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x3fbbce),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x3fbbce);}['_initializeQuickActionsDropdown'](_0x42ced7){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Yt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x32dec3,'label':C(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x42ced7));}['_prepareQuickActionsDefinition'](_0x2712e1){this['_quickActionsDefinition']=_0x2712e1['map'](_0x5903f5=>{if('actions'in _0x5903f5){const _0xdb9027=_0x5903f5;return{..._0xdb9027,'actions':_0xdb9027['actions']['map'](_0x5a09aa=>{const {actions:_0x58bfc1,..._0x1a46aa}=_0xdb9027;return{..._0x5a09aa,'parent':_0x1a46aa};})['filter'](_0x48a1eb=>this['_shouldIncludeAction'](_0x48a1eb))};}return _0x5903f5;})['filter'](_0x117acc=>'actions'in _0x117acc?_0x117acc['actions']['length']>0x0:this['_shouldIncludeAction'](_0x117acc));}['_shouldIncludeAction'](_0x57d4d1){const _0xc7edb8=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ma[_0x57d4d1['type']])&&!_0xc7edb8['includes'](_0x57d4d1['id']);}['_initializeQuickActionsComponents'](_0xbf3f1d){this['_quickActionsDefinition']['forEach'](_0x5f31d1=>{if('actions'in _0x5f31d1){const _0x1febb6=Yt(this['editor'],_0x5f31d1['actions'],_0x5f31d1,_0xbf3f1d);this['editor']['ui']['componentFactory']['add'](_0x5f31d1['id'],_0x1febb6),_0x5f31d1['actions']['forEach'](_0x197537=>{const _0x293bdd=Gt(this['editor'],_0x197537);this['editor']['ui']['componentFactory']['add'](_0x197537['id'],_0x293bdd);});}else{const _0x3c4b97=Gt(this['editor'],_0x5f31d1,!0x1,!0x0,!0x1);this['editor']['ui']['componentFactory']['add'](_0x5f31d1['id'],_0x3c4b97);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x43bef9=>{const _0xdca5ee=new _0x38710d(_0x43bef9),_0x5a8456=C(_0x43bef9,'AI_QUICK_ACTIONS_HEADING');_0xdca5ee['buttonView']['set']({'label':_0x5a8456,'icon':_0x32dec3});const _0xc1d65c=new ti(_0x43bef9);_0xc1d65c['set']({'ariaLabel':_0x5a8456,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0xafd129=>{if('actions'in _0xafd129){const _0x14ef04=_0xafd129,_0xdbda4e=new _0x44e2e2(_0x43bef9,_0xdca5ee),_0xe7b6d7=new _0x38710d(_0x43bef9),_0x103682=new ti(_0x43bef9);_0xe7b6d7['buttonView']['set']({'label':_0x14ef04['label'],'icon':_0x14ef04['icon']}),_0x14ef04['actions']['forEach'](_0x4691d2=>{const _0xa82915=new _0x44e2e2(_0x43bef9,_0xe7b6d7),_0x4400d9=new _0x5b3955(_0x43bef9);_0x4400d9['set']({'label':_0x4691d2['displayedPrompt'],'icon':_0x4691d2['icon'],'role':'menuitem'}),_0x4400d9['on']('execute',()=>{this['_executeQuickAction'](_0x4691d2);}),_0x4400d9['delegate']('execute')['to'](_0xe7b6d7),_0xa82915['children']['add'](_0x4400d9),_0x103682['items']['add'](_0xa82915);}),_0xe7b6d7['panelView']['children']['add'](_0x103682),_0xdbda4e['children']['add'](_0xe7b6d7),_0xc1d65c['items']['add'](_0xdbda4e);}else{const _0x5ee48a=_0xafd129,_0x332ccc=new _0x44e2e2(_0x43bef9,_0xdca5ee),_0x3d7044=new _0x5b3955(_0x43bef9);_0x3d7044['set']({'label':_0x5ee48a['displayedPrompt'],'icon':_0x5ee48a['icon'],'role':'menuitem'}),_0x3d7044['on']('execute',()=>{this['_executeQuickAction'](_0x5ee48a);}),_0x3d7044['delegate']('execute')['to'](_0xdca5ee),_0x332ccc['children']['add'](_0x3d7044),_0xc1d65c['items']['add'](_0x332ccc);}});const _0x196128=Object['values'](Ma)['some'](_0x5bc13b=>this['editor']['plugins']['has'](_0x5bc13b));return _0xdca5ee['set']({'isEnabled':_0x196128}),_0xdca5ee['panelView']['children']['add'](_0xc1d65c),_0xdca5ee;});}['_executeQuickAction'](_0x2139f2){const _0x14f710=this['editor'];_0x14f710['editing']['view']['focus'](),_0x14f710['commands']['execute']('aiQuickAction',_0x2139f2);const _0x5ee1c8=_0x14f710['ui']['view']['menuBarView'];_0x5ee1c8&&_0x5ee1c8['close']&&_0x5ee1c8['close']();}}class Ai extends Nt{['execute'](_0x3bd511){switch(this['_expandSelectionIfCollapsed'](),_0x3bd511['type']){case Ot['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x4298c=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x29f184('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4298c});}this['_handleAIChatAction'](_0x3bd511);break;case Ot['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x284687=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x29f184('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x284687});}this['_handleAIActionsAction'](_0x3bd511);break;case Ot['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x7f7343=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x29f184('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x7f7343});}this['_handleAIReviewAction'](_0x3bd511);}}async['_handleAIChatAction'](_0x17abea){const _0x3b16fa=this['editor']['plugins']['get']('AIChat'),_0x212eee=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x17abea['id'])_0x212eee['removeSelectionFromChatContext'](),await _0x3b16fa['addSelectionToChatContext'](),_0x3b16fa['focusPromptInput']();else await _0x3b16fa['startConversation'](),_0x212eee['removeSelectionFromChatContext'](),await _0x3b16fa['addSelectionToChatContext'](),_0x3b16fa['focusPromptInput'](),await _0x3b16fa['sendMessage']({'message':_0x17abea['prompt']||_0x17abea['displayedPrompt'],'quickActionData':{'id':_0x17abea['id'],'displayedPrompt':_0x17abea['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x112163=this['editor'],_0x357f8c=_0x112163['model']['document']['selection'];if(!_0x357f8c['isCollapsed'])return;const _0x4c1492=_0x592c76(_0x357f8c['getSelectedBlocks']())||_0x112163['model']['schema']['getLimitElement'](_0x357f8c);_0x112163['model']['change'](_0x220761=>{_0x220761['setSelection'](_0x4c1492,'in');});}['_handleAIActionsActionLabel'](_0x334692){return _0x334692['parent']?.['label']&&'other'!==_0x334692['parent']?.['id']?_0x334692['parent']['label']+':\x20'+_0x334692['displayedPrompt']:_0x334692['displayedPrompt'];}async['_handleAIActionsAction'](_0x3e7f83){const _0x1e56ca=this['editor']['plugins']['get']('AIActions'),_0xde5189=_0x3e7f83['prompt']?{'userMessage':_0x3e7f83['prompt'],'model':_0x3e7f83['model']}:{'actionName':_0x3e7f83['actionName']||_0x3e7f83['id'],'args':_0x3e7f83['args']},_0x1f20bd=this['_handleAIActionsActionLabel'](_0x3e7f83);await _0x1e56ca['executeAction'](_0xde5189,_0x1f20bd,_0x3e7f83['icon']);}async['_handleAIReviewAction'](_0x548fbd){console['log']('handleAIReviewAction',_0x548fbd);}}class gi extends _0x5f3288{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x506c74=this['editor'],_0x3603a1=new Ai(this['editor']);if(_0x506c74['commands']['add']('aiQuickAction',_0x3603a1),_0x506c74['plugins']['has']('AIChat')){const _0xb1a846=this['editor']['plugins']['get']('AIChat');_0x506c74['model']['document']['selection']['on']('change:range',(_0x4acfdf,_0x1803fd)=>{_0x1803fd['directChange']&&_0xb1a846['removeSelectionFromChatContext']();});}}}class Zt extends de{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x46f31e=this['documentContextContent']['children']['map'](_0x50ea74=>({'node':_0x50ea74,'id':pt(_0x50ea74,'data-id')})),_0x434161=this['parsedMergedContent']['children']['map'](_0x4b0857=>({'node':_0x4b0857,'id':pt(_0x4b0857,'data-id')||_0x223274()})),_0x2e8125=_0x1896dd(_0x46f31e,_0x434161,{'comparator':(_0x368203,_0x1cda25)=>_0x368203['id']==_0x1cda25['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x2e8125['length']&&_0x2e8125[_0x2e8125['length']-0x1]['removed'];)_0x2e8125['pop']();}const _0x42e692=_0x2e8125['map'](_0x99b5ae=>{const _0x5f0cb8=_0x99b5ae['added']?'new':_0x99b5ae['removed']?'removed':'modified';return{'node':_0x99b5ae['value'][0x0]['node'],'type':_0x5f0cb8,'id':_0x99b5ae['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x42e692,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x558206,_0xc4d5c7){return _0xc4d5c7;}}class l extends Jt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x3eb616){super(_0x3eb616),this['content']=_0x3eb616['content'],this['version']=_0x3eb616['version'],this['actionName']=_0x3eb616['actionName'],this['args']=_0x3eb616['args'],this['userMessage']=_0x3eb616['userMessage'],this['model']=_0x3eb616['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':Xt['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x1469a6){const _0x2c9509=new Zt({'editor':this['editor'],'documentContextContent':this['content'],..._0x1469a6});return this['replies']['push'](_0x2c9509),_0x2c9509['delegate'](...Vt)['to'](this),this['fire']('replyCreated',_0x2c9509),_0x2c9509;}}class pi extends _0x5f3288{static get['requires'](){return[s,_0x10183e,c,w,_0x2b3cb3];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0xf07a6b();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0xc2f132){super(_0xc2f132),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x2d6d78,_0x4676c7,_0x51209a){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x500c83,anchorData:_0x2f4590}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x2d6d78,_0x500c83,_0x2f4590,_0x4676c7,_0x51209a);}}const {modelFragment:_0x123b00,anchorData:_0x476c54}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x2d6d78,_0x123b00,_0x476c54,_0x4676c7,_0x51209a);}['_getExecuteDataRegular'](){const _0x3e6ab0=this['editor']['model']['document']['selection'];if(_0x3e6ab0['isCollapsed']){const _0x2bbe8a=_0x592c76(_0x3e6ab0['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x3e6ab0);this['editor']['model']['change'](_0x3ada20=>{_0x3ada20['setSelection'](_0x2bbe8a,'in');});}const _0x14d706=_0x3e6ab0['getFirstRange'](),_0x4ebd2c=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x3e6ab0),_0x14d706['start'],_0x14d706['end']),_0x540fcc=_0x3e6ab0['getFirstRange']()['start'],_0x5218f8=new Map();let _0x1a5ea8=_0x4ebd2c;for(let _0xb6cb68=0x0;_0xb6cb68<_0x540fcc['path']['length'];_0xb6cb68++)_0x5218f8['set'](_0x1a5ea8,_0x540fcc['path'][_0xb6cb68]),_0x1a5ea8=_0x1a5ea8['getChild'](0x0);return{'modelFragment':_0x4ebd2c,'anchorData':_0x5218f8};}['_getExecuteDataInTable'](){const _0x336b60=this['editor']['model']['document']['selection'],_0x25f1bd=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x173a40=_0x336b60['getFirstRange']()['start']['parent']['parent'],_0x290c13=this['_wrapWithCommonAncestors'](_0x25f1bd,this['editor']['model']['createPositionBefore'](_0x173a40),this['editor']['model']['createPositionAfter'](_0x173a40)),_0x3fa390=_0x336b60['getFirstRange']()['start'],_0x5175c0=new Map();let _0x2d59e3=_0x290c13;for(let _0x51330c=0x0;_0x51330c<_0x3fa390['path']['length'];_0x51330c++)if(_0x5175c0['set'](_0x2d59e3,_0x3fa390['path'][_0x51330c]),_0x51330c<_0x3fa390['path']['length']-0x1)_0x2d59e3=_0x2d59e3['getChild'](0x0);else{let _0x20dd89=_0x2d59e3['nextSibling'];for(;_0x20dd89;)_0x5175c0['set'](_0x20dd89,_0x3fa390['path'][_0x51330c]),_0x20dd89=_0x20dd89['nextSibling'];}return{'modelFragment':_0x290c13,'anchorData':_0x5175c0};}['_executeAction'](_0x18af41,_0x14e436,_0x40d82f,_0x4cfb7f,_0x1b21c3){const _0x508654=this['editor']['plugins']['get'](c),_0x53d312=this['editor']['plugins']['get'](w),_0xb91983=this['editor']['model']['document']['selection'],_0x28b4bc=_0x508654['modelToViewWithIds'](_0x14e436),_0xb3a052=this['editor']['data']['processor']['toData'](_0x28b4bc),_0x474153=this['editor']['model']['document']['version'],_0x488fff=[..._0xb91983['getRanges']()];let _0x4c7e71=this['editor']['config']['get']('ai.availableReplyActions')||[...k];this['editor']['plugins']['has']('TrackChanges')||(_0x4c7e71=_0x4c7e71['filter'](_0x46c8d4=>'insertSuggestion'!=_0x46c8d4));const _0x1ba078=new e(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x4c7e71});return _0x53d312['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x4cfb7f,'icon':_0x1b21c3||_0x32dec3,'mainView':_0x1ba078,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x488fff}),this['_setLoadingState'](_0x1ba078,_0x53d312),this['listenTo'](_0x53d312,'applySuggestion',()=>{this['_applyChanges'](_0x14e436,_0x40d82f,!0x1);}),this['listenTo'](_0x53d312,'insertSuggestion',()=>{this['_applyChanges'](_0x14e436,_0x40d82f,!0x0);}),this['listenTo'](_0x53d312,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x53d312,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x4455d4=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x2afb9a=_0x4455d4['changeGroups'][0x0];_0x2afb9a&&'pending'===_0x2afb9a['state']&&_0x4455d4['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x53d312);}),this['_createInteraction'](_0xb3a052,_0x474153,_0x1ba078,_0x53d312,_0x18af41);}['_wrapWithCommonAncestors'](_0x2450b3,_0x2b9187,_0xafaa14){const _0x25a784=this['editor']['model']['createRange'](_0x2b9187,_0xafaa14)['getCommonAncestor'](),_0x6cfb32=_0x25a784['is']('documentFragment')?[]:_0x25a784['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x6cfb32['length']){const _0x579381=_0x6cfb32['map'](_0x542225=>_0x542225['_clone'](!0x1));for(let _0x4bca0b=0x1;_0x4bca0b<_0x579381['length'];_0x4bca0b++)_0x579381[_0x4bca0b-0x1]['_appendChild'](_0x579381[_0x4bca0b]);return _0x579381[_0x579381['length']-0x1]['_appendChild'](_0x2450b3),new _0x25eb17(_0x579381[0x0]);}return _0x2450b3;}async['_createInteraction'](_0x5cdec9,_0x46fd09,_0x47fce7,_0x1ed781,_0x2199ba){const _0x3cb234=this['editor'];this['_interactionParams']={'action':_0x2199ba,'content':_0x5cdec9,'version':_0x46fd09,'mainView':_0x47fce7,'aiBalloon':_0x1ed781};const _0x222b80=new l({'connector':this['_aiConnector'],'editor':_0x3cb234,'content':_0x5cdec9,'version':_0x46fd09,..._0x2199ba});this['_interactions']['push'](_0x222b80),_0x47fce7['hideError']();const _0x45f612=(_0x2a5fa0,_0x4084bf,_0x15f93f=!0x1,_0x195062='streaming')=>this['_promiseQueue']['enqueue'](async _0x163909=>{try{const _0x508273=y({'editor':_0x3cb234,'changeGroups':_0x2a5fa0['changeGroups'],'documentContextContent':_0x2a5fa0['documentContextContent'],'showDiff':_0x15f93f,'trimUnchanged':!0x1});await _0x4084bf['updateContent']({'parts':_0x508273,'renderingStrategy':_0x195062,'abortSignal':_0x163909});}catch(_0x1bbd34){if(this['_isAbortError'](_0x1bbd34))return;throw _0x1bbd34;}});this['_interaction']['on']('replyCreated',(_0x376cf3,_0x3eb5ab)=>{_0x47fce7['hideLoader'](),_0x45f612(_0x3eb5ab,_0x47fce7)['catch'](_0x64deac=>{this['_isAbortError'](_0x64deac)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x64deac),this['_setErrorState'](_0x222b80,_0x47fce7));});}),this['_interaction']['on']('replyContentUpdated',(_0x209e52,_0x348a65)=>{_0x45f612(_0x348a65,_0x47fce7)['catch'](_0x59d939=>{this['_isAbortError'](_0x59d939)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x59d939),this['_setErrorState'](_0x222b80,_0x47fce7));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x47fce7,_0x1ed781),this['_updateNavigationUI']();}catch(_0x31b7ca){this['_isAbortError'](_0x31b7ca)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x31b7ca),this['_setErrorState'](_0x222b80,_0x47fce7));}}),this['listenTo'](_0x47fce7,'toggleSuggestionDisplayMode',(_0x176008,{showDiff:_0xcc8155})=>{this['_balloonShowDiff']=_0xcc8155;const _0x430533=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x430533&&_0x45f612(_0x430533,_0x47fce7,_0xcc8155,'static')['catch'](_0x425fa0=>{this['_isAbortError'](_0x425fa0)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x425fa0),this['_setErrorState'](_0x222b80,_0x47fce7));});}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0xb91d7f,{reply:_0x3f99b5})=>{const _0x493bb4={'positiveCount':_0x3f99b5['changeGroups']['filter'](_0x5077bd=>'accepted'===_0x5077bd['state'])['length'],'totalCount':_0x3f99b5['changeGroups']['length']},_0x16c248=this['_interaction']['actionCallId'],_0x21cc32=this['_interaction']['actionName'];_0x21cc32?this['_aiConnector']['upsertAIActionRating'](_0x21cc32,_0x16c248,_0x493bb4):this['_aiConnector']['upsertCustomAIActionRating'](_0x16c248,_0x493bb4);}),this['_setLoadingState'](_0x47fce7,_0x1ed781);try{const _0x2bb5eb=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x2bb5eb;}catch(_0x2610ea){if(this['_isAbortError'](_0x2610ea))return;_0x47fce7['hideLoader'](),this['_setErrorState'](_0x222b80,_0x47fce7);}}['_applyChanges'](_0x3d41af,_0x3cb409,_0x58403b){const _0x5985ef=this['editor'];if(_0x58403b&&!_0x5985ef['plugins']['has']('TrackChanges'))throw new _0x29f184('ai-no-track-changes',null);const _0x56dfdb=this['editor']['plugins']['get'](_0x2b3cb3),_0x92ae5a=this['_interaction'],_0x1026cc=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x556119=_0x1026cc['changeGroups'];_0x1026cc['setChangeGroupState'](0x0,'accepted');let _0xdcec46=v({'editor':_0x5985ef,'reply':_0x1026cc,'interaction':_0x92ae5a,'groups':_0x556119,'transform':!0x1,'documentCompare':_0x56dfdb,'documentCompareOptions':{'anchor':_0x5985ef['model']['createPositionAt'](_0x3d41af,0x0),'markDeletions':_0x58403b}});_0xdcec46=this['_filterOperationsOutsideRange'](_0xdcec46,_0x3cb409);for(const _0x4d0218 of _0xdcec46)this['_anchorOperation'](_0x3cb409,_0x4d0218,_0x5985ef['model']['document']['getRoot']());const _0x43fea1=_0x92ae5a['getDocumentContext']()['version'],_0x267abc=_0x5985ef['model']['document']['history']['getOperations'](_0x43fea1),_0x121acf={'document':_0x5985ef['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4567fd=_0x33bff0(_0xdcec46,_0x267abc,_0x121acf)['operationsA'];_0x5985ef['model']['change'](_0x285647=>{if(_0x285647['setSelection'](_0x5985ef['model']['document']['selection']['focus']),_0x58403b)_0x5985ef['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4567fd);else{for(const _0x472181 of _0x4567fd)_0x472181['baseVersion']=_0x5985ef['model']['document']['version'],b(_0x5985ef,_0x472181),_0x285647['batch']['addOperation'](_0x472181),_0x5985ef['model']['applyOperation'](_0x472181);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x32019f,_0x589ab0){return _0x32019f['filter'](_0x220c4f=>{if('rename'==_0x220c4f['type']){const _0x3a09df=_0x220c4f['position']['nodeAfter'];return!_0x589ab0['has'](_0x3a09df);}if(_0x220c4f['type']['indexOf']('Attribute')>-0x1){const _0x1ae608=_0x220c4f['range']['start']['nodeAfter'];return!_0x589ab0['has'](_0x1ae608);}return!0x0;});}['_anchorOperation'](_0x16841c,_0x58f242,_0x3851b2){const _0x2f5837=_0x58f242['clone']();for(const _0x2badb6 in _0x58f242){const _0x35a664=_0x58f242[_0x2badb6];_0x35a664 instanceof _0x59485f?_0x58f242[_0x2badb6]=new _0x59485f(_0x333021(_0x35a664['start']),_0x333021(_0x35a664['end'])):_0x35a664 instanceof _0x58772b&&(_0x58f242[_0x2badb6]=_0x333021(_0x35a664));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x2f5837['type'])){if(_0x2f5837['isDocumentOperation']=!0x1,_0x2f5837['baseVersion']=null,'remove'==_0x2f5837['type']){const _0x4d4cb7=_0x2f5837['sourcePosition'],_0x4dc4c4=_0x2f5837['howMany'];new _0x1609ec(_0x4d4cb7,_0x4dc4c4)['_execute']();}else _0x2f5837['_execute']();}function _0x333021(_0x247a2c){if('$graveyard'==_0x247a2c['root']['rootName'])return _0x247a2c;const _0x4477af=[];let _0x97c14=_0x247a2c['root'];for(let _0x5ead60=0x0;_0x5ead60<_0x247a2c['path']['length'];_0x5ead60++){const _0x4ee36c=_0x16841c['get'](_0x97c14)||0x0;_0x4477af[_0x5ead60]=_0x247a2c['path'][_0x5ead60]+_0x4ee36c,_0x97c14=_0x97c14['getChildAtOffset'](_0x247a2c['path'][_0x5ead60]);}return new _0x58772b(_0x3851b2,_0x4477af,_0x247a2c['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x5972cc,content:_0x558bf6,version:_0x5eb322,mainView:_0x4f20a3,aiBalloon:_0x12e1b8}=this['_interactionParams'];_0x4f20a3['areChangesVisible']=!0x1,_0x4f20a3['hideError'](),this['_clearErrorState'](_0x4f20a3,_0x12e1b8);const _0x590482=_0x4f20a3;_0x590482['miniToolbarView']&&_0x590482['miniToolbarView']['showChangesButton']&&_0x590482['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x490482}),this['_clearSuggestionContent'](_0x4f20a3),_0x4f20a3['showLoader'](),this['_updateNavigationUI'](),this['_createInteraction'](_0x558bf6,_0x5eb322,_0x4f20a3,_0x12e1b8,_0x5972cc)['catch'](_0x302ae6=>{this['_isAbortError'](_0x302ae6)||console['error']('Error\x20refreshing\x20interaction:',_0x302ae6);});}['_clearSuggestionContent'](_0x4ac120){const _0x3756c0=_0x4ac120['bodyView']['_children'];for(;_0x3756c0['length']>0x0;)_0x3756c0['remove'](_0x3756c0['first']);_0x4ac120['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x3484ff){return!!_0x3484ff['message']&&_0x3484ff['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0x2b40e5=new _0x14ee0a(this['editor']['locale']),_0x2fc2b1=new _0x14ee0a(this['editor']['locale']),_0x292fe2=new _0x19a8c6(this['editor']['locale']),_0x104381=new _0x14ee0a(this['editor']['locale']);_0x2b40e5['set']({'icon':_0x395185,'label':C(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x2fc2b1['set']({'icon':_0x25d049,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x292fe2['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x104381['set']({'icon':_0x346a5d,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x2b40e5['bind']('isEnabled')['to'](this,'isBusy',_0x462f79=>!_0x462f79),_0x2b40e5['on']('execute',()=>{this['_refreshInteraction']();}),_0x2fc2b1['bind']('isEnabled')['to'](this,'isBusy',_0x353aa1=>!_0x353aa1),_0x2fc2b1['on']('execute',()=>{this['_navigateToPrevious']();}),_0x104381['bind']('isEnabled')['to'](this,'isBusy',_0x53912f=>!_0x53912f),_0x104381['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x2fc2b1,this['_navigationCounter']=_0x292fe2,this['_navigationNextButton']=_0x104381,this['_customViews']['add'](_0x2b40e5);}['_navigateToPrevious'](){const _0x1959c8=this['_interactions']['length'];this['_currentInteractionIndex']<_0x1959c8-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x2e9038){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x2e9038;const {mainView:_0x218e80}=this['_interactionParams'],_0x3bbdb3=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3bbdb3)return;if(_0x3bbdb3['hasError'])return this['_setErrorState'](_0x3bbdb3,_0x218e80),void this['_updateNavigationUI']();if(!_0x3bbdb3['replies']['length'])return;_0x218e80['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x218e80,this['_interactionParams']['aiBalloon']);const _0x1ddb3c=_0x3bbdb3['replies'][_0x3bbdb3['replies']['length']-0x1];if(_0x1ddb3c){const _0x24055a=this['editor'];this['_clearSuggestionContent'](_0x218e80);try{const _0x6d3dab=y({'editor':_0x24055a,'changeGroups':_0x1ddb3c['changeGroups'],'documentContextContent':_0x1ddb3c['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x218e80),await new Promise(_0x5872d0=>setTimeout(_0x5872d0,0x32)),await _0x218e80['updateContent']({'parts':_0x6d3dab,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x9c0346){this['_isAbortError'](_0x9c0346)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x9c0346);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x54da31=this['_interactions']['length'],_0x282e97=_0x54da31>0x1,_0x57cd15=this['_interactionParams']?.['mainView'];if(_0x282e97){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x57cd15?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x57cd15?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x57cd15?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x371e62=_0x54da31-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x371e62+'/'+_0x54da31),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x54da31-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x57cd15?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x57cd15?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x57cd15?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x3224f2,_0xca019b){_0x3224f2['setLoading'](),_0xca019b['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x919333,_0x5b92e2){const _0x1530a7=C(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x5b92e2['showError'](_0x1530a7),_0x919333['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x5b92e2['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x14201c,_0x3e900e){_0x14201c['clearErrorState'](),_0x3e900e['balloonView']['toolbar']&&(_0x3e900e['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x2579bd,_0x2169be){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x2579bd['clearLoading'](),_0x2169be['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x2216a4=>{'isEnabled'in _0x2216a4&&(_0x2216a4['isEnabled']=!0x1);});}}class Ua extends _0x5f3288{static get['requires'](){return[ui,gi,pi];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x264528){super(_0x264528),_0x264528['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class xs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x85a8ff,title:_0x13d2d3,description:_0x5e5aa3,isParameterized:_0x46d633,useArgs:_0x5ba465,options:_0x3de931}){this['id']=_0x85a8ff,this['title']=_0x13d2d3,this['description']=_0x5e5aa3,this['isParameterized']=_0x46d633,this['useArgs']=_0x5ba465,this['options']=_0x3de931;}}class kr extends xs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x26db74){this['_models']=_0x26db74;}}class wi extends _0x4572ab(){['_checks'];constructor(_0x3aef3c){super(),this['_checks']=this['_mapCheckDefinitions'](_0x3aef3c);}get['checks'](){return this['_checks'];}['getCheckById'](_0xbf80eb){return this['checks']['find'](_0x1db580=>_0x1db580['id']===_0xbf80eb);}['_mapCheckDefinitions'](_0x2f1385){return _0x2f1385['map'](_0x44abde=>'custom'===_0x44abde['id']?new kr(_0x44abde):new xs(_0x44abde));}}class Rs extends _0x135bec(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x1f7c08,contentNew:_0x21004d,contentInitial:_0x26d93b,documentVersion:_0x3ff5f2}){super(),this['id']=_0x1f7c08,this['contentNew']=_0x21004d,this['contentInitial']=_0x26d93b,this['documentVersion']=_0x3ff5f2;}}class js extends _0x4572ab(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x45a090,_0x5b15a3,_0x3d70cb){super(),this['id']=_0x45a090,this['parent']=_0x3d70cb,this['_data']=_0x5b15a3,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class Ts extends _0x4572ab(){['id']=_0x223274();['callId'];['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x335a20,_0x3e43c6,_0x36212c,_0x2c8549,_0x5ab266){super(),this['_documentData']=_0x335a20,this['_sourceCheck']=_0x3e43c6,this['_aiConnector']=_0x36212c,this['_reviewParams']=_0x2c8549,this['_reviewArgs']=_0x5ab266,this['on']('change:status',(_0x384024,_0x5b7d81,_0x487872)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x487872,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0x4c564c=>'pending'===_0x4c564c['status']);}get['currentError'](){return this['_currentError'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x537f1c=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x3fb3ca of _0x537f1c)'unmodified'!==_0x3fb3ca['data']['operation']&&('error'!==_0x3fb3ca['data']['operation']?'review-metadata'!==_0x3fb3ca['event']?this['_addReviewCheckResult'](_0x3fb3ca['data']['dataId'],_0x3fb3ca['data']['textDelta']):this['callId']=_0x3fb3ca['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0xf574d8){this['_currentError']=_0xf574d8,_0xf574d8 instanceof Error&&_0xf574d8['message']['includes']('ai-request-aborted')?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async['restart'](){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,await this['start']();}['addResultChanges'](_0x29c197,_0x2731f0){const _0x1b570b=this['_results']['get'](_0x29c197);if(!_0x1b570b)return;const _0x602686=[];_0x2731f0['forEach']((_0x37082a,_0x43424f)=>{const _0x1e7fff=new js(_0x1b570b['id']+'-'+_0x43424f,_0x37082a,_0x1b570b);_0x1e7fff['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x1e7fff,'status':_0x1e7fff['status']});}),_0x1e7fff['on']('change:isActivated',()=>{_0x1e7fff['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1e7fff}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1e7fff});}),this['_changes']['push'](_0x1e7fff),_0x602686['push'](_0x1e7fff);}),this['fire']('reviewCheckResultReady',{'changes':_0x602686,'result':_0x1b570b,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x3f89da){const _0x285774=this['_changes']['find'](_0x574be8=>_0x574be8['id']===_0x3f89da);return!(!_0x285774||'pending'!==_0x285774['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x42eca3=>'pending'===_0x42eca3['status']);}['markAllChangesAsAccepted'](){for(const _0x8a6799 of this['_changes'])'pending'===_0x8a6799['status']&&(_0x8a6799['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x48b8e1){const _0x3b796b=this['_changes']['find'](_0x1e44ee=>_0x1e44ee['id']===_0x48b8e1);_0x3b796b&&'pending'===_0x3b796b['status']&&(_0x3b796b['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x3e6ad1){const _0x232bfb=this['_changes']['find'](_0x339389=>_0x339389['id']===_0x3e6ad1);_0x232bfb&&'pending'===_0x232bfb['status']&&(_0x232bfb['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x2a817a){const _0x4e1bc8=this['_changes']['find'](_0xd5a8b2=>_0xd5a8b2['id']===_0x2a817a);_0x4e1bc8&&'pending'===_0x4e1bc8['status']&&(_0x4e1bc8['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x2dc900){const _0x27e61c=this['_changes']['find'](_0x30b6fb=>_0x30b6fb['id']===_0x2dc900);_0x27e61c&&'outdated'===_0x27e61c['status']&&(_0x27e61c['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x53365d){this['_changes']['filter'](_0x59d42c=>_0x59d42c['isActivated']&&_0x59d42c['id']!==_0x53365d)['forEach'](_0x1c13ca=>{_0x1c13ca['isActivated']=!0x1;});const _0x1c2d2e=this['_changes']['find'](_0x599cd5=>_0x599cd5['id']===_0x53365d);_0x1c2d2e&&'pending'===_0x1c2d2e['status']&&(_0x1c2d2e['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x10e4a8=>_0x10e4a8['isActivated'])['forEach'](_0x908062=>{_0x908062['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x343733){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x49b2eb;if(_0x343733){const _0xddaa12=this['_changes']['find'](_0x51f00d=>_0x51f00d['id']===_0x343733);if(_0xddaa12&&_0xddaa12['isRated'])return;_0xddaa12&&(_0x49b2eb=_0xddaa12['parent']['id'],_0xddaa12['isRated']=!0x0);}const _0x3b675b={'positiveCount':this['_changes']['filter'](_0x1ee9ab=>'accepted'===_0x1ee9ab['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x3b675b,this['callId'],_0x49b2eb);}['_addReviewCheckResult'](_0x154fb5,_0xf69893){const _0x5d08a3=this['_documentData']['elements']['get'](_0x154fb5);if(!_0x5d08a3)return;const _0x2cc480=_0x5d08a3['getContent']();if(_0x2cc480===_0xf69893)return;const _0x5de76b=new Rs({'id':_0x154fb5,'contentInitial':_0x2cc480,'contentNew':_0xf69893,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x5de76b['id'],_0x5de76b),this['fire']('reviewCheckResultAdded',{'result':_0x5de76b,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x24d1aa=>'pending'===_0x24d1aa['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x53fda9=>'pending'===_0x53fda9['status'])['length']&&(this['status']='finished'));}}class vi extends Ts{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x2e26f0=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x670e57=0x0;_0x670e57<this['_reviewParams']['length'];_0x670e57++){if(!this['_reviewParams'][_0x670e57]||!this['_sourceCheck']['options'][_0x670e57])continue;const _0x220b3c=this['_sourceCheck']['options'][_0x670e57],_0x4d0cca=_0x220b3c['data']?.['find'](_0x123557=>_0x123557['id']===this['_reviewParams'][_0x670e57]);_0x4d0cca&&_0x2e26f0['push'](_0x4d0cca['label']);}return _0x2e26f0['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x273852,_0x3ca7f2,_0x599c7){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x3ca7f2,_0x273852,_0x599c7);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class fi extends Ts{['_prompt'];['_model'];constructor(_0x112dc2,_0x461219,_0x9578cd,_0x3c3a86,_0x18b940){super(_0x9578cd,_0x3c3a86,_0x18b940),this['_prompt']=_0x112dc2,this['_model']=_0x461219;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x5c2866,_0x548223,_0x44b512){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x548223,_0x5c2866,_0x44b512);}}const Ri=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class ee extends _0x171820{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[s];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x2bb262=this['context']['config']['get']('ai.reviewMode.translations');if(_0x2bb262){for(const _0x3c6549 of Ri)'translate'===_0x3c6549['id']&&(_0x3c6549['options'][0x0]['data']=_0x2bb262);}const _0x45f180=this['_translateReviewChecks'](Ri);this['_aiReviewCheckList']=new wi(_0x45f180);const _0x5b1b0b=this['_aiReviewCheckList']['checks']['find'](_0x47f2ea=>'custom'===_0x47f2ea['id']);if(_0x5b1b0b){const _0x455c56=await new ki({'connector':this['_aiConnector']})['getAll']();_0x5b1b0b['models']=_0x455c56['map'](_0xff4629=>({..._0xff4629,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0xff4629['id']['toUpperCase'](),_0xff4629['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x150574,_0x10ec78)=>{const _0x37252b=this['_aiReviewCheckList']['getCheckById'](_0x10ec78['id']);if(_0x37252b){this['_onDiffChange'](this['_isDiffOn']),_0x10ec78['isCustom']?this['_currentReviewCheckRun']=new fi(_0x10ec78['args']['prompt'],_0x10ec78['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x37252b,this['_aiConnector']):this['_currentReviewCheckRun']=new vi(this['_aiReviewModeEditing']['getDocumentData'](),_0x37252b,this['_aiConnector'],_0x10ec78['params'],_0x10ec78['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x56db6e,_0x215a99)=>{'data'===_0x215a99['status']||'loading'===_0x215a99['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x215a99)):'finished'===_0x215a99['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x215a99['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x215a99['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x215a99['status']?(this['_aiReviewModeUi']['showGeneralErrorView'](),this['_logError'](new _0x29f184('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x215a99['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x29f184('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x215a99['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x215a99['status']&&'error-chunk'!==_0x215a99['status']&&'error-general'!==_0x215a99['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x1ea6fb,_0x20743d)=>{if(!this['_currentReviewCheckRun'])throw new _0x29f184('ai-review-mode-no-current-check-run',this);const _0x13a1fa=this['_aiReviewModeEditing']['diffContent'](_0x20743d['result']['contentInitial'],_0x20743d['result']['contentNew']);_0x20743d['source']['addResultChanges'](_0x20743d['result']['id'],_0x13a1fa);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x2683dc,_0x473be8)=>{for(const _0x1f36ad of _0x473be8['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x1f36ad);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x473be8['changes'],_0x473be8['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x83f6ee,_0x5a642a)=>{this['_aiReviewModeUi']['updateChangeState'](_0x5a642a['change']['id'],_0x5a642a['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x18c675,_0x7a2bf1)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x7a2bf1['change']['id']);const _0x58e5b8=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x7a2bf1['change']['id']);if(_0x58e5b8){if('content'===this['_changeActivationSource']){const _0x45a90f=this['_aiReviewModeUi']['getChangeElement'](_0x7a2bf1['change']['id']);_0x45a90f&&_0x38bec5(_0x45a90f['closest']('.ck-ai-review-mode__check-run-result')||_0x45a90f);}else{if('panel'===this['_changeActivationSource']){const _0x3b1b1a={'target':_0x58e5b8['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x2992c3(_0x3b1b1a);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x7a2bf1['change'],_0x58e5b8['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x5eb9ca){_0x5eb9ca instanceof Error&&_0x5eb9ca['message']['includes']('ai-request-aborted')||(_0x5eb9ca instanceof _0x29f184?this['_logError'](_0x5eb9ca):this['_logError'](new _0x29f184('ai-review-mode-check-run-failed',this,{'error':_0x5eb9ca})));}}else this['_logError'](new _0x29f184('ai-review-mode-source-check-not-found',this,{'checkId':_0x10ec78['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x4472e8=this['_currentReviewCheckRun']['getActiveChanges']();_0x4472e8['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x4472e8['map'](_0x196bf1=>_0x196bf1['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x59fd06,_0x2ed67e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x2ed67e['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x2ed67e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x2ed67e['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x2ed67e['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x1eff32,_0x86ed24)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x86ed24['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x86ed24['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x86ed24['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x86ed24['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x211d70,_0x27f829)=>{this['_isDiffOn']=_0x27f829['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x42fd02,_0x59d63c)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x59d63c['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0xfb272e,_0x2a5c1e)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2a5c1e['changeId']));}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x510be4,_0x4d8d55)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4d8d55['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x90521d,_0x6d3c22)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x6d3c22['changeId']);});}['_onReviewModeRunLeave'](_0x2d949a=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x2d949a&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x267311=this['_aiReviewModeEditing']['getEditor']();_0x267311&&_0x267311['editing']['view']['change'](_0x26dc76=>{const _0x42e4a2=_0x267311['editing']['view']['document']['getRoot']();_0x26dc76['removeClass']('ck-ai-review-mode-diff',_0x42e4a2),_0x26dc76['removeClass']('ck-ai-review-mode-highlights',_0x42e4a2);});}['_onDiffChange'](_0x598ee0){const _0x52f083=this['_aiReviewModeEditing']['getEditor']();_0x598ee0?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x52f083&&_0x52f083['editing']['view']['change'](_0x5a1d1d=>{const _0x23aad0=_0x52f083['editing']['view']['document']['getRoot']();_0x5a1d1d['removeClass']('ck-ai-review-mode-diff',_0x23aad0),_0x5a1d1d['removeClass']('ck-ai-review-mode-highlights',_0x23aad0),_0x5a1d1d['addClass'](_0x598ee0?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x23aad0);});}['_translateReviewChecks'](_0x4fed63){return _0x4fed63['map'](_0x1911c0=>{const _0x373823='AI_REVIEW_CHECK_'+_0x1911c0['id']['toUpperCase']()['replaceAll']('-','_'),_0x59dea6={..._0x1911c0,'title':this['_getTranslationWithDefault'](_0x373823+'_TITLE',_0x1911c0['title']),'description':this['_getTranslationWithDefault'](_0x373823+'_DESCRIPTION',_0x1911c0['description'])};return _0x1911c0['options']&&(_0x59dea6['options']=_0x1911c0['options']['map'](_0x24d216=>({..._0x24d216,'label':this['_getTranslationWithDefault'](_0x373823+'_OPTIONS_LABEL',_0x24d216['label']||''),'data':_0x24d216['data']?_0x24d216['data']['map'](_0x4a9c80=>({..._0x4a9c80,'label':this['_getTranslationWithDefault'](_0x373823+'_OPTIONS_DATA_'+_0x4a9c80['id']['toUpperCase'](),_0x4a9c80['label'])})):void 0x0}))),_0x59dea6;});}['_getTranslationWithDefault'](_0x444cad,_0x208711){const _0x20a859=C(this['context']['locale'],_0x444cad);return _0x20a859===_0x444cad?_0x208711:_0x20a859;}['_logError'](_0x40dc39){ot(_0x40dc39['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x19a8c6{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x1957f5,_0x4d4f15){super(_0x1957f5),this['_defaultValue']=_0x4d4f15['default']||(_0x4d4f15['data']['length']>0x0?_0x4d4f15['data'][0x0]['id']:''),this['_defaultLabel']=_0x4d4f15['data']['find'](_0x218c2a=>_0x218c2a['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x10d828(this['locale']);const _0x1c816e=this['_prepareListOptions'](_0x4d4f15['data']);_0x21ea2c(this['_dropdownView'],_0x1c816e,{'role':'menu','ariaLabel':_0x4d4f15['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2a28f2=>{_0x2a28f2['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x2b84e0=>{this['formValue']=_0x2b84e0['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x2b84e0['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x32bdcc=[]){const _0x305a92=new _0x5d69ef();this['resetToDefault']();for(const _0x3a0b95 of _0x32bdcc){const _0x3e723f=new _0x3cd526({'label':_0x3a0b95['label'],'withText':!0x0,'role':'menuitemradio','id':_0x3a0b95['id'],'model':_0x3a0b95});_0x3e723f['bind']('isOn')['to'](this,'formValue',_0x4af85d=>_0x4af85d===_0x3e723f['id']);const _0x1690ab={'type':'button','model':_0x3e723f};_0x305a92['add'](_0x1690ab);}return _0x305a92;}}class Ys extends _0x2269a3{['_formItem']=null;constructor(_0x5c99db,_0x117b00,_0x564f79){super(_0x5c99db),this['argsKey']=_0x117b00?.['argsKey'];if('dropdown'===_0x117b00['formType'])this['_formItem']=new Mr(this['locale'],_0x117b00);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x21abb0=new _0x222658(this['locale'],{'children':[this['_formItem']],'class':[_0x564f79?'ck-form__row_with-submit':'']});_0x564f79&&_0x21abb0['children']['add'](_0x564f79),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x21abb0]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Hs extends _0xf80c43{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x5a9009){super(_0x5a9009),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x1f1bc5(),this['minRows']=Hs['MIN_ROWS'],this['maxRows']=Hs['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class Zs extends _0x19a8c6{['focusTracker']=new ts();['keystrokes']=new _0x1f1bc5();['focusCycler'];['_focusables']=new _0xf07a6b();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x3634d2,_0x1da501){super(_0x3634d2),this['_check']=_0x1da501,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x1da501['models']&&_0x1da501['models']['length']>0x0?_0x1da501['models'][0x0]['id']:'',this['_defaultLabel']=_0x1da501['models']&&_0x1da501['models']['length']>0x0?_0x1da501['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x5cba56(this['locale'],()=>new Hs(_0x3634d2)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x5d69ef(),this['_setModelList'](),_0x21ea2c(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x222658(this['locale'],{'children':[this['promptInputView']]}),new _0x222658(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x51af3d,_0xdecc87)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0xdecc87()):_0xdecc87();}),this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x15597b=>{this['_focusables']['add'](_0x15597b),this['focusTracker']['add'](_0x15597b['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x307bed of this['_getFormValidators']()){const _0x541176=_0x307bed();if(_0x541176)return this['promptInputView']['errorText']=_0x541176,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return C(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x3a1c77=new _0x14ee0a(this['locale']),t=this['locale']['t'];return _0x3a1c77['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3a1c77['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x3a1c77;}['_createCancelButtonView'](){const _0x5c7f21=new _0x14ee0a(this['locale']),t=this['locale']['t'];return _0x5c7f21['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x5c7f21['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x28795e=>{_0x28795e['stopPropagation']();})}}),_0x5c7f21['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x5c7f21;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x458763=this['_check']['models'];if(this['resetToDefault'](),_0x458763?.['length']){const _0x4e3df8=ki['getLocalized'](this['locale'],_0x458763);for(const _0x34e520 of _0x4e3df8){const _0x4e1f36=new _0x3cd526({'label':_0x34e520['name'],'withText':!0x0,'role':'menuitemradio','id':_0x34e520['id'],'model':_0x34e520});_0x4e1f36['bind']('isOn')['to'](this,'modelId',_0x365199=>_0x365199===_0x34e520['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4e1f36,'labelView':new Ws(this['locale'],_0x34e520)});}}}['_createModelSelectionDropdown'](){const _0x44b6e0=_0x10d828(this['locale']);return _0x44b6e0['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x44b6e0['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x44b6e0,'execute',_0x28c15d=>{this['modelId']=_0x28c15d['source']['model']['id'],_0x44b6e0['buttonView']['label']=_0x28c15d['source']['label'];}),_0x44b6e0;}['_createActionsFooterView'](){const _0x2093af=new _0x19a8c6(this['locale']);return _0x2093af['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x2093af;}}class Ws extends _0x53816d{constructor(_0x5321cd,_0x36351e){super();const _0x2b165b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2b165b['to']('style'),'id':_0x2b165b['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x2b165b['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x36351e['description']||'']}]}]});}}class Gs extends _0x2269a3{['_formItemsCollection']=new _0xf07a6b();['_customCheckView']=null;constructor(_0x5c8c50,_0x1ca9d6,_0x4d72f2){super(_0x5c8c50),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1ca9d6['isParameterized']);const _0x1a9fb2=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x21d58f=>_0x21d58f),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x13de4b=>_0x13de4b)],'style':{'--ck-ai-review-check-list-item-index':_0x4d72f2}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x1ca9d6['title']}]},_0x1a9fb2]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x1ca9d6['description']}]}]}]},..._0x1ca9d6['isParameterized']?[this['_createParameterizedView'](_0x1ca9d6)]:[],...'custom'===_0x1ca9d6['id']?[this['_createCustomView'](_0x1ca9d6)]:[]]}),this['on']('click',()=>{_0x1ca9d6['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1ca9d6['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x29a34e({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x1f5d89=>{_0x1f5d89['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x4fb93d=new _0x50b9df();return _0x4fb93d['content']=_0x3ced14,_0x4fb93d['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x4fb93d;}['_createParameterizedView'](_0xc8e62c){const _0x53934e=new _0x19a8c6(),_0x24a2ea=this['_createFormView'](_0xc8e62c);return _0x53934e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x28f1b4=>!_0x28f1b4)]},'children':[_0x24a2ea]}),_0x53934e;}['_createFormView'](_0x347453){const _0x4e937e=new _0x19a8c6(),_0x6f4ab4=Array['isArray'](_0x347453['options'])?_0x347453['options']:[],_0x124f86=new _0x14ee0a(this['locale']),t=this['locale']['t'];_0x124f86['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x124f86['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x512a48=>{_0x512a48['stopPropagation']();})}}),_0x124f86['on']('execute',()=>{const _0x4c6a99=[],_0x1dd57b={};this['_formItemsCollection']['forEach'](_0x299b56=>{_0x4c6a99['push'](_0x299b56['value']),_0x347453['useArgs']&&_0x347453['options']&&(_0x1dd57b[_0x299b56['argsKey']]=_0x299b56['value']);}),this['fire']('runReviewCheck',{'id':_0x347453['id'],'params':_0x4c6a99['length']?_0x4c6a99:void 0x0,'args':Object['keys'](_0x1dd57b)['length']?_0x1dd57b:void 0x0});});const _0x57ca49=_0x6f4ab4['length'];return _0x6f4ab4['forEach']((_0x567fca,_0x6ffebc)=>{const _0x14c232=_0x6ffebc===_0x57ca49-0x1;this['_formItemsCollection']['add'](new Ys(this['locale'],_0x567fca,_0x14c232?_0x124f86:null));}),_0x4e937e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x4e937e;}['_createCustomView'](_0x496f8d){return this['_customCheckView']=new Zs(this['locale'],_0x496f8d),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0xe979d5=>!_0xe979d5)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x286c9a,_0x36e099,_0x4fbf54)=>{_0x4fbf54||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class $s extends _0x2269a3{['_checkViews'];constructor(_0x4382d8){super(_0x4382d8),this['_checkViews']=new _0xf07a6b();const _0x4efbca=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x4efbca['if']('isVisible','ck-hidden',_0x474e3b=>!_0x474e3b)]},'children':this['_checkViews']});}['setChecks'](_0x569016){this['_checkViews']['clear']();for(const [_0x5cbfbc,_0x18f28a]of _0x569016['entries']()){const _0x1d29a4=new Gs(this['locale'],_0x18f28a,_0x5cbfbc);_0x1d29a4['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x1d29a4);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x1158ae of this['_checkViews'])_0x1158ae instanceof Gs&&_0x1158ae['resetToDefault']();}}class Bs extends _0x19a8c6{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0x1b4678,_0x2369c9){super(_0x1b4678),this['id']=_0x2369c9,this['set']('status','pending'),this['set']('changeId',_0x2369c9),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['statusButtonView']=this['_createStatusButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['statusButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x2369c9,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4869fb=new _0x19a8c6(this['locale']);return _0x4869fb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x5220b0=>!_0x5220b0)]}}),_0x4869fb;}['_createAcceptButtonView'](){const _0x3118c6=new _0x14ee0a(this['locale']);return _0x3118c6['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x3118c6['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xc55a8c=>{this['fire']('acceptChange',{'id':this['changeId']}),_0xc55a8c['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x354536=>'pending'!==_0x354536)]}}),_0x3118c6;}['_createDismissButtonView'](){const _0x111c98=new _0x14ee0a(this['locale']);return _0x111c98['set']({'label':C(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x111c98['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5473a8=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x5473a8['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x825054=>'pending'!==_0x825054)]}}),_0x111c98;}['_createInfoButtonView'](){const _0x2c2625=new _0x14ee0a(this['locale']);return _0x2c2625['set']({'label':C(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x136575,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x2c2625['bind']('isOn')['to'](this,'isInfoToggleOn',_0x1464be=>_0x1464be),_0x2c2625['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x2c2625;}['_createStatusButtonView'](){const _0x4d1b2d=new _0x14ee0a(this['locale']);return _0x4d1b2d['set']({'withText':!0x0,'isEnabled':!0x1}),_0x4d1b2d['bind']('label')['to'](this,'status',_0x1e1d80=>C(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x1e1d80['toUpperCase']())),_0x4d1b2d['bind']('icon')['to'](this,'status',_0x2788ae=>'ACCEPTED'===_0x2788ae['toUpperCase']()?_0x547952:'REJECTED'===_0x2788ae['toUpperCase']()?_0x510307:_0x50e8a9),_0x4d1b2d['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x2833dd=>'pending'===_0x2833dd)],'disabled':'disabled'}}),_0x4d1b2d;}}class Js extends _0x14ee0a{constructor(_0x2b0dd8){super(_0x2b0dd8),this['set']({'label':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class sh extends _0x2269a3{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x5bb03c){super(_0x5bb03c),this['_resultViews']=new _0xf07a6b(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Vi(_0x5bb03c),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x29c60c=this['_createCombinedSkeletonLoader'](),_0x39493d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x39493d['if']('isVisible','ck-hidden',_0x58cdab=>!_0x58cdab)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2271df=>_0x2271df)]},'children':this['_resultViews']},_0x29c60c]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x355f59){const _0x28f823=new Bs(this['locale'],_0x355f59['id']);_0x28f823['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x28f823),_0x28f823['resultResponseView']['element']['innerHTML']=_0x355f59['contentDiffed'];}['hideResult'](_0x19323b,_0x59a7e1){if('pending'===_0x59a7e1)return;const _0x2b4fe8=this['_resultViews']['find'](_0x43fa32=>_0x43fa32['id']===_0x19323b);_0x2b4fe8&&(_0x2b4fe8['status']=_0x59a7e1,_0x2b4fe8['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0xb120ea,_0x5af33e){if('pending'!==_0x5af33e)return;const _0x5d6b1c=this['_resultViews']['find'](_0x31d1a1=>_0x31d1a1['id']===_0xb120ea);_0x5d6b1c&&(_0x5d6b1c['status']=_0x5af33e,_0x5d6b1c['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x556ae3,_0x2e7954){this['headerTitle']=_0x556ae3,this['headerSubtitle']=_0x2e7954||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new je(this['locale'],Ce['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x20ef48=new _0x19a8c6(this['locale']),_0x1ec749=[];for(let _0x4c0ebe=0x0;_0x4c0ebe<0x10;_0x4c0ebe++){const _0x11948a=this['_createSkeletonLoader']();_0x11948a['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x1ec749['push'](_0x11948a);}return _0x20ef48['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x15158f=>!_0x15158f)]},'children':_0x1ec749}),_0x20ef48;}['_createErrorView'](){const _0x298eb5=new _0x19a8c6(this['locale']),_0x1be1eb=new _0x14ee0a(this['locale']),t=this['locale']['t'];return _0x298eb5['delegate']('retryReview')['to'](this),_0x1be1eb['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x1be1eb['on']('execute',()=>{this['fire']('retryReview');}),_0x298eb5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x3e688a=>!_0x3e688a),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x466d46=>'chunk'===_0x466d46)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x34ca7b=>'chunk'===_0x34ca7b)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x125b6c=>'general'!==_0x125b6c)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1f6b73=>'chunk'!==_0x1f6b73)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x1be1eb]}),_0x298eb5;}['_createCancelButtonView'](){const _0x4d9875=new _0x14ee0a(this['locale']);return _0x4d9875['set']({'label':C(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x4c89d2}),_0x4d9875['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0xcd5b89=>_0xcd5b89),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x37afaa=>_0x37afaa)]}}),_0x4d9875['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x4d9875;}['_createToggleDiffButtonView'](){const _0x39638e=new _0x14ee0a(this['locale']);_0x39638e['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x39638e['bind']('isEnabled')['to'](this,'isError',_0x58d859=>!_0x58d859),_0x39638e['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xb3824d=>!_0xb3824d),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x439593=>_0x439593)]}});const _0x32bbcd=C(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x166eda=C(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x39638e['bind']('isOn')['to'](this,'isToggleDiffOn',_0x314603=>_0x314603),_0x39638e['bind']('icon')['to'](this,'isToggleDiffOn',_0x1a6c55=>_0x1a6c55?_0x58391f:_0x3b8dda),_0x39638e['bind']('label')['to'](this,'isToggleDiffOn',_0x9b7e20=>_0x9b7e20?_0x32bbcd:_0x166eda),_0x39638e['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x39638e;}['_createAcceptAllButtonView'](){const _0x28591e=new _0x14ee0a(this['locale']);return _0x28591e['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x28591e['bind']('isEnabled')['to'](this,'isError',_0x59eea5=>!_0x59eea5),_0x28591e['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x110ac0=>!_0x110ac0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x395c8f=>_0x395c8f)]}}),_0x28591e['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x28591e;}['_createExitReviewButtonView'](){const _0x46bdd2=new _0x14ee0a(this['locale']);return _0x46bdd2['set']({'label':C(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x46bdd2['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4fe648=>!_0x4fe648),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3ec01d=>_0x3ec01d)]}}),_0x46bdd2['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x46bdd2;}['_createResultHeaderView'](){const _0x5f2685=new _0x19a8c6(this['locale']),_0x1476d7=this['_createTitleView']();return _0x5f2685['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x2f1ca6=>_0x2f1ca6)]},'children':[_0x1476d7,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x5f2685;}['_createTitleView'](){const _0x4ad145=new _0x19a8c6(this['locale']),_0x50fdc9=new Le();return _0x50fdc9['bind']('isVisible')['to'](this,'isResultReady',_0x2de9ad=>!_0x2de9ad),_0x4ad145['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x50fdc9,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2b7d51=>_0x2b7d51)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x17cf74=>!_0x17cf74)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x4ad145;}['_createFinishReviewButtonView'](){const _0x3cb6fe=new Js(this['locale']);return _0x3cb6fe['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x199677=>!_0x199677)]}}),_0x3cb6fe['delegate']('finishReview')['to'](this),_0x3cb6fe;}}class eh extends _0x2269a3{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x44c54a){super(_0x44c54a),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x17b08a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x17b08a['if']('isVisible','ck-hidden',_0x3c5628=>!_0x3c5628)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':C(_0x44c54a,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x37e71b=new Js(this['locale']);return _0x37e71b['delegate']('finishReview')['to'](this),_0x37e71b;}['_createResultHeaderView'](){const _0x4eb9bf=new _0x19a8c6(this['locale']);return _0x4eb9bf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x4eb9bf;}}class le extends _0x19a8c6{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x5a62cc){super(_0x5a62cc),this['reviewModeHeader']=new _0x5720b1(_0x5a62cc,{'label':C(_0x5a62cc,'AI_REVIEW_MODE'),'icon':_0x3451c9,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new $s(_0x5a62cc),this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=new sh(_0x5a62cc),this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=new eh(_0x5a62cc),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x194c80){this['reviewCheckResultsView']['addResult'](_0x194c80),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class we extends _0x500981{['resultItemView'];constructor(_0x10ef21,_0x73ab6f){super(_0x10ef21),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x73ab6f['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x33e1c5){this['resultItemView']['changeId']=_0x33e1c5['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x33e1c5['contentDiffed'];}['showBalloon'](_0xf85883,_0x2db3f9){this['updateContent'](_0xf85883),this['show'](),this['pin']({'target':()=>this['_getBestRectPosition'](_0x2db3f9)});}['hideBalloon'](){this['hide'](),this['unpin']();}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_setupClickOutsideHandler'](){_0x29a34e({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['_createContentView'](){const _0xf0377f=new _0x19a8c6();return this['resultItemView']=new Bs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0xf0377f['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0xf0377f;}['_getBestRectPosition'](_0x429832){const _0x3fec5c=Array['from'](_0x429832['getClientRects']());return _0x3fec5c['find'](_0x51b43f=>_0x51b43f['width']>0x0)||_0x3fec5c[0x0];}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x171820{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[at];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e6fef){super(_0x1e6fef),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new le(this['context']['locale']),this['_reviewModeView']['delegate'](...ih)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new we(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x50e6c6=this['context']['plugins']['get']('AITabs');_0x50e6c6['view']['on']('activateTab',(_0x14f1a,_0x188dff)=>{'reviewMode'===_0x188dff?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x50e6c6['view']['addTab']({'id':'reviewMode','buttonLabel':C(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x3451c9,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x3b8d72){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x3b8d72),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x3236dc){_0x3236dc&&('error-general'!==_0x3236dc['status']?'error-chunk'!==_0x3236dc['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x2eadc0){this['_reviewModeView']['addCheckRunResult'](_0x2eadc0);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x12b2c6,_0x4e3ad1){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x12b2c6,_0x4e3ad1);}['setActiveStateInResults'](_0x39975e){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x502340=>{_0x502340['id']===_0x39975e&&_0x502340['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3bbef7=>_0x3bbef7['setItemAsInactive']());}['updateChangeState'](_0x411ca3,_0x2f787b){'accepted'===_0x2f787b||'rejected'===_0x2f787b||'outdated'===_0x2f787b?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x411ca3,_0x2f787b):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x411ca3,_0x2f787b);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x491de9,_0x2fa96f){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x491de9,_0x2fa96f);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x3610af){const _0x2d6fa5=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x517cc9=>_0x517cc9['id']===_0x3610af);return _0x2d6fa5?_0x2d6fa5['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const me='reviewmode-';class re extends _0x171820{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x2b3cb3,c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x3b681a){super(_0x3b681a),this['_domEmitter']=new(_0x556252())(),this['_eventEmitter']=new(_0x135bec())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x55bf98=P(this['context']);_0x55bf98['conversion']['for']('editingDowncast')['markerToElement']({'model':me+'insert','view':(_0xae9265,{writer:_0xd03cc5})=>{const _0xddfcce=this['_markers']['get'](_0xae9265['markerName']),_0x396b79={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0xae9265['markerName']};return _0xd03cc5['createUIElement']('span',_0x396b79,function(_0x37c29f){const _0x816d71=this['toDomElement'](_0x37c29f);return _0x816d71['innerHTML']=_0xddfcce?.['text']||'',_0x816d71;});}}),_0x55bf98['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-only','view':_0x1a1cb9=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x1a1cb9['markerName']}})}),_0x55bf98['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-context','view':_0x285b99=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x285b99['markerName']}})}),_0x55bf98['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-text','view':_0x108803=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x108803['markerName']}})}),_0x55bf98['conversion']['for']('dataDowncast')['markerToElement']({'model':me+'suggestion-context','view':(_0x162baf,{writer:_0x2ae745})=>_0x2ae745['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x162baf['isOpening']?'start':'end')})}),_0x55bf98['conversion']['for']('downcast')['attributeToAttribute']({'model':ct,'view':_0x413d9f}),this['_domEmitter']['listenTo'](document,'click',(_0x5cb69a,_0x24499a)=>{const _0xeb6efb=_0x24499a['target'],_0x22f692=this['_findMarkerElement'](_0xeb6efb);if(!_0x22f692)return;const _0x24ba2d=_0x22f692['getAttribute']('data-marker-id'),_0x44d4db=_0x24ba2d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x24ba2d,'changeId':_0x44d4db});}),_0x55bf98['model']['document']['registerPostFixer'](_0x301d29=>this['_validateMarkers'](_0x55bf98,_0x301d29)),_0x55bf98['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x55bf98));}['getDocumentData'](){const _0x2cafc5=this['context']['plugins']['get']('AIEditing'),_0xae11a8=P(this['context']),_0x3ae283=_0xae11a8['model'],_0x2f9fb8=new _0x25eb17();for(const _0x3d25f2 of _0x3ae283['document']['getRoot']()['getChildren']()){const _0x42704c=_0x3d25f2['_clone'](!0x0);_0x2f9fb8['_appendChild'](_0x42704c);}for(const _0x45b8e0 of _0x3ae283['markers'])_0x2f9fb8['markers']['set'](_0x45b8e0['name'],this['_changeRangeOwnerDocument'](_0x45b8e0['getRange']()['clone'](),_0x2f9fb8));const _0x9d6e07=new _0x1fbb34({'ignoreElementEnd':!0x0,'startPosition':_0x3ae283['createPositionAt'](_0x2f9fb8,0x0)}),_0x224845=new Set(),_0x5407ed=new Map();for(const {item:_0x568007}of _0x9d6e07){if(!_0x568007['is']('$textProxy'))continue;const _0x3561c4=_0x568007['parent'];if((!_0x3561c4||!_0x3561c4['is']('element','caption'))&&(_0x3561c4&&_0x3561c4['is']('element'))){let _0x23f796=_0x3561c4['getAttribute'](ct);_0x23f796||(_0x23f796=_0x2cafc5['_nextDataId'](_0x224845),_0x3561c4['_setAttribute'](ct,_0x23f796)),_0x224845['add'](_0x23f796);let _0x3f6c0b=_0x3561c4;for(;_0x3f6c0b['parent']&&!_0x3f6c0b['parent']['is']('documentFragment');)_0x3f6c0b=_0x3f6c0b['parent'],_0x3f6c0b['hasAttribute'](ct)&&_0x3f6c0b['_removeAttribute'](ct);_0x5407ed['set'](_0x23f796,{'path':_0x3561c4['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x3f6c0b['_clone'](!0x0),_0x23f796,_0xae11a8['data'])}),_0x9d6e07['jumpTo'](_0x3ae283['createPositionAfter'](_0x3561c4));}}return{'content':_0xae11a8['data']['processor']['toData'](_0xae11a8['data']['toView'](_0x2f9fb8)),'version':_0xae11a8['model']['document']['version'],'elements':_0x5407ed};}['diffContent'](_0x5b788f,_0xc1a2d7){const _0xcdc26a=[],_0x2621a5=P(this['context']),_0x10dc81=_0x2621a5['data']['parse'](_0x5b788f,'$documentFragment'),_0x253e5e=_0x2621a5['model']['createPositionAt'](_0x10dc81,0x0),_0x4ba283=_0x2621a5['data']['parse'](_0xc1a2d7,'$documentFragment');if(!this['_hasSameTopLevelElement'](_0x10dc81,_0x4ba283))return _0xcdc26a;const _0x1cc6ed=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5b788f,_0xc1a2d7,{'anchor':_0x253e5e,'markDeletions':!0x0})['getOperations']()['filter'](_0x30a3c0=>'insert'===_0x30a3c0['type']||'marker'===_0x30a3c0['type']&&_0x30a3c0['name']['startsWith']('$markedRemove')),_0x4fcf4f=this['_groupAdjacentOperations'](_0x1cc6ed);let _0x122214=0x0;return _0x2621a5['model']['change'](_0xd3008d=>{for(let _0x5d1532=0x0;_0x5d1532<_0x4fcf4f['length'];_0x5d1532++){const _0x1a99be=_0x4fcf4f[_0x5d1532],_0x3e6eee=_0xd3008d['createDocumentFragment']();for(const _0x64a461 of _0x10dc81['getChildren']())_0xd3008d['append'](_0x64a461['_clone'](!0x0),_0x3e6eee);for(const _0x55f2e5 of _0x1a99be['operationsIsolated'])if('insert'===_0x55f2e5['type']){const _0x23f4e5=_0x55f2e5;_0x23f4e5['baseVersion']=null,_0x23f4e5['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x23f4e5,_0x3e6eee),_0xd3008d['batch']['addOperation'](_0x55f2e5),_0x2621a5['model']['applyOperation'](_0x55f2e5);const _0x4cc64e='suggestion:insertion:id:authorId:'+_0x122214++,_0x2cf22e=_0x2621a5['model']['createRange'](_0x23f4e5['position'],_0x23f4e5['position']['getShiftedBy'](_0x23f4e5['howMany']));_0x3e6eee['markers']['set'](_0x4cc64e,_0x2cf22e);}else{if('marker'===_0x55f2e5['type']&&_0x55f2e5['name']['startsWith']('$markedRemove')){const _0x26a5ae=_0x55f2e5,_0x316fbf='suggestion:deletion:id:authorId:'+_0x122214++;this['_changeOperationOwnerDocument'](_0x26a5ae,_0x3e6eee),_0x3e6eee['markers']['set'](_0x316fbf,_0x26a5ae['newRange']);}}const _0x348e6b=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1a99be['operationsIsolated'][0x0]),_0x3e6eee),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1a99be['operationsIsolated'][_0x1a99be['operationsIsolated']['length']-0x1]),_0x3e6eee));_0x3e6eee['markers']['set'](me+'suggestion-context',new _0x59485f(_0x348e6b['start'],_0x348e6b['end'])),_0xcdc26a['push']({..._0x1a99be,'context':this['_createGetContextFn'](_0x3e6eee,_0x2621a5['data'],{'ellipsisBefore':_0x348e6b['hasContentBefore'],'ellipsisAfter':_0x348e6b['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3e6eee,_0x2621a5['data'])});}}),_0xcdc26a;}['markChangePositionInEditorContent'](_0x301168,_0x3c33be){if(!_0x301168['length'])return;const _0x10302b=_0x301168[0x0]['parent']['id'],_0x258761=_0x3c33be['elements']['get'](_0x10302b);if(!_0x258761)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x10302b);const _0x2fed6b=_0x258761['path'],_0x43a8c0=P(this['context']),_0x3fcec0=_0x43a8c0['model']['document']['history']['getOperations'](_0x3c33be['version']),_0x5a996f=[];for(const _0xb2b023 of _0x301168){const _0x114321=_0xb2b023['operationsIsolated']['map'](_0x51f784=>this['_translateOperationToEditorContent'](_0x51f784,_0x2fed6b,_0x43a8c0['model']['document']['getRoots']()[0x0]));if(!_0x114321||!_0x114321['length'])continue;const _0x20c45a=_0x114321['every'](_0x11eb8b=>'marker'===_0x11eb8b['type']&&_0x11eb8b['name']['startsWith']('$markedRemove')),_0x5728fb={'document':_0x43a8c0['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x31b30f=_0x33bff0(_0x114321,_0x3fcec0,_0x5728fb)['operationsA'];for(const _0x17a1ff of _0x31b30f)if('insert'===_0x17a1ff['type']){const _0x57f028=_0x17a1ff,_0x8cce3d=_0x57f028['nodes'];let _0x59e9ae='';for(const _0x5de245 of _0x8cce3d)_0x5de245&&_0x5de245['is']('model:$text')&&(_0x59e9ae+=_0x5de245['data']);_0x5a996f['push']({'start':_0x57f028['position'],'end':_0x57f028['position'],'type':'insert','groupId':_0xb2b023['id'],'text':_0x59e9ae});}else{if('marker'===_0x17a1ff['type']&&_0x17a1ff['name']['startsWith']('$markedRemove')){const _0x2f0e28=_0x17a1ff;let _0x240065='remove-text';if(_0x20c45a){const _0x225d5b=this['_findAdjacentContextDistance'](_0x2f0e28['newRange']['start'],'backward',_0x43a8c0['model']['schema']),_0x11e82d=this['_findAdjacentContextDistance'](_0x2f0e28['newRange']['end'],'forward',_0x43a8c0['model']['schema']);if(_0x225d5b||_0x11e82d){const _0x381d01=_0x2f0e28['newRange']['start']['getShiftedBy'](-_0x225d5b),_0x4c29b3=_0x2f0e28['newRange']['end']['getShiftedBy'](_0x11e82d);_0x5a996f['push']({'start':_0x381d01,'end':_0x4c29b3,'groupId':_0xb2b023['id'],'type':'remove-context'});}else _0x240065='remove-only';}_0x5a996f['push']({'start':_0x2f0e28['newRange']['start'],'end':_0x2f0e28['newRange']['end'],'groupId':_0xb2b023['id'],'type':_0x240065});}}}this['_insertMarkers'](_0x5a996f);}['clearAllMarkers'](){const _0x39284f=P(this['context']);_0x39284f['model']['change'](_0x575aec=>{for(const _0x5c8b05 of this['_markers']['keys']())_0x39284f['model']['markers']['get'](_0x5c8b05)&&_0x575aec['removeMarker'](_0x5c8b05);}),this['_markers']['clear']();}['switchToReadOnly'](){P(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){P(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x56d76c){const _0x16c7a7=P(this['context']),_0x59c90a=_0x16c7a7['model'],_0x161588=_0x56d76c['map'](_0x2408e1=>this['_getMarkersDataForGroup'](_0x2408e1))['flat']();_0x59c90a['change'](_0x53d23b=>{for(const _0x127fff of _0x161588){const _0x79ec0c=_0x16c7a7['model']['markers']['get'](_0x127fff['id']);_0x79ec0c&&('insert'===_0x127fff['type']?_0x59c90a['insertContent'](_0x53d23b['createText'](_0x127fff['text']||''),_0x79ec0c['getRange']()['start']):'remove-text'!==_0x127fff['type']&&'remove-only'!==_0x127fff['type']||_0x59c90a['deleteContent'](_0x59c90a['createSelection'](_0x79ec0c['getRange']())),_0x53d23b['removeMarker'](_0x127fff['id']),this['_markers']['delete'](_0x127fff['id']));}});}['rejectChange'](_0x2eb0df){const _0x2ac28c=P(this['context']),_0x29b262=this['_getMarkersDataForGroup'](_0x2eb0df);_0x2ac28c['model']['change'](_0x2c4eef=>{for(const _0x45ad58 of _0x29b262)_0x2c4eef['removeMarker'](_0x45ad58['id']),this['_markers']['delete'](_0x45ad58['id']);});}['getEditor'](){return P(this['context']);}['getMarkerElementForChange'](_0x304dff){const _0x32aa02=Array['from'](this['_markers']['values']())['filter'](_0x42ba7c=>_0x42ba7c['groupId']===_0x304dff);if(!_0x32aa02['length'])return null;const _0x3fab96=0x1===_0x32aa02['length']?_0x32aa02[0x0]:this['_sortMarkers'](_0x32aa02)[0x0],_0x1af10b=P(this['context']),_0x5bcee4=_0x1af10b['model']['markers']['get'](_0x3fab96['id']);if(!_0x5bcee4)return null;const _0x3f69ef=_0x5bcee4['getRange'](),_0x329524=_0x1af10b['editing']['view']['getDomRoot']();if(!_0x329524||!_0x3f69ef)return null;const _0x322234=_0x329524['querySelector']('[data-marker-id=\x22'+_0x3fab96['id']+'\x22]');return _0x322234?{'modelRange':_0x3f69ef,'domElement':_0x322234}:null;}['_validateMarkers'](_0x4fda35,_0x9fde50){const _0x272bcc=Array['from'](this['_markers']['keys']()),_0x14b37b=new Map();for(const _0x3988a4 of _0x272bcc){const _0x50802d=_0x4fda35['model']['markers']['get'](_0x3988a4);if(!_0x50802d)continue;const _0x50c2f0=_0x50802d['getStart']()['path'][0x0];_0x14b37b['has'](_0x50c2f0)||_0x14b37b['set'](_0x50c2f0,[]),_0x14b37b['get'](_0x50c2f0)['push'](_0x50802d);}const _0x1321a0=new Set();for(const _0x4cf4fa of _0x4fda35['model']['document']['differ']['getChanges']()){let _0x58f2df=-0x1,_0x345555=null;if('insert'===_0x4cf4fa['type'])_0x345555=new _0x59485f(_0x4cf4fa['position'],_0x4cf4fa['position']['getShiftedBy'](_0x4cf4fa['length'])),_0x58f2df=_0x4cf4fa['position']['path'][0x0];else{if('remove'!==_0x4cf4fa['type'])continue;_0x345555=new _0x59485f(_0x4cf4fa['position']),_0x58f2df=_0x4cf4fa['position']['path'][0x0];}const _0x3ea484=_0x14b37b['get'](_0x58f2df)||[];if(_0x3ea484['length']){for(const _0x2e2d46 of _0x3ea484)if(_0x345555['root']['rootName']===_0x2e2d46['getRange']()['root']['rootName']&&('insert'!==_0x4cf4fa['type']||!_0x345555['containsRange'](_0x2e2d46['getRange']()))&&(_0x345555['isIntersecting'](_0x2e2d46['getRange']())||_0x345555['start']['isTouching'](_0x2e2d46['getRange']()['end'])||_0x345555['end']['isTouching'](_0x2e2d46['getRange']()['start']))){const _0x53298c=this['_parseMarkerName'](_0x2e2d46['name']);Array['from'](this['_markers']['values']())['filter'](_0x59dff7=>_0x59dff7['groupId']===_0x53298c['groupId'])['forEach'](_0x2f2468=>_0x1321a0['add'](_0x2f2468['id']));}}}if(_0x1321a0['size']){for(const _0x9d4253 of _0x1321a0)_0x9fde50['removeMarker'](_0x9d4253);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xd52e9c){for(const {name:_0x209958,data:_0x29a5e4}of _0xd52e9c['model']['document']['differ']['getChangedMarkers']()){if(!_0x209958['startsWith'](me))continue;const _0x731844=_0x29a5e4['oldRange'],_0x17c1f1=_0x29a5e4['newRange'],_0x563ef2=_0x731844&&'$graveyard'===_0x731844['root']['rootName'],_0x4b55ae=_0x17c1f1&&'$graveyard'===_0x17c1f1['root']['rootName'];if(_0x563ef2&&_0x4b55ae)continue;const _0x2be676=this['_parseMarkerName'](_0x209958);this['_markers']['get'](_0x209958)&&(_0x4b55ae||!_0x17c1f1?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x209958,'changeId':_0x2be676['groupId']}):_0x563ef2&&_0x17c1f1&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x209958,'changeId':_0x2be676['groupId']}));}}['_parseMarkerName'](_0x5bf50a){const _0x35ca78=_0x5bf50a['split'](':'),_0x12c6ed=(_0x35ca78[0x1]||'')['split']('_');return{'prefix':_0x35ca78[0x0],'groupId':_0x12c6ed[0x0],'suffix':_0x12c6ed[0x1]};}['_translateOperationToEditorContent'](_0x4a1f2f,_0x1050b5,_0xee5f8b){if('insert'===_0x4a1f2f['type']){const _0x2fc642=_0x4a1f2f;return new te(this['_changePosition'](_0x1050b5['concat'](_0x2fc642['position']['offset']),_0xee5f8b),_0x2fc642['nodes'],_0x2fc642['baseVersion']);}if('marker'===_0x4a1f2f['type']&&_0x4a1f2f['name']['startsWith']('$markedRemove')){const _0x397a36=_0x4a1f2f;return new _0x339507(_0x397a36['name'],_0x397a36['oldRange'],this['_changeRange'](_0x397a36['newRange'],_0x1050b5['concat'](_0x397a36['newRange']['start']['offset']),_0x1050b5['concat'](_0x397a36['newRange']['end']['offset']),_0xee5f8b),_0x397a36['_markers'],_0x397a36['affectsData'],_0x397a36['baseVersion']);}return _0x4a1f2f;}['_groupAdjacentOperations'](_0x50d7c7){if(!_0x50d7c7['length'])return[];const _0x4e7d41=[];let _0x426c42=0x0,_0x562ed7=0x0,_0x1c5567=[];for(let _0x4a15f6=0x0;_0x4a15f6<=_0x50d7c7['length'];_0x4a15f6++){const _0x1d673f=_0x50d7c7[_0x4a15f6],_0x3d6d9b=_0x50d7c7[_0x4a15f6-0x1];!_0x1d673f||_0x3d6d9b&&!this['_getOperationEnd'](_0x3d6d9b)['isTouching'](this['_getOperationStart'](_0x1d673f))?(_0x4e7d41['push']({'operations':_0x1c5567,'operationsIsolated':_0x1c5567['map'](_0x3e0485=>this['_shiftOperation'](_0x3e0485['clone'](),-_0x562ed7)),'groupOffset':_0x426c42}),_0x1c5567=_0x1d673f?[_0x1d673f]:[],_0x562ed7+=_0x426c42,_0x426c42=0x0):_0x1c5567['push'](_0x1d673f),_0x1d673f&&'insert'===_0x1d673f['type']&&(_0x426c42+=_0x1d673f['howMany']);}return _0x4e7d41;}['_findAdjacentContextDistance'](_0x11b9a1,_0x1b69f1,_0x55ae5e,_0x5aed41=0x1){const _0x2f7a57=new _0x1fbb34({'startPosition':_0x11b9a1,'direction':_0x1b69f1});let _0x1c7f8d=0x0;for(let _0x4b791d=0x0;_0x4b791d<_0x5aed41;_0x4b791d++){let _0xc2c8a3=0x0,_0xb7a75c=!0x1,_0x461603='forward'===_0x1b69f1?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x2f3685}of _0x2f7a57)if(_0x2f3685['is']('$textProxy')){const _0x40e4a2=_0x461603['exec'](_0x2f3685['data']);if(_0x40e4a2&&_0x40e4a2['length']){if(_0xc2c8a3+='forward'===_0x1b69f1?_0x40e4a2['index']+_0x40e4a2[0x0]['length']:_0x2f3685['data']['length']-_0x40e4a2['index'],_0x40e4a2[0x0]['length']!==_0x2f3685['data']['length'])break;_0xb7a75c=!0x0,_0x461603='forward'===_0x1b69f1?/^\w+/:/\w+$/;}else{if(_0xb7a75c)break;_0xc2c8a3+=_0x2f3685['offsetSize'];}}else{if(_0x2f3685['is']('element')){_0x55ae5e['isInline'](_0x2f3685)&&!_0xb7a75c&&(_0xc2c8a3+=0x1);break;}}_0x1c7f8d+=_0xc2c8a3,_0x2f7a57['jumpTo'](_0x11b9a1['getShiftedBy']('forward'===_0x1b69f1?_0x1c7f8d:-_0x1c7f8d));}return _0x1c7f8d;}['_getChangeContext'](_0x2fcaad,_0x1d3673){const _0x36b76e=P(this['context'])['model']['schema'],_0x424566=this['_findAdjacentContextDistance'](_0x2fcaad,'backward',_0x36b76e,0x6),_0x982b21=this['_findAdjacentContextDistance'](_0x1d3673,'forward',_0x36b76e,0x6),_0xd1d6dc=_0x2fcaad['getShiftedBy'](-_0x424566),_0x25ab9c=_0x1d3673['getShiftedBy'](_0x982b21);return{'start':_0xd1d6dc,'end':_0x25ab9c,'hasContentBefore':!_0xd1d6dc['isAtStart'],'hasContentAfter':!_0x25ab9c['isAtEnd']};}['_insertMarkers'](_0x325972){const _0x583366=this['context']['plugins']['get']('AIEditing'),_0x586508=new Set();P(this['context'])['model']['change'](_0x328363=>{for(const _0xd6d9ee of _0x325972){const _0x473731=''+me+_0xd6d9ee['type']+':'+_0xd6d9ee['groupId']+'_'+_0x583366['_nextDataId'](_0x586508);this['_markers']['set'](_0x473731,{'id':_0x473731,'groupId':_0xd6d9ee['groupId'],'type':_0xd6d9ee['type'],'text':_0xd6d9ee['text']}),_0x328363['addMarker'](_0x473731,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x328363['createRange'](_0xd6d9ee['start'],_0xd6d9ee['end'])});}});}['_createGetContextFn'](_0x508151,_0xd0cc71,_0x4a5a3c){let _0x33867a='';return()=>{if(!_0x33867a){const _0x3b890e=_0xd0cc71['toView'](_0x508151,{'showSuggestionHighlights':!0x0}),_0x29a1a6=_0x3b890e['getChild'](0x0);if(!_0x29a1a6)return'';let _0x56a833=!0x1;const _0x95b459=[];for(const _0x3aad54 of _0x29a1a6['getChildren']())_0x3aad54['is']('element','span')&&_0x3aad54['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x56a833=!0x1),_0x56a833&&_0x95b459['push'](_0x3aad54),_0x3aad54['is']('element','span')&&_0x3aad54['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x56a833=!0x0);_0x29a1a6['_removeChildren'](0x0,_0x29a1a6['childCount']),_0x4a5a3c?.['ellipsisBefore']&&_0x29a1a6['_appendChild']('…'),_0x29a1a6['_appendChild'](_0x95b459),_0x4a5a3c?.['ellipsisAfter']&&_0x29a1a6['_appendChild']('…');const _0x291ac0=_0xd0cc71['htmlProcessor']['domConverter']['viewToDom'](_0x3b890e),_0x1a64e4=_0xd0cc71['htmlProcessor']['htmlWriter']['getHtml'](_0x291ac0);_0x33867a=_0x1a64e4;}return _0x33867a;};}['_createGetContentFn'](_0x1b3ba6,_0x3654dc){let _0x5950e3='';return()=>(_0x5950e3||(_0x5950e3=_0x3654dc['stringify'](_0x1b3ba6,{'showSuggestionHighlights':!0x0})),_0x5950e3);}['_createGetContentUsingDataIdFn'](_0x6d13a4,_0x1f08a5,_0x237dfd){let _0x1bc5e1='';return()=>{if(!_0x1bc5e1){const _0x340063=_0x237dfd['toView'](new _0x25eb17(_0x6d13a4)),_0x5f1eff=_0x237dfd['htmlProcessor']['domConverter']['viewToDom'](_0x340063)['querySelector']('[data-id=\x22'+_0x1f08a5+'\x22]');_0x1bc5e1=_0x5f1eff?.['outerHTML']||'';}return _0x1bc5e1;};}['_findMarkerElement'](_0x481b65,_0x2edb38=0x5){let _0x308fdc=_0x481b65,_0x52dea1=null;for(let _0x426451=0x0;_0x426451<_0x2edb38&&_0x308fdc;_0x426451++){if(!_0x308fdc['className']){_0x308fdc=_0x308fdc['parentElement'];continue;}if(!(''+_0x308fdc['className'])['includes']('ck-ai_review-mode-marker_')){_0x308fdc=_0x308fdc['parentElement'];continue;}if(!_0x308fdc['getAttribute']('data-marker-id'))break;_0x52dea1=_0x308fdc;break;}return _0x52dea1;}['_getMarkersDataForGroup'](_0x5359d9){return Array['from'](this['_markers']['values']())['filter'](_0x16d5f6=>_0x16d5f6['groupId']===_0x5359d9);}['_getOperationStart'](_0x882538){return'insert'===_0x882538['type']?_0x882538['position']:_0x882538['newRange']['start'];}['_getOperationEnd'](_0x33ad31,_0x25eb76=!0x1){return'insert'===_0x33ad31['type']?_0x25eb76?_0x33ad31['position']:_0x33ad31['position']['getShiftedBy'](_0x33ad31['howMany']):_0x33ad31['newRange']['end'];}['_shiftOperation'](_0xeff67,_0x4152ff){return'insert'===_0xeff67['type']?_0xeff67['position']=_0xeff67['position']['getShiftedBy'](_0x4152ff):'marker'===_0xeff67['type']&&_0xeff67['newRange']&&(_0xeff67['newRange']=new _0x59485f(_0xeff67['newRange']['start']['getShiftedBy'](_0x4152ff),_0xeff67['newRange']['end']['getShiftedBy'](_0x4152ff))),_0xeff67;}['_changeOperationOwnerDocument'](_0x4e6aab,_0x43d135){'insert'===_0x4e6aab['type']?_0x4e6aab['position']=this['_changePositionOwnerDocument'](_0x4e6aab['position'],_0x43d135):'marker'===_0x4e6aab['type']&&_0x4e6aab['newRange']&&(_0x4e6aab['newRange']=this['_changeRangeOwnerDocument'](_0x4e6aab['newRange'],_0x43d135));}['_changePositionOwnerDocument'](_0x26cb94,_0x58009d){return new _0x58772b(_0x58009d,_0x26cb94['path']);}['_changeRangeOwnerDocument'](_0x1cfd48,_0x2136db){return new _0x59485f(this['_changePositionOwnerDocument'](_0x1cfd48['start'],_0x2136db),this['_changePositionOwnerDocument'](_0x1cfd48['end'],_0x2136db));}['_changePosition'](_0x476332,_0x8c067b){return new _0x58772b(_0x8c067b,[..._0x476332]);}['_changeRange'](_0x5d013b,_0x51d8ee,_0x226ffb,_0x4abd55){return new _0x59485f(this['_changePosition'](_0x51d8ee,_0x4abd55),this['_changePosition'](_0x226ffb,_0x4abd55));}['_sortMarkers'](_0x4d9cd1){const _0x1dae78=_0xa0cdcd=>{switch(_0xa0cdcd){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x4d9cd1['sort']((_0x47acbc,_0x2f77ed)=>_0x1dae78(_0x47acbc['type'])-_0x1dae78(_0x2f77ed['type']));}['_hasSameTopLevelElement'](_0xd6ee3a,_0x1b4d3d){const _0x170070=_0xd6ee3a['getChild'](0x0),_0x25a4c7=_0x1b4d3d['getChild'](0x0);return!(!_0x170070||!_0x25a4c7)&&((!_0x170070['is']('element')||!_0x25a4c7['is']('element')||_0x170070['name']===_0x25a4c7['name'])&&!(_0x170070['is']('element')&&!_0x25a4c7['is']('element')||!_0x170070['is']('element')&&_0x25a4c7['is']('element')));}}class Va extends _0x171820{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{pi as AIActions,ni as AIAdapter,qn as AIAssistant,G as AIAssistantUI,w as AIBalloon,Pa as AIChat,tt as AIChatController,it as AIChatHistory,yt as AIChatHistoryController,jt as AIChatHistoryUI,et as AIChatUI,s as AIConnector,c as AIEditing,Ha as AIEditorIntegration,Ot as AIQuickActionType,Ua as AIQuickActions,ui as AIQuickActionsUI,tr as AIRequestError,xs as AIReviewCheck,Rs as AIReviewCheckResult,Ts as AIReviewCheckRun,Va as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,at as AITabs,ue as AITextAdapter,bt as AIToggleButtonUI,zn as AWSTextAdapter,Xn as OpenAITextAdapter,ai as ShowAIAssistantCommand,go as ToggleAICommand,Cs as createResizeButton,Qn as getDefaultAICommands};
|