@ckeditor/ckeditor5-ai 47.7.1-alpha.0 → 47.7.1

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.
Files changed (114) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +5 -5
  3. package/package.json +15 -15
  4. package/src/aiactions/aiactions.js +1 -1
  5. package/src/aiactions/model/aiactionsreply.js +1 -1
  6. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  7. package/src/aiassistant/aiassistantediting.js +1 -1
  8. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  9. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  10. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  11. package/src/aiassistant/ui/form/aiformview.js +1 -1
  12. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  13. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  14. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  15. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  16. package/src/aiballoon/aiballoon.js +1 -1
  17. package/src/aichat/aichat.js +1 -1
  18. package/src/aichat/aichatballoon.js +1 -1
  19. package/src/aichat/aichatcontroller.js +1 -1
  20. package/src/aichat/aichatui.js +1 -1
  21. package/src/aichat/model/aichatcontext.js +1 -1
  22. package/src/aichat/model/aichatconversation.js +1 -1
  23. package/src/aichat/ui/aichatballoonview.js +1 -1
  24. package/src/aichat/ui/aichatfeedview.js +1 -1
  25. package/src/aichat/ui/aichatheaderview.js +1 -1
  26. package/src/aichat/ui/aichatview.js +1 -1
  27. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  28. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  29. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  30. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  31. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  32. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  33. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  34. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  35. package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
  36. package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
  37. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  38. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  39. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  40. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  41. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  42. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  43. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  44. package/src/aichat/utils/eventnames.js +1 -1
  45. package/src/aichathistory/aichathistory.js +1 -1
  46. package/src/aichathistory/aichathistorycontroller.js +1 -1
  47. package/src/aichathistory/aichathistoryui.js +1 -1
  48. package/src/aichathistory/model/aichathistoryconversations.js +1 -1
  49. package/src/aichathistory/model/aichathistoryitem.js +1 -1
  50. package/src/aichathistory/ui/aichathistorylistitemview.js +2 -2
  51. package/src/aichathistory/ui/aichathistorylistview.js +1 -1
  52. package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
  53. package/src/aichathistory/ui/aichathistoryview.js +1 -1
  54. package/src/aichatshortcuts/aichatshortcuts.js +1 -1
  55. package/src/aichatshortcuts/ui/aichatshortcutsview.js +1 -1
  56. package/src/aichatshortcuts/ui/aichatshortcutview.js +1 -1
  57. package/src/aicore/aiconnector.js +1 -1
  58. package/src/aicore/aiediting.js +1 -1
  59. package/src/aicore/model/aimodels.js +1 -1
  60. package/src/aicore/model/aireply.js +1 -1
  61. package/src/aicore/pipeline/airesponseapplier.js +2 -2
  62. package/src/aicore/pipeline/airesponseparser.js +2 -2
  63. package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
  64. package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
  65. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
  66. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.js +1 -1
  67. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.js +1 -1
  68. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.js +1 -1
  69. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
  70. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  71. package/src/aicore/ui/suggestioncontainer/aisuggestionloaderview.js +1 -1
  72. package/src/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js +1 -1
  73. package/src/aicore/ui/suggestioncontainer/aiwebsourcesview.js +1 -1
  74. package/src/aicore/utils/documentrange.js +1 -1
  75. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  76. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  77. package/src/aicore/utils/htmlparser.js +1 -1
  78. package/src/aicore/utils/htmlstreamer.js +1 -1
  79. package/src/aicore/utils/scrollmanager.js +1 -1
  80. package/src/aieditorintegration/aieditorintegration.js +1 -1
  81. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
  82. package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
  83. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  84. package/src/aiquickactions/aiquickactionsui.js +1 -1
  85. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  86. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  87. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  88. package/src/aiquickactions/ui/aiquickactionsfilteredlistview.js +1 -1
  89. package/src/aiquickactions/ui/balloon/aiactionsballoonview.js +1 -1
  90. package/src/aiquickactions/ui/dropdownmenubuttonwithhighlightview.js +1 -1
  91. package/src/aireviewcore/aireviewcorecontroller.js +1 -1
  92. package/src/aireviewcore/aireviewcoreediting.js +1 -1
  93. package/src/aireviewcore/aireviewcoreui.js +1 -1
  94. package/src/aireviewcore/model/aireviewchecklist.js +1 -1
  95. package/src/aireviewcore/model/aireviewcheckrun.js +1 -1
  96. package/src/aireviewcore/model/aireviewsystemcheckrun.js +1 -1
  97. package/src/aireviewcore/ui/aireviewcoreballoonsuggestionview.js +1 -1
  98. package/src/aireviewcore/ui/aireviewcorechecklistitemresultview.js +1 -1
  99. package/src/aireviewcore/ui/aireviewcorecustomcheckview.js +1 -1
  100. package/src/aireviewcore/ui/aireviewcorereviewchecklistview.js +1 -1
  101. package/src/aireviewcore/ui/aireviewcorereviewcommandlistitemview.js +1 -1
  102. package/src/aireviewcore/ui/aireviewcorereviewcompletedview.js +1 -1
  103. package/src/aireviewcore/ui/aireviewcoreuicheckresultsview.js +1 -1
  104. package/src/aireviewcore/ui/form/aireviewcoreformdropdown.js +1 -1
  105. package/src/aireviewcore/ui/form/aireviewcoreformmanager.js +1 -1
  106. package/src/aireviewmode/aireviewmode.js +1 -1
  107. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  108. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  109. package/src/aireviewmode/model/aireviewcheckextra.js +1 -1
  110. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  111. package/src/aireviewmode/model/aireviewmodechecklist.js +1 -1
  112. package/src/aitabs/aitabs.js +1 -1
  113. package/src/aitranslate/aitranslate.js +1 -1
  114. package/src/aitranslate/model/aitranslatecheck.js +1 -1
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x241f5a,Command as Ut,ContextPlugin as _0x118815,Editor as dt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5614d4,IconCheck as _0x1cd2e2,IconError as _0x3d2dec,IconSubmit as _0x349858,IconAIHistory as mt,IconMagicWand as _0x3c71fd,IconRobotPencil as _0xb06f9,IconMaximize as _0x5521e7,IconMinimize as _0x5bfc92,IconShowChangesOn as _0x34d7d0,IconShowChangesOff as _0x4218b0,IconDocument as _0x20ff08,IconBoxWithCross as _0x1c0feb,IconBoxWithCheck as _0x2b1fdc,IconBoxWithMarker as _0x3ecbda,IconInfo as tc,IconLoupe as _0x1fb99b,IconCancel as _0x187b85,IconStop as _0x49c145,IconAIChat as Ft,IconPlus as _0x377ed9,IconPin as _0x125ef8,IconThreeHorizontalDots as _0x22e1a7,IconChevronDown as _0x1ee736,IconChevronUp as _0x5c42c1,IconOutdated as _0x257152,IconEye as _0x3a16b6,IconEyeCrossedOut as _0x2b26c,IconChevronRight as _0x2ef869,IconAIReview as _0x143feb,IconAITranslate as _0x3515b8}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x2e2dc8,CKEditorError as _0x542443,ObservableMixin as ts,global as it,isVisible as _0x2e19a7,Rect as ot,Collection as _0x4b06b7,FocusTracker as _0x510dfd,KeystrokeHandler as _0x394cf5,first as _0xd78d7,logWarning as _0x23c4c9,logError as Ct,toArray as _0x498aeb,EmitterMixin as _0x204e9f,scrollViewportToShowTarget as st,scrollAncestorsToShowTarget as _0x88b018,ResizeObserver as _0x9cd70,_isMotionReduced as Pt,getConstrainedViewportRect as _0x2279c2,DomEmitterMixin as _0x400351}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x3da665,ButtonView as _0x5bfd84,View as _0x15a8cb,SpinnerView as _0x1e066a,IconView as _0x2ae97e,AutocompleteView as _0x322b7b,ListView as _0x236991,ListItemGroupView as _0x3c320d,ListItemView as _0x5e9d54,ButtonLabelView as _0x59760a,FocusCycler as _0x5a99d2,createLabeledTextarea as _0x11d52f,Dialog as _0x1017f8,createDropdown as _0x29ed58,addMenuToDropdown as _0x359042,MenuBarMenuView as _0x538ac7,MenuBarMenuListItemButtonView as _0x302890,DialogViewPosition as _0x2be176,MenuBarMenuListView as _0x255377,MenuBarMenuListItemView as _0x199d14,BodyCollection as _0x49fddd,BalloonPanelView as _0x1ddc71,clickOutsideHandler as _0x4daaf2,addListToDropdown as _0x48b098,UIModel as _0x129df2,submitHandler as _0x251698,LabeledFieldView as _0x1a087b,createLabeledInputText as th,FormHeaderView as _0x2e3f47,HighlightedTextView as _0x258b31,ViewCollection as _0x152ab6,FileDialogButtonView as _0x4834b0,InputTextView as _0x406518,SearchTextView as _0x230635,ListItemButtonView as _0x1426e0,ButtonLabelWithHighlightView as _0x5d3d48,DropdownMenuPanelPositioningFunctions as _0x50490e,BalloonToolbar as te,FormRowView as _0x294a7c,TextareaView as _0x59ba6f}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x1a7e12,ClipboardMarkersUtils as _0x3b2626}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x195c6c,ViewDataTransfer as _0xed8390,ViewUpcastWriter as _0x971b42,Matcher as _0x405f3f,_DetachOperation as _0x5de5b5,_insertIntoModelNodeList as _0x1aa9ab,_removeFromModelNodeList as to,ModelRange as _0x561be6,transformOperationSets as _0x359a53,ViewDowncastWriter as Nt,ModelDocumentFragment as _0x53b4ba,ModelPosition as _0x18c733,ModelTreeWalker as _0x266ef3,MarkerOperation as _0x2b53fb,InsertOperation as _0x147757}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x3060e9,escape as _0x1052a4,escapeRegExp as _0x249f4a,debounce as _0x5a61ef}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x4a7826}from'htmlparser2';import{isTag as _0x512964,findOne as xt,getParent as _0x4b34c6,findAll as _0x5269a1,removeElement as _0xb8c25a,replaceElement as _0x390c69,prepend as _0x11de48,prependChild as _0x52afa8,appendChild as _0xce27f2,append as _0x59a323,find as _0x3dc1d7,isComment as _0x434d7d,getChildren as _0x260bf8,textContent as _0x25d39e}from'domutils';import _0x3688ac from'dom-serializer';import{Document as Rt,Element as _0x1075d8,Text as _0x2ef03d,cloneNode as _0x255d9a,isDocument as _0x14eea4,isText as _0x59e3c1,NodeWithChildren as _0x673436}from'domhandler';import{MarkdownGfmMdToHtml as _0x33c75d}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0xf7c114,DocumentCompare as _0x143aa3,DATA_ID_MODEL_ATTRIBUTE as Et,ConfirmMixin as _0x52eed7,LateFocusDropdownButtonView as _0x26095f,getAllMarkersDomElementsSorted as tt,SuggestionsConversion as qt,DATA_ID_VIEW_ATTRIBUTE as _0x53de42,getMarkerDomElement as _0x25a0d4}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x282866}from'es-toolkit';import _0x308f05 from'morphdom';import{IconWeb as _0x1ce37c,IconClose as _0x4affb1,IconDocument as _0x51d2a2,IconSelection as _0x16211b,IconFileUpload as _0x56f9a2,IconLink as _0x5acb26,IconBulb as _0x10c759,IconAI as _0xe3a7aa,IconPreviousArrow as _0x3c7600,IconCheck as _0x15208f,IconDocumentOutline as _0x4da3a3,IconPaperClip as _0xb33e07,IconBrowseFiles as _0x555a1a,IconDropdownArrow as _0x4e1794,IconAIChat as _0x294a94,IconAIReview as _0x283d0c,IconAITranslate as Vt,IconAIAskAI as _0x57100f,IconThumbUp as _0x502ea4,IconThumbDown as _0x4cfb74,IconCopy as _0x2f6fb4,IconShowChangesOff as _0x43cdc5,IconShowChangesOn as _0x5e9a92,IconAIQuickActions as _0x9e3e58,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as zt,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x5c8076,IconNextArrow as _0x40af26}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x57cf13}from'diff';const x='_ungrouppedCommands';function o(_0x422a93,_0x2b4075){const _0x481aa4=(0x0,_0x2b4075['t'])('Other');return _0x422a93['length']?'groupId'in _0x422a93[0x0]?_0x422a93:[{'groupId':x,'groupLabel':_0x481aa4,'order':0x1/0x0,'commands':_0x422a93}]:[{'groupId':x,'groupLabel':_0x481aa4,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x241f5a{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1e9f06}=this,_0x3be726=['ck-fake-ai-selection'];_0x1e9f06['config']['get']('ai.assistant.useTheme')&&_0x3be726['push']('ck-ai-assistant-ui_theme'),_0x1e9f06['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x3be726,'priority':0xc}}),_0x1e9f06['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x30603e,{writer:_0x324744})=>{if(!_0x30603e['markerRange']['isCollapsed'])return null;const _0x347786=_0x324744['createUIElement']('span');return _0x324744['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x347786),_0x347786;}});}['afterInit'](){!async function(_0x1f2569){const _0x2da766=_0x282350([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]),_0x3da1d7=0x3dffc4e1,_0x4c1fe5=0x3df84329^_0x3da1d7,_0x3dc9aa=window[_0x282350([0x44,0x61,0x74,0x65])][_0x282350([0x6e,0x6f,0x77])](),_0x31132d=_0x1f2569[_0x282350([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x127122=new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5bd34=>{_0x31132d[_0x282350([0x6f,0x6e,0x63,0x65])](_0x282350([0x72,0x65,0x61,0x64,0x79]),_0x5bd34);}),_0x18da63={[_0x282350([0x6b,0x74,0x79])]:_0x282350([0x45,0x43]),[_0x282350([0x75,0x73,0x65])]:_0x282350([0x73,0x69,0x67]),[_0x282350([0x63,0x72,0x76])]:_0x282350([0x50,0x2d,0x32,0x35,0x36]),[_0x282350([0x78])]:_0x282350([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]),[_0x282350([0x79])]:_0x282350([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]),[_0x282350([0x61,0x6c,0x67])]:_0x282350([0x45,0x53,0x32,0x35,0x36])},_0x3d81a3=_0x31132d[_0x282350([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x282350([0x67,0x65,0x74])](_0x282350([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x3d0613(){let _0x56efa6,_0x533f76=null,_0xd278b5=null;try{if(_0x3d81a3==_0x282350([0x47,0x50,0x4c]))return _0x282350([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x56efa6=_0x2fee7c(),!_0x56efa6)return _0x282350([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x56efa6[_0x282350([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xd278b5=_0x2b58df(_0x56efa6[_0x282350([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x56efa6[_0x282350([0x6a,0x74,0x69])])),await _0x328f70()?_0x204108()?_0x204e87()?_0x282350([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1e20fa()?(_0x56efa6[_0x282350([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x282350([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x533f76=_0x231d25(_0x282350([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0xe84e13()):_0x282350([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x282350([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x282350([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x282350([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x204e87(){const _0x21726a=[_0x282350([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x282350([0x74,0x72,0x69,0x61,0x6c])][_0x282350([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x56efa6[_0x282350([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3dc9aa/0x3e8:0xe10*_0x4c1fe5;return _0x56efa6[_0x282350([0x65,0x78,0x70])]<_0x21726a;}function _0x204108(){const _0x3d3f4b=_0x56efa6[_0x282350([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3d3f4b&&(!!_0x3d3f4b[_0x282350([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x282350([0x2a]))||!!_0x3d3f4b[_0x282350([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x282350([0x41,0x49])));}function _0x1e20fa(){const _0x3408df=_0x56efa6[_0x282350([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3408df||0x0==_0x3408df[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x69f774}=new URL(window[_0x282350([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3408df[_0x282350([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x69f774))return!0x0;const _0x2ff827=_0x69f774[_0x282350([0x73,0x70,0x6c,0x69,0x74])](_0x282350([0x2e]));return _0x3408df[_0x282350([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x30a5ee=>_0x30a5ee[_0x282350([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x282350([0x2a])))[_0x282350([0x6d,0x61,0x70])](_0x1cb602=>_0x1cb602[_0x282350([0x73,0x70,0x6c,0x69,0x74])](_0x282350([0x2e])))[_0x282350([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x12f9f7=>_0x12f9f7[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2ff827[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x282350([0x6d,0x61,0x70])](_0x1a946f=>Array(_0x2ff827[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1a946f[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x282350([0x66,0x69,0x6c,0x6c])](_0x1a946f[0x0]===_0x282350([0x2a])?_0x282350([0x2a]):'')[_0x282350([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1a946f))[_0x282350([0x73,0x6f,0x6d,0x65])](_0xa6af09=>_0x2ff827[_0x282350([0x65,0x76,0x65,0x72,0x79])]((_0x2847f6,_0x3ca89d)=>_0xa6af09[_0x3ca89d]===_0x2847f6||_0xa6af09[_0x3ca89d]===_0x282350([0x2a])));}function _0xe84e13(){return _0x533f76&&_0xd278b5?new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3151b3,_0x35f2b6)=>{_0x533f76[_0x282350([0x74,0x68,0x65,0x6e])](_0x3151b3,_0x35f2b6),_0xd278b5[_0x282350([0x74,0x68,0x65,0x6e])](_0x340a67=>{_0x340a67!=_0x282350([0x56,0x61,0x6c,0x69,0x64])&&_0x3151b3(_0x340a67);},_0x35f2b6);}):_0x533f76||_0xd278b5||_0x282350([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2b58df(_0x238880,_0x3773b1){return new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b9372=>{if(_0x222e83())return _0x2b9372(_0x282350([0x56,0x61,0x6c,0x69,0x64]));_0x136923(),_0x31132d[_0x282350([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x282350([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4b5035=!0x1;const _0x40b7c6=_0x2e2dc8();function _0x4f7ff4(_0x14c2f2){return!!_0x14c2f2&&(typeof _0x14c2f2===_0x282350([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x14c2f2===_0x282350([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x14c2f2[_0x282350([0x74,0x68,0x65,0x6e])]===_0x282350([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x14c2f2[_0x282350([0x63,0x61,0x74,0x63,0x68])]===_0x282350([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x180d64(_0x595e34){_0x447c51(_0x595e34)[_0x282350([0x74,0x68,0x65,0x6e])](_0x274ab3=>{if(!_0x274ab3||_0x274ab3[_0x282350([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x282350([0x6f,0x6b]))return _0x282350([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x2fb0a9(_0x40decf(_0x40b7c6+_0x3773b1))!=_0x274ab3[_0x282350([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x282350([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x282350([0x56,0x61,0x6c,0x69,0x64]);})[_0x282350([0x74,0x68,0x65,0x6e])](_0x2fc51b=>(_0x13c0b9(),_0x2fc51b),()=>{const _0x26dd64=_0x13f1f5();return null==_0x26dd64?(_0x13c0b9(),_0x282350([0x56,0x61,0x6c,0x69,0x64])):_0x282350(_0x3dc9aa-_0x26dd64>(0x19f340e1^_0x3da1d7)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x282350([0x74,0x68,0x65,0x6e])](_0x2b9372)[_0x282350([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2b9372(_0x282350([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x20d57f=0x3dc92a61^_0x3da1d7;function _0x13c0b9(){const _0x2c874f=_0x282350([0x6c,0x6c,0x63,0x74,0x2d])+_0x2fb0a9(_0x40decf(_0x238880)),_0x13ec7a=_0x5a68e7(_0x2fb0a9(window[_0x282350([0x4d,0x61,0x74,0x68])][_0x282350([0x63,0x65,0x69,0x6c])](_0x3dc9aa/_0x20d57f)));window[_0x282350([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x282350([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2c874f,_0x13ec7a);}function _0x13f1f5(){const _0x408594=_0x282350([0x6c,0x6c,0x63,0x74,0x2d])+_0x2fb0a9(_0x40decf(_0x238880)),_0x28131a=window[_0x282350([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x282350([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x408594);return _0x28131a?window[_0x282350([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5a68e7(_0x28131a),0x10)*_0x20d57f:null;}function _0x447c51(_0x1e13e6){return new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x29a577,_0x4d6ffc)=>{_0x1e13e6[_0x282350([0x74,0x68,0x65,0x6e])](_0x29a577,_0x4d6ffc),window[_0x282350([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4d6ffc,0x3dfe1021^_0x3da1d7);});}}_0x31132d[_0x282350([0x6f,0x6e])](_0x282350([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x54c97a,_0x131ac2)=>{if(_0x131ac2[0x0]!=_0x238880)return _0x2b9372(_0x282350([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x131ac2[0x1]={..._0x131ac2[0x1],[_0x282350([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x40b7c6};},{[_0x282350([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x282350([0x68,0x69,0x67,0x68])}),_0x31132d[_0x282350([0x6f,0x6e])](_0x282350([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x525b0e=>{_0x4f7ff4(_0x525b0e[_0x282350([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4b5035=!0x0,_0x180d64(_0x525b0e[_0x282350([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x282350([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x282350([0x6c,0x6f,0x77])}),_0x127122[_0x282350([0x74,0x68,0x65,0x6e])](()=>{_0x4b5035||_0x2b9372(_0x282350([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x222e83(){return _0x31132d[_0x282350([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x282350([0x76,0x69,0x65,0x77])][_0x282350([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x282350([0x61,0x75,0x74,0x6f]);}function _0x136923(){_0x31132d[_0x282350([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x282350([0x76,0x69,0x65,0x77])][_0x282350([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x282350([0x61,0x75,0x74,0x6f]);}}function _0x231d25(_0xe09466){const _0x2da034=[new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x19b312=>setTimeout(_0x19b312,0x3df6fa2d^_0x3da1d7)),_0x127122[_0x282350([0x74,0x68,0x65,0x6e])](()=>new window[(_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x250a66=>{let _0x533d77=0x0;_0x31132d[_0x282350([0x6d,0x6f,0x64,0x65,0x6c])][_0x282350([0x6f,0x6e])](_0x282350([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xfedcc7,_0x1f41db)=>{_0x1f41db[0x0][_0x282350([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x533d77++,_0x533d77==(0x3dffc109^_0x3da1d7)&&(_0x250a66(),_0xfedcc7[_0x282350([0x6f,0x66,0x66])]());});}))];return window[_0x282350([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x282350([0x72,0x61,0x63,0x65])](_0x2da034)[_0x282350([0x74,0x68,0x65,0x6e])](()=>_0xe09466);}async function _0x4b2188(){await _0x127122,_0x31132d[_0x282350([0x6d,0x6f,0x64,0x65,0x6c])][_0x282350([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3591d7,_0x31132d[_0x282350([0x6d,0x6f,0x64,0x65,0x6c])][_0x282350([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3591d7,_0x31132d[_0x282350([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x282350([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x50ee08(_0x536feb){const _0x14435a=_0x331fad();_0x31132d[_0x14435a]=_0x282350([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x536feb,_0x536feb!=_0x282350([0x56,0x61,0x6c,0x69,0x64])&&_0x4b2188();}function _0x331fad(){const _0x32a61e=window[_0x282350([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x282350([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x282350([0x6e,0x6f,0x77])]())[_0x282350([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x282350([0x2e]),'');let _0x1aa360=_0x282350([0x6e]);for(let _0x498b5b=0x0;_0x498b5b<_0x32a61e[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x498b5b+=0x2){let _0x12f43b=window[_0x282350([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x32a61e[_0x282350([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x498b5b,_0x498b5b+0x2));_0x12f43b>=_0x2da766[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x12f43b-=_0x2da766[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1aa360+=_0x2da766[_0x12f43b];}return _0x1aa360;}function _0x2fee7c(){const _0x1292eb=_0x3d81a3[_0x282350([0x73,0x70,0x6c,0x69,0x74])](_0x282350([0x2e]));if(0x3!=_0x1292eb[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xf02128(_0x1292eb[0x1]);function _0xf02128(_0x1f184a){const _0x56e121=_0x302143(_0x1f184a);return _0x56e121&&_0x1161bb()?_0x56e121:null;function _0x1161bb(){const _0x562a08=_0x56e121[_0x282350([0x6a,0x74,0x69])],_0x429546=window[_0x282350([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x562a08[_0x282350([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x562a08[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2a45e5={..._0x56e121,[_0x282350([0x6a,0x74,0x69])]:_0x562a08[_0x282350([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x562a08[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2a45e5[_0x282350([0x76,0x63])],_0x40decf(_0x2a45e5)==_0x429546;}}}async function _0x328f70(){let _0x37b09d=!0x0;try{const _0x131734=_0x3d81a3[_0x282350([0x73,0x70,0x6c,0x69,0x74])](_0x282350([0x2e])),[_0x4c0b67,_0xa78c25,_0x2fee25]=_0x131734;return _0x3f03c1(_0x4c0b67),await _0x3717b7(_0x4c0b67,_0xa78c25,_0x2fee25),_0x37b09d;}catch{return!0x1;}function _0x3f03c1(_0xfad86c){const _0x4d7739=_0x302143(_0xfad86c);_0x4d7739&&_0x4d7739[_0x282350([0x61,0x6c,0x67])]==_0x282350([0x45,0x53,0x32,0x35,0x36])||(_0x37b09d=!0x1);}async function _0x3717b7(_0x25de1f,_0x12e9b6,_0x4e7e5d){const _0x4468ae=window[_0x282350([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x282350([0x66,0x72,0x6f,0x6d])](_0xddd475(_0x4e7e5d),_0x417231=>_0x417231[_0x282350([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x37253b=new window[(_0x282350([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x282350([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x25de1f+_0x282350([0x2e])+_0x12e9b6),_0x20e1ed=window[_0x282350([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x282350([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x20e1ed)return;const _0xb1610c=await _0x20e1ed[_0x282350([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x282350([0x6a,0x77,0x6b]),_0x18da63,{[_0x282350([0x6e,0x61,0x6d,0x65])]:_0x282350([0x45,0x43,0x44,0x53,0x41]),[_0x282350([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x282350([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x282350([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x20e1ed[_0x282350([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x282350([0x6e,0x61,0x6d,0x65])]:_0x282350([0x45,0x43,0x44,0x53,0x41]),[_0x282350([0x68,0x61,0x73,0x68])]:{[_0x282350([0x6e,0x61,0x6d,0x65])]:_0x282350([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0xb1610c,_0x4468ae,_0x37253b)||(_0x37b09d=!0x1);}}function _0x302143(_0x56c9cf){return _0x56c9cf[_0x282350([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x282350([0x65,0x79]))?JSON[_0x282350([0x70,0x61,0x72,0x73,0x65])](_0xddd475(_0x56c9cf)):null;}function _0xddd475(_0x84507b){return window[_0x282350([0x61,0x74,0x6f,0x62])](_0x84507b[_0x282350([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x282350([0x2b]))[_0x282350([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x282350([0x2f])));}function _0x40decf(_0x1d35c4){let _0x3c3e78=0x1505;function _0x580517(_0x5ce314){for(let _0x4e67a2=0x0;_0x4e67a2<_0x5ce314[_0x282350([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4e67a2++){const _0x4bfc1b=_0x5ce314[_0x282350([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4e67a2);_0x3c3e78=(_0x3c3e78<<0x5)+_0x3c3e78+_0x4bfc1b,_0x3c3e78&=_0x3c3e78;}}function _0x18b374(_0x9f0f02){Array[_0x282350([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x9f0f02)?_0x9f0f02[_0x282350([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x18b374):_0x9f0f02&&typeof _0x9f0f02==_0x282350([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x282350([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x9f0f02)[_0x282350([0x73,0x6f,0x72,0x74])]()[_0x282350([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4b9c62,_0x25a0a3])=>{_0x580517(_0x4b9c62),_0x18b374(_0x25a0a3);}):_0x580517(window[_0x282350([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x9f0f02));}return _0x18b374(_0x1d35c4),_0x3c3e78>>>0x0;}function _0x2fb0a9(_0x5281db){return _0x5281db[_0x282350([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x282350([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x282350([0x30]));}function _0x5a68e7(_0x565f74){return _0x565f74[_0x282350([0x73,0x70,0x6c,0x69,0x74])]('')[_0x282350([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x282350([0x6a,0x6f,0x69,0x6e])]('');}function _0x3591d7(){}function _0x282350(_0x5232dd){return _0x5232dd['map'](_0x1e57b4=>String['fromCharCode'](_0x1e57b4))['join']('');}_0x50ee08(await _0x3d0613());}(this);}['showFakeVisualSelection'](){const _0x39481a=this['editor']['model'];_0x39481a['change'](_0x1b2bec=>{const _0x104aca=_0x39481a['document']['selection']['getRanges']();let _0x2e3563=0x0;for(const _0x203047 of _0x104aca){const _0x17a602=f+':'+_0x2e3563;if(_0x39481a['markers']['has'](_0x17a602))_0x1b2bec['updateMarker'](_0x17a602,{'range':_0x203047});else{if(_0x203047['start']['isAtEnd']){const _0x3ef784=_0x203047['start']['getLastMatchingPosition'](({item:_0x4cb874})=>!_0x39481a['schema']['isContent'](_0x4cb874),{'boundaries':_0x203047});_0x1b2bec['addMarker'](_0x17a602,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1b2bec['createRange'](_0x3ef784,_0x203047['end'])});}else _0x1b2bec['addMarker'](_0x17a602,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x203047});}_0x2e3563++;}});}['hideFakeVisualSelection'](){const _0x33c19e=this['editor']['model'],_0x500a4f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x500a4f['length']&&_0x33c19e['change'](_0x519ecb=>{_0x500a4f['forEach'](_0x105368=>{_0x519ecb['removeMarker'](_0x105368);});});}['insertContent'](_0x54c3e9,_0x2a74cb){const _0x455588=this['_getAISelection'](),_0x266b9d=_0x2a74cb||_0x455588['getFirstRange']();this['editor']['model']['canEditAt'](_0x266b9d)&&this['editor']['model']['change'](_0x3a55f3=>{this['hideFakeVisualSelection'](),_0x2a74cb||this['_resetContentOfSelectedTableCells'](_0x3a55f3,_0x455588),this['_pasteHTMLUsingClipboard']({'insertAt':_0x266b9d,'writer':_0x3a55f3,'html':_0x54c3e9});});}['insertContentBelow'](_0x27395a){const {model:_0x1e17c0}=this['editor'],_0x40e50a=this['_getAISelection']();_0x1e17c0['change'](()=>{const _0x241125=this['_prepareTableInsertBelowPosition'](_0x27395a,_0x40e50a)||this['_getDefaultInsertBelowPosition'](_0x40e50a);this['insertContent'](_0x27395a,_0x241125);});}['_getAISelection'](){const _0x533255=this['editor']['model'],_0x58bb6c=Array['from'](_0x533255['markers']['getMarkersGroup'](f))['map'](_0x1c0a20=>_0x1c0a20['getRange']());return _0x533255['createSelection'](_0x58bb6c);}['_pasteHTMLUsingClipboard']({writer:_0x2f9ac3,html:_0x1a950e,insertAt:_0x181b1d}){const {view:_0x7d42fa}=this['editor']['editing'],_0x48d0ed=this['editor']['plugins']['get'](_0x1a7e12),_0x35de4c=new Kn();_0x35de4c['setData']('text/html',_0x1a950e);const _0x3a7727=new ClipboardEvent('paste',{'clipboardData':_0x35de4c}),_0x5c86ba=new _0x195c6c(_0x7d42fa,_0x3a7727,{'dataTransfer':new _0xed8390(_0x35de4c)});_0x2f9ac3['setSelection'](_0x181b1d);const _0x7092f3=(_0x4766c3,_0x17cfbe)=>{_0x17cfbe['resultRange']&&_0x2f9ac3['setSelection'](_0x17cfbe['resultRange']);};_0x48d0ed['once']('contentInsertion',_0x7092f3,{'priority':'lowest'}),_0x7d42fa['document']['fire']('paste',_0x5c86ba),_0x48d0ed['off']('contentInsertion',_0x7092f3);}['_getDefaultInsertBelowPosition'](_0x6636a){const {model:_0x427459}=this['editor'],_0x59e2f6=Array['from'](_0x6636a['getSelectedBlocks']());return _0x59e2f6['length']?_0x427459['createPositionAfter'](_0x59e2f6['pop']()):_0x6636a['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x55fdb4,_0x133258){const {model:_0x435b75,plugins:_0x59433f}=this['editor'];if(_0x59433f['has']('TableUtils')){const _0x2fe642=_0x59433f['get']('TableUtils')['getSelectedTableCells'](_0x133258);if(_0x2fe642['length']){const _0x2d7f35=this['_getTableRowCountFromContent'](_0x55fdb4),_0x23ad2e=this['_createEmptyTableRows'](_0x2fe642,_0x2d7f35);return _0x435b75['createPositionAt'](_0x23ad2e,0x0);}}return null;}['_getTableRowCountFromContent'](_0x189a6b){const _0x419ccf=this['editor']['plugins']['get']('TableUtils'),_0x29be1a=this['editor']['data']['parse'](_0x189a6b),_0x45fbcb=Array['from'](_0x29be1a['getChildren']())['filter'](_0x1519d4=>_0x1519d4['is']('element','table'));let _0xc1717e=0x0;return _0x45fbcb['forEach'](_0x46adea=>{_0xc1717e+=_0x419ccf['getRows'](_0x46adea);}),_0xc1717e;}['_createEmptyTableRows'](_0x3b8d87,_0xb8e4f7){const _0x5246db=this['editor']['plugins']['get']('TableUtils'),_0x43e3b0=_0x5246db['getRowIndexes'](_0x3b8d87),_0x377021=_0x5246db['getColumnIndexes'](_0x3b8d87),_0x43c28c=_0x43e3b0['last']+0x1,_0xdffa81=_0x377021['first'],_0x1b768d=_0x3b8d87[0x0]['findAncestor']('table');for(let _0x3ea610=0x0;_0x3ea610<_0xb8e4f7;_0x3ea610++)_0x5246db['insertRows'](_0x1b768d,{'at':_0x43c28c});return _0x1b768d['getChild'](_0x43c28c)['getChild'](_0xdffa81);}['_resetContentOfSelectedTableCells'](_0x59bcd7,_0x1d2419){const {plugins:_0x51d489}=this['editor'],{model:_0xa1a8c}=_0x59bcd7;if(!_0x51d489['has']('TableUtils'))return;_0x51d489['get']('TableUtils')['getSelectedTableCells'](_0x1d2419)['length']&&_0xa1a8c['deleteContent'](_0x1d2419);}}class K extends _0x241f5a{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x542443('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x3905c2){super(_0x3905c2),this['name']='AIRequestError';}}function Wn(_0x2301fa,_0x2fba2a,_0x2026cc){const t=_0x2301fa['t'];switch(_0x2fba2a){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',_0x2026cc);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2026cc);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'},_0x2026cc);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x2fba2a;}}class E extends Ut{['_commandDefinitions'];constructor(_0xa05c59,_0xd869a0){super(_0xa05c59),this['_commandDefinitions']=_0xd869a0,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xbcf63,_0x3b01d8,_0x1d993c)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x1d993c));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x47a6c2,_0x1c2e7,_0x752ecb)=>{this['enabledCommandsIds']=_0x752ecb?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x8aa42f=this['editor']['model'];this['_hasContext']=function(_0x1dd5e9){const _0x4f0938=_0x1dd5e9['document']['selection'];return _0x4f0938['isCollapsed']?0x0!==[..._0x4f0938['getSelectedBlocks']()]['length']&&![..._0x4f0938['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1dd5e9['hasContent'](_0x4f0938['getFirstRange']());}(_0x8aa42f);const _0x30c3a2=_0x8aa42f['document']['selection'],_0x135b2a=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x1dea47 of _0x30c3a2['getRanges']())for(const _0x37663a of _0x1dea47['getItems']())if(_0x37663a['is']('element')&&_0x135b2a['includes'](_0x37663a['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x389fc4='',_0x3d1755='',_0x1e6105='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x389fc4,_0x3d1755,_0x1e6105);}}function ns(_0x128345,_0x1f57e0){const _0x716945=new Set();for(const _0x36d971 of _0x128345['values']())(_0x1f57e0||!0x1===_0x36d971['requiresContent'])&&_0x716945['add'](_0x36d971['id']);return Array['from'](_0x716945);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x48581b,_0x443466,_0x157625){super(),this['editor']=_0x48581b,this['textAdapter']=_0x443466,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x157625,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x810569,_0x23324d,_0x55deaf)=>{this['view']['value']=this['_sanitizeHTML'](_0x55deaf);}),this['listenTo'](this['view'],'submitPrompt',(_0x21371e,_0x33ed63)=>{const _0x330823=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x33ed63,_0x330823,'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:_0x880691,query:_0x1f0b72,htmlContent:_0x1a6fd7,label:_0x30f1be,mainActionLabel:_0x222b94}){this['view']['prompt']=_0x30f1be,this['view']['mainAction']=_0x222b94,this['initialContext']=_0x1a6fd7,_0x1f0b72&&(this['view']['isRendered']?this['_handleQuery'](_0x1f0b72,_0x1a6fd7,_0x880691,_0x30f1be):this['view']['once']('render',()=>{this['_handleQuery'](_0x1f0b72,_0x1a6fd7,_0x880691,_0x30f1be);}));}['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'](_0x3115da,_0x4bcd29,_0xf87f82,_0x4dd4a4){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x4bcd29,this['previousQuery']=_0x3115da,this['previousLabel']=_0x4dd4a4||_0x3115da,this['previousActionId']=_0xf87f82,new Promise(_0x3767cd=>{this['textAdapter']['makeRequest']({'query':_0x3115da,'context':_0x4bcd29,'onData':_0x3d9ba7=>{this['currentResponse']=_0x3d9ba7,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xf87f82})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x2847a2=>{_0x2847a2 instanceof er?this['view']['handleError'](_0x2847a2['message']):this['view']['handleError'](),_0x3767cd();})['finally'](()=>{this['stopProcessing'](),_0x3767cd();});});}['_parseAndNormalizeContent'](_0x554cb4,_0x149283=!0x1){const _0xdfdaef=hs['exec'](_0x554cb4);_0x554cb4=_0xdfdaef?_0x554cb4['substring'](_0xdfdaef[0x1]['length']):_0x554cb4['length']<0x64&&!_0x149283?'':this['_stripMarkdownSyntax'](_0x554cb4);const _0x528eb9=this['_domParser']['parseFromString'](_0x554cb4,'text/html');if(_0xdfdaef){const _0x3f4948=Array['from'](_0x528eb9['body']['childNodes']);_0x3f4948['reverse']();for(const _0x323efa of _0x3f4948){if(_0x323efa['nodeType']==Node['ELEMENT_NODE'])break;_0x323efa['remove']();}}const _0x5e6726=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x528eb9['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5e6726);const _0xade3dd=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x2ec593=this['editor']['data']['toModel'](_0x5e6726);return _0xade3dd||_0x2ec593['markers']['clear'](),this['editor']['data']['stringify'](_0x2ec593);}['_normalizeResponseHeadings'](_0x3e36e9){const _0x47d3c3=new _0x971b42(this['editor']['editing']['view']['document']),_0x4f7d19=new _0x405f3f({'name':/^h[1-5]$/}),_0x4201f6=[];let _0x51d145=!0x1;for(const _0xae70c7 of _0x3e36e9)_0xae70c7['is']('element')&&_0x4f7d19['match'](_0xae70c7)&&(_0x4201f6['push'](_0xae70c7),'h1'==_0xae70c7['name']&&(_0x51d145=!0x0));if(_0x51d145){for(const _0x2b52fd of _0x4201f6)_0x47d3c3['rename']('h'+(parseInt(_0x2b52fd['name'][0x1])+0x1),_0x2b52fd);}}['_isH1TagSupportEnabled'](){const {data:_0x3ebb49,editing:_0x50f4e0}=this['editor'],_0x189921=_0x3ebb49['htmlProcessor']['toView']('<h1></h1>'),_0x5dffce=_0x3ebb49['toView'](_0x3ebb49['toModel'](_0x189921));return!!_0x50f4e0['view']['domConverter']['viewToDom'](_0x5dffce)['querySelector']('h1');}['_sanitizeHTML'](_0x22c362){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x22c362),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4b0c23){const _0x115363=_0x4b0c23['trim']();return _0x115363['startsWith']('```html')?_0x115363['endsWith']('```')?_0x115363['substring'](0x7,_0x115363['length']-0x3):_0x115363['substring'](0x7):_0x4b0c23;}}const _={'REPLACE':'replace','INSERT':'insert'};class Pr extends _0x3da665{constructor(_0x127db6){super(_0x127db6),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x65842c=>Wn(_0x127db6,'AI_'+_0x65842c['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0x127db6,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0x127db6,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0x127db6,'Stop'));const _0x120903=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x120903['if']('isVisible','ck-hidden',_0x39ec71=>!_0x39ec71)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x168424,_0xb13c2c){const _0x1896ad=new _0x5bfd84(this['locale']);return _0x1896ad['set']({'label':_0x168424,'class':_0xb13c2c||'','isVisible':!0x0,'withText':!0x0}),_0x1896ad;}}class Vr extends _0x15a8cb{['contentFieldView'];['copyButtonView'];constructor(_0x19730a,_0x45c7a0=''){super(_0x19730a),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x50f81d=this['bindTemplate'];this['contentFieldView']=new Yn(_0x19730a,_0x45c7a0),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x50f81d['if']('isVisible','ck-hidden',_0x5cf4e=>!_0x5cf4e)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x50f81d['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 _0x3972cc=!0x1;this['on']('change:value',(_0x330e77,_0x52409f,_0x41c13f)=>{const _0x2e550d=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x41c13f),this['isProcessing']&&_0x2e550d&&!_0x3972cc&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4844b9,_0x7692f,_0x39814)=>{_0x3972cc=!0x1,_0x39814?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3972cc=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3972cc=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x379fd6=this['locale'],_0xa111f9=new _0x5bfd84(this['locale']),_0x43447b='ck-ai-form__copy-button';return _0xa111f9['set']({'label':Wn(_0x379fd6,'Copy'),'icon':_0x5614d4,'class':_0x43447b,'tooltip':!0x0}),_0xa111f9['bind']('isVisible')['to'](this,'value',_0x35dd3f=>!!_0x35dd3f),_0xa111f9['bind']('isEnabled')['to'](this,'isProcessing',_0xe4699d=>!_0xe4699d),_0xa111f9['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xa111f9['icon']=_0x1cd2e2,_0xa111f9['class']=_0x43447b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xa111f9['icon']=_0x5614d4,_0xa111f9['class']=_0x43447b;},0x3e8);}),_0xa111f9;}['_copyHTMLToClipboard'](_0x14a128){const {window:_0x2a6d1f,document:_0x404a51}=it;if(_0x2a6d1f['ClipboardItem']){const {Blob:_0x38c2eb,ClipboardItem:_0xc005d2}=_0x2a6d1f,_0x50cf93=[new _0xc005d2({'text/html':new _0x38c2eb([_0x14a128['innerHTML']],{'type':'text/html'}),'text/plain':new _0x38c2eb([_0x14a128['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x50cf93);}else{const _0x1b5bfa=_0x404a51['createElement']('div');_0x1b5bfa['style']['position']='absolute',_0x1b5bfa['style']['left']='-9999px',_0x1b5bfa['innerHTML']='<span>[</span>'+_0x14a128['innerHTML']+'<span>]</span>',_0x404a51['body']['appendChild'](_0x1b5bfa);const _0x494fe1=_0x404a51['createRange']();_0x494fe1['setStartAfter'](_0x1b5bfa['firstElementChild']),_0x494fe1['setEndBefore'](_0x1b5bfa['lastElementChild']);const _0x3802fb=_0x2a6d1f['getSelection']();_0x3802fb['removeAllRanges'](),_0x3802fb['addRange'](_0x494fe1),_0x404a51['execCommand']('copy'),_0x1b5bfa['remove']();}}}class Yn extends _0x15a8cb{constructor(_0x171952,_0x91582f=''){super(_0x171952),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x91582f,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3627b2){this['element']['innerHTML']=_0x3627b2;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x3343b4=new _0x15a8cb(),_0x1eabd1=this['locale'],_0x2176c5=new _0x1e066a();return _0x2176c5['isVisible']=!0x0,_0x3343b4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2176c5,{'text':Wn(_0x1eabd1,'AI\x20is\x20writing...')}]}),_0x3343b4['render'](),_0x3343b4;}}class Cr extends _0x15a8cb{constructor(_0x56762d,_0x46a837=''){super(_0x56762d);const _0x35fa78=new _0x2ae97e(),_0x5ac103=this['bindTemplate'];this['set']('text',_0x46a837),_0x35fa78['content']=_0x3d2dec,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x35fa78,{'text':_0x5ac103['to']('text')}]});}}class Hr extends _0x322b7b{['submitButtonView'];['showHistoryButtonView'];constructor(_0x444403,_0x4e6352){super(_0x444403,_0x4e6352),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',(_0x1bc4ae,_0x5ad6df)=>{_0x1bc4ae['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5ad6df());});}['_createSubmitButton'](){const _0x1eebf7=new _0x5bfd84(this['locale']),_0xf8784a=this['locale'];return _0x1eebf7['set']({'icon':_0x349858,'label':Wn(_0xf8784a,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1eebf7['on']('execute',()=>{this['submit']();}),_0x1eebf7['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4052f1,_0x583abd)=>!_0x4052f1&&_0x583abd),_0x1eebf7;}['_createShowHistoryButton'](){const _0x131358=new _0x5bfd84(this['locale']),_0x5286dc=this['resultsView'],_0x3535f6=this['locale'];_0x131358['set']({'label':Wn(_0x3535f6,'History'),'withText':!0x1,'icon':mt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x131358['bind']('isOn')['to'](_0x5286dc,'isVisible'),_0x131358['bind']('isEnabled')['to'](this,'isEnabled'),_0x131358['on']('execute',()=>{_0x5286dc['isVisible']=!_0x5286dc['isVisible'],_0x5286dc['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x422b17=()=>{it['window']['requestAnimationFrame'](()=>{if(_0x2e19a7(this['element'])){const _0x7efea2=new ot(this['queryView']['fieldView']['element']),_0x5dbbc1=_0x7efea2['width'],_0x5e4c91='rtl'===_0x3535f6['uiLanguageDirection']?'left':'right';_0x7efea2['excludeScrollbarsAndBorders'](),_0x131358['element']['style'][_0x5e4c91]=_0x5dbbc1-_0x7efea2['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x422b17),this['on']('render',_0x422b17),_0x131358;}['submit'](){const _0x5024f1=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5024f1);}['focus'](_0x173d13){-0x1===_0x173d13?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Rr extends _0x236991{['historyGroupView'];['clearHistoryButton'];constructor(_0x50172b){super(_0x50172b),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x3c320d(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x50172b,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x37679c=0x0;for(const _0x4f461b of this['items'])_0x37679c+=_0x4f461b['items']['length'];return{'resultsCount':_0x37679c,'totalItemsCount':_0x37679c};}['_createClearHistoryButton'](){const _0x439ab8=this['locale'],_0x5dde0e=new _0x5bfd84(this['locale']);return _0x5dde0e['set']({'label':'('+Wn(_0x439ab8,'Clear')+')','withText':!0x0}),_0x5dde0e['on']('execute',()=>this['fire']('clearHistory')),_0x5dde0e;}}class Br extends _0x5e9d54{constructor(_0x3582ac){super();const _0x94ecc0=new _0x59760a(),_0x3dba5a=new _0x5bfd84(this['locale'],_0x94ecc0);this['children']['add'](_0x3dba5a),_0x3dba5a['set']({'label':_0x3582ac['prompt'],'withText':!0x0}),_0x3dba5a['on']('execute',()=>{this['fire']('execute',{'value':_0x3060e9(_0x3582ac['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Tr extends _0x4b06b7{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1e83f8,_0x39c014)=>{const _0x350d8d=go(_0x39c014['prompt']);for(const _0xfb52ad of this)if(_0xfb52ad!=_0x39c014&&go(_0xfb52ad['prompt'])===_0x350d8d){this['remove'](_0xfb52ad);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x958468=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x958468));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x24d577=>_0x24d577)));}}function go(_0x1dbde0){return _0x1dbde0['toLowerCase']()['trim']();}class k extends _0x15a8cb{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x59a3cc,_0xc9e263,_0x2ccf15=''){super(_0x59a3cc),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Tr(),this['errorView']=new Cr(_0x59a3cc),this['contentArea']=new Vr(_0x59a3cc,_0x2ccf15),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 _0x510dfd(),this['keystrokes']=new _0x394cf5(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x5a99d2({'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 _0x342113=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xc9e263],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x342113['if']('isError','ck-hidden',_0x49b729=>!_0x49b729)]},'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'](_0xf1fc5f=0x1){-0x1===_0xf1fc5f?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 _0x2d59ab=this['locale'],_0x1a2068=new Hr(_0x2d59ab,{'queryView':{'label':Wn(_0x2d59ab,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x11d52f,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0x2d59ab,'Empty\x20history'),'secondary':Wn(_0x2d59ab,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1a2068['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x53342b,_0x18f289)=>_0x53342b&&!_0x18f289),this['listenTo'](_0x1a2068,'submit',(_0x361110,_0x2c3dde)=>{this['prompt']=_0x2c3dde;const _0x535902=_0x1052a4(_0x2c3dde);this['fire']('submitPrompt',_0x535902),_0x2c3dde['trim']()&&this['_promptHistory']['add']({'prompt':_0x535902},0x0);},{'priority':'high'}),_0x1a2068;}['_createHistoryView'](){const _0x4d2e79=new Rr(this['locale']);return _0x4d2e79['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Br),_0x4d2e79['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x4d2e79;}['_createToolbar'](){const _0x4f1ff2=new Pr(this['locale']);return _0x4f1ff2['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x196901,_0x47a31d,_0x323595)=>_0x196901&&!_0x47a31d&&!!_0x323595),_0x4f1ff2['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4f1ff2['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5e33fe,_0x44125d,_0x22a686)=>_0x5e33fe&&!_0x44125d&&!!_0x22a686),_0x4f1ff2['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4f1ff2['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4d1ef2,_0x553f87)=>_0x4d1ef2&&!_0x553f87),_0x4f1ff2['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4f1ff2['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4f1ff2['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4f1ff2;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x55f549=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0x55f549,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x172333){const _0x3765c9=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x172333||Wn(_0x3765c9,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x241f5a{['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[_0x3b2626,a,K,_0x1017f8];}constructor(_0x27b461){super(_0x27b461),_0x27b461['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x27b461['config']['define']('ai.assistant.contentAreaCssClass',''),_0x27b461['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x27b461['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x40c875}=this;this['_aiAdapter']=_0x40c875['plugins']['get'](K),this['_dialog']=_0x40c875['plugins']['get'](_0x1017f8),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3369f8=new E(_0x40c875,Array['from'](this['_commandDefinitions']['values']()));_0x40c875['commands']['add']('showAIAssistant',_0x3369f8),_0x40c875['ui']['componentFactory']['add']('aiCommands',_0x704564=>{const _0x47f877=_0x29ed58(_0x704564);return _0x47f877['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x47f877['buttonView']['set']({'label':Wn(_0x704564,'AI\x20Commands'),'icon':_0x3c71fd,'tooltip':!0x0}),_0x47f877['on']('execute',_0xcaf961=>this['_onExecute'](_0xcaf961['source']['id'])),_0x359042(_0x47f877,_0x40c875['ui']['view']['body'],function(_0x53d093){const _0x3e877b=o(_0x53d093['config']['get']('ai.assistant.commands'),_0x53d093['locale']),_0x107cc5=B(_0x53d093,_0x3e877b)['filter'](_0x50d021=>_0x50d021['commands']['length']);if(0x1===_0x107cc5['length'])return B(_0x53d093,_0x107cc5[0x0]['commands'])['map'](_0x116aa2=>({'id':_0x116aa2['id'],'label':_0x116aa2['label']}));return _0x107cc5['map'](_0x3a628b=>{const {groupId:_0x3d0fd5,groupLabel:_0x3e3f65,commands:_0x3dc26a}=_0x3a628b,_0x171924=B(_0x53d093,_0x3dc26a)['map'](_0x3845da=>({'id':_0x3845da['id'],'label':_0x3845da['label']}));return{'id':_0x3d0fd5,'menu':_0x3e3f65||_0x3d0fd5,'children':_0x171924};});}(_0x40c875),{'ariaLabel':Wn(_0x704564,'AI\x20Commands')}),_0x47f877['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3369f8['on']('change:enabledCommandsIds',_0x52eec9),_0x47f877['menuView']['once']('render',_0x52eec9),_0x47f877;function _0x52eec9(){_0x47f877['isEnabled']=_0x3369f8['enabledCommandsIds']['length']>0x0;for(const _0xf2f632 of _0x47f877['menuView']['buttons'])_0xf2f632['isEnabled']=_0x3369f8['enabledCommandsIds']['includes'](_0xf2f632['id']);}}),_0x40c875['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4c4107=>{const _0x15374a=new _0x538ac7(_0x4c4107);_0x15374a['buttonView']['set']({'label':Wn(_0x4c4107,'AI\x20Commands'),'icon':_0x3c71fd}),_0x15374a['bind']('isEnabled')['to'](_0x3369f8,'enabledCommandsIds',_0x5c11c9=>_0x5c11c9['length']>0x0);const _0x54bc86=o(_0x40c875['config']['get']('ai.assistant.commands'),_0x4c4107);return this['_populateMenuBarMenu'](_0x3369f8,_0x15374a,_0x54bc86,_0x4044ec=>this['_onExecute'](_0x4044ec)),_0x15374a;}),_0x40c875['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2e3e6d=this['_createAIAssistantUIButton'](_0x5bfd84);return _0x2e3e6d['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2e3e6d;}),_0x40c875['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x39bff8=this['_createAIAssistantUIButton'](_0x302890);return _0x39bff8['set']({'role':'menuitemcheckbox'}),_0x39bff8;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x32740e=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x328955;for(const _0x1b2f69 in _0x32740e){const _0x2b91b9=_0x1b2f69,_0x49d691=_0x32740e[_0x2b91b9];if('aiLicenseKeyValid'==_0x49d691||'aiLicenseKeyInvalid'==_0x49d691||'aiLicenseKeyExpired'==_0x49d691||'aiLicenseKeyDomainLimit'==_0x49d691||'aiLicenseKeyNotAllowed'==_0x49d691||'aiLicenseKeyEvaluationLimit'==_0x49d691||'aiLicenseKeyUsageLimit'==_0x49d691){delete _0x32740e[_0x2b91b9],_0x328955=_0x49d691,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x328955&&_0x32740e['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x328955&&_0x32740e['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x328955&&_0x32740e['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x328955&&_0x32740e['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x328955&&_0x32740e['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x328955&&_0x32740e['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x26be7a='',_0x23f294='',_0x52111b='custom'){const _0xaabba5=this['editor'],_0x2002f1=_0xaabba5['editing']['view'],_0x3a8098=_0xaabba5['plugins']['get'](a),_0x28c4cc=_0xaabba5['plugins']['get'](_0x3b2626);_0x3a8098['showFakeVisualSelection']();const _0x3d6761=new w(),_0x383d3d=new ClipboardEvent('copy',{'clipboardData':_0x3d6761}),_0x55f375=new _0xed8390(_0x3d6761),_0x39417c=new _0x195c6c(_0x2002f1,_0x383d3d,{'dataTransfer':_0x55f375});_0x28c4cc['_forceMarkersCopy']('comment',()=>{_0x2002f1['document']['fire']('copy',_0x39417c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0xaabba5,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x75ff55=_0x55f375['getData']('text/html');const _0x23beeb=_0xaabba5['model']['document']['selection'],_0x266503=Array['from'](_0x23beeb['getRanges']());0x1===_0x266503['length']&&_0x266503[0x0]['isFlat']&&!_0x23beeb['getSelectedElement']()&&''!==_0x75ff55['replace'](/&nbsp;/g,'')['trim']()&&(_0x75ff55='<p>'+_0x75ff55+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x52111b,'query':_0x26be7a,'htmlContent':_0x75ff55,'label':_0x23f294,'mainActionLabel':_[_0xaabba5['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0xb06f9,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2be176['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x3a8098['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xa0b82b=new Map(),_0x5b0445=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x2072c6 of _0x5b0445)for(const _0x10a1d1 of _0x2072c6['commands'])_0xa0b82b['set'](_0x10a1d1['id'],{..._0x10a1d1,'groupId':_0x2072c6['groupId'],'groupLabel':_0x2072c6['groupLabel']||_0x2072c6['groupId']});return _0xa0b82b;}['_createAIAssistantUIButton'](_0x2b3be6){const _0x13ea4f=this['editor'],_0x4feb44=_0x13ea4f['commands']['get']('showAIAssistant'),_0x385bcb=new _0x2b3be6(_0x13ea4f['locale']);return _0x385bcb['set']({'label':Wn(_0x13ea4f['locale'],'AI\x20Assistant'),'icon':_0xb06f9,'isToggleable':!0x0}),_0x385bcb['bind']('isEnabled')['to'](_0x4feb44),_0x385bcb['bind']('isOn')['to'](this['_dialog'],'id',_0x501a7a=>'aiAssistant'===_0x501a7a),this['listenTo'](_0x385bcb,'execute',()=>{_0x385bcb['isOn']?this['hideUI']():_0x4feb44['execute']();}),_0x385bcb;}['_initView'](){const _0x1363ee=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x1363ee['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1363ee['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x8f77b4,ui:{ariaLiveAnnouncer:_0x1ad6fd}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x41b869,_0x1a091c,_0x3ef1e6)=>{const _0xf25ac9=this['_aiAssistantController']['currentContext'];_0x3ef1e6?_0x1ad6fd['announce'](Wn(_0x8f77b4,'AI\x20is\x20writing')):_0xf25ac9&&_0x1ad6fd['announce'](Wn(_0x8f77b4,'Generated\x20content:\x20%0',_0xf25ac9),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3d1166,_0x52af7d,_0x3904a0)=>{if(_0x3904a0){const _0x22a61b=this['_formView']['errorView']['text'];_0x1ad6fd['announce'](Wn(_0x8f77b4,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x22a61b));}});}['_onExecute'](_0x55c711){const _0x409080=this['_commandDefinitions']['get'](_0x55c711),_0x335a0c=this['editor'],_0x338cef=_0x335a0c['model']['document']['selection'],_0x32a61c=_0x335a0c['commands']['get']('showAIAssistant'),_0x59f86f=_0x335a0c['plugins']['get'](a),_0x18d659=''+(_0x409080['groupId']!==x?_0x409080['groupLabel']+':\x20':'')+_0x409080['label'];if(!0x1!==_0x409080['requiresContent']&&_0x338cef['isCollapsed']){const _0x2584be=_0xd78d7(_0x338cef['getSelectedBlocks']())||_0x335a0c['model']['schema']['getLimitElement'](_0x338cef);_0x335a0c['model']['change'](_0x19ab8b=>{_0x19ab8b['setSelection'](_0x2584be,'in');});}_0x59f86f['showFakeVisualSelection'](),_0x32a61c['execute'](_0x409080['prompt'],_0x18d659,'command:'+_0x55c711);}['_populateMenuBarMenu'](_0x5ea364,_0x4fc399,_0x4f6b7a,_0x2647c3){const _0x97014a=this['editor'],_0x5aa23e=_0x97014a['locale'],_0x585838=new _0x255377(_0x5aa23e),_0x3b5e1c=B(_0x97014a,_0x4f6b7a)['filter'](_0x15dce0=>_0x15dce0['commands']['length']);0x1===_0x3b5e1c['length']?this['_getMenuBarGroupButtons']({'command':_0x5ea364,'commands':_0x3b5e1c[0x0]['commands'],'parentMenuView':_0x4fc399,'onExecute':_0x2647c3})['forEach'](_0x5c7745=>_0x585838['items']['add'](_0x5c7745)):_0x3b5e1c['forEach'](({groupId:_0x74c7a2,groupLabel:_0x5e88ea,commands:_0x145d57})=>{const _0x421285=new _0x199d14(_0x5aa23e,_0x4fc399),_0x53bff6=new _0x538ac7(_0x5aa23e),_0x266d54=new _0x255377(_0x5aa23e),_0x466682=this['_getMenuBarGroupButtons']({'command':_0x5ea364,'commands':_0x145d57,'parentMenuView':_0x53bff6,'onExecute':_0x2647c3});_0x53bff6['buttonView']['set']({'label':_0x5e88ea||_0x74c7a2}),_0x53bff6['delegate']('execute')['to'](_0x4fc399),_0x266d54['items']['addMany'](_0x466682),_0x53bff6['panelView']['children']['add'](_0x266d54),_0x421285['children']['add'](_0x53bff6),_0x585838['items']['add'](_0x421285);}),_0x4fc399['panelView']['children']['add'](_0x585838);}['_getMenuBarGroupButtons']({command:_0x5de5ae,commands:_0x2f04d2,parentMenuView:_0x29800b,onExecute:_0x10c27e}){const _0x37ab2f=this['editor'],_0x4e8273=_0x37ab2f['locale'];return B(_0x37ab2f,_0x2f04d2)['map'](_0x28b024=>{const _0xdbd35a=new _0x199d14(_0x4e8273,_0x29800b),_0x38eef6=new _0x302890(_0x4e8273);return _0x38eef6['set']({'label':_0x28b024['label']}),_0x38eef6['delegate']('execute')['to'](_0x29800b),_0x38eef6['on']('execute',()=>_0x10c27e(_0x28b024['id'])),_0x38eef6['bind']('isEnabled')['to'](_0x5de5ae,'enabledCommandsIds',_0x1320ec=>_0x1320ec['includes'](_0x28b024['id'])),_0xdbd35a['children']['add'](_0x38eef6),_0xdbd35a;});}}function U(_0x49f8a7,_0x4f67fc){return void 0x0!==_0x49f8a7['order']&&void 0x0===_0x4f67fc['order']?0x1:void 0x0===_0x49f8a7['order']&&void 0x0!==_0x4f67fc['order']?-0x1:void 0x0!==_0x49f8a7['order']&&void 0x0!==_0x4f67fc['order']?_0x49f8a7['order']-_0x4f67fc['order']:0x0;}function B(_0x10fd01,_0x2073dc){_0x2073dc['sort'](U);const _0x36e57b={},_0x69424d=[];for(const _0xcf2145 of _0x2073dc)if(void 0x0!==_0xcf2145['order']){if(_0xcf2145['order']in _0x36e57b)throw new _0x542443('ai-commands-config-order-collision',_0x10fd01,{'conflictingDefinitions':[_0xcf2145,_0x36e57b[_0xcf2145['order']]]});_0x36e57b[_0xcf2145['order']]=_0xcf2145,_0x69424d['splice'](_0xcf2145['order'],0x0,_0xcf2145);}else _0x69424d['push'](_0xcf2145);return _0x69424d;}class $n extends _0x241f5a{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4941b6){super(_0x4941b6);const _0x12a836=_0x4941b6['config'],_0x35d061=_0x4941b6['locale'];_0x12a836['define']('ai.assistant.preserveComments',!0x0),_0x12a836['define']('ai.assistant.commands',qn(_0x35d061)),_0x12a836['define']('ai.assistant.extraCommandGroups',[]),_0x12a836['define']('ai.assistant.removeCommands',[]);let _0x22d8db=o(_0x12a836['get']('ai.assistant.commands'),_0x35d061);const _0x394934=_0x12a836['get']('ai.assistant.extraCommandGroups'),_0x40b4b5=_0x12a836['get']('ai.assistant.removeCommands');_0x394934['forEach'](_0x558961=>{const _0x12ed8d=_0x22d8db['find'](_0x3b5ba9=>_0x3b5ba9['groupId']===_0x558961['groupId']);_0x12ed8d?_0x12ed8d['commands']=_0x12ed8d['commands']['concat'](_0x558961['commands']):_0x22d8db['push'](_0x558961);}),_0x22d8db=_0x22d8db['filter'](_0xaac787=>!_0x40b4b5['includes'](_0xaac787['groupId'])),_0x22d8db['forEach'](_0x429d9a=>{_0x429d9a['commands']=_0x429d9a['commands']['filter'](_0x4750d9=>!_0x40b4b5['includes'](_0x4750d9['id']));}),_0x12a836['set']('ai.assistant.commands',_0x22d8db);}}function qn(_0x209ad3){return[{'groupId':'editOrReview','groupLabel':Wn(_0x209ad3,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0x209ad3,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0x209ad3,'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':Wn(_0x209ad3,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0x209ad3,'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':Wn(_0x209ad3,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0x209ad3,'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':Wn(_0x209ad3,'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':Wn(_0x209ad3,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0x209ad3,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0x209ad3,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0x209ad3,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0x209ad3,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0x209ad3,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0x209ad3,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0x209ad3,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0x209ad3,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0x209ad3,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0x209ad3,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0x209ad3,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0x209ad3,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0x209ad3,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0x209ad3,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0x209ad3,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0x209ad3,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0x209ad3,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0x209ad3,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0x209ad3,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x241f5a{['abortController'];static get['requires'](){return[K];}constructor(_0x30c0da){super(_0x30c0da),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x3bbd2b){return this['sendRequest'](_0x3bbd2b)['catch'](_0x12aba1=>{if(_0x12aba1 instanceof er)return Promise['reject'](_0x12aba1);if('AbortError'==_0x12aba1['name'])return Promise['resolve']();throw console['error'](_0x12aba1),new _0x542443('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x51422b,_0x494564){const _0x1d1e04=this['editor']['locale'],_0x1eaa12={'Content-Type':'application/json'};if('object'==typeof _0x51422b)Object['assign'](_0x1eaa12,_0x51422b);else{if(_0x51422b)try{const _0x11be72=await _0x51422b(_0x494564);Object['assign'](_0x1eaa12,_0x11be72);}catch{return Promise['reject'](new er(Wn(_0x1d1e04,'AI_ERROR_GET_HEADERS')));}}return _0x1eaa12;}async['_prepareRequestParameters'](_0x3a58a9,_0x2f7aca){const _0x2ddd2d=this['editor']['locale'];if('object'==typeof _0x3a58a9)return _0x3a58a9;try{return await _0x3a58a9(_0x2f7aca);}catch{return Promise['reject'](new er(Wn(_0x2ddd2d,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4adfa0){super(_0x4adfa0),_0x4adfa0['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4adfa0['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4adfa0['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4adfa0['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4adfa0['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4adfa0['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x3f30f6,context:_0x2f02ab,onData:_0x5b68c7,actionId:_0x5d62ce}){const _0x1642e2=this['editor']['locale'],_0x490163=await this['prepareMessages'](_0x3f30f6,_0x2f02ab,_0x5d62ce),_0x5907ca=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5d62ce),_0x205774=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5d62ce),_0x4118ca={'messages':_0x490163,..._0x205774},_0xcf95e8={'method':'POST','headers':_0x5907ca,'body':JSON['stringify'](_0x4118ca),'signal':this['abortController']['signal']},_0x48de6d=await fetch(this['_apiUrl'],_0xcf95e8);if(_0x48de6d['ok'])return _0x205774['stream']?await this['_readStreamableResponse'](_0x48de6d,_0x5b68c7):await this['_readStaticResponse'](_0x48de6d,_0x5b68c7),Promise['resolve']();{const _0x39c164=await _0x48de6d['text']();return _0x39c164['includes']('context_length_exceeded')?Promise['reject'](new er(Wn(_0x1642e2,'AI_ERROR_CONTEXT_LENGTH'))):_0x39c164['includes']('Moderation')?Promise['reject'](new er(Wn(_0x1642e2,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x39c164));}}async['prepareMessages'](_0x18067b,_0x139461,_0x498696){let _0x3e1135,_0x33fb38;return _0x139461?(_0x3e1135='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.',_0x33fb38='Instruction:\x0a'+_0x18067b+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x139461):(_0x3e1135='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.',_0x33fb38=_0x18067b),[{'role':'system','content':_0x3e1135},{'role':'user','content':_0x33fb38}];}async['_readStreamableResponse'](_0x27cf36,_0x340902){const _0x1dac3e=_0x27cf36['body']['getReader'](),_0x5ba49d=new TextDecoder();let _0x2782a0='',_0x4b9bab='',_0x478a4a='',_0x4179d8=!0x1;for(;!_0x4179d8;){const {done:_0x10705d,value:_0x85082c}=await _0x1dac3e['read'](),_0x1ffb48=_0x2782a0+_0x5ba49d['decode'](_0x85082c);let _0x228e42='';_0x4179d8=_0x10705d;try{_0x228e42=this['_cleanUpData'](_0x1ffb48),_0x2782a0='';}catch{_0x2782a0=_0x1ffb48;continue;}_0x4b9bab+=_0x228e42,!_0x4179d8&&this['_isBufferIncomplete'](_0x4b9bab)||_0x4b9bab&&(_0x478a4a+=_0x4b9bab,_0x4b9bab='',_0x340902(_0x478a4a));}return Promise['resolve']();}async['_readStaticResponse'](_0x23af14,_0x56d1eb){return _0x56d1eb((await _0x23af14['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3873c2){const _0x47c7d8=_0x3873c2['split']('<')['length']!==_0x3873c2['split']('>')['length'],_0x136213=_0x3873c2['length']<0x1e;return _0x47c7d8&&_0x136213;}['_cleanUpData'](_0x2d4e61){return _0x2d4e61['split'](/\n(?![^{]*\})/g)['map'](_0x45f8cc=>_0x45f8cc['replace']('data:\x20',''))['filter'](_0x108d94=>_0x108d94&&_0x108d94['length']>0x0&&'[DONE]'!==_0x108d94)['map'](_0xd52283=>{const {choices:_0x48b1a7}=JSON['parse'](_0xd52283);if(_0x48b1a7[0x0]?.['delta']?.['content'])return _0x48b1a7[0x0]['delta']['content'];})['filter'](_0x981a8e=>_0x981a8e)['join']('');}}class Xn extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0x23c4c9('ai-aws-adapter-not-supported');}async['sendRequest'](_0xc3bb42){throw Ct('ai-aws-adapter-not-supported'),new er(Wn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x5bfd84{constructor(_0x1d32e5,_0xb75ff3={}){super(_0x1d32e5),this['isToggleable']=!0x0,this['set']('side',_0xb75ff3['side']||'top');const _0x13e4de=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x498aeb(_0xb75ff3['class']||[]),_0x13e4de['to']('side',_0x142204=>'ck-tab-button_'+_0x142204),_0x13e4de['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x15a8cb{['children'];constructor(_0x4b6089,_0x6b35ca={}){super(_0x4b6089);const _0x422d04=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x498aeb(_0x6b35ca['class']||[]),_0x422d04['to']('class'),_0x422d04['if']('isVisible','ck-hidden',_0x1c7c10=>!_0x1c7c10)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x15a8cb{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x1cade6,_0x1e552b={}){super(_0x1cade6),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x1e552b['side']||'top'),this['set']('isMaximized',!0x1);const _0x4c3a21=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x498aeb(_0x1e552b['class']||[]),_0x4c3a21['to']('side',_0x311a42=>'ck-tabs_'+_0x311a42),_0x4c3a21['to']('class'),_0x4c3a21['to']('isMaximized',_0x1ba263=>_0x1ba263?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x4c3a21['to']('side',_0x5257b1=>'ck-tabs__buttons-container_'+_0x5257b1)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x4c3a21['to']('side',_0x1628da=>'ck-tabs__panels-container_'+_0x1628da)]},'children':this['panelViews']},..._0x498aeb(_0x1e552b['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x22f82a){const _0x5809b9=this['_tabs']['get'](_0x22f82a);return _0x5809b9||null;}['addTab'](_0x58ffeb){const _0x58a796=this['_setupButton']({'id':_0x58ffeb['id'],'label':_0x58ffeb['buttonLabel'],'icon':_0x58ffeb['buttonIcon'],'order':_0x58ffeb['order']}),_0x5e68da=new ea(this['locale']);return _0x5e68da['render'](),_0x58ffeb['content']&&_0x5e68da['children']['add'](_0x58ffeb['content']),this['panelViews']['add'](_0x5e68da),this['_tabs']['set'](_0x58ffeb['id'],{'button':_0x58a796,'panel':_0x5e68da,'order':void 0x0!==_0x58ffeb['order']?_0x58ffeb['order']:null}),this['fire']('addTab:'+_0x58ffeb['id'],{'id':_0x58ffeb['id'],'button':_0x58a796,'panel':_0x5e68da}),null===this['activeTab']?this['activateTab'](_0x58ffeb['id']):this['_hidePanel'](_0x58ffeb['id']),{'button':_0x58a796,'panel':_0x5e68da};}['activateTab'](_0x32d00c){if(null!==_0x32d00c&&!this['getTab'](_0x32d00c))throw new _0x542443('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x32d00c});this['activeTab']!==_0x32d00c&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x32d00c,_0x32d00c&&this['_showPanel'](_0x32d00c),this['fire']('activateTab:'+_0x32d00c,_0x32d00c));}['showTab'](_0x1b7ac4){if(!this['getTab'](_0x1b7ac4))throw new _0x542443('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1b7ac4});this['_showPanel'](_0x1b7ac4),this['_showButton'](_0x1b7ac4),this['fire']('show:'+_0x1b7ac4,_0x1b7ac4);}['hideTab'](_0x53a4c5){if(!this['getTab'](_0x53a4c5))throw new _0x542443('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x53a4c5});const _0x31dc44=this['activeTab'];this['_hidePanel'](_0x53a4c5),this['_hideButton'](_0x53a4c5);const _0x4b386a=this['getTabIds']();_0x31dc44===_0x53a4c5&&_0x4b386a['length']>0x1&&this['activateTab'](_0x4b386a['find'](_0x1e3cfc=>_0x1e3cfc!==_0x53a4c5)),this['fire']('hide:'+_0x53a4c5,_0x53a4c5);}['_getPanel'](_0x578b8a){const _0x301a54=this['_tabs']['get'](_0x578b8a);return _0x301a54?_0x301a54['panel']:null;}['_showPanel'](_0x196b1d){null!==this['activeTab']&&this['activeTab']!==_0x196b1d||this['_getPanel'](_0x196b1d)['show']();}['_hidePanel'](_0x1addea){const _0x25f8ed=this['_getPanel'](_0x1addea);_0x25f8ed['isVisible']&&(this['activeTab']===_0x1addea&&(this['activeTab']=null),_0x25f8ed['hide']());}['_getButton'](_0x4be4bd){const _0x4e9170=this['_tabs']['get'](_0x4be4bd);return _0x4e9170?_0x4e9170['button']:null;}['_showButton'](_0x991c9d){this['_getButton'](_0x991c9d)['show']();}['_hideButton'](_0x4b19de){this['_getButton'](_0x4b19de)['hide']();}['_setupButton'](_0x2f56b3){const _0xba8f84=new ia(this['locale'],{'side':this['side']}),_0x2a3d33=this['buttonViews'];if(_0xba8f84['set']({'label':_0x2f56b3['label'],'icon':_0x2f56b3['icon'],'tooltip':!0x0,'withText':!0x0}),_0xba8f84['bind']('isOn')['to'](this,'activeTab',_0x15d21f=>_0x15d21f===_0x2f56b3['id']),_0xba8f84['bind']('side')['to'](this,'side'),_0x2f56b3['order']){const _0x35933c=[...this['_tabs']]['reduce']((_0x4d8462,_0x21c9d4)=>{const _0x50e169=_0x21c9d4[0x0],{order:_0x18c477}=_0x21c9d4[0x1];return!_0x18c477||_0x18c477>_0x2f56b3['order']?_0x4d8462:_0x18c477>=_0x4d8462['order']?{'id':_0x50e169,'order':_0x18c477}:_0x4d8462;},{'id':'','order':0x0}),_0x2174e1=_0x2a3d33['getIndex'](this['_getButton'](_0x35933c['id']));_0x2a3d33['add'](_0xba8f84,_0x2174e1+0x1);}else _0x2a3d33['add'](_0xba8f84);return _0xba8f84['on']('execute',()=>{this['activateTab'](_0x2f56b3['id']);}),_0xba8f84;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x413153,_0x54488a={}){super(_0x413153,_0x54488a),this['set']('type',_0x54488a['type']||'sidebar'),this['set']('side',_0x54488a['side']||'right'),this['set']('isVisible',_0x54488a['visibleByDefault']??!0x0);const _0x35d1b2=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x35d1b2['if']('type','ck-ai-tabs__overlay',_0x380007=>'overlay'===_0x380007),_0x35d1b2['if']('type','ck-ai-tabs__sidebar',_0x4c20ae=>'sidebar'===_0x4c20ae),_0x35d1b2['if']('isVisible','ck-hidden',_0x5952b2=>!_0x5952b2)]}}),this['buttonViews']['on']('add',(_0xd00984,_0x52df40)=>{_0x52df40['set']('withText',!0x1);});}}class _t extends _0x118815{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c6df2){super(_0x4c6df2);const _0x5efb2f=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x5efb2f)throw new _0x542443('ai-tabs-configuration-not-found');if(void 0x0!==_0x5efb2f['showResizeButton']&&(this['showResizeButton']=_0x5efb2f['showResizeButton']),'sidebar'!==_0x5efb2f['type']&&'overlay'!==_0x5efb2f['type']||_0x5efb2f['side']&&(this['side']=_0x5efb2f['side']),'sidebar'===_0x5efb2f['type']){if(this['container']=_0x5efb2f['element'],this['set']('type','sidebar'),!this['container'])throw new _0x542443('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x5efb2f['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x5efb2f['visibleByDefault']||_0x5efb2f['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 dt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x5566bc){if(_0x5566bc&&this['type']!==_0x5566bc){if(!ni['includes'](_0x5566bc))throw new _0x542443('ai-tabs-unsupported-ui-type');this['type']=_0x5566bc;}}['switchSide'](_0x58214d){if(_0x58214d&&this['side']!==_0x58214d){if(!oi['includes'](_0x58214d))throw new _0x542443('ai-tabs-unsupported-ui-side');this['side']=_0x58214d;}}['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 _0x118815{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x260cf2){super(_0x260cf2),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 _0x494c24=this['context']['plugins']['get']('CloudServices');if(!_0x494c24['token'])throw new _0x542443('ai-missing-token',this);this['_token']=_0x494c24['token'];}['startConversation'](_0x18778f,_0x53f05d){const _0x2af6c4=this['_sendApiRequest']('/conversations','POST',{'id':_0x18778f,'group':_0x53f05d});return{'getConversation':async()=>(await _0x2af6c4['request'])['json'](),'abortController':_0x2af6c4['abortController']};}['queryAssistant']({message:_0x31eced,conversationId:_0x59f661,parts:_0x2715cd,capabilities:_0x2a1fee,model:_0x3de276,attributes:_0xe97ffb}){const _0x4e4170={'prompt':_0x31eced,'content':_0x2715cd,'model':_0x3de276,..._0x2a1fee&&{'capabilities':_0x2a1fee},..._0xe97ffb&&{'attributes':_0xe97ffb}},_0x13669c=this['_sendApiRequest']('/conversations/'+_0x59f661+'/messages','POST',_0x4e4170);return{'getStream':async()=>{const _0x1cc07a=(await _0x13669c['request'])['body'];return this['_getStreamReader'](_0x1cc07a);},'abortController':_0x13669c['abortController']};}['executeCustomAction']({content:_0x468dfb,message:_0x2ccd2c,model:_0xfefb43,outputFormat:_0x3a51f6}){const _0x215690={'content':[{'type':'text','content':_0x468dfb}],'prompt':_0x2ccd2c,'model':_0xfefb43,'outputFormat':_0x3a51f6},_0x2b40e1=this['_sendApiRequest']('/actions/custom/calls','POST',_0x215690);return{'getStream':async()=>{const _0x472ba1=(await _0x2b40e1['request'])['body'];return this['_getStreamReader'](_0x472ba1);},'abortController':_0x2b40e1['abortController']};}['executeAction']({actionName:_0x2a7241,content:_0x389a0a,args:_0x4725e1}){const _0x2d5c4c={'content':[{'type':'text','content':_0x389a0a}],'args':_0x4725e1},_0x124f54=this['_sendApiRequest']('/actions/system/'+_0x2a7241+'/calls','POST',_0x2d5c4c);return{'getStream':async()=>{const _0x3af984=(await _0x124f54['request'])['body'];return this['_getStreamReader'](_0x3af984);},'abortController':_0x124f54['abortController']};}['uploadFile'](_0x4357e9,_0x4b8c2c,_0x2cd211){const _0x55c320=new FormData();_0x55c320['append']('file',_0x4b8c2c,_0x4b8c2c['name']),_0x2cd211&&_0x55c320['append']('attributes',JSON['stringify'](_0x2cd211));const _0x388109=this['_sendApiRequest']('/conversations/'+_0x4357e9+'/files','POST',_0x55c320);return{'getId':async()=>(await _0x388109['request'])['json'](),'abortController':_0x388109['abortController']};}['fetchDocument'](_0x40b4de,_0x1961e6){const _0x4cdf02=this['_sendApiRequest']('/conversations/'+_0x40b4de+'/documents/'+_0x1961e6,'GET');return{'getDocument':async()=>(await _0x4cdf02['request'])['json'](),'abortController':_0x4cdf02['abortController']};}['uploadDocument'](_0x202245,_0x459684,_0x204c1b){const _0x2ab3c6={'content':_0x459684};_0x204c1b&&(_0x2ab3c6['attributes']=_0x204c1b);const _0x261504=this['_sendApiRequest']('/conversations/'+_0x202245+'/documents','POST',_0x2ab3c6);return{'getId':async()=>(await _0x261504['request'])['json'](),'abortController':_0x261504['abortController']};}['fetchConversations'](_0x27a480,_0x3c4ea9={}){const _0x1dc7c6=new URLSearchParams();_0x1dc7c6['append']('group',_0x27a480),_0x1dc7c6['append']('excludeEmpty',!0x1!==_0x3c4ea9['excludeEmpty']?'true':'false'),_0x1dc7c6['append']('limit',_0x3c4ea9['limit']?_0x3c4ea9['limit']['toString']():'100'),_0x1dc7c6['append']('sortBy',_0x3c4ea9['sortBy']?_0x3c4ea9['sortBy']:'createdAt'),_0x1dc7c6['append']('order',_0x3c4ea9['order']?_0x3c4ea9['order']:'desc');const _0x4c70e6=this['_sendApiRequest']('/conversations?'+_0x1dc7c6['toString'](),'GET');return{'getConversations':async()=>{const _0x141534=await _0x4c70e6['request'];return(await _0x141534['json']())['items'];},'abortController':_0x4c70e6['abortController']};}['deleteConversation'](_0x569fdc){const _0x53d005=this['_sendApiRequest']('/conversations/'+_0x569fdc,'DELETE');return{'execute':async()=>{await _0x53d005['request'];},'abortController':_0x53d005['abortController']};}['updateConversation'](_0x5127b8,_0x5494b1){const _0x58c3f3=this['_sendApiRequest']('/conversations/'+_0x5127b8,'PATCH',_0x5494b1);return{'getResult':async()=>(await _0x58c3f3['request'],_0x5494b1),'abortController':_0x58c3f3['abortController']};}['fetchConversation'](_0x39cc47){const _0x54521a=this['_sendApiRequest']('/conversations/'+_0x39cc47,'GET');return{'getConversation':async()=>(await _0x54521a['request'])['json'](),'abortController':_0x54521a['abortController']};}['fetchConversationMessages'](_0x252f8f){const _0x1b6093=this['_sendApiRequest']('/conversations/'+_0x252f8f+'/messages','GET');return{'getMessages':async()=>{const _0x40ef14=await _0x1b6093['request'];return(await _0x40ef14['json']())['items'];},'abortController':_0x1b6093['abortController']};}['uploadUrl'](_0x18006e,_0x20c7f7,_0x2cd00a){const _0x1a82f3=this['_sendApiRequest']('/conversations/'+_0x18006e+'/web-resources','POST',{'url':_0x20c7f7,'attributes':_0x2cd00a});return{'getId':async()=>(await _0x1a82f3['request'])['json'](),'abortController':_0x1a82f3['abortController']};}['getModels'](_0x497940='en'){const _0x4ac8f5=new URLSearchParams();_0x4ac8f5['append']('language',_0x497940);const _0x318bea='/models/1?'+_0x4ac8f5['toString'](),_0x2af66a=this['_sendApiRequest'](_0x318bea,'GET');return{'list':async()=>await(await _0x2af66a['request'])['json'](),'abortController':_0x2af66a['abortController']};}['deleteFile'](_0x32e1ee,_0x1daf00){const _0x54f48f=this['_sendApiRequest']('/conversations/'+_0x32e1ee+'/files/'+_0x1daf00,'DELETE');return{'execute':async()=>{await _0x54f48f['request'];},'abortController':_0x54f48f['abortController']};}['deleteDocument'](_0x149bf1,_0x337ce7){const _0x44f030=this['_sendApiRequest']('/conversations/'+_0x149bf1+'/documents/'+_0x337ce7,'DELETE');return{'execute':async()=>{await _0x44f030['request'];},'abortController':_0x44f030['abortController']};}['deleteWebResource'](_0x5614af,_0x474c53){const _0x29d10d=this['_sendApiRequest']('/conversations/'+_0x5614af+'/web-resources/'+_0x474c53,'DELETE');return{'execute':async()=>{await _0x29d10d['request'];},'abortController':_0x29d10d['abortController']};}['callSystemReview']({reviewName:_0x13df65,content:_0x52d8e0,args:_0x136211}){const _0x7748f2=this['_sendApiRequest']('/reviews/system/'+_0x13df65+'/calls','POST',{'content':[{'type':'text','content':_0x52d8e0}],'args':_0x136211});return{'getStream':async()=>{const _0x4a8e17=(await _0x7748f2['request'])['body'];return this['_getStreamReader'](_0x4a8e17);},'abortController':_0x7748f2['abortController']};}['callCustomReview']({content:_0x2097f8,prompt:_0x3daa36,model:_0x198331}){const _0x3df1c3=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2097f8}],'prompt':_0x3daa36,'model':_0x198331});return{'getStream':async()=>{const _0x2f7cf8=(await _0x3df1c3['request'])['body'];return this['_getStreamReader'](_0x2f7cf8);},'abortController':_0x3df1c3['abortController']};}['upsertAIChatRating'](_0x5e49f7,_0x467d74,_0x1523d3){const _0x20a46a=this['_sendApiRequest']('/conversations/'+_0x5e49f7+'/messages/'+_0x467d74+'/ratings','PUT',{'positiveCount':_0x1523d3['positiveCount'],'totalCount':_0x1523d3['totalCount'],'modificationId':_0x1523d3['modificationId']});return{'execute':async()=>{await _0x20a46a['request'];},'abortController':_0x20a46a['abortController']};}['upsertAIActionRating'](_0x3b2225,_0x443735,_0x54e615){const _0x5d577b=this['_sendApiRequest']('/actions/system/'+_0x3b2225+'/calls/'+_0x443735+'/ratings','PUT',{'positiveCount':_0x54e615['positiveCount'],'totalCount':_0x54e615['totalCount']});return{'execute':async()=>{await _0x5d577b['request'];},'abortController':_0x5d577b['abortController']};}['upsertCustomAIActionRating'](_0x49f524,_0xfc29d5){const _0x1b08bd=this['_sendApiRequest']('/actions/custom/calls/'+_0x49f524+'/ratings','PUT',{'positiveCount':_0xfc29d5['positiveCount'],'totalCount':_0xfc29d5['totalCount']});return{'execute':async()=>{await _0x1b08bd['request'];},'abortController':_0x1b08bd['abortController']};}['upsertAIReviewRating'](_0x397bc4,_0x3d5235,_0x24dfef,_0x53ffbc){const _0x4623d5=this['_sendApiRequest']('/reviews/system/'+_0x397bc4+'/calls/'+_0x3d5235+'/ratings','PUT',{'positiveCount':_0x24dfef['positiveCount'],'totalCount':_0x24dfef['totalCount'],'dataId':_0x53ffbc});return{'execute':async()=>{await _0x4623d5['request'];},'abortController':_0x4623d5['abortController']};}['upsertCustomAIReviewRating'](_0xae1011,_0x3ab122,_0x15a35a){const _0x547efa=this['_sendApiRequest']('/reviews/custom/calls/'+_0xae1011+'/ratings','PUT',{'positiveCount':_0x3ab122['positiveCount'],'totalCount':_0x3ab122['totalCount'],'dataId':_0x15a35a});return{'execute':async()=>{await _0x547efa['request'];},'abortController':_0x547efa['abortController']};}['_sendApiRequest'](_0x3400bd,_0x113d34,_0x4c908d){const _0x1b945f=new AbortController(),_0x326615=_0x4c908d instanceof FormData,_0x47424b={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x4c908d&&!_0x326615&&(_0x47424b['Content-Type']='application/json');const _0x18ab02={'method':_0x113d34,'headers':_0x47424b,'signal':_0x1b945f['signal']};return _0x4c908d&&(_0x18ab02['body']=_0x326615?_0x4c908d:JSON['stringify'](_0x4c908d)),{'request':fetch(''+this['_apiUrl']+_0x3400bd,_0x18ab02)['catch'](_0x5f4391=>{this['_handleError'](_0x5f4391);})['then'](_0x203eda=>_0x203eda['ok']?_0x203eda:_0x203eda['json']()['then'](_0x4ec00c=>{throw{'url':this['_apiUrl'],'path':_0x3400bd,'method':_0x113d34,'body':_0x4c908d,'status':(_0x203eda||{})['status'],'statusText':(_0x203eda||{})['statusText'],'code':_0x4ec00c['code'],'message':_0x4ec00c['message'],'traceId':_0x4ec00c['traceId']};})),'abortController':_0x1b945f};}async*['_getStreamReader'](_0x353733){const _0x328ac6=[],_0x45933c=_0x353733['getReader'](),_0x2c3053=$t({'onError':_0x127d51=>{this['_handleError'](_0x127d51);},'onEvent':_0x3ca2b3=>{_0x3ca2b3['data']=JSON['parse'](_0x3ca2b3['data']),_0x328ac6['push'](_0x3ca2b3);}});try{let _0x5d34cd=!0x1;for(;!_0x5d34cd;){const {done:_0x17e348,value:_0x28321d}=await _0x45933c['read']();_0x17e348&&(_0x5d34cd=!0x0),_0x2c3053['feed'](this['_decoder']['decode'](_0x28321d,{'stream':!0x0})),yield*_0x328ac6,_0x328ac6['length']=0x0;}}catch(_0x48a9ef){this['_handleError'](_0x48a9ef);}finally{_0x45933c['releaseLock'](),_0x2c3053['reset']();}}['_handleError'](_0x4f8180){if(_0x4f8180 instanceof _0x542443)throw _0x4f8180;if(_0x4f8180 instanceof Error&&'AbortError'===_0x4f8180['name'])throw new _0x542443('ai-request-aborted',this,{'originalError':_0x4f8180});throw new _0x542443('ai-request-failed',this,{'originalError':_0x4f8180});}}function i(_0x1ef15d,_0x30f31b,_0x10bb2c){const t=_0x1ef15d['t'];switch(_0x30f31b){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'},_0x10bb2c);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'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_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x10bb2c);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.'},_0x10bb2c);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_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x10bb2c);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x10bb2c);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x10bb2c);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x10bb2c);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.'},_0x10bb2c);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.'},_0x10bb2c);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.'},_0x10bb2c);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.'},_0x10bb2c);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'},_0x10bb2c);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x10bb2c);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x30f31b;}}function Ri(_0x4f363c,_0x49aea5){const _0x4d2288=new _0x5bfd84(_0x4f363c),_0x6ed15b=i(_0x4f363c,'AI_TABS_LABEL_MINIMIZE'),_0x25bbfe=i(_0x4f363c,'AI_TABS_LABEL_MAXIMIZE');return _0x4d2288['set']({'withText':!0x1,'icon':_0x5521e7,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x4d2288['bind']('label')['to'](_0x49aea5,'isMaximized',_0x5eda04=>_0x5eda04?_0x6ed15b:_0x25bbfe),_0x4d2288['bind']('icon')['to'](_0x49aea5,'isMaximized',_0x2166ee=>_0x2166ee?_0x5bfc92:_0x5521e7),_0x4d2288['bind']('isOn')['to'](_0x49aea5,'isMaximized'),_0x4d2288['on']('execute',()=>{_0x49aea5['fire']('resizeTabs');}),_0x4d2288;}function Ni(_0x560268){return _0x4a7826(_0x560268);}function Dt(_0x3b3736){return _0x3688ac(_0x3b3736);}function bt(_0xe13cb5,_0x47a9ef,_0x56906b){const _0x38c211=null!==_0x47a9ef?_0x2a0052=>_0x2a0052['attribs'][_0xe13cb5]===_0x47a9ef:_0x8a299d=>Boolean(_0x8a299d['attribs'][_0xe13cb5]);return xt(_0x3d05a1=>_0x512964(_0x3d05a1)&&_0x38c211(_0x3d05a1),_0x56906b);}function Ji(_0x377a1f,_0x400d49,_0x582dfc){const _0x2ef168=null!==_0x400d49?_0xe4b4a=>_0xe4b4a['attribs'][_0x377a1f]===_0x400d49:_0x2af562=>Boolean(_0x2af562['attribs'][_0x377a1f]);return _0x5269a1(_0x36afa9=>_0x512964(_0x36afa9)&&_0x2ef168(_0x36afa9),_0x582dfc);}function Ot(_0x476018,_0xd1e093){return _0x476018&&_0x512964(_0x476018)?_0x476018['attribs'][_0xd1e093]:null;}function Ns(_0x847689,_0x524895,_0x4aa68d){_0x512964(_0x847689)&&(null===_0x4aa68d?delete _0x847689['attribs'][_0x524895]:_0x847689['attribs'][_0x524895]=_0x4aa68d);}function Xi(_0x551b2d,_0xd1c481,_0xf138cf){const _0x446fcc=_0xd1c481['cloneNode'](!0x0);'beforebegin'===_0xf138cf?_0x11de48(_0x551b2d,_0x446fcc):'afterbegin'===_0xf138cf?_0x52afa8(_0x551b2d,_0x446fcc):'beforeend'===_0xf138cf?_0xce27f2(_0x551b2d,_0x446fcc):'afterend'===_0xf138cf&&_0x59a323(_0x551b2d,_0x446fcc);}function Pi(_0x4c1ff0){const _0x1957aa=[];let _0xeebec2=_0x4c1ff0;for(;_0xeebec2;)_0xeebec2=_0x4b34c6(_0xeebec2),_0xeebec2&&_0x1957aa['push'](_0xeebec2);return _0x1957aa;}function zn(_0x635218){return _0x635218['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ds(_0x5bb4f0){let _0x28b48c=0x0;for(;_0x5bb4f0['parentNode'];)_0x5bb4f0=_0x5bb4f0['parentNode'],_0x28b48c++;return _0x28b48c;}function Ss(_0x1cb2ec){const _0x352dea=[];let _0x5c21a5=_0x1cb2ec['nextSibling'];for(;_0x5c21a5;)_0x352dea['push'](_0x5c21a5),_0x5c21a5=_0x5c21a5['nextSibling'];_0x352dea['forEach'](_0x564f10=>{_0xb8c25a(_0x564f10);});}class Wi extends/* #__PURE__ -- @preserve */
25
- ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x33c75d();}['convertMarkdownToHTML'](_0x7da885){const _0x39e855=this['_m2html']['parse'](_0x7da885);return this['parseAndNormalizeHTML'](_0x39e855);}['parseAndNormalizeHTML'](_0x7feecf){return this['_parseHTML'](_0x7feecf);}['_parseHTML'](_0x2df0b7){const _0x1b8087=Ni('<dummy>'+_0x2df0b7['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x1b8087['children']=_0x1b8087['children'][0x0]['children'],_0x1b8087;}}class qi extends/* #__PURE__ -- @preserve */
26
- ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0xa0886f){super(),this['_generateUid']=_0xa0886f||_0x2e2dc8;}['merge'](_0x5d7fb4,_0x78bc7a,_0x56b85a){const _0x12125c=_0x5d7fb4['cloneNode'](!0x0);if(0x0===_0x78bc7a['childNodes']['length']){const _0x4995f1=[];return Ji('data-id','new-element',_0x12125c)['forEach'](_0x3b74bd=>{const _0x460954=this['_generateUid']();Ns(_0x3b74bd,'data-id',_0x460954),_0x4995f1['push'](_0x460954);}),this['_removeSpecialComments'](_0x12125c),{'parsedContent':_0x12125c,'newNodeIds':_0x4995f1,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x56b85a&&_0x56b85a['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x12125c),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ji('data-id',null,_0x78bc7a)['map'](_0x203dbc=>Ot(_0x203dbc,'data-id'))['filter'](_0x5f0588=>!!_0x5f0588));let _0x1d6db9=-0x1,_0x44f693=!0x1;const _0x53841e=_0x12125c['childNodes'],_0x10399e=Array['from'](_0x53841e)['filter'](_0x59fe81=>!(0x3===_0x59fe81['nodeType']&&''===Dt(_0x59fe81)['trim']())),_0x1ad534=_0x10399e['length'];for(let _0x57134c=0x0;_0x57134c<_0x1ad534;_0x57134c++){const _0x326ed5=_0x10399e[_0x57134c],_0x3bdef3=_0x10399e[_0x57134c+0x1];if(this['_isNewNode'](_0x326ed5)){if(-0x1===_0x1d6db9&&(_0x1d6db9=_0x57134c),this['_markWrappedElements'](_0x326ed5),!this['_isNewNode'](_0x3bdef3)){const [_0x3919b9,_0x77fc86]=this['_findReferenceNode'](_0x326ed5,_0x44f693,_0x78bc7a);if(_0x3919b9){const _0x1dce24=Array['from'](_0x10399e)['slice'](_0x1d6db9,_0x57134c+0x1);this['_insertNodes'](_0x3919b9,_0x1dce24,_0x77fc86),_0x1d6db9=-0x1;}}}else{if(this['_isExistingContentComment'](_0x326ed5))_0x44f693=!0x0;else{if(this['_isExistingNode'](_0x326ed5)){const _0x46d52d=Ot(_0x326ed5,'data-id');if(_0x46d52d&&this['_existingDataIds']['has'](_0x46d52d)){const _0x3b5182=bt('data-id',_0x46d52d,_0x78bc7a);this['_replaceNode'](_0x3b5182,_0x326ed5);}if(this['_touchedNodesState']['removedIds']['includes'](_0x46d52d)){const _0x493841=this['_touchedNodesState']['removedIds']['indexOf'](_0x46d52d);this['_touchedNodesState']['removedIds']['splice'](_0x493841,0x1);}}else{if(this['_isDelNode'](_0x326ed5)){const _0x46986a=Ot(_0x326ed5,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x46986a)||this['_storeDeletedElementIds'](_0x326ed5);}}}}}for(const _0x5ca526 of this['_touchedNodesState']['removedIds']){const _0x54d289=bt('data-id',_0x5ca526,_0x78bc7a);if(_0x54d289){if(_0x56b85a&&_0x56b85a['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x5ca526;const _0x4a87ac=_0x56b85a['replaceRemovedWith']['cloneNode'](!0x0);Ns(_0x4a87ac,'data-id',_0x5ca526),Ns(_0x4a87ac,'data-removed','true'),_0x390c69(_0x54d289,_0x4a87ac);}else _0xb8c25a(_0x54d289);}}if(Ji('data-wrapped-id',null,_0x78bc7a)['forEach'](_0x4771d9=>{const _0x5ca2d7=bt('data-id',Ot(_0x4771d9,'data-wrapped-id'),_0x78bc7a);var _0x45ac48,_0x289142;_0x5ca2d7&&(_0x289142=_0x4771d9,_0xb8c25a(_0x45ac48=_0x5ca2d7),_0x390c69(_0x289142,_0x45ac48));}),Ji('data-id','new-element',_0x78bc7a)['forEach'](_0x1eb6ae=>{const _0x27a263=this['_getUid'](_0x1eb6ae);Ns(_0x1eb6ae,'data-id',_0x27a263),this['_touchedNodesState']['newIds']['push'](_0x27a263);}),this['_removeSpecialComments'](_0x78bc7a),_0x56b85a&&_0x56b85a['markUnstableElements']&&this['_markUnstableElements'](_0x78bc7a,_0x56b85a['markUnstableElementsDepth']||0x0),_0x56b85a&&_0x56b85a['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x2630c6=bt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x78bc7a);for(;_0x2630c6;)Ss(_0x2630c6),_0x2630c6=_0x2630c6['parentNode'];}return{'parsedContent':_0x78bc7a,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x23c270,_0x44d601,_0x4d3c81){for(const _0x207203 of _0x44d601){const _0x495b9a=this['_getUid'](_0x207203);Ns(_0x207203,'data-id',_0x495b9a),this['_touchedNodesState']['newIds']['push'](_0x495b9a),this['_touchedNodesState']['lastTouchedId']=_0x495b9a;}const _0x4c7263='afterbegin'===_0x4d3c81||'afterend'===_0x4d3c81?_0x44d601['reverse']():_0x44d601;for(const _0x4407cb of _0x4c7263)Xi(_0x23c270,_0x4407cb,_0x4d3c81);}['_replaceNode'](_0x3bc066,_0x359a91){if(!_0x3bc066)return;if(_0x65883a=_0x359a91,zn(Dt(_0x3bc066))===zn(Dt(_0x65883a)))return;var _0x65883a;const _0x14a679=this['_getUid'](_0x3bc066);Ns(_0x359a91,'data-id',_0x14a679),this['_touchedNodesState']['modifiedIds']['push'](_0x14a679),this['_touchedNodesState']['lastTouchedId']=_0x14a679,_0x390c69(_0x3bc066,_0x359a91['cloneNode'](!0x0));}['_findReferenceNode'](_0x58e731,_0x128aee,_0x479aa5){const _0x1a6516=this['_findPrevElementWithDataId'](_0x58e731,!0x1);if(_0x1a6516){const _0x17e200=this['_getNodeDataId'](_0x1a6516),_0x19b6b1=bt('data-id',_0x17e200,_0x479aa5);if(_0x19b6b1)return[_0x19b6b1,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x17e200);}const _0x4633b9=this['_findNextElementWithDataId'](_0x58e731,!0x1);if(_0x4633b9){const _0xd5e72a=this['_getNodeDataId'](_0x4633b9),_0x52e2d4=bt('data-id',_0xd5e72a,_0x479aa5);if(_0x52e2d4)return[_0x52e2d4,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0xd5e72a);}return _0x128aee?_0x58e731['nextSibling']?this['_findFallbackReferenceNode'](_0x58e731,_0x479aa5):[_0x479aa5['childNodes'][_0x479aa5['childNodes']['length']-0x1],'afterend']:[_0x479aa5['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x38c25a,_0x151785){const _0x896109=[],_0x5062f2=this['_findPrevElementWithDataId'](_0x38c25a,!0x0);if(_0x5062f2){const _0x370c62=bt('data-id',this['_getNodeDataId'](_0x5062f2),_0x151785);_0x370c62&&_0x896109['push']([_0x370c62,'afterend']);}const _0x179b95=this['_findNextElementWithDataId'](_0x38c25a,!0x0);if(_0x179b95){const _0x200030=bt('data-id',this['_getNodeDataId'](_0x179b95),_0x151785);_0x200030&&_0x896109['push']([_0x200030,'beforebegin']);}if(_0x896109['length']>0x1)return Ds(_0x896109[0x0][0x0])<=Ds(_0x896109[0x1][0x0])?_0x896109[0x0]:_0x896109[0x1];return 0x1===_0x896109['length']?_0x896109[0x0]:[_0x151785['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x42e5f0,_0x32c29f){let _0x4acc0e=_0x42e5f0['nextSibling'],_0x35fd37=null,_0x458424=!0x1;for(;_0x4acc0e;){if(_0x434d7d(_0x4acc0e)){if(this['_isDelNode'](_0x4acc0e)&&(_0x35fd37=_0x4acc0e),this['_isExistingContentComment'](_0x4acc0e)&&_0x32c29f&&!_0x458424){_0x458424=!0x0,_0x4acc0e=_0x4acc0e['nextSibling'];continue;}break;}const _0x28044b=Ot(_0x4acc0e,'data-id');if(_0x28044b&&'new-element'!==_0x28044b&&this['_existingDataIds']['has'](_0x28044b)){_0x35fd37=_0x4acc0e;break;}_0x4acc0e=_0x4acc0e['nextSibling'];}return _0x35fd37;}['_findPrevElementWithDataId'](_0x3dba07,_0x18b9f1){let _0x1ed987=_0x3dba07['previousSibling'],_0x25117d=null,_0x7b5c16=!0x1;for(;_0x1ed987;){if(_0x434d7d(_0x1ed987)){if(this['_isDelNode'](_0x1ed987)&&(_0x25117d=_0x1ed987),this['_isExistingContentComment'](_0x1ed987)&&_0x18b9f1&&!_0x7b5c16){_0x7b5c16=!0x0,_0x1ed987=_0x1ed987['previousSibling'];continue;}break;}const _0x3ea83b=Ot(_0x1ed987,'data-id');if(_0x3ea83b&&'new-element'!==_0x3ea83b&&this['_existingDataIds']['has'](_0x3ea83b)){_0x25117d=_0x1ed987;break;}_0x1ed987=_0x1ed987['previousSibling'];}return _0x25117d;}['_markWrappedElements'](_0x5ac3bf){_0x512964(_0x5ac3bf)&&Ji('data-id',null,_0x5ac3bf)['forEach'](_0x2e63b6=>{this['_isExistingNode'](_0x2e63b6)&&!this['_hasWrappedParent'](_0x2e63b6)&&(Ns(_0x2e63b6,'data-wrapped-id',Ot(_0x2e63b6,'data-id')),Ns(_0x2e63b6,'data-id',null));});}['_getNodeDataId'](_0x2c818a){if(!_0x2c818a)return null;if(_0x512964(_0x2c818a))return Ot(_0x2c818a,'data-id');if(_0x434d7d(_0x2c818a)){const _0x34c858=Dt(_0x2c818a)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x34c858&&_0x34c858[0x1])return _0x34c858[0x1];}return null;}['_storeDeletedElementIds'](_0x25442b){if(_0x434d7d(_0x25442b)){const _0x1707a3=Dt(_0x25442b)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x1707a3&&_0x1707a3[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x1707a3[0x1]);}}['_getUid'](_0x4e3a41){return this['_isExistingNode'](_0x4e3a41)?Ot(_0x4e3a41,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3e7a43){(function(_0x5a517f){return _0x3dc1d7(_0x2ee923=>_0x434d7d(_0x2ee923),_0x5a517f,!0x0,0x1/0x0);}(_0x3e7a43)['filter'](_0x37d884=>this['_isDelNode'](_0x37d884)||this['_isExistingContentComment'](_0x37d884))['forEach'](_0x413c73=>{_0xb8c25a(_0x413c73);}));}['_markLastTagElementUnstable'](_0x285cb1){const _0x56f4a8=_0x285cb1['childNodes'],_0x501385=_0x56f4a8[_0x56f4a8['length']-0x1];_0x501385&&_0x512964(_0x501385)&&Ns(_0x501385,'data-unstable','true');}['_markUnstableElements'](_0x2777b9,_0x412115){const _0xc4d06c=bt('data-unstable','true',_0x2777b9);if(!_0xc4d06c)return;const _0x4729a3=Pi(_0xc4d06c)['slice'](0x0,-0x1),_0x7af62b=_0x4729a3['length'];let _0x337980=_0xc4d06c;if(_0x7af62b>_0x412115){let _0x3d0193=_0x7af62b,_0x38061b=null;for(;_0x3d0193>_0x412115&&_0x3d0193>=0x0;)_0x3d0193--,_0x38061b=_0x4729a3[_0x3d0193];_0x38061b&&(_0x337980=_0x38061b,Ns(_0xc4d06c,'data-unstable',null),Ns(_0x38061b,'data-unstable','true'));}else{if(_0x7af62b<_0x412115){let _0x3ad7ee=_0x7af62b,_0xc39050=_0xc4d06c;for(;_0x3ad7ee<_0x412115;){const _0x3d348e=_0xc39050['childNodes']['filter'](_0x4d4a06=>_0x512964(_0x4d4a06));if(0x0===_0x3d348e['length'])break;_0x3ad7ee++,_0xc39050=_0x3d348e[_0x3d348e['length']-0x1];}_0xc39050&&(_0x337980=_0xc39050,Ns(_0xc4d06c,'data-unstable',null),Ns(_0xc39050,'data-unstable','true'));}}let _0x11c95d=_0x337980;for(;_0x11c95d;){for(;_0x11c95d['nextSibling'];)_0x11c95d=_0x11c95d['nextSibling'],_0x512964(_0x11c95d)&&Ns(_0x11c95d,'data-unstable','true');_0x11c95d=_0x11c95d['parentNode'];}}['_isNewNode'](_0xd80554){return Boolean('new-element'===Ot(_0xd80554,'data-id'));}['_isExistingNode'](_0x445f94){return Boolean((Ot(_0x445f94,'data-id')||'')['length']>0x0&&'new-element'!==Ot(_0x445f94,'data-id'));}['_isDelNode'](_0x540cc3){return!!_0x540cc3&&Boolean(_0x434d7d(_0x540cc3)&&Dt(_0x540cc3)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x460f93){let _0x15aeee=_0x460f93['parentNode'];for(;_0x15aeee;){if(Ot(_0x15aeee,'data-wrapped-id'))return!0x0;_0x15aeee=_0x15aeee['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x893692){return Boolean(_0x434d7d(_0x893692)&&Dt(_0x893692)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function q({editor:_0x1bf8f6,changeGroups:_0x275565,documentContextContent:_0x195d91,showDiff:_0xf15e1d,trimUnchanged:_0x5a55f0=!0x0}){return _0x275565['map'](_0x296ebe=>{const _0x2d1856=new Rt([]),_0x2ef9cf=new Rt([]);for(const _0x4bdcc7 of _0x296ebe['changes'])if(_0xf15e1d&&'removed'==_0x4bdcc7['type']||_0x2ef9cf['children']['push'](_0x4bdcc7['node']['cloneNode'](!0x0)),'new'!=_0x4bdcc7['type']&&(_0xf15e1d||'removed'!=_0x4bdcc7['type'])){const _0x2ff1c8=xt(_0x1e8457=>Ot(_0x1e8457,'data-id')==_0x4bdcc7['id'],_0x195d91,!0x0);_0x2ff1c8&&_0x2d1856['children']['push'](_0x2ff1c8['cloneNode'](!0x0));}const {content:_0x9840b9,hasChanges:_0x56e2e8}=function(_0x5d8c8e,_0x56aeaf,_0x3b6cd3,_0xa1ad40,_0x276807=!0x0){const _0x412983=_0x5d8c8e['plugins']['get']('DocumentCompare'),_0x2ff099=Dt(_0x56aeaf),_0x426d08=Dt(_0x3b6cd3),_0x4f6f52=_0x5d8c8e['data']['parse'](_0x2ff099,'$root'),_0x22d21b=_0x5d8c8e['model']['createPositionAt'](_0x4f6f52,0x0),_0x483468=_0x412983['getDiff'](_0x2ff099,_0x426d08,{'anchor':_0x22d21b,'markDeletions':_0xa1ad40}),_0x208396=_0x483468['getOperations']();if(0x0==_0x208396['length'])return{'content':_0x56aeaf['cloneNode'](!0x0),'hasChanges':!0x1};_0xa1ad40?function(_0x240a76,_0x5bcb6f,_0xe0c508){if(0x0==_0x240a76['length'])return;const _0x1dafbf=_0xe0c508['plugins']['get']('DocumentCompare'),_0x58a71f=_0xe0c508['plugins']['get']('SuggestionsConversion');_0xe0c508['model']['change'](_0x5e9e66=>{const _0x5b026b=new Set();for(let _0x129940=0x0;_0x129940<_0x240a76['length'];_0x129940++){const _0x3ab487=_0x240a76[_0x129940];if(_0x3ab487['baseVersion']=null,_0x3ab487['isDocumentOperation']=!0x1,_0x1dafbf['isMarkedRemoveOperation'](_0x3ab487)){const _0x269d29=_0xf7c114(_0x3ab487['newRange'],_0xe0c508['model']),_0x3b7615='suggestion:deletion:'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x3b7615,_0x269d29);}else switch(_0x3ab487['type']){case'rename':{if(_0x3ab487['oldName']==_0x3ab487['newName'])break;_0x5e9e66['batch']['addOperation'](_0x3ab487),_0xe0c508['model']['applyOperation'](_0x3ab487);const _0x40bf30='$elementName',_0x10476c=_0x3ab487['position'],_0xcd8600=_0xe0c508['model']['createRange'](_0x10476c,_0xe0c508['model']['createPositionAt'](_0x10476c['nodeAfter'],'end')),_0x4b5006='suggestion:attribute:'+_0x40bf30+':'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x4b5006,_0xcd8600);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3ab487['oldValue']==_0x3ab487['newValue'])break;_0x5e9e66['batch']['addOperation'](_0x3ab487),_0xe0c508['model']['applyOperation'](_0x3ab487);const _0x4f5c84=_0x3ab487['key'];if(!_0x58a71f['isRegisteredAttribute'](_0x4f5c84))break;const _0x31e691=_0xf7c114(_0x3ab487['range'],_0xe0c508['model']),_0x3ead00='suggestion:attribute:'+_0x4f5c84+':'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x3ead00,_0x31e691);break;}case'insert':{_0x5e9e66['batch']['addOperation'](_0x3ab487),_0xe0c508['model']['applyOperation'](_0x3ab487);if(_0x240a76[_0x129940+0x1]&&'move'==_0x240a76[_0x129940+0x1]['type']){no(_0x5bcb6f,_0x3ab487);break;}const _0x515daf=_0x3ab487['position'],_0x3341aa=_0x3ab487['howMany'],_0x112e30=_0xf7c114(_0xe0c508['model']['createRange'](_0x515daf,_0x515daf['getShiftedBy'](_0x3341aa)),_0xe0c508['model']),_0x12cb01='suggestion:insertion:'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x12cb01,_0x112e30);break;}case'split':{_0x5e9e66['batch']['addOperation'](_0x3ab487),_0xe0c508['model']['applyOperation'](_0x3ab487);const _0x37b306=_0x3ab487['splitPosition'],_0x117de4=_0x3ab487['moveTargetPosition'],_0x2fad40=_0xe0c508['model']['createRange'](_0x37b306,_0x117de4),_0x4912a8='suggestion:insertion:'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x4912a8,_0x2fad40);break;}case'move':{_0x5e9e66['batch']['addOperation'](_0x3ab487),_0xe0c508['model']['applyOperation'](_0x3ab487),_0x240a76[_0x129940-0x1]&&'insert'==_0x240a76[_0x129940-0x1]['type']&&no(_0x5bcb6f,_0x3ab487);const _0x487418=_0x3ab487['getMovedRangeStart'](),_0x38e3ce=_0x3ab487['howMany'];for(let _0x48a1e5=0x0;_0x48a1e5<_0x38e3ce;_0x48a1e5++){const _0x19cfc4=_0x487418['getShiftedBy'](_0x48a1e5)['nodeAfter'];_0x5b026b['add'](_0x19cfc4);}break;}case'remove':{const _0x528b02=_0x3ab487['sourcePosition'],_0x2bae97=_0x3ab487['howMany'],_0x5de677=new _0x5de5b5(_0x528b02,_0x2bae97);_0x5e9e66['batch']['addOperation'](_0x5de677),_0xe0c508['model']['applyOperation'](_0x5de677);break;}}}for(const _0x343c90 of _0x5b026b){const _0x21ad05=_0xe0c508['model']['createRangeOn'](_0x343c90),_0x4ad6f8='suggestion:formatBlock:$fakeWrap:'+_0x2e2dc8()+':$aiSuggestion';_0x5bcb6f['markers']['set'](_0x4ad6f8,_0xf7c114(_0x21ad05,_0xe0c508['model']));}});}(_0x208396,_0x4f6f52,_0x5d8c8e):_0x5d8c8e['model']['change'](_0x3e7c2f=>{for(const _0x1afcd4 of _0x208396)if('remove'==_0x1afcd4['type']){const _0x1b141=_0x1afcd4['sourcePosition'],_0x44c71b=_0x1afcd4['howMany'],_0x20f448=new _0x5de5b5(_0x1b141,_0x44c71b);_0x3e7c2f['batch']['addOperation'](_0x20f448),_0x5d8c8e['model']['applyOperation'](_0x20f448);}else{if('marker'==_0x1afcd4['type']){const _0x4b82e5=_0x1afcd4['name'],_0x3daa9f=_0x1afcd4['newRange'];null!==_0x3daa9f?_0x4f6f52['markers']['set'](_0x4b82e5,_0x3daa9f):_0x4f6f52['markers']['delete'](_0x4b82e5);}else _0x1afcd4['baseVersion']=null,_0x1afcd4['isDocumentOperation']=!0x1,_0x3e7c2f['batch']['addOperation'](_0x1afcd4),_0x5d8c8e['model']['applyOperation'](_0x1afcd4);}});if(_0x276807){const _0xa608a0=vt(_0x5d8c8e,_0x208396,_0x4f6f52);St(_0x5d8c8e['model'],_0xa608a0),function(_0x4707cd,_0x10fb86){const _0x26985c=_0x10fb86['getFirstRange']()['start'];let _0x2b2bfd=_0x10fb86['getFirstRange']()['end'];const _0x5d1e25=_0x26985c['root'];(_0x2b2bfd['textNode']||_0x2b2bfd['nodeAfter']&&_0x2b2bfd['nodeAfter']['is']('$text'))&&(_0x1aa9ab(_0x2b2bfd,'...'),_0x2b2bfd=_0x2b2bfd['getShiftedBy'](0x3)),(_0x26985c['textNode']||_0x26985c['nodeBefore']&&_0x26985c['nodeBefore']['is']('$text'))&&(_0x1aa9ab(_0x26985c,'...'),function(_0x30e8c2,_0x36fd01,_0x4a0807){for(let [_0x3fbb41,_0x1b3a9d]of _0x30e8c2['markers']){const _0x36b5c3=_0x1b3a9d['_getTransformedByInsertion'](_0x36fd01,_0x4a0807,!0x1);_0x1b3a9d=_0x36b5c3[0x0],_0x30e8c2['markers']['set'](_0x3fbb41,_0x1b3a9d);}}(_0x5d1e25,_0x26985c,0x3),_0x26985c['parent']==_0x2b2bfd['parent']&&(_0x2b2bfd=_0x2b2bfd['getShiftedBy'](0x3)));const _0x2cd9ac=_0x4707cd['createRange'](_0x4707cd['createPositionAt'](_0x5d1e25,0x0),_0x26985c),_0x21fa77=_0x4707cd['createRange'](_0x2b2bfd,_0x4707cd['createPositionAt'](_0x5d1e25,'end')),_0x13b7e9=[..._0x2cd9ac['getMinimalFlatRanges'](),..._0x21fa77['getMinimalFlatRanges']()];_0x13b7e9['reverse']();for(const _0x46d753 of _0x13b7e9)to(_0x46d753),Jn(_0x5d1e25,_0x46d753);}(_0x5d8c8e['model'],_0xa608a0);}const _0x17d09c=_0x5d8c8e['data']['stringify'](_0x4f6f52,{'showSuggestionHighlights':!0x0});return{'content':Ni(_0x17d09c),'hasChanges':!0x0};}(_0x1bf8f6,_0x2d1856,_0x2ef9cf,_0xf15e1d,_0x5a55f0);return{'type':_0x296ebe['changes'][0x0]['type'],'index':_0x296ebe['index'],'content':_0x9840b9,'hasChanges':_0x56e2e8};});}function no(_0x240891,_0x27d561){for(const [_0x119a2e,_0xc153e4]of _0x240891['markers']){const _0x2435f2=_0x561be6['_createFromRanges'](_0xc153e4['getTransformedByOperation'](_0x27d561));_0x240891['markers']['set'](_0x119a2e,_0x2435f2);}}function vt(_0x42711c,_0x518fed,_0x1fb3a3){const _0x473127=_0x42711c['plugins']['get']('DocumentCompare');let _0x481ebf=_0x42711c['model']['createPositionAt'](_0x1fb3a3,Number['POSITIVE_INFINITY']),_0x5d2c56=_0x42711c['model']['createPositionAt'](_0x1fb3a3,0x0);for(const _0x5f0912 of _0x518fed){let _0x388991,_0xbfbe1e;if(_0x473127['isMarkedRemoveOperation'](_0x5f0912))_0x388991=_0x5f0912['newRange']['start'],_0xbfbe1e=_0x5f0912['newRange']['end'];else switch(_0x481ebf=_0x481ebf['getTransformedByOperation'](_0x5f0912),_0x5d2c56=_0x5d2c56['getTransformedByOperation'](_0x5f0912),_0x5f0912['type']){case'rename':_0x388991=_0x5f0912['position'],_0xbfbe1e=_0x388991['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x388991=_0x5f0912['range']['start'],_0xbfbe1e=_0x5f0912['range']['end'];break;case'insert':_0x388991=_0x5f0912['position'],_0xbfbe1e=_0x388991['getShiftedBy'](_0x5f0912['howMany']);break;case'split':_0x388991=_0x5f0912['splitPosition'],_0xbfbe1e=_0x5f0912['moveTargetPosition'];break;case'merge':{const _0x210b26=_0x5f0912['targetPosition']['path']['slice'](0x0,-0x1);_0x388991=_0x42711c['model']['createPositionFromPath'](_0x1fb3a3,_0x210b26),_0xbfbe1e=_0x388991['getShiftedBy'](0x1);break;}case'remove':{const _0x41ff85=_0x5f0912['howMany'],_0x2a058c=_0x5f0912['sourcePosition']['_getTransformedByInsertion'](_0x5f0912['targetPosition'],_0x41ff85),_0x51db7d=_0x5f0912['getMovedRangeStart']();'remove'==_0x5f0912['type']?(_0x388991=_0x2a058c,_0xbfbe1e=_0x2a058c):(_0x388991=_0x51db7d,_0xbfbe1e=_0x51db7d['getShiftedBy'](_0x41ff85));break;}}_0x388991&&_0x388991['isBefore'](_0x481ebf)&&(_0x481ebf=_0x388991['clone'](),_0x481ebf['stickiness']='toNone'),_0xbfbe1e&&_0xbfbe1e['isAfter'](_0x5d2c56)&&(_0x5d2c56=_0xbfbe1e['clone'](),_0x5d2c56['stickiness']='toNone');}return _0x42711c['model']['createSelection'](_0x42711c['model']['createRange'](_0x481ebf,_0x5d2c56));}function St(_0xce8744,_0x1db302){ro(_0xce8744,_0x1db302,'forward');const _0xcd6a0b=_0x1db302['getFirstRange']();_0x1db302['setTo']([]),_0x1db302['setTo'](_0xcd6a0b,{'backward':!0x0}),ro(_0xce8744,_0x1db302,'backward');}function ro(_0x5e9f05,_0x3b4ff7,_0x52ee86){let _0x5a47cb=0x14;for(;_0x5a47cb;){_0x5e9f05['modifySelection'](_0x3b4ff7,{'unit':'word','direction':_0x52ee86}),_0x5a47cb--;const _0x38f5f5=_0x3b4ff7['focus']['forward'==_0x52ee86?'nodeBefore':'nodeAfter'];if(_0x38f5f5&&_0x38f5f5['is']('element')&&_0x5e9f05['schema']['isBlock'](_0x38f5f5)&&_0x5e9f05['schema']['isObject'](_0x38f5f5))break;}}function Jn(_0x203604,_0x5c096d){for(const [_0x25c3db,_0x36ca31]of _0x203604['markers']){const _0x30b8a4=_0x36ca31['_getTransformedByDeletion'](_0x5c096d['start'],_0x5c096d['end']['offset']-_0x5c096d['start']['offset']);null!=_0x30b8a4?_0x203604['markers']['set'](_0x25c3db,_0x30b8a4):_0x203604['markers']['delete'](_0x25c3db);}}class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Rt([]);['parsedMergedContent']=new Rt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x5853be,content:_0x557c7b='',isDone:_0x465de5=!0x1,interactionId:_0x154467,areActionsDisabled:_0x25a07f,documentContextContent:_0x2ea42e,editor:_0x8bd7bd,id:_0x1efa40}){super(),this['id']=_0x1efa40||_0x2e2dc8(),this['interactionId']=_0x154467,this['type']=_0x5853be,this['areActionsDisabled']=!!_0x25a07f,this['editor']=_0x8bd7bd,this['aiResponseParser']=new Wi(),this['aiResponseApplier']=new qi(),this['documentContextContent']=Ni(_0x2ea42e||''),this['set']('isDone',_0x465de5),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x557c7b);}['appendContent'](_0x8c9bee){this['set']('content',this['content']+_0x8c9bee);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x476cad,_0x4d532f){this['changeGroups'][_0x476cad]['state']=_0x4d532f,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x476cad,'state':_0x4d532f});}['getContentParts']({showDiff:_0x5849d2,groupIndex:_0x5e572c}){if(!this['editor'])throw new _0x542443('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x16463b=this['_getCachedContentParts'](_0x5849d2,_0x5e572c);if(_0x16463b)return _0x16463b;let _0x159bf4=[];if(void 0x0===_0x5e572c)_0x159bf4=this['changeGroups'];else{const _0x161972=this['changeGroups']['find'](({index:_0x8fb594})=>_0x8fb594===_0x5e572c);if(!_0x161972)throw new _0x542443('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x5e572c});_0x159bf4=[_0x161972];}const _0x3227aa=q({'editor':this['editor'],'showDiff':_0x5849d2,'changeGroups':_0x159bf4,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x5849d2,_0x3227aa),_0x3227aa;}['_getCachedContentParts'](_0x1e85b8,_0x5221a4){const _0x17dba0=_0x1e85b8?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x17dba0]['length'])return null;const _0xf21e6c=this['cachedSuggestionContentParts'][_0x17dba0];if(void 0x0===_0x5221a4)return _0xf21e6c['length']>0x0&&_0xf21e6c['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x1e85b8,null),null):_0x282866(_0xf21e6c);{const _0x286260=_0xf21e6c['find'](({index:_0x5ebc86})=>_0x5ebc86===_0x5221a4);if(_0x286260)return[_0x282866(_0x286260)];}return null;}['_setCachedContentParts'](_0x53f144,_0x989d6c){const _0x54a1c3=_0x53f144?'withDiff':'withoutDiff';_0x989d6c?_0x989d6c['forEach'](_0x5ee30d=>{const _0x2b25c0=this['cachedSuggestionContentParts'][_0x54a1c3],_0x1b2668=_0x2b25c0['find'](({index:_0x5b5792})=>_0x5b5792===_0x5ee30d['index']);if(_0x1b2668){const _0x15bad1=_0x2b25c0['indexOf'](_0x1b2668);_0x2b25c0['splice'](_0x15bad1,0x1,_0x5ee30d);}else _0x2b25c0['push'](_0x5ee30d);}):this['cachedSuggestionContentParts'][_0x54a1c3]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0xc64aa1=this['changeGroups'];this['updateChangeGroups']();const _0x502ed0=this['_getDifferentChangeGroups'](_0xc64aa1,this['changeGroups']);(_0x502ed0['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x502ed0),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x53b6f7,_0x2553d1){const _0x4850ae=[];for(const _0x1e4efd of _0x2553d1){const _0x289645=_0x53b6f7[_0x1e4efd['index']];_0x289645?_0x289645['changes']['length']!==_0x1e4efd['changes']['length']?_0x4850ae['push'](_0x1e4efd):_0x289645['changes']['forEach']((_0x2543bf,_0x4909f9)=>{const _0x20c8ed=_0x1e4efd['changes'][_0x4909f9];_0x2543bf['id']!==_0x20c8ed['id']&&_0x4850ae['push'](_0x1e4efd);}):_0x4850ae['push'](_0x1e4efd);}return _0x4850ae;}['updateChangeGroups'](){const _0x3a68a7=new _0x1075d8('p',{},[new _0x1075d8('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x2ef03d(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x34bf6d=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x3a68a7,'cutAfterLastChange':!this['isDone']});if(!_0x34bf6d['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x34bf6d['parsedContent'];let _0x2bf6d5=[];if(_0x5269a1(_0x4fafb9=>{const _0x22a689=Ot(_0x4fafb9,'data-id');if(!_0x22a689||!_0x3bc61b(_0x22a689))return!0x1;const _0x40d1b7=[_0x4fafb9,...Pi(_0x4fafb9)]['at'](-0x2);if(_0x4fafb9!=_0x40d1b7){const _0x44e48c=Ot(_0x40d1b7,'data-id');_0x3bc61b(_0x44e48c)||(_0x2bf6d5['push']({'node':_0x40d1b7,'id':_0x44e48c,'type':'modified'}),_0x34bf6d['modifiedNodeIds']['push'](_0x44e48c));}else _0x34bf6d['modifiedNodeIds']['includes'](_0x22a689)?_0x2bf6d5['push']({'node':_0x4fafb9,'type':'modified','id':_0x22a689}):_0x34bf6d['newNodeIds']['includes'](_0x22a689)?_0x2bf6d5['push']({'node':_0x4fafb9,'type':'new','id':_0x22a689,'anchorId':Ot(_0x4fafb9['previousSibling'],'data-id')}):_0x2bf6d5['push']({'node':_0x4fafb9,'type':'removed','id':_0x22a689});return!0x0;},this['parsedMergedContent']),_0x2bf6d5=_0x2bf6d5['filter'](({node:_0x50e01e})=>[...Pi(_0x50e01e),_0x50e01e]['every'](_0x5597fe=>!Ot(_0x5597fe,'data-unstable'))),0x0==_0x2bf6d5['length'])return;const _0x1c0a41=[[_0x2bf6d5[0x0]]];for(let _0x116dcd=0x1;_0x116dcd<_0x2bf6d5['length'];_0x116dcd++){const _0xef9605=_0x1c0a41[_0x1c0a41['length']-0x1],_0x2f18bb=_0xef9605[_0xef9605['length']-0x1];_0x2bf6d5[_0x116dcd]['node']['previousSibling']==_0x2f18bb['node']&&'modified'!=_0x2bf6d5[_0x116dcd]['type']&&'modified'!=_0x2f18bb['type']?_0xef9605['push'](_0x2bf6d5[_0x116dcd]):_0x1c0a41['push']([_0x2bf6d5[_0x116dcd]]);}for(const _0xb55760 of _0x1c0a41){const _0x71accc=_0xb55760[0x0],_0x566713=_0xb55760[_0xb55760['length']-0x1],_0x477937=_0x4fc0b0(_0x71accc['node']['previousSibling']);_0x477937&&_0xb55760['unshift'](_0x477937);const _0x2e83b0=_0x4fc0b0(_0x566713['node']['nextSibling']);_0x2e83b0&&_0xb55760['push'](_0x2e83b0);}function _0x3bc61b(_0x25c97e){return _0x34bf6d['modifiedNodeIds']['includes'](_0x25c97e)||_0x34bf6d['newNodeIds']['includes'](_0x25c97e)||_0x34bf6d['removedNodeIds']['includes'](_0x25c97e);}function _0x4fc0b0(_0x4a4ba2){if(_0x4a4ba2&&Ot(_0x4a4ba2,'data-id')&&!Ot(_0x4a4ba2,'data-unstable')){const _0x8ca893=Ot(_0x4a4ba2,'data-id');if(!_0x3bc61b(_0x8ca893))return{'node':_0x4a4ba2,'type':'context','id':_0x8ca893};}return null;}this['changeGroups']=_0x1c0a41['map']((_0x1fadf5,_0x4844d4)=>({'changes':_0x1fadf5,'state':'pending','index':_0x4844d4}));}}const ye=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xe extends _0x204e9f(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0xd91b20,editor:_0x6bf241}){super(),this['id']=_0x2e2dc8(),this['connector']=_0xd91b20,this['isStopped']=!0x0,this['editor']=_0x6bf241;}async['start'](){const _0xa57a3b=[];let _0x3e055f,_0x13e9c9,_0x9b1c1e;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x6c9711=await this['currentRequest']['getStream']();for await(const _0x4381b4 of _0x6c9711){if(this['isStopped'])return;if('error'==_0x4381b4['event'])return void this['fire']('error',{'error':new _0x542443('ai-chat-interaction-error',this)});switch(_0x4381b4['event']){case'message-metadata':this['messageId']=_0x4381b4['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x4381b4['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x4381b4['data']['conversationTitle'],!0x0);break;case'source':_0xa57a3b['push'](_0x4381b4['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x3e055f='modification-delta'==_0x4381b4['event']?'modification':'text',_0x13e9c9='modification-delta'==_0x4381b4['event']?_0x4381b4['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x3e055f&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x3e055f,'interactionId':this['id'],'id':_0x13e9c9}),'modification'==_0x3e055f&&(this['currentReply']['sources']=_0xa57a3b['splice'](0x0))),this['currentReply']['appendContent'](_0x4381b4['data']['textDelta']);break;case'mcp-tool-result':_0x9b1c1e=JSON['parse'](_0x4381b4['data']['result']),this['_handleToolResultData']({'toolName':_0x4381b4['data']['toolName'],'data':_0x9b1c1e['data'],'attributes':_0x9b1c1e['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x4381b4['data']['toolName'],'data':_0x4381b4['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0xa57a3b['length']>0x0&&(this['currentReply']['sources']=_0xa57a3b['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x594594){return this['replies']['find'](_0x564732=>_0x564732['id']===_0x594594);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x5a9c9b=>_0x5a9c9b['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x3ba4da){const _0x3bb0b6=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x3ba4da});return this['replies']['push'](_0x3bb0b6),_0x3bb0b6['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x3bb0b6),_0x3bb0b6;}['setConversationTitle'](_0x2d49ba,_0x572d6c=!0x1){this['fire']('setConversationTitle',_0x2d49ba,_0x572d6c);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x2c61d4){this['fire']('toolDataReceived',{'type':'result','toolName':_0x2c61d4['toolName'],'data':structuredClone(_0x2c61d4['data']||{}),'attributes':structuredClone(_0x2c61d4['attributes']||{})},this);}['_handleToolNotificationData'](_0x42c73e){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x42c73e['toolName'],'data':structuredClone(_0x42c73e['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var qe=function(_0x42a786){return _0x42a786['TOOL']='mcp-tool-context',_0x42a786['FILE']='file',_0x42a786['DOCUMENT']='document',_0x42a786['URL']='web-resource',_0x42a786['TEXT']='text',_0x42a786['SELECTION']='selection',_0x42a786;}({}),Fe=function(_0x4501c6){return _0x4501c6['TEXT']='text',_0x4501c6['MARKDOWN']='markdown',_0x4501c6['HTML']='html',_0x4501c6;}({});const Oe=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),He=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class We extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x28ee7f,config:_0x4eaf8a,ownerId:_0x1409d8}){super(),this['_connector']=_0x28ee7f,this['_config']=_0x4eaf8a,this['_ownerId']=_0x1409d8;}['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'](_0x23794b){const _0x473c4f=await this['_createContextItemFromContent'](_0x23794b);return this['_addToConversationContextItem'](_0x473c4f),'current-document'===_0x473c4f['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x473c4f;}async['_createContextItemFromContent'](_0xb71f48){if(_0xb71f48['type']===qe['DOCUMENT']){const _0x254cf9=await this['_connector']['fetchDocument'](this['_ownerId'],_0xb71f48['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0xb71f48['type'],'content':_0x254cf9['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x254cf9['attributes']?.['version'],'sessionId':_0x254cf9['attributes']?.['sessionId']};}if(_0xb71f48['type']===qe['TOOL'])return{'id':_0xb71f48['id'],'uiId':_0xb71f48['id'],'label':_0xb71f48['data']?.['label']||_0xb71f48['id'],'type':qe['TOOL'],'mcpServerName':_0xb71f48['mcpServerName'],'toolName':_0xb71f48['toolName'],'data':_0xb71f48['data']||{}};return{'id':_0xb71f48['id'],'uiId':_0xb71f48['id'],'label':_0xb71f48['attributes']?.['label']||_0xb71f48['name']||_0xb71f48['url']||_0xb71f48['id'],'type':_0xb71f48['type'],..._0xb71f48?.['attributes']?.['resourceId']?{'resourceId':_0xb71f48['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0xdd46f9){const _0x34ace2=this['_pendingContextItems']['get'](_0xdd46f9);_0x34ace2?.['isReadOnly']||this['_removeContextItem'](_0xdd46f9);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x14e08b of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x14e08b['uiId']);const _0x980211=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x980211&&this['_addContextItem']({..._0x980211,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x76c6ec){for(const _0x16412d of _0x76c6ec['values']())this['_addToConversationContextItem'](_0x16412d);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'](_0x12bb07){return Array['from'](_0x12bb07['values']())['map'](_0x3258c2=>this['_mapContextItemToRequestData'](_0x3258c2))['filter'](_0x2d2c4e=>null!==_0x2d2c4e);}async['addFilesToContext'](_0x3a19a4,_0x1874c0,_0x3ca267=qe['FILE']){const _0x55108b='files-'+_0x2e2dc8();this['_startUploadOperation'](_0x55108b);try{await Promise['all'](_0x3a19a4['map'](async _0x432514=>{const _0x899174='file-'+_0x2e2dc8(),_0x490274=_0x1052a4(_0x432514['name']);try{this['_addContextItem']({'type':_0x3ca267,'label':_0x1874c0?.['label']||_0x490274,'uiId':_0x899174,'resourceId':_0x1874c0?.['resourceId']},!0x0);const _0x54417d=this['_connector']['uploadFile'](this['_ownerId'],_0x432514,_0x1874c0);this['_ongoingUploads']['set'](_0x899174,_0x54417d['abortController']);const {id:_0x2bf9bd}=await _0x54417d['getId']();this['_ongoingUploads']['delete'](_0x899174),this['_finishContextItemLoading']({'type':_0x3ca267,'id':_0x2bf9bd,'label':_0x1874c0?.['label']||_0x490274,'uiId':_0x899174,'resourceId':_0x1874c0?.['resourceId']},!0x1);}catch(_0x13fac9){this['_ongoingUploads']['delete'](_0x899174);if(!(_0x13fac9 instanceof _0x542443&&_0x13fac9['message']['startsWith']('ai-request-aborted'))){const _0x3f1b40=Oe['get'](_0x13fac9['code'])||'ai-chat-file-upload-failed',_0x3a71f3=new _0x542443(_0x3f1b40,null,{'fileName':_0x490274,..._0x13fac9});_0x3a71f3['stack']=_0x13fac9['stack'],this['fire']('error',{'error':_0x3a71f3});}this['_removeContextItem'](_0x899174);}}));}finally{this['_finishUploadOperation'](_0x55108b);}}['addCurrentDocumentToContext'](_0x41f7ed){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x3f847e={'type':qe['DOCUMENT'],'uiId':'current-document','label':_0x41f7ed,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3f847e);}async['updateCurrentDocument'](_0x57d811,_0x2b08c2,_0x3f4476,_0x3dbbd0){const _0x1c3000=this['_pendingContextItems']['get']('current-document');if(_0x1c3000&&_0x57d811){_0x1c3000['selection']=_0x3dbbd0?_0x3dbbd0['map'](_0x10ff1c=>({'start':_0x10ff1c['start'],'end':_0x10ff1c['end']})):[];try{if(_0x1c3000['version']===_0x2b08c2)return;const {id:_0x45fb4a}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x57d811,{'version':_0x2b08c2,'sessionId':_0x3f4476})['getId']();_0x1c3000['id']=_0x45fb4a,_0x1c3000['content']=_0x57d811,_0x1c3000['version']=_0x2b08c2,_0x1c3000['sessionId']=_0x3f4476;}catch(_0x33ace0){const _0x281eff=new _0x542443('ai-chat-document-upload-failed',null);_0x281eff['stack']=_0x33ace0['stack'],this['fire']('error',{'error':_0x281eff});}}}['addSelectionToContext'](_0x1e7064){this['_addContextItem']({'type':qe['SELECTION'],'label':_0x1e7064,'uiId':'selection','content':_0x1e7064});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x340a88,_0x9a7298){const _0x584358='url-'+_0x2e2dc8();this['_startUploadOperation'](_0x584358);const _0xf261e0='url-'+_0x2e2dc8();try{this['_addContextItem']({'type':qe['URL'],'label':_0x9a7298?.['label']||_0x340a88,'uiId':_0xf261e0,'resourceId':_0x9a7298?.['resourceId']},!0x0);const _0x50fe80=this['_connector']['uploadUrl'](this['_ownerId'],_0x340a88,_0x9a7298);this['_ongoingUploads']['set'](_0xf261e0,_0x50fe80['abortController']);const {id:_0x321031}=await _0x50fe80['getId']();this['_ongoingUploads']['delete'](_0xf261e0),this['_finishContextItemLoading']({'type':qe['URL'],'id':_0x321031,'label':_0x9a7298?.['label']||_0x340a88,'uiId':_0xf261e0,'resourceId':_0x9a7298?.['resourceId']},!0x1);}catch(_0x3d0219){this['_ongoingUploads']['delete'](_0xf261e0),(_0x3d0219['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x542443('ai-chat-url-upload-failed',this,{'url':_0x340a88,'originalError':_0x3d0219}),'url':_0x340a88}),this['_removeContextItem'](_0xf261e0));}finally{this['_finishUploadOperation'](_0x584358);}}['addToolItemToContext'](_0x3338d1){_0x3338d1['id']=_0x3338d1['id']??_0x2e2dc8()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x3338d1['uiId'],_0x3338d1),this['fire']('contextItemAdded',{'contextItem':_0x3338d1,'isLoading':!0x1});}async['loadSourceResources'](_0x43d1b8,_0xc4628d,_0x4f5311){const _0x47c522=this['_addContextOptionsState']['sources']['find'](_0x27ae2e=>_0x27ae2e['id']===_0x43d1b8);if(!_0x47c522)return this['fire']('error',{'error':new _0x542443('ai-chat-source-not-found',this,{'sourceId':_0x43d1b8}),'sourceId':_0x43d1b8}),[];try{const _0x293884=(await _0x47c522['getResources'](_0xc4628d))['map'](_0x147a6a=>{const _0x44318c=this['_isResourceInContext'](_0x147a6a['id']);return{..._0x147a6a,'isInContext':_0x44318c};});return _0x47c522['resources']=_0x293884,this['fire']('sourceResourcesLoaded',{'sourceId':_0x43d1b8,'source':_0x47c522,'resources':_0x293884,'uid':_0x4f5311}),_0x293884;}catch(_0x4a9dc3){return this['fire']('error',{'error':new _0x542443('ai-chat-source-resources-load-failed',this,{'sourceId':_0x43d1b8,'originalError':_0x4a9dc3}),'sourceId':_0x43d1b8,'sourceLabel':_0x47c522['label']}),[];}}async['addResourceToContext'](_0xa9ca89,_0x273af1){if(this['_isResourceInContext'](_0x273af1['id']))return;let _0x18c1e3=_0x273af1['data'];if(!_0x18c1e3&&_0xa9ca89['getData'])try{_0x18c1e3=await _0xa9ca89['getData'](_0x273af1['id']);}catch(_0x3744d5){return void this['fire']('error',{'error':new _0x542443('ai-chat-resource-load-failed',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id'],'originalError':_0x3744d5}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});}if(_0x18c1e3)switch(_0x273af1['type']){case qe['URL']:if('string'!=typeof _0x18c1e3)return void this['fire']('error',{'error':new _0x542443('ai-chat-context-invalid-data',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id'],'expectedType':'string','actualType':typeof _0x18c1e3}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});await this['addUrlToContext'](_0x18c1e3,{'label':_0x273af1['label'],'resourceId':_0x273af1['id']});break;case qe['FILE']:if(!(_0x18c1e3 instanceof File))return void this['fire']('error',{'error':new _0x542443('ai-chat-context-invalid-data',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id'],'expectedType':'File','actualType':typeof _0x18c1e3}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});await this['addFilesToContext']([_0x18c1e3],{'label':_0x273af1['label'],'resourceId':_0x273af1['id']});break;case qe['TEXT']:if('object'!=typeof _0x18c1e3||!('content'in _0x18c1e3)||!('type'in _0x18c1e3))return void this['fire']('error',{'error':new _0x542443('ai-chat-context-invalid-data',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x18c1e3}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});_0x18c1e3=We['_convertTextResourceToFile'](_0x18c1e3,_0x273af1['label']),await this['addFilesToContext']([_0x18c1e3],{'label':_0x273af1['label'],'resourceId':_0x273af1['id']},qe['TEXT']);break;case qe['TOOL']:break;default:this['fire']('error',{'error':new _0x542443('ai-chat-context-unsupported-type',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id'],'resourceType':_0x273af1['type']}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});}else this['fire']('error',{'error':new _0x542443('ai-chat-resource-no-data',this,{'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']}),'resourceId':_0x273af1['id'],'sourceId':_0xa9ca89['id']});}static['_convertTextResourceToFile'](_0x3a45b1,_0x177df5){switch(_0x3a45b1['type']){case Fe['MARKDOWN']:return new File([_0x3a45b1['content']],_0x177df5,{'type':'text/markdown'});case Fe['HTML']:return new File([_0x3a45b1['content']],_0x177df5,{'type':'text/html'});default:return new File([_0x3a45b1['content']],_0x177df5,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x193559){switch(_0x193559['type']){case qe['FILE']:return{'type':qe['FILE'],'id':_0x193559['id']};case qe['URL']:return{'type':qe['URL'],'id':_0x193559['id']};case qe['DOCUMENT']:return{'type':qe['DOCUMENT'],'id':_0x193559['id'],..._0x193559['selection']?.['length']&&{'selection':_0x193559['selection']}};case qe['TEXT']:return{'type':qe['FILE'],'id':_0x193559['id']};case qe['TOOL']:{const _0x5617cd=_0x193559;return{'type':qe['TOOL'],'mcpServerName':_0x5617cd['mcpServerName'],'toolName':_0x5617cd['toolName'],'data':_0x5617cd['data'],'id':_0x5617cd['id']};}default:return null;}}['_addContextItem'](_0x183757,_0x451bdc=!0x1){if(this['_pendingContextItems']['set'](_0x183757['uiId'],_0x183757),_0x183757['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x183757,'isLoading':_0x451bdc}),'current-document'===_0x183757['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x183757['resourceId']){const _0xb3bb11=this['_findSourceIdsByResourceId'](_0x183757['resourceId']);_0xb3bb11&&_0xb3bb11['forEach'](_0x401724=>{this['_updateResourceInContextState'](_0x401724,_0x183757['resourceId'],!0x0);});}}['_removeContextItem'](_0x37a9bd){const _0x9cc782=this['_pendingContextItems']['get'](_0x37a9bd),_0x6758d7=this['_ongoingUploads']['get'](_0x37a9bd);if(_0x6758d7&&(_0x6758d7['abort'](),this['_ongoingUploads']['delete'](_0x37a9bd)),_0x9cc782?.['resourceId']){const _0x39f113=this['_findSourceIdsByResourceId'](_0x9cc782['resourceId']);_0x39f113&&_0x39f113['forEach'](_0x1884b8=>{this['_updateResourceInContextState'](_0x1884b8,_0x9cc782['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x37a9bd),this['fire']('contextItemRemoved',{'uiId':_0x37a9bd,'type':_0x9cc782?.['type']}),'current-document'===_0x37a9bd&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x383618,_0x202c06){if(this['_pendingContextItems']['has'](_0x383618['uiId'])&&(this['_pendingContextItems']['set'](_0x383618['uiId'],_0x383618),this['fire']('contextItemLoadingEnded',{'contextItem':_0x383618,'isLoading':_0x202c06}),_0x383618['resourceId'])){const _0x51f979=this['_findSourceIdsByResourceId'](_0x383618['resourceId']);_0x51f979&&_0x51f979['forEach'](_0x1aa060=>{this['_updateResourceInContextState'](_0x1aa060,_0x383618['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x225b0e){this['_conversationContextItems']['set'](_0x225b0e['uiId'],_0x225b0e);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x388686=>({..._0x388686,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x457aaf=>({..._0x457aaf,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x5e97f0=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x5e97f0,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0xcdc125){for(const _0x3e2dc0 of this['_pendingContextItems']['values']())if(_0x3e2dc0['resourceId']===_0xcdc125)return!0x0;for(const _0x3c4dcb of this['_conversationContextItems']['values']())if(_0x3c4dcb['resourceId']===_0xcdc125)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x4cd791){const _0x44ac5b=[];for(const _0x426d81 of this['_addContextOptionsState']['sources']){_0x426d81['resources']['find'](_0x5a24e7=>_0x5a24e7['id']===_0x4cd791)&&_0x44ac5b['push'](_0x426d81['id']);}return 0x0===_0x44ac5b['length']?null:_0x44ac5b;}['_updateResourceInContextState'](_0x3b2f66,_0x5e2c2f,_0x1fda6e){const _0x28d65b=this['_addContextOptionsState']['sources']['find'](_0xebdc5b=>_0xebdc5b['id']===_0x3b2f66);if(!_0x28d65b)return;const _0x1ce2a0=_0x28d65b['resources']['find'](_0xcd5040=>_0xcd5040['id']===_0x5e2c2f);_0x1ce2a0&&(_0x1ce2a0['isInContext']=_0x1fda6e,this['fire']('resourceStateChanged',{'sourceId':_0x3b2f66,'resourceId':_0x5e2c2f,'isInContext':_0x1fda6e}));}['_startUploadOperation'](_0xbdb9fb){this['_ongoingUploadOperations']['set'](_0xbdb9fb,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x5ead11){this['_ongoingUploadOperations']['delete'](_0x5ead11),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Be=['capabilitiesUpdated'];class Je extends _0x204e9f(){['_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'](_0x2f3039){const _0x15cad4={};return _0x2f3039&&_0x2f3039['isWebSearchEnabled']&&(_0x15cad4['webSearch']={}),_0x2f3039&&_0x2f3039['isReasoningEnabled']&&(_0x15cad4['reasoning']={}),_0x15cad4;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x33e119){_0x33e119!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x33e119,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x1733ee){_0x1733ee!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x1733ee,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ke extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x437ffc){super(_0x437ffc),this['conversationId']=_0x437ffc['conversationId'],this['contextItems']=_0x437ffc['contextItems'],this['capabilities']=_0x437ffc['capabilities'],this['userMessage']=_0x437ffc['userMessage'],this['model']=_0x437ffc['model'],this['attributes']=_0x437ffc['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':We['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Je['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class yt extends _0x204e9f(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0xa84393){super(),this['options']=_0xa84393,this['connector']=_0xa84393['connector'],this['chatModels']=_0xa84393['chatModels'],this['id']=_0xa84393['conversationId'],this['isFromHistory']=_0xa84393['isFromHistory'];}async['init'](_0xbd0a44){try{this['chatContext']=new We({'connector':this['connector'],'config':_0xbd0a44,'ownerId':this['id']}),this['chatContext']['delegate'](...He)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Je(),this['chatCapabilities']['delegate'](...Be)['to'](this),this['chatCapabilities']['init']();const _0x1634c8=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x1634c8});const _0x434e7a=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x434e7a&&await this['setModel'](_0x434e7a);}catch(_0x2c4294){const _0x27bab2=new _0x542443('ai-chat-conversation-init-failed',null,{'message':_0x2c4294['message']||_0x2c4294});_0x27bab2['stack']=_0x2c4294['stack'],this['fire']('error',{'error':_0x27bab2});}}async['start'](){if(this['isStarted'])throw new _0x542443('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x542443('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x148aac}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x148aac,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x324b09){const _0x5b6457=new _0x542443('ai-chat-conversation-start-failed',null,{'message':_0x324b09['message'],'conversationId':this['id']});throw _0x5b6457['stack']=_0x324b09['stack'],this['fire']('error',{'error':_0x5b6457}),_0x5b6457;}}async['load'](_0x103006,_0x3968f2){try{const _0x2ec190=await this['connector']['fetchConversation'](_0x103006)['getConversation'](),_0x4f4aac=await this['connector']['fetchConversationMessages'](_0x103006)['getMessages'](),_0x523658=_0x4f4aac[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x2ec190['id'],'title'in _0x2ec190?this['fire']('setConversationTitle',_0x2ec190['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0xe03fe6=(await this['chatModels']['getAll']())['find'](_0x19517a=>_0x19517a['id']['toLowerCase']()===_0x523658['toLowerCase']());return this['selectedModel']=_0xe03fe6,this['fire']('modelSelected',{'selectedModel':_0xe03fe6,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x4f4aac,_0x3968f2,_0x523658),this['currentInteraction']=void 0x0,this;}catch(_0x5983b2){const _0x109314=new _0x542443('ai-chat-conversation-init-from-id-failed',null,{'message':_0x5983b2['message'],'conversationId':_0x103006});throw _0x109314['stack']=_0x5983b2['stack'],this['fire']('error',{'error':_0x109314}),_0x109314;}}async['_processMessagesToInteractions'](_0x21dbf0,_0x17b61e,_0x411791){let _0x535093;for(const _0x13a016 of _0x21dbf0)if('user'===_0x13a016['role']){const _0x40748c=await this['_extractContextItems'](_0x13a016),_0x3db0e7={'isReasoningEnabled':Object['hasOwn'](_0x13a016['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x13a016['capabilities'],'webSearch')};_0x535093=this['createInteraction']({'userMessage':_0x13a016['prompt'],'contextItems':_0x40748c,'capabilities':_0x3db0e7,'modelId':_0x411791,'attributes':_0x13a016['attributes']}),this['currentInteraction']=_0x535093,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x13a016['role']&&_0x535093){const _0x5a6c1f=[];for(const _0x2236b1 of _0x13a016['content'])switch(_0x2236b1['type']){case'text':case'modification':{const _0x3e67ee=_0x535093['getDocumentContext']()?.['sessionId']!==_0x17b61e;_0x535093['currentReply']=_0x535093['createReply']({'type':_0x2236b1['type'],'isDone':!0x0,'interactionId':_0x535093['id'],'areActionsDisabled':_0x3e67ee}),_0x535093['currentReply']['appendContent'](_0x2236b1['content']),_0x5a6c1f['length']>0x0&&(_0x535093['currentReply']['sources']=_0x5a6c1f['splice'](0x0));break;}case'url':_0x5a6c1f['push'](_0x2236b1);break;case'mcp-tool-result':{const {data:_0x102970,attributes:_0x374da6}=JSON['parse'](_0x2236b1['content']);_0x535093['_handleToolResultData']({'toolName':_0x2236b1['toolName'],'data':_0x102970,'attributes':_0x374da6});break;}}}}}async['_extractContextItems'](_0x1d680c){const _0x205832=new Map();if(!_0x1d680c['content'])return _0x205832;for(const _0x5741cc of _0x1d680c['content']){const _0x3356e8=await this['chatContext']['populateFromMessage'](_0x5741cc);_0x3356e8&&_0x205832['set'](_0x3356e8['id'],_0x3356e8);}return _0x205832;}async['handleUserInteraction']({userMessage:_0xe25b33,attributes:_0x233c4e}){if(!this['isStarted'])throw new _0x542443('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x542443('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x3eb669=this['chatContext']['getPendingContextItems'](),_0x279e59=this['chatCapabilities']['getCapabilitiesConfig'](),_0x4b358a=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0xe25b33,'contextItems':_0x3eb669,'capabilities':_0x279e59,'modelId':_0x4b358a,'attributes':_0x233c4e}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x1d27a2){if(_0x1d27a2 instanceof _0x542443)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x1d27a2});else{const _0x190b30=Oe['get'](_0x1d27a2['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x542443(_0x190b30,null,{'error':_0x1d27a2})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x56491f,contextItems:_0x46daaa,capabilities:_0x37e7d7,modelId:_0x13b47c,attributes:_0x1b82ba}){const _0x25d6cc=new Ke({'userMessage':_0x56491f,'contextItems':_0x46daaa,'capabilities':_0x37e7d7,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x13b47c,'attributes':_0x1b82ba});return _0x25d6cc['delegate'](...ye)['to'](this),this['interactions']['push'](_0x25d6cc),this['fire']('interactionCreated',_0x25d6cc),_0x25d6cc;}['getInteraction'](_0x5b3de0){return this['interactions']['find'](_0x22741a=>_0x22741a['id']===_0x5b3de0);}['removeInteraction'](_0x514f06){const _0x7e32e7=this['getInteraction'](_0x514f06);_0x7e32e7&&(_0x7e32e7['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x7e32e7),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x181fce){this['chatContext']['addCurrentDocumentToContext'](_0x181fce);}async['updateCurrentDocumentInContext']({content:_0x4652f3,version:_0x320a37,sessionId:_0x3cac41,selections:_0x53c5b1}){await this['chatContext']['updateCurrentDocument'](_0x4652f3,_0x320a37,_0x3cac41,_0x53c5b1);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x143704){this['chatContext']['addSelectionToContext'](_0x143704);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x50090e){this['chatContext']['addFilesToContext'](_0x50090e);}['addUrlToContext'](_0xd3cf7f){this['chatContext']['addUrlToContext'](_0xd3cf7f);}['addToolItemToContext'](_0x5774f9){this['chatContext']['addToolItemToContext'](_0x5774f9);}['addResourceToContext'](_0x23d67d,_0x3a374f){this['chatContext']['addResourceToContext'](_0x23d67d,_0x3a374f);}['loadSourceResources'](_0x305ca5,_0x360f66,_0x1678ee){return this['chatContext']['loadSourceResources'](_0x305ca5,_0x360f66,_0x1678ee);}['removeFromContext'](_0x48332a){this['chatContext']['removeFromContext'](_0x48332a);}['setWebSearch'](_0x594d09){this['chatCapabilities']['setWebSearch'](_0x594d09);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x1a0735){this['chatCapabilities']['setReasoning'](_0x1a0735);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x5b033f){_0x5b033f?!0x1===await this['chatModels']['isAvailable'](_0x5b033f)&&(_0x23c4c9('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x5b033f}),_0x5b033f=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x23c4c9('ai-chat-conversation-set-model-null',{'conversation':this}),_0x5b033f=(await this['chatModels']['getAvailableModels']())[0x0]),_0x5b033f['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x5b033f,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x5b033f}));}}class At extends _0x204e9f(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3d4f90,config:_0x1cb9d3,locale:_0x41689f}){super(),this['_connector']=_0x3d4f90,this['_config']=_0x1cb9d3,this['_locale']=_0x41689f;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x245e1c=await this['getAll']();let _0x113169;return _0x113169=this['_availableModels']?this['_filterModels'](_0x245e1c,this['_availableModels']):_0x245e1c['filter'](_0x2db8b9=>_0x2db8b9['recommended']),_0x113169;}async['getModel'](_0x304076){const _0x781bb=await this['getAll']();if(!_0x781bb['length'])return null;if(_0x304076){const _0x1850c1=this['_getModelById'](_0x781bb,_0x304076);if(_0x1850c1)return _0x1850c1;_0x23c4c9('ai-chat-model-id-unrecognized',{'modelId':_0x304076,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x47bad8=await this['getAvailableModels']();if(!_0x47bad8['length'])return null;if(this['_defaultModelId']){const _0x39af13=this['_getModelById'](_0x47bad8,this['_defaultModelId']);if(_0x39af13)return _0x39af13;_0x23c4c9('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x47bad8[0x0]['id']});}return _0x47bad8[0x0];}async['isAvailable'](_0x707184){return(await this['getAvailableModels']())['some'](_0x4e9ca6=>_0x4e9ca6['name']===_0x707184['name']&&_0x4e9ca6['provider']===_0x707184['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x17ccdc=this['_locale']['uiLanguage']||'en',_0x3a7047=this['_connector']['getModels'](_0x17ccdc),_0x3db6ad=await _0x3a7047['list']();this['_modelList']=_0x3db6ad['items']['map'](_0x4bd5b3=>Mi(_0x4bd5b3)?{..._0x4bd5b3,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x4bd5b3);}catch(_0x4880de){throw Ct('ai-models-unable-to-retrieve',{'error':_0x4880de}),_0x4880de;}return[...this['_modelList']];}['_filterModels'](_0x582a57,_0x42dcf1){let _0x4d600c;if(_0x42dcf1){_0x4d600c=[];const _0x6b9275=new Set(),_0x97ac4a='string'==typeof _0x42dcf1?[_0x42dcf1['toLocaleLowerCase']()]:_0x42dcf1['map'](_0x44ffa4=>_0x44ffa4['toLocaleLowerCase']());for(const _0x3ae5b3 of _0x97ac4a)for(const _0x5500e4 of _0x582a57)!_0x6b9275['has'](_0x5500e4['id'])&&this['_isMatchingFilter'](_0x5500e4,_0x3ae5b3)&&(_0x4d600c['push'](_0x5500e4),_0x6b9275['add'](_0x5500e4['id']));}else _0x4d600c=_0x582a57;return _0x4d600c;}['_isMatchingFilter'](_0x3be5eb,_0x312f48){const _0x5a7204=_0x3be5eb['id']['toLocaleLowerCase'](),_0x28817a=_0x3be5eb['name']['toLocaleLowerCase'](),_0x1996c3=_0x3be5eb['provider']['toLocaleLowerCase']();return _0x5a7204===_0x312f48||_0x28817a===_0x312f48||Mi(_0x3be5eb)&&'auto'===_0x312f48||_0x1996c3===_0x312f48||_0x5a7204['startsWith'](_0x312f48);}['_getModelById'](_0x4056da,_0x2c9b60){return _0x4056da['find'](_0x504313=>Mi(_0x504313)&&'auto'===_0x2c9b60?_0x504313:_0x504313['id']===_0x2c9b60)||null;}}function Mi(_0x29b4ed){return _0x29b4ed['id']['startsWith']('agent');}function et(_0x4b46e2){if(_0x4b46e2 instanceof dt)return _0x4b46e2;if(_0x4b46e2?.['editors']&&_0x4b46e2['editors']['get'](0x0))return _0x4b46e2['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.'),_0x4b46e2['editors']['get'](0x0);throw new _0x542443('ai-get-editor-from-context-no-editor');}function W({editor:_0x5c793,interaction:_0x5d0c05,reply:_0x1b8a76,groups:_0x2729c5,transform:_0x10dec5,documentCompare:_0x2f385b,documentCompareOptions:_0x1b589e}){const _0x4044af=_0x5d0c05['getDocumentContext']();if(!_0x4044af)return[];const _0xcc9e9e=_0x4044af['content'],_0x30a3e0=_0x4044af['version'],_0x5e0dd5=_0x1b8a76['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4d1e60}of _0x2729c5){const _0x48ee2f=_0x4d1e60['filter'](_0x552f73=>'new'!=_0x552f73['type'])['map'](_0x22b8f1=>bt('data-id',_0x22b8f1['id'],_0x5e0dd5)),_0x569efd=_0x4d1e60['filter'](_0x4b8122=>'removed'!=_0x4b8122['type'])['map'](_0x54935e=>_0x54935e['node']['cloneNode'](!0x0));let _0x6fec68=null;if(_0x48ee2f['length']){_0x6fec68=_0x48ee2f[0x0]['previousSibling'];for(let _0x36c202=0x0;_0x36c202<_0x48ee2f['length'];_0x36c202++)_0xb8c25a(_0x48ee2f[_0x36c202]);}if(_0x569efd['length']){_0x6fec68||(_0x4d1e60[0x0]['anchorId']?_0x6fec68=bt('data-id',_0x4d1e60[0x0]['anchorId'],_0x5e0dd5):(_0x6fec68=_0x569efd['shift'](),_0x52afa8(_0x5e0dd5,_0x6fec68)));for(let _0x1a747d=0x0;_0x1a747d<_0x569efd['length'];_0x1a747d++)_0x59a323(_0x6fec68,_0x569efd[_0x1a747d]),_0x6fec68=_0x569efd[_0x1a747d];}}const _0x5aa615=Dt(_0x5e0dd5),_0x4eba8f=_0x2f385b['getDiff'](_0xcc9e9e,_0x5aa615,_0x1b589e)['getOperations']();if(_0x10dec5){const _0x5ec1f2=_0x5c793['model']['document']['history']['getOperations'](_0x30a3e0),_0x4a9452={'document':_0x5c793['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x359a53(_0x4eba8f,_0x5ec1f2,_0x4a9452)['operationsA'];}return _0x4eba8f;}function V(_0x2c77ad,_0x26a26c){if('marker'!=_0x26a26c['type'])return;const _0x3b1596=_0x2c77ad['model']['markers']['get'](_0x26a26c['name']);_0x3b1596&&(_0x26a26c['oldRange']=_0x3b1596['getRange']());}class ht extends _0x118815{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[S,_0x143aa3];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x49fddd(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new At({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x4dd847=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0xfc760a,_0x3d648b)=>{this['_handleUIUserMessage']({'userMessage':_0x3d648b});}),this['listenTo'](_0x4dd847,'resizedTabs',(_0x43627d,_0x378944)=>{this['_setIsMaximized'](_0x378944);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x4dd847['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x449949,_0x4e7945)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x4e7945));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x5469b3,_0x8bb70a)=>{this['activeConversation']?.['addUrlToContext'](_0x8bb70a);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x5f5b9d,_0x4a5491)=>{_0x4a5491['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x14e072,_0x4d9560)=>{this['activeConversation']?.['addResourceToContext'](_0x4d9560['source'],_0x4d9560['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x27c966,_0x2eb23c)=>{this['_removeFromContext'](_0x2eb23c);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x105e70,_0x47851a)=>{this['activeConversation']?.['loadSourceResources'](_0x47851a['sourceId'],_0x47851a['query'],_0x47851a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x5592f8,_0x2cd039)=>{this['activeConversation']?.['setModel'](_0x2cd039);}),this['listenTo'](this['_aiChatUi'],'like',(_0x2a237f,{replyId:_0x167031})=>{console['log']('Liked\x20response',_0x167031);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x3a82ea,{replyId:_0x50c5bc})=>{console['log']('Disliked\x20response',_0x50c5bc);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x542afc,_0x56e85e)=>{this['_insertSuggestion'](_0x56e85e);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x5721eb,{replyId:_0x4e1d68,partIndex:_0x24a5a1})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4e1d68,_0x24a5a1);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x699b4b,{replyId:_0x20a5d0,partIndex:_0x7be5c0})=>{const _0x28d59a=this['_getDocumentRangeForReplyChanges'](_0x20a5d0,_0x7be5c0);_0x28d59a&&'$graveyard'!=_0x28d59a['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x28d59a['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3cfd49,_0x2a5187)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x2a5187);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x1cd942,{replyId:_0x2c49fe,showDiff:_0x4639c8})=>{const {reply:_0x56a068}=this['getInteractionAndReplyById'](_0x2c49fe),_0x5a2444=_0x56a068['getContentParts']({'showDiff':_0x4639c8});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x56a068['id'],'parts':_0x5a2444,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x3e0490,{replyId:_0x345463,partIndex:_0x336537})=>{this['_rejectSuggestion']({'replyId':_0x345463,'partIndex':_0x336537}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x4d219a,partIndex:_0x2b946a}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x389c54}=this['getInteractionAndReplyById'](_0x4d219a),_0x1039c7=_0x389c54['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x2b946a});this['_aiChatBalloon']['updateContent']({'part':_0x1039c7[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x2f0562,partIndex:_0x92c683}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x2f0562,'partIndex':_0x92c683}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x55b12d,partIndex:_0x1636a8}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x55b12d,'partIndex':_0x1636a8}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x39dd3c,partIndex:_0x2dd88a}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x39dd3c,'partIndex':_0x2dd88a}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0xc0b315,partIndex:_0x3a13d4}=this['_currentPreviewedChangeGroup'],_0x2e53bf=this['_getPresentableSiblingContentPartIndex'](_0xc0b315,_0x3a13d4,'next');null!==_0x2e53bf&&this['_openBalloonFor'](_0xc0b315,_0x2e53bf);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x4c41cb,partIndex:_0x5edee9}=this['_currentPreviewedChangeGroup'],_0x18fb10=this['_getPresentableSiblingContentPartIndex'](_0x4c41cb,_0x5edee9,'previous');null!==_0x18fb10&&this['_openBalloonFor'](_0x4c41cb,_0x18fb10);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x405283,{id:_0x474bd2})=>{if('aiChatBalloon'!==_0x474bd2)return;const {replyId:_0x90bb7e,partIndex:_0x153003}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x90bb7e,'index':_0x153003,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1c9575,_0xb81fd9)=>{_0xb81fd9['on']('ready',()=>{this['_integrateEditor'](_0xb81fd9);});});const _0x468657=this['context']['config']['get']('ai.chat.initialConversation');let _0x155367=_0x468657;if('lastCreated'!=_0x468657||(_0x155367=await this['_getLastCreatedConversationId'](),_0x155367))return'new'==_0x155367?this['_startConversationSafely']():this['loadConversation'](_0x155367);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x5570b0){const _0x4cddd9=et(this['context']);if(!_0x4cddd9['plugins']['has']('TrackChanges'))throw new _0x542443('ai-no-track-changes',null);const _0x1d601d=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x2cc192,interaction:_0x54667b}=this['getInteractionAndReplyById'](_0x5570b0['replyId']),_0x2bd5f2=this['_getDocumentRangeForReplyChanges'](_0x5570b0['replyId'],_0x5570b0['partIndex']),_0x5304b1=void 0x0!==_0x5570b0['partIndex']?[_0x2cc192['changeGroups'][_0x5570b0['partIndex']]]:_0x2cc192['changeGroups']['filter'](_0x3c447f=>'pending'==_0x3c447f['state']),_0x4b623f=_0x5304b1['map'](_0x332aec=>_0x2cc192['changeGroups']['indexOf'](_0x332aec));if(!_0x2bd5f2||'$graveyard'==_0x2bd5f2['range']['root']['rootName'])return void _0x4b623f['forEach'](_0x29cb71=>_0x2cc192['setChangeGroupState'](_0x29cb71,'outdated'));_0x4b623f['forEach'](_0x2f98f2=>_0x2cc192['setChangeGroupState'](_0x2f98f2,'accepted'));const _0x304e85=W({'editor':_0x4cddd9,'reply':_0x2cc192,'interaction':_0x54667b,'groups':_0x5304b1,'transform':!0x0,'documentCompare':_0x1d601d,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x2fa8b2;_0x2bd5f2&&this['_scrollToSuggestionRange'](_0x2bd5f2['range']),_0x4cddd9['model']['change'](_0x5684ad=>{_0x2fa8b2=_0x5684ad['batch'],_0x4cddd9['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x304e85),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x2fa8b2,{'interactionId':_0x54667b['id'],'replyId':_0x2cc192['id'],'indexes':_0x4b623f['slice']()}),this['_updateRatings'](_0x2cc192);}['_applySuggestion'](_0x565e96){const _0x5c9bc0=et(this['context']),_0x2133b5=this['context']['plugins']['get'](_0x143aa3),{reply:_0x31a0f3,interaction:_0x4af452}=this['getInteractionAndReplyById'](_0x565e96['replyId']),_0xe3e65b=this['_getDocumentRangeForReplyChanges'](_0x565e96['replyId'],_0x565e96['partIndex']),_0x425965=void 0x0!==_0x565e96['partIndex']?[_0x31a0f3['changeGroups'][_0x565e96['partIndex']]]:_0x31a0f3['changeGroups']['filter'](_0x93b7a0=>'pending'==_0x93b7a0['state']),_0x2525bd=_0x425965['map'](_0x376b3c=>_0x31a0f3['changeGroups']['indexOf'](_0x376b3c));if(!_0xe3e65b||'$graveyard'==_0xe3e65b['range']['root']['rootName'])return void _0x2525bd['forEach'](_0x5848fa=>_0x31a0f3['setChangeGroupState'](_0x5848fa,'outdated'));_0x2525bd['forEach'](_0x6065d1=>_0x31a0f3['setChangeGroupState'](_0x6065d1,'accepted'));const _0x559123=W({'editor':_0x5c9bc0,'reply':_0x31a0f3,'interaction':_0x4af452,'groups':_0x425965,'transform':!0x0,'documentCompare':_0x2133b5,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0xdf6dc3;_0xe3e65b&&this['_scrollToSuggestionRange'](_0xe3e65b['range']),_0x5c9bc0['model']['change'](_0x9605e3=>{_0xdf6dc3=_0x9605e3['batch'];for(const _0x3de23e of _0x559123)_0x3de23e['baseVersion']=_0x5c9bc0['model']['document']['version'],V(_0x5c9bc0,_0x3de23e),_0x9605e3['batch']['addOperation'](_0x3de23e),_0x5c9bc0['model']['applyOperation'](_0x3de23e);}),this['_batchToChanges']['set'](_0xdf6dc3,{'interactionId':_0x4af452['id'],'replyId':_0x31a0f3['id'],'indexes':_0x2525bd['slice']()}),this['_updateRatings'](_0x31a0f3);}['_rejectSuggestion'](_0x2c95c8){const {reply:_0x1719ea}=this['getInteractionAndReplyById'](_0x2c95c8['replyId']);_0x1719ea['setChangeGroupState'](_0x2c95c8['partIndex'],'rejected');}['_openBalloonFor'](_0x3af545,_0x4a9c94){if(!this['_aiChatBalloon'])return;const {reply:_0x5b3ba9}=this['getInteractionAndReplyById'](_0x3af545),_0x5ab7ca=_0x5b3ba9['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x188e7a,_0x5ada55;if(void 0x0!==_0x4a9c94?(_0x5ada55=_0x5ab7ca['find'](_0x5151da=>_0x5151da['index']==_0x4a9c94),_0x188e7a=_0x5ada55?.['index']):(_0x5ada55=_0x5ab7ca[0x0],_0x188e7a=_0x5ada55['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x3af545&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x188e7a)return;const _0x5d8e0d=this['_getUserPresentableContentPartDocumentRange'](_0x3af545,_0x5b3ba9,_0x5ada55);if(!_0x5d8e0d)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x3af545,'partIndex':_0x188e7a},this['_scrollToSuggestionRange'](_0x5d8e0d,!0x0);const _0x5c3387=this['_getPresentableSiblingContentPartIndex'](_0x3af545,_0x188e7a,'next');this['_aiChatBalloon']['updateContent']({'part':_0x5ada55,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x188e7a,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x188e7a+0x1)['toString']()),'showRotator':null!==_0x5c3387,'ranges':[_0x5d8e0d],'areActionsDisabled':_0x5b3ba9['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x3af545,_0x188e7a),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x3af545,'index':_0x188e7a,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x1fae87,_0x565934,_0x366858){const {reply:_0x3c8e37}=this['getInteractionAndReplyById'](_0x1fae87),_0x179356=_0x3c8e37['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x179356['length'])return null;const _0x2ff46e=_0x179356['findIndex'](_0x278339=>_0x278339['index']==_0x565934),_0x4d9ae9='next'==_0x366858?0x1:-0x1;let _0x1ab7dd=_0x179356['at']((_0x2ff46e+_0x4d9ae9)%_0x179356['length'])['index'],_0x5f38b2=_0x179356[_0x1ab7dd];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x1fae87,_0x3c8e37,_0x5f38b2);){if(_0x1ab7dd=_0x179356['at']((_0x1ab7dd+_0x4d9ae9)%_0x179356['length'])['index'],_0x1ab7dd===_0x2ff46e)return null;_0x5f38b2=_0x179356[_0x1ab7dd];}return _0x1ab7dd;}['_getUserPresentableContentPartDocumentRange'](_0x63cbb3,_0x30fcd7,_0x1516ec){const _0x91f169=_0x30fcd7['changeGroups'];if(!_0x1516ec['hasChanges'])return null;const _0x8e0628=_0x91f169['find'](_0x2f7b3c=>_0x2f7b3c['index']==_0x1516ec['index']);if('pending'!==_0x8e0628?.['state'])return null;const _0xfd7a5c=this['_getDocumentRangeForReplyChanges'](_0x63cbb3,_0x1516ec['index']);if(!_0xfd7a5c)return null;const {range:_0x1cc19b,currentIndex:_0x447ed4}=_0xfd7a5c;return'$graveyard'==_0x1cc19b['root']['rootName']?(_0x30fcd7['setChangeGroupState'](_0x447ed4,'outdated'),null):_0xfd7a5c['range'];}['_getDocumentRangeForReplyChanges'](_0x3315fd,_0x63bd8e){const _0x968b5e=et(this['context']),{reply:_0x28a2ca,interaction:_0x417b8a}=this['getInteractionAndReplyById'](_0x3315fd),_0x1e2030=_0x28a2ca['changeGroups']['filter'](_0x1c0d1a=>'pending'==_0x1c0d1a['state']),_0x178f77=_0x1e2030['map'](_0x4dcdb0=>_0x28a2ca['changeGroups']['indexOf'](_0x4dcdb0));void 0x0===_0x63bd8e&&(_0x63bd8e=_0x178f77[0x0]);const _0x2b7208=_0x178f77['indexOf'](_0x63bd8e);if(-0x1==_0x2b7208)return null;const _0x5ec1a9=_0x1e2030[_0x2b7208],_0x2a577f=new Rt([]),_0x5ae6a3=new Rt([]);for(const _0x214dbc of _0x5ec1a9['changes'])if('removed'!=_0x214dbc['type']&&_0x5ae6a3['children']['push'](_0x214dbc['node']['cloneNode'](!0x0)),'new'!=_0x214dbc['type']){const _0x13ca40=xt(_0x4fe190=>Ot(_0x4fe190,'data-id')==_0x214dbc['id'],_0x28a2ca['documentContextContent'],!0x0);_0x2a577f['children']['push'](_0x13ca40['cloneNode'](!0x0));}if(0x0==_0x2a577f['children']['length']){if(_0x5ec1a9['changes'][0x0]['anchorId']){const _0x25507c=bt('data-id',_0x5ec1a9['changes'][0x0]['anchorId'],_0x28a2ca['documentContextContent']);_0x2a577f['children']['unshift'](_0x25507c['cloneNode'](!0x0)),_0x5ae6a3['children']['unshift'](_0x25507c['cloneNode'](!0x0)),_0x25507c['nextSibling']&&(_0x2a577f['children']['push'](_0x25507c['nextSibling']['cloneNode'](!0x0)),_0x5ae6a3['children']['push'](_0x25507c['nextSibling']['cloneNode'](!0x0)));}else{const _0x579162=_0x28a2ca['documentContextContent']['children'][0x0];if(!_0x579162)return null;_0x2a577f['children']['push'](_0x579162['cloneNode'](!0x0)),_0x5ae6a3['children']['push'](_0x579162['cloneNode'](!0x0));}}const _0x3e4041=_0x417b8a['getDocumentContext'](),_0x138813=_0x968b5e['data']['parse'](_0x3e4041['content']),_0xe07159=Dt(_0x2a577f),_0x38d860=_0x968b5e['data']['parse'](_0xe07159),_0x5639c8=_0x968b5e['data']['parse'](_0xe07159),_0x511390=_0x968b5e['model']['createPositionAt'](_0x38d860,0x0),_0x2068e7=Dt(_0x5ae6a3),_0x1b2b95={'anchor':_0x511390,'markDeletions':!0x1},_0xc06dfb=_0x968b5e['plugins']['get'](_0x143aa3)['getDiff'](_0xe07159,_0x2068e7,_0x1b2b95)['getOperations']();if(!_0xc06dfb['length'])return null;_0x968b5e['model']['change'](_0x2e94e5=>{for(const _0x4e6e43 of _0xc06dfb)if('remove'==_0x4e6e43['type']){const _0x5431c5=_0x4e6e43['sourcePosition'],_0x1d210b=_0x4e6e43['howMany'],_0x5dc496=new _0x5de5b5(_0x5431c5,_0x1d210b);_0x2e94e5['batch']['addOperation'](_0x5dc496),_0x968b5e['model']['applyOperation'](_0x5dc496);}else'marker'!==_0x4e6e43['type']&&(_0x4e6e43['baseVersion']=null,_0x4e6e43['isDocumentOperation']=!0x1,_0x2e94e5['batch']['addOperation'](_0x4e6e43),_0x968b5e['model']['applyOperation'](_0x4e6e43));});const _0x2e99a4=vt(_0x968b5e,_0xc06dfb,_0x38d860);St(_0x968b5e['model'],_0x2e99a4);const _0x5e18e9=_0x2e99a4['getFirstRange']()['start']['path']['slice'](),_0x512c11=_0x2e99a4['getFirstRange']()['end']['path']['slice'](),_0x3da5af=[];let _0x341c5a=_0x38d860,_0x1a711e=_0x5639c8;for(let _0x2d0b2f=0x0;_0x2d0b2f<_0x512c11['length'];_0x2d0b2f++){const _0x4354e7=_0x341c5a['maxOffset']-_0x512c11[_0x2d0b2f];_0x3da5af[_0x2d0b2f]=_0x1a711e['maxOffset']-_0x4354e7,_0x341c5a=_0x341c5a['getChildAtOffset'](_0x512c11[_0x2d0b2f]),_0x1a711e=_0x1a711e['getChildAtOffset'](_0x3da5af[_0x2d0b2f]);}const _0x580b8c=_0x968b5e['model']['createRange'](_0x968b5e['model']['createPositionFromPath'](_0x5639c8,_0x5e18e9),_0x968b5e['model']['createPositionFromPath'](_0x5639c8,_0x3da5af)),_0x56f52e=_0x5639c8['getChild'](0x0)['getAttribute'](Et),_0x4cb18f=Array['from'](_0x138813['getChildren']())['find'](_0x472fad=>_0x472fad['getAttribute'](Et)==_0x56f52e)['getPath'](),_0x275a5b=_0x580b8c['start']['path']['slice'](),_0x5e5f31=_0x580b8c['end']['path']['slice']();_0x275a5b[0x0]=_0x4cb18f[0x0]+_0x275a5b[0x0],_0x5e5f31[0x0]=_0x4cb18f[0x0]+_0x5e5f31[0x0];let _0x376e7a=_0x968b5e['model']['createRange'](_0x968b5e['model']['createPositionFromPath'](_0x968b5e['model']['document']['getRoot'](),_0x275a5b),_0x968b5e['model']['createPositionFromPath'](_0x968b5e['model']['document']['getRoot'](),_0x5e5f31));const _0x5727e9=_0x968b5e['model']['document']['history']['getOperations'](_0x3e4041['version']);for(const _0x5625ff of _0x5727e9)_0x376e7a=_0x561be6['_createFromRanges'](_0x376e7a['getTransformedByOperation'](_0x5625ff));return{'range':_0x376e7a,'currentIndex':_0x63bd8e};}['_integrateEditor'](_0x30b913){if(!_0x30b913['plugins']['has']('Undo'))return;const _0x5b7b77=_0x30b913['commands']['get']('undo'),_0x1acc67=_0x30b913['commands']['get']('redo');this['listenTo'](_0x5b7b77,'revert',(_0x2f7128,_0x222b9d,_0x3d64cf)=>{const _0x44c53b=this['_batchToChanges']['get'](_0x222b9d);if(!_0x44c53b)return;const _0x75f7b3=this['activeConversation']['getInteraction'](_0x44c53b['interactionId'])['getReply'](_0x44c53b['replyId']);_0x44c53b['indexes']['forEach'](_0x1691be=>_0x75f7b3['setChangeGroupState'](_0x1691be,'pending')),this['_batchToChanges']['delete'](_0x222b9d),this['_batchToChanges']['set'](_0x3d64cf,_0x44c53b);}),this['listenTo'](_0x1acc67,'revert',(_0xc95e2c,_0x1b9519,_0x50fb9f)=>{const _0x4e4e03=this['_batchToChanges']['get'](_0x1b9519);if(!_0x4e4e03)return;const _0x21e793=this['activeConversation']['getInteraction'](_0x4e4e03['interactionId'])['getReply'](_0x4e4e03['replyId']);_0x4e4e03['indexes']['forEach'](_0x5df410=>_0x21e793['setChangeGroupState'](_0x5df410,'accepted')),this['_batchToChanges']['delete'](_0x1b9519),this['_batchToChanges']['set'](_0x50fb9f,_0x4e4e03);});}async['loadConversation'](_0x1cf9c8){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](_t)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1cf9c8)['getConversation'](),await this['_startConversationSafely'](_0x1cf9c8),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1cf9c8,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x3c1047){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1cf9c8}),this['_logError'](new _0x542443('ai-chat-conversation-not-found',this,{'error':_0x3c1047}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x5e2cc3=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x10e351=await _0x5e2cc3['getConversations']();return _0x10e351['length']?_0x10e351[0x0]['id']:'new';}catch(_0x2f5c04){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x2e2dc8()}),this['_logError'](new _0x542443('ai-chat-conversation-init-failed',this,{'error':_0x2f5c04})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x2b8ea0){this['activeConversation']['id']===_0x2b8ea0&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x1d6bbb=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x1d6bbb),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x3d1553,attributes:_0x29be9b}){await this['_handleUIUserMessage']({'userMessage':_0x3d1553,'attributes':_0x29be9b});}['getGroupId'](){const _0x2430e4=this['context']['config']['get']('collaboration.channelId');if(!_0x2430e4)throw new _0x542443('ai-chat-missing-channel-id',this);return _0x2430e4;}async['_startConversationSafely'](_0x293054){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x293054);}catch(_0x50e556){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x293054||_0x2e2dc8()}),console['error'](_0x50e556),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x4a932e){let _0x114aa5;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x4a932e||!this['activeConversation']?_0x114aa5=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x114aa5=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x13bd38=this['getGroupId'](),_0x4efcd1=_0x4a932e||_0x2e2dc8();this['activeConversation']=new yt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x114aa5,'conversationId':_0x4efcd1,'group':_0x13bd38,'getEditor':()=>et(this['context']),'isFromHistory':!!_0x4a932e}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x517c7c,_0x3e1263)=>{this['_aiChatUi']['createConversation'](_0x3e1263),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x4a932e||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x7db5e4,_0x41634b)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x41634b['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x477254,_0x4f9b5f)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4f9b5f);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x5db7d9=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x5db7d9);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x184554=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x184554);}),this['activeConversation']['on']('webSearchFinished',(_0x1c7b56,_0x3fdd40)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3fdd40,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x2d6e37,_0x2c81ef)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2c81ef,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x3f7f55,_0x54767b)=>{this['_aiChatUi']['removeFeedInteraction'](_0x54767b['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x10aba5,_0x1bb7a0,_0x557c52)=>{this['updateConversationTitle'](_0x1bb7a0,_0x557c52);}),this['activeConversation']['on']('replyCreated',(_0x2a7f79,_0x1a57ec)=>{'text'===_0x1a57ec['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x1a57ec):this['_aiChatUi']['addFeedItemAISuggestion'](_0x1a57ec);}),this['activeConversation']['on']('replyContentUpdated',async(_0x57c9c6,_0x50d159)=>{await this['_updateReplyContent']({'reply':_0x50d159});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x5e924d,{reply:_0x4635cd,index:_0x3621d3,state:_0x199bda})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x4635cd['id'],'index':_0x3621d3,'state':_0x199bda}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x4635cd['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3621d3&&this['_aiChatBalloon']?.['setState'](_0x199bda);}),this['activeConversation']['on']('contextItemAdded',(_0x3f3e96,_0x4b852d)=>{if(this['_aiChatUi']['addContextItem'](_0x4b852d['contextItem'],_0x4b852d['isLoading']),'selection'===_0x4b852d['contextItem']['type']){const _0xbb2d91=[...et(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0xbb2d91,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x2f0f89,_0x10e083)=>{this['_aiChatUi']['removeContextItem'](_0x10e083['uiId']),'current-document'==_0x10e083['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x10e083['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x580df3,_0x144dad)=>{this['_aiChatUi']['setContextItemLoading'](_0x144dad['contextItem']['uiId'],_0x144dad['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x2837f6,_0x22038f)=>{this['_aiChatUi']['setConversationContext'](_0x22038f['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x5170eb,_0x35150f)=>{this['_aiChatUi']['setAddContextOptions'](_0x35150f['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x5282cd,_0x52fe92)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x52fe92['sourceId'],_0x52fe92['source'],_0x52fe92['resources'],_0x52fe92['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x3b20c7,_0x3ea5e6)=>{this['_aiChatUi']['updateResourceState'](_0x3ea5e6['sourceId'],_0x3ea5e6['resourceId'],_0x3ea5e6['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x3d06ad,_0x53109c)=>{this['_aiChatUi']['updateCapabilities'](_0x53109c);}),this['activeConversation']['on']('modelSelected',async(_0x4f9830,_0x4728ea)=>{const _0x300c08=(await this['_aiChatModels']['getAll']())['find'](_0x4fed32=>_0x4fed32['id']===_0x4728ea['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x300c08,_0x4728ea['isDisabled']);}),this['activeConversation']['on']('error',(_0x57ff47,{error:_0x4c9cd5,interactionId:_0x4fae35,fileName:_0x5e3abe,url:_0x5e7490,sourceId:_0xa14f03,sourceLabel:_0x406ef6})=>{const _0x29fe43=_0x4fae35?_0x4fae35+':'+_0x2e2dc8():_0x2e2dc8();_0x4c9cd5['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x29fe43}):_0x4c9cd5['message']['startsWith']('ai-chat-conversation-init-failed')||_0x4c9cd5['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x5e3abe),'id':_0x29fe43}):_0x4c9cd5['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x5e7490),'id':_0x29fe43}):_0x4c9cd5['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x29fe43}):_0x4c9cd5['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x29fe43}):_0x4c9cd5['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0xa14f03&&this['_aiChatUi']['closeSourceResourceBalloon'](_0xa14f03),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x406ef6||'source'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):_0x4c9cd5['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x29fe43}),this['_logError'](_0x4c9cd5));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x4a932e||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x586105,attributes:_0x53baa2}){if(!this['activeConversation'])throw new _0x542443('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x26524a=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x26524a);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x586105,'attributes':_0x53baa2});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x3dad53){this['_aiChatUi']['setIsMaximized'](_0x3dad53);}['_logError'](_0x2a9064){Ct(_0x2a9064['message']);}['_removeFromContext'](_0xd0f453){this['activeConversation']?.['removeFromContext'](_0xd0f453);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x14dfda){const [_0x517813,_0xfaeef0]=_0x14dfda['split'](':'),_0x24eec6=this['activeConversation']['getInteraction'](_0x517813),_0x2a0f97=_0x24eec6['getReply'](_0xfaeef0);return{'interaction':_0x24eec6,'reply':_0x2a0f97};}['_scrollToSuggestionRange'](_0x4a8950,_0x1472d5=!0x1){const _0x1c578f=et(this['context']),_0x94a946={'target':_0x1c578f['editing']['view']['domConverter']['viewRangeToDom'](_0x1c578f['editing']['mapper']['toViewRange'](_0x4a8950)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x1472d5};_0x1472d5&&(_0x94a946['alignToTop']=!0x0),st(_0x94a946);}['updateConversationTitle'](_0x625b05,_0x1c1a4e=!0x1){this['_aiChatUi']['setConversationTitle'](_0x625b05||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x1c1a4e);}async['_updateReplyContent']({reply:_0x481e28,renderingStrategy:_0x2a701f}){const {id:_0x1f6b79,interactionId:_0xfdc074,isDone:_0x5cc79a,type:_0x122a23,parsedContent:_0x533771}=_0x481e28,_0x5ec5b8=_0xfdc074+':'+_0x1f6b79;if('modification'===_0x122a23){const _0x2962ea=_0x481e28['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5ec5b8,'parts':_0x2962ea,'renderingStrategy':_0x2a701f,'isDone':_0x5cc79a});}else'text'===_0x122a23&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x5ec5b8,'parsedContent':_0x533771,'renderingStrategy':_0x2a701f,'isDone':_0x5cc79a});_0x5cc79a&&_0x481e28['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x5ec5b8,_0x481e28['sources']);}async['_stopLastInteraction'](){const _0x2862f1=this['activeConversation']?.['lastInteraction'];_0x2862f1&&(_0x2862f1['stop'](),this['_aiChatUi']['stopInteraction'](_0x2862f1));}async['_flushLastInteractionUI'](){const _0x296a1c=this['activeConversation']?.['lastInteraction'];if(_0x296a1c){for await(const _0x1e7c1e of _0x296a1c['replies'])await this['_updateReplyContent']({'reply':_0x1e7c1e,'renderingStrategy':'static'});}}['_updateRatings'](_0x265f0a){const _0x1f5230={'positiveCount':_0x265f0a['changeGroups']['filter'](_0x394505=>'accepted'===_0x394505['state'])['length'],'totalCount':_0x265f0a['changeGroups']['length'],'modificationId':_0x265f0a['id']},_0x27e09c=this['activeConversation']['getInteraction'](_0x265f0a['interactionId'])['messageId'];_0x27e09c&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x27e09c,_0x1f5230);}['_registerToolDataCallback'](_0x4d46c3){let _0x1cee84=null,_0x7b33=null;this['on']('toolDataReceived',(_0x1b4148,_0x2afaa5,_0x99612e)=>{_0x99612e['id']!==_0x1cee84&&(_0x1cee84=_0x99612e['id'],_0x7b33=this['_getAIChatInteractionAPI'](_0x99612e)),_0x4d46c3(_0x2afaa5,_0x7b33);});}['_getAIChatInteractionAPI'](_0x3e9f78){const _0x5f4546=this['_aiChatUi'],_0x510885=()=>{_0x3e9f78['resetWebSearchState'](),_0x3e9f78['resetReasoningState'](),_0x5f4546['clearLoadingMessage']();},_0x54ef47=()=>{_0x3e9f78['currentReply']&&(_0x3e9f78['currentReply']['done'](),_0x3e9f78['currentReply']=void 0x0);};return{'insertTextReply':(_0x230a1c,_0x2b303c)=>{_0x54ef47(),_0x510885();const _0x4ae4d3=_0x3e9f78['currentReply']=_0x3e9f78['createReply']({'type':'text','interactionId':_0x3e9f78['id'],'content':_0x230a1c,'id':_0x2b303c||_0x2e2dc8()});return _0x54ef47(),_0x4ae4d3;},'insertCustomElement':async(_0x38138e,_0x3d8c02)=>(_0x54ef47(),_0x510885(),_0x5f4546['addFeedItemCustomElement'](_0x38138e,_0x3d8c02||_0x2e2dc8())),'setLoadingMessage':_0x494d57=>{_0x5f4546['setLoadingMessage'](_0x494d57);},'clearLoadingMessage':()=>{_0x5f4546['clearLoadingMessage']();}};}}const F='ai-selection';class D extends _0x118815{constructor(_0x30bd8a){super(_0x30bd8a),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_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 _0x142f82=et(this['context']),_0x5759f8=_0x142f82['plugins']['has']('RealTimeCollaborationClient')&&_0x142f82['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x5759f8||_0x2e2dc8();}return this['_sessionId'];}async['getDocumentData'](){const _0x13d80f=et(this['context']),_0x1fdd68=_0x13d80f['model'],_0x44fb94=_0x13d80f['data']['toView'](_0x1fdd68['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x20b5a6=new Nt(_0x13d80f['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x44fb94,_0x20b5a6);let _0x1bffeb=await this['_getDocumentDataStringFromView'](_0x44fb94);const _0x53d36e=this['_getMarkersInDocumentOrder'](),_0x432c3a=[];for(const _0xb975b6 of _0x53d36e){const _0x575b32='<'+_0xb975b6['name']+':start></'+_0xb975b6['name']+':start>',_0x470f12=_0x1bffeb['indexOf'](_0x575b32);_0x1bffeb=_0x1bffeb['substring'](0x0,_0x470f12)+_0x1bffeb['substring'](_0x470f12+_0x575b32['length']);const _0x291d02='<'+_0xb975b6['name']+':end></'+_0xb975b6['name']+':end>',_0x31e0b9=_0x1bffeb['indexOf'](_0x291d02);_0x1bffeb=_0x1bffeb['substring'](0x0,_0x31e0b9)+_0x1bffeb['substring'](_0x31e0b9+_0x291d02['length']),_0x432c3a['push']({'markerName':_0xb975b6['name'],'start':_0x470f12,'end':_0x31e0b9,'htmlFragment':_0x1bffeb['substring'](_0x470f12,_0x31e0b9)});}return{'content':_0x1bffeb,'version':_0x13d80f['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x432c3a};}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x50f530,_0x537ac4)=>{_0x537ac4['on']('ready',()=>{this['_integrateEditor'](_0x537ac4);});});}['_setOutputDataProcessor'](_0x3a3be6){this['_outputDataProcessor']=_0x3a3be6;}async['_getDocumentDataStringFromView'](_0x27bdf2){let _0xe73b13;const _0x4c8c69=et(this['context']);if(this['_outputDataProcessor']){const _0x4f21b8=_0x4c8c69['data']['processor']['domConverter']['viewToDom'](_0x27bdf2),_0x328478=await this['_outputDataProcessor'](_0x4f21b8);_0xe73b13=_0x4c8c69['data']['processor']['htmlWriter']['getHtml'](_0x328478);}else _0xe73b13=_0x4c8c69['data']['processor']['toData'](_0x27bdf2);return _0xe73b13;}['_integrateEditor'](_0x4a30c5){_0x4a30c5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':F,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x4a30c5['conversion']['for']('dataDowncast')['markerToElement']({'model':F,'view':(_0x50cb57,{writer:_0x4bac55,options:_0x43b08d})=>_0x43b08d['convertAiChatSelectionMarker']?_0x4bac55['createUIElement'](_0x50cb57['markerName']+':'+(_0x50cb57['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1abbb5,_0x14f52f,_0x2528fd=!0x1,_0x2d4d6f=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x2d4d6f)return!0x1;const _0x44f416=et(this['context'])['model'];return _0x44f416['change'](_0x5e42ab=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x14f52f,this['_displayedFakeSelectionLocked']=_0x2528fd;let _0x24fb39=0x0;for(let _0x1c3b87 of _0x1abbb5){const _0x2be7a3=F+':'+_0x24fb39;if(_0x1c3b87['start']['isAtEnd']){const _0x14b40b=_0x1c3b87['start']['getLastMatchingPosition'](({item:_0x48b0ad})=>!_0x44f416['schema']['isContent'](_0x48b0ad),{'boundaries':_0x1c3b87});_0x1c3b87=_0x5e42ab['createRange'](_0x14b40b,_0x1c3b87['end']);}_0x5e42ab['addMarker'](_0x2be7a3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1c3b87}),_0x24fb39++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x291e2f){if(this['_displayedFakeSelectionId']!=_0x291e2f)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x592fcd=et(this['context']),_0x3b8f2e=_0x592fcd['model']['markers']['getMarkersGroup'](F);return _0x592fcd['model']['change'](_0x14c8b3=>{for(const _0x113632 of _0x3b8f2e)_0x14c8b3['removeMarker'](_0x113632);}),!0x0;}async['modelToDataWithIds'](_0x5efe71){const _0x25bcb4=et(this['context']),_0xac1692=_0x25bcb4['data']['toView'](_0x5efe71),_0x3786eb=new Nt(_0x25bcb4['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0xac1692,_0x3786eb),this['_getDocumentDataStringFromView'](_0xac1692);}['_setDataIdsOnChildren'](_0x1e33ef,_0x443e4f){let _0x358daa=!0x1;const _0x593d09=new Set();for(const _0x5858b0 of _0x1e33ef['getChildren']()){const _0x5280a5=_0x5858b0['is']('emptyElement')||_0x5858b0['is']('containerElement');if(!_0x5858b0['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5858b0,_0x443e4f)||_0x5280a5)&&(_0x443e4f['setAttribute']('data-id',this['_nextDataId'](_0x593d09),_0x5858b0),_0x358daa=!0x0);}return _0x358daa;}['_nextDataId'](_0x2e1c6c){let _0x59cf3e;do{_0x59cf3e='';for(let _0x433126=0x0;_0x433126<0x4;_0x433126++)_0x59cf3e+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x2e1c6c['has'](_0x59cf3e));return _0x2e1c6c['add'](_0x59cf3e),_0x59cf3e;}['getSelectionText'](){const {model:_0x574ce4}=et(this['context']),_0x6792f1=_0x574ce4['document']['selection'],_0x56656f=[];for(const _0x22c3bd of _0x6792f1['getRanges']())for(const _0x2c4a18 of _0x22c3bd['getItems']())_0x2c4a18['is']('$textProxy')?_0x56656f['push'](_0x2c4a18['data']):_0x2c4a18['is']('element')&&_0x56656f['length']>0x0&&'\x20'!==_0x56656f[_0x56656f['length']-0x1]&&_0x56656f['push']('\x20');return _0x56656f['length']?'\x22'+_0x56656f['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0xe1c2c3=et(this['context'])['model'];return Array['from'](_0xe1c2c3['markers']['getMarkersGroup'](F))['sort']((_0x124f1a,_0x450b84)=>_0x124f1a['getStart']()['isBefore'](_0x450b84['getStart']())?-0x1:_0x124f1a['getStart']()['isAfter'](_0x450b84['getStart']())?0x1:0x0);}}const pt=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Lt=[...pt,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0xcc2a48){this['options']={'delay':_0xcc2a48['delay']??0x14,'textNodeStyle':_0xcc2a48['textNodeStyle'],'onStreamUpdate':_0xcc2a48['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x578622,targetElement:_0x4eefca,abortSignal:_0x5dfe23}){this['isStreaming']&&this['stop'](),_0x5dfe23?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x255d9a(_0x578622,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x2fa4c6=0x0;_0x2fa4c6<this['currentIndex'];_0x2fa4c6++)this['nodesList'][_0x2fa4c6]['shouldBeStreamed']=!0x0;do{const _0x29897b=Date['now'](),_0x1eea94=this['nodesList'][this['currentIndex']],_0x250939=_0x29897b-this['lastUpdateTime'];if(_0x1eea94){_0x1eea94['shouldBeStreamed']=!0x0;let _0x33b20f=_0x1eea94['parent'];for(;_0x33b20f;)_0x33b20f['shouldBeStreamed']=!0x0,_0x33b20f=_0x33b20f['parent'];}if(_0x250939<this['options']['delay'])try{const {promise:_0x12d7de,abortController:_0x423257}=Us(this['options']['delay']-_0x250939);this['timeoutAbortController']=_0x423257,await _0x12d7de;}catch(_0x2ae047){return;}_0x308f05(_0x4eefca,'<'+_0x4eefca['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x4eefca['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x59aacc}){Array['from'](_0x59aacc['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0xc68a66=>{_0xc68a66['replaceWith'](_0xc68a66['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x3183ee){let _0xe79405='';if(function(_0x14643c){return _0x14eea4(_0x14643c);}(_0x3183ee)){for(const _0x245d39 of _0x3183ee['children'])_0xe79405+=this['renderNode'](_0x245d39);}else{if(Ls(_0x3183ee)){if(!_0x3183ee['shouldBeStreamed'])return'';const _0x15cf12=_0x3183ee,_0x5e9e0f=Object['entries'](_0x15cf12['attribs'])['map'](([_0x2aa08e,_0x1850ad])=>_0x2aa08e+'=\x22'+_0x1850ad+'\x22')['join']('\x20');_0xe79405+='<'+_0x15cf12['tagName']+(_0x5e9e0f?'\x20'+_0x5e9e0f:'')+'>';for(const _0x2f5831 of _0x260bf8(_0x15cf12))_0xe79405+=this['renderNode'](_0x2f5831);_0xe79405+='</'+_0x15cf12['tagName']+'>';}else{if(!Ts(_0x3183ee))return'';if(!_0x3183ee['shouldBeStreamed'])return'';!function(_0x10315c){if(!_0x10315c['parent']||!Ls(_0x10315c['parent']))return!0x1;if(!ys['includes'](_0x10315c['parent']['tagName']))return!0x1;return!_0x25d39e(_0x10315c)['match'](/^\s*[<>]\s*$/);}(_0x3183ee)?_0xe79405+=_0x3688ac(_0x3183ee):_0xe79405+=_0x3688ac(new _0x1075d8('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x3183ee]));}}return _0xe79405;}['getParsedDocumentNodeList'](){const _0x46065c=[];return function(_0x1c6977,_0xcb192f){const _0x5eb4de=_0x12c3f7=>{if(_0xcb192f(_0x12c3f7),_0x12c3f7 instanceof _0x673436)for(let _0x11d34b=0x0;_0x11d34b<_0x12c3f7['children']['length'];_0x11d34b++){const _0x2ad065=_0x12c3f7['children'][_0x11d34b];_0x5eb4de(_0x2ad065);}};for(let _0x226460=0x0;_0x226460<_0x1c6977['children']['length'];_0x226460++)_0x5eb4de(_0x1c6977['children'][_0x226460]);}(this['document'],_0x1013e1=>{if(Ts(_0x1013e1)){const _0x1326fc=this['splitTextNodeIntoWordNodes'](_0x1013e1);_0x1326fc['length']&&_0x46065c['push'](..._0x1326fc);}_0x1013e1['isWordSplitSource']||_0x1013e1['isWordSplitResult']||_0x46065c['push'](_0x1013e1);}),_0x46065c;}['splitTextNodeIntoWordNodes'](_0x58a7dc){if(_0x58a7dc['isWordSplitSource']||_0x58a7dc['isWordSplitResult'])return[];const _0x28181c=_0x25d39e(_0x58a7dc)['match'](/(?:\s*\S+\s*)/g),_0xc12f84=[];if(_0x28181c&&_0x28181c['length']>0x1){for(const _0x6659db of _0x28181c){const _0x35a002=new _0x2ef03d(_0x6659db);_0x35a002['isWordSplitResult']=!0x0,_0x11de48(_0x58a7dc,_0x35a002),_0xc12f84['push'](_0x35a002);}_0x58a7dc['isWordSplitSource']=!0x0,_0xb8c25a(_0x58a7dc);}return _0xc12f84;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ts(_0x424a00){return _0x59e3c1(_0x424a00);}function Ls(_0x37d65e){return _0x512964(_0x37d65e);}function Us(_0x408ff7){const _0x3ab26d=new AbortController();return{'promise':new Promise((_0x367f29,_0x32b592)=>{const _0x4e9d06=setTimeout(_0x367f29,_0x408ff7);_0x3ab26d['signal']['addEventListener']('abort',()=>{clearTimeout(_0x4e9d06),_0x32b592();});}),'abortController':_0x3ab26d};}class Fr extends _0x15a8cb{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x5491a7){super();const _0x2ce0f1=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']=_0x5491a7,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2ce0f1['if']('isDone','ck-ai-chat__feed__item_done'),_0x2ce0f1['if']('isVisible','ck-hidden',_0x2339fe=>!_0x2339fe),'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'](_0x353467=>{_0x353467['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x3ee0cd,_0x287167,_0x3f946f){await this['htmlStreamer']['stream']({'document':_0x3ee0cd,'targetElement':_0x287167,'abortSignal':_0x3f946f});}}class oa extends _0x15a8cb{['showChangesToggleView'];constructor(_0x569a78,_0x53ac8b){super(_0x569a78),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Zn(_0x569a78),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x569a78,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x53ac8b['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x6fae46=>_0x6fae46?_0x34d7d0:_0x4218b0),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x4e3472=new _0x2ae97e();_0x4e3472['content']=_0x20ff08,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x53ac8b['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x4e3472,{'tag':'span','children':[i(_0x569a78,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Zn extends _0x5bfd84{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Or={'accepted':_0x2b1fdc,'rejected':_0x1c0feb,'outdated':_0x1c0feb};class ps extends _0x15a8cb{['stateIconView'];constructor(_0x4440c7){super(_0x4440c7);const _0x287378=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Nr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x287378['to']('state',_0x183827=>'ck-ai-suggestion__content-part-state_'+_0x183827),_0x287378['if']('isVisible','ck-hidden',_0x14d28f=>!_0x14d28f)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x287378['to']('state',_0x5ef376=>{switch(_0x5ef376){case'accepted':return i(_0x4440c7,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x4440c7,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x4440c7,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x3e89fe){this['state']=_0x3e89fe;}}class Nr extends _0x2ae97e{constructor(){super(),this['set']('state','accepted'),this['content']=Or[this['state']],this['on']('change:state',()=>{this['content']=Or[this['state']];});}}class us extends _0x3da665{['_applyButton'];['_suggestButton'];constructor(_0x29908f,_0x1dc735,_0x3b2d2b){super(_0x29908f);const _0x25b652=Boolean(_0x3b2d2b);this['set']('isEnabled',!_0x25b652),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0xe9bd23=[];if(_0x25b652){const _0x3a96f9=new _0x5bfd84(_0x29908f);_0x3a96f9['set']({'label':i(_0x29908f,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc}),_0xe9bd23['push'](_0x3a96f9);}else{_0x1dc735['includes']('applySuggestion')&&(this['_applyButton']=new _0x5bfd84(_0x29908f),this['_applyButton']['set']({'label':i(_0x29908f,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2b1fdc}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0xe9bd23['push'](this['_applyButton'])),_0x1dc735['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x5bfd84(_0x29908f),this['_suggestButton']['set']({'label':i(_0x29908f,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3ecbda}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0xe9bd23['push'](this['_suggestButton']));const _0x187fdc=new _0x5bfd84(_0x29908f);_0x187fdc['set']({'label':i(_0x29908f,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1c0feb}),_0x187fdc['bind']('isEnabled')['to'](this),_0x187fdc['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0xe9bd23['push'](_0x187fdc);}this['items']['addMany'](_0xe9bd23);const _0x59bd9f=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x59bd9f['if']('isVisible','ck-hidden',_0x2dce25=>!_0x2dce25)]}});}['setButtonsVisibility']({showApplyButton:_0x4a6b9a,showSuggestButton:_0x16035d}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x4a6b9a),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x16035d);}}class vn extends _0x15a8cb{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x21cf2a,{part:_0x2f4026,uiIndex:_0x4397db,availableActions:_0x3e2b9,areActionsDisabled:_0x1539b3}){super(_0x21cf2a),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new us(_0x21cf2a,_0x3e2b9,_0x1539b3),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x2f4026['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x2f4026['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x2f4026['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ps(_0x21cf2a),this['titleLabelView']=new Sn(_0x21cf2a,_0x4397db),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x1868d3,_0x4efb59,_0x10613e,_0x32544d)=>{'pending'===_0x32544d?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x10613e?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x10613e),this['children']['add'](this['stateView']));});}}class Sn extends _0x15a8cb{constructor(_0x5bf311,_0x4b88d6){super(_0x5bf311),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x5bf311,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x4b88d6['toString']())]});}}class as extends _0x15a8cb{['htmlStreamer'];constructor(_0x228f90){super(_0x228f90),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x11f288,renderingStrategy:_0xd715d5,abortSignal:_0x8e1de1}){'streaming'===_0xd715d5?await this['htmlStreamer']['stream']({'document':_0x11f288['content'],'targetElement':this['element'],'abortSignal':_0x8e1de1}):this['element']['innerHTML']=Dt(_0x11f288['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x15a8cb{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4a6a13,{part:_0x570b98,uiIndex:_0x2bbbf0,areActionsDisabled:_0x4ac7df,availableActions:_0x43e314}){super(_0x4a6a13);const _0x5f4362=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x379077=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x4ac7df;};this['on']('change:state',_0x379077),this['on']('change:isDone',_0x379077),_0x379077(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x4a6a13,{'part':_0x570b98,'uiIndex':_0x2bbbf0,'availableActions':_0x43e314,'areActionsDisabled':_0x4ac7df}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...pt)['to'](this),this['_streamableContentView']=new as(_0x4a6a13),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5f4362['to']('state',_0x1c312f=>'ck-ai-suggestion__body__content-part_'+_0x1c312f),_0x5f4362['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x5f4362['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x5f4362['if']('isVisible','ck-hidden',_0x4df12f=>!_0x4df12f)]},'children':this['_children'],'on':{'mouseenter':_0x5f4362['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x570b98['index']});}),'mouseleave':_0x5f4362['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x570b98['index']});}),'click':_0x5f4362['to'](_0x1c1ac8=>{const _0x26bfd2=_0x1c1ac8['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x26bfd2)&&this['fire']('showChangeInText',{'index':_0x570b98['index']});})}});}async['updateContent']({part:_0x377834,renderingStrategy:_0xe27aea,showUnchangedParts:_0x1df418=!0x1,abortSignal:_0x2bf099}){this['partDefinition']=_0x377834,this['isVisible']=this['partDefinition']['hasChanges']||_0x1df418,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x377834,'renderingStrategy':_0xe27aea,'abortSignal':_0x2bf099});}['markAsDone'](){this['isDone']=!0x0;}}class N extends _0x204e9f(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x1d7d00){const _0x14df49=this['createTask'](_0x1d7d00);return this['queue']['push'](_0x14df49),this['_processQueue'](),_0x14df49['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(_0x2027cf=>{this['once']('_queueEmpty',()=>{_0x2027cf();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x48e29b=this['queue']['shift']();try{await _0x48e29b['callback'](this['_abortController']['signal']),_0x48e29b['resolve']();}catch(_0x306a7c){_0x48e29b['reject'](_0x306a7c);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x5ddcc0){let _0x12e6c6,_0x361913;const _0x46bac2=new Promise((_0x6462cc,_0xeb7cc1)=>{_0x12e6c6=_0x6462cc,_0x361913=_0xeb7cc1;});return{'callback':_0x5ddcc0,'resolve':_0x12e6c6,'reject':_0x361913,'completePromise':_0x46bac2};}}class Ze extends Fr{constructor(_0x29be2b){super(_0x29be2b),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x29be2b['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x1a0f15){this['element']['innerHTML']=_0x1a0f15;}}const X=['applySuggestion','insertSuggestion'];class ra extends _0x15a8cb{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x55e7c0,_0x4177f1=[...X],_0x37da93){super(_0x55e7c0);const _0x29a052=this['bindTemplate'],_0x4ac430=Boolean(_0x37da93);if(this['set']('isEnabled',!_0x4ac430),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x4ac430){const _0x3c6e69=new _0x5bfd84(_0x55e7c0);_0x3c6e69['set']({'label':i(_0x55e7c0,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc});const _0x1b7608=new _0x15a8cb(_0x55e7c0);_0x1b7608['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x55e7c0,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x3c6e69]}]}),this['children']['add'](_0x1b7608);}else this['_applyChangesButton']=new _0x5bfd84(_0x55e7c0),this['_applyChangesButton']['set']({'label':i(_0x55e7c0,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x4177f1['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x5bfd84(_0x55e7c0),this['_insertSuggestionsButton']['set']({'label':i(_0x55e7c0,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x4177f1['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x3ef3d7=>{_0x3ef3d7['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x29a052['if']('isVisible','ck-hidden',_0x169a80=>!_0x169a80)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x42d936){this['isVisible']=_0x42d936;}['_switchButtonLabelsPlurality'](_0x54cd68){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x54cd68?(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0x15a8cb{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x1aedfa,_0x4f44c6){super(_0x1aedfa),this['bodyCollection']=_0x4f44c6,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',_0x4acfc6=>!_0x4acfc6)]},'children':this['children']});const _0xcac83e=new _0x15a8cb(this['locale']),_0x4f3bb7=new _0x2ae97e();_0x4f3bb7['content']=_0x1ce37c,_0xcac83e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x4f3bb7,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0xcac83e),this['_setupBalloonPanel'](_0x1aedfa);}['addSource'](_0x4fa0ab){this['children']['add'](new qr(this['locale'],_0x4fa0ab,this['balloonPanelView']));}['_setupBalloonPanel'](_0x37aa30){this['balloonPanelView']=new _0x1ddc71(_0x37aa30),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x5bfd84{['balloonPanelView'];['source'];constructor(_0x485dfb,_0x351726,_0x154771){super(_0x485dfb),this['source']=_0x351726,this['balloonPanelView']=_0x154771,this['set']({'label':_0x351726['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x17209b=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x17209b['to'](()=>{window['open'](_0x351726['url'],'_blank');}),'mouseenter':_0x17209b['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x17209b['to'](()=>{this['_hideTooltip']();})}}),_0x351726['favicon']){const _0x4ecc64=new _0x15a8cb(_0x485dfb);_0x4ecc64['setTemplate']({'tag':'img','attributes':{'src':_0x351726['favicon']||_0x1ce37c,'alt':_0x351726['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x4ecc64);}else this['set']('icon',_0x1ce37c);}['_createTooltipContentView'](_0x35792f,_0x4edb6f){const _0x58d9e0=new _0x15a8cb(_0x35792f),_0x6e6625=[];let _0x2aebce;_0x4edb6f?.['favicon']?(_0x2aebce=new _0x15a8cb(_0x35792f),_0x2aebce['setTemplate']({'tag':'img','attributes':{'src':_0x4edb6f['favicon'],'alt':_0x4edb6f['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x2aebce=new _0x2ae97e(),_0x2aebce['content']=_0x1ce37c,_0x2aebce['extendTemplate']({'attributes':{'alt':_0x4edb6f['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x6e6625['push'](_0x2aebce);const _0x5bf09e=new _0x15a8cb(_0x35792f);_0x5bf09e['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x4edb6f['url']},'children':[{'text':new URL(_0x4edb6f['url'])?.['hostname']}]}),_0x6e6625['push'](_0x5bf09e);const _0x477d20=new _0x15a8cb(_0x35792f);_0x477d20['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x6e6625});const _0x5930e8=new _0x15a8cb(_0x35792f);return _0x5930e8['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x4edb6f['title']['length']>0x190?_0x4edb6f['title']['substring'](0x0,0x190)+'...':_0x4edb6f['title']}]}),_0x58d9e0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x477d20,_0x5930e8]}),_0x58d9e0;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x1ddc71['defaultPositions']['northArrowSouth'],_0x1ddc71['defaultPositions']['northArrowSouthWest'],_0x1ddc71['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x3e26ef=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x3e26ef);}}class ca extends _0x15a8cb{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x373fee,_0x3b60a7){super(_0x373fee);const {areActionsDisabled:_0x3a314a,showUnchangedParts:_0x3ddd5a,availableActions:_0x3ea4a3}=_0x3b60a7;this['_areActionsDisabled']=_0x3a314a,this['_showUnchangedParts']=_0x3ddd5a,this['_availableActions']=_0x3ea4a3,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new N(),this['_emptyPartsWarningView']=new Ze({'id':'empty-parts-warning','initialContent':i(_0x373fee,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x373fee,_0x3b60a7['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x3b60a7['bodyCollection']),_0x3b60a7['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...pt)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x2d91fb,renderingStrategy:_0x20cc4a,abortSignal:_0x344508}){this['_children']['length']?_0x2d91fb['forEach'](_0x24d64c=>{const _0x560698=this['_cachedContentParts']['findIndex'](_0x4792e8=>_0x4792e8['index']==_0x24d64c['index']);-0x1===_0x560698?this['_cachedContentParts']['push'](_0x24d64c):this['_cachedContentParts'][_0x560698]=_0x24d64c;}):this['_cachedContentParts']=_0x2d91fb;const _0x41dff5=this['_showUnchangedParts']?_0x2d91fb:_0x2d91fb['filter'](_0xb1aeb5=>_0xb1aeb5['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x41dff5['length']>0x1);for(const _0x5dbfe8 of _0x41dff5)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x442633=>{let _0x3a3d4c=this['getPartView'](_0x5dbfe8['index']);_0x3a3d4c||(_0x3a3d4c=new na(this['locale'],{'part':_0x5dbfe8,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3a3d4c['delegate'](...pt)['to'](this),this['_children']['add'](_0x3a3d4c),this['hasPendingParts']=!0x0),await _0x3a3d4c['updateContent']({'part':_0x5dbfe8,'renderingStrategy':_0x20cc4a,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x442633}),_0x3a3d4c['markAsDone']();});return _0x344508?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x317fb8,_0x1e18eb){const _0x2d01c1=this['getPartView'](_0x317fb8);_0x2d01c1&&(_0x2d01c1['state']=_0x1e18eb),this['hasPendingParts']='pending'==_0x1e18eb||Array['from'](this['_children'])['some'](_0x586e84=>'pending'==_0x586e84['state']);}['setPartActive'](_0xed12e0,_0x32ca66){if(!0x1===_0xed12e0){for(const _0x541d24 of this['_children'])_0x541d24['isActive']=!0x1;}else{const _0xcad786=this['getPartView'](_0xed12e0);_0xcad786&&(_0xcad786['isActive']=_0x32ca66);}}['updateSources'](_0x472215){_0x472215['forEach'](_0x22b6c8=>this['_sourcesView']['addSource'](_0x22b6c8)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x4aeb1c){return this['_children']['find'](_0x20c50c=>_0x20c50c['partDefinition']['index']==_0x4aeb1c)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1d1558=!this['_cachedContentParts']['find'](({hasChanges:_0x390aec})=>_0x390aec),_0x39dfcd=!!this['_cachedContentParts']['find'](({hasChanges:_0x5dd484})=>!_0x5dd484);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x39dfcd,_0x1d1558?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x4090e=>_0x4090e['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0xd3a308=>_0xd3a308['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x15a8cb{['bodyView'];['children'];['headerView'];constructor(_0x1b8586,_0x13aab2,_0x42dac5){super(_0x1b8586);const {showDiff:_0xf6eb07,areActionsDisabled:_0x512fc6,showUnchangedParts:_0x4c938c,availableActions:_0x1a898b}=_0x13aab2;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x1b8586,{'showDiff':_0xf6eb07}),this['headerView']['on']('toggleShowChanges',(_0x2f2d19,_0x1f2444)=>{this['areChangesVisible']=_0x1f2444['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1f2444['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x1b8586,{'areActionsDisabled':_0x512fc6,'showUnchangedParts':!!_0x4c938c,'availableActions':_0x1a898b,'bodyCollection':_0x42dac5}),this['bodyView']['delegate'](...pt)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x2249ff){await this['bodyView']['updateContentParts'](_0x2249ff);}['updateSources'](_0x2ef30d){this['bodyView']['updateSources'](_0x2ef30d);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Qe extends Fr{['containerView'];constructor(_0x439e27,_0x3843d0,_0x48eb47){super(_0x3843d0),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x439e27,{'showDiff':_0x3843d0['showDiff'],'areActionsDisabled':_0x3843d0['areActionsDisabled'],'availableActions':_0x3843d0['availableActions']},_0x48eb47),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x1f78aa,_0x6c70b6)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x6c70b6['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x1c7ba0,{index:_0x11831f})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x11831f});}),this['containerView']['on']('applySuggestion',(_0x4b920d,{index:_0x5ce7cb}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x5ce7cb});}),this['containerView']['on']('insertSuggestion',(_0x4abf7e,{index:_0x535821}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x535821});}),this['containerView']['on']('rejectSuggestion',(_0x129449,{index:_0x3e2259})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3e2259});}),this['containerView']['on']('mouseOverSuggestion',(_0x2bb5c2,{index:_0x459413})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x459413});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x421a26,{index:_0x569834})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x569834});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x526a37){await this['containerView']['updateContent'](_0x526a37);}['updatePartState'](_0x138625,_0x37537b){this['containerView']['bodyView']['updatePartState'](_0x138625,_0x37537b);}['setPartActive'](_0x40ee24,_0x5c24b5){!0x1===_0x40ee24?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x40ee24,_0x5c24b5);}['updateSources'](_0x5a0d8c){this['containerView']['updateSources'](_0x5a0d8c);}['getPartView'](_0x14a429){return this['containerView']['bodyView']['getPartView'](_0x14a429);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Xe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x2b1445,_0x213516,_0x131628){super(_0x213516),this['_bodyCollection']=_0x131628,this['locale']=_0x2b1445,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x15a8cb(),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':Ni(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x48422b,renderingStrategy:_0x4e8fdb,abortSignal:_0xbc0891}){'streaming'===_0x4e8fdb?await this['streamIntoElement'](_0x48422b,this['replyContainer']['element'],_0xbc0891):this['replyContainer']['element']['innerHTML']=_0x3688ac(_0x48422b);}['updateSources'](_0x48d7a2){const _0x4cdbaf=new Sr(this['locale'],this['_bodyCollection']);_0x4cdbaf['children']['addMany'](_0x48d7a2['map'](_0x1f211e=>new qr(this['locale'],_0x1f211e,_0x4cdbaf['balloonPanelView']))),_0x4cdbaf['isVisible']=!0x0,this['children']['add'](_0x4cdbaf);}}class Ci extends _0x1e066a{constructor(_0x31a8cf=void 0x0){super();const _0xb34e8c=_0x31a8cf?'ck-ai-spinner_'+_0x31a8cf:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0xb34e8c]}});}}const xn={'file':_0x56f9a2,'document':_0x51d2a2,'web-resource':_0x5acb26,'text':_0x56f9a2,'selection':_0x16211b,'mcp-tool-context':_0x51d2a2},Wr='ck-ai-chat-context-chip',Yr='ck-ai-chat-context-chip_wide',$r='ck-ai-chat-context-chip_document',Qr='ck-ai-chat-context-chip__label',Xr='ck-ai-chat-context-chip__type-icon',Zr='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Vo extends _0x5bfd84{constructor(_0xe954ba,_0x5c6d39,_0x424a4b,_0xf2b8df,_0x819149=!0x1){super(_0xe954ba),this['_isAnimationOnEnterEnabled']=_0xf2b8df,this['_initializeProperties'](_0x5c6d39,_0x424a4b,_0x819149),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'](_0x2245be,_0x5e6cc2,_0x510595){this['set']('label',_0x2245be['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x2245be['type']),this['set']('id',_0x2245be['uiId']),this['set']('readonly',_0x5e6cc2),this['set']('isLoading',_0x510595);}['_setupTemplate'](){const _0x53fe88=this['_createIconView'](),_0x1fe64d=this['_createRemoveButton'](),_0x4f01a0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x4f01a0),'children':this['_createTemplateChildren'](_0x53fe88,_0x1fe64d,_0x4f01a0)});}['_createTemplateAttributes'](_0x2065f7){return{'class':[Wr,_0x2065f7['if']('itemType',$r,_0x2c2846=>'document'==_0x2c2846),_0x2065f7['if']('itemType',Yr,_0x1dfe0c=>'selection'==_0x1dfe0c)],'data-cke-tooltip-text':_0x2065f7['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Zr};}['_createTemplateChildren'](_0x56e4d2,_0x1c258e,_0xc9436f){const _0x22952c=this['_createLabelElement'](_0xc9436f),_0x2e24f4=this['_createLoaderIcon']();return this['readonly']?[_0x56e4d2,_0x22952c]:[_0x56e4d2,_0x2e24f4,_0x22952c,_0x1c258e];}['_createLabelElement'](_0x2629d0){return{'tag':'span','attributes':{'class':Qr},'children':[{'text':_0x2629d0['to']('label')}]};}['_createRemoveButton'](){const _0x167f66=new _0x5bfd84(this['locale']);return _0x167f66['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x4affb1}),this['_setupRemoveButtonEvent'](_0x167f66),_0x167f66;}['_setupRemoveButtonEvent'](_0x142cb0){_0x142cb0['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x34950e=this['bindTemplate'],_0x435513=new _0x2ae97e();return _0x435513['content']=xn[this['itemType']],_0x435513['extendTemplate']({'attributes':{'class':[Xr,_0x34950e['if']('isLoading','ck-hidden',_0x53cd32=>_0x53cd32)]}}),_0x435513;}['_handleAnimationEndOnce'](_0x303487,_0x138a6a){if(!_0x303487)return;const _0x3899c8=()=>{_0x138a6a(),_0x303487['removeEventListener']('animationend',_0x3899c8),_0x303487['removeEventListener']('webkitAnimationEnd',_0x3899c8);};_0x303487['addEventListener']('animationend',_0x3899c8),_0x303487['addEventListener']('webkitAnimationEnd',_0x3899c8);}['_createLoaderIcon'](){const _0x21589b=new Ci('small');return _0x21589b['bind']('isVisible')['to'](this,'isLoading',_0x3bf3fd=>_0x3bf3fd),_0x21589b;}}function In(_0x3b6435){if(!_0x3b6435)return _0x3b6435;if(_0x3b6435['length']<=0x78)return _0x3b6435;const _0x5b544b=_0x3b6435['slice'](0x0,0x78),_0x159a93=_0x5b544b['lastIndexOf']('\x20');return(_0x159a93>0x0?_0x5b544b['slice'](0x0,_0x159a93):_0x5b544b)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Po{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x424584,_0x3cbfb7,_0x30f605,_0x32a6a2,_0x5ecce5){this['_locale']=_0x424584,this['_visibleChips']=_0x3cbfb7,this['_config']={...hn,..._0x30f605,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x30f605['cssClasses']}},this['_overflowChips']=new _0x4b06b7(),this['_bodyCollection']=_0x32a6a2,this['_parentView']=_0x5ecce5||null;}['setContainerElement'](_0x5e2e39){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x5e2e39,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 _0x221496=[...this['_visibleChips'],...this['_overflowChips']],_0x1e9341=this['_createCalculationContainer'](),_0x532e1e=this['_calculateOverflowInContainer'](_0x1e9341,_0x221496),_0x50f309=_0x1e9341['_ancestorsToRestore'];_0x50f309&&this['_restoreAncestorVisibility'](_0x50f309),_0x1e9341['remove'](),this['_applyOverflowResults'](_0x221496,_0x532e1e);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x4daaf2({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x50300d=new _0x5bfd84(this['_locale']);_0x50300d['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0xf64a68=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0xf64a68['push'](this['_config']['cssClasses']['controlsButton']),_0x50300d['extendTemplate']({'attributes':{'class':_0xf64a68}}),_0x50300d;}['_createShowMoreBalloonPanelView'](){const _0x3a3945=new _0x1ddc71(this['_locale']);return _0x3a3945['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x3a3945),_0x3a3945;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x8dbf04=>{_0x8dbf04['disableAnimationOnEnter']();});const _0x533878=new _0x15a8cb(this['_locale']);_0x533878['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x533878);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x440e66=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x440e66?'':'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'](_0x2ed225){const _0x6e79bd=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x529e0f=this['_containerElement']?.['classList'];if(_0x529e0f){const _0x2a13bd=_0x529e0f[0x0]||'',_0xe79135=_0x2ed225['querySelector']('.'+_0x2a13bd),_0x1048f8=_0x2ed225['querySelector'](_0x6e79bd);return _0xe79135||_0x1048f8||_0x2ed225;}return _0x2ed225['querySelector'](_0x6e79bd)||_0x2ed225;}['_calculateContainerWidth'](){const _0x4104f9=this['_parentView']?.['element']||this['_containerElement'];if(!_0x4104f9)return an;const _0x41b873=window['getComputedStyle'](_0x4104f9)['width'];if('auto'===_0x41b873||'0px'===_0x41b873||!_0x41b873){const _0x2ae4ba=_0x4104f9['parentElement'];if(_0x2ae4ba){const _0x237681=window['getComputedStyle'](_0x2ae4ba);return'auto'!==_0x237681['width']?_0x237681['width']:an;}return an;}return _0x41b873;}['_applyCalculationStyles'](_0x227c19,_0x100311){this['_config']['cssClasses']['calculationContainer']&&_0x227c19['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x227c19['style']['width']=_0x100311,_0x227c19['style']['position']='absolute',_0x227c19['style']['top']='-9999px',_0x227c19['style']['left']='-9999px',_0x227c19['style']['opacity']='0',_0x227c19['style']['pointerEvents']='none',_0x227c19['style']['zIndex']='-1',_0x227c19['style']['visibility']='visible\x20!important',_0x227c19['style']['display']='block\x20!important',_0x227c19['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x193c9f){_0x193c9f['forEach'](({element:_0x346b35,originalDisplay:_0x2d2e5f,originalVisibility:_0x5f3d9d})=>{_0x346b35['style']['display']=_0x2d2e5f,_0x346b35['style']['visibility']=_0x5f3d9d;});}['_makeAncestorsVisible'](_0x30a9f1){const _0x3e0056=[];let _0x16cd86=_0x30a9f1;for(;_0x16cd86&&_0x16cd86!==document['body'];){const _0x5254a9=window['getComputedStyle'](_0x16cd86);'none'!==_0x5254a9['display']&&'hidden'!==_0x5254a9['visibility']||(_0x3e0056['push']({'element':_0x16cd86,'originalDisplay':_0x16cd86['style']['display'],'originalVisibility':_0x16cd86['style']['visibility']}),_0x16cd86['style']['display']='block',_0x16cd86['style']['visibility']='visible'),_0x16cd86=_0x16cd86['parentElement'];}return _0x3e0056;}['_createContainerElements'](){let _0x2293ba,_0x51d641;return this['_parentView']?.['element']?(_0x2293ba=this['_parentView']['element']['cloneNode'](!0x0),_0x51d641=this['_findTargetContainer'](_0x2293ba)):(_0x2293ba=document['createElement']('div'),_0x51d641=_0x2293ba),{'calculationContainer':_0x2293ba,'targetContainer':_0x51d641};}['_createCalculationContainer'](){const {calculationContainer:_0x504965,targetContainer:_0x36d238}=this['_createContainerElements'](),_0xb3ca5a=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x504965,_0xb3ca5a);const _0x3d73af=this['_parentView']?.['element']||this['_containerElement'],_0x4ef37a=_0x3d73af?.['parentElement'];_0x4ef37a?_0x4ef37a['appendChild'](_0x504965):document['body']['appendChild'](_0x504965),_0x504965['_targetContainer']=_0x36d238;const _0x51c1b9=this['_makeAncestorsVisible'](_0x4ef37a||null);return _0x504965['offsetWidth'],_0x504965['_ancestorsToRestore']=_0x51c1b9,_0x504965;}['_calculateOverflowInContainer'](_0x51b451,_0x548008){const _0x4e1a24=_0x51b451['_targetContainer']||_0x51b451,_0x586c89=[],{rowCount:_0x4bf650}=this['_renderChipsAndCountRows'](_0x4e1a24,_0x548008);if(_0x4bf650<=this['_config']['maxVisibleRows'])return _0x586c89;const _0xce4b33=_0x548008['slice']();for(;_0xce4b33['length']>0x0;){if(this['_testButtonFit'](_0x51b451,_0x4e1a24,_0xce4b33)){const _0x51e856=_0x548008['filter'](_0x4d08aa=>!_0xce4b33['includes'](_0x4d08aa));_0x586c89['push'](..._0x51e856);break;}if(!_0xce4b33['pop']())break;}return _0x586c89;}['_renderChipsAndCountRows'](_0xee5190,_0x355be2){_0xee5190['innerHTML']='',_0x355be2['forEach'](_0x59625c=>{if(_0x59625c['element']){const _0x198983=_0x59625c['element']['cloneNode'](!0x0);_0xee5190['appendChild'](_0x198983);}}),_0xee5190['offsetWidth'];const _0x2f1ff7=_0xee5190['children'],_0x526f8b=[];return Array['from'](_0x2f1ff7)['forEach'](_0xc6ca27=>{const _0x33b694=_0xc6ca27['getBoundingClientRect']()['top'];_0x526f8b['some'](_0x491f8a=>Math['abs'](_0x491f8a-_0x33b694)<this['_config']['rowDetectionTolerance'])||_0x526f8b['push'](_0x33b694);}),{'rowCount':_0x526f8b['length']};}['_createMockButton'](){const _0x5b603e=document['createElement']('button');return _0x5b603e['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x5b603e['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x5b603e['textContent']='+\x201',_0x5b603e;}['_testButtonFit'](_0x346f0d,_0x53bd33,_0xc458a3){this['_renderChipsAndCountRows'](_0x53bd33,_0xc458a3);const _0x397b77=this['_createMockButton']();_0x346f0d['appendChild'](_0x397b77),_0x346f0d['offsetWidth'];const _0x27ef5d=[..._0x53bd33['children'],_0x397b77],_0x50b790=[];_0x27ef5d['forEach'](_0x726b1=>{const _0x22c58e=_0x726b1['getBoundingClientRect']()['top'];_0x50b790['some'](_0x4e9cc9=>Math['abs'](_0x4e9cc9-_0x22c58e)<this['_config']['rowDetectionTolerance'])||_0x50b790['push'](_0x22c58e);});const _0x2cd5b9=_0x50b790['length'];return _0x397b77['remove'](),_0x2cd5b9<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x542dc9,_0x372ab3){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x542dc9['forEach'](_0x512703=>{_0x372ab3['includes'](_0x512703)?this['_overflowChips']['add'](_0x512703):this['_visibleChips']['add'](_0x512703);});}['_updateOverflowUI'](_0x21cdb2){if(_0x21cdb2>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x21cdb2>0x0&&this['_showMoreButtonView']){const _0x2c1553=''+this['_config']['showMoreLabelPrefix']+(_0x21cdb2<0x63?_0x21cdb2:'99');this['_showMoreButtonView']['label']=_0x2c1553;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x5bf3e2,_0x2d3ca2){this['_distributeChips'](_0x5bf3e2,_0x2d3ca2),this['_updateOverflowUI'](_0x2d3ca2['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x4fda0c=>{_0x4fda0c[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 _0x21039a=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x21039a['width']||0x0===_0x21039a['height'])return!0x1;const _0x18e5e2=window['innerHeight']||document['documentElement']['clientHeight'],_0x5b8148=window['innerWidth']||document['documentElement']['clientWidth'],_0x450101=0xc8;return _0x21039a['bottom']>=-0xc8&&_0x21039a['top']<=_0x18e5e2+_0x450101&&_0x21039a['right']>=-0xc8&&_0x21039a['left']<=_0x5b8148+_0x450101;}}const la='ck-ai-chat__feed__context-chips',ua='ck-ai-chat-context-chips-wrapper',da='ck-ai-chat-context-chips-wrapper-balloon',_a='ck-ai-chat-controls-button',Aa='ck-ai-chat-controls_context_show-more-button',ga='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x15a8cb{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x5b8cae,_0x1677de,_0x33cd87){super(_0x5b8cae),this['_bodyCollection']=_0x33cd87,this['_createContextChips'](_0x1677de);const _0x44ecc2={'cssClasses':{'showMoreButton':Aa,'showMoreBalloon':ga,'overflowContainer':da,'controlsButton':_a}};this['_overflowManager']=new Po(_0x5b8cae,this['_contextChips'],_0x44ecc2,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[la,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':ua},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x49ac2a=this['element']['querySelector']('.'+ua);_0x49ac2a&&(this['_overflowManager']['setContainerElement'](_0x49ac2a),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x5e18aa){for(const _0x19c8ac of _0x5e18aa){const _0x453106=new Vo(this['locale'],_0x19c8ac,!0x0,!0x1);this['_contextChips']['add'](_0x453106);}}}class Ye extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x534ac0,_0x5c8f02,_0x34cffa){super(_0x5c8f02),this['_locale']=_0x534ac0,this['_bodyCollection']=_0x34cffa,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 _h(this['_locale'],this['options']['contextItems']['filter'](_0xf3e8cd=>!_0xf3e8cd['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x15a8cb(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 Ht extends Fr{['capabilities'];constructor(_0x369739,_0x10324d){super(_0x10324d);const {isWebSearchEnabled:_0x5133b7,isReasoningEnabled:_0x2ab334}=_0x10324d['capabilities'],_0x177fe6=[];let _0x28b943='';_0x5133b7&&_0x2ab334?(_0x28b943=i(_0x369739,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x177fe6['push'](aa(_0x1ce37c)),_0x177fe6['push'](aa(_0x10c759))):_0x5133b7?(_0x28b943=i(_0x369739,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x177fe6['push'](aa(_0x1ce37c))):_0x2ab334&&(_0x28b943=i(_0x369739,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x177fe6['push'](aa(_0x10c759))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x28b943?'':'ck-hidden']}});const _0x3e628e=new _0x15a8cb();_0x3e628e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x177fe6,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x28b943]}]}),this['children']['add'](_0x3e628e),this['capabilities']=_0x10324d['capabilities'];}}function aa(_0x228591){const _0x186e84=new _0x2ae97e();return _0x186e84['content']=_0x228591,_0x186e84;}const Fs=['wheel','touchstart','pointerdown','keydown'],qs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class $e{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x55a26f){this['element']=_0x55a26f,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x3737a0 of Fs){const _0x1001f4='keydown'!==_0x3737a0;this['element']['addEventListener'](_0x3737a0,this['_onUserEvent']['bind'](this),{'passive':_0x1001f4,'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'](_0x31e537){if(this['isRunning']){if('keydown'===_0x31e537['type']){const _0x55a000=_0x31e537['key'];if(!qs['includes'](_0x55a000))return;}_0x31e537 instanceof WheelEvent?_0x31e537['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x33cdad,scrollHeight:_0x5743c5,clientHeight:_0x24c246}=this['element'];return _0x5743c5-_0x33cdad-_0x24c246<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Ei extends _0x15a8cb{constructor(_0x381be5,_0x46c703){super(_0x381be5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x46c703)});}['_createSkeletonItems'](_0x59354c){const _0x50a0a1=['ck','ck-ai-skeleton__item'];return _0x59354c['map'](_0x47625e=>{let _0x5a6afc='';switch(_0x47625e['attributes']['align']){case'right':_0x5a6afc='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x5a6afc='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x5a6afc='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x47625e['tag'],'attributes':{'class':[..._0x50a0a1,_0x47625e['attributes']['class']?_0x47625e['attributes']['class']:''],'style':'width:\x20'+_0x47625e['attributes']['width']+';\x20height:\x20'+_0x47625e['attributes']['height']+';'+_0x5a6afc}};});}}const Si={'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(_0x23c427,_0x289315,_0x4ec8ec,_0x3745d6){return new Array(_0x23c427)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x289315,'height':_0x4ec8ec,'align':_0x3745d6}}));}class vi extends Fr{constructor(_0x555a29){super(_0x555a29),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class ji extends _0x15a8cb{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x543dd4,_0x55e0ff){super(_0x543dd4),this['_bodyCollection']=_0x55e0ff,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Lt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new $e(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x2e6f71,_0x53cbac){let _0xce022a;return'ai-reply'===_0x2e6f71?_0xce022a=new Xe(this['locale'],_0x53cbac,this['_bodyCollection']):'ai-suggestion-reply'===_0x2e6f71?(_0xce022a=new Qe(this['locale'],_0x53cbac,this['_bodyCollection']),_0xce022a['bind']('isTrackChangesOn')['to'](this)):_0xce022a='user-message'===_0x2e6f71?new Ye(this['locale'],_0x53cbac,this['_bodyCollection']):'interaction-header'===_0x2e6f71?new Ht(this['locale'],_0x53cbac):'custom-element'===_0x2e6f71?new vi(_0x53cbac):new Ze(_0x53cbac),this['children']['add'](_0xce022a),_0xce022a;}async['updateReplyItem']({id:_0x326eb8,parsedContent:_0x21f4a5,renderingStrategy:_0x5344f0,abortSignal:_0x5aba14}){const _0x234b35=this['getItemById'](_0x326eb8);if(!(_0x234b35 instanceof Xe))throw new _0x542443('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x234b35,'id':_0x326eb8,'parsedContent':_0x21f4a5});await _0x234b35['updateContent']({'parsedContent':_0x21f4a5,'renderingStrategy':_0x5344f0,'abortSignal':_0x5aba14});}async['updateWebSources'](_0x1ece46,_0x319870){const _0x68377a=this['getItemById'](_0x1ece46);if(_0x68377a instanceof Qe)_0x68377a['updateSources'](_0x319870);else{if(!(_0x68377a instanceof Xe))throw new _0x542443('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x68377a,'id':_0x1ece46,'sources':_0x319870});_0x68377a['updateSources'](_0x319870);}}async['updateSuggestionItem']({id:_0x4af279,parts:_0x20bbe2,renderingStrategy:_0x1efe83,abortSignal:_0x302183}){const _0x1ad148=this['getItemById'](_0x4af279);if(!(_0x1ad148 instanceof Qe))throw new _0x542443('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x1ad148,'id':_0x4af279,'parts':_0x20bbe2});await _0x1ad148['updateContent']({'parts':_0x20bbe2,'renderingStrategy':_0x1efe83,'abortSignal':_0x302183});}['updateSuggestionPartState']({id:_0x905b1a,index:_0x587b8e,state:_0x542a19}){const _0x4088fc=this['getItemById'](_0x905b1a);if(!(_0x4088fc instanceof Qe))throw new _0x542443('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x905b1a});_0x4088fc['updatePartState'](_0x587b8e,_0x542a19);}['setSuggestionPartActive']({id:_0x25f27e,index:_0x22e4af,isActive:_0x2d510e}){const _0x37e038=this['getItemById'](_0x25f27e);if(!(_0x37e038 instanceof Qe))throw new _0x542443('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x25f27e});this['children']['filter'](_0x34df6a=>_0x34df6a instanceof Qe)['forEach'](_0x7f36a0=>{_0x7f36a0['setPartActive'](!0x1);}),_0x37e038['setPartActive'](_0x22e4af,_0x2d510e);}['markItemAsDone'](_0x288354){this['getItemById'](_0x288354)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x5c4225=>_0x5c4225['options']['id']);}['removeItem'](_0x4d697b){this['children']['remove'](this['getItemById'](_0x4d697b));}['hasItem'](_0x23cb70){return!!this['children']['find'](_0x5a8ad2=>_0x5a8ad2['options']['id']['includes'](_0x23cb70));}['scrollToSuggestion'](_0x5ddc7a,_0x494797){const _0x486b50=this['getItemById'](_0x5ddc7a);if(!(_0x486b50 instanceof Qe))return void _0x23c4c9('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x5ddc7a,'partIndex':_0x494797});const _0x35e014=_0x486b50['getPartView'](_0x494797);_0x35e014?_0x88b018(_0x35e014['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x23c4c9('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x5ddc7a,'partIndex':_0x494797});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x26fda4=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x26fda4,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x3bfd02=new Ei(this['locale'],Si['aiFeed']);return _0x3bfd02['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x58db41=>!_0x58db41)]}}),_0x3bfd02;}['_createFeedItems'](){const _0x5987fd=new _0x15a8cb(this['locale']);return _0x5987fd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x5987fd;}['_createFeedLoader'](){const _0x36522f=new _0x15a8cb(this['locale']);return _0x36522f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0xe94d6b=>!_0xe94d6b)]},'children':this['_createLoaderChildren']()}),_0x36522f;}['_createLoaderChildren'](){const _0x38b781=new Ci();return _0x38b781['isVisible']=!0x0,[_0x38b781,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x9d9dd2){const _0x5c2d58=this['children']['find'](_0x4fe3a7=>_0x4fe3a7['options']['id']['includes'](_0x9d9dd2));if(!_0x5c2d58)throw new _0x542443('ai-chat-feed-view-item-not-found',this,{'id':_0x9d9dd2});return _0x5c2d58;}['setLoadingMessage'](_0x54a7d9){this['set']('loadingMessage',_0x54a7d9);}['toggleLoadingSkeleton'](_0x460b4e){this['set']('isLoadingSkeletonVisible',_0x460b4e);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nh extends _0x236991{['filter'](){let _0x681bff=0x0;for(const _0x2a5db0 of this['items'])_0x681bff+=_0x2a5db0['items']['length'];return{'resultsCount':_0x681bff,'totalItemsCount':_0x681bff};}}const ah='ck-ai-chat__prompt-input_highlighted';class _s extends _0x322b7b{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x51216c,_0x5a5660){super(_0x51216c,{'queryView':{'label':'','creator':_0x11d52f,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nh(_0x51216c),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5a5660,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=_s['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=_s['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',(_0x12640f,_0x1b1f69)=>!_0x12640f&&!_0x1b1f69),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x25042a,_0x3d3e82)=>{this['isUploadInProgress']||this['isEmpty']||_0x25042a['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3d3e82());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x496f5e=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x496f5e)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0xc32c13=_0x1052a4(_0x496f5e);this['fire']('sendUserMessage',_0xc32c13),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x13c4f1){this['queryView']['fieldView']['set']('placeholder',_0x13c4f1);}['focus'](_0x3e1b16=!0x1){super['focus'](),_0x3e1b16&&(this['element']['classList']['contains'](ah)||(this['element']['classList']['add'](ah),setTimeout(()=>{this['element']['classList']['remove'](ah);},0x320)));}['_createSubmitButton'](){const _0x14ba03=new _0x5bfd84(this['locale']);return _0x14ba03['set']({'icon':_0x349858,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x14ba03['on']('execute',()=>{this['submit']();}),_0x14ba03;}['setIsUploadInProgress'](_0x3ab8c0){this['isUploadInProgress']=_0x3ab8c0;}['_setUpAddContextButtonPositioning'](){const _0xc67e88=this['locale'],_0x167f49=()=>{it['window']['requestAnimationFrame'](()=>{if(_0x2e19a7(this['element'])){const _0x505150=new ot(this['queryView']['fieldView']['element']),_0x255992=new ot(this['_addContextButtonView']['element']),_0x41c3d7=_0x505150['width'],_0x2188ec='rtl'===_0xc67e88['uiLanguageDirection']?'right':'left';_0x505150['excludeScrollbarsAndBorders']();const _0x93871d=_0x41c3d7-_0x505150['width']+0x1;this['_addContextButtonView']['element']['style'][_0x2188ec]='calc('+(_0x41c3d7-_0x255992['width']-_0x93871d)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x167f49),this['on']('render',()=>{_0x167f49(),this['_queryViewResizeObserver']=new _0x9cd70(this['queryView']['fieldView']['element'],()=>{_0x167f49();});});}}const Ia='ck-ai-chat__prompt-capabilities',Ea='ck-ai-chat-controls-button',Ta='ck-ai-chat-controls-button--commands',pa='ck-ai-button-tertiary',ma='ck-ai-chat-controls__model-selection',Ca='ck-ai-chat-controls__model-selection__item-name',wa='ck-ai-chat-controls__model-selection__item-description',fa='ck-ai-chat-controls__model-selection__item-capabilities',Sa='n';class vs extends _0x15a8cb{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x89de3){super(_0x89de3),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4ea7a6=>'selector'===_0x4ea7a6),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0xa3e69c=>_0xa3e69c?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x162435=>_0x162435),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x3b99a0=>_0x3b99a0),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x18816f=>i(this['locale'],_0x18816f?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x2dd2dc=>_0x2dd2dc),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x18c75c=>i(this['locale'],_0x18c75c?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Ia]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x4b06b7(),_0x48b098(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x45748b,_0x22c4fd){if(_0x22c4fd)this['set']('modelDisplayMode','hidden');else{const _0x58f5db=0x1===_0x45748b['length'];this['set']('modelDisplayMode',_0x58f5db?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x45748b?.['length'])for(const _0x573a23 of _0x45748b){const _0x777bcd=new _0x129df2({'label':_0x573a23['name'],'withText':!0x0,'role':'menuitemradio','id':_0x573a23['id'],'model':_0x573a23});_0x777bcd['bind']('isOn')['to'](this,'activeModelId',_0x5b5523=>_0x5b5523===_0x573a23['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x777bcd,'labelView':new ba(this['locale'],_0x573a23)});}}['setWebSearch'](_0x531172){this['set']('webSearchActive',_0x531172);}['setReasoning'](_0x11af17){this['set']('reasoningActive',_0x11af17);}['setModel'](_0x13cbd5){if(!_0x13cbd5)return;this['activeModelId']=_0x13cbd5['id'],this['activeModelName']=_0x13cbd5['name']||_0x13cbd5['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x13cbd5['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x13cbd5['name']);const _0x38cfef=_0x13cbd5['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x38cfef),this['_webSearchButton']['set']('isVisible',_0x38cfef);const _0x3490c8=_0x13cbd5['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x3490c8),this['_reasoningButton']['set']('isVisible',_0x3490c8);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x24de96){this['set']('modelSelectorEnabled',!0x1),_0x24de96&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x13e91b=new _0x5bfd84();return _0x13e91b['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x1ce37c,'class':Ea,'isToggleable':!0x0,'tooltipPosition':Sa}),_0x13e91b['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x13e91b;}['_createReasoningButton'](){const _0x41c4a7=new _0x5bfd84();return _0x41c4a7['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x10c759,'class':Ea,'isToggleable':!0x0,'tooltipPosition':Sa}),_0x41c4a7['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x41c4a7;}['_createCommandsButton'](){const _0x5d4a57=new _0x5bfd84();return _0x5d4a57['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0xe3a7aa,'withText':!0x0,'class':Ea,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Sa}),_0x5d4a57['extendTemplate']({'attributes':{'class':[Ta]}}),_0x5d4a57['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x5d4a57;}['_createModelSelectionDropdown'](){const _0x230afd=_0x29ed58(this['locale']);return _0x230afd['set']({'panelPosition':'ne','class':[ma]}),_0x230afd['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Sa,'class':pa}),this['listenTo'](_0x230afd,'execute',_0x5dc8b8=>{this['fire']('selectModel',_0x5dc8b8['source']['model']);}),_0x230afd;}['_createModelNameView'](){const _0x358363=new Ra(this['locale']);return _0x358363['bind']('text')['to'](this,'activeModelName',_0x36390a=>_0x36390a??''),_0x358363['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1e91b8=>'name'===_0x1e91b8),_0x358363;}}let ba=class extends _0x59760a{constructor(_0x3df08f,_0x243a2a){super();const _0x55099c=this['bindTemplate'],_0x55ef34=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x55099c['to']('style'),'id':_0x55099c['to']('id')},'children':[{'tag':'div','attributes':{'class':[Ca]},'children':[{'text':_0x55099c['to']('text')}]},{'tag':'div','attributes':{'class':[wa]},'children':[{'tag':'span','children':[{'text':_0x243a2a['description']}]}]},{'tag':'div','attributes':{'class':[fa]},'children':_0x55ef34}]}),_0x55ef34['addMany'](this['_getCapabilityParts'](_0x3df08f,_0x1ce37c,'AI_CHAT_SEARCH_WEB',_0x243a2a['capabilities']['webSearch']?.['enabled']??!0x1)),_0x55ef34['addMany'](this['_getCapabilityParts'](_0x3df08f,_0x10c759,'AI_CHAT_REASONING',_0x243a2a['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x4e15b3,_0xbd8015,_0x16a875,_0x92e3b2){const _0x5989ca=new _0x2ae97e();_0x5989ca['content']=_0xbd8015;const _0x257642=new _0x15a8cb(_0x4e15b3);_0x257642['setTemplate']({'tag':'span','children':[{'text':i(_0x4e15b3,_0x16a875)+':\x20'}]});const _0xf05d7b=new _0x15a8cb(_0x4e15b3);return _0xf05d7b['setTemplate']({'tag':'span','children':[{'text':i(_0x4e15b3,_0x92e3b2?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x5989ca,_0x257642,_0xf05d7b];}},Ra=class extends _0x15a8cb{constructor(_0x5091d2){super(_0x5091d2),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x41fc55=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x41fc55['if']('isVisible','ck-hidden',_0x4ceeda=>!_0x4ceeda)]},'children':[{'text':_0x41fc55['to']('text')}]});}};const Oa='ck-ai-chat-context-controls__url-form',ka='ck-ai-chat-context-controls__url-input-section';class Io extends _0x15a8cb{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x3ced6a){super(_0x3ced6a),this['focusTracker']=new _0x510dfd(),this['keystrokes']=new _0x394cf5(),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 _0x5a99d2({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x1a25d3=>{this['focusTracker']['add'](_0x1a25d3['element']),this['keystrokes']['listenTo'](_0x1a25d3['element']);}),_0x251698({'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'](_0x13fbd8){this['urlInputField']['errorText']=_0x13fbd8,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x5ea867=new _0x5bfd84(this['locale']);return _0x5ea867['set']({'icon':_0x3c7600,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x35aaf6,_0x406503,_0x335aaa)=>{_0x5ea867['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x335aaa?'':'\x20ck-hidden')]});}),_0x5ea867;}['_createUrlInputField'](){const _0x49daf1=new _0x1a087b(this['locale'],th);return _0x49daf1['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x49daf1['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x49daf1;}['_createConfirmButton'](){const _0x418daa=new _0x5bfd84(this['locale']);return _0x418daa['set']({'icon':_0x15208f,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x418daa;}['_setupTemplate'](){const _0x14e333=new _0x2e3f47(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x14e333['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Oa,'tabindex':'-1'},'children':[_0x14e333,{'tag':'div','attributes':{'class':ka},'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',_0x381db9=>{_0x381db9['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x3254d4,_0x469a89)=>{this['clear'](),this['fire']('cancel'),_0x469a89();});}['_handleSubmit'](){const _0x28e81b=this['getValue']()['trim']();_0x28e81b?this['_isValidUrl'](_0x28e81b)?(this['clearError'](),this['fire']('submitUrl',_0x28e81b)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x21a817=this['getValue']()['trim'](),_0x178a5e=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x21a817['length']>0x0&&!_0x178a5e;}['_isValidUrl'](_0x1aecb7){try{return!!new URL(_0x1aecb7);}catch{return!0x1;}}}const Na='ck-ai-chat-resources__item',va='ck-ai-chat-resources__item--in-context',ya='ck-ai-chat-resources__item-title',xa='ck-ai-chat-resources__item__icon';class hc extends _0x5e9d54{['resource'];['_titleView'];['_iconView'];constructor(_0x32a790,_0x45097b){super(_0x32a790),this['resource']=_0x45097b,this['set']('isInContext',!!_0x45097b['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x36ebe9){if(_0x36ebe9['isInContext'])return _0x15208f;switch(_0x36ebe9['type']){case qe['DOCUMENT']:return _0x51d2a2;case qe['URL']:return _0x5acb26;case qe['FILE']:case qe['TEXT']:return _0x56f9a2;default:return _0x4da3a3;}}['highlightText'](_0x1463d1){if(!_0x1463d1||''===_0x1463d1['trim']())return void this['_titleView']['highlightText'](null);const _0x241dd0=new RegExp(_0x249f4a(_0x1463d1),'gi');this['_titleView']['highlightText'](_0x241dd0);}['updateResourceState'](_0x165743){this['resource']['isInContext']=_0x165743,this['isInContext']=_0x165743,this['_updateIcon']();}['_createTitleView'](){const _0xf21661=new _0x258b31();return _0xf21661['text']=this['resource']['label'],_0xf21661['extendTemplate']({'tag':'span','attributes':{'class':[ya]}}),_0xf21661;}['_createIconView'](){const _0x46a926=new _0x2ae97e();return _0x46a926['content']=this['getResourceIcon'](this['resource']),_0x46a926;}['_setupTemplate'](){const _0x3a1ffb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Na,_0x3a1ffb['if']('isVisible','ck-hidden',_0x54d514=>!_0x54d514),_0x3a1ffb['if']('isInContext',va)]},'children':[{'tag':'div','attributes':{'class':[xa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x3a1ffb['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const La='ck-ai-chat-resources__list';class Lr extends _0x236991{['_source'];constructor(_0xfcd3c5,_0xa46bf2){super(_0xfcd3c5),this['_source']=_0xa46bf2,this['extendTemplate']({'attributes':{'class':[La]}});}['setResources'](_0x181d7d,_0x367c04){this['items']['clear']();let _0x39c91b=_0x181d7d;if(this['_source']['useDefaultFiltering']&&_0x367c04&&''!==_0x367c04['trim']()){const _0x339af6=new RegExp(_0x367c04['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x39c91b=_0x181d7d['filter'](_0x2b5e11=>_0x339af6['test'](_0x2b5e11['label']));}for(const _0x273c36 of _0x39c91b){const _0x378f46=new hc(this['locale'],_0x273c36);_0x378f46['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x273c36);}),this['items']['add'](_0x378f46);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x367c04);}['highlightText'](_0x1bccef){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x291e0d=>{_0x291e0d['highlightText'](_0x1bccef);});}['updateResourceState'](_0x54d543,_0x38f060){for(const _0x42b075 of this['items']){const _0x550fd7=_0x42b075;_0x550fd7['resource']['id']===_0x54d543&&_0x550fd7['updateResourceState'](_0x38f060);}}['_handleResourceSelection'](_0x52188f,_0x20f959){this['fire']('addResourceToContext',{'source':_0x52188f,'resource':_0x20f959});}}class Ur extends _0x1a087b{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x4f9272){const t=_0x4f9272['t'],_0x1829f8={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x4f9272,'AI_CHAT_SEARCH_RESOURCES')};super(_0x4f9272,_0x1829f8['creator']),this['label']=_0x1829f8['label'],this['_viewConfig']=_0x1829f8,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x4f9272,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4e0c1a){this['fire']('search',_0x4e0c1a);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x2ae97e(),this['iconView']['content']=_0x1fb99b,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x204d28,t){this['resetButtonView']=new _0x5bfd84(_0x204d28),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x187b85,'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',_0x36ae44=>!_0x36ae44),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 lc extends _0x15a8cb{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x549055,_0x7b9ddc){super(_0x549055),this['_source']=_0x7b9ddc['source'],this['_searchInputVisibleFrom']=_0x7b9ddc['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 _0x152ab6([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 _0x5ee788=new _0x15a8cb(this['locale']);return _0x5ee788['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2d6542,_0x599d76)=>{this['loadResources'](_0x599d76),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x599d76);}),_0x5ee788;}['_createResourcesListView'](){const _0x253021=new Lr(this['locale'],this['_source']);return _0x253021['delegate']('addResourceToContext')['to'](this),_0x253021['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x253021;}['_createSkeletonView'](){const _0x279603=new Ei(this['locale'],Si['aiChatResources']);return _0x279603['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4268ea=>!_0x4268ea)]}}),_0x279603;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x245fa2){const _0x1388d2=_0x2e2dc8();this['_latestLoadResourcesUid']=_0x1388d2,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x245fa2,'uid':_0x1388d2}),this['isLoading']=!0x0;}['setResources'](_0x2ce795,_0x3dc6c0){if(_0x3dc6c0&&_0x3dc6c0!==this['_latestLoadResourcesUid'])return;const _0x94356a=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x2ce795,_0x94356a),_0x2ce795['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x4fa840,_0x164415){this['_resourcesListView']['updateResourceState'](_0x4fa840,_0x164415);}}const Da='ck-ai-chat-context-controls__source-balloon-panel',Pa='ck-button-icon\x20ck-button-back',Ha='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Ro{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x27ce6c,_0x50812d,_0x55c481){this['_locale']=_0x27ce6c,this['_bodyCollection']=_0x50812d,this['_config']=_0x55c481;}['showSourceResourcesBalloon']({source:_0x16fabd,withBackButton:_0x425f44}){let _0x1f3b3e=this['_sourceResourceBalloons']['get'](_0x16fabd['id']);_0x1f3b3e||(_0x1f3b3e=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x16fabd['id'],_0x1f3b3e),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x1f3b3e)),this['_addSourceResourceContent']({'balloonPanel':_0x1f3b3e,'source':_0x16fabd,'withBackButton':_0x425f44}),_0x1f3b3e['show']();const _0x286673=this['_config']['getTargetElement']();_0x286673&&_0x1f3b3e['pin']({'target':_0x286673,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x224aed,_0x31d8ba,_0x2e3db5){const _0x4213fe=this['_sourceResourceBalloons']['get'](_0x224aed);if(!_0x4213fe)return;const _0x48fa00=this['_getResourcesViewFromBalloon'](_0x4213fe);_0x48fa00&&(_0x48fa00['setResources'](_0x31d8ba,_0x2e3db5),_0x48fa00['once']('change:isLoading',()=>{_0x4213fe['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x217681){const _0x5ca216=this['_sourceResourceBalloons']['get'](_0x217681);_0x5ca216&&requestAnimationFrame(()=>{_0x5ca216['hide'](),this['_sourceResourceBalloons']['delete'](_0x217681),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x49acbd of this['_sourceResourceBalloons']['values']())if(_0x49acbd['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x25dd34,_0x14b08c,_0xf50a84){const _0x552938=this['_sourceResourceBalloons']['get'](_0x25dd34);if(!_0x552938||!_0x552938['isVisible'])return;const _0x1acb2b=this['_config']['getTargetElement']();if(!_0x1acb2b)return;_0x552938['pin']({'target':_0x1acb2b,'limiter':this['_config']['getLimiterElement']()});const _0x570648=this['_getResourcesViewFromBalloon'](_0x552938);_0x570648&&_0x570648['updateResourceState'](_0x14b08c,_0xf50a84);}['destroy'](){for(const _0x4cc2ea of this['_sourceResourceBalloons']['values']())_0x4cc2ea['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x423837=new _0x1ddc71(this['_locale']);return _0x423837['extendTemplate']({'attributes':{'class':Da}}),this['_bodyCollection']['add'](_0x423837),_0x423837;}['_addSourceResourceContent']({balloonPanel:_0x4bb65d,source:_0x3d8ab7,withBackButton:_0x31a91a}){_0x4bb65d['content']['clear']();const _0x996a48=this['_createBalloonHeader']({'balloonPanel':_0x4bb65d,'source':_0x3d8ab7,'withBackButton':_0x31a91a});_0x4bb65d['content']['add'](_0x996a48);const _0x5ce18f=this['_createBalloonResourcesView'](_0x3d8ab7);_0x4bb65d['content']['add'](_0x5ce18f);}['_createBalloonHeader']({balloonPanel:_0x494a3c,source:_0x59ed97,withBackButton:_0x50e3a2}){const _0x42e268=new _0x2e3f47(this['_locale'],{'label':_0x59ed97['label'],'class':Ha});return _0x50e3a2&&_0x42e268['children']['add'](this['_createBackButton'](_0x494a3c),0x0),_0x42e268;}['_createBackButton'](_0x46eb66){const _0x23d64f=new _0x5bfd84(this['_locale']);return _0x23d64f['set']({'icon':_0x3c7600,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Pa}),_0x23d64f['on']('execute',()=>{_0x46eb66['hide'](),this['_config']['onBackToContext']();}),_0x23d64f;}['_createBalloonResourcesView'](_0x21e875){const _0x1d67d3=new lc(this['_locale'],{'source':_0x21e875,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x1d67d3['on']('loadSourceResources',(_0x4b167e,_0x52b4a7)=>{this['_config']['onLoadSourceResources'](_0x52b4a7);}),_0x1d67d3['on']('addResourceToContext',(_0x548d9e,_0x3899f3)=>{this['_config']['onResourceSelected'](_0x3899f3['source'],_0x3899f3['resource']),this['closeSourceResourceBalloon'](_0x21e875['id']);}),_0x1d67d3;}['_getResourcesViewFromBalloon'](_0x495180){const _0x5b4b85=_0x495180['content']['get'](0x1);return _0x5b4b85 instanceof lc?_0x5b4b85:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0xa9f6bd){_0x4daaf2({'emitter':_0xa9f6bd,'contextElements':[_0xa9f6bd['element']],'callback':()=>{_0xa9f6bd['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0xa9f6bd['isVisible']});}}const xs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Oo='ck-ai-chat-context-controls',Uo='ck-ai-chat-context-controls__pending-contexts',Lo='ck-ai-chat-context-controls__add-context-balloon-panel',No='ck-ai-chat-context-controls__add-context-button',Mo='ck-ai-chat-context-controls__url-balloon-panel',Ho='ck-ai-chat-context-controls__balloon-button',jo='ck-ai-chat-context-controls__balloon-button-source',Fo='ck-ai-chat-controls-button',Xo='ck-ai-chat-context-chips-wrapper-balloon',yo='ck-ai-chat-controls_context_show-more-button',Do='ck-ai-chat-context-controls__show-more-balloon-panel',$o='ck-ai-chat',Wo=[_0x1ddc71['defaultPositions']['northArrowSouthWest'],_0x1ddc71['defaultPositions']['northArrowSouth'],_0x1ddc71['defaultPositions']['northArrowSouthEast'],_0x1ddc71['defaultPositions']['southArrowNorthWest'],_0x1ddc71['defaultPositions']['southArrowNorth'],_0x1ddc71['defaultPositions']['southArrowNorthEast']];class Is extends _0x15a8cb{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x19f5bf,_0xfdadf){super(_0x19f5bf),this['bodyCollection']=_0xfdadf['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x19f5bf),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x19f5bf),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x19f5bf),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x19f5bf,_0xfdadf);const _0x290de1={'cssClasses':{'showMoreButton':yo,'showMoreBalloon':Do,'overflowContainer':Xo,'controlsButton':Fo}};this['_overflowManager']=new Po(_0x19f5bf,this['_currentContextsChips'],_0x290de1,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'](_0x20977c,_0xc99bbb){const _0x54abec=this['_createContextButton'](_0x20977c,'current',!0x0,_0xc99bbb);this['_addContextToCollection'](_0x54abec,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x4948ff){this['_removeContextFromCollection'](_0x4948ff,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x4948ff,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x8f4386,_0x137250){let _0xe88a08=this['_currentContextsChips']['find'](_0x5c4546=>_0x5c4546['id']===_0x8f4386);_0xe88a08||(_0xe88a08=this['_overflowManager']['overflowChips']['find'](_0x3db014=>_0x3db014['id']===_0x8f4386)),_0xe88a08&&(_0xe88a08['isLoading']=_0x137250);}['setConversationContext'](_0x1be2c5){this['_conversationContextsChips']['clear']();for(const _0x124c1d of _0x1be2c5){const _0x42da92=this['_createContextButton'](_0x124c1d,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x42da92,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x4b55d6,_0x55fdd6,_0x42be0a){this['_resourcesBalloonView']['updateResourceState'](_0x4b55d6,_0x55fdd6,_0x42be0a);}['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']({source:_0x3f3d9d,withBackButton:_0x4f6bb2}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x3f3d9d,'withBackButton':_0x4f6bb2}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x3f428f,_0x5468a5,_0x495c65,_0x322209){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x3f428f,_0x495c65,_0x322209);}['closeSourceResourceBalloon'](_0x399d2c){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x399d2c),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xa542aa){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xa542aa),this['_setAddContextButtonEnabled'](_0xa542aa);}['_setAddContextButtonEnabled'](_0x44a10e){const _0x1f7808=!_0x44a10e['document']['isHidden']&&_0x44a10e['document']['enabled'],_0x56f5c0=_0x44a10e['urls']['enabled'],_0x2035f9=_0x44a10e['files']['enabled'],_0x22d3d6=_0x44a10e['sources']['length']>0x0,_0xa4b991=_0x44a10e['customItems']&&_0x44a10e['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x1f7808||_0x56f5c0||_0x2035f9||_0x22d3d6||_0xa4b991;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Oo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Uo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x487c9c){const _0x35c3cb=new _0x5bfd84(_0x487c9c);return _0x35c3cb['set']({'label':i(_0x487c9c,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Fo+'\x20'+No,'icon':_0xb33e07,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x35c3cb;}['_createAddContextBalloonPanelView'](_0x2baa73){return this['_createBaseBalloonPanel'](_0x2baa73,Lo);}['_createUrlBalloonPanelView'](_0x4e785a){const _0x1c1ee1=this['_createBaseBalloonPanel'](_0x4e785a,Mo);return this['_addUrlContent'](_0x1c1ee1,_0x4e785a),_0x1c1ee1;}['_createResourcesBalloonView'](_0xf28d12,_0x390144){const _0x5088c6={'searchInputVisibleFrom':_0x390144['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wo});},'onResourceSelected':(_0xed85e0,_0x15efd0)=>{this['fire']('addResourceToContext',{'source':_0xed85e0,'resource':_0x15efd0});},'onLoadSourceResources':_0x206357=>{this['fire']('loadSourceResources',_0x206357);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Ro(_0xf28d12,_0x390144['bodyCollection'],_0x5088c6);}['_getLimiterElement'](){return this['element']?.['closest']('.'+$o)||document['body'];}['_createBaseBalloonPanel'](_0x4fc702,_0xc7d9b){const _0x5cbc96=new _0x1ddc71(_0x4fc702);return _0x5cbc96['extendTemplate']({'attributes':{'class':_0xc7d9b}}),this['bodyCollection']['add'](_0x5cbc96),_0x5cbc96;}['_setBalloonPanelContent'](_0x351bf7,_0xda2c83,_0x15fcba){if(_0x351bf7['content']['clear'](),!_0x15fcba['document']['isHidden']&&_0x15fcba['document']['enabled']){const _0x297546=this['_createBalloonButton'](_0xda2c83,{'label':i(_0xda2c83,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x51d2a2});_0x297546['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x351bf7['content']['add'](_0x297546);}if(_0x15fcba['urls']['enabled']){const _0x1a34b1=this['_createBalloonButton'](_0xda2c83,{'label':i(_0xda2c83,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x5acb26});_0x1a34b1['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wo}),this['_urlInputView']['focus']();}),_0x351bf7['content']['add'](_0x1a34b1);}if(_0x15fcba['files']['enabled']){const _0x329048=new _0x4834b0(_0xda2c83);_0x329048['set']({'label':i(_0xda2c83,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x555a1a,'withText':!0x0,'tooltip':!0x0,'class':Ho,'allowMultipleFiles':!0x0}),_0x329048['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x329048['on']('done',(_0x54cf1d,_0x12aa1a)=>{this['fire']('addFileToContext',_0x12aa1a);}),_0x329048['tooltip']=!0x0,_0x351bf7['content']['add'](_0x329048);}for(const _0x1be4c5 of _0x15fcba['sources']){const _0x2bc65d=this['_createBalloonButton'](_0xda2c83,{'label':_0x1be4c5['label'],'icon':_0x1be4c5['icon']||_0x4da3a3,'type':'source'});_0x351bf7['content']['add'](_0x2bc65d),_0x2bc65d['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x1be4c5,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0xd154ca of _0x15fcba['customItems']||[]){const _0x543210=this['_createBalloonButton'](_0xda2c83,{'label':_0xd154ca['label'],'icon':_0xd154ca['icon']||_0x4da3a3,'type':'customItem'});_0x351bf7['content']['add'](_0x543210),_0x543210['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0xd154ca);});}this['_hasExactlyOneSource']=0x1===_0x351bf7['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x4961c9,_0x4e4ad1){this['_urlInputView']=new Io(_0x4e4ad1),this['_urlInputView']['on']('submitUrl',(_0x4ebf1d,_0x5a5649)=>{this['_handleUrlSubmit'](_0x5a5649);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wo});}),_0x4961c9['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0xef98bb,_0x4afbd7){const _0xcb8b1b='source'===_0x4afbd7['type']?new Ma(_0xef98bb):new _0x5bfd84(_0xef98bb);return _0xcb8b1b['set']({'label':_0x4afbd7['label'],'icon':_0x4afbd7['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ho}),_0xcb8b1b;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x4daaf2({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x59a4cf){const _0x1bb1f1=this['_addContextBalloonConfig'];_0x1bb1f1['buttonView']['isOn']=_0x59a4cf,_0x59a4cf?_0x1bb1f1['balloonView']['show']():_0x1bb1f1['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0xb04b48,buttonView:_0x5e6365,hideMethod:_0x405131}=this['_addContextBalloonConfig'];_0x4daaf2({'emitter':_0xb04b48,'contextElements':[_0xb04b48['element'],_0x5e6365['element']],'callback':()=>{_0x405131();},'activator':()=>_0x5e6365['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x277633,_0x2a9802,_0x2ce262=!0x1,_0x5d15c4=!0x1){const _0x5d9bde='conversation'===_0x2a9802||!0x0===_0x277633['isReadOnly'],_0x4e3734=new Vo(this['locale'],_0x277633,_0x5d9bde,_0x2ce262,_0x5d15c4);return _0x5d9bde||_0x4e3734['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x4e3734['id']);}),_0x4e3734;}['_addContextToCollection'](_0x46a1a1,_0x5de129){_0x5de129['add'](_0x46a1a1,0x0);}['_removeContextFromCollection'](_0x554fd9,_0x2a1a8d){const _0x27b019=_0x2a1a8d['find'](_0x4067e3=>_0x4067e3['id']===_0x554fd9);_0x27b019&&_0x2a1a8d['remove'](_0x27b019);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Wo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x55255e){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x55255e);}}class Ma extends _0x5bfd84{['arrowView'];constructor(_0x11c3d3){super(_0x11c3d3),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[jo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x30c943=new _0x2ae97e();return _0x30c943['content']=_0x4e1794,_0x30c943['extendTemplate']({'attributes':{'class':jo+'__arrow'}}),_0x30c943;}}class Cs extends _0x15a8cb{['_cancelButtonView'];['_loaderView'];constructor(_0xdc349f){super(_0xdc349f),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 _0x581c75=new _0x5bfd84(this['locale']);return _0x581c75['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x49c145}),_0x581c75['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x581c75;}['_createLoaderView'](){const _0x2e02b1=new _0x15a8cb(this['locale']);return _0x2e02b1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x2e02b1;}}class xi extends _0x15a8cb{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x194728,_0x50f0ff){super(_0x194728),this['_contextPanelView']=this['_createContextPanelView'](_0x194728,{'bodyCollection':_0x50f0ff['bodyCollection'],'searchInputVisibleFrom':_0x50f0ff['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x194728),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x194728),this['_loaderView']=this['_createLoaderView'](_0x194728),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x194728),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'](...xs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x53bd13=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x53bd13['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x53bd13['if']('isLoading','ck-hidden',_0x25c3d4=>_0x25c3d4||!this['isModelAvailable']),_0x53bd13['if']('isModelAvailable','ck-hidden',_0x28935f=>!_0x28935f||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x53bd13['if']('isLoading','ck-hidden',_0x4e9fb5=>!_0x4e9fb5)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x53bd13['if']('isModelAvailable','ck-hidden',_0x8c1299=>_0x8c1299)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x4daaf2({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x51749a,_0x34182c){return new Is(_0x51749a,_0x34182c);}['_createPromptInputView'](_0x3d9818){return new _s(_0x3d9818,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x1b0ec4){return new vs(_0x1b0ec4);}['_createLoaderView'](_0x37b2b2){return new Cs(_0x37b2b2);}['_createModelUnavailableMessageView'](_0xc70916){const _0x8d48f=new As(_0xc70916);return _0x8d48f['delegate']('startConversation')['to'](this),_0x8d48f;}['_handlePromptInputFocus'](_0x4eb2af,_0x23deac,_0x4ef11b){_0x4ef11b?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x534b37,_0xf17c83){this['_contextPanelView']['addContextItem'](_0x534b37,_0xf17c83);}['removeContextItem'](_0x4f0698){this['_contextPanelView']['removeContextItem'](_0x4f0698);}['setContextItemLoading'](_0x4707f6,_0x4cd636){this['_contextPanelView']['setContextItemLoading'](_0x4707f6,_0x4cd636);}['setIsUploadInProgress'](_0x512304){this['_promptInputView']['setIsUploadInProgress'](_0x512304);}['setConversationContext'](_0x4e6638){this['_contextPanelView']['setConversationContext'](_0x4e6638);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x13cc08,_0xec16a5,_0x1c0a21){this['_contextPanelView']['updateResourceState'](_0x13cc08,_0xec16a5,_0x1c0a21);}['setWebSearch'](_0x4e6ea9){this['_promptCapabilitiesView']['setWebSearch'](_0x4e6ea9);}['setReasoning'](_0x1f2583){this['_promptCapabilitiesView']['setReasoning'](_0x1f2583);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x1eec05){this['_contextPanelView']['setAddContextOptions'](_0x1eec05);}['setInputPlaceholder'](_0x17d72f){this['_promptInputView']['setPlaceholderText'](_0x17d72f);}['setModelList'](_0x31251c,_0x108256){this['_promptCapabilitiesView']['setModelList'](_0x31251c,_0x108256);}['setModel'](_0x4c38c2){_0x4c38c2?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x4c38c2)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x499044){this['_promptCapabilitiesView']['disableModelSelector'](_0x499044);}['populateSourceResourceBalloon'](_0x34c26c,_0x432ae2,_0x467db1,_0x559d97){this['_contextPanelView']['populateSourceResourceBalloon'](_0x34c26c,_0x432ae2,_0x467db1,_0x559d97);}['closeSourceResourceBalloon'](_0x543e90){this['_contextPanelView']['closeSourceResourceBalloon'](_0x543e90);}['focusPromptInput'](_0x2e95e9=!0x1){this['_promptInputView']['focus'](_0x2e95e9);}['setPromptInputValue'](_0x3c661c){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x3c661c;}}class As extends _0x15a8cb{constructor(_0x2335e9){super(_0x2335e9);const _0x40e2ff=new _0x5bfd84(_0x2335e9);_0x40e2ff['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x40e2ff['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x40e2ff]}]});}}class Bi extends _0x2e3f47{['conversationStartButton'];['resizeButton'];constructor(_0x5b0018,_0x17c514){super(_0x5b0018,{'label':i(_0x5b0018,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Ft}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x5b0018),this['children']['add'](this['conversationStartButton']),_0x17c514&&(this['resizeButton']=Ri(_0x5b0018,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x41d70d){const _0x3a7c12=new _0x5bfd84(_0x41d70d);return _0x3a7c12['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x377ed9,'class':'ck-ai-chat__start-conversation'}),_0x3a7c12['on']('execute',()=>{this['fire']('startConversation');}),_0x3a7c12;}}class Fi extends _0x15a8cb{constructor(_0x51683c){super(_0x51683c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x51683c,'AI_DISCLAIMER_TEXT')}]}]});}}class Mt extends _0x15a8cb{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x426ab5,_0x2ce84b){super(_0x426ab5),this['_bodyCollection']=new _0x49fddd(_0x426ab5),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Bi(_0x426ab5,_0x2ce84b['showResizeButton']),this['chatHeader']['delegate'](...Lt)['to'](this),this['chatFeed']=new ji(_0x426ab5,this['_bodyCollection']),this['chatFeed']['delegate'](...Lt)['to'](this),this['chatControls']=new xi(_0x426ab5,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x2ce84b['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Lt)['to'](this),this['chatDisclaimer']=new Fi(_0x426ab5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x426ab5['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x188b0d,_0x42f424,_0x2eef2a,_0x4a7d3c){this['chatControls']['populateSourceResourceBalloon'](_0x188b0d,_0x42f424,_0x2eef2a,_0x4a7d3c);}['closeSourceResourceBalloon'](_0x59deb0){this['chatControls']['closeSourceResourceBalloon'](_0x59deb0);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ut extends _0x118815{static get['requires'](){return[_t];}['_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(_0x473f78){super(_0x473f78);const _0x4f67fd=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new N(),this['_view']=new Mt(this['context']['locale'],{'showResizeButton':_0x4f67fd['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Lt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x18960b,{showDiff:_0x14cc94})=>{this['showDiff']=_0x14cc94;}),_0x4f67fd['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Ft,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x183434=>_0x183434),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x401463=>_0x401463),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x1d11d3){const _0x19eeb3=this['context']['config']['get']('ai.chat.welcomeMessage')??i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x1d11d3['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x19eeb3}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x2102cc,staticMessage:_0x5ca152}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2102cc,'initialContent':'<p>'+_0x5ca152+'</p>'});}['addFeedItemUserMessage'](_0x3786a9){const _0x3b60d9=_0x3786a9['attributes']?.['displayedPrompt']||_0x3786a9['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x3786a9['contextItems']['values']()),'initialContent':'<p>'+_0x3b60d9+'</p>','id':_0x3786a9['id']});}['addFeedItemError']({errorMessage:_0x475ffa,id:_0x584590}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x475ffa+'</p>','id':_0x584590});}['addFeedItemAIReply'](_0x17383b){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x17383b['interactionId']+':'+_0x17383b['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0xc1c18d){const _0x42b4bb=et(this['context']);let _0x183724=_0x42b4bb['config']['get']('ai.availableReplyActions')||[...X];if(_0x42b4bb['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x29d8c9=_0x42b4bb['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x29d8c9,'value');}}else _0x183724=_0x183724['filter'](_0x4137c3=>'insertSuggestion'!=_0x4137c3);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0xc1c18d['interactionId']+':'+_0xc1c18d['id'],'areActionsDisabled':_0xc1c18d['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x183724}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x261dda,_0x33d44d){const _0x1681cb=this['_view']['chatFeed']['children']['last'];if(_0x1681cb instanceof Ht)return this['_view']['chatFeed']['children']['remove'](_0x1681cb),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x261dda['id'],'capabilities':{'isWebSearchEnabled':_0x1681cb['capabilities']['isWebSearchEnabled']||_0x33d44d['isWebSearchEnabled'],'isReasoningEnabled':_0x1681cb['capabilities']['isReasoningEnabled']||_0x33d44d['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x261dda['id'],'capabilities':_0x33d44d});}async['addFeedItemCustomElement'](_0x203eb8,_0x6db6b8){let _0x1eb061;return await this['_promiseQueue']['enqueue'](async()=>{_0x1eb061=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x203eb8,'id':_0x6db6b8});}),_0x1eb061;}['removeFeedItem'](_0x568041){this['_view']['chatFeed']['removeItem'](_0x568041);}['hasFeedItem'](_0x580240){return this['_view']['chatFeed']['hasItem'](_0x580240);}['updateFeedInteractionHeader'](_0xa76ff6){const _0xb2dabb=this['_view']['chatFeed']['children']['find'](_0x12d143=>_0x12d143['options']['id']==_0xa76ff6['id']&&_0x12d143 instanceof Ht);_0xb2dabb&&_0xb2dabb['set']('isVisible',_0xa76ff6['isVisible']);}async['updateFeedItemAIReplyContent'](_0x325a95){const _0x1f930d=_0x325a95['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x3783a2=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x325a95,'abortSignal':_0x3783a2,'renderingStrategy':_0x1f930d}),_0x325a95['isDone']&&this['markFeedItemAsDone'](_0x325a95['id']);});}['updateFeedItemAIReplySources'](_0x11faa3,_0x29b11b){this['_view']['chatFeed']['updateWebSources'](_0x11faa3,_0x29b11b);}async['updateFeedItemAIReplySuggestionContent'](_0x1948e3){const _0x2fe490=_0x1948e3['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x406e8d=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x1948e3,'abortSignal':_0x406e8d,'renderingStrategy':_0x2fe490}),_0x1948e3['isDone']&&this['markFeedItemAsDone'](_0x1948e3['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x348951){this['_view']['chatFeed']['updateSuggestionPartState'](_0x348951);}['setFeedItemAIReplySuggestionPartActive'](_0x4dfbcf){this['_view']['chatFeed']['setSuggestionPartActive'](_0x4dfbcf);}['markFeedItemAsDone'](_0x1e21cf){this['_view']['chatFeed']['markItemAsDone'](_0x1e21cf);}['removeFeedInteraction'](_0x27a16b){this['_view']['chatFeed']['getItemIds']()['filter'](_0x358d28=>_0x358d28['startsWith'](_0x27a16b))['forEach'](_0x15e411=>this['_view']['chatFeed']['removeItem'](_0x15e411));}['startInteraction'](){const _0x2b2c0e=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x2b2c0e),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x70a178){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x3fc0c0=>_0x3fc0c0['startsWith'](_0x70a178['id']))['forEach'](_0x3ceca3=>this['markFeedItemAsDone'](_0x3ceca3)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x559df4,_0x49ec93){this['_view']['chatControls']['addContextItem'](_0x559df4,_0x49ec93);}['removeContextItem'](_0x5f5a06){this['_view']['chatControls']['removeContextItem'](_0x5f5a06);}['setContextItemLoading'](_0x31d134,_0x3bde14){this['_view']['chatControls']['setContextItemLoading'](_0x31d134,_0x3bde14);}['setIsUploadInProgress'](_0x2d8e51){this['_view']['chatControls']['setIsUploadInProgress'](_0x2d8e51);}['setConversationContext'](_0x42cf14){this['_view']['chatControls']['setConversationContext'](_0x42cf14);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x455d78,_0xc421e7,_0x53e9c9){this['_view']['chatControls']['updateResourceState'](_0x455d78,_0xc421e7,_0x53e9c9);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x7facb6){this['_view']['chatControls']['setAddContextOptions'](_0x7facb6);}['updateCapabilities'](_0x14054f){this['_view']['chatControls']['setWebSearch'](_0x14054f['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x14054f['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x14054f));}['setSelectedModel'](_0x3e915d,_0x2cbd5f){this['_view']['chatControls']['setModel'](_0x3e915d),_0x2cbd5f&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x2be16d){this['feedItemRenderingStrategy']=_0x2be16d;}['toggleLoadingSkeleton'](_0x16da25){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x16da25);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x4e00af,_0x85fe43=!0x1){if(_0x85fe43&&!Pt()&&_0x4e00af['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4e00af);this['_view']['chatHeader']['label']=_0x4e00af;}['setLoadingMessage'](_0x330ba0){this['_view']['chatFeed']['setLoadingMessage'](_0x330ba0);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x3803ed){let _0x13cbd9=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x3803ed[_0x13cbd9],_0x13cbd9++,_0x13cbd9===_0x3803ed['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x2ffb69){this['_view']['chatHeader']['isMaximized']=_0x2ffb69;}['prepareLoadingMessage'](_0x4b3ba8){return _0x4b3ba8['isWebSearchEnabled']&&_0x4b3ba8['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x4b3ba8['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x4b3ba8['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x547f53){return _0x547f53?_0x547f53['isWebSearchEnabled']&&_0x547f53['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x547f53['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x547f53['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x3e2d69,_0x1310a0,_0x3c335e,_0x4f8bc4){this['_view']['populateSourceResourceBalloon'](_0x3e2d69,_0x1310a0,_0x3c335e,_0x4f8bc4);}['closeSourceResourceBalloon'](_0x12bd7){this['_view']['closeSourceResourceBalloon'](_0x12bd7);}['setPromptInputValue'](_0x5383ae){this['_view']['chatControls']['setPromptInputValue'](_0x5383ae);}['focusPromptInput'](_0x12824b=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x12824b);}['scrollFeedToSuggestion'](_0x40bd3e,_0x170667){this['_view']['chatFeed']['scrollToSuggestion'](_0x40bd3e,_0x170667);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class bi extends _0x236991{['sections'];constructor(_0x59203c,_0x391d9d){super(_0x59203c),this['sections']=_0x391d9d,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x59af59){let _0x2df113=0x0,_0xb0c448=0x0;for(const _0x2c7751 of this['sections']){const {resultsCount:_0x5e106f,totalItemsCount:_0x183043}=_0x2c7751['filter'](_0x59af59);_0x2df113+=_0x5e106f,_0xb0c448+=_0x183043;}return{'resultsCount':_0x2df113,'totalItemsCount':_0xb0c448};}}class yi extends _0x5e9d54{['title'];['itemsViews'];['_itemsListView'];constructor(_0x73324b,{title:_0x29062a,items:_0x7c6993}){super(_0x73324b);const _0x597bf6=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x29062a,this['itemsViews']=_0x7c6993;const _0x5061da=new _0x15a8cb(_0x73324b);_0x5061da['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x236991(_0x73324b),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x597bf6['if']('isVisible','ck-hidden',_0x28a3b7=>!_0x28a3b7)]},'children':[_0x5061da,this['_itemsListView']]});}['filter'](_0x3d13dc){const _0x1f5979=this['itemsViews']['length'];let _0xd113b3=0x0;for(const _0xd08a4f of this['itemsViews']){if(_0x3d13dc){const _0x252dc2=_0xd08a4f['isMatching'](_0x3d13dc);_0xd08a4f['isVisible']=!!_0x252dc2,_0xd08a4f['highlightText'](_0x3d13dc);}else _0xd08a4f['isVisible']=!0x0,_0xd08a4f['highlightText'](null);_0xd08a4f['isVisible']&&_0xd113b3++;}return this['isVisible']=_0xd113b3>0x0,{'resultsCount':_0xd113b3,'totalItemsCount':_0x1f5979};}['getItem'](_0x22cb2f){return this['itemsViews']['find'](_0x36d01d=>_0x36d01d['id']===_0x22cb2f);}['removeItem'](_0x54eb52){const _0x25eb6d=this['itemsViews']['indexOf'](_0x54eb52);-0x1!==_0x25eb6d&&(this['itemsViews']['splice'](_0x25eb6d,0x1),this['_itemsListView']['items']['remove'](_0x54eb52));}}class gi extends/* #__PURE__ -- @preserve */
27
- _0x52eed7(_0x5e9d54){['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(_0x34d89a,_0x284315){super(_0x34d89a);const _0x1d3926=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x284315['pinned']),this['set']('loadingState',null),this['id']=_0x284315['id'];const {title:_0x4f29b2,createdAt:_0x26dbc8,active:_0x443bf9=!0x1}=_0x284315;this['_titleView']=new _0x258b31(),this['_titleView']['text']=_0x4f29b2,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x54bdde=this['_createCheckView'](),_0xd8fda3=this['_createPinButtonView'](_0x34d89a),_0x32300e=this['_createMenuDropdownView'](),_0x267c2e=this['_createEditInputView'](_0x34d89a,_0x4f29b2),_0x47c8c3=this['_createAcceptEditButtonView'](_0x34d89a,_0x267c2e),_0x2dfb8c=this['_createCancelEditButtonView'](_0x34d89a,_0x267c2e);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0xd8fda3),this['actions']['add'](_0x32300e),this['on']('change:isEdit',(_0x46d317,_0x17cf0b,_0x1f5856)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x1f5856?(this['actions']['add'](_0x47c8c3),this['actions']['add'](_0x2dfb8c),this['mainContent']['add'](_0x267c2e),_0x267c2e['element']['focus']()):(this['actions']['add'](_0xd8fda3),this['actions']['add'](_0x32300e),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x443bf9?'ck-ai-chat-history__item--active':'',_0x1d3926['if']('isVisible','ck-hidden',_0x22cefb=>!_0x22cefb),_0x1d3926['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',_0x1d3926['if']('loadingState','ck-hidden',_0x53cd20=>!!_0x53cd20)]},'children':_0x443bf9?[_0x54bdde]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x1d3926['if']('loadingState','ck-hidden',_0x4741b5=>!_0x4741b5)]},'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',_0x1d3926['if']('loadingState','ck-hidden',_0x449c1d=>!!_0x449c1d)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x1d3926['if']('loadingState','ck-hidden',_0x5aa6a9=>!_0x5aa6a9)]},'children':[{'text':_0x1d3926['to']('loadingState',_0x174516=>_0x174516?i(this['locale'],gi['LOADING_LABELS'][_0x174516]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x26dbc8]}]},{'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'](_0x2bb2ff){this['_titleView']['text']=_0x1052a4(_0x2bb2ff);}['updateLoadingState'](_0x37b637,_0x4dc2f7){this['set']('loadingState',_0x4dc2f7?_0x37b637:null);}['_createCheckView'](){const _0x9468ff=new _0x2ae97e();return _0x9468ff['set']({'content':_0x1cd2e2}),_0x9468ff;}['_createPinButtonView'](_0x4cfc46){const _0x54b8c8=new _0x5bfd84(_0x4cfc46);return _0x54b8c8['set']({'label':i(_0x4cfc46,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x125ef8,'withText':!0x1,'tooltip':!0x0}),_0x54b8c8['bind']('isOn')['to'](this,'pinned'),_0x54b8c8['on']('execute',()=>{const _0x15a595=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x15a595});}),_0x54b8c8;}['_createMenuDropdownView'](){const _0x2ce2e5=_0x29ed58(this['locale'],_0x26095f),_0x555dd2=_0x2ce2e5['panelView']['children'];_0x2ce2e5['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x22e1a7}),_0x2ce2e5['panelPosition']='sw';const _0x5d0c70=new _0x5bfd84(this['locale']);_0x5d0c70['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x5d0c70['withText']=!0x0,_0x5d0c70['on']('execute',()=>{this['isEdit']=!0x0;});const _0x25d905=new _0x5bfd84(this['locale']);_0x25d905['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x25d905['withText']=!0x0,_0x25d905['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x106dd5=new _0x236991(this['locale']),_0x503888=new _0x5e9d54(this['locale']);_0x503888['children']['add'](_0x5d0c70);const _0x441b93=new _0x5e9d54(this['locale']);return _0x441b93['children']['add'](_0x25d905),_0x106dd5['items']['addMany']([_0x503888,_0x441b93]),_0x555dd2['add'](_0x106dd5),_0x2ce2e5;}['_createEditInputView'](_0x282e67,_0x62805e){const _0x50d41d=new _0x406518(_0x282e67),_0x532a94=_0x50d41d['bindTemplate'];return _0x50d41d['value']=_0x62805e,_0x50d41d['extendTemplate']({'on':{'keydown':_0x532a94['to'](_0x5bc677=>{'Enter'==_0x5bc677['key']&&this['_commitEditInputValue'](_0x50d41d);})}}),_0x50d41d;}['_createAcceptEditButtonView'](_0x2cbf1b,_0x77691a){const _0x3230bb=new _0x5bfd84(_0x2cbf1b);return _0x3230bb['set']({'icon':_0x1cd2e2,'withText':!0x1,'tooltip':i(_0x2cbf1b,'AI_CHAT_HISTORY_ACCEPT')}),_0x3230bb['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x3230bb['on']('execute',()=>{this['_commitEditInputValue'](_0x77691a);}),_0x3230bb;}['_commitEditInputValue'](_0x1caf88){const _0x59f612=_0x1caf88['element']['value']||'';this['_titleView']['text']=_0x59f612,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x59f612});}['_createCancelEditButtonView'](_0x765e5e,_0x1227d2){const _0x5a3bb6=new _0x5bfd84(_0x765e5e);return _0x5a3bb6['set']({'icon':_0x187b85,'withText':!0x1,'tooltip':i(_0x765e5e,'AI_CHAT_HISTORY_CANCEL')}),_0x5a3bb6['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x5a3bb6['on']('execute',()=>{this['isEdit']=!0x1,_0x1227d2['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x5a3bb6;}['_createSpinnerView'](){const _0x180076=new Ci('tiny');return _0x180076['isVisible']=!0x0,_0x180076;}['isMatching'](_0x3bedd1){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x3bedd1)?{'title':!0x0}:null;}['highlightText'](_0x3b3ec5){this['_titleView']['highlightText'](_0x3b3ec5);}}class It extends _0x15a8cb{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x264a20,_0x2423a3){super(_0x264a20),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x21de3c=new _0x2e3f47(_0x264a20,{'label':i(_0x264a20,'AI_CHAT_HISTORY_HEADING'),'icon':mt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x2423a3&&(this['resizeButton']=Ri(_0x264a20,this),_0x21de3c['children']['add'](this['resizeButton'])),this['sectionsView']=new bi(_0x264a20,[]),this['sectionsView']['delegate'](...Hi)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x155cd4=>!_0x155cd4)]}}),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':[_0x21de3c,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x2d5eac=new _0x230635(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x2f2309=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x2f2309),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x36ec84=this['_createErrorView']();return _0x36ec84['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x7a5f43=>!_0x7a5f43)]}}),_0x2d5eac['on']('render',()=>{_0x2d5eac['children']['add'](_0x36ec84,0x1);}),_0x2d5eac['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x569ff1=>!_0x569ff1)]}}),_0x2d5eac;}['_createSkeletonView'](){const _0x31924a=new Ei(this['locale'],Si['aiHistory']);return _0x31924a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x588a05=>!_0x588a05)]}}),_0x31924a;}['_createErrorView'](){const _0x48e658=new _0x15a8cb(this['locale']),_0x52214b=new _0x5bfd84(this['locale']);_0x52214b['set']({'withText':!0x1,'icon':_0x187b85,'class':'ck-ai-notification_error__dismiss-button'}),_0x52214b['bind']('isVisible')['to'](this,'hasItems',_0x5dd312=>!!_0x5dd312),_0x52214b['on']('execute',()=>{this['errorMessage']='';});const _0x513081=this['bindTemplate'];return _0x48e658['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x513081['to']('errorMessage')}]},_0x52214b]}),_0x48e658;}['_createEmptyStateView'](){const _0x139e5e=new _0x5bfd84(this['locale']);_0x139e5e['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x377ed9,'class':'ck-ai-chat__start-conversation'}),_0x139e5e['on']('execute',()=>{this['fire']('openChat');});const _0x10b44a=new _0x15a8cb(this['locale']);return _0x10b44a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x4b24cd=>!_0x4b24cd)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x139e5e]}),_0x10b44a;}['_createListItemViews'](_0x2a81f9,_0x3ff5aa){const _0x143ca5=[];for(const _0x142cfa of _0x2a81f9){const _0x49d2c2=new gi(_0x3ff5aa,_0x142cfa);_0x49d2c2['delegate'](...Hi)['to'](this),_0x143ca5['push'](_0x49d2c2);}return _0x143ca5;}['updateHistoryItemsWithCategories'](_0x29e722){const _0x5a0c5d=this['locale']||'en',_0x248409=[];for(const _0x509dea of _0x29e722){const _0x1a3378=this['_createListItemViews'](_0x509dea['items'],_0x5a0c5d);_0x248409['push'](new yi(_0x5a0c5d,{'title':_0x509dea['title'],'items':_0x1a3378}));}this['sectionsView']['sections']=_0x248409,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x248409),this['hasItems']=_0x29e722['some'](_0x5a6f2e=>_0x5a6f2e['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x5de28c){for(const _0x356943 of this['sectionsView']['sections']){const _0xcbc0bb=_0x356943['getItem'](_0x5de28c);if(_0xcbc0bb){if(_0x356943['removeItem'](_0xcbc0bb),0x0===_0x356943['itemsViews']['length']){const _0x4d3367=this['sectionsView']['sections']['indexOf'](_0x356943);-0x1!==_0x4d3367&&(this['sectionsView']['sections']['splice'](_0x4d3367,0x1),this['sectionsView']['items']['remove'](_0x356943));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5ed1d6,_0x1a0f8e){for(const _0x3f2401 of this['sectionsView']['sections']){const _0x2201bb=_0x3f2401['getItem'](_0x5ed1d6);if(_0x2201bb){_0x2201bb['updateTitle'](_0x1a0f8e);break;}}}['updateItemLoadingState'](_0x58c615,_0x494e73,_0x741c2e){for(const _0x4fec3d of this['sectionsView']['sections']){const _0xbbe3c3=_0x4fec3d['getItem'](_0x58c615);if(_0xbbe3c3){_0xbbe3c3['updateLoadingState'](_0x494e73,_0x741c2e);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x52d97f=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x52d97f);}}}const Hi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ct extends _0x118815{static get['requires'](){return[_t];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x36d0f8){super(_0x36d0f8);const _0x2d97ed=this['context']['plugins']['get']('AITabs');this['_historyView']=new It(this['context']['locale'],_0x2d97ed['showResizeButton']),this['_historyView']['delegate'](...Hi)['to'](this),_0x2d97ed['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':mt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0xd86a76){this['_historyView']['removeHistoryItem'](_0xd86a76);}['updateItems'](_0x295850){this['_historyView']['updateHistoryItemsWithCategories'](_0x295850);}['updateItemTitle'](_0x150407,_0x41d7e4){this['_historyView']['updateItemTitle'](_0x150407,_0x41d7e4);}['updateItemLoadingState'](_0x45aa4f,_0x1cdd2b,_0x312308){this['_historyView']['updateItemLoadingState'](_0x45aa4f,_0x1cdd2b,_0x312308);}['setLoadingSkeleton'](_0x490a38){this['_historyView']['isLoading']=_0x490a38;}['showError'](_0x1440ef){this['_historyView']['errorMessage']=_0x1440ef;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x26a727){this['_historyView']['isMaximized']=_0x26a727;}}class Ue extends ts(){['id'];['createdAt'];constructor({id:_0x488d0a,title:_0x3e6165,createdAt:_0x46eb2f,updatedAt:_0x1f283d,pinned:_0x1f2465}){super(),this['id']=_0x488d0a,this['createdAt']=new Date(_0x46eb2f),this['set']('title',_0x3e6165),this['set']('updatedAt',_0x1f283d?new Date(_0x1f283d):null),this['set']('pinned',_0x1f2465||!0x1);}['updateTitle'](_0x30e55a){this['set']('title',_0x1052a4(_0x30e55a)),this['updatedAt']=new Date();}['updatePinned'](_0x5539bd){this['set']('pinned',_0x5539bd),this['updatedAt']=new Date();}}class Tt extends _0x204e9f(){['items']=[];['connector'];['group'];constructor({connector:_0x1a94e6,group:_0x177757}){super(),this['connector']=_0x1a94e6,this['group']=_0x177757;}async['init'](){try{const _0x454a55=this['connector']['fetchConversations'](this['group']),_0x54d68a=await _0x454a55['getConversations']();this['loadItems'](_0x54d68a);}catch(_0x4aa0ab){this['fire']('error',{'error':_0x4aa0ab,'operation':'init'});}}['addItem'](_0x1a55aa){this['items']['push'](_0x1a55aa);}async['removeItem'](_0x3d00ce){const _0x46e526=this['items']['findIndex'](_0x3e847d=>_0x3e847d['id']===_0x3d00ce);if(-0x1===_0x46e526)return!0x1;try{return await this['connector']['deleteConversation'](_0x3d00ce)['execute'](),this['items']['splice'](_0x46e526,0x1),this['fire']('itemRemoved',{'itemId':_0x3d00ce}),!0x0;}catch(_0x36b4c){return this['fire']('error',{'error':_0x36b4c,'operation':'removeItem','itemId':_0x3d00ce}),!0x1;}}['getItem'](_0x59e4d8){return this['items']['find'](_0x4032a8=>_0x4032a8['id']===_0x59e4d8);}async['updateItemTitle'](_0x5b1481,_0x21918a){const _0xcc66c5=this['getItem'](_0x5b1481);if(!_0xcc66c5)return!0x1;try{return await this['connector']['updateConversation'](_0x5b1481,{'title':_0x21918a})['getResult'](),_0xcc66c5['updateTitle'](_0x21918a),this['fire']('itemUpdated',{'itemId':_0x5b1481,'updates':{'title':_0x21918a}}),!0x0;}catch(_0x449901){return this['fire']('error',{'error':_0x449901,'operation':'updateItemTitle','itemId':_0x5b1481}),!0x1;}}async['updateItemPinned'](_0x5abeb0,_0x2d728f){const _0x5e790f=this['getItem'](_0x5abeb0);if(!_0x5e790f)return!0x1;try{return await this['connector']['updateConversation'](_0x5abeb0,{'pinned':_0x2d728f})['getResult'](),_0x5e790f['updatePinned'](_0x2d728f),this['fire']('itemUpdated',{'itemId':_0x5abeb0,'updates':{'pinned':_0x2d728f}}),!0x0;}catch(_0x2fff69){return this['fire']('error',{'error':_0x2fff69,'operation':'updateItemPinned','itemId':_0x5abeb0}),!0x1;}}['loadItems'](_0x4b1879){try{this['items']=[],_0x4b1879['map'](_0x4d3ad0=>{this['addItem'](new Ue(_0x4d3ad0));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x143a39){this['fire']('error',{'error':_0x143a39,'operation':'loadItems'});}}['getItems'](_0x21acd5={}){const _0x16dc40=void 0x0!==_0x21acd5['pinned']&&_0x21acd5['pinned'],_0x67703c=_0x21acd5['from']?new Date(_0x21acd5['from']['getFullYear'](),_0x21acd5['from']['getMonth'](),_0x21acd5['from']['getDate']()):null,_0x9e3575=_0x21acd5['to']?new Date(_0x21acd5['to']['getFullYear'](),_0x21acd5['to']['getMonth'](),_0x21acd5['to']['getDate']()):null;return this['items']['filter'](_0x4860e7=>{if(_0x4860e7['pinned']!==_0x16dc40)return!0x1;if(_0x9e3575){const _0x18e944=new Date(_0x4860e7['createdAt']['getFullYear'](),_0x4860e7['createdAt']['getMonth'](),_0x4860e7['createdAt']['getDate']());return _0x67703c?_0x67703c['getTime']()===_0x9e3575['getTime']()?_0x18e944['getTime']()===_0x67703c['getTime']():_0x18e944<_0x9e3575&&_0x18e944>=_0x67703c:_0x18e944<_0x9e3575;}return!0x0;});}}class rt extends _0x118815{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[S,ht,ct,_t];}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'](ct),this['_aiChatController']=this['context']['plugins']['get'](ht);const _0x14216c=this['context']['plugins']['get'](_t);try{const _0x2c3f88=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x2c3f88}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x45e7d5,_0x33e423)=>{this['_setItemLoading'](_0x33e423['id'],'remove'),this['_handleRemove'](_0x33e423['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x4eddb1,_0x218b64)=>{this['_setItemLoading'](_0x218b64['id'],'rename'),this['_handleEditTitle'](_0x218b64['id'],_0x218b64['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x22e9fb,_0x3d91f4)=>{void 0x0!==_0x3d91f4['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x3d91f4['itemId'],_0x3d91f4['updates']['title']),void 0x0!==_0x3d91f4['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x3d91f4['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x302bdf,_0x1c3f80)=>{this['_aiChatController']['handleRemovedConversation'](_0x1c3f80['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x1c3f80['itemId']),this['_clearItemLoading'](_0x1c3f80['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x38e265,_0x3111df)=>{this['_handleHistoryErrorUI'](_0x3111df['error'],_0x3111df['operation'],_0x3111df['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x63c496,_0x873d2c)=>{this['_handleSelectConversation'](_0x873d2c['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x13b1cf,_0x27ac0e)=>{const _0x51365e=_0x27ac0e['pinned']?'pin':'unpin';this['_setItemLoading'](_0x27ac0e['id'],_0x51365e),this['_handleTogglePin'](_0x27ac0e['id'],_0x27ac0e['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x14216c['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x14216c['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x14216c,'resizedTabs',(_0x53d4a2,_0x5ba8f2)=>{this['_setIsMaximized'](_0x5ba8f2);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x14216c['resize']();});}catch(_0x4d9ec4){this['_handleHistoryErrorUI'](_0x4d9ec4,'init');}}async['_handleEditTitle'](_0x59a53b,_0x261d2b){await this['history']['updateItemTitle'](_0x59a53b,_0x261d2b);}async['_handleTogglePin'](_0x196541,_0x9a0723){await this['history']['updateItemPinned'](_0x196541,_0x9a0723);}async['_handleRemove'](_0xb79128){await this['history']['removeItem'](_0xb79128);}async['_handleSelectConversation'](_0x435cd0){await this['_aiChatController']['loadConversation'](_0x435cd0);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x1f29e5=this['_aiChatController']['activeConversation']?.['id'],_0x11db90=this['_getCategorizedItems']()['map'](_0x4be435=>({'title':_0x4be435['title'],'items':_0x4be435['items']['map'](_0x2bd0c5=>({'id':_0x2bd0c5['id'],'title':_0x2bd0c5['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x2bd0c5['createdAt'])['toLocaleDateString'](),'active':_0x2bd0c5['id']===_0x1f29e5,'pinned':_0x2bd0c5['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x11db90);}['_setItemLoading'](_0x3733d7,_0x2f20ee){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x3733d7,_0x2f20ee,!0x0);}['_clearItemLoading'](_0x473232){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x473232,null,!0x1);}['_handleHistoryErrorUI'](_0x31d605,_0x1e043d,_0x1c832b){const _0x28cbb3=this['_generateErrorMessage'](_0x1e043d,_0x1c832b);this['_aiChatHistoryUi']['showError'](_0x28cbb3),_0x1c832b&&this['_clearItemLoading'](_0x1c832b),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x31cbc4,_0x4c6d52){const _0xeee350=_0x4c6d52?this['history']['getItem'](_0x4c6d52):null,_0x106f94=_0xeee350?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x31cbc4){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x106f94);case'updateItemPinned':{const _0x2662c3=i(this['context']['locale'],_0xeee350?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x2662c3,_0x106f94]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x106f94);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x2ffa8f=new Date(),_0x5e66ed=new Date(_0x2ffa8f['getFullYear'](),_0x2ffa8f['getMonth'](),_0x2ffa8f['getDate']()),_0x5039e1=new Date(_0x5e66ed);_0x5039e1['setDate'](_0x5039e1['getDate']()-0x1);const _0x50399e=new Date(_0x5e66ed);_0x50399e['setDate'](_0x50399e['getDate']()-0xe);const _0x59ed68=this['history']['getItems']({'pinned':!0x0}),_0x1e8454=this['history']['getItems']({'from':_0x5e66ed,'to':_0x5e66ed}),_0xb07b55=this['history']['getItems']({'from':_0x5039e1,'to':_0x5039e1}),_0x490e89=this['history']['getItems']({'from':_0x50399e,'to':_0x5039e1}),_0x590742=this['history']['getItems']({'to':_0x50399e}),_0x6ef444=[];return _0x59ed68['length']>0x0&&_0x6ef444['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x59ed68}),_0x1e8454['length']>0x0&&_0x6ef444['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x1e8454}),_0xb07b55['length']>0x0&&_0x6ef444['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0xb07b55}),_0x490e89['length']>0x0&&_0x6ef444['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x490e89}),_0x590742['length']>0x0&&_0x6ef444['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x590742}),_0x6ef444;}['_setIsMaximized'](_0x4bedec){this['_aiChatHistoryUi']['setIsMaximized'](_0x4bedec);}}class gt extends _0x118815{static get['requires'](){return[rt,ct];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ua extends _0x118815{static get['requires'](){return[ht,D,ut,gt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ce502){super(_0x4ce502),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](ht)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](ht)['startConversation']();}async['sendMessage']({message:_0x38613e,attributes:_0x73face}){await this['context']['plugins']['get'](ht)['sendMessage']({'message':_0x38613e,'attributes':_0x73face});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](ht)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](ht)['focusPromptInput']();}['registerToolDataCallback'](_0x393701){this['context']['plugins']['get'](ht)['_registerToolDataCallback'](_0x393701);}}class cs extends _0x5bfd84{['id'];constructor(_0x3ced4f,_0x5e22d1){super(_0x3ced4f);const {id:_0x4a300d,type:_0x963232,icon:_0x124048}=_0x5e22d1;this['id']=_0x4a300d,this['set']({'label':_0x5e22d1['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x5e22d1['id']}}),_0x124048?this['icon']=_0x124048:'chat'===_0x963232?this['icon']=_0x294a94:'review'===_0x963232?this['icon']=_0x283d0c:'translate'===_0x963232&&(this['icon']=Vt);}}class lt extends _0x15a8cb{['listView'];constructor(_0x3400eb,_0x162af6){super(_0x3400eb);const _0x134dc0=_0x162af6['map'](_0x481696=>{const _0x4252e9=new _0x5e9d54(this['locale']),_0x4a989a=new cs(this['locale'],_0x481696);return _0x4252e9['children']['add'](_0x4a989a),_0x4a989a['delegate']('execute')['to'](this),_0x4252e9;});this['listView']=new _0x236991(this['locale']),this['listView']['items']['addMany'](_0x134dc0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const wt='chat-shortcuts';var Va=function(_0x47bec3){return _0x47bec3['CHAT']='chat',_0x47bec3['REVIEW']='review',_0x47bec3['TRANSLATE']='translate',_0x47bec3;}({});class Ba extends _0x118815{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ut];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ut),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x8a39ac=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x8a39ac['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x8a39ac,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x98aa41=Object['values'](Va);this['_shortcuts']['forEach'](_0x192d5d=>{let _0x5b5b22=!0x0;if(_0x192d5d['id']&&_0x192d5d['label']&&_0x98aa41['includes'](_0x192d5d['type'])?'chat'===_0x192d5d['type']&&(_0x5b5b22='string'==typeof _0x192d5d['prompt']):_0x5b5b22=!0x1,!_0x5b5b22)throw new _0x542443('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x192d5d});});}['_injectShortcuts'](){const _0x1180a8=this['context']['plugins']['get'](ut);this['_shortcutsView']=new lt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x1180a8['addFeedItemCustomElement'](this['_shortcutsView']['element'],wt),this['_shortcutsView']['on']('execute',_0x4d6b0a=>{const _0x54eb39=_0x4d6b0a['source']['id'];this['_executeShortcut'](_0x54eb39);});}['_removeShortcuts'](){const _0x35d98b=this['context']['plugins']['get'](ut);_0x35d98b['hasFeedItem'](wt)&&_0x35d98b['removeFeedItem'](wt),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x3567d3){const _0x5703ab=this['_shortcuts']['find'](_0x1cede0=>_0x1cede0['id']===_0x3567d3),_0x1ce228=_0x5703ab['type'];'chat'===_0x1ce228?this['_runChatShortcut'](_0x5703ab):'review'===_0x1ce228?_0x5703ab['check']?this['_runReviewShortcut'](_0x5703ab):this['_switchTab']('reviewMode'):'translate'===_0x1ce228&&(_0x5703ab['language']?this['_runTranslateShortcut'](_0x5703ab):this['_switchTab']('translate'));}['_switchTab'](_0x226b11){if(!this['context']['plugins']['has']('AITabs'))throw new _0x542443('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x226b11});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x226b11);}async['_runChatShortcut']({prompt:_0x19d8bb,draftMode:_0x2af67a,useWebSearch:_0x5d692f=!0x1,useReasoning:_0xca0829=!0x1,model:_0x166d5c}){const _0x364d4f=this['context']['plugins']['get']('AIChat'),_0x3e84b0=this['context']['plugins']['get']('AIChatController'),_0x3a2336=_0x3e84b0['activeConversation'];let _0x3a2cba;_0x3a2cba=_0x166d5c?await _0x3a2336['chatModels']['getModel'](_0x166d5c):await _0x3a2336['chatModels']['getDefault'](),_0x3a2cba&&await _0x3a2336['setModel'](_0x3a2cba),_0x3a2336['setWebSearch'](_0x5d692f),_0x3a2336['setReasoning'](_0xca0829),_0x3e84b0['addCurrentDocumentToChatContext'](),_0x2af67a?(this['_aiChatUI']['setPromptInputValue'](_0x19d8bb),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x364d4f['sendMessage']({'message':_0x19d8bb});}['_runReviewShortcut']({check:_0x2ebb2c,model:_0x295c16,prompt:_0x113fdb,params:_0x54eaaa}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x542443('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x4e7bfd={'id':_0x2ebb2c,'isCustom':'custom'===_0x2ebb2c};_0x295c16&&_0x113fdb&&(_0x4e7bfd['args']={'model':_0x295c16,'prompt':_0x113fdb}),_0x54eaaa&&(_0x4e7bfd['params']=_0x54eaaa),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x4e7bfd);}['_runTranslateShortcut']({language:_0x4a0b01}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x542443('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x4a0b01,'args':{'language':_0x4a0b01}});}}class Oi extends Ut{constructor(_0x4d7bd9){super(_0x4d7bd9);const _0x295a0e=_0x4d7bd9['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x295a0e,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x4f6340=this['editor']['plugins']['get']('AITabs')['view'];_0x4f6340['isVisible']=!_0x4f6340['isVisible'];}}class jt extends _0x241f5a{static get['requires'](){return[_t];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x30d2a8=this['editor'];_0x30d2a8['commands']['add']('toggleAi',new Oi(_0x30d2a8)),_0x30d2a8['ui']['componentFactory']['add']('toggleAi',()=>{const _0x179f03=this['_createAIUIButton'](_0x5bfd84);return _0x179f03['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x179f03;}),_0x30d2a8['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x4545dc=this['_createAIUIButton'](_0x302890);return _0x4545dc['set']({'role':'menuitemcheckbox'}),_0x4545dc;});}['_createAIUIButton'](_0x468170){const _0x32f80a=this['editor'],_0x17e21c=_0x32f80a['commands']['get']('toggleAi'),_0x1d7b70=new _0x468170(_0x32f80a['locale']);return _0x1d7b70['set']({'label':i(_0x32f80a['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x57100f,'isToggleable':!0x0}),_0x1d7b70['bind']('isEnabled')['to'](_0x17e21c),_0x1d7b70['bind']('isOn')['to'](_0x17e21c,'value',_0x4bb19d=>!!_0x4bb19d),this['listenTo'](_0x1d7b70,'execute',()=>{_0x17e21c['execute']();}),_0x1d7b70;}}const nt=['applySuggestion','insertSuggestion','showNext','showPrevious'];class gs extends _0x15a8cb{['_errorView'];constructor(_0x2c370a){super(_0x2c370a),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x45c5dd){this['showError'](_0x45c5dd);}['showError'](_0x35bce4){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x35bce4,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x33298b=new _0x15a8cb(this['locale']),_0x3b139d=new _0x15a8cb(this['locale']);return _0x3b139d['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x33298b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x528bfd=>!_0x528bfd)]},'children':[_0x3b139d]}),_0x33298b;}}const at=0xa;class P extends _0x118815{static get['requires'](){return[D];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x5000d2){const {id:_0x275389}=this['_currentConfig']??{};this['_currentConfig']=_0x5000d2;const {id:_0x554ef3}=this['_currentConfig'];this['isOpen']&&_0x275389===_0x554ef3?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x586abb=et(this['context'])['plugins']['get']('Dialog');_0x586abb['isOpen']&&this['_currentConfig']&&_0x586abb['id']===this['_currentConfig']['id']&&_0x586abb['hide']();}['_updateDialog'](){const _0x300edf=et(this['context'])['plugins']['get']('Dialog'),{icon:_0x474148,title:_0x499059}=this['_currentConfig'];_0x300edf['view']?.['headerView']&&(_0x300edf['view']['headerView']['label']=_0x499059,_0x300edf['view']['headerView']['iconView']&&_0x474148&&(_0x300edf['view']['headerView']['iconView']['content']=_0x474148)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x300edf['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x463077){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x463077);}['_showDialog'](){const _0x33e43c=et(this['context'])['plugins']['get']('Dialog'),{id:_0x2db0e3,title:_0x196ae2,icon:_0x536808,class:_0x1635a4,mainView:_0x40f63a}=this['_currentConfig'];_0x40f63a['delegate'](...nt)['to'](this),_0x33e43c['show']({'title':_0x196ae2,'icon':_0x536808,'hasCloseButton':!0x0,'id':_0x2db0e3,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x1635a4||''),'content':_0x40f63a,'onShow':_0x53fc87=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x16b417=this['_getSelectionElements']();_0x16b417&&_0x16b417[0x0]&&st({'target':_0x16b417[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x53fc87['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x2db0e3});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x2db0e3}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0xe701c2,_0x2030f0){if(!_0x2030f0)return null;const _0x52caf1=this['_getSelectionElements']();if(!_0x52caf1||0x0===_0x52caf1['length'])return{'left':Math['round'](_0x2030f0['left']+_0x2030f0['width']/0x2-_0xe701c2['width']/0x2),'top':Math['round'](_0x2030f0['top']+_0x2030f0['height']/0x2-_0xe701c2['height']/0x2)};const _0x1a4e2b=Math['round'](_0x2030f0['left']+_0x2030f0['width']/0x2-_0xe701c2['width']/0x2),_0x4e3b67=_0x52caf1['map'](_0x2f0c22=>new ot(_0x2f0c22)),_0x16e3ba=_0xe701c2['height'];return{'left':_0x1a4e2b,'top':this['_calculateOptimalTopPosition'](_0x4e3b67,_0x16e3ba,_0x2030f0)};}['_calculateOptimalTopPosition'](_0x574b16,_0x26ca02,_0x1f5fee){const _0x366826=new ot(it['window']),_0x253e73=_0x574b16['map'](_0x4873fb=>_0x4873fb['getVisible']())['filter'](_0x2936f8=>_0x2936f8),_0x448ea5=ot['getBoundingRect'](_0x253e73);if(!_0x448ea5)return Math['round'](_0x1f5fee['top']+_0x1f5fee['height']/0x2);const _0x5b6e5b=_0x366826['getIntersection'](_0x448ea5);if(!_0x5b6e5b)return Math['round'](_0x1f5fee['top']+_0x1f5fee['height']/0x2);const _0x3ebf3a=_0x1f5fee['getVisible'](),_0xea870f=_0x3ebf3a&&_0x448ea5['height']>_0x3ebf3a['height'],_0x15c6f3=_0x5b6e5b['top'],_0x455f7b=_0x5b6e5b['bottom'];if(_0xea870f){const _0x599617=(_0x3ebf3a||_0x366826)['height']/0x2-_0x26ca02/0x2,_0x5a5736=_0x15c6f3-at-_0x1f5fee['top'],_0x5c4eea=_0x1f5fee['bottom']-_0x455f7b-at;return _0x5a5736>=_0x26ca02?Math['max'](at,_0x15c6f3-_0x26ca02-at):_0x5c4eea>=_0x26ca02?_0x455f7b+at:Math['max'](at,_0x599617);}const _0x450f1c=_0x15c6f3-_0x26ca02,_0x1c50d8=_0x1f5fee['bottom']-_0x455f7b-at,_0x288de5=_0x15c6f3-at-_0x1f5fee['top'];let _0x388453;if(_0x1c50d8>=_0x26ca02)_0x388453=_0x455f7b+at;else{if(_0x288de5>=_0x26ca02)_0x388453=_0x450f1c-at;else _0x388453=_0x15c6f3+_0x448ea5['height']/0x2-_0x26ca02/0x2;}return _0x388453;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x4122a9=et(this['context']);this['listenTo'](_0x4122a9['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x5610af,data:{newRange:_0xd52d3b}}of _0x4122a9['model']['document']['differ']['getChangedMarkers']())if(_0x5610af['startsWith'](F+':')&&(_0xd52d3b&&(_0xd52d3b['start']['isEqual'](_0xd52d3b['end'])||'$graveyard'==_0xd52d3b['root']['rootName'])||null==_0xd52d3b)){const _0x5e9f94=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x5e9f94),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x243f35=et(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x243f35['model']['document']);}['_getSelectionElements'](){const _0x449bad=et(this['context']);return tt(_0x449bad['editing'],[..._0x449bad['model']['markers']['getMarkersGroup']('ai-selection'),..._0x449bad['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class ls extends _0x3da665{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x6a3945,_0x3931ea={}){super(_0x6a3945),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3931ea};const _0x38f536=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x38f536?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x548dc4){this['showChangesButton']['isEnabled']=_0x548dc4;}['_setupRatingButtons'](){this['likeButton']=new _0x5bfd84(this['locale']),this['likeButton']['set']({'icon':_0x502ea4,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x5bfd84(this['locale']),this['dislikeButton']['set']({'icon':_0x4cfb74,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x5bfd84(this['locale']),this['copyButton']['set']({'icon':_0x2f6fb4,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x582c9b=new _0x2ae97e();_0x582c9b['set']({'content':_0x15208f}),_0x582c9b['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'](_0x582c9b);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x5bfd84(this['locale']),this['showChangesButton']['set']({'icon':_0x43cdc5,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':'ck-ai-button-tertiary'}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x2c9868=>_0x2c9868?_0x5e9a92:_0x43cdc5),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class ft extends gs{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x4ee821,_0x395db5){super(_0x4ee821);const _0x42d18a=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x510dfd(),this['_keystrokes']=new _0x394cf5(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x5a99d2({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x395db5,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new as(_0x4ee821),this['_partToolbarView']=new us(_0x4ee821,_0x395db5['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x395db5),this['_stateView']=new ps(_0x4ee821),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ls(_0x4ee821,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fs(_0x4ee821,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x41ebfb,_0x206930,_0x25ca7a,_0xc56624)=>{let _0xd582bc,_0x5c156e;'pending'===_0xc56624?(_0xd582bc=this['_partToolbarView'],_0x5c156e=this['_stateView']):(_0xd582bc=this['_stateView'],_0x5c156e=this['_partToolbarView']),this['_stateView']['setState'](_0x25ca7a),_0xd582bc['isVisible']=!0x1,_0x5c156e['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x42d18a['to']('_state',_0x1c24da=>'ck-ai-chat-balloon-main_state_'+_0x1c24da)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x395db5);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0xa24499){_0xa24499?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0xa24499);}['setState'](_0x503883){this['_state']=_0x503883;}['showError'](_0x20eeab){super['showError'](_0x20eeab),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x56b023){super['showBlockingError'](_0x56b023),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x475cec){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x475cec;}['togglePartToolbarEnabled'](_0xd5f4a8){this['_partToolbarView']['isEnabled']=_0xd5f4a8;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x14aa11,showSuggestButton:_0x38fe25}){_0x14aa11=_0x14aa11&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x38fe25=_0x38fe25&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x14aa11,'showSuggestButton':_0x38fe25});}['_createNextButtonView'](){const _0x99c3d5=new _0x5bfd84(this['locale']);return _0x99c3d5['set']({'icon':_0x1ee736,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x99c3d5['on']('execute',()=>{this['fire']('showNext');}),_0x99c3d5;}['_createPreviousButtonView'](){const _0x57911f=new _0x5bfd84(this['locale']);return _0x57911f['set']({'icon':_0x5c42c1,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x57911f['on']('execute',()=>{this['fire']('showPrevious');}),_0x57911f;}}class fs extends _0x15a8cb{constructor(_0x79055c,_0x5a2a23){super(_0x79055c),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x5a2a23});}}class kt extends _0x241f5a{static get['requires'](){return[_0x1017f8,P];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x5c67b1){super(_0x5c67b1),this['set']('showDiff',!0x1);}['open'](_0xba9ca7){const _0x28c33d=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x28c33d['plugins']['get']('AIBalloon')['open']({..._0xba9ca7,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0xba9ca7['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0xba9ca7['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x100f72){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x100f72);}['setState'](_0x518613){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x518613);}['_createChatBalloonView'](){const _0x1ca56c=this['editor'],_0x40c45d=_0x1ca56c['plugins']['get']('AIBalloon'),_0x1865b5=_0x1ca56c['commands']['get']('trackChanges');let _0x51b781=_0x1ca56c['config']['get']('ai.availableReplyActions')||[...X];_0x1ca56c['plugins']['has']('TrackChanges')||(_0x51b781=_0x51b781['filter'](_0x4be9ea=>'insertSuggestion'!=_0x4be9ea));const _0x4fb5ba=new ft(_0x1ca56c['locale'],{'availableActions':_0x51b781,'showApplyButton':!0x0,'showSuggestButton':!!_0x1865b5});return _0x4fb5ba['bind']('showDiff')['to'](this),_0x4fb5ba['delegate'](...pt)['to'](this),_0x4fb5ba['delegate']('showPrevious','showNext')['to'](this),_0x40c45d['delegate']('dialogClosed')['to'](this),_0x4fb5ba['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4fb5ba['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4fb5ba['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x1865b5&&_0x4fb5ba['bind']('isTrackChangesOn')['to'](_0x1865b5,'value'),_0x4fb5ba['render'](),_0x4fb5ba;}['_toggleRotatorButtonsInDialogHeader'](_0x555e4d){const _0x250d13=this['editor'],_0x4c0071=_0x250d13['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x555e4d),_0x4c0071['has'](this['_chatBalloonView']['previousButtonView'])||(_0x4c0071['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x250d13['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x4c0071['remove'](this['_chatBalloonView']['previousButtonView']),_0x4c0071['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ga extends _0x241f5a{static get['requires'](){return[jt,kt,qt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0xe83400){const {editor:_0xf259b8,action:_0x298662,withText:_0x223583=!0x1,withIcon:_0x419b88=!0x0,isInDropdown:_0x596a51=!0x0,shouldPreventFocus:_0x1bad04=!0x1}=_0xe83400;return()=>{const _0x1423cf=_0xf259b8['locale'],_0x289cc6=new _0x5bfd84(_0x1423cf),_0x4c99f7=_0x289cc6['bindTemplate'];_0x596a51&&_0x289cc6['extendTemplate']({'on':{'mouseenter':_0x4c99f7['to'](()=>{_0x1bad04&&_0x1bad04()||_0x289cc6['focus']();})}});const _0x3ae7ae=_0x298662['icon']??_0x298662['parent']?.['icon'];return _0x289cc6['set']({'label':_0x298662['displayedPrompt'],'withText':_0x223583,'role':'menuitem','icon':_0x419b88?_0x3ae7ae??_0x9e3e58:void 0x0,'tooltip':!_0x223583,'class':'ck-ai-quick-actions-button','isEnabled':_0x298662['isEnabled']}),_0x289cc6['on']('execute',()=>{_0xf259b8['editing']['view']['focus'](),_0xf259b8['commands']['execute']('aiQuickAction',_0x298662);}),_0x289cc6;};}class Gs extends _0x1426e0{['arrowView'];constructor(_0x2a0eb2,_0x2abb50){super(_0x2a0eb2,_0x2abb50);const _0x1bf1dc=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0xbf5b21=>String(_0xbf5b21)),'data-cke-tooltip-disabled':_0x1bf1dc['to']('isOn')},'on':{'mouseenter':_0x1bf1dc['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x562d61=new _0x2ae97e();return _0x562d61['content']=_0x4e1794,_0x562d61['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x562d61;}}class Ks extends _0x236991{['_allListItems'];['_allSearchableItems'];constructor(_0x506d75,_0x32d632,_0x3b15c5){super(_0x506d75),this['_allListItems']=_0x32d632,this['_allSearchableItems']=_0x3b15c5;}['filter'](_0x40c247){if(!_0x40c247)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x21927e=_0x40c247['source']['toLowerCase']()['trim'](),_0x52d822=this['_allSearchableItems']['filter'](_0x7e9e09=>(_0x7e9e09['groupLabel']?_0x7e9e09['label']+'\x20('+_0x7e9e09['groupLabel']+')':_0x7e9e09['label'])['toLowerCase']()['includes'](_0x21927e));return this['items']['clear'](),this['items']['addMany'](_0x52d822['sort']((_0x30e92f,_0x1da65f)=>{const _0x1c2e23=_0x30e92f['groupLabel'],_0x26df3f=_0x1da65f['groupLabel'];return _0x1c2e23||_0x26df3f?_0x1c2e23?0x1:-0x1:0x0;})['map'](_0x512e3e=>_0x512e3e['item'])),this['_highlightQuery'](_0x21927e,_0x52d822),{'resultsCount':_0x52d822['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x440c49,_0x1b88c5){if(!_0x440c49)return;const _0x483cd7=new RegExp(_0x249f4a(_0x440c49),'gi');_0x1b88c5['forEach'](_0x14ce78=>{_0x14ce78['highlightViews']&&_0x14ce78['highlightViews']['forEach'](_0x561bb4=>{'function'==typeof _0x561bb4['highlightText']&&_0x561bb4['highlightText'](_0x483cd7);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x185d11=>{_0x185d11['highlightViews']&&_0x185d11['highlightViews']['forEach'](_0x467d46=>{'function'==typeof _0x467d46['highlightText']&&_0x467d46['highlightText'](null);});});}}const Os='menu',Hs='menuitem';class io extends _0x15a8cb{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x60c6d2,_0x4423ae,_0x2b747e,_0x2bfe35,_0x5c2de7=!0x1){const _0x5c4c5a=_0x60c6d2['locale'];super(_0x5c4c5a),this['_bodyCollection']=_0x2bfe35,this['_hasSearch']=_0x5c2de7;const _0x57c661=this['_createListItems'](_0x60c6d2,_0x4423ae,_0x2b747e);this['optionsListView']=new Ks(_0x5c4c5a,_0x57c661,this['_allSearchableItems']),this['optionsListView']['role']=Os,this['optionsListView']['items']['addMany'](_0x57c661),this['focusTracker']=new _0x510dfd(),this['keystrokes']=new _0x394cf5(),_0x5c2de7&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x57c661,this['focusCycler']=new _0x5a99d2({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x5c2de7&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x1d6d7f=_0x5c2de7&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x152ab6(_0x1d6d7f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x5c4c5a['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x230635(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x363a5a=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x363a5a);}['_createListItems'](_0x59b8f4,_0x1b5859,_0x4d232d){const _0x5c43f1=new _0x152ab6();return _0x1b5859['forEach'](_0x5cbd70=>{if('actions'in _0x5cbd70){const {listItem:_0x40c46f}=this['_createActionGroupButton'](_0x59b8f4,_0x5cbd70,_0x4d232d);_0x5c43f1['add'](_0x40c46f),_0x5cbd70['actions']['forEach'](_0x54a4e8=>{this['_createActionButton'](_0x59b8f4,_0x54a4e8,_0x5cbd70['label'],_0x5cbd70['icon']);const {listItem:_0x5e8125,highlightViews:_0x56ffa5}=this['_createSearchResultActionButton'](_0x59b8f4,_0x54a4e8,_0x5cbd70['label'],_0x5cbd70['icon']);this['_allSearchableItems']['push']({'item':_0x5e8125,'label':_0x54a4e8['displayedPrompt'],'groupLabel':_0x5cbd70['label'],'highlightViews':_0x56ffa5});});}else{const {listItem:_0x315d8e}=this['_createActionButton'](_0x59b8f4,_0x5cbd70);_0x5c43f1['add'](_0x315d8e);const _0x3a2532=_0x315d8e['children']['first'];if(_0x3a2532){const {listItem:_0x2f5a39,highlightViews:_0x337cab}=this['_createSearchResultActionButton'](_0x59b8f4,_0x5cbd70);this['_allSearchableItems']['push']({'item':_0x2f5a39,'label':_0x3a2532['label']||'','highlightViews':_0x337cab});}}}),_0x5c43f1;}['_createActionButton'](_0x27293c,_0x348a07,_0x5f068b,_0x25731a){const _0x50a97a=new _0x5e9d54(this['locale']);if(_0x5f068b&&_0x25731a){const _0x5e0189=new _0x5bfd84(this['locale']),_0x39c745=_0x5e0189['bindTemplate'],_0x34cfda=new _0x258b31();_0x34cfda['text']=_0x348a07['displayedPrompt'];const _0x50bf57=new _0x258b31();_0x50bf57['text']=_0x5f068b;const _0xd00484=new _0x2ae97e();_0xd00484['content']=_0x25731a,_0xd00484['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x3f9284=new _0x15a8cb(this['locale']);_0x3f9284['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x147363=new _0x15a8cb(this['locale']);return _0x147363['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x5e0189['set']({'label':_0x348a07['displayedPrompt']+'\x20('+_0x5f068b+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x5e0189['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x34cfda,_0x3f9284,_0xd00484,_0x50bf57,_0x147363],'on':{'mouseenter':_0x39c745['to'](()=>{this['_isSearchFocused']()||_0x5e0189['focus']();}),'click':_0x39c745['to'](()=>{_0x5e0189['fire']('execute');})}}),_0x5e0189['on']('execute',()=>{_0x27293c['editing']['view']['focus'](),_0x27293c['commands']['execute']('aiQuickAction',_0x348a07);}),_0x50a97a['children']['add'](_0x5e0189),{'listItem':_0x50a97a,'highlightViews':[_0x34cfda,_0x50bf57]};}{const _0x36764a=new _0x5d3d48(),_0x1b6825=new _0x5bfd84(this['locale'],_0x36764a),_0x142e5d=_0x1b6825['bindTemplate'],_0x27820a=_0x348a07['icon']??_0x348a07['parent']?.['icon'],_0x5bc248=void 0x0!==_0x348a07['icon'];return _0x1b6825['set']({'label':_0x348a07['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x5bc248?_0x27820a??_0x9e3e58:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x1b6825['extendTemplate']({'on':{'mouseenter':_0x142e5d['to'](()=>{this['_isSearchFocused']()||_0x1b6825['focus']();})}}),_0x1b6825['on']('execute',()=>{_0x27293c['editing']['view']['focus'](),_0x27293c['commands']['execute']('aiQuickAction',_0x348a07);}),_0x50a97a['children']['add'](_0x1b6825),{'listItem':_0x50a97a,'highlightViews':[_0x36764a]};}}['_createSearchResultActionButton'](_0x5f2c95,_0x2c63a1,_0x5850b2,_0x1de86b){return _0x5850b2&&_0x1de86b?this['_createSearchResultGroupedActionButton'](_0x5f2c95,_0x2c63a1,_0x5850b2,_0x1de86b):this['_createSearchResultIndividualActionButton'](_0x5f2c95,_0x2c63a1);}['_createSearchResultGroupedActionButton'](_0x5619b5,_0x250eef,_0x2d20c3,_0x1111f3){const _0x305619=new _0x5e9d54(this['locale']),_0xa39168=new _0x5bfd84(this['locale']),_0x1c6eef=_0xa39168['bindTemplate'],{view:_0x557be6,highlightView:_0x41793c}=this['_createSearchResultGroupRow'](_0x2d20c3,_0x1111f3),{view:_0xfe6e30,highlightView:_0x23fde5}=this['_createSearchResultActionRow'](_0x250eef['displayedPrompt']),_0x24807b=this['_createSearchResultContentView'](_0x557be6,_0xfe6e30);return _0xa39168['set']({'label':_0x250eef['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0xa39168['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x24807b],'on':{'mouseenter':_0x1c6eef['to'](()=>{this['_isSearchFocused']()||_0xa39168['focus']();}),'click':_0x1c6eef['to'](()=>{this['_handleSearchResultButtonClick'](_0xa39168);})}}),this['_setupActionButtonExecution'](_0xa39168,_0x5619b5,_0x250eef),_0x305619['children']['add'](_0xa39168),{'listItem':_0x305619,'highlightViews':[_0x41793c,_0x23fde5]};}['_createSearchResultIndividualActionButton'](_0xc7ad29,_0x363bd3){const _0x1f6cb5=new _0x5e9d54(this['locale']),_0x397dfe=new _0x5d3d48(),_0x5a6ca0=new _0x5bfd84(this['locale'],_0x397dfe),_0x3dfe4e=_0x5a6ca0['bindTemplate'];return _0x5a6ca0['set']({'label':_0x363bd3['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5a6ca0['extendTemplate']({'on':{'mouseenter':_0x3dfe4e['to'](()=>{this['_isSearchFocused']()||_0x5a6ca0['focus']();})}}),this['_setupActionButtonExecution'](_0x5a6ca0,_0xc7ad29,_0x363bd3),_0x1f6cb5['children']['add'](_0x5a6ca0),{'listItem':_0x1f6cb5,'highlightViews':[_0x397dfe]};}['_createSearchResultGroupRow'](_0x474118,_0x262b65){const _0xf8155b=new _0x15a8cb(this['locale']),_0x4b71b8=new _0x2ae97e();_0x4b71b8['content']=_0x262b65,_0x4b71b8['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x54fd9f=new _0x258b31();return _0x54fd9f['text']=_0x474118,_0xf8155b['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x4b71b8,_0x54fd9f]}),{'view':_0xf8155b,'highlightView':_0x54fd9f};}['_createSearchResultActionRow'](_0x5fe5df){const _0x397acd=new _0x15a8cb(this['locale']),_0x3cf971=new _0x258b31();return _0x3cf971['text']=_0x5fe5df,_0x397acd['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x3cf971]}),{'view':_0x397acd,'highlightView':_0x3cf971};}['_createSearchResultContentView'](_0x3e8f08,_0x2516f9){const _0x46ce63=new _0x15a8cb(this['locale']);return _0x46ce63['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x3e8f08,_0x2516f9]}),_0x46ce63;}['_setupActionButtonExecution'](_0x171f09,_0x464923,_0x5e8c60){_0x171f09['on']('execute',()=>{_0x464923['editing']['view']['focus'](),_0x464923['commands']['execute']('aiQuickAction',_0x5e8c60);});}['_createActionGroupButton'](_0x18279a,_0x246ccd,_0x1ba767){const _0x30357a=new _0x5e9d54(this['locale']),_0xff95ef=new _0x5d3d48(),_0x4841c2=new Gs(this['locale'],_0xff95ef),_0x5f47ef=_0x4841c2['bindTemplate'],_0x4c84e7=this['_getPanelKeystroke'](_0x1ba767),_0xe20302=this['_createGroupActionsList'](_0x18279a,_0x246ccd['actions'],_0x1ba767);_0x4841c2['set']({'label':_0x246ccd['label'],'withText':!0x0,'role':Hs,'icon':_0x246ccd['icon']??_0x9e3e58,'isEnabled':_0x246ccd['actions']['some'](_0x2beb50=>_0x2beb50['isEnabled'])}),_0x4841c2['extendTemplate']({'on':{'mouseenter':_0x5f47ef['to'](()=>{this['_isSearchFocused']()||_0x4841c2['focus']();})}});const _0x15a61d=new _0x1ddc71(this['locale']);return _0x15a61d['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x5f47ef['to'](_0x565a34=>{this['_handlePanelKeydown'](_0x565a34,_0x4c84e7,_0x4841c2,_0x15a61d);})}}),_0x4841c2['bind']('isOn')['to'](_0x15a61d,'isVisible'),this['_bodyCollection']['add'](_0x15a61d),_0x15a61d['content']['add'](_0xe20302),this['_setupGroupMenuBehavior'](_0x4841c2,_0x15a61d),_0x30357a['children']['add'](_0x4841c2),{'listItem':_0x30357a,'highlightView':_0xff95ef};}['_createGroupActionsList'](_0x5e591d,_0x2b39bc,_0x5e3948){const _0x22e2e1=new _0x236991(this['locale']);return _0x22e2e1['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x2b39bc['forEach'](_0x2d361b=>{const _0x408758=new _0x5e9d54(this['locale']),_0x50ab90=Zt({'editor':_0x5e591d,'action':_0x2d361b,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x408758['children']['add'](_0x50ab90),_0x5e3948['focusTracker']['add'](_0x50ab90),_0x22e2e1['items']['add'](_0x408758);}),_0x22e2e1;}['_setupGroupMenuBehavior'](_0x239d5a,_0x36a664){const _0x1b5dae=_0x239d5a['bindTemplate'],_0x431f82=this['_getButtonKeystroke'](_0x239d5a);_0x239d5a['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x1b5dae['to'](()=>{this['_showNestedPanel'](_0x36a664,_0x239d5a);}),'mouseleave':_0x1b5dae['to'](_0x4be345=>{const _0x2dab31=_0x4be345['relatedTarget'];this['_isMovingToNestedMenu'](_0x2dab31,_0x36a664)||this['_hideNestedPanel'](_0x36a664);}),'keydown':_0x1b5dae['to'](_0x2c3855=>{_0x2c3855['key']==_0x431f82&&(this['_showNestedPanel'](_0x36a664,_0x239d5a),_0x36a664['content']['get'](0x0)['focus']());})}}),_0x36a664['on']('render',()=>{_0x36a664['element']?.['addEventListener']('mouseleave',_0x5f3fd9=>{const _0x653cdd=_0x5f3fd9['relatedTarget'];_0x239d5a['element']?.['contains'](_0x653cdd)||this['_isMovingToNestedMenu'](_0x653cdd,_0x36a664)||this['_hideNestedPanel'](_0x36a664);});});}['_showNestedPanel'](_0x3fb2d2,_0x3f9d3a){this['_openNestedPanels']['forEach'](_0x41a87d=>{_0x41a87d!==_0x3fb2d2&&_0x41a87d['isVisible']&&_0x41a87d['hide']();}),_0x3fb2d2['show'](),_0x3fb2d2['pin']({'positions':[_0x50490e['eastSouth']],'target':_0x3f9d3a['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3fb2d2);}['_hideNestedPanel'](_0x1ad042){_0x1ad042['hide'](),this['_openNestedPanels']['delete'](_0x1ad042);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x5b5f9f=>_0x5b5f9f['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5f08ba,_0x4cd646){if(!_0x5f08ba)return!0x1;if(_0x4cd646['element']?.['contains'](_0x5f08ba))return!0x0;const _0x3b524b=_0x5f08ba;return _0x3b524b['closest']&&(null!==_0x3b524b['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x3b524b['closest']('.ck-ai-quick-actions-group-list')||null!==_0x3b524b['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x26c628){return'rtl'===_0x26c628['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x521971){return'rtl'===_0x521971['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4e69cf,_0x80b345,_0x10f542,_0x309d57){_0x4e69cf['key']==_0x80b345&&(_0x10f542['focus'](),this['_hideNestedPanel'](_0x309d57));}['_handleSearchResultButtonClick'](_0x26c4f1){_0x26c4f1['fire']('execute');}}function Xt(_0x10244f){const {editor:_0x3da1aa,content:_0x1259d8,buttonDefinition:_0x41deed,bodyCollection:_0xf3e83,hasSearch:_0x4e4863=!0x1}=_0x10244f;return()=>{const _0x5a62f9=_0x3da1aa['locale'],_0x4d4a28=_0x29ed58(_0x5a62f9);_0x4d4a28['buttonView']['set']({'icon':_0x41deed['icon']??_0x9e3e58,'label':_0x41deed['label'],'tooltip':!0x0}),_0x4d4a28['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x4f204b=new io(_0x3da1aa,_0x1259d8,_0x4d4a28,_0xf3e83,_0x4e4863);if(_0x4d4a28['panelView']['children']['add'](_0x4f204b),_0x4e4863){const _0x5e9240='ai-quick-actions-dropdown-selection';_0x4d4a28['on']('change:isOpen',(_0x5447f7,_0x231443,_0xffaf6c)=>{if(_0xffaf6c){if(_0x3da1aa['plugins']['has']('AIEditing')){const _0x2469c5=_0x3da1aa['plugins']['get'](D),_0x4c4a60=_0x3da1aa['model']['document']['selection'],_0x2e725c=Array['from'](_0x4c4a60['getRanges']());_0x2e725c['length']>0x0&&_0x2469c5['showFakeVisualSelection'](_0x2e725c,_0x5e9240,!0x1,!0x0);}}else _0x3da1aa['plugins']['has']('AIEditing')&&_0x3da1aa['plugins']['get'](D)['hideFakeVisualSelection'](_0x5e9240),_0x4f204b['resetSearch']();});}return _0x4d4a28;};}const ee='<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>',ie='<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>',ne='<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 Qt=function(_0xe2d05b){return _0xe2d05b['CHAT']='CHAT',_0xe2d05b['ACTION']='ACTION',_0xe2d05b['REVIEW']='REVIEW',_0xe2d05b;}({}),Fa=function(_0xa458a1){return _0xa458a1['CHAT']='AIChat',_0xa458a1['ACTION']='AIActions',_0xa458a1['REVIEW']='AIReviewMode',_0xa458a1;}({});class ii extends _0x241f5a{static get['requires'](){return[te,S];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x156fe0=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x156fe0),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x4f6ea3){return function(_0x45e295){const _0x4cbda8=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x45e295['uiLanguage']),_0x285977=_0x4cbda8||'English',_0x173076=[{'id':'ask-ai','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x45e295,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x285977),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x285977),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x285977),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':zt},{'id':'fix-grammar','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x45e295,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x45e295,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x45e295,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x45e295,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x173076;}(_0x4f6ea3);}async['_getDefaultAndCustomActions'](){const _0x458bcb=ii['getDefaultQuickActions'](this['editor']['locale']),_0x2cee48=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x5ed8f6=[];try{_0x5ed8f6=await new At({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0xfadfc7){const _0xfce7af=new _0x542443('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0xfadfc7});Ct(_0xfce7af['message']);}finally{const _0x5b330b=_0x2cee48['map'](_0x23e8ed=>({..._0x23e8ed,'icon':void 0x0}));_0x458bcb['find'](_0x49a643=>'other'===_0x49a643['id'])['actions']['push'](..._0x5b330b),_0x458bcb['forEach'](_0x583f34=>{if('actions'in _0x583f34)_0x583f34['actions']['forEach'](_0x2f9ffa=>{if(_0x2f9ffa['isEnabled']=!!_0x5ed8f6['find'](_0xda7a3b=>_0xda7a3b['id']===_0x2f9ffa['model'])||void 0x0===_0x2f9ffa['model'],!_0x2f9ffa['isEnabled']){const _0xf97189=new _0x542443('ai-quick-actions-unavailable-model',this,{'actionId':_0x2f9ffa['id'],'modelId':_0x2f9ffa['model']});Ct(_0xf97189['message']);}});else{if(_0x583f34['isEnabled']=!!_0x5ed8f6['find'](_0xa13d21=>_0xa13d21['id']===_0x583f34['model'])||void 0x0===_0x583f34['model'],!_0x583f34['isEnabled']){const _0x378c3c=new _0x542443('ai-quick-actions-unavailable-model',this,{'actionId':_0x583f34['id'],'modelId':_0x583f34['model']});Ct(_0x378c3c['message']);}}});}return _0x458bcb;}['_initializeQuickActionsComponentsAndCommands'](){const _0x577107=new _0x49fddd(this['editor']['locale']);_0x577107['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x577107),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x577107);}['_initializeQuickActionsDropdown'](_0x9111fb){const _0x5351fc=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x9e3e58,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x9111fb,'hasSearch':_0x5351fc}));}['_prepareQuickActionsDefinition'](_0x57745f){this['_quickActionsDefinition']=_0x57745f['map'](_0xc489d1=>{if('actions'in _0xc489d1){const _0xad905e=_0xc489d1;return{..._0xad905e,'actions':_0xad905e['actions']['map'](_0x32e0fb=>{const {actions:_0x1acec6,..._0x4cb01a}=_0xad905e;return{..._0x32e0fb,'parent':_0x4cb01a};})['filter'](_0x24745a=>this['_shouldIncludeAction'](_0x24745a))};}return _0xc489d1;})['filter'](_0x20a8cb=>'actions'in _0x20a8cb?_0x20a8cb['actions']['length']>0x0:this['_shouldIncludeAction'](_0x20a8cb));}['_shouldIncludeAction'](_0x24ad18){const _0x508438=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Fa[_0x24ad18['type']])&&!_0x508438['includes'](_0x24ad18['id'])&&!('CHAT'===_0x24ad18['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x45e768){this['_quickActionsDefinition']['forEach'](_0x32b7f8=>{if('actions'in _0x32b7f8){const _0x465f96=Xt({'editor':this['editor'],'content':_0x32b7f8['actions'],'buttonDefinition':_0x32b7f8,'bodyCollection':_0x45e768});this['editor']['ui']['componentFactory']['add'](_0x32b7f8['id'],_0x465f96),_0x32b7f8['actions']['forEach'](_0x472d21=>{const _0x1cee99=Zt({'editor':this['editor'],'action':_0x472d21});this['editor']['ui']['componentFactory']['add'](_0x472d21['id'],_0x1cee99);});}else{const _0x376ff2=Zt({'editor':this['editor'],'action':_0x32b7f8,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x32b7f8['id'],_0x376ff2);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x382dae=>{const _0x3eec1e=new _0x538ac7(_0x382dae),_0x506302=i(_0x382dae,'AI_QUICK_ACTIONS_HEADING');_0x3eec1e['buttonView']['set']({'label':_0x506302,'icon':_0x9e3e58});const _0x123bb2=new _0x255377(_0x382dae);_0x123bb2['set']({'ariaLabel':_0x506302,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x16e5ef=>{if('actions'in _0x16e5ef){const _0x3951db=_0x16e5ef,_0x251fb4=new _0x199d14(_0x382dae,_0x3eec1e),_0x2fd67c=new _0x538ac7(_0x382dae),_0x4c5cdc=new _0x255377(_0x382dae);_0x2fd67c['buttonView']['set']({'label':_0x3951db['label'],'icon':_0x3951db['icon']}),_0x3951db['actions']['forEach'](_0x4b36d1=>{const _0x56d783=new _0x199d14(_0x382dae,_0x2fd67c),_0x55aa5b=new _0x302890(_0x382dae);_0x55aa5b['set']({'label':_0x4b36d1['displayedPrompt'],'icon':_0x4b36d1['icon'],'role':'menuitem','isEnabled':_0x4b36d1['isEnabled']}),_0x55aa5b['on']('execute',()=>{this['_executeQuickAction'](_0x4b36d1);}),_0x55aa5b['delegate']('execute')['to'](_0x2fd67c),_0x56d783['children']['add'](_0x55aa5b),_0x4c5cdc['items']['add'](_0x56d783);}),_0x2fd67c['panelView']['children']['add'](_0x4c5cdc),_0x251fb4['children']['add'](_0x2fd67c),_0x123bb2['items']['add'](_0x251fb4);}else{const _0x25575d=_0x16e5ef,_0x1ecdac=new _0x199d14(_0x382dae,_0x3eec1e),_0x9c3922=new _0x302890(_0x382dae);_0x9c3922['set']({'label':_0x25575d['displayedPrompt'],'icon':_0x25575d['icon'],'role':'menuitem','isEnabled':_0x25575d['isEnabled']}),_0x9c3922['on']('execute',()=>{this['_executeQuickAction'](_0x25575d);}),_0x9c3922['delegate']('execute')['to'](_0x3eec1e),_0x1ecdac['children']['add'](_0x9c3922),_0x123bb2['items']['add'](_0x1ecdac);}});const _0x42d2b1=Object['values'](Fa)['some'](_0x183897=>this['editor']['plugins']['has'](_0x183897));return _0x3eec1e['set']({'isEnabled':_0x42d2b1}),_0x3eec1e['panelView']['children']['add'](_0x123bb2),_0x3eec1e;});}['_executeQuickAction'](_0x3087aa){const _0x2c1cd9=this['editor'];_0x2c1cd9['editing']['view']['focus'](),_0x2c1cd9['commands']['execute']('aiQuickAction',_0x3087aa);const _0x1511f6=_0x2c1cd9['ui']['view']['menuBarView'];_0x1511f6&&_0x1511f6['close']&&_0x1511f6['close']();}}class ci extends Ut{['execute'](_0x25ad06){switch(this['_expandSelectionIfCollapsed'](),_0x25ad06['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x441303=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x542443('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x441303});}this['_handleAIChatAction'](_0x25ad06);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x1d10ba=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x542443('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1d10ba});}this['_handleAIActionsAction'](_0x25ad06);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x9218e5=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x542443('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x9218e5});}this['_handleAIReviewAction'](_0x25ad06);}}async['_handleAIChatAction'](_0x5985b6){const _0x2efa56=this['editor']['plugins']['get']('AIChat'),_0x28363f=this['editor']['plugins']['get']('AIChatController'),_0xb748f4=this['editor']['plugins']['get']('AITabs')['view'];if(_0xb748f4['isVisible']||(_0xb748f4['isVisible']=!0x0),'chat'!==_0xb748f4['activeTab']&&_0xb748f4['activateTab']('chat'),'ask-ai'===_0x5985b6['id'])_0x28363f['removeSelectionFromChatContext'](),await _0x2efa56['addSelectionToChatContext'](),_0x2efa56['focusPromptInput']();else await _0x2efa56['startConversation'](),_0x28363f['removeSelectionFromChatContext'](),await _0x2efa56['addSelectionToChatContext'](),_0x2efa56['focusPromptInput'](),await _0x2efa56['sendMessage']({'message':_0x5985b6['prompt']||_0x5985b6['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x5985b6['id']},'displayedPrompt':_0x5985b6['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x546c58=this['editor'],_0x2e2d0f=_0x546c58['model']['document']['selection'];if(!_0x2e2d0f['isCollapsed'])return;const _0xbee00c=_0xd78d7(_0x2e2d0f['getSelectedBlocks']())||_0x546c58['model']['schema']['getLimitElement'](_0x2e2d0f);_0x546c58['model']['change'](_0x59a072=>{_0x59a072['setSelection'](_0xbee00c,'in');});}['_handleAIActionsActionLabel'](_0x2f7252){return _0x2f7252['parent']?.['label']&&'other'!==_0x2f7252['parent']?.['id']?_0x2f7252['parent']['label']+':\x20'+_0x2f7252['displayedPrompt']:_0x2f7252['displayedPrompt'];}async['_handleAIActionsAction'](_0x1829ae){const _0x64dd19=this['editor']['plugins']['get']('AIActions'),_0x3efd0a=_0x1829ae['prompt']?{'userMessage':_0x1829ae['prompt'],'model':_0x1829ae['model']}:{'actionName':_0x1829ae['actionName']||_0x1829ae['id'],'args':_0x1829ae['args']},_0x55a142=this['_handleAIActionsActionLabel'](_0x1829ae);await _0x64dd19['executeAction'](_0x3efd0a,_0x55a142,_0x1829ae['icon']);}async['_handleAIReviewAction'](_0x5b7cf9){console['log']('handleAIReviewAction',_0x5b7cf9);}}class ti extends _0x241f5a{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x16994f=this['editor'],_0x5c9a2c=new ci(this['editor']);if(_0x16994f['commands']['add']('aiQuickAction',_0x5c9a2c),_0x16994f['plugins']['has']('AIChat')){const _0x50a820=this['editor']['plugins']['get']('AIChat');_0x16994f['model']['document']['selection']['on']('change:range',(_0x9b873c,_0xcde5b1)=>{_0xcde5b1['directChange']&&_0x50a820['removeSelectionFromChatContext']();});}}}class De extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x52624a=this['documentContextContent']['children']['map'](_0x114d37=>({'node':_0x114d37,'id':Ot(_0x114d37,'data-id')})),_0x4b6e3f=this['parsedMergedContent']['children']['map'](_0x439138=>({'node':_0x439138,'id':Ot(_0x439138,'data-id')||_0x2e2dc8()})),_0x33a4c0=_0x57cf13(_0x52624a,_0x4b6e3f,{'comparator':(_0x240e6f,_0x5099ad)=>_0x240e6f['id']==_0x5099ad['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x33a4c0['length']&&_0x33a4c0[_0x33a4c0['length']-0x1]['removed'];)_0x33a4c0['pop']();}const _0x59b358=_0x33a4c0['map'](_0x500299=>{const _0x2fd7a4=_0x500299['added']?'new':_0x500299['removed']?'removed':'modified';return{'node':_0x500299['value'][0x0]['node'],'type':_0x2fd7a4,'id':_0x500299['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x59b358,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x3db51b,_0x4a4817){return _0x4a4817;}}class O extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x53dc2c){super(_0x53dc2c),this['content']=_0x53dc2c['content'],this['version']=_0x53dc2c['version'],this['actionName']=_0x53dc2c['actionName'],this['args']=_0x53dc2c['args'],this['userMessage']=_0x53dc2c['userMessage'],this['model']=_0x53dc2c['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':qe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x43d206){const _0x2b8260=new De({'editor':this['editor'],'documentContextContent':this['content'],..._0x43d206});return this['replies']['push'](_0x2b8260),_0x2b8260['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x2b8260),_0x2b8260;}}class Bn extends _0x3da665{constructor(_0x43025c,_0x30f256=!0x0,_0x169668=!0x0){super(_0x43025c),this['set']('isEnabled',!0x1),_0x30f256&&(this['applyButton']=this['_createButton'](i(_0x43025c,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x169668&&(this['suggestButton']=this['_createButton'](i(_0x43025c,'AI_BALLOON_SUGGEST_BUTTON'),_0x30f256?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x30f256,'showSuggestButton':_0x169668}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x4b6368,showSuggestButton:_0x33691f}){this['applyButton']&&(this['applyButton']['isVisible']=_0x4b6368),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x33691f);}['_createButton'](_0x1b2cf1,_0x128474){const _0x32adaa=new _0x5bfd84(this['locale']);return _0x32adaa['set']({'label':_0x1b2cf1,'class':_0x128474,'isVisible':!0x0,'withText':!0x0}),_0x32adaa;}}class yn extends _0x15a8cb{constructor(_0x59cbf4){super(_0x59cbf4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0x59cbf4,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x15a8cb{constructor(_0x52411e){super(_0x52411e),this['set']('isVisible',!0x0);const _0x4d11ff=new Ci('small');_0x4d11ff['isVisible']=!0x0;const _0x504cb1=new _0x15a8cb(this['locale']);_0x504cb1['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x118750=>!_0x118750)]},'children':[_0x4d11ff,_0x504cb1]});}}class Y extends gs{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x4e9418,_0x4014df){super(_0x4e9418),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x4014df,this['_focusTracker']=new _0x510dfd(),this['_keystrokes']=new _0x394cf5(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x5a99d2({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x152ab6(),this['_addContentWrapper'](_0x4014df),this['_addDisclaimerView'](),this['_addToolbar'](_0x4014df),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x4014df);});}['render'](){super['render']();for(const _0x5d7fc4 of this['_focusables'])this['_focusTracker']['add'](_0x5d7fc4['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x26f494){-0x1===_0x26f494?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x1cc3dc){this['_isLoading']=_0x1cc3dc;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x1bc689){super['showError'](_0x1bc689),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x524d15){super['showBlockingError'](_0x524d15),this['setErrorState']();}['addMiniToolbarItem'](_0x540ee2){this['_miniToolbarView']['items']['has'](_0x540ee2)||this['_miniToolbarView']['items']['add'](_0x540ee2);}['removeMiniToolbarItem'](_0x3dd82e){this['_miniToolbarView']['items']['has'](_0x3dd82e)&&this['_miniToolbarView']['items']['remove'](_0x3dd82e);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0xf3e4d6,showSuggestButton:_0x43dbbc}){_0xf3e4d6=_0xf3e4d6&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x43dbbc=_0x43dbbc&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0xf3e4d6,'showSuggestButton':_0x43dbbc});}async['updateContent'](_0x3f7411){await this['_streamableContentView']['update'](_0x3f7411);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x89153f){this['_contentWrapper']=new _0x15a8cb(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x89153f['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x384657,showSuggestButton:_0x5edf84}){this['_toolbarView']=new Bn(this['locale'],_0x384657,_0x5edf84),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x1b62cb,_0x11d849,_0xb595d4)=>!(_0x1b62cb||_0x11d849||_0xb595d4)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x384657,'showSuggestButton':_0x5edf84}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x15c9c0){return this['_miniToolbarView']=new ls(this['locale'],_0x15c9c0),this['_miniToolbarView']['delegate'](...pt)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x1acdcf,_0x4b259f)=>!(_0x1acdcf||_0x4b259f)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new as(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x1ad18f=new _0x5bfd84(this['locale']),_0x5b01e6=new _0x5bfd84(this['locale']),_0x8e91e5=new Ln(this['locale']),_0x52889e=new _0x5bfd84(this['locale']);_0x1ad18f['set']({'icon':_0x5c8076,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x5b01e6['set']({'icon':_0x3c7600,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x52889e['set']({'icon':_0x40af26,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x1ad18f['bind']('isEnabled')['to'](this,'isBusy',_0x5172c7=>!_0x5172c7),_0x1ad18f['on']('execute',()=>{this['fire']('tryAgain');}),_0x5b01e6['bind']('isEnabled')['to'](this,'isBusy',_0x27d36c=>!_0x27d36c),_0x5b01e6['on']('execute',()=>{this['fire']('showPrevious');}),_0x52889e['bind']('isEnabled')['to'](this,'isBusy',_0x4edfe7=>!_0x4edfe7),_0x52889e['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x5b01e6,this['_navigationCounter']=_0x8e91e5,this['_navigationNextButton']=_0x52889e,this['_navigationTryAgainButton']=_0x1ad18f;}['updateMiniToolbarButtons'](_0x5c7f5f,_0x152e34){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x512c38=_0x5c7f5f>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x512c38){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x1f7993=_0x5c7f5f-_0x152e34;this['_navigationCounter']['setInteractionCount'](_0x1f7993+'/'+_0x5c7f5f),this['_navigationPreviousButton']['isEnabled']=_0x152e34<_0x5c7f5f-0x1,this['_navigationNextButton']['isEnabled']=_0x152e34>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x5156d3){this['_isLoading']=_0x5156d3;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x371b64=this['_getScrollableElement']();_0x371b64&&!this['_scrollManager']&&(this['_scrollManager']=new $e(_0x371b64));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x15a8cb{constructor(_0x5ac5d2){super(_0x5ac5d2);const _0x524e94=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x524e94['to']('interactionCount')}]});}['setInteractionCount'](_0x1600df){this['set']('interactionCount',_0x1600df);}}class ri extends _0x241f5a{static get['requires'](){return[S,_0x1017f8,D,P,_0x143aa3];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x2bd0c2){super(_0x2bd0c2),this['_bodyCollection']=new _0x49fddd(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new N();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x34fb15,_0x168f3c,_0x1765c3){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x3d8ee6,anchorData:_0x3e00e3}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x34fb15,_0x3d8ee6,_0x3e00e3,_0x168f3c,_0x1765c3);}}const {modelFragment:_0x1736fc,anchorData:_0x490407}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x34fb15,_0x1736fc,_0x490407,_0x168f3c,_0x1765c3);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x2edb71=this['editor']['plugins']['has']('TrackChanges');let _0x1eed19=this['editor']['config']['get']('ai.availableReplyActions')||[...X];_0x2edb71||(_0x1eed19=_0x1eed19['filter'](_0x90ed83=>'insertSuggestion'!=_0x90ed83));const _0x22230f=this['editor']['commands']['get']('trackChanges'),_0xb4def4=new Y(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x2edb71,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1eed19});return _0xb4def4['bind']('isBusy')['to'](this),_0x22230f&&_0xb4def4['bind']('isTrackChangesOn')['to'](_0x22230f,'value'),_0xb4def4['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0xb4def4['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0xb4def4['on']('showNext',()=>{this['_navigateToNext']();}),_0xb4def4;}['_getExecuteDataRegular'](){const _0x33c927=this['editor']['model']['document']['selection'];if(_0x33c927['isCollapsed']){const _0x2856dd=_0xd78d7(_0x33c927['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x33c927);this['editor']['model']['change'](_0x595bbe=>{_0x595bbe['setSelection'](_0x2856dd,'in');});}const _0x56b8ca=_0x33c927['getFirstRange'](),_0x243d68=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x33c927),_0x56b8ca['start'],_0x56b8ca['end']);this['_copyMarkersToFragment'](_0x243d68,_0x33c927,{'isTableSelection':!0x1});const _0x35152c=_0x33c927['getFirstRange']()['start'],_0x17eda2=new Map();let _0x106d21=_0x243d68;for(let _0x76b51=0x0;_0x76b51<_0x35152c['path']['length'];_0x76b51++)_0x17eda2['set'](_0x106d21,_0x35152c['path'][_0x76b51]),_0x106d21=_0x106d21['getChild'](0x0);return{'modelFragment':_0x243d68,'anchorData':_0x17eda2};}['_getExecuteDataInTable'](){const _0x375365=this['editor']['model']['document']['selection'],_0x384639=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x2e090c=_0x375365['getFirstRange']()['start']['parent']['parent'],_0x41c10d=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x2e090c),this['editor']['model']['createPositionAfter'](_0x2e090c)),_0x592aa9=this['_wrapWithCommonAncestors'](_0x384639,_0x41c10d['start'],_0x41c10d['end']);this['_copyMarkersToFragment'](_0x592aa9,_0x375365,{'isTableSelection':!0x0});const _0x1f8def=_0x375365['getFirstRange']()['start'],_0x415ea6=new Map();let _0x25142c=_0x592aa9;for(let _0x4f1e56=0x0;_0x4f1e56<_0x1f8def['path']['length'];_0x4f1e56++)if(_0x415ea6['set'](_0x25142c,_0x1f8def['path'][_0x4f1e56]),_0x4f1e56<_0x1f8def['path']['length']-0x1)_0x25142c=_0x25142c['getChild'](0x0);else{let _0x104dac=_0x25142c['nextSibling'];for(;_0x104dac;)_0x415ea6['set'](_0x104dac,_0x1f8def['path'][_0x4f1e56]),_0x104dac=_0x104dac['nextSibling'];}return{'modelFragment':_0x592aa9,'anchorData':_0x415ea6};}async['_executeAction'](_0x10b13d,_0x1e9a10,_0x524f35,_0x21e879,_0x50646c){const _0x599ccf=this['editor']['plugins']['get'](D),_0xdd69f6=this['editor']['plugins']['get'](P),_0x25f694=this['editor']['model']['document']['selection'],_0x452940=await _0x599ccf['modelToDataWithIds'](_0x1e9a10),_0x143900=this['editor']['model']['document']['version'],_0x536ea8=[..._0x25f694['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0xdd69f6['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x21e879,'icon':_0x50646c||_0x9e3e58,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x536ea8,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xdd69f6),this['_interactionParams']={'action':_0x10b13d,'content':_0x452940,'version':_0x143900,'aiBalloon':_0xdd69f6,'modelFragment':_0x1e9a10,'anchorData':_0x524f35},this['_setupApplyListeners'](),this['listenTo'](_0xdd69f6,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0xdd69f6,'dialogClosed',(_0x508780,{id:_0xe95c31})=>{if('aiActionsBalloon'===_0xe95c31){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x4bf8b1=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x24b318=_0x4bf8b1['changeGroups'][0x0];_0x24b318&&'pending'===_0x24b318['state']&&_0x4bf8b1['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xdd69f6);}}),this['_createInteraction'](_0x452940,_0x143900,_0xdd69f6,_0x10b13d);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0xd4966b,anchorData:_0x4c0636}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0xd4966b,_0x4c0636,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0xd4966b,_0x4c0636,!0x0);});}['_wrapWithCommonAncestors'](_0x4232ed,_0x5a03e0,_0x156026){const _0x5c78a6=this['editor']['model']['createRange'](_0x5a03e0,_0x156026)['getCommonAncestor'](),_0x4a49b7=_0x5c78a6['is']('documentFragment')?[]:_0x5c78a6['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x4a49b7['length']){const _0x1f17b4=_0x4a49b7['map'](_0x23b81b=>_0x23b81b['_clone'](!0x1));for(let _0x7deb36=0x1;_0x7deb36<_0x1f17b4['length'];_0x7deb36++)_0x1f17b4[_0x7deb36-0x1]['_appendChild'](_0x1f17b4[_0x7deb36]);return _0x1f17b4[_0x1f17b4['length']-0x1]['_appendChild'](_0x4232ed),new _0x53b4ba(_0x1f17b4[0x0]);}return _0x4232ed;}['_copyMarkersToFragment'](_0x3a2118,_0x3d1074,_0x13cc87={'isTableSelection':!0x1}){const _0x3c9dea=this['editor']['model'],_0x14fe50=Array['from'](_0x3d1074['getRanges']()),_0x28eb77=_0x3d1074['getFirstRange']()['start'];for(const _0x2dcf23 of _0x3c9dea['markers']){if(_0x2dcf23['name']['startsWith'](F)||!_0x2dcf23['affectsData'])continue;const _0x464b8d=_0x2dcf23['getRange']();if(!_0x14fe50['some'](_0x14f34d=>_0x14f34d['containsRange'](_0x464b8d,!0x0)))continue;const _0x34ca49=this['_regularCalculateMarkerPath'](_0x464b8d['start'],_0x28eb77,_0x13cc87['isTableSelection']),_0x2d56f5=this['_regularCalculateMarkerPath'](_0x464b8d['end'],_0x28eb77,_0x13cc87['isTableSelection']),_0xe694c=_0x3c9dea['createPositionFromPath'](_0x3a2118,_0x34ca49),_0x4d0ebe=_0x3c9dea['createPositionFromPath'](_0x3a2118,_0x2d56f5);if(!_0xe694c['isEqual'](_0x4d0ebe)){const _0x1cd719=_0x3c9dea['createRange'](_0xe694c,_0x4d0ebe);_0x3a2118['markers']['set'](_0x2dcf23['name'],_0x1cd719);}}}['_regularCalculateMarkerPath'](_0x2642c0,_0x5e6f8c,_0x1ef1b2=!0x1){const _0x30d9ac=[..._0x2642c0['path']['slice']()];for(let _0x50c082=0x0;_0x50c082<Math['max'](_0x5e6f8c['path']['length'],_0x2642c0['path']['length']);_0x50c082++){const _0x199646=_0x5e6f8c['path'][_0x50c082]||0x0,_0xa908dd=(_0x2642c0['path'][_0x50c082]||0x0)-_0x199646;if(_0x30d9ac[_0x50c082]=_0xa908dd,0x0!==_0xa908dd&&!_0x1ef1b2)break;}return _0x30d9ac;}async['_createInteraction'](_0x5d2703,_0x46633a,_0x21e1af,_0x689ae7){const _0x28ea18=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x689ae7,'content':_0x5d2703,'version':_0x46633a,'aiBalloon':_0x21e1af,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x213acb=new O({'connector':this['_aiConnector'],'editor':_0x28ea18,'content':_0x5d2703,'version':_0x46633a,..._0x689ae7});this['_interactions']['push'](_0x213acb);const _0xd208ce=(_0x7753b2,_0x459e9f=!0x1,_0x13fc7d='streaming')=>this['_promiseQueue']['enqueue'](async _0xb8ede0=>{try{const _0x5205b4=q({'editor':_0x28ea18,'changeGroups':_0x7753b2['changeGroups'],'documentContextContent':_0x7753b2['documentContextContent'],'showDiff':_0x459e9f,'trimUnchanged':!0x1});_0x5205b4['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x5205b4[0x0],'renderingStrategy':_0x13fc7d,'abortSignal':_0xb8ede0});}catch(_0x322db3){if(this['_isAbortError'](_0x322db3))return;throw _0x322db3;}});this['_interaction']['on']('replyCreated',(_0x191016,_0xb69bdb)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0xd208ce(_0xb69bdb)['catch'](_0x185bfd=>{this['_isAbortError'](_0x185bfd)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x185bfd),this['_setErrorState'](_0x213acb));});}),this['_interaction']['on']('replyContentUpdated',(_0xfb8a3d,_0x36c728)=>{_0xd208ce(_0x36c728)['catch'](_0x3e2dfb=>{this['_isAbortError'](_0x3e2dfb)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x3e2dfb),this['_setErrorState'](_0x213acb));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x89ea30){this['_isAbortError'](_0x89ea30)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x89ea30),this['_setErrorState'](_0x213acb));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x5a6049,{showDiff:_0x162fc5})=>{try{this['_balloonShowDiff']=_0x162fc5;const _0x1f5db5=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x1f5db5&&await _0xd208ce(_0x1f5db5,_0x162fc5,'static');}catch(_0xab8263){this['_isAbortError'](_0xab8263)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0xab8263),this['_setErrorState'](_0x213acb));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x2380a1,{reply:_0x3462af})=>{const _0x5c839e={'positiveCount':_0x3462af['changeGroups']['filter'](_0xe1a40f=>'accepted'===_0xe1a40f['state'])['length'],'totalCount':_0x3462af['changeGroups']['length']},_0x3b2083=this['_interaction']['actionCallId'],_0x5a7dfb=this['_interaction']['actionName'];_0x5a7dfb?this['_aiConnector']['upsertAIActionRating'](_0x5a7dfb,_0x3b2083,_0x5c839e):this['_aiConnector']['upsertCustomAIActionRating'](_0x3b2083,_0x5c839e);}),this['_setLoadingState']();try{const _0x513612=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x513612;}catch(_0x59fb4b){if(this['_isAbortError'](_0x59fb4b))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x213acb);}}['_applyChanges'](_0x2117ed,_0x5d9e93,_0x30e5fd){const _0x14f38=this['editor'];if(_0x30e5fd&&!_0x14f38['plugins']['has']('TrackChanges'))throw new _0x542443('ai-no-track-changes',null);const _0x134999=this['editor']['plugins']['get'](_0x143aa3),_0x5f4edf=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5f4edf||!_0x5f4edf['replies']['length'])return;const _0x40aebd=_0x5f4edf['replies'][_0x5f4edf['replies']['length']-0x1],_0x27eb9c=_0x40aebd['changeGroups'];_0x40aebd['setChangeGroupState'](0x0,'accepted');let _0x4dee70=W({'editor':_0x14f38,'reply':_0x40aebd,'interaction':_0x5f4edf,'groups':_0x27eb9c,'transform':!0x1,'documentCompare':_0x134999,'documentCompareOptions':{'anchor':_0x14f38['model']['createPositionAt'](_0x2117ed,0x0),'markDeletions':_0x30e5fd}});_0x4dee70=this['_filterOperationsOutsideRange'](_0x4dee70,_0x5d9e93);for(const _0x3ce5be of _0x4dee70)this['_anchorOperation'](_0x5d9e93,_0x3ce5be,_0x14f38['model']['document']['getRoot']());const _0x3047f4=_0x5f4edf['getDocumentContext']()['version'],_0x2411d9=_0x14f38['model']['document']['history']['getOperations'](_0x3047f4),_0x37f811={'document':_0x14f38['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4ff422=_0x359a53(_0x4dee70,_0x2411d9,_0x37f811)['operationsA'];_0x14f38['model']['change'](_0x37bc18=>{if(_0x37bc18['setSelection'](_0x14f38['model']['document']['selection']['focus']),_0x30e5fd)_0x14f38['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4ff422);else{for(const _0x148ee5 of _0x4ff422)_0x148ee5['baseVersion']=_0x14f38['model']['document']['version'],V(_0x14f38,_0x148ee5),_0x37bc18['batch']['addOperation'](_0x148ee5),_0x14f38['model']['applyOperation'](_0x148ee5);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x41cb67,_0x13a322){return _0x41cb67['filter'](_0x38758f=>{if('rename'==_0x38758f['type']){const _0x3346df=_0x38758f['position']['nodeAfter'];return!_0x13a322['has'](_0x3346df);}if(_0x38758f['type']['indexOf']('Attribute')>-0x1){const _0x45268d=_0x38758f['range']['start']['nodeAfter'];return!_0x13a322['has'](_0x45268d);}return!0x0;});}['_anchorOperation'](_0x28bd41,_0x5aaab3,_0x3022f5){const _0x296425=_0x5aaab3['clone']();for(const _0x114f14 in _0x5aaab3){const _0x5b0e50=_0x5aaab3[_0x114f14];_0x5b0e50 instanceof _0x561be6?_0x5aaab3[_0x114f14]=new _0x561be6(_0xc2cc67(_0x5b0e50['start']),_0xc2cc67(_0x5b0e50['end'])):_0x5b0e50 instanceof _0x18c733&&(_0x5aaab3[_0x114f14]=_0xc2cc67(_0x5b0e50));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x296425['type'])){if(_0x296425['isDocumentOperation']=!0x1,_0x296425['baseVersion']=null,'remove'==_0x296425['type']){const _0x4f7ffb=_0x296425['sourcePosition'],_0x2c7286=_0x296425['howMany'];new _0x5de5b5(_0x4f7ffb,_0x2c7286)['_execute']();}else _0x296425['_execute']();}function _0xc2cc67(_0x391049){if('$graveyard'==_0x391049['root']['rootName'])return _0x391049;const _0x1b374b=[];let _0x3872d5=_0x391049['root'];for(let _0xfa79d7=0x0;_0xfa79d7<_0x391049['path']['length'];_0xfa79d7++){const _0x28a24e=_0x28bd41['get'](_0x3872d5)||0x0;_0x1b374b[_0xfa79d7]=_0x391049['path'][_0xfa79d7]+_0x28a24e,_0x3872d5=_0x3872d5['getChildAtOffset'](_0x391049['path'][_0xfa79d7]);}return new _0x18c733(_0x3022f5,_0x1b374b,_0x391049['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x5e5daf,content:_0xc019a7,version:_0x4feb60,aiBalloon:_0x531728}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0xc019a7,_0x4feb60,_0x531728,_0x5e5daf)['catch'](_0x3bb612=>{this['_isAbortError'](_0x3bb612)||console['error']('Error\x20refreshing\x20interaction:',_0x3bb612);});}['_isAbortError'](_0x48cad0){return!!_0x48cad0['message']&&_0x48cad0['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x4a8817=this['_interactions']['length'];this['_currentInteractionIndex']<_0x4a8817-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x3c9f81){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x3c9f81;const _0xa57e0=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0xa57e0)return;if(_0xa57e0['hasError'])return this['_setErrorState'](_0xa57e0),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0xa57e0['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x4c0830=_0xa57e0['replies'][_0xa57e0['replies']['length']-0x1];if(_0x4c0830){const _0x581ced=this['editor'];try{const _0x2296b7=q({'editor':_0x581ced,'changeGroups':_0x4c0830['changeGroups'],'documentContextContent':_0x4c0830['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x3abd96=>setTimeout(_0x3abd96,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x2296b7[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x5bfa13){this['_isAbortError'](_0x5bfa13)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x5bfa13);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x1e1a1e){const _0x36b5a1=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x36b5a1),_0x1e1a1e['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class Ka extends _0x241f5a{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x18051b){super(_0x18051b),_0x18051b['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class gr extends _0x15a8cb{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x10856c,_0x33cbb4){super(_0x10856c),this['id']=_0x33cbb4,this['set']('status','pending'),this['set']('changeId',_0x33cbb4),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x558f1f,_0x34d87d)=>{_0x34d87d&&_0x34d87d['target']&&'A'===_0x34d87d['target']['tagName']&&_0x34d87d['preventDefault'](),this['fire']('activateChange',{'id':_0x33cbb4,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x33cbb4,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x33cbb4,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x2a68ae=new _0x15a8cb(this['locale']);return _0x2a68ae['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x475972=>!_0x475972)]}}),_0x2a68ae;}['_createAcceptButtonView'](){const _0x5c3ac1=new _0x5bfd84(this['locale']);return _0x5c3ac1['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x5c3ac1['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x54e2dc=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x54e2dc['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x4ee816=>'pending'!==_0x4ee816&&'accepted'!==_0x4ee816),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x5c2be5=>'pending'===_0x5c2be5),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x20ccbc=>'accepted'===_0x20ccbc)]}}),this['on']('change:status',(_0x469da3,_0x1cc754,_0x193beb)=>{_0x5c3ac1['isEnabled']='pending'===_0x193beb,'accepted'===_0x193beb&&(_0x5c3ac1['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x5c3ac1['icon']=_0x1cd2e2);}),_0x5c3ac1;}['_createDismissButtonView'](){const _0x24448e=new _0x5bfd84(this['locale']);return _0x24448e['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x24448e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x52704e=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x52704e['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x2478fd=>'pending'!==_0x2478fd&&'rejected'!==_0x2478fd),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x112729=>'pending'===_0x112729),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0xddc756=>'rejected'===_0xddc756)]}}),this['on']('change:status',(_0xb4aef4,_0x3aba95,_0x5a2aa6)=>{_0x24448e['isEnabled']='pending'===_0x5a2aa6,'rejected'===_0x5a2aa6&&(_0x24448e['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x24448e['icon']=_0x187b85);}),_0x24448e;}['_createInfoButtonView'](){const _0x3fa57a=new _0x5bfd84(this['locale']);return _0x3fa57a['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':tc,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x3fa57a['bind']('isOn')['to'](this,'isInfoToggleOn',_0x2a9567=>_0x2a9567),_0x3fa57a['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x3fa57a;}['_createOutdatedButtonView'](){const _0x51b495=new _0x5bfd84(this['locale']);return _0x51b495['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x257152,'withText':!0x0,'isEnabled':!0x1}),_0x51b495['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x5776d9=>'outdated'!==_0x5776d9)],'disabled':'disabled'}}),_0x51b495;}}class me extends _0x1ddc71{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x22e4c5,_0x40a10b){super(_0x22e4c5),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x40a10b['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0xf8bee6){this['resultItemView']['changeId']=_0xf8bee6['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0xf8bee6['contentDiffed'];}['showBalloon'](_0x218130,_0x2bb107,_0x38f6b3,_0x5569d5,_0x529b95,_0x1a20ac){const _0x29db15=_0x2bb107();if(!_0x29db15)return;this['updateContent'](_0x218130),this['show']();const _0x2c743e=Array['from'](_0x29db15['getClientRects']())['reverse'](),_0x317304=this['_getPointedRectIndexFromEvent'](_0x38f6b3,_0x2c743e),_0x357b39=_0x2c743e[_0x317304??0x0];'click'===_0x5569d5?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x2bb107(),_0x317304,_0x218130['id'],_0x529b95,_0x1a20ac)||_0x357b39})):'hover'===_0x5569d5&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x2bb107(),_0x317304,_0x218130['id'])||_0x357b39}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x4daaf2({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x125963=[this['element']];return this['_pinnedTargetElement']&&_0x125963['push'](this['_pinnedTargetElement']),_0x125963;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x25251e=new _0x15a8cb();return this['resultItemView']=new gr(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x25251e['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x25251e;}['_getBestRectPositionOnClick'](_0x458338,_0x4ebca6,_0xcc4526,_0x90d5d9,_0x121e9d){if(!_0x458338)return null;const _0x5ae572=this['position']['replace']('arrow_',''),_0x8e21e9=Array['from'](_0x458338['getClientRects']());let _0x839b12,_0x345980=_0x8e21e9['reverse']();return void 0x0!==_0x4ebca6&&this['_isPinnedRectVisible'](_0x345980[_0x4ebca6],_0x90d5d9,_0x121e9d)?(_0x839b12=_0x345980[_0x4ebca6],this['_pinnedRectIndex']=_0x4ebca6):this['_isPinnedRectVisible'](_0x345980[0x0],_0x90d5d9,_0x121e9d)&&void 0x0===_0x4ebca6?_0x839b12=_0x345980[0x0]:(_0x345980='s'==_0x5ae572[0x0]?[..._0x8e21e9]['reverse']():_0x8e21e9,_0x345980['forEach'](_0x2ee714=>{this['_isPinnedRectVisible'](_0x2ee714,_0x90d5d9,_0x121e9d)&&(_0x839b12=_0x2ee714);})),this['_pinnedTargetChangeId']=_0xcc4526,this['_pinnedTargetElement']=_0x458338,_0x839b12||_0x458338['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x5a7816,_0x1424fc,_0x30a7bf){if(!_0x5a7816)return null;const _0x1eba29=Array['from'](_0x5a7816['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x1424fc&&this['_pinnedTargetChangeId']!==_0x30a7bf)return this['_pinnedRectIndex']=_0x1424fc,this['_pinnedTargetElement']=_0x5a7816,this['_pinnedTargetChangeId']=_0x30a7bf,_0x1eba29[_0x1424fc];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x30a7bf){if(_0x5a7816!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x1eba29[this['_pinnedRectIndex']];}return void 0x0!==_0x1424fc&&this['_pinnedTargetChangeId']!==_0x30a7bf?(this['_pinnedRectIndex']=_0x1424fc,this['_pinnedTargetElement']=_0x5a7816,this['_pinnedTargetChangeId']=_0x30a7bf,_0x1eba29[_0x1424fc]):_0x5a7816['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x74873f,_0x2f24d2){if(_0x74873f)for(let _0x5d09e8=0x0;_0x5d09e8<_0x2f24d2['length'];_0x5d09e8++){const _0x5e1906=_0x2f24d2[_0x5d09e8];if(_0x74873f['clientX']>=_0x5e1906['left']-0x3&&_0x74873f['clientX']<=_0x5e1906['right']+0x3&&_0x74873f['clientY']>=_0x5e1906['top']-0x3&&_0x74873f['clientY']<=_0x5e1906['bottom']+0x3)return _0x5d09e8;}}['_isPinnedRectVisible'](_0x5bbf1a,_0x39817e,_0x2252c0){const _0x250fee=new ot(_0x5bbf1a),_0x13952f=_0x39817e||document['documentElement'],_0x4078c4=_0x250fee['getIntersection'](_0x2279c2(_0x2252c0)),_0x244a60=new ot(_0x13952f)['getIntersection'](_0x250fee);return!!(_0x4078c4&&_0x244a60&&_0x250fee['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x118815{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[_t];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5f5ba7){super(_0x5f5ba7),this['_bodyCollection']=new _0x49fddd(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ih)['to'](this),this['_balloonSuggestionView']=new me(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x283aad=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x283aad);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0xf373d6){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x57f3d5=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0xf373d6,_0x57f3d5);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x2b2b2c){_0x2b2b2c&&('error-general'!==_0x2b2b2c['status']?'error-chunk'!==_0x2b2b2c['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x37321e){this['_mainView']['addCheckRunResult'](_0x37321e);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x5c89e0){this['_mainView']['showGeneralReviewCoreErrorView'](_0x5c89e0??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x1c5ee2,_0x38b5c0){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x1c5ee2,_0x38b5c0);}['setActiveStateInResults'](_0x259866){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3f2eb7=>{_0x3f2eb7['id']===_0x259866&&_0x3f2eb7['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x1774cd=>_0x1774cd['setItemAsInactive']());}['updateChangeState'](_0x3e079a,_0x23010d){'accepted'===_0x23010d||'rejected'===_0x23010d||'outdated'===_0x23010d?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x3e079a,_0x23010d):this['_mainView']['reviewCheckResultsView']['showResult'](_0x3e079a,_0x23010d);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x5d1a6e,_0x2bd384,_0x1f602f,_0x5caf09,_0xb96e48,_0x39fe15){this['_balloonSuggestionView']['showBalloon'](_0x5d1a6e,_0x2bd384,_0x1f602f,_0x5caf09,_0xb96e48,_0x39fe15);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x421f49){const _0x44e524=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x2a4eed=>_0x2a4eed['id']===_0x421f49);return _0x44e524?_0x44e524['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x15a8cb{constructor(_0x442654){super(_0x442654),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x5ce5e4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x5ce5e4['if']('isVisible','ck-hidden',_0x5b73ff=>!_0x5b73ff)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x5ce5e4['to']('errorMessage')}]}]});}}class Ae extends _0x15a8cb{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x440a08,_0x547b12){super(_0x440a08),this['reviewCoreHeader']=_0x547b12['header'],this['generalErrorView']=new sh(_0x440a08),this['reviewCheckListView']=_0x547b12['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x547b12['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x547b12['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x5f3a18){this['reviewCheckResultsView']['addResult'](_0x5f3a18),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x53a2ed){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x53a2ed;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class _r extends _0x5bfd84{constructor(_0x44f6b4,_0x4383ca){super(_0x4383ca),this['set']({'label':_0x44f6b4,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x5e9d54{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x3efa97,_0x120fe3){super(_0x3efa97),this['_contents']=_0x120fe3,this['_resultViews']=new _0x152ab6(),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 Fi(_0x3efa97),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 _0x4ff5c9=this['_createCombinedSkeletonLoader'](),_0x3f1b59=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x3f1b59['if']('isLoading','ck-ai_review__check-run_loading',_0x232df0=>_0x232df0),_0x3f1b59['if']('isResultReady','ck-ai_review__check-run_ready',_0x2cf305=>_0x2cf305),_0x3f1b59['if']('isVisible','ck-hidden',_0x11ff8a=>!_0x11ff8a)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x11bdb3=>_0x11bdb3)]},'children':this['_resultViews']},_0x4ff5c9]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x301158){const _0x52731b=new gr(this['locale'],_0x301158['id']);_0x52731b['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x52731b),_0x52731b['resultResponseView']['element']['innerHTML']=_0x301158['contentDiffed'];}['hideResult'](_0x5bb6da,_0x47218e){if('pending'===_0x47218e)return;const _0x5d903b=this['_resultViews']['find'](_0x3f70c4=>_0x3f70c4['id']===_0x5bb6da);_0x5d903b&&(_0x5d903b['status']=_0x47218e,_0x5d903b['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x39ca0a,_0x5755c7){if('pending'!==_0x5755c7)return;const _0x50a32c=this['_resultViews']['find'](_0x2d649f=>_0x2d649f['id']===_0x39ca0a);_0x50a32c&&(_0x50a32c['status']=_0x5755c7,_0x50a32c['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x3a20d0,_0x5e1f72){this['headerTitle']=_0x3a20d0,this['headerSubtitle']=_0x5e1f72||'';}['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 Ei(this['locale'],Si['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x7ccccc=new _0x15a8cb(this['locale']),_0x3e8583=[];for(let _0x421abe=0x0;_0x421abe<0x10;_0x421abe++){const _0x177852=this['_createSkeletonLoader']();_0x177852['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x3e8583['push'](_0x177852);}return _0x7ccccc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x70df5e=>!_0x70df5e)]},'children':_0x3e8583}),_0x7ccccc;}['_createErrorView'](){const _0x239397=new _0x15a8cb(this['locale']),_0x15d0d7=new _0x5bfd84(this['locale']),t=this['locale']['t'];return _0x239397['delegate']('retryReview')['to'](this),_0x15d0d7['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x15d0d7['on']('execute',()=>{this['fire']('retryReview');}),_0x239397['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x49319c=>!_0x49319c),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x38155b=>'chunk'===_0x38155b)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x57879c=>'chunk'===_0x57879c)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5101e2=>'general'!==_0x5101e2)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2f4a37=>'chunk'!==_0x2f4a37)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x15d0d7]}),_0x239397;}['_createCancelButtonView'](){const _0x18c3d8=new _0x5bfd84(this['locale']);return _0x18c3d8['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x49c145}),_0x18c3d8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3afa66=>_0x3afa66),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x10d08e=>_0x10d08e)]}}),_0x18c3d8['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x18c3d8;}['_createToggleDiffButtonView'](){const _0x15f1a0=new _0x5bfd84(this['locale']);_0x15f1a0['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x15f1a0['bind']('isEnabled')['to'](this,'isError',_0x226409=>!_0x226409),_0x15f1a0['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xed5269=>!_0xed5269),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xc6125a=>_0xc6125a)]}});const _0x9c84d3=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0xa2e72=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x15f1a0['bind']('isOn')['to'](this,'isToggleDiffOn',_0x300e57=>_0x300e57),_0x15f1a0['bind']('icon')['to'](this,'isToggleDiffOn',_0xd6b76f=>_0xd6b76f?_0x3a16b6:_0x2b26c),_0x15f1a0['bind']('label')['to'](this,'isToggleDiffOn',_0x24d597=>_0x24d597?_0x9c84d3:_0xa2e72),_0x15f1a0['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x15f1a0;}['_createAcceptAllButtonView'](){const _0x1a6001=new _0x5bfd84(this['locale']);return _0x1a6001['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x1a6001['bind']('isEnabled')['to'](this,'isError',_0x1e5b74=>!_0x1e5b74),_0x1a6001['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4d0557=>!_0x4d0557),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x513727=>_0x513727)]}}),_0x1a6001['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x1a6001;}['_createExitReviewButtonView'](){const _0x54c039=new _0x5bfd84(this['locale']);return _0x54c039['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x54c039['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x277f69=>!_0x277f69),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3c16bd=>_0x3c16bd)]}}),_0x54c039['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x54c039;}['_createResultHeaderView'](){const _0x39d17a=new _0x15a8cb(this['locale']),_0x126f2b=this['_createTitleView']();return _0x39d17a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x298685=>_0x298685)]},'children':[_0x126f2b,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x39d17a;}['_createTitleView'](){const _0x43d079=new _0x15a8cb(this['locale']),_0xec69a9=new Ci();return _0xec69a9['bind']('isVisible')['to'](this,'isResultReady',_0x4b8cd2=>!_0x4b8cd2),_0x43d079['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0xec69a9,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x562d31=>_0x562d31)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3918a0=>!_0x3918a0)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x43d079;}['_createFinishReviewButtonView'](){const _0x39681e=new _r(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x39681e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x282e7e=>!_0x282e7e)]}}),_0x39681e['delegate']('finishReview')['to'](this),_0x39681e;}}class be extends _0x5e9d54{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x3fc96d,_0x2db180){super(_0x3fc96d),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x2db180['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x2db180['headerText']);const _0x192120=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x192120['if']('isVisible','ck-hidden',_0x118028=>!_0x118028)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x2db180['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x4a07df){const _0x39b591=new _r(_0x4a07df,this['locale']);return _0x39b591['delegate']('finishReview')['to'](this),_0x39b591;}['_createResultHeaderView'](_0x3ed9a0){const _0x315249=new _0x15a8cb(this['locale']);return _0x315249['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x3ed9a0}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x315249;}}class Dr extends _0x15a8cb{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x320ea7,_0x206da3){super(_0x320ea7),this['_defaultValue']=_0x206da3['default']||(_0x206da3['data']['length']>0x0?_0x206da3['data'][0x0]['id']:''),this['_defaultLabel']=_0x206da3['data']['find'](_0x8800bf=>_0x8800bf['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x29ed58(this['locale']);const _0x6f2085=this['_prepareListOptions'](_0x206da3['data']);_0x48b098(this['_dropdownView'],_0x6f2085,{'role':'menu','ariaLabel':_0x206da3['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2cf2f5=>{_0x2cf2f5['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x197c4f=>{this['formValue']=_0x197c4f['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x197c4f['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x479718=[]){const _0x27adbb=new _0x4b06b7();this['resetToDefault']();for(const _0x780c8e of _0x479718){const _0x3b8a38=new _0x129df2({'label':_0x780c8e['label'],'withText':!0x0,'role':'menuitemradio','id':_0x780c8e['id'],'model':_0x780c8e});_0x3b8a38['bind']('isOn')['to'](this,'formValue',_0x1ae91d=>_0x1ae91d===_0x3b8a38['id']);const _0x43223a={'type':'button','model':_0x3b8a38};_0x27adbb['add'](_0x43223a);}return _0x27adbb;}}class cc extends _0x5e9d54{['_formItem']=null;constructor(_0x980df2,_0x3ed1b1,_0x44a0ff){super(_0x980df2),this['argsKey']=_0x3ed1b1?.['argsKey'];if('dropdown'===_0x3ed1b1['formType'])this['_formItem']=new Dr(this['locale'],_0x3ed1b1);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x315a3c=new _0x294a7c(this['locale'],{'children':[this['_formItem']],'class':[_0x44a0ff?'ck-form__row_with-submit':'']});_0x44a0ff&&_0x315a3c['children']['add'](_0x44a0ff),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x315a3c]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class mo extends _0x59ba6f{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x217399){super(_0x217399),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x394cf5(),this['minRows']=mo['MIN_ROWS'],this['maxRows']=mo['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class rc extends _0x15a8cb{['focusTracker']=new _0x510dfd();['keystrokes']=new _0x394cf5();['focusCycler'];['_focusables']=new _0x152ab6();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x25f0f8,_0x221af0,_0xf57a29=!0x1){super(_0x25f0f8),this['_check']=_0x221af0,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x221af0['defaultModel']?_0x221af0['defaultModel']['id']:'',this['_defaultLabel']=_0x221af0['defaultModel']?_0x221af0['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x1a087b(this['locale'],()=>new mo(_0x25f0f8)),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 _0x4b06b7(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0xf57a29),_0x48b098(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x294a7c(this['locale'],{'children':[this['promptInputView']]}),new _0x294a7c(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x4b8d1f,_0x247b89)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x247b89()):_0x247b89();}),this['focusCycler']=new _0x5a99d2({'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'](_0x19ba30=>{this['_focusables']['add'](_0x19ba30),this['focusTracker']['add'](_0x19ba30['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 _0x3aca7b of this['_getFormValidators']()){const _0x1e4fd5=_0x3aca7b();if(_0x1e4fd5)return this['promptInputView']['errorText']=_0x1e4fd5,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x3a848b=new _0x5bfd84(this['locale']),t=this['locale']['t'];return _0x3a848b['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3a848b['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x3a848b;}['_createCancelButtonView'](){const _0x1f9798=new _0x5bfd84(this['locale']),t=this['locale']['t'];return _0x1f9798['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x1f9798['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x32d4b9=>{_0x32d4b9['stopPropagation']();})}}),_0x1f9798['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x1f9798;}['_setModelList'](_0x5537e8){this['_modelSelectionDropdownItems']['clear']();const _0x192e6c=this['_check']['models'];if(_0x5537e8)this['set']('modelDisplayMode','hidden');else{const _0x400a08=0x1===_0x192e6c['length'];this['set']('modelDisplayMode',_0x400a08?'name':'selector');}if(this['resetToDefault'](),_0x192e6c?.['length']){0x1===_0x192e6c['length']&&this['set']('activeModelName',_0x192e6c[0x0]['name']||_0x192e6c[0x0]['id']);for(const _0x1fca4e of _0x192e6c){const _0x1ffb5a=new _0x129df2({'label':_0x1fca4e['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1fca4e['id'],'model':_0x1fca4e});_0x1ffb5a['bind']('isOn')['to'](this,'modelId',_0x2a6a6e=>_0x2a6a6e===_0x1fca4e['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1ffb5a,'labelView':new po(this['locale'],_0x1fca4e)});}}}['_createModelSelectionDropdown'](){const _0x5f5aa1=_0x29ed58(this['locale']);return _0x5f5aa1['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x5f5aa1['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x5f5aa1['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x53d591=>'selector'===_0x53d591),this['listenTo'](_0x5f5aa1,'execute',_0x1f1c5b=>{this['modelId']=_0x1f1c5b['source']['model']['id'],_0x5f5aa1['buttonView']['label']=_0x1f1c5b['source']['label'];}),_0x5f5aa1;}['_createModelNameView'](){const _0x60812c=new wo(this['locale']);return _0x60812c['bind']('text')['to'](this,'activeModelName',_0x70864b=>_0x70864b??''),_0x60812c['bind']('isVisible')['to'](this,'modelDisplayMode',_0x268641=>'name'===_0x268641),_0x60812c;}['_createActionsFooterView'](){const _0x59c2ea=new _0x15a8cb(this['locale']);return _0x59c2ea['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x59c2ea;}}class wo extends _0x15a8cb{constructor(_0x5c7584){super(_0x5c7584),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x58a4f6=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x58a4f6['if']('isVisible','ck-hidden',_0x1b2358=>!_0x1b2358)]},'children':[{'text':_0x58a4f6['to']('text')}]});}}class po extends _0x59760a{constructor(_0x11495f,_0x21a4d5){super();const _0x5130e9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5130e9['to']('style'),'id':_0x5130e9['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x5130e9['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x21a4d5['description']||'']}]}]});}}class ic extends _0x5e9d54{['_formItemsCollection']=new _0x152ab6();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x158cf5,_0x2f6857,_0x346fb5,_0x13d1c4=!0x1){super(_0x158cf5),this['_hideModels']=_0x13d1c4,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x2f6857['isParameterized']);const _0x19ee75=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x5c26f7=>_0x5c26f7),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x2cba74=>_0x2cba74)],'style':{'--ck-ai-review-check-list-item-index':_0x346fb5}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x2f6857['title']}]},_0x19ee75]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x2f6857['description']?[{'text':_0x2f6857['description']}]:[]}]}]},..._0x2f6857['isParameterized']?[this['_createParameterizedView'](_0x2f6857)]:[],...'custom'===_0x2f6857['id']?[this['_createCustomView'](_0x2f6857,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x2f6857['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x2f6857['id'],'args':_0x2f6857['useArgs']?_0x2f6857['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x4daaf2({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x3a130b=>{_0x3a130b['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x161b8d=new _0x2ae97e();return _0x161b8d['content']=_0x2ef869,_0x161b8d['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x161b8d;}['_createParameterizedView'](_0x409694){const _0x5bdd82=new _0x15a8cb(),_0x2557ac=this['_createFormView'](_0x409694);return _0x5bdd82['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x472a5d=>!_0x472a5d)]},'children':[_0x2557ac]}),_0x5bdd82;}['_createFormView'](_0xee0296){const _0x425f3b=new _0x15a8cb(),_0x3a9643=Array['isArray'](_0xee0296['options'])?_0xee0296['options']:[],_0x1a3b49=new _0x5bfd84(this['locale']),t=this['locale']['t'];_0x1a3b49['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x1a3b49['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x52bbc9=>{_0x52bbc9['stopPropagation']();})}}),_0x1a3b49['on']('execute',()=>{const _0x1c4f1a=[],_0x2c481c={};this['_formItemsCollection']['forEach'](_0x277ff3=>{_0x1c4f1a['push'](_0x277ff3['value']),_0xee0296['useArgs']&&_0xee0296['options']&&(_0x2c481c[_0x277ff3['argsKey']]=_0x277ff3['value']);}),this['fire']('runReviewCheck',{'id':_0xee0296['id'],'params':_0x1c4f1a['length']?_0x1c4f1a:void 0x0,'args':Object['keys'](_0x2c481c)['length']?_0x2c481c:void 0x0});});const _0x3df306=_0x3a9643['length'];return _0x3a9643['forEach']((_0x113ea9,_0x3fcc36)=>{const _0x474e6d=_0x3fcc36===_0x3df306-0x1;this['_formItemsCollection']['add'](new cc(this['locale'],_0x113ea9,_0x474e6d?_0x1a3b49:null));}),_0x425f3b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x425f3b;}['_createCustomView'](_0x5d7430,_0x329c63=!0x1){return this['_customCheckView']=new rc(this['locale'],_0x5d7430,_0x329c63),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x55e9a4=>!_0x55e9a4)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x2ad20e,_0x1414b9,_0x5c65f3)=>{_0x5c65f3||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x5e9d54{['_checkViews'];constructor(_0x29350b){super(_0x29350b),this['_checkViews']=new _0x152ab6(),this['_setupTemplate']();}['setChecks'](_0xbdb016,_0x7a574e=!0x1){this['_checkViews']['clear']();for(const [_0x24c605,_0x1be260]of _0xbdb016['entries']()){const _0x2344b2=new ic(this['locale'],_0x1be260,_0x24c605,_0x7a574e);_0x2344b2['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x2344b2);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x42a796 of this['_checkViews'])_0x42a796 instanceof ic&&_0x42a796['resetToDefault']();}['_setupTemplate'](){const _0x2caa4d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2caa4d['if']('isVisible','ck-hidden',_0x1ebd6f=>!_0x1ebd6f)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x381d93=this['context']['locale'],_0x294573=new _0x2e3f47(_0x381d93,{'label':i(_0x381d93,'AI_REVIEW_MODE'),'icon':_0x143feb,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x294573,'list':new je(_0x381d93),'results':new Ve(_0x381d93,{'generalErrorText':i(_0x381d93,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x381d93,{'headerText':i(_0x381d93,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x381d93,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x381d93,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x16da58=this['context']['plugins']['get']('AITabs');_0x16da58['view']['on']('activateTab',(_0x47407d,_0x445714)=>{'reviewMode'===_0x445714?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x16da58['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x143feb,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x118815{static get['requires'](){return[_0x143aa3,D];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x27947c){super(_0x27947c),this['_domEmitter']=new(_0x400351())(),this['_eventEmitter']=new(_0x204e9f())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x4d89a8=et(this['context']);_0x4d89a8['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x2db2e3,{writer:_0x1df47b})=>{const _0x5b63fa=this['_markers']['get'](_0x2db2e3['markerName']),_0x2cbcdc={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x5b63fa?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2db2e3['markerName']};return _0x1df47b['createUIElement']('span',_0x2cbcdc,function(_0x2305a8){const _0x13b5bc=this['toDomElement'](_0x2305a8);return _0x13b5bc['innerHTML']=_0x5b63fa?.['content']?.['asString']||'',_0x13b5bc;});}}),_0x4d89a8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x1214a7=>{const _0x38acea=this['_markers']['get'](_0x1214a7['markerName']),_0x3a50f8=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x38acea?.['id']||'')&&_0x3a50f8['push']('ck-ai_review__change_active'),{'classes':_0x3a50f8,'attributes':{'data-marker-id':_0x1214a7['markerName']}};}}),_0x4d89a8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x60f9cc=>{const _0x2f5435=this['_markers']['get'](_0x60f9cc['markerName']),_0x3ac850=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x2f5435?.['id']||'')&&_0x3ac850['push']('ck-ai_review__change_active'),{'classes':_0x3ac850,'attributes':{'data-marker-id':_0x60f9cc['markerName']}};}}),_0x4d89a8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x360701=>{const _0x14257d=this['_markers']['get'](_0x360701['markerName']),_0x22e8ee=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x14257d?.['id']||'')&&_0x22e8ee['push']('ck-ai_review__change_active'),{'classes':_0x22e8ee,'attributes':{'data-marker-id':_0x360701['markerName']}};}}),_0x4d89a8['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x269104,{writer:_0x4630a4})=>_0x4630a4['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x269104['isOpening']?'start':'end')})}),_0x4d89a8['conversion']['for']('downcast')['attributeToAttribute']({'model':Et,'view':_0x53de42});const _0x28ef0b=_0x4d89a8['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x28ef0b,'mouseup',(_0x184103,_0x386df0)=>{const _0x24edcc=_0x386df0['target'],_0x2a9393=this['_findMarkerElement'](_0x24edcc);if(!_0x2a9393)return;const _0x3a9c6d=_0x2a9393['getAttribute']('data-marker-id'),_0x323844=_0x3a9c6d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x3a9c6d,'changeId':_0x323844,'markerElement':()=>this['_findMarkerElementById'](_0x3a9c6d),'domEvent':_0x386df0});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x28ef0b,'mouseover',(_0x360e69,_0x7ae6f7)=>{const _0x5bb88a=_0x7ae6f7['target'],_0x280392=_0x7ae6f7['relatedTarget'];let _0x14d66f=this['_findMarkerElement'](_0x5bb88a);if(!_0x14d66f&&_0x280392&&(_0x14d66f=this['_findMarkerElement'](_0x280392)),!_0x14d66f)return;const _0x3fa1bb=_0x14d66f['getAttribute']('data-marker-id'),_0xc113eb=_0x3fa1bb['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xc113eb,'markerElement':()=>this['_findMarkerElementById'](_0x3fa1bb),'domEvent':_0x7ae6f7});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x5a61ef((_0x341480,_0x12013b)=>{const _0x52bdbc=_0x12013b['target'];if(this['_findMarkerElement'](_0x52bdbc))return;_0x52bdbc['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x4d89a8['model']['document']['registerPostFixer'](_0x355a36=>this['_validateMarkers'](_0x4d89a8,_0x355a36)),_0x4d89a8['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x4d89a8));}['getDocumentData'](){const _0x357e52=this['context']['plugins']['get']('AIEditing'),_0x5abb38=et(this['context']),_0xc418c7=_0x5abb38['model'],_0x5507dc=new _0x53b4ba();for(const _0x29673c of _0xc418c7['document']['getRoot']()['getChildren']()){const _0x1fec37=_0x29673c['_clone'](!0x0);_0x5507dc['_appendChild'](_0x1fec37);}for(const _0x275847 of _0xc418c7['markers'])_0x5507dc['markers']['set'](_0x275847['name'],this['_changeRangeOwnerDocument'](_0x275847['getRange']()['clone'](),_0x5507dc));const _0x14f533=new _0x266ef3({'ignoreElementEnd':!0x0,'startPosition':_0xc418c7['createPositionAt'](_0x5507dc,0x0)}),_0x4ca3d3=new Set(),_0x5e1d7c=new Map();for(const {item:_0x143603}of _0x14f533){if(!_0x143603['is']('$textProxy'))continue;const _0x31b008=_0x143603['parent'];if(_0x31b008&&_0x31b008['is']('element')){const _0x3e33bb=this['_upsertDataId'](_0x31b008,()=>_0x357e52['_nextDataId'](_0x4ca3d3));_0x4ca3d3['add'](_0x3e33bb);for(const _0x326cbf of _0x31b008['getChildren']())_0x326cbf['is']('element')&&_0x4ca3d3['add'](this['_upsertDataId'](_0x326cbf,()=>_0x357e52['_nextDataId'](_0x4ca3d3)));let _0xf1cfd7=_0x31b008;for(;_0xf1cfd7['parent']&&!_0xf1cfd7['parent']['is']('documentFragment');)_0xf1cfd7=_0xf1cfd7['parent'],_0xf1cfd7['hasAttribute'](Et)&&_0xf1cfd7['_removeAttribute'](Et);_0x5e1d7c['set'](_0x3e33bb,{'path':_0x31b008['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0xf1cfd7['_clone'](!0x0),_0x3e33bb,_0x5abb38['data'])}),_0x14f533['jumpTo'](_0xc418c7['createPositionAfter'](_0x31b008));}}return{'content':_0x5abb38['data']['processor']['toData'](_0x5abb38['data']['toView'](_0x5507dc)),'version':_0x5abb38['model']['document']['version'],'elements':_0x5e1d7c};}['diffContent'](_0x58315a,_0x3ff74b,_0x263316=!0x1){const _0x224c51=[],_0x459981=et(this['context']),_0x3c7930=_0x459981['data']['parse'](_0x3ff74b,'$documentFragment'),_0x17a8da=_0x459981['data']['parse'](_0x58315a,'$documentFragment'),_0x34ab69=_0x459981['model']['createPositionAt'](_0x17a8da,0x0);if(this['_haveSingleTopLevelElement'](_0x3c7930)){if(!this['_hasSameTopLevelElement'](_0x17a8da,_0x3c7930))return _0x224c51;}else{const _0x211fec=_0x459981['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x17a8da,_0x211fec)||!this['_haveOnlyInlineContent'](_0x3c7930,_0x211fec))return _0x224c51;}const _0x2065e7=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x58315a,_0x3ff74b,{'anchor':_0x34ab69,'markDeletions':!0x0})['getOperations']()['filter'](_0x3cbfed=>'insert'===_0x3cbfed['type']||'marker'===_0x3cbfed['type']&&_0x3cbfed['name']['startsWith']('$markedRemove')),_0x47a3d0=this['_groupAdjacentOperations'](_0x2065e7),_0x33c8e5=[];if(_0x263316){if(_0x47a3d0['length']){const _0x26f747=_0x47a3d0[0x0]['operations'][0x0],_0x3fe46c='insert'===_0x26f747['type']?_0x26f747['position']:_0x26f747['newRange']['start'],_0xf6e629=this['_getPositionLimitingRange'](_0x3fe46c,_0x459981,'inside'),_0x2c5121=_0xf6e629?_0x3c7930['getChild'](0x0)['getChildren']():_0x3c7930['getChildren'](),_0x54aea4=_0xf6e629||_0x459981['model']['createRangeIn'](_0x17a8da),_0x2e6314=[new _0x2b53fb('$markedRemove:synthetic'+_0x2e2dc8(),null,_0x54aea4,_0x459981['model']['document']['model']['markers'],!0x0,_0x459981['model']['document']['version']+0x1),new _0x147757(_0x54aea4['end'],_0x2c5121,_0x459981['model']['document']['version']+0x2)];_0x33c8e5['push']({'operations':_0x2e6314,'operationsIsolated':_0x2e6314,'groupOffset':0x0});}}else _0x33c8e5['push'](..._0x47a3d0);let _0x1a6d2e=0x0;return _0x459981['model']['change'](_0x3f4715=>{for(let _0x471bb6=0x0;_0x471bb6<_0x33c8e5['length'];_0x471bb6++){const _0x279991=_0x33c8e5[_0x471bb6],_0x106953=_0x3f4715['createDocumentFragment']();for(const _0x179f2e of _0x17a8da['getChildren']())_0x3f4715['append'](_0x179f2e['_clone'](!0x0),_0x106953);for(const _0x3c8926 of _0x279991['operationsIsolated'])if('insert'===_0x3c8926['type']){const _0x22fc8b=_0x3c8926;_0x22fc8b['baseVersion']=null,_0x22fc8b['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x22fc8b,_0x106953),_0x3f4715['batch']['addOperation'](_0x3c8926),_0x459981['model']['applyOperation'](_0x3c8926);const _0x3a81a8='suggestion:insertion:id:authorId:'+_0x1a6d2e++,_0xb8b7c=_0x459981['model']['createRange'](_0x22fc8b['position'],_0x22fc8b['position']['getShiftedBy'](_0x22fc8b['howMany']));_0x106953['markers']['set'](_0x3a81a8,_0xb8b7c);}else{if('marker'===_0x3c8926['type']&&_0x3c8926['name']['startsWith']('$markedRemove')){const _0x1f8645=_0x3c8926,_0x271cd2='suggestion:deletion:id:authorId:'+_0x1a6d2e++;this['_changeOperationOwnerDocument'](_0x1f8645,_0x106953),_0x106953['markers']['set'](_0x271cd2,_0x1f8645['newRange']);}}if(_0x263316)_0x224c51['push']({..._0x279991,'context':this['_createGetContentFn'](_0x17a8da,_0x459981['data']),'content':this['_createGetContentFn'](_0x17a8da,_0x459981['data'])});else{const _0x17a803=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x279991['operationsIsolated'][0x0]),_0x106953),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x279991['operationsIsolated'][_0x279991['operationsIsolated']['length']-0x1]),_0x106953));_0x106953['markers']['set'](fe+'suggestion-context',new _0x561be6(_0x17a803['start'],_0x17a803['end'])),_0x224c51['push']({..._0x279991,'context':this['_createGetContextFn'](_0x106953,_0x459981['data'],{'ellipsisBefore':_0x17a803['hasContentBefore'],'ellipsisAfter':_0x17a803['hasContentAfter']}),'content':this['_createGetContentFn'](_0x106953,_0x459981['data'])});}}}),_0x224c51;}['markChangePositionInEditorContent'](_0x25b0a8,_0x1b7c8b){if(!_0x25b0a8['length'])return;const _0x265838=_0x25b0a8[0x0]['parent']['id'],_0x39331f=_0x1b7c8b['elements']['get'](_0x265838);if(!_0x39331f)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x265838);const _0x21a685=_0x39331f['path'],_0x2b98bb=et(this['context']),_0x2726c6=_0x2b98bb['model']['document']['history']['getOperations'](_0x1b7c8b['version']),_0x45d981=[];for(const _0x556940 of _0x25b0a8){const _0x126b3d=_0x556940['operationsIsolated']['map'](_0x16eba3=>this['_translateOperationToEditorContent'](_0x16eba3,_0x21a685,_0x2b98bb['model']['document']['getRoots']()[0x0]));if(!_0x126b3d||!_0x126b3d['length'])continue;const _0x24b8ca=_0x126b3d['every'](_0x3e0bc9=>'marker'===_0x3e0bc9['type']&&_0x3e0bc9['name']['startsWith']('$markedRemove')),_0x100fca={'document':_0x2b98bb['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2f2d1b=_0x359a53(_0x126b3d,_0x2726c6,_0x100fca)['operationsA'];for(const _0x600347 of _0x2f2d1b)if('insert'===_0x600347['type']){const _0x13f64a=_0x600347,_0x3097c9=_0x13f64a['nodes'];_0x2b98bb['model']['change'](_0x13ec08=>{const _0x530d66=_0x13ec08['createDocumentFragment']();for(const _0x113b89 of _0x3097c9)_0x13ec08['append'](_0x113b89['_clone'](!0x0),_0x530d66);_0x45d981['push']({'start':_0x13f64a['position'],'end':_0x13f64a['position'],'type':'insert','groupId':_0x556940['id'],'content':{'asString':this['_createGetContentFn'](_0x530d66,_0x2b98bb['data'])(),'asFragment':_0x530d66}});});}else{if('marker'===_0x600347['type']&&_0x600347['name']['startsWith']('$markedRemove')){const _0x3186ed=_0x600347;let _0x4933bf='remove-text';if(_0x24b8ca){const _0x3a0b79=this['_findAdjacentContextDistance'](_0x3186ed['newRange']['start'],'backward',_0x2b98bb['model']['schema']),_0x24c85b=this['_findAdjacentContextDistance'](_0x3186ed['newRange']['end'],'forward',_0x2b98bb['model']['schema']);if(_0x3a0b79||_0x24c85b){const _0x3ff2db=_0x3186ed['newRange']['start']['getShiftedBy'](-_0x3a0b79),_0x264d6e=_0x3186ed['newRange']['end']['getShiftedBy'](_0x24c85b);_0x45d981['push']({'start':_0x3ff2db,'end':_0x264d6e,'groupId':_0x556940['id'],'type':'remove-context'});}else _0x4933bf='remove-only';}_0x45d981['push']({'start':_0x3186ed['newRange']['start'],'end':_0x3186ed['newRange']['end'],'groupId':_0x556940['id'],'type':_0x4933bf});}}}this['_insertMarkers'](_0x45d981);}['clearAllMarkers'](){const _0x56294f=et(this['context']);_0x56294f['model']['change'](_0x2f5153=>{for(const _0x29f68d of this['_markers']['keys']())_0x56294f['model']['markers']['get'](_0x29f68d)&&_0x2f5153['removeMarker'](_0x29f68d);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){et(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){et(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x3e80ac){const _0x2fc07d=et(this['context']),_0x5c28f1=_0x2fc07d['model'],_0x310a5f=_0x3e80ac['map'](_0x3c0535=>this['_getMarkersDataForGroup'](_0x3c0535))['flat']();_0x5c28f1['change'](_0x79a2c9=>{for(const _0x19bb9d of _0x310a5f){const _0x215b6d=_0x2fc07d['model']['markers']['get'](_0x19bb9d['id']);if(_0x215b6d){if('insert'===_0x19bb9d['type']){if(!_0x19bb9d['content'])continue;_0x5c28f1['insertContent'](_0x19bb9d['content']['asFragment']||null,_0x215b6d['getRange']()['start']);}else'remove-text'!==_0x19bb9d['type']&&'remove-only'!==_0x19bb9d['type']||_0x5c28f1['deleteContent'](_0x5c28f1['createSelection'](_0x215b6d['getRange']()));_0x79a2c9['removeMarker'](_0x19bb9d['id']),this['_markers']['delete'](_0x19bb9d['id']);}}});}['rejectChange'](_0x330ade){const _0x26ee25=et(this['context']),_0x18ad25=this['_getMarkersDataForGroup'](_0x330ade);_0x26ee25['model']['change'](_0x1a7674=>{for(const _0x296031 of _0x18ad25)_0x1a7674['removeMarker'](_0x296031['id']),this['_markers']['delete'](_0x296031['id']);});}['getEditor'](){return et(this['context']);}['getMarkerElementForChange'](_0x2cd7f7){const _0x3cf1b5=Array['from'](this['_markers']['values']())['filter'](_0x3a2cae=>_0x3a2cae['groupId']===_0x2cd7f7);if(!_0x3cf1b5['length'])return null;const _0x17c21a=0x1===_0x3cf1b5['length']?_0x3cf1b5[0x0]:this['_sortMarkers'](_0x3cf1b5)[0x0],_0x3e4c8c=et(this['context'])['model']['markers']['get'](_0x17c21a['id']);if(!_0x3e4c8c)return null;return{'modelRange':_0x3e4c8c['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x17c21a['id'])};}['getContentElementForChange'](_0x38934d){const _0x159373=Array['from'](this['_markers']['values']())['filter'](_0xa11bcc=>_0xa11bcc['groupId']===_0x38934d);if(!_0x159373['length'])return null;const _0x450c4c=0x1===_0x159373['length']?_0x159373[0x0]:this['_sortMarkers'](_0x159373)[0x0],_0x40e976=et(this['context']),_0x5e7d83=_0x40e976['model']['markers']['get'](_0x450c4c['id']);if(!_0x5e7d83)return null;const _0x404411=_0x5e7d83['getRange'](),_0x355896=_0x40e976['editing']['view']['getDomRoot']();if(!_0x355896||!_0x404411)return null;let _0x5cc039=_0x404411['start']['parent'];for(;_0x5cc039['parent']&&'$root'!==_0x5cc039['parent']['name'];)_0x5cc039=_0x5cc039['parent'];if(!_0x5cc039||!_0x5cc039['name'])return null;const _0x2a72e6=_0x355896['querySelector']('[data-marker-id=\x22'+_0x450c4c['id']+'\x22]');if(!_0x2a72e6)return null;let _0x4da2d9=null;_0x40e976['model']['change'](_0x1e8cc5=>{_0x4da2d9=_0x1e8cc5['createDocumentFragment'](),_0x1e8cc5['append'](_0x5cc039['_clone'](!0x0),_0x4da2d9);});const _0x556d4c=_0x40e976['data']['toView'](_0x4da2d9)['getChild'](0x0);return _0x2a72e6['closest'](_0x556d4c['name']);}['reactivateMarkers'](_0x932952){const _0x5c0fee=this['_getMarkersDataForGroup'](_0x932952);if(!_0x5c0fee['length'])return;const _0xd6e9c0=Array['from'](this['_activeMarkers'])['sort'](),_0x3803db=Array['from'](new Set(_0x5c0fee['map'](_0x34cbf8=>_0x34cbf8['id'])))['sort']();_0xd6e9c0['join']('|')!==_0x3803db['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x932952));}['setMarkersInElementAsActive'](_0x268dfa){const _0x488441=this['_getMarkersDataForGroup'](_0x268dfa);if(!_0x488441['length'])return;const _0x501532=et(this['context']),_0x451cd1=new Set(_0x488441['map'](_0x3a1b3f=>_0x3a1b3f['id'])),_0x2c4165=Array['from'](_0x451cd1['values']())['map'](_0x3cfcb5=>_0x501532['model']['markers']['get'](_0x3cfcb5))['filter'](_0x212c00=>!!_0x212c00);_0x451cd1['forEach'](_0x4b132e=>{this['_activeMarkers']['add'](_0x4b132e);}),_0x501532['model']['change'](()=>{_0x2c4165['forEach'](_0x2da372=>{_0x501532['editing']['reconvertMarker'](_0x2da372);});});}['setAllMarkersAsInactive'](){const _0x38a0d2=Array['from'](this['_activeMarkers']);if(!_0x38a0d2['length'])return;this['_activeMarkers']['clear']();const _0x208c87=et(this['context']),_0xe7a003=_0x38a0d2['map'](_0x23d26f=>_0x208c87['model']['markers']['get'](_0x23d26f))['filter'](_0x26e53b=>!!_0x26e53b);_0x208c87['model']['change'](()=>{_0xe7a003['forEach'](_0x2509fe=>{_0x208c87['editing']['reconvertMarker'](_0x2509fe);});});}['_getPositionLimitingRange'](_0x2f07fe,_0x2bad22,_0x17489d='outside'){if(!_0x2f07fe)return null;let _0x4c7b8c=_0x2f07fe['parent'];for(;_0x4c7b8c&&_0x4c7b8c['parent']&&'$root'!==_0x4c7b8c['parent']['name']&&!_0x2bad22['model']['schema']['isLimit'](_0x4c7b8c)&&!_0x2bad22['model']['schema']['isBlock'](_0x4c7b8c);)_0x4c7b8c=_0x4c7b8c['parent'];if(!_0x4c7b8c||!_0x4c7b8c['name']||'$root'===_0x4c7b8c['name'])return null;let _0x5cfb04=null;return _0x2bad22['model']['change'](_0x18107e=>{_0x5cfb04='inside'===_0x17489d?_0x18107e['createRangeIn'](_0x4c7b8c):_0x18107e['createRangeOn'](_0x4c7b8c);}),_0x5cfb04;}['_validateMarkers'](_0x3bfa4c,_0x56bccc){const _0x1419e5=Array['from'](this['_markers']['keys']()),_0x56a6b4=new Map();for(const _0x172575 of _0x1419e5){const _0x11f317=_0x3bfa4c['model']['markers']['get'](_0x172575);if(!_0x11f317)continue;const _0x1cff56=_0x11f317['getStart']()['path'][0x0];_0x56a6b4['has'](_0x1cff56)||_0x56a6b4['set'](_0x1cff56,[]),_0x56a6b4['get'](_0x1cff56)['push'](_0x11f317);}const _0x514176=new Set();for(const _0x5d1a92 of _0x3bfa4c['model']['document']['differ']['getChanges']()){let _0x3b4c4a=-0x1,_0xc7d444=null;if('insert'===_0x5d1a92['type'])_0xc7d444=new _0x561be6(_0x5d1a92['position'],_0x5d1a92['position']['getShiftedBy'](_0x5d1a92['length'])),_0x3b4c4a=_0x5d1a92['position']['path'][0x0];else{if('remove'!==_0x5d1a92['type'])continue;_0xc7d444=new _0x561be6(_0x5d1a92['position']),_0x3b4c4a=_0x5d1a92['position']['path'][0x0];}const _0x4c15b8=_0x56a6b4['get'](_0x3b4c4a)||[];if(_0x4c15b8['length']){for(const _0x42d45f of _0x4c15b8)if(_0xc7d444['root']['rootName']===_0x42d45f['getRange']()['root']['rootName']&&('insert'!==_0x5d1a92['type']||!_0xc7d444['containsRange'](_0x42d45f['getRange']()))&&(_0xc7d444['isIntersecting'](_0x42d45f['getRange']())||_0xc7d444['start']['isTouching'](_0x42d45f['getRange']()['end'])||_0xc7d444['end']['isTouching'](_0x42d45f['getRange']()['start']))){const _0x30b477=this['_parseMarkerName'](_0x42d45f['name']);Array['from'](this['_markers']['values']())['filter'](_0x4fa1d2=>_0x4fa1d2['groupId']===_0x30b477['groupId'])['forEach'](_0x1ec88b=>_0x514176['add'](_0x1ec88b['id']));}}}if(_0x514176['size']){for(const _0x1b5f7e of _0x514176)_0x56bccc['removeMarker'](_0x1b5f7e);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x6c2cbe){for(const {name:_0x30a16b,data:_0x1d518c}of _0x6c2cbe['model']['document']['differ']['getChangedMarkers']()){if(!_0x30a16b['startsWith'](fe))continue;const _0x26c419=_0x1d518c['oldRange'],_0x49cce6=_0x1d518c['newRange'],_0x2aadaa=_0x26c419&&'$graveyard'===_0x26c419['root']['rootName'],_0x475a90=_0x49cce6&&'$graveyard'===_0x49cce6['root']['rootName'];if(_0x2aadaa&&_0x475a90)continue;const _0x334bd6=this['_parseMarkerName'](_0x30a16b);this['_markers']['get'](_0x30a16b)&&(_0x475a90||!_0x49cce6?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x30a16b,'changeId':_0x334bd6['groupId']}):_0x2aadaa&&_0x49cce6&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x30a16b,'changeId':_0x334bd6['groupId']}));}}['_parseMarkerName'](_0x3d1ea1){const _0x3d7ace=_0x3d1ea1['split'](':'),_0x2d1cc3=(_0x3d7ace[0x1]||'')['split']('_');return{'prefix':_0x3d7ace[0x0],'groupId':_0x2d1cc3[0x0],'suffix':_0x2d1cc3[0x1]};}['_translateOperationToEditorContent'](_0x4e432e,_0x58031e,_0x436c46){if('insert'===_0x4e432e['type']){const _0x5914c1=_0x4e432e;return new _0x147757(this['_changePosition'](_0x58031e['concat'](_0x5914c1['position']['offset']),_0x436c46),_0x5914c1['nodes'],_0x5914c1['baseVersion']);}if('marker'===_0x4e432e['type']&&_0x4e432e['name']['startsWith']('$markedRemove')){const _0x402572=_0x4e432e;return new _0x2b53fb(_0x402572['name'],_0x402572['oldRange'],this['_changeRange'](_0x402572['newRange'],_0x58031e['concat'](_0x402572['newRange']['start']['offset']),_0x58031e['concat'](_0x402572['newRange']['end']['offset']),_0x436c46),_0x402572['_markers'],_0x402572['affectsData'],_0x402572['baseVersion']);}return _0x4e432e;}['_groupAdjacentOperations'](_0x29c23c){if(!_0x29c23c['length'])return[];const _0x3b5ee5=[];let _0xc40779=0x0,_0xd3a3d3=0x0,_0x529901=[];for(let _0x1119a8=0x0;_0x1119a8<=_0x29c23c['length'];_0x1119a8++){const _0x487bb2=_0x29c23c[_0x1119a8],_0x43ffd0=_0x29c23c[_0x1119a8-0x1];!_0x487bb2||_0x43ffd0&&!this['_getOperationEnd'](_0x43ffd0)['isTouching'](this['_getOperationStart'](_0x487bb2))?(_0x3b5ee5['push']({'operations':_0x529901,'operationsIsolated':_0x529901['map'](_0x13d8f1=>this['_shiftOperation'](_0x13d8f1['clone'](),-_0xd3a3d3)),'groupOffset':_0xc40779}),_0x529901=_0x487bb2?[_0x487bb2]:[],_0xd3a3d3+=_0xc40779,_0xc40779=0x0):_0x529901['push'](_0x487bb2),_0x487bb2&&'insert'===_0x487bb2['type']&&(_0xc40779+=_0x487bb2['howMany']);}return _0x3b5ee5;}['_findAdjacentContextDistance'](_0x537861,_0x347970,_0x17b201,_0x36b6fc=0x1){const _0x395ed0=new _0x266ef3({'startPosition':_0x537861,'direction':_0x347970});let _0xed3372=0x0;for(let _0x53f4c5=0x0;_0x53f4c5<_0x36b6fc;_0x53f4c5++){let _0x543dc2=0x0,_0x5de01b=!0x1,_0x46a281='forward'===_0x347970?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x45a382}of _0x395ed0)if(_0x45a382['is']('$textProxy')){const _0x37a0d8=_0x46a281['exec'](_0x45a382['data']);if(_0x37a0d8&&_0x37a0d8['length']){if(_0x543dc2+='forward'===_0x347970?_0x37a0d8['index']+_0x37a0d8[0x0]['length']:_0x45a382['data']['length']-_0x37a0d8['index'],_0x37a0d8[0x0]['length']!==_0x45a382['data']['length'])break;_0x5de01b=!0x0,_0x46a281='forward'===_0x347970?/^\w+/:/\w+$/;}else{if(_0x5de01b)break;_0x543dc2+=_0x45a382['offsetSize'];}}else{if(_0x45a382['is']('element')){_0x17b201['isInline'](_0x45a382)&&!_0x5de01b&&(_0x543dc2+=0x1);break;}}_0xed3372+=_0x543dc2,_0x395ed0['jumpTo'](_0x537861['getShiftedBy']('forward'===_0x347970?_0xed3372:-_0xed3372));}return _0xed3372;}['_getChangeContext'](_0xc5bab5,_0x8f3f3f){const _0xdc3eac=et(this['context'])['model']['schema'],_0x5be1d7=this['_findAdjacentContextDistance'](_0xc5bab5,'backward',_0xdc3eac,0x6),_0x4971a1=this['_findAdjacentContextDistance'](_0x8f3f3f,'forward',_0xdc3eac,0x6),_0x3f68f1=_0xc5bab5['getShiftedBy'](-_0x5be1d7),_0x152f79=_0x8f3f3f['getShiftedBy'](_0x4971a1);return{'start':_0x3f68f1,'end':_0x152f79,'hasContentBefore':!_0x3f68f1['isAtStart'],'hasContentAfter':!_0x152f79['isAtEnd']};}['_insertMarkers'](_0xf015d1){const _0x5e3fb3=this['context']['plugins']['get']('AIEditing'),_0x2c5950=new Set();et(this['context'])['model']['change'](_0xd78fe4=>{for(const _0x5b6377 of _0xf015d1){const _0x5c5eee=''+fe+_0x5b6377['type']+':'+_0x5b6377['groupId']+'_'+_0x5e3fb3['_nextDataId'](_0x2c5950);this['_markers']['set'](_0x5c5eee,{'id':_0x5c5eee,'groupId':_0x5b6377['groupId'],'type':_0x5b6377['type'],'content':_0x5b6377['content']}),_0xd78fe4['addMarker'](_0x5c5eee,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xd78fe4['createRange'](_0x5b6377['start'],_0x5b6377['end'])});}});}['_createGetContextFn'](_0x206ddc,_0x56b23e,_0x1c8f4f){let _0x7b9de='';return()=>{if(!_0x7b9de){const _0x22bbb1=_0x56b23e['toView'](_0x206ddc,{'showSuggestionHighlights':!0x0});let _0x87f4c=_0x22bbb1['getChild'](0x0);if(_0x87f4c['is']('containerElement')||(_0x87f4c=_0x22bbb1),!_0x87f4c)return'';let _0x378deb=!0x1;const _0x5c2c9b=[];for(const _0x1ea4d4 of _0x87f4c['getChildren']())_0x1ea4d4['is']('element','span')&&_0x1ea4d4['hasClass']('ck-ai_review-marker_context-end')&&(_0x378deb=!0x1),_0x378deb&&_0x5c2c9b['push'](_0x1ea4d4),_0x1ea4d4['is']('element','span')&&_0x1ea4d4['hasClass']('ck-ai_review-marker_context-start')&&(_0x378deb=!0x0);_0x87f4c['_removeChildren'](0x0,_0x87f4c['childCount']),_0x1c8f4f?.['ellipsisBefore']&&_0x87f4c['_appendChild']('…'),_0x87f4c['_appendChild'](_0x5c2c9b),_0x1c8f4f?.['ellipsisAfter']&&_0x87f4c['_appendChild']('…');const _0x27922a=_0x56b23e['htmlProcessor']['domConverter']['viewToDom'](_0x22bbb1),_0x34765a=_0x56b23e['htmlProcessor']['htmlWriter']['getHtml'](_0x27922a);_0x7b9de=_0x34765a;}return _0x7b9de;};}['_createGetContentFn'](_0x564ac3,_0x31d211){let _0x5b6a78='';return()=>(_0x5b6a78||(_0x5b6a78=_0x31d211['stringify'](_0x564ac3,{'showSuggestionHighlights':!0x0})),_0x5b6a78);}['_createGetContentUsingDataIdFn'](_0x2685cf,_0x2e85a8,_0x262c85){let _0x5afafb='';return()=>{if(!_0x5afafb){const _0x3b74f9=_0x262c85['toView'](new _0x53b4ba(_0x2685cf)),_0x29dbdd=_0x262c85['htmlProcessor']['domConverter']['viewToDom'](_0x3b74f9)['querySelector']('[data-id=\x22'+_0x2e85a8+'\x22]');_0x5afafb=_0x29dbdd?.['outerHTML']||'';}return _0x5afafb;};}['_findMarkerElement'](_0x51858f,_0x5bdfea=0x5){let _0x9ecccf=_0x51858f,_0x5f5117=null;for(let _0x1a4aa4=0x0;_0x1a4aa4<_0x5bdfea&&_0x9ecccf;_0x1a4aa4++){if(!_0x9ecccf['className']){_0x9ecccf=_0x9ecccf['parentElement'];continue;}if(!(''+_0x9ecccf['className'])['includes']('ck-ai_review-marker_')){_0x9ecccf=_0x9ecccf['parentElement'];continue;}if(!_0x9ecccf['getAttribute']('data-marker-id'))break;_0x5f5117=_0x9ecccf;break;}return _0x5f5117;}['_findMarkerElementById'](_0x5c0208){const _0x26ece9=et(this['context']),_0x45fb2d=_0x26ece9['model']['markers']['get'](_0x5c0208);return _0x45fb2d?_0x25a0d4(_0x26ece9['editing'],_0x45fb2d):null;}['_getMarkersDataForGroup'](_0x2e508b){return Array['from'](this['_markers']['values']())['filter'](_0x24a791=>_0x24a791['groupId']===_0x2e508b);}['_getOperationStart'](_0x581a08){return'insert'===_0x581a08['type']?_0x581a08['position']:_0x581a08['newRange']['start'];}['_getOperationEnd'](_0x3d1ae5,_0x347aca=!0x1){return'insert'===_0x3d1ae5['type']?_0x347aca?_0x3d1ae5['position']:_0x3d1ae5['position']['getShiftedBy'](_0x3d1ae5['howMany']):_0x3d1ae5['newRange']['end'];}['_shiftOperation'](_0x475c9e,_0x2ef24e){return'insert'===_0x475c9e['type']?_0x475c9e['position']=_0x475c9e['position']['getShiftedBy'](_0x2ef24e):'marker'===_0x475c9e['type']&&_0x475c9e['newRange']&&(_0x475c9e['newRange']=new _0x561be6(_0x475c9e['newRange']['start']['getShiftedBy'](_0x2ef24e),_0x475c9e['newRange']['end']['getShiftedBy'](_0x2ef24e))),_0x475c9e;}['_changeOperationOwnerDocument'](_0x24edb7,_0x4c3791){'insert'===_0x24edb7['type']?_0x24edb7['position']=this['_changePositionOwnerDocument'](_0x24edb7['position'],_0x4c3791):'marker'===_0x24edb7['type']&&_0x24edb7['newRange']&&(_0x24edb7['newRange']=this['_changeRangeOwnerDocument'](_0x24edb7['newRange'],_0x4c3791));}['_changePositionOwnerDocument'](_0x5dd961,_0xef2ef){return new _0x18c733(_0xef2ef,_0x5dd961['path']);}['_changeRangeOwnerDocument'](_0x9e7580,_0x4beb52){return new _0x561be6(this['_changePositionOwnerDocument'](_0x9e7580['start'],_0x4beb52),this['_changePositionOwnerDocument'](_0x9e7580['end'],_0x4beb52));}['_changePosition'](_0x376d33,_0x52d4c){return new _0x18c733(_0x52d4c,[..._0x376d33]);}['_changeRange'](_0x281a70,_0x186696,_0x2920dc,_0x22f386){return new _0x561be6(this['_changePosition'](_0x186696,_0x22f386),this['_changePosition'](_0x2920dc,_0x22f386));}['_sortMarkers'](_0x22d6e3){const _0x1426ed=_0xb041ab=>{switch(_0xb041ab){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x22d6e3['sort']((_0x38849c,_0x25f447)=>_0x1426ed(_0x38849c['type'])-_0x1426ed(_0x25f447['type']));}['_hasSameTopLevelElement'](_0x4ff00e,_0x509c98){const _0x181451=_0x4ff00e['getChild'](0x0),_0x3e64c4=_0x509c98['getChild'](0x0);return!(!_0x181451||!_0x3e64c4)&&((!_0x181451['is']('element')||!_0x3e64c4['is']('element')||_0x181451['name']===_0x3e64c4['name'])&&!(_0x181451['is']('element')&&!_0x3e64c4['is']('element')||!_0x181451['is']('element')&&_0x3e64c4['is']('element')));}['_haveSingleTopLevelElement'](_0x5671c2){return 0x1===_0x5671c2['childCount'];}['_haveOnlyInlineContent'](_0x1131f6,_0x1781e5){for(const _0x335e9d of _0x1131f6['getChildren']())if(_0x335e9d['is']('element')&&!_0x1781e5['isInline'](_0x335e9d))return!0x1;return!0x0;}['_upsertDataId'](_0x210e5a,_0xf4fc90){let _0x44d100=_0x210e5a['getAttribute'](Et);return _0x44d100||(_0x44d100=_0xf4fc90(),_0x210e5a['_setAttribute'](Et,_0x44d100)),_0x44d100;}}class Xs extends _0x204e9f(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x3d8739,contentNew:_0x58cedb,contentInitial:_0x2a85d7,documentVersion:_0x466d15}){super(),this['id']=_0x3d8739,this['contentNew']=_0x58cedb,this['contentInitial']=_0x2a85d7,this['documentVersion']=_0x466d15;}}class Ys extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x55c50d,_0x1535e7,_0x2a6976){super(),this['id']=_0x55c50d,this['parent']=_0x2a6976,this['_data']=_0x1535e7,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 Zs extends ts(){['id']=_0x2e2dc8();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x14e3aa,_0x5a9770,_0x63b79d,_0x787fef,_0x3b0c92){super(),this['_sourceCheck']=_0x5a9770,this['_documentData']=_0x14e3aa,this['_aiConnector']=_0x63b79d,this['_reviewParams']=_0x787fef,this['_reviewArgs']=_0x3b0c92,this['on']('change:status',(_0x229af4,_0x341de3,_0x1e14cf)=>{'aborted'==_0x1e14cf&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x1e14cf,'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'](_0x16005e=>'pending'===_0x16005e['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x544c35){this['_documentData']=_0x544c35;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x3ec28b=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x5e83d5 of _0x3ec28b)'unmodified'!==_0x5e83d5['data']['operation']&&('error'!==_0x5e83d5['data']['operation']?'review-metadata'!==_0x5e83d5['event']?this['_addReviewCheckResult'](_0x5e83d5['data']['dataId'],_0x5e83d5['data']['textDelta']):this['callId']=_0x5e83d5['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x50a737){this['_currentError']=_0x50a737,_0x50a737 instanceof Error&&_0x50a737['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'](_0x434731,_0x22412a){const _0x1b2fde=this['_results']['get'](_0x434731);if(!_0x1b2fde)return;if(0x0===_0x22412a['length'])return;const _0x12b78b=[];_0x22412a['forEach']((_0x4d1e9d,_0x52dc49)=>{const _0x484c26=new Ys(_0x1b2fde['id']+'-'+_0x52dc49,_0x4d1e9d,_0x1b2fde);_0x484c26['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x484c26,'status':_0x484c26['status']});}),_0x484c26['on']('change:isActivated',()=>{_0x484c26['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x484c26}):this['fire']('reviewCheckResultDeactivated',{'change':_0x484c26});}),this['_changes']['push'](_0x484c26),_0x12b78b['push'](_0x484c26);}),this['fire']('reviewCheckResultReady',{'changes':_0x12b78b,'result':_0x1b2fde,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x187b22){const _0x535aa1=this['_changes']['find'](_0x3d0529=>_0x3d0529['id']===_0x187b22);return!(!_0x535aa1||'pending'!==_0x535aa1['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x1b83d9=>!0x0===_0x1b83d9['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x34d72d=>'pending'===_0x34d72d['status']);}['getChangeById'](_0x1d60bd){return this['_changes']['find'](_0x170a50=>_0x170a50['id']===_0x1d60bd);}['markAllChangesAsAccepted'](){for(const _0x901a00 of this['_changes'])'pending'===_0x901a00['status']&&(_0x901a00['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0xfecaf){const _0x1a9944=this['_changes']['find'](_0x291a6c=>_0x291a6c['id']===_0xfecaf);_0x1a9944&&'pending'===_0x1a9944['status']&&(_0x1a9944['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0xe15333){const _0x3bef6c=this['_changes']['find'](_0x2a028c=>_0x2a028c['id']===_0xe15333);_0x3bef6c&&'pending'===_0x3bef6c['status']&&(_0x3bef6c['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x578026){const _0xd4a25d=this['_changes']['find'](_0x4c0a10=>_0x4c0a10['id']===_0x578026);_0xd4a25d&&'pending'===_0xd4a25d['status']&&(_0xd4a25d['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x51abae){const _0x4c5b4f=this['_changes']['find'](_0x231ec9=>_0x231ec9['id']===_0x51abae);_0x4c5b4f&&'outdated'===_0x4c5b4f['status']&&(_0x4c5b4f['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x147963){this['_changes']['filter'](_0x2c5404=>_0x2c5404['isActivated']&&_0x2c5404['id']!==_0x147963)['forEach'](_0x5f2f04=>{_0x5f2f04['isActivated']=!0x1;});const _0x188c24=this['_changes']['find'](_0x43adfe=>_0x43adfe['id']===_0x147963);_0x188c24&&'pending'===_0x188c24['status']&&(_0x188c24['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x61543d=>_0x61543d['isActivated'])['forEach'](_0x1a4b89=>{_0x1a4b89['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x473de4){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x32095e;if(_0x473de4){const _0x2c4adc=this['_changes']['find'](_0x26c955=>_0x26c955['id']===_0x473de4);if(_0x2c4adc&&_0x2c4adc['isRated'])return;_0x2c4adc&&(_0x32095e=_0x2c4adc['parent']['id'],_0x2c4adc['isRated']=!0x0);}const _0x18b962={'positiveCount':this['_changes']['filter'](_0x54d1dc=>'accepted'===_0x54d1dc['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x18b962,this['callId'],_0x32095e);}['_addReviewCheckResult'](_0x30edef,_0x13abe0){const _0xf5758f=this['_documentData']['elements']['get'](_0x30edef);if(!_0xf5758f)return;const _0x1aad8f=_0xf5758f['getContent']();if(_0x1aad8f===_0x13abe0)return;const _0x3f31a7=new Xs({'id':_0x30edef,'contentInitial':_0x1aad8f,'contentNew':_0x13abe0,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x3f31a7['id'],_0x3f31a7),this['fire']('reviewCheckResultAdded',{'result':_0x3f31a7,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x41e505=>'pending'===_0x41e505['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x53f148=>'pending'===_0x53f148['status'])['length']&&(this['status']='finished'));}}class si extends Zs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1e31db=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x56206b=0x0;_0x56206b<this['_reviewParams']['length'];_0x56206b++){if(!this['_reviewParams'][_0x56206b]||!this['_sourceCheck']['options'][_0x56206b])continue;const _0x489e21=this['_sourceCheck']['options'][_0x56206b],_0x25715c=_0x489e21['data']?.['find'](_0x361430=>_0x361430['id']===this['_reviewParams'][_0x56206b]);_0x25715c&&_0x1e31db['push'](_0x25715c['label']);}return _0x1e31db['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x471556,_0x52734d,_0x51e58c){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x52734d,_0x471556,_0x51e58c);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x118815{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[S];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x3f0835,_0x1ae433)=>{const _0x1f8242=this['_aiReviewCheckList']['getCheckById'](_0x1ae433['id']);if(_0x1f8242){this['_onReviewCheckRun'](_0x1ae433),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x1ae433,_0x1f8242),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x3cf637,_0x4c00e8)=>{switch(_0x4c00e8['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x4c00e8);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x542443('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x542443('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x4c00e8['status']&&'error-chunk'!==_0x4c00e8['status']&&'error-general'!==_0x4c00e8['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x531911,_0x5b0f66)=>{if(!this['_currentReviewCheckRun'])throw new _0x542443('ai-review-mode-no-current-check-run',this);const _0x1c4ec0=this['_diffContent'](_0x5b0f66['result']['contentInitial'],_0x5b0f66['result']['contentNew']);_0x5b0f66['source']['addResultChanges'](_0x5b0f66['result']['id'],_0x1c4ec0);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x313aec,_0x8fb602)=>{for(const _0x471217 of _0x8fb602['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x471217);this['_markChangePositionInEditorContent'](_0x8fb602['changes'],_0x8fb602['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x188de6,_0x4071f3)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x4071f3['change']['id'],_0x4071f3['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x2f3f76,_0x5acc73)=>{this['_onReviewCheckResultActivated'](_0x5acc73);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x59a187){_0x59a187 instanceof Error&&_0x59a187['message']['includes']('ai-request-aborted')||(_0x59a187 instanceof _0x542443?this['_logError'](_0x59a187):this['_logError'](new _0x542443('ai-review-mode-check-run-failed',this,void 0x0,_0x59a187)));}}else this['_logError'](new _0x542443('ai-review-mode-source-check-not-found',this,{'checkId':_0x1ae433['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x5c4e14=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x5c4e14['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x5c4e14['map'](_0x5cec99=>_0x5cec99['id']));const _0x328bd9=this['_currentReviewCheckRun'];_0x328bd9['markAllChangesAsAccepted'](),_0x328bd9['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x59adfc,_0x21f298)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x21f298['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x21f298['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x21f298['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x21f298['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x19fcdf,_0x589aed)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x589aed['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x589aed['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x589aed['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x589aed['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x3761f2,_0x233673)=>{this['_onActivateChange'](_0x233673);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x2389b9,_0x1732f1)=>{this['_onDeactivateChange'](_0x1732f1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x184fec,_0x14cf94)=>{this['_onChangeMarkerClicked'](_0x184fec,_0x14cf94);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x265b91,_0x2ff552)=>{this['_onChangeMarkerHovered'](_0x265b91,_0x2ff552);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x40f4ba,_0x58a426)=>{this['_onChangeMarkerRemoved'](_0x40f4ba,_0x58a426);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x5d7f28,_0x462350)=>{this['_onChangeMarkerRestored'](_0x5d7f28,_0x462350);});}['_createReviewCheckRun'](_0x4c2189,_0x570d32){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x570d32,this['_aiConnector'],_0x4c2189['params'],_0x4c2189['args']);}['_onChangeMarkerRemoved'](_0x4a2c9a,_0x5e39df){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x5e39df['changeId']);}['_onChangeMarkerRestored'](_0x1ce50f,_0x5eea4a){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x5eea4a['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x47fcd1=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x47fcd1&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x56a796=this['_aiReviewCoreEditing']['getEditor']();_0x56a796&&_0x56a796['editing']['view']['change'](_0x2b1113=>{const _0x5e0dfa=_0x56a796['editing']['view']['document']['getRoot']();_0x2b1113['removeClass']('ck-ai_review-diff',_0x5e0dfa),_0x2b1113['removeClass']('ck-ai_review-highlights',_0x5e0dfa),_0x2b1113['removeClass']('ck-ai-translate-mode-content',_0x5e0dfa);});}['_getTranslationWithDefault'](_0x54fc2f,_0x304554){const _0x40bb5c=i(this['context']['locale'],_0x54fc2f);return _0x40bb5c===_0x54fc2f?_0x304554:_0x40bb5c;}['_logError'](_0x6a647a,_0x3e74dd=!0x1){Ct(_0x6a647a['message']),_0x3e74dd||(_0x6a647a['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x570504){if('content'===this['_changeActivationSource']){const _0x2fbafe=this['_aiReviewCoreUi']['getChangeElement'](_0x570504);_0x2fbafe&&_0x88b018(_0x2fbafe['closest']('.ck-ai_review__check-run-result')||_0x2fbafe);}else{if('panel'===this['_changeActivationSource']){const _0x56f8e5=this['_getChangeContentElement'](_0x570504);if(!_0x56f8e5)return;st({'target':_0x56f8e5,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const we=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class Ws{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x4ffd60){this['id']=_0x4ffd60['id'],this['commandId']=_0x4ffd60['commandId'],this['title']=_0x4ffd60['title'],this['description']=_0x4ffd60['description'],this['isParameterized']=_0x4ffd60['isParameterized'],this['useArgs']=_0x4ffd60['useArgs'],this['options']=_0x4ffd60['options'],this['args']=_0x4ffd60['args'];}}class vo extends ts(){['_checks']=[];['setupChecks'](_0x46f522){this['_checks']=_0x46f522['map'](_0x2a69f4=>new Ws(_0x2a69f4));}get['checks'](){return this['_checks'];}['getCheckById'](_0x517773){return this['checks']['find'](_0x18154a=>_0x18154a['id']===_0x517773);}['removeCheckById'](_0x3e2684){this['_checks']=this['_checks']['filter'](_0x1ff23b=>_0x1ff23b['id']!==_0x3e2684);}}class ke extends Ws{['_models']=[];['_defaultModel']=null;constructor(_0x3ac5c6,_0x148471,_0xc372e8){super(_0x3ac5c6),this['_models']=_0x148471,this['_defaultModel']=_0xc372e8;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ws{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x459677,_0x13b025,_0x3b246e){super(_0x459677),this['prompt']=_0x459677['prompt'],this['model']=_0x459677['model'],this['model']?this['_defaultModel']=_0x13b025['find'](_0x345530=>_0x345530['id']===this['model'])||null:this['_defaultModel']=_0x3b246e;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x34750e,_0x138646,_0x22c2a6){super(),this['_allModels']=_0x34750e,this['_recommendedModels']=_0x138646,this['_defaultModel']=_0x22c2a6;}['setupChecks'](_0x405d4b){this['_checks']=_0x405d4b['map'](_0x375703=>!0x0===_0x375703['isExtra']?new Ie(_0x375703,this['_allModels'],this['_defaultModel']):'custom'===_0x375703['id']?new ke(_0x375703,this['_recommendedModels'],this['_defaultModel']):new Ws(_0x375703));}}class Ce extends Zs{['_prompt'];['_model'];constructor(_0x82895b,_0x1addf4,_0x3ab76d,_0x2fb004,_0x4068cf){super(_0x3ab76d,_0x2fb004,_0x4068cf),this['_prompt']=_0x82895b,this['_model']=_0x1addf4;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x1f116c,_0x4cb7b4,_0x51c964){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x4cb7b4,_0x1f116c,_0x51c964);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x17da1d){this['_prompt']=_0x17da1d;}set['model'](_0x495629){this['_model']=_0x495629;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x14537a){super(_0x14537a),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x59179e=>_0x59179e['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x53ace2,_0x3d7732)=>{this['_isDiffOn']=_0x3d7732['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x3ed687,_0x4246df){return _0x3ed687['isCustom']?new Ce(_0x3ed687['args']['prompt'],_0x3ed687['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4246df,this['_aiConnector']):_0x4246df['isExtra']?new Re(_0x4246df['prompt'],_0x4246df['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4246df,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4246df,this['_aiConnector'],_0x3ed687['params'],_0x3ed687['args']);}['_onReviewCheckResultActivated'](_0x2a682a){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x2a682a['change']['id']),this['_scrollToChange'](_0x2a682a['change']['id']);const _0x4c9dc9=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2a682a['change']['id']);if(!_0x4c9dc9)return;const _0x4febbd=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2a682a['change'],()=>_0x4c9dc9['getElement'](),void 0x0,'click',_0x4febbd?.['editing']?.['view']?.['getDomRoot'](),_0x4febbd?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x2a682a['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x17c958){this['_currentReviewCheckRun']&&'click'===_0x17c958['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x17c958['id']));}['_onDeactivateChange'](_0xe185a0){this['_currentReviewCheckRun']&&'balloon'===_0xe185a0['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5dee00,_0x4d5360){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4d5360['changeId']);const _0x25bbca=this['_currentReviewCheckRun']['getChangeById'](_0x4d5360['changeId']);if(!_0x25bbca)return;const _0xe2f031=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x25bbca,_0x4d5360['markerElement'],_0x4d5360['domEvent'],'click',_0xe2f031?.['editing']?.['view']?.['getDomRoot'](),_0xe2f031?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x12378a,_0x4fe888){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x1c662e=this['_currentReviewCheckRun']['getChangeById'](_0x4fe888['changeId']);if(!_0x1c662e)return;const _0x4c269f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1c662e,_0x4fe888['markerElement'],_0x4fe888['domEvent'],'hover',_0x4c269f?.['editing']?.['view']?.['getDomRoot'](),_0x4c269f?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x503b55){const _0x2500b4=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x503b55);return _0x2500b4?_0x2500b4['getElement']():null;}['_markChangePositionInEditorContent'](_0x1fff22,_0x4947b2){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x1fff22,_0x4947b2);}['_diffContent'](_0xce9b17,_0x254c3f){return this['_aiReviewCoreEditing']['diffContent'](_0xce9b17,_0x254c3f);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x292d2a){const _0x23dffd=this['_aiReviewCoreEditing']['getEditor']();_0x292d2a?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x23dffd&&_0x23dffd['editing']['view']['change'](_0x3d1a66=>{const _0x3bb844=_0x23dffd['editing']['view']['document']['getRoot']();for(const _0x389aa9 of _0x3bb844['getClassNames']())_0x389aa9['startsWith']('ck-ai_review-')&&_0x3d1a66['removeClass'](_0x389aa9,_0x3bb844);_0x3d1a66['addClass'](_0x292d2a?'ck-ai_review-diff':'ck-ai_review-highlights',_0x3bb844);});}async['_getChecksList'](){const _0xf53245=[...we,...this['_getExtraChecks']()],_0x3e9584=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x3e9584,_0xf53245);let _0x115393=_0xf53245;this['_hasDefaultAvailableCommands']||(_0x115393=_0x3e9584['map'](_0x5aa92b=>_0xf53245['find'](_0x123460=>_0x123460['id']===_0x5aa92b))['filter'](_0x4cb654=>!!_0x4cb654)),_0x115393=_0x115393['map'](_0x13d841=>_0x13d841['isExtra']?_0x13d841:this['_translateReviewCheck'](_0x13d841));const _0x123ed7=_0x115393['some'](_0x4f4ba6=>_0x4f4ba6['isExtra']||'custom'===_0x4f4ba6['id']);let _0x238d95=[],_0x3e416c=[],_0x5b0990=null;if(_0x123ed7){const _0x20bae3=await this['_getModels']();_0x238d95=_0x20bae3['all'],_0x3e416c=_0x20bae3['recommended'],_0x5b0990=_0x20bae3['default'];}const _0x1abaf7=new _e(_0x238d95,_0x3e416c,_0x5b0990);return _0x1abaf7['setupChecks'](_0x115393),_0x123ed7&&this['_filterChecksWithMissingModel'](_0x1abaf7),_0x1abaf7;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x43e355=>({'id':_0x43e355['id'],'commandId':_0x43e355['id'],'title':_0x43e355['label'],'description':_0x43e355['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x43e355['prompt'],'model':_0x43e355['model']}));}['_logErrorForNonExistentChecks'](_0x5fda74,_0x2d8686){const _0x6b7567=_0x5fda74['filter'](_0x54977=>!_0x2d8686['some'](_0x5ce858=>_0x5ce858['id']===_0x54977));_0x6b7567['length']&&this['_logError'](new _0x542443('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x6b7567['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x5bfc43=new At({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x5bfc43['getAll'](),'recommended':await _0x5bfc43['getAvailableModels'](),'default':await _0x5bfc43['getDefault']()};}catch(_0x36bb8e){return this['_logError'](new _0x542443('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x36bb8e)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x2c9ed3){const _0x2796df='AI_REVIEW_CHECK_'+_0x2c9ed3['id']['toUpperCase']()['replaceAll']('-','_'),_0x1dea25={..._0x2c9ed3,'title':this['_getTranslationWithDefault'](_0x2796df+'_TITLE',_0x2c9ed3['title']),'description':this['_getTranslationWithDefault'](_0x2796df+'_DESCRIPTION',_0x2c9ed3['description'])};return _0x2c9ed3['options']&&(_0x1dea25['options']=_0x2c9ed3['options']['map'](_0x4b2c7f=>({..._0x4b2c7f,'label':this['_getTranslationWithDefault'](_0x2796df+'_OPTIONS_LABEL',_0x4b2c7f['label']||''),'data':_0x4b2c7f['data']?_0x4b2c7f['data']['map'](_0x1ae030=>({..._0x1ae030,'label':this['_getTranslationWithDefault'](_0x2796df+'_OPTIONS_DATA_'+_0x1ae030['id']['toUpperCase'](),_0x1ae030['label'])})):void 0x0}))),_0x1dea25;}['_filterChecksWithMissingModel'](_0x476ef9){const _0x56ebb7=[];_0x476ef9['checks']['forEach'](_0x21a8d3=>{(_0x21a8d3 instanceof Ie&&!_0x21a8d3['defaultModel']||_0x21a8d3 instanceof ke&&!_0x21a8d3['models']['length'])&&_0x56ebb7['push'](_0x21a8d3['id']);}),_0x56ebb7['length']&&_0x56ebb7['forEach'](_0x1f7e50=>{_0x476ef9['removeCheckById'](_0x1f7e50),this['_logError'](new _0x542443('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x1f7e50}),!0x0);});}}class Wa extends _0x118815{static get['requires'](){return[pe,ge,de];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class jr extends Ws{get['apiId'](){return'translate';}}class Pe extends vo{['setupChecks'](_0x5b5e5d){this['_checks']=_0x5b5e5d['map'](_0x332bf6=>new jr(_0x332bf6));}}class Se extends si{['_title'];constructor(_0x30131e,_0x504426,_0x1c33c6,_0x4a831f,_0x44ca0c,_0x36f4d9){super(_0x30131e,_0x504426,_0x1c33c6,_0x44ca0c,_0x36f4d9),this['_title']=_0x4a831f;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x3f95ea){super(_0x3f95ea),this['context']['config']['define']('ai.translate.languages',[{'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'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x55e61b,_0x36a8c3){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x36a8c3,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x55e61b['params'],_0x55e61b['args']);}['_onReviewCheckResultActivated'](_0x298345){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x298345['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x298345['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x405407){this['_currentReviewCheckRun']&&('hover'===_0x405407['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x405407['id'])),'click'===_0x405407['uiInteraction']&&this['_scrollToChange'](_0x405407['id']));}['_onDeactivateChange'](_0x4c81a0){this['_currentReviewCheckRun']&&'panel'===_0x4c81a0['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x515a8a,_0x2a3543){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2a3543['changeId']),this['_scrollToChange'](_0x2a3543['changeId']));}['_onChangeMarkerHovered'](_0x1739e1,_0x224ef7){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x224ef7['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x224ef7['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0xf193fd){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0xf193fd);}['_markChangePositionInEditorContent'](_0xefb323,_0x5b866a){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0xefb323,_0x5b866a);}['_diffContent'](_0x3d9e7c,_0x32b61c){return this['_aiReviewCoreEditing']['diffContent'](_0x3d9e7c,_0x32b61c,!0x0);}['_onReviewCheckRun'](){const _0x1fd66c=this['_aiReviewCoreEditing']['getEditor']();_0x1fd66c&&_0x1fd66c['editing']['view']['change'](_0x16a815=>{const _0x1c9b43=_0x1fd66c['editing']['view']['document']['getRoot']();for(const _0x26f24d of _0x1c9b43['getClassNames']())(_0x26f24d['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x26f24d)&&_0x16a815['removeClass'](_0x26f24d,_0x1c9b43);_0x16a815['addClass']('ck-ai-translate-mode-content',_0x1c9b43);});}async['_getChecksList'](){const _0x335ed9=[],_0x5d0a66=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x5db886 of _0x5d0a66)_0x335ed9['push']({'title':_0x5db886['label'],'id':_0x5db886['id'],'commandId':_0x5db886['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x5db886['id']}});const _0x3ead28=new Pe();return _0x3ead28['setupChecks'](this['_translateChecks'](_0x335ed9)),_0x3ead28;}['_translateChecks'](_0x5144cb){return _0x5144cb['map'](_0x208fb8=>{const _0x20fd2a='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x208fb8['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x208fb8,'title':this['_getTranslationWithDefault'](_0x20fd2a,_0x208fb8['title'])};});}}class Le extends Ve{constructor(_0x4dd27e,_0x2b8817){super(_0x4dd27e,_0x2b8817),this['on']('set:isLoading',(_0x3e6f3f,_0x34ec52,_0x2d52aa)=>{_0x2d52aa&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x789080,_0x588706,_0x1ac3c0)=>{_0x1ac3c0&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x35ba3e=super['_createAcceptAllButtonView']();return _0x35ba3e['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x35ba3e;}['_createExitReviewButtonView'](){const _0x477286=super['_createExitReviewButtonView']();return _0x477286['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x477286;}}class Ne extends je{['_setupTemplate'](){const _0x1abac9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x1abac9['if']('isVisible','ck-hidden',_0x469846=>!_0x469846)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x1abac9['if']('isVisible','ck-hidden',_0x11bc61=>!_0x11bc61)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x266a9a=this['context']['locale'],_0x350a32=new _0x2e3f47(_0x266a9a,{'label':i(_0x266a9a,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x3515b8,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x5c085e=new Ae(_0x266a9a,{'header':_0x350a32,'list':new Ne(_0x266a9a),'results':new Le(_0x266a9a,{'generalErrorText':i(_0x266a9a,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x266a9a,{'headerText':i(_0x266a9a,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x266a9a,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x266a9a,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x5c085e['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x5c085e;}['registerTab'](){const _0xba5859=this['context']['plugins']['get']('AITabs');_0xba5859['view']['on']('activateTab',(_0xe8a2bc,_0xa2b046)=>{'translate'===_0xa2b046?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0xba5859['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x3515b8,'order':0x0,'content':this['_mainView']});}}class Ya extends _0x118815{static get['requires'](){return[rr,tr,de];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,$n as AIAssistant,n as AIAssistantUI,P as AIBalloon,Ua as AIChat,ht as AIChatController,gt as AIChatHistory,rt as AIChatHistoryController,ct as AIChatHistoryUI,Ba as AIChatShortcuts,ut as AIChatUI,S as AIConnector,D as AIEditing,Ga as AIEditorIntegration,Qt as AIQuickActionType,Ka as AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ws as AIReviewCheck,Xs as AIReviewCheckResult,Zs as AIReviewCheckRun,Wa as AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,_t as AITabs,ar as AITextAdapter,jt as AIToggleButtonUI,Ya as AITranslate,rr as AITranslateController,tr as AITranslateUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,E as ShowAIAssistantCommand,Oi as ToggleAICommand,Ri as createResizeButton,qn as getDefaultAICommands};
23
+ import{Plugin as _0x511be8,Command as Lt,ContextPlugin as _0x575928,Editor as dt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x225b63,IconCheck as _0x34e643,IconError as _0x3e02e6,IconSubmit as _0x4fc1d8,IconAIHistory as Nt,IconMagicWand as _0x2ff5c5,IconRobotPencil as _0x98228,IconMaximize as _0x327f4b,IconMinimize as _0x932832,IconShowChangesOn as _0x45a410,IconShowChangesOff as _0x4ecb10,IconDocument as _0x822d49,IconBoxWithCross as _0x815ee6,IconBoxWithCheck as _0x546f60,IconBoxWithMarker as _0x50a3ec,IconInfo as _0x42893a,IconLoupe as _0x3c98bc,IconCancel as _0x557804,IconStop as _0x2ff977,IconAIChat as vt,IconPlus as _0x40fce4,IconPin as _0x9d14c3,IconThreeHorizontalDots as _0xe97e9,IconChevronDown as _0x460c5d,IconChevronUp as _0x567c89,IconOutdated as tc,IconEye as _0x1597a1,IconEyeCrossedOut as _0x11989d,IconChevronRight as _0x3d890b,IconAIReview as _0x375882,IconAITranslate as _0x6cdaad}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x926b30,CKEditorError as _0x36ca17,ObservableMixin as ts,global as _0x28fe94,isVisible as _0x255643,Rect as _0x5b8f6e,Collection as _0x4b57cf,FocusTracker as _0x22c832,KeystrokeHandler as _0x2b0c94,first as _0x17af57,logWarning as _0x3bfc82,logError as gt,toArray as _0x2d74dd,EmitterMixin as _0x290e58,scrollViewportToShowTarget as _0x538b49,scrollAncestorsToShowTarget as _0x3c5789,ResizeObserver as _0xb25201,_isMotionReduced as Rt,getConstrainedViewportRect as _0x3e7313,DomEmitterMixin as _0x48ef7b}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x178dcf,ButtonView as _0x1e9460,View as _0x184e76,SpinnerView as _0x4435de,IconView as _0xc034b,AutocompleteView as _0x4043f2,ListView as _0x35cdc6,ListItemGroupView as _0x3633a2,ListItemView as _0x4ffa3a,ButtonLabelView as _0x55674c,FocusCycler as _0x56c0d3,createLabeledTextarea as _0x5db2e8,Dialog as _0x6460a2,createDropdown as _0x546896,addMenuToDropdown as _0xf23687,MenuBarMenuView as _0x53e868,MenuBarMenuListItemButtonView as _0x12221a,DialogViewPosition as _0x48fc7b,MenuBarMenuListView as _0x685ce2,MenuBarMenuListItemView as _0x217236,BodyCollection as _0x591ff4,BalloonPanelView as _0x2fff3d,clickOutsideHandler as _0x1ff4d5,addListToDropdown as _0x321091,UIModel as _0xf9ff1d,submitHandler as _0xa2cd14,LabeledFieldView as _0xfba0d2,createLabeledInputText as th,FormHeaderView as _0x41e0a3,HighlightedTextView as _0x56f45c,ViewCollection as _0x4e90c7,FileDialogButtonView as _0x254afa,InputTextView as _0x9c7843,SearchTextView as _0x46980e,ListItemButtonView as _0x8cf39b,ButtonLabelWithHighlightView as _0x32742a,DropdownMenuPanelPositioningFunctions as _0x291da6,BalloonToolbar as te,FormRowView as _0x20574d,TextareaView as _0x2dac43}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x4669c5,ClipboardMarkersUtils as _0x4d7ada}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x4f929f,ViewDataTransfer as _0xab6e54,ViewUpcastWriter as _0x5bedf2,Matcher as _0xe7dd0a,_DetachOperation as et,_insertIntoModelNodeList as _0x1fa6b7,_removeFromModelNodeList as to,ModelRange as it,transformOperationSets as nt,ViewDowncastWriter as Dt,ModelDocumentFragment as tt,ModelPosition as st,ModelTreeWalker as _0x3f0c2e,MarkerOperation as _0x57d058,InsertOperation as _0x1e2b01}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x5682c5,escape as _0xac888d,escapeRegExp as _0x3383a1,debounce as _0xd2e461}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x413294}from'htmlparser2';import{isTag as _0x5d51b2,findOne as yt,getParent as _0x2456ab,findAll as _0x3e90f0,removeElement as _0x4c1d4c,replaceElement as _0x482733,prepend as _0x2b8438,prependChild as _0x12356b,appendChild as _0x59ec57,append as _0x2bdf7a,find as _0x1a1c14,isComment as _0x3bac06,getChildren as _0x3d953b,textContent as _0x1aed79}from'domutils';import _0x3807c6 from'dom-serializer';import{Document as Et,Element as _0x10ebb7,Text as _0x280441,cloneNode as _0x54590c,isDocument as _0x22ff9c,isText as _0x30a61f,NodeWithChildren as _0x5f1e12}from'domhandler';import{MarkdownGfmMdToHtml as _0x26b84e}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x893b7e,DocumentCompare as _0x29a341,DATA_ID_MODEL_ATTRIBUTE as Ct,ConfirmMixin as _0x3bd6ad,LateFocusDropdownButtonView as _0x4e06b6,getAllMarkersDomElementsSorted as _0x450a79,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0x169cf0,getMarkerDomElement as _0x5b13cd}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x1e538d}from'es-toolkit';import _0x13f10f from'morphdom';import{IconWeb as _0xd367bf,IconClose as _0xf5ecf7,IconDocument as _0x35a5eb,IconSelection as _0x5a0e45,IconFileUpload as _0x55fdc0,IconLink as _0xb249a6,IconBulb as _0x433ff5,IconAI as _0x1d5463,IconPreviousArrow as _0x29f3c3,IconCheck as _0xa54ca6,IconDocumentOutline as _0x56717c,IconPaperClip as _0xb4fa02,IconBrowseFiles as _0x3baee4,IconDropdownArrow as _0xd17942,IconAIChat as _0x2be426,IconAIReview as _0x560fa1,IconAITranslate as Vt,IconAIAskAI as _0x6818cf,IconThumbUp as _0x16e3fe,IconThumbDown as _0x46fa26,IconCopy as _0xb692f9,IconShowChangesOff as _0x196b91,IconShowChangesOn as _0x3d498c,IconAIQuickActions as _0x363d5b,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as Ft,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x3b6fc0,IconNextArrow as _0x3a3110}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x148630}from'diff';const x='_ungrouppedCommands';function o(_0x40709d,_0x53e7f1){const _0x5be2a9=(0x0,_0x53e7f1['t'])('Other');return _0x40709d['length']?'groupId'in _0x40709d[0x0]?_0x40709d:[{'groupId':x,'groupLabel':_0x5be2a9,'order':0x1/0x0,'commands':_0x40709d}]:[{'groupId':x,'groupLabel':_0x5be2a9,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x511be8{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1b4acd}=this,_0x40d5dd=['ck-fake-ai-selection'];_0x1b4acd['config']['get']('ai.assistant.useTheme')&&_0x40d5dd['push']('ck-ai-assistant-ui_theme'),_0x1b4acd['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x40d5dd,'priority':0xc}}),_0x1b4acd['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x58fb41,{writer:_0x459fa2})=>{if(!_0x58fb41['markerRange']['isCollapsed'])return null;const _0x2e4ee6=_0x459fa2['createUIElement']('span');return _0x459fa2['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2e4ee6),_0x2e4ee6;}});}['afterInit'](){!async function(_0x2a56cd){const _0x149f60=_0xed93ba([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]),_0x19a658=0x3dffc4e1,_0x366a24=0x3df84cf1^_0x19a658,_0x4aca38=window[_0xed93ba([0x44,0x61,0x74,0x65])][_0xed93ba([0x6e,0x6f,0x77])](),_0x124832=_0x2a56cd[_0xed93ba([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2401e6=new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5c3585=>{_0x124832[_0xed93ba([0x6f,0x6e,0x63,0x65])](_0xed93ba([0x72,0x65,0x61,0x64,0x79]),_0x5c3585);}),_0xd6f700={[_0xed93ba([0x6b,0x74,0x79])]:_0xed93ba([0x45,0x43]),[_0xed93ba([0x75,0x73,0x65])]:_0xed93ba([0x73,0x69,0x67]),[_0xed93ba([0x63,0x72,0x76])]:_0xed93ba([0x50,0x2d,0x32,0x35,0x36]),[_0xed93ba([0x78])]:_0xed93ba([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]),[_0xed93ba([0x79])]:_0xed93ba([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]),[_0xed93ba([0x61,0x6c,0x67])]:_0xed93ba([0x45,0x53,0x32,0x35,0x36])},_0x1628b2=_0x124832[_0xed93ba([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xed93ba([0x67,0x65,0x74])](_0xed93ba([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x130826(){let _0x5ebbc5,_0x2fd6f6=null,_0x3b7f18=null;try{if(_0x1628b2==_0xed93ba([0x47,0x50,0x4c]))return _0xed93ba([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5ebbc5=_0x5d3c63(),!_0x5ebbc5)return _0xed93ba([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5ebbc5[_0xed93ba([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3b7f18=_0x2b968e(_0x5ebbc5[_0xed93ba([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5ebbc5[_0xed93ba([0x6a,0x74,0x69])])),await _0x532a9e()?_0x1ace83()?_0x1d2757()?_0xed93ba([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x300e30()?(_0x5ebbc5[_0xed93ba([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xed93ba([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2fd6f6=_0x39731f(_0xed93ba([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4d33bd()):_0xed93ba([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xed93ba([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xed93ba([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0xed93ba([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1d2757(){const _0x129868=[_0xed93ba([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xed93ba([0x74,0x72,0x69,0x61,0x6c])][_0xed93ba([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5ebbc5[_0xed93ba([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4aca38/0x3e8:0xe10*_0x366a24;return _0x5ebbc5[_0xed93ba([0x65,0x78,0x70])]<_0x129868;}function _0x1ace83(){const _0x1c43e9=_0x5ebbc5[_0xed93ba([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1c43e9&&(!!_0x1c43e9[_0xed93ba([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xed93ba([0x2a]))||!!_0x1c43e9[_0xed93ba([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xed93ba([0x41,0x49])));}function _0x300e30(){const _0x5a6b3e=_0x5ebbc5[_0xed93ba([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5a6b3e||0x0==_0x5a6b3e[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x28ca31}=new URL(window[_0xed93ba([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5a6b3e[_0xed93ba([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x28ca31))return!0x0;const _0x1f61c6=_0x28ca31[_0xed93ba([0x73,0x70,0x6c,0x69,0x74])](_0xed93ba([0x2e]));return _0x5a6b3e[_0xed93ba([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xf648e5=>_0xf648e5[_0xed93ba([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xed93ba([0x2a])))[_0xed93ba([0x6d,0x61,0x70])](_0xa5c1b9=>_0xa5c1b9[_0xed93ba([0x73,0x70,0x6c,0x69,0x74])](_0xed93ba([0x2e])))[_0xed93ba([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1f88c0=>_0x1f88c0[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x1f61c6[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xed93ba([0x6d,0x61,0x70])](_0x10c6cb=>Array(_0x1f61c6[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x10c6cb[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xed93ba([0x66,0x69,0x6c,0x6c])](_0x10c6cb[0x0]===_0xed93ba([0x2a])?_0xed93ba([0x2a]):'')[_0xed93ba([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x10c6cb))[_0xed93ba([0x73,0x6f,0x6d,0x65])](_0x33f497=>_0x1f61c6[_0xed93ba([0x65,0x76,0x65,0x72,0x79])]((_0x561d0f,_0x5d42da)=>_0x33f497[_0x5d42da]===_0x561d0f||_0x33f497[_0x5d42da]===_0xed93ba([0x2a])));}function _0x4d33bd(){return _0x2fd6f6&&_0x3b7f18?new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5e5a8d,_0x76d8e4)=>{_0x2fd6f6[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x5e5a8d,_0x76d8e4),_0x3b7f18[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x34a846=>{_0x34a846!=_0xed93ba([0x56,0x61,0x6c,0x69,0x64])&&_0x5e5a8d(_0x34a846);},_0x76d8e4);}):_0x2fd6f6||_0x3b7f18||_0xed93ba([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2b968e(_0x2a0d3e,_0x3d40b5){return new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x48ae6c=>{if(_0x591d73())return _0x48ae6c(_0xed93ba([0x56,0x61,0x6c,0x69,0x64]));_0x4eaa63(),_0x124832[_0xed93ba([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xed93ba([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xe5d514=!0x1;const _0x9eb9a4=_0x926b30();function _0x110a5e(_0x36d1be){return!!_0x36d1be&&(typeof _0x36d1be===_0xed93ba([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x36d1be===_0xed93ba([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x36d1be[_0xed93ba([0x74,0x68,0x65,0x6e])]===_0xed93ba([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x36d1be[_0xed93ba([0x63,0x61,0x74,0x63,0x68])]===_0xed93ba([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x25730d(_0x259201){_0x3230b1(_0x259201)[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x4922f5=>{if(!_0x4922f5||_0x4922f5[_0xed93ba([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xed93ba([0x6f,0x6b]))return _0xed93ba([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5dc9dc(_0x5e948b(_0x9eb9a4+_0x3d40b5))!=_0x4922f5[_0xed93ba([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xed93ba([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xed93ba([0x56,0x61,0x6c,0x69,0x64]);})[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x20000e=>(_0x4a5499(),_0x20000e),()=>{const _0x17537e=_0x1a5a16();return null==_0x17537e?(_0x4a5499(),_0xed93ba([0x56,0x61,0x6c,0x69,0x64])):_0xed93ba(_0x4aca38-_0x17537e>(0x19f340e1^_0x19a658)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x48ae6c)[_0xed93ba([0x63,0x61,0x74,0x63,0x68])](()=>{_0x48ae6c(_0xed93ba([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3ece40=0x3dc92a61^_0x19a658;function _0x4a5499(){const _0x5b14e2=_0xed93ba([0x6c,0x6c,0x63,0x74,0x2d])+_0x5dc9dc(_0x5e948b(_0x2a0d3e)),_0x1a15e2=_0x234714(_0x5dc9dc(window[_0xed93ba([0x4d,0x61,0x74,0x68])][_0xed93ba([0x63,0x65,0x69,0x6c])](_0x4aca38/_0x3ece40)));window[_0xed93ba([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xed93ba([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5b14e2,_0x1a15e2);}function _0x1a5a16(){const _0xdb365a=_0xed93ba([0x6c,0x6c,0x63,0x74,0x2d])+_0x5dc9dc(_0x5e948b(_0x2a0d3e)),_0x4a1441=window[_0xed93ba([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xed93ba([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xdb365a);return _0x4a1441?window[_0xed93ba([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x234714(_0x4a1441),0x10)*_0x3ece40:null;}function _0x3230b1(_0x380a71){return new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x53db87,_0x311915)=>{_0x380a71[_0xed93ba([0x74,0x68,0x65,0x6e])](_0x53db87,_0x311915),window[_0xed93ba([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x311915,0x3dfe1021^_0x19a658);});}}_0x124832[_0xed93ba([0x6f,0x6e])](_0xed93ba([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x343cfb,_0x29710a)=>{if(_0x29710a[0x0]!=_0x2a0d3e)return _0x48ae6c(_0xed93ba([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x29710a[0x1]={..._0x29710a[0x1],[_0xed93ba([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x9eb9a4};},{[_0xed93ba([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xed93ba([0x68,0x69,0x67,0x68])}),_0x124832[_0xed93ba([0x6f,0x6e])](_0xed93ba([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2c9852=>{_0x110a5e(_0x2c9852[_0xed93ba([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xe5d514=!0x0,_0x25730d(_0x2c9852[_0xed93ba([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xed93ba([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xed93ba([0x6c,0x6f,0x77])}),_0x2401e6[_0xed93ba([0x74,0x68,0x65,0x6e])](()=>{_0xe5d514||_0x48ae6c(_0xed93ba([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x591d73(){return _0x124832[_0xed93ba([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xed93ba([0x76,0x69,0x65,0x77])][_0xed93ba([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xed93ba([0x61,0x75,0x74,0x6f]);}function _0x4eaa63(){_0x124832[_0xed93ba([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xed93ba([0x76,0x69,0x65,0x77])][_0xed93ba([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xed93ba([0x61,0x75,0x74,0x6f]);}}function _0x39731f(_0x56ddc0){const _0x67df6e=[new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x37bcb4=>setTimeout(_0x37bcb4,0x3df6fa2d^_0x19a658)),_0x2401e6[_0xed93ba([0x74,0x68,0x65,0x6e])](()=>new window[(_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4c9587=>{let _0x239f6b=0x0;_0x124832[_0xed93ba([0x6d,0x6f,0x64,0x65,0x6c])][_0xed93ba([0x6f,0x6e])](_0xed93ba([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x37ade9,_0xcd450)=>{_0xcd450[0x0][_0xed93ba([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x239f6b++,_0x239f6b==(0x3dffc109^_0x19a658)&&(_0x4c9587(),_0x37ade9[_0xed93ba([0x6f,0x66,0x66])]());});}))];return window[_0xed93ba([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xed93ba([0x72,0x61,0x63,0x65])](_0x67df6e)[_0xed93ba([0x74,0x68,0x65,0x6e])](()=>_0x56ddc0);}async function _0x400715(){await _0x2401e6,_0x124832[_0xed93ba([0x6d,0x6f,0x64,0x65,0x6c])][_0xed93ba([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x516507,_0x124832[_0xed93ba([0x6d,0x6f,0x64,0x65,0x6c])][_0xed93ba([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x516507,_0x124832[_0xed93ba([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xed93ba([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2f1177(_0x2de4b4){const _0x279346=_0x1d1b13();_0x124832[_0x279346]=_0xed93ba([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2de4b4,_0x2de4b4!=_0xed93ba([0x56,0x61,0x6c,0x69,0x64])&&_0x400715();}function _0x1d1b13(){const _0xf15689=window[_0xed93ba([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xed93ba([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xed93ba([0x6e,0x6f,0x77])]())[_0xed93ba([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xed93ba([0x2e]),'');let _0x24a771=_0xed93ba([0x6e]);for(let _0x400ceb=0x0;_0x400ceb<_0xf15689[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x400ceb+=0x2){let _0xe724c2=window[_0xed93ba([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xf15689[_0xed93ba([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x400ceb,_0x400ceb+0x2));_0xe724c2>=_0x149f60[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xe724c2-=_0x149f60[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x24a771+=_0x149f60[_0xe724c2];}return _0x24a771;}function _0x5d3c63(){const _0xd8f9a=_0x1628b2[_0xed93ba([0x73,0x70,0x6c,0x69,0x74])](_0xed93ba([0x2e]));if(0x3!=_0xd8f9a[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3792d9(_0xd8f9a[0x1]);function _0x3792d9(_0x18bd63){const _0x93f3f1=_0x19d528(_0x18bd63);return _0x93f3f1&&_0x63f661()?_0x93f3f1:null;function _0x63f661(){const _0x35cb27=_0x93f3f1[_0xed93ba([0x6a,0x74,0x69])],_0x8f3451=window[_0xed93ba([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x35cb27[_0xed93ba([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x35cb27[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3fcfd4={..._0x93f3f1,[_0xed93ba([0x6a,0x74,0x69])]:_0x35cb27[_0xed93ba([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x35cb27[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3fcfd4[_0xed93ba([0x76,0x63])],_0x5e948b(_0x3fcfd4)==_0x8f3451;}}}async function _0x532a9e(){let _0x2fc7bf=!0x0;try{const _0x490e5c=_0x1628b2[_0xed93ba([0x73,0x70,0x6c,0x69,0x74])](_0xed93ba([0x2e])),[_0x384d29,_0x32a7e8,_0x203e0c]=_0x490e5c;return _0x10b7dc(_0x384d29),await _0x415d1b(_0x384d29,_0x32a7e8,_0x203e0c),_0x2fc7bf;}catch{return!0x1;}function _0x10b7dc(_0x17934a){const _0x483aae=_0x19d528(_0x17934a);_0x483aae&&_0x483aae[_0xed93ba([0x61,0x6c,0x67])]==_0xed93ba([0x45,0x53,0x32,0x35,0x36])||(_0x2fc7bf=!0x1);}async function _0x415d1b(_0x514894,_0x1a7cf3,_0x268b04){const _0x27a56f=window[_0xed93ba([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xed93ba([0x66,0x72,0x6f,0x6d])](_0x17c8f9(_0x268b04),_0x109dcb=>_0x109dcb[_0xed93ba([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x117cc5=new window[(_0xed93ba([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xed93ba([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x514894+_0xed93ba([0x2e])+_0x1a7cf3),_0x5e22fa=window[_0xed93ba([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xed93ba([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5e22fa)return;const _0x519f6f=await _0x5e22fa[_0xed93ba([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xed93ba([0x6a,0x77,0x6b]),_0xd6f700,{[_0xed93ba([0x6e,0x61,0x6d,0x65])]:_0xed93ba([0x45,0x43,0x44,0x53,0x41]),[_0xed93ba([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xed93ba([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xed93ba([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5e22fa[_0xed93ba([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xed93ba([0x6e,0x61,0x6d,0x65])]:_0xed93ba([0x45,0x43,0x44,0x53,0x41]),[_0xed93ba([0x68,0x61,0x73,0x68])]:{[_0xed93ba([0x6e,0x61,0x6d,0x65])]:_0xed93ba([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x519f6f,_0x27a56f,_0x117cc5)||(_0x2fc7bf=!0x1);}}function _0x19d528(_0x515c10){return _0x515c10[_0xed93ba([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xed93ba([0x65,0x79]))?JSON[_0xed93ba([0x70,0x61,0x72,0x73,0x65])](_0x17c8f9(_0x515c10)):null;}function _0x17c8f9(_0x41dd3e){return window[_0xed93ba([0x61,0x74,0x6f,0x62])](_0x41dd3e[_0xed93ba([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xed93ba([0x2b]))[_0xed93ba([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xed93ba([0x2f])));}function _0x5e948b(_0xd8a795){let _0x21c246=0x1505;function _0x752815(_0x47c5b4){for(let _0x48800d=0x0;_0x48800d<_0x47c5b4[_0xed93ba([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x48800d++){const _0x5c6c84=_0x47c5b4[_0xed93ba([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x48800d);_0x21c246=(_0x21c246<<0x5)+_0x21c246+_0x5c6c84,_0x21c246&=_0x21c246;}}function _0x939d6f(_0x726641){Array[_0xed93ba([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x726641)?_0x726641[_0xed93ba([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x939d6f):_0x726641&&typeof _0x726641==_0xed93ba([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xed93ba([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x726641)[_0xed93ba([0x73,0x6f,0x72,0x74])]()[_0xed93ba([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2d45b1,_0x11f25f])=>{_0x752815(_0x2d45b1),_0x939d6f(_0x11f25f);}):_0x752815(window[_0xed93ba([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x726641));}return _0x939d6f(_0xd8a795),_0x21c246>>>0x0;}function _0x5dc9dc(_0x2043f3){return _0x2043f3[_0xed93ba([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xed93ba([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xed93ba([0x30]));}function _0x234714(_0x3dc43d){return _0x3dc43d[_0xed93ba([0x73,0x70,0x6c,0x69,0x74])]('')[_0xed93ba([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xed93ba([0x6a,0x6f,0x69,0x6e])]('');}function _0x516507(){}function _0xed93ba(_0x3ca062){return _0x3ca062['map'](_0x544f07=>String['fromCharCode'](_0x544f07))['join']('');}_0x2f1177(await _0x130826());}(this);}['showFakeVisualSelection'](){const _0x5ca5fe=this['editor']['model'];_0x5ca5fe['change'](_0x255ae6=>{const _0x45e04b=_0x5ca5fe['document']['selection']['getRanges']();let _0x2bc3e4=0x0;for(const _0x1c0304 of _0x45e04b){const _0x47c9e6=f+':'+_0x2bc3e4;if(_0x5ca5fe['markers']['has'](_0x47c9e6))_0x255ae6['updateMarker'](_0x47c9e6,{'range':_0x1c0304});else{if(_0x1c0304['start']['isAtEnd']){const _0x2fbc29=_0x1c0304['start']['getLastMatchingPosition'](({item:_0x344bd2})=>!_0x5ca5fe['schema']['isContent'](_0x344bd2),{'boundaries':_0x1c0304});_0x255ae6['addMarker'](_0x47c9e6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x255ae6['createRange'](_0x2fbc29,_0x1c0304['end'])});}else _0x255ae6['addMarker'](_0x47c9e6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1c0304});}_0x2bc3e4++;}});}['hideFakeVisualSelection'](){const _0x3c3013=this['editor']['model'],_0x5e0426=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x5e0426['length']&&_0x3c3013['change'](_0x468668=>{_0x5e0426['forEach'](_0x3a6152=>{_0x468668['removeMarker'](_0x3a6152);});});}['insertContent'](_0x4881f3,_0x5561c9){const _0x52efad=this['_getAISelection'](),_0x400956=_0x5561c9||_0x52efad['getFirstRange']();this['editor']['model']['canEditAt'](_0x400956)&&this['editor']['model']['change'](_0x1b6883=>{this['hideFakeVisualSelection'](),_0x5561c9||this['_resetContentOfSelectedTableCells'](_0x1b6883,_0x52efad),this['_pasteHTMLUsingClipboard']({'insertAt':_0x400956,'writer':_0x1b6883,'html':_0x4881f3});});}['insertContentBelow'](_0x1d72ce){const {model:_0x390b73}=this['editor'],_0xf7cceb=this['_getAISelection']();_0x390b73['change'](()=>{const _0x5cbdc6=this['_prepareTableInsertBelowPosition'](_0x1d72ce,_0xf7cceb)||this['_getDefaultInsertBelowPosition'](_0xf7cceb);this['insertContent'](_0x1d72ce,_0x5cbdc6);});}['_getAISelection'](){const _0x5adf36=this['editor']['model'],_0x37b6e6=Array['from'](_0x5adf36['markers']['getMarkersGroup'](f))['map'](_0x40f69f=>_0x40f69f['getRange']());return _0x5adf36['createSelection'](_0x37b6e6);}['_pasteHTMLUsingClipboard']({writer:_0x56794c,html:_0x2ab6b4,insertAt:_0x188965}){const {view:_0x520eaa}=this['editor']['editing'],_0x18c144=this['editor']['plugins']['get'](_0x4669c5),_0x69a5af=new Kn();_0x69a5af['setData']('text/html',_0x2ab6b4);const _0xbb1cfc=new ClipboardEvent('paste',{'clipboardData':_0x69a5af}),_0x483390=new _0x4f929f(_0x520eaa,_0xbb1cfc,{'dataTransfer':new _0xab6e54(_0x69a5af)});_0x56794c['setSelection'](_0x188965);const _0x2a9a23=(_0x5039b3,_0x596bc3)=>{_0x596bc3['resultRange']&&_0x56794c['setSelection'](_0x596bc3['resultRange']);};_0x18c144['once']('contentInsertion',_0x2a9a23,{'priority':'lowest'}),_0x520eaa['document']['fire']('paste',_0x483390),_0x18c144['off']('contentInsertion',_0x2a9a23);}['_getDefaultInsertBelowPosition'](_0x328505){const {model:_0x3395c5}=this['editor'],_0x53cbd2=Array['from'](_0x328505['getSelectedBlocks']());return _0x53cbd2['length']?_0x3395c5['createPositionAfter'](_0x53cbd2['pop']()):_0x328505['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x4f429d,_0x15fe68){const {model:_0x6affd5,plugins:_0x11323a}=this['editor'];if(_0x11323a['has']('TableUtils')){const _0xc69a88=_0x11323a['get']('TableUtils')['getSelectedTableCells'](_0x15fe68);if(_0xc69a88['length']){const _0x99bbce=this['_getTableRowCountFromContent'](_0x4f429d),_0x129412=this['_createEmptyTableRows'](_0xc69a88,_0x99bbce);return _0x6affd5['createPositionAt'](_0x129412,0x0);}}return null;}['_getTableRowCountFromContent'](_0x4f0235){const _0x3053df=this['editor']['plugins']['get']('TableUtils'),_0xa62ab7=this['editor']['data']['parse'](_0x4f0235),_0x5b4fdd=Array['from'](_0xa62ab7['getChildren']())['filter'](_0x20c50d=>_0x20c50d['is']('element','table'));let _0x876b41=0x0;return _0x5b4fdd['forEach'](_0x8b4838=>{_0x876b41+=_0x3053df['getRows'](_0x8b4838);}),_0x876b41;}['_createEmptyTableRows'](_0x221962,_0x32c90c){const _0x340173=this['editor']['plugins']['get']('TableUtils'),_0xe083a3=_0x340173['getRowIndexes'](_0x221962),_0x2729e3=_0x340173['getColumnIndexes'](_0x221962),_0x151925=_0xe083a3['last']+0x1,_0x57898d=_0x2729e3['first'],_0x155d52=_0x221962[0x0]['findAncestor']('table');for(let _0x4b09e4=0x0;_0x4b09e4<_0x32c90c;_0x4b09e4++)_0x340173['insertRows'](_0x155d52,{'at':_0x151925});return _0x155d52['getChild'](_0x151925)['getChild'](_0x57898d);}['_resetContentOfSelectedTableCells'](_0x2d316f,_0x6684ad){const {plugins:_0x2a20ba}=this['editor'],{model:_0x358c90}=_0x2d316f;if(!_0x2a20ba['has']('TableUtils'))return;_0x2a20ba['get']('TableUtils')['getSelectedTableCells'](_0x6684ad)['length']&&_0x358c90['deleteContent'](_0x6684ad);}}class K extends _0x511be8{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x36ca17('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x4be1f6){super(_0x4be1f6),this['name']='AIRequestError';}}function Wn(_0x3f834e,_0x5d416f,_0x37aa24){const t=_0x3f834e['t'];switch(_0x5d416f){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',_0x37aa24);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x37aa24);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'},_0x37aa24);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x5d416f;}}class E extends Lt{['_commandDefinitions'];constructor(_0x5ab397,_0x21827e){super(_0x5ab397),this['_commandDefinitions']=_0x21827e,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x115a1a,_0x22dfd8,_0x326768)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x326768));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2e0866,_0xab09bd,_0x1f8a89)=>{this['enabledCommandsIds']=_0x1f8a89?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x28e9a4=this['editor']['model'];this['_hasContext']=function(_0x11287d){const _0x316781=_0x11287d['document']['selection'];return _0x316781['isCollapsed']?0x0!==[..._0x316781['getSelectedBlocks']()]['length']&&![..._0x316781['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x11287d['hasContent'](_0x316781['getFirstRange']());}(_0x28e9a4);const _0x1ada69=_0x28e9a4['document']['selection'],_0x2fb6a4=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x4f0473 of _0x1ada69['getRanges']())for(const _0x2fcd01 of _0x4f0473['getItems']())if(_0x2fcd01['is']('element')&&_0x2fb6a4['includes'](_0x2fcd01['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x398e9f='',_0x356a32='',_0x579d23='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x398e9f,_0x356a32,_0x579d23);}}function ns(_0x2c800b,_0x3c849e){const _0x1a71e2=new Set();for(const _0x481e43 of _0x2c800b['values']())(_0x3c849e||!0x1===_0x481e43['requiresContent'])&&_0x1a71e2['add'](_0x481e43['id']);return Array['from'](_0x1a71e2);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
+ ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0xea131c,_0x331f79,_0x5f497e){super(),this['editor']=_0xea131c,this['textAdapter']=_0x331f79,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5f497e,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4c22f0,_0x5aceb3,_0x66d275)=>{this['view']['value']=this['_sanitizeHTML'](_0x66d275);}),this['listenTo'](this['view'],'submitPrompt',(_0x2c3815,_0x3c3794)=>{const _0x582bee=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x3c3794,_0x582bee,'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:_0x59f8b8,query:_0x16ceb1,htmlContent:_0x35fa96,label:_0x10de47,mainActionLabel:_0x457ebf}){this['view']['prompt']=_0x10de47,this['view']['mainAction']=_0x457ebf,this['initialContext']=_0x35fa96,_0x16ceb1&&(this['view']['isRendered']?this['_handleQuery'](_0x16ceb1,_0x35fa96,_0x59f8b8,_0x10de47):this['view']['once']('render',()=>{this['_handleQuery'](_0x16ceb1,_0x35fa96,_0x59f8b8,_0x10de47);}));}['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'](_0x3aeac,_0x136c9c,_0x34ee71,_0x3cad7a){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x136c9c,this['previousQuery']=_0x3aeac,this['previousLabel']=_0x3cad7a||_0x3aeac,this['previousActionId']=_0x34ee71,new Promise(_0x3933aa=>{this['textAdapter']['makeRequest']({'query':_0x3aeac,'context':_0x136c9c,'onData':_0xe31bd3=>{this['currentResponse']=_0xe31bd3,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x34ee71})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x33ee2d=>{_0x33ee2d instanceof er?this['view']['handleError'](_0x33ee2d['message']):this['view']['handleError'](),_0x3933aa();})['finally'](()=>{this['stopProcessing'](),_0x3933aa();});});}['_parseAndNormalizeContent'](_0x5add46,_0x217702=!0x1){const _0xd03811=hs['exec'](_0x5add46);_0x5add46=_0xd03811?_0x5add46['substring'](_0xd03811[0x1]['length']):_0x5add46['length']<0x64&&!_0x217702?'':this['_stripMarkdownSyntax'](_0x5add46);const _0x49990e=this['_domParser']['parseFromString'](_0x5add46,'text/html');if(_0xd03811){const _0x305b1f=Array['from'](_0x49990e['body']['childNodes']);_0x305b1f['reverse']();for(const _0xfff122 of _0x305b1f){if(_0xfff122['nodeType']==Node['ELEMENT_NODE'])break;_0xfff122['remove']();}}const _0x485791=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x49990e['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x485791);const _0x23dc61=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4f5515=this['editor']['data']['toModel'](_0x485791);return _0x23dc61||_0x4f5515['markers']['clear'](),this['editor']['data']['stringify'](_0x4f5515);}['_normalizeResponseHeadings'](_0x16e9e0){const _0x1bfd6e=new _0x5bedf2(this['editor']['editing']['view']['document']),_0x1ee280=new _0xe7dd0a({'name':/^h[1-5]$/}),_0x1190fb=[];let _0x42a0de=!0x1;for(const _0x21fc78 of _0x16e9e0)_0x21fc78['is']('element')&&_0x1ee280['match'](_0x21fc78)&&(_0x1190fb['push'](_0x21fc78),'h1'==_0x21fc78['name']&&(_0x42a0de=!0x0));if(_0x42a0de){for(const _0x38d234 of _0x1190fb)_0x1bfd6e['rename']('h'+(parseInt(_0x38d234['name'][0x1])+0x1),_0x38d234);}}['_isH1TagSupportEnabled'](){const {data:_0xd6d7db,editing:_0x4a15fd}=this['editor'],_0x19af30=_0xd6d7db['htmlProcessor']['toView']('<h1></h1>'),_0x1b30e5=_0xd6d7db['toView'](_0xd6d7db['toModel'](_0x19af30));return!!_0x4a15fd['view']['domConverter']['viewToDom'](_0x1b30e5)['querySelector']('h1');}['_sanitizeHTML'](_0x1fe30a){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1fe30a),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x68a5de){const _0xdc3616=_0x68a5de['trim']();return _0xdc3616['startsWith']('```html')?_0xdc3616['endsWith']('```')?_0xdc3616['substring'](0x7,_0xdc3616['length']-0x3):_0xdc3616['substring'](0x7):_0x68a5de;}}const _={'REPLACE':'replace','INSERT':'insert'};class Ar extends _0x178dcf{constructor(_0xf354fb){super(_0xf354fb),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4c5ee7=>Wn(_0xf354fb,'AI_'+_0x4c5ee7['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0xf354fb,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0xf354fb,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0xf354fb,'Stop'));const _0x15012a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x15012a['if']('isVisible','ck-hidden',_0x37af08=>!_0x37af08)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5496c4,_0x20a9d2){const _0x36ec82=new _0x1e9460(this['locale']);return _0x36ec82['set']({'label':_0x5496c4,'class':_0x20a9d2||'','isVisible':!0x0,'withText':!0x0}),_0x36ec82;}}class Pr extends _0x184e76{['contentFieldView'];['copyButtonView'];constructor(_0xd4a943,_0x10b624=''){super(_0xd4a943),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x22b232=this['bindTemplate'];this['contentFieldView']=new Yn(_0xd4a943,_0x10b624),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x22b232['if']('isVisible','ck-hidden',_0x5bdcd5=>!_0x5bdcd5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x22b232['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 _0x1b308f=!0x1;this['on']('change:value',(_0x4ba238,_0x46f825,_0x161ecc)=>{const _0x647a81=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x161ecc),this['isProcessing']&&_0x647a81&&!_0x1b308f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3950c6,_0x2096b8,_0x6ebdb2)=>{_0x1b308f=!0x1,_0x6ebdb2?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1b308f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1b308f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3e2c59=this['locale'],_0x97030b=new _0x1e9460(this['locale']),_0x4f12fc='ck-ai-form__copy-button';return _0x97030b['set']({'label':Wn(_0x3e2c59,'Copy'),'icon':_0x225b63,'class':_0x4f12fc,'tooltip':!0x0}),_0x97030b['bind']('isVisible')['to'](this,'value',_0x3b0a14=>!!_0x3b0a14),_0x97030b['bind']('isEnabled')['to'](this,'isProcessing',_0x6dbca8=>!_0x6dbca8),_0x97030b['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x97030b['icon']=_0x34e643,_0x97030b['class']=_0x4f12fc+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x97030b['icon']=_0x225b63,_0x97030b['class']=_0x4f12fc;},0x3e8);}),_0x97030b;}['_copyHTMLToClipboard'](_0x5c1032){const {window:_0x4bae24,document:_0x256796}=_0x28fe94;if(_0x4bae24['ClipboardItem']){const {Blob:_0x600c00,ClipboardItem:_0x2d5f1c}=_0x4bae24,_0x1e3d8f=[new _0x2d5f1c({'text/html':new _0x600c00([_0x5c1032['innerHTML']],{'type':'text/html'}),'text/plain':new _0x600c00([_0x5c1032['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1e3d8f);}else{const _0x55dd78=_0x256796['createElement']('div');_0x55dd78['style']['position']='absolute',_0x55dd78['style']['left']='-9999px',_0x55dd78['innerHTML']='<span>[</span>'+_0x5c1032['innerHTML']+'<span>]</span>',_0x256796['body']['appendChild'](_0x55dd78);const _0x12f588=_0x256796['createRange']();_0x12f588['setStartAfter'](_0x55dd78['firstElementChild']),_0x12f588['setEndBefore'](_0x55dd78['lastElementChild']);const _0x4563d3=_0x4bae24['getSelection']();_0x4563d3['removeAllRanges'](),_0x4563d3['addRange'](_0x12f588),_0x256796['execCommand']('copy'),_0x55dd78['remove']();}}}class Yn extends _0x184e76{constructor(_0x5c4aaa,_0xa4e0ab=''){super(_0x5c4aaa),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xa4e0ab,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3b74b4){this['element']['innerHTML']=_0x3b74b4;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x36becd=new _0x184e76(),_0x1b2184=this['locale'],_0x48438a=new _0x4435de();return _0x48438a['isVisible']=!0x0,_0x36becd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x48438a,{'text':Wn(_0x1b2184,'AI\x20is\x20writing...')}]}),_0x36becd['render'](),_0x36becd;}}class Vr extends _0x184e76{constructor(_0x53f222,_0x428a5f=''){super(_0x53f222);const _0x388963=new _0xc034b(),_0x1a452b=this['bindTemplate'];this['set']('text',_0x428a5f),_0x388963['content']=_0x3e02e6,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x388963,{'text':_0x1a452b['to']('text')}]});}}class Cr extends _0x4043f2{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3fac22,_0x3ffaeb){super(_0x3fac22,_0x3ffaeb),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',(_0x2a1bdd,_0x2d154d)=>{_0x2a1bdd['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2d154d());});}['_createSubmitButton'](){const _0x1757d1=new _0x1e9460(this['locale']),_0x210615=this['locale'];return _0x1757d1['set']({'icon':_0x4fc1d8,'label':Wn(_0x210615,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1757d1['on']('execute',()=>{this['submit']();}),_0x1757d1['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2d403d,_0x151956)=>!_0x2d403d&&_0x151956),_0x1757d1;}['_createShowHistoryButton'](){const _0x1d194a=new _0x1e9460(this['locale']),_0x1864f3=this['resultsView'],_0x14ead7=this['locale'];_0x1d194a['set']({'label':Wn(_0x14ead7,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x1d194a['bind']('isOn')['to'](_0x1864f3,'isVisible'),_0x1d194a['bind']('isEnabled')['to'](this,'isEnabled'),_0x1d194a['on']('execute',()=>{_0x1864f3['isVisible']=!_0x1864f3['isVisible'],_0x1864f3['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x285bbc=()=>{_0x28fe94['window']['requestAnimationFrame'](()=>{if(_0x255643(this['element'])){const _0x43ec8a=new _0x5b8f6e(this['queryView']['fieldView']['element']),_0x45f865=_0x43ec8a['width'],_0x45531a='rtl'===_0x14ead7['uiLanguageDirection']?'left':'right';_0x43ec8a['excludeScrollbarsAndBorders'](),_0x1d194a['element']['style'][_0x45531a]=_0x45f865-_0x43ec8a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x285bbc),this['on']('render',_0x285bbc),_0x1d194a;}['submit'](){const _0x51bfea=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x51bfea);}['focus'](_0x66ecda){-0x1===_0x66ecda?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x35cdc6{['historyGroupView'];['clearHistoryButton'];constructor(_0x4799ea){super(_0x4799ea),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x3633a2(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x4799ea,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x51ad9c=0x0;for(const _0x45d883 of this['items'])_0x51ad9c+=_0x45d883['items']['length'];return{'resultsCount':_0x51ad9c,'totalItemsCount':_0x51ad9c};}['_createClearHistoryButton'](){const _0x51604d=this['locale'],_0x3e42c6=new _0x1e9460(this['locale']);return _0x3e42c6['set']({'label':'('+Wn(_0x51604d,'Clear')+')','withText':!0x0}),_0x3e42c6['on']('execute',()=>this['fire']('clearHistory')),_0x3e42c6;}}class Rr extends _0x4ffa3a{constructor(_0x57755b){super();const _0x4f8757=new _0x55674c(),_0x458d30=new _0x1e9460(this['locale'],_0x4f8757);this['children']['add'](_0x458d30),_0x458d30['set']({'label':_0x57755b['prompt'],'withText':!0x0}),_0x458d30['on']('execute',()=>{this['fire']('execute',{'value':_0x5682c5(_0x57755b['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x4b57cf{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1c6b0f,_0x3dd552)=>{const _0xb9d91b=go(_0x3dd552['prompt']);for(const _0x5d3bf4 of this)if(_0x5d3bf4!=_0x3dd552&&go(_0x5d3bf4['prompt'])===_0xb9d91b){this['remove'](_0x5d3bf4);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5ad519=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x5ad519));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0xf59bba=>_0xf59bba)));}}function go(_0x175e79){return _0x175e79['toLowerCase']()['trim']();}class k extends _0x184e76{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4d4af2,_0xaefba4,_0x137280=''){super(_0x4d4af2),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Br(),this['errorView']=new Vr(_0x4d4af2),this['contentArea']=new Pr(_0x4d4af2,_0x137280),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 _0x22c832(),this['keystrokes']=new _0x2b0c94(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x56c0d3({'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 _0x4492ad=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xaefba4],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4492ad['if']('isError','ck-hidden',_0x55abed=>!_0x55abed)]},'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'](_0x26bcfe=0x1){-0x1===_0x26bcfe?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 _0xf55388=this['locale'],_0x6aabf1=new Cr(_0xf55388,{'queryView':{'label':Wn(_0xf55388,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x5db2e8,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0xf55388,'Empty\x20history'),'secondary':Wn(_0xf55388,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x6aabf1['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4c9b42,_0x222ab3)=>_0x4c9b42&&!_0x222ab3),this['listenTo'](_0x6aabf1,'submit',(_0xc4f92b,_0x75f7c9)=>{this['prompt']=_0x75f7c9;const _0x21d2e3=_0xac888d(_0x75f7c9);this['fire']('submitPrompt',_0x21d2e3),_0x75f7c9['trim']()&&this['_promptHistory']['add']({'prompt':_0x21d2e3},0x0);},{'priority':'high'}),_0x6aabf1;}['_createHistoryView'](){const _0x2cf876=new Hr(this['locale']);return _0x2cf876['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x2cf876['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2cf876;}['_createToolbar'](){const _0x284592=new Ar(this['locale']);return _0x284592['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4f4174,_0x301489,_0x258420)=>_0x4f4174&&!_0x301489&&!!_0x258420),_0x284592['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x284592['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5a5386,_0x47df93,_0x2d93f1)=>_0x5a5386&&!_0x47df93&&!!_0x2d93f1),_0x284592['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x284592['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2dcd59,_0x46e8d0)=>_0x2dcd59&&!_0x46e8d0),_0x284592['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x284592['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x284592['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x284592;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3b5570=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0x3b5570,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2e745b){const _0x1d79a4=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2e745b||Wn(_0x1d79a4,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x511be8{['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[_0x4d7ada,a,K,_0x6460a2];}constructor(_0x53b281){super(_0x53b281),_0x53b281['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x53b281['config']['define']('ai.assistant.contentAreaCssClass',''),_0x53b281['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x53b281['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x687472}=this;this['_aiAdapter']=_0x687472['plugins']['get'](K),this['_dialog']=_0x687472['plugins']['get'](_0x6460a2),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x30f06b=new E(_0x687472,Array['from'](this['_commandDefinitions']['values']()));_0x687472['commands']['add']('showAIAssistant',_0x30f06b),_0x687472['ui']['componentFactory']['add']('aiCommands',_0x4ac41b=>{const _0x4c0518=_0x546896(_0x4ac41b);return _0x4c0518['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4c0518['buttonView']['set']({'label':Wn(_0x4ac41b,'AI\x20Commands'),'icon':_0x2ff5c5,'tooltip':!0x0}),_0x4c0518['on']('execute',_0x3ff2ce=>this['_onExecute'](_0x3ff2ce['source']['id'])),_0xf23687(_0x4c0518,_0x687472['ui']['view']['body'],function(_0x5591fb){const _0x428786=o(_0x5591fb['config']['get']('ai.assistant.commands'),_0x5591fb['locale']),_0x50a718=B(_0x5591fb,_0x428786)['filter'](_0x185f87=>_0x185f87['commands']['length']);if(0x1===_0x50a718['length'])return B(_0x5591fb,_0x50a718[0x0]['commands'])['map'](_0x285c2f=>({'id':_0x285c2f['id'],'label':_0x285c2f['label']}));return _0x50a718['map'](_0x56b44c=>{const {groupId:_0x2c9d5a,groupLabel:_0x27a845,commands:_0x3ee87a}=_0x56b44c,_0x24eb87=B(_0x5591fb,_0x3ee87a)['map'](_0x541239=>({'id':_0x541239['id'],'label':_0x541239['label']}));return{'id':_0x2c9d5a,'menu':_0x27a845||_0x2c9d5a,'children':_0x24eb87};});}(_0x687472),{'ariaLabel':Wn(_0x4ac41b,'AI\x20Commands')}),_0x4c0518['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x30f06b['on']('change:enabledCommandsIds',_0x21cc9e),_0x4c0518['menuView']['once']('render',_0x21cc9e),_0x4c0518;function _0x21cc9e(){_0x4c0518['isEnabled']=_0x30f06b['enabledCommandsIds']['length']>0x0;for(const _0x5e0bc5 of _0x4c0518['menuView']['buttons'])_0x5e0bc5['isEnabled']=_0x30f06b['enabledCommandsIds']['includes'](_0x5e0bc5['id']);}}),_0x687472['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1f50ba=>{const _0x3fc49d=new _0x53e868(_0x1f50ba);_0x3fc49d['buttonView']['set']({'label':Wn(_0x1f50ba,'AI\x20Commands'),'icon':_0x2ff5c5}),_0x3fc49d['bind']('isEnabled')['to'](_0x30f06b,'enabledCommandsIds',_0x538551=>_0x538551['length']>0x0);const _0x16d617=o(_0x687472['config']['get']('ai.assistant.commands'),_0x1f50ba);return this['_populateMenuBarMenu'](_0x30f06b,_0x3fc49d,_0x16d617,_0x3c4066=>this['_onExecute'](_0x3c4066)),_0x3fc49d;}),_0x687472['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1b9e05=this['_createAIAssistantUIButton'](_0x1e9460);return _0x1b9e05['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1b9e05;}),_0x687472['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4f35e1=this['_createAIAssistantUIButton'](_0x12221a);return _0x4f35e1['set']({'role':'menuitemcheckbox'}),_0x4f35e1;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x39240c=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x428ff1;for(const _0x107ab8 in _0x39240c){const _0x53f0d1=_0x107ab8,_0x2b6699=_0x39240c[_0x53f0d1];if('aiLicenseKeyValid'==_0x2b6699||'aiLicenseKeyInvalid'==_0x2b6699||'aiLicenseKeyExpired'==_0x2b6699||'aiLicenseKeyDomainLimit'==_0x2b6699||'aiLicenseKeyNotAllowed'==_0x2b6699||'aiLicenseKeyEvaluationLimit'==_0x2b6699||'aiLicenseKeyUsageLimit'==_0x2b6699){delete _0x39240c[_0x53f0d1],_0x428ff1=_0x2b6699,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x428ff1&&_0x39240c['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x428ff1&&_0x39240c['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x428ff1&&_0x39240c['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x428ff1&&_0x39240c['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x428ff1&&_0x39240c['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x428ff1&&_0x39240c['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x591c5b='',_0x2d8c6a='',_0x299463='custom'){const _0x54215b=this['editor'],_0x192a06=_0x54215b['editing']['view'],_0x1cceaf=_0x54215b['plugins']['get'](a),_0x4c040a=_0x54215b['plugins']['get'](_0x4d7ada);_0x1cceaf['showFakeVisualSelection']();const _0x47d675=new w(),_0x57387c=new ClipboardEvent('copy',{'clipboardData':_0x47d675}),_0x421107=new _0xab6e54(_0x47d675),_0x4581d4=new _0x4f929f(_0x192a06,_0x57387c,{'dataTransfer':_0x421107});_0x4c040a['_forceMarkersCopy']('comment',()=>{_0x192a06['document']['fire']('copy',_0x4581d4);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x54215b,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3c702b=_0x421107['getData']('text/html');const _0x1a49c9=_0x54215b['model']['document']['selection'],_0x4d47d6=Array['from'](_0x1a49c9['getRanges']());0x1===_0x4d47d6['length']&&_0x4d47d6[0x0]['isFlat']&&!_0x1a49c9['getSelectedElement']()&&''!==_0x3c702b['replace'](/&nbsp;/g,'')['trim']()&&(_0x3c702b='<p>'+_0x3c702b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x299463,'query':_0x591c5b,'htmlContent':_0x3c702b,'label':_0x2d8c6a,'mainActionLabel':_[_0x54215b['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x98228,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x48fc7b['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x1cceaf['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x44fb04=new Map(),_0x29d782=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x34cacc of _0x29d782)for(const _0x3bf099 of _0x34cacc['commands'])_0x44fb04['set'](_0x3bf099['id'],{..._0x3bf099,'groupId':_0x34cacc['groupId'],'groupLabel':_0x34cacc['groupLabel']||_0x34cacc['groupId']});return _0x44fb04;}['_createAIAssistantUIButton'](_0x1af570){const _0x4629cb=this['editor'],_0x3209d3=_0x4629cb['commands']['get']('showAIAssistant'),_0x2de4c7=new _0x1af570(_0x4629cb['locale']);return _0x2de4c7['set']({'label':Wn(_0x4629cb['locale'],'AI\x20Assistant'),'icon':_0x98228,'isToggleable':!0x0}),_0x2de4c7['bind']('isEnabled')['to'](_0x3209d3),_0x2de4c7['bind']('isOn')['to'](this['_dialog'],'id',_0x1bed54=>'aiAssistant'===_0x1bed54),this['listenTo'](_0x2de4c7,'execute',()=>{_0x2de4c7['isOn']?this['hideUI']():_0x3209d3['execute']();}),_0x2de4c7;}['_initView'](){const _0x5d33de=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x5d33de['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x5d33de['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2bfa3e,ui:{ariaLiveAnnouncer:_0x42cb98}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xb51175,_0x1df781,_0x16a31d)=>{const _0x36980a=this['_aiAssistantController']['currentContext'];_0x16a31d?_0x42cb98['announce'](Wn(_0x2bfa3e,'AI\x20is\x20writing')):_0x36980a&&_0x42cb98['announce'](Wn(_0x2bfa3e,'Generated\x20content:\x20%0',_0x36980a),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5bf590,_0x25bdc1,_0x46b709)=>{if(_0x46b709){const _0x31c589=this['_formView']['errorView']['text'];_0x42cb98['announce'](Wn(_0x2bfa3e,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x31c589));}});}['_onExecute'](_0xbcf99f){const _0x4a7c47=this['_commandDefinitions']['get'](_0xbcf99f),_0x1e2338=this['editor'],_0x3710e8=_0x1e2338['model']['document']['selection'],_0x1244b6=_0x1e2338['commands']['get']('showAIAssistant'),_0x258e7a=_0x1e2338['plugins']['get'](a),_0x262050=''+(_0x4a7c47['groupId']!==x?_0x4a7c47['groupLabel']+':\x20':'')+_0x4a7c47['label'];if(!0x1!==_0x4a7c47['requiresContent']&&_0x3710e8['isCollapsed']){const _0x4124e4=_0x17af57(_0x3710e8['getSelectedBlocks']())||_0x1e2338['model']['schema']['getLimitElement'](_0x3710e8);_0x1e2338['model']['change'](_0x10819f=>{_0x10819f['setSelection'](_0x4124e4,'in');});}_0x258e7a['showFakeVisualSelection'](),_0x1244b6['execute'](_0x4a7c47['prompt'],_0x262050,'command:'+_0xbcf99f);}['_populateMenuBarMenu'](_0x56c613,_0x1924dc,_0x4fc84f,_0x450039){const _0x1e19e9=this['editor'],_0x8bdba1=_0x1e19e9['locale'],_0x35fb08=new _0x685ce2(_0x8bdba1),_0x3a3488=B(_0x1e19e9,_0x4fc84f)['filter'](_0x432de7=>_0x432de7['commands']['length']);0x1===_0x3a3488['length']?this['_getMenuBarGroupButtons']({'command':_0x56c613,'commands':_0x3a3488[0x0]['commands'],'parentMenuView':_0x1924dc,'onExecute':_0x450039})['forEach'](_0x440438=>_0x35fb08['items']['add'](_0x440438)):_0x3a3488['forEach'](({groupId:_0x5d292d,groupLabel:_0xbe915b,commands:_0x24ade9})=>{const _0x4351bd=new _0x217236(_0x8bdba1,_0x1924dc),_0x44a6c1=new _0x53e868(_0x8bdba1),_0x1f2108=new _0x685ce2(_0x8bdba1),_0x30ad1d=this['_getMenuBarGroupButtons']({'command':_0x56c613,'commands':_0x24ade9,'parentMenuView':_0x44a6c1,'onExecute':_0x450039});_0x44a6c1['buttonView']['set']({'label':_0xbe915b||_0x5d292d}),_0x44a6c1['delegate']('execute')['to'](_0x1924dc),_0x1f2108['items']['addMany'](_0x30ad1d),_0x44a6c1['panelView']['children']['add'](_0x1f2108),_0x4351bd['children']['add'](_0x44a6c1),_0x35fb08['items']['add'](_0x4351bd);}),_0x1924dc['panelView']['children']['add'](_0x35fb08);}['_getMenuBarGroupButtons']({command:_0x587aef,commands:_0x4bdbab,parentMenuView:_0x2f632d,onExecute:_0x5eb665}){const _0x4053fe=this['editor'],_0x39b24b=_0x4053fe['locale'];return B(_0x4053fe,_0x4bdbab)['map'](_0x1f8a49=>{const _0x59e36a=new _0x217236(_0x39b24b,_0x2f632d),_0x6ae85c=new _0x12221a(_0x39b24b);return _0x6ae85c['set']({'label':_0x1f8a49['label']}),_0x6ae85c['delegate']('execute')['to'](_0x2f632d),_0x6ae85c['on']('execute',()=>_0x5eb665(_0x1f8a49['id'])),_0x6ae85c['bind']('isEnabled')['to'](_0x587aef,'enabledCommandsIds',_0x1d2f64=>_0x1d2f64['includes'](_0x1f8a49['id'])),_0x59e36a['children']['add'](_0x6ae85c),_0x59e36a;});}}function U(_0x531977,_0x551714){return void 0x0!==_0x531977['order']&&void 0x0===_0x551714['order']?0x1:void 0x0===_0x531977['order']&&void 0x0!==_0x551714['order']?-0x1:void 0x0!==_0x531977['order']&&void 0x0!==_0x551714['order']?_0x531977['order']-_0x551714['order']:0x0;}function B(_0x4258cb,_0x20780b){_0x20780b['sort'](U);const _0x442229={},_0x21b155=[];for(const _0x2a47ae of _0x20780b)if(void 0x0!==_0x2a47ae['order']){if(_0x2a47ae['order']in _0x442229)throw new _0x36ca17('ai-commands-config-order-collision',_0x4258cb,{'conflictingDefinitions':[_0x2a47ae,_0x442229[_0x2a47ae['order']]]});_0x442229[_0x2a47ae['order']]=_0x2a47ae,_0x21b155['splice'](_0x2a47ae['order'],0x0,_0x2a47ae);}else _0x21b155['push'](_0x2a47ae);return _0x21b155;}class $n extends _0x511be8{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49befc){super(_0x49befc);const _0x899778=_0x49befc['config'],_0xadefd4=_0x49befc['locale'];_0x899778['define']('ai.assistant.preserveComments',!0x0),_0x899778['define']('ai.assistant.commands',qn(_0xadefd4)),_0x899778['define']('ai.assistant.extraCommandGroups',[]),_0x899778['define']('ai.assistant.removeCommands',[]);let _0x45aafe=o(_0x899778['get']('ai.assistant.commands'),_0xadefd4);const _0xf30427=_0x899778['get']('ai.assistant.extraCommandGroups'),_0x5c6e4c=_0x899778['get']('ai.assistant.removeCommands');_0xf30427['forEach'](_0x3b650e=>{const _0x1dfd4d=_0x45aafe['find'](_0x3ed13f=>_0x3ed13f['groupId']===_0x3b650e['groupId']);_0x1dfd4d?_0x1dfd4d['commands']=_0x1dfd4d['commands']['concat'](_0x3b650e['commands']):_0x45aafe['push'](_0x3b650e);}),_0x45aafe=_0x45aafe['filter'](_0x4f0b5f=>!_0x5c6e4c['includes'](_0x4f0b5f['groupId'])),_0x45aafe['forEach'](_0x389003=>{_0x389003['commands']=_0x389003['commands']['filter'](_0x26859c=>!_0x5c6e4c['includes'](_0x26859c['id']));}),_0x899778['set']('ai.assistant.commands',_0x45aafe);}}function qn(_0x19a605){return[{'groupId':'editOrReview','groupLabel':Wn(_0x19a605,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0x19a605,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0x19a605,'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':Wn(_0x19a605,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0x19a605,'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':Wn(_0x19a605,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0x19a605,'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':Wn(_0x19a605,'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':Wn(_0x19a605,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0x19a605,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0x19a605,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0x19a605,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0x19a605,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0x19a605,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0x19a605,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0x19a605,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0x19a605,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0x19a605,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0x19a605,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0x19a605,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0x19a605,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0x19a605,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0x19a605,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0x19a605,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0x19a605,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0x19a605,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0x19a605,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0x19a605,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x511be8{['abortController'];static get['requires'](){return[K];}constructor(_0xd19eab){super(_0xd19eab),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x355fb6){return this['sendRequest'](_0x355fb6)['catch'](_0x500724=>{if(_0x500724 instanceof er)return Promise['reject'](_0x500724);if('AbortError'==_0x500724['name'])return Promise['resolve']();throw console['error'](_0x500724),new _0x36ca17('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x584db7,_0x5adde8){const _0x28e32d=this['editor']['locale'],_0x4e6019={'Content-Type':'application/json'};if('object'==typeof _0x584db7)Object['assign'](_0x4e6019,_0x584db7);else{if(_0x584db7)try{const _0x41e4aa=await _0x584db7(_0x5adde8);Object['assign'](_0x4e6019,_0x41e4aa);}catch{return Promise['reject'](new er(Wn(_0x28e32d,'AI_ERROR_GET_HEADERS')));}}return _0x4e6019;}async['_prepareRequestParameters'](_0x2b64aa,_0x278a7a){const _0x56fcf0=this['editor']['locale'];if('object'==typeof _0x2b64aa)return _0x2b64aa;try{return await _0x2b64aa(_0x278a7a);}catch{return Promise['reject'](new er(Wn(_0x56fcf0,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5c1e6b){super(_0x5c1e6b),_0x5c1e6b['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5c1e6b['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x5c1e6b['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5c1e6b['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x5c1e6b['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x5c1e6b['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x5463f5,context:_0x181db5,onData:_0x2b6099,actionId:_0x20cd0d}){const _0x87b9a3=this['editor']['locale'],_0x3c2220=await this['prepareMessages'](_0x5463f5,_0x181db5,_0x20cd0d),_0x277082=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x20cd0d),_0x156af8=await this['_prepareRequestParameters'](this['_requestParameters'],_0x20cd0d),_0x418e19={'messages':_0x3c2220,..._0x156af8},_0x54c684={'method':'POST','headers':_0x277082,'body':JSON['stringify'](_0x418e19),'signal':this['abortController']['signal']},_0x5edd97=await fetch(this['_apiUrl'],_0x54c684);if(_0x5edd97['ok'])return _0x156af8['stream']?await this['_readStreamableResponse'](_0x5edd97,_0x2b6099):await this['_readStaticResponse'](_0x5edd97,_0x2b6099),Promise['resolve']();{const _0x50e145=await _0x5edd97['text']();return _0x50e145['includes']('context_length_exceeded')?Promise['reject'](new er(Wn(_0x87b9a3,'AI_ERROR_CONTEXT_LENGTH'))):_0x50e145['includes']('Moderation')?Promise['reject'](new er(Wn(_0x87b9a3,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x50e145));}}async['prepareMessages'](_0x38d777,_0x2876b8,_0x4dee6c){let _0x1ae003,_0xb48ffb;return _0x2876b8?(_0x1ae003='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.',_0xb48ffb='Instruction:\x0a'+_0x38d777+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2876b8):(_0x1ae003='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.',_0xb48ffb=_0x38d777),[{'role':'system','content':_0x1ae003},{'role':'user','content':_0xb48ffb}];}async['_readStreamableResponse'](_0x184296,_0x4d86d0){const _0x3bfe8f=_0x184296['body']['getReader'](),_0xa191ed=new TextDecoder();let _0x2179f0='',_0x42e334='',_0x405c51='',_0x27085c=!0x1;for(;!_0x27085c;){const {done:_0x3ac17e,value:_0x229114}=await _0x3bfe8f['read'](),_0x7ee901=_0x2179f0+_0xa191ed['decode'](_0x229114);let _0xd9d460='';_0x27085c=_0x3ac17e;try{_0xd9d460=this['_cleanUpData'](_0x7ee901),_0x2179f0='';}catch{_0x2179f0=_0x7ee901;continue;}_0x42e334+=_0xd9d460,!_0x27085c&&this['_isBufferIncomplete'](_0x42e334)||_0x42e334&&(_0x405c51+=_0x42e334,_0x42e334='',_0x4d86d0(_0x405c51));}return Promise['resolve']();}async['_readStaticResponse'](_0x3dea7b,_0x313b4e){return _0x313b4e((await _0x3dea7b['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x552e0b){const _0x323591=_0x552e0b['split']('<')['length']!==_0x552e0b['split']('>')['length'],_0x35c523=_0x552e0b['length']<0x1e;return _0x323591&&_0x35c523;}['_cleanUpData'](_0x300043){return _0x300043['split'](/\n(?![^{]*\})/g)['map'](_0x46748e=>_0x46748e['replace']('data:\x20',''))['filter'](_0x92f0ff=>_0x92f0ff&&_0x92f0ff['length']>0x0&&'[DONE]'!==_0x92f0ff)['map'](_0x405f24=>{const {choices:_0x2c8324}=JSON['parse'](_0x405f24);if(_0x2c8324[0x0]?.['delta']?.['content'])return _0x2c8324[0x0]['delta']['content'];})['filter'](_0x33fbf0=>_0x33fbf0)['join']('');}}class Xn extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0x3bfc82('ai-aws-adapter-not-supported');}async['sendRequest'](_0x3a08b1){throw gt('ai-aws-adapter-not-supported'),new er(Wn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x1e9460{constructor(_0x1c0793,_0x18a0ab={}){super(_0x1c0793),this['isToggleable']=!0x0,this['set']('side',_0x18a0ab['side']||'top');const _0x48ac15=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x2d74dd(_0x18a0ab['class']||[]),_0x48ac15['to']('side',_0xccb7c1=>'ck-tab-button_'+_0xccb7c1),_0x48ac15['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x184e76{['children'];constructor(_0x5f4140,_0x53dc24={}){super(_0x5f4140);const _0xcef25=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x2d74dd(_0x53dc24['class']||[]),_0xcef25['to']('class'),_0xcef25['if']('isVisible','ck-hidden',_0x401736=>!_0x401736)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x184e76{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x388d60,_0x38695e={}){super(_0x388d60),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x38695e['side']||'top'),this['set']('isMaximized',!0x1);const _0x3a637e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x2d74dd(_0x38695e['class']||[]),_0x3a637e['to']('side',_0x2b5553=>'ck-tabs_'+_0x2b5553),_0x3a637e['to']('class'),_0x3a637e['to']('isMaximized',_0x2bedd9=>_0x2bedd9?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x3a637e['to']('side',_0x29aab9=>'ck-tabs__buttons-container_'+_0x29aab9)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x3a637e['to']('side',_0x2a2174=>'ck-tabs__panels-container_'+_0x2a2174)]},'children':this['panelViews']},..._0x2d74dd(_0x38695e['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x1b07a6){const _0x292e4e=this['_tabs']['get'](_0x1b07a6);return _0x292e4e||null;}['addTab'](_0x52daa6){const _0x247c62=this['_setupButton']({'id':_0x52daa6['id'],'label':_0x52daa6['buttonLabel'],'icon':_0x52daa6['buttonIcon'],'order':_0x52daa6['order']}),_0x4885eb=new ea(this['locale']);return _0x4885eb['render'](),_0x52daa6['content']&&_0x4885eb['children']['add'](_0x52daa6['content']),this['panelViews']['add'](_0x4885eb),this['_tabs']['set'](_0x52daa6['id'],{'button':_0x247c62,'panel':_0x4885eb,'order':void 0x0!==_0x52daa6['order']?_0x52daa6['order']:null}),this['fire']('addTab:'+_0x52daa6['id'],{'id':_0x52daa6['id'],'button':_0x247c62,'panel':_0x4885eb}),null===this['activeTab']?this['activateTab'](_0x52daa6['id']):this['_hidePanel'](_0x52daa6['id']),{'button':_0x247c62,'panel':_0x4885eb};}['activateTab'](_0x4a7677){if(null!==_0x4a7677&&!this['getTab'](_0x4a7677))throw new _0x36ca17('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4a7677});this['activeTab']!==_0x4a7677&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x4a7677,_0x4a7677&&this['_showPanel'](_0x4a7677),this['fire']('activateTab:'+_0x4a7677,_0x4a7677));}['showTab'](_0x3f16b6){if(!this['getTab'](_0x3f16b6))throw new _0x36ca17('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3f16b6});this['_showPanel'](_0x3f16b6),this['_showButton'](_0x3f16b6),this['fire']('show:'+_0x3f16b6,_0x3f16b6);}['hideTab'](_0x11026e){if(!this['getTab'](_0x11026e))throw new _0x36ca17('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x11026e});const _0x4e5606=this['activeTab'];this['_hidePanel'](_0x11026e),this['_hideButton'](_0x11026e);const _0x37517b=this['getTabIds']();_0x4e5606===_0x11026e&&_0x37517b['length']>0x1&&this['activateTab'](_0x37517b['find'](_0x304937=>_0x304937!==_0x11026e)),this['fire']('hide:'+_0x11026e,_0x11026e);}['_getPanel'](_0x59baf3){const _0x3e4a22=this['_tabs']['get'](_0x59baf3);return _0x3e4a22?_0x3e4a22['panel']:null;}['_showPanel'](_0x4bf576){null!==this['activeTab']&&this['activeTab']!==_0x4bf576||this['_getPanel'](_0x4bf576)['show']();}['_hidePanel'](_0xb36aee){const _0x3de5c0=this['_getPanel'](_0xb36aee);_0x3de5c0['isVisible']&&(this['activeTab']===_0xb36aee&&(this['activeTab']=null),_0x3de5c0['hide']());}['_getButton'](_0x580dea){const _0x2e3bdd=this['_tabs']['get'](_0x580dea);return _0x2e3bdd?_0x2e3bdd['button']:null;}['_showButton'](_0x36c462){this['_getButton'](_0x36c462)['show']();}['_hideButton'](_0x347f18){this['_getButton'](_0x347f18)['hide']();}['_setupButton'](_0x24e041){const _0x917302=new ia(this['locale'],{'side':this['side']}),_0xd44c83=this['buttonViews'];if(_0x917302['set']({'label':_0x24e041['label'],'icon':_0x24e041['icon'],'tooltip':!0x0,'withText':!0x0}),_0x917302['bind']('isOn')['to'](this,'activeTab',_0x5f2715=>_0x5f2715===_0x24e041['id']),_0x917302['bind']('side')['to'](this,'side'),_0x24e041['order']){const _0x542613=[...this['_tabs']]['reduce']((_0x2f91b0,_0x4ec658)=>{const _0x3bceeb=_0x4ec658[0x0],{order:_0xfc61b1}=_0x4ec658[0x1];return!_0xfc61b1||_0xfc61b1>_0x24e041['order']?_0x2f91b0:_0xfc61b1>=_0x2f91b0['order']?{'id':_0x3bceeb,'order':_0xfc61b1}:_0x2f91b0;},{'id':'','order':0x0}),_0x28bac9=_0xd44c83['getIndex'](this['_getButton'](_0x542613['id']));_0xd44c83['add'](_0x917302,_0x28bac9+0x1);}else _0xd44c83['add'](_0x917302);return _0x917302['on']('execute',()=>{this['activateTab'](_0x24e041['id']);}),_0x917302;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x39f0d3,_0x5b84bd={}){super(_0x39f0d3,_0x5b84bd),this['set']('type',_0x5b84bd['type']||'sidebar'),this['set']('side',_0x5b84bd['side']||'right'),this['set']('isVisible',_0x5b84bd['visibleByDefault']??!0x0);const _0xcae935=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xcae935['if']('type','ck-ai-tabs__overlay',_0x42c42e=>'overlay'===_0x42c42e),_0xcae935['if']('type','ck-ai-tabs__sidebar',_0x4b6b8c=>'sidebar'===_0x4b6b8c),_0xcae935['if']('isVisible','ck-hidden',_0x13501b=>!_0x13501b)]}}),this['buttonViews']['on']('add',(_0x5c1527,_0x45dfe7)=>{_0x45dfe7['set']('withText',!0x1);});}}class pt extends _0x575928{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x52100b){super(_0x52100b);const _0x38f5dd=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x38f5dd)throw new _0x36ca17('ai-tabs-configuration-not-found');if(void 0x0!==_0x38f5dd['showResizeButton']&&(this['showResizeButton']=_0x38f5dd['showResizeButton']),'sidebar'!==_0x38f5dd['type']&&'overlay'!==_0x38f5dd['type']||_0x38f5dd['side']&&(this['side']=_0x38f5dd['side']),'sidebar'===_0x38f5dd['type']){if(this['container']=_0x38f5dd['element'],this['set']('type','sidebar'),!this['container'])throw new _0x36ca17('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x38f5dd['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x38f5dd['visibleByDefault']||_0x38f5dd['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 dt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x2bb3ad){if(_0x2bb3ad&&this['type']!==_0x2bb3ad){if(!ni['includes'](_0x2bb3ad))throw new _0x36ca17('ai-tabs-unsupported-ui-type');this['type']=_0x2bb3ad;}}['switchSide'](_0x144d9d){if(_0x144d9d&&this['side']!==_0x144d9d){if(!oi['includes'](_0x144d9d))throw new _0x36ca17('ai-tabs-unsupported-ui-side');this['side']=_0x144d9d;}}['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 q extends _0x575928{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c648e){super(_0x4c648e),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 _0xaa092b=this['context']['plugins']['get']('CloudServices');if(!_0xaa092b['token'])throw new _0x36ca17('ai-missing-token',this);this['_token']=_0xaa092b['token'];}['startConversation'](_0x13727,_0x183be4){const _0x5b506d=this['_sendApiRequest']('/conversations','POST',{'id':_0x13727,'group':_0x183be4});return{'getConversation':async()=>(await _0x5b506d['request'])['json'](),'abortController':_0x5b506d['abortController']};}['queryAssistant']({message:_0x4ef975,conversationId:_0x51d836,parts:_0x36e6dc,capabilities:_0xb1ca7b,model:_0x229b12,attributes:_0x1c84a1}){const _0x4dfaa4={'prompt':_0x4ef975,'content':_0x36e6dc,'model':_0x229b12,..._0xb1ca7b&&{'capabilities':_0xb1ca7b},..._0x1c84a1&&{'attributes':_0x1c84a1}},_0x2bf02f=this['_sendApiRequest']('/conversations/'+_0x51d836+'/messages','POST',_0x4dfaa4);return{'getStream':async()=>{const _0x48bf7c=(await _0x2bf02f['request'])['body'];return this['_getStreamReader'](_0x48bf7c);},'abortController':_0x2bf02f['abortController']};}['executeCustomAction']({content:_0x56605f,message:_0x5c6862,model:_0x5e089c,outputFormat:_0xcf6b33}){const _0x1328b2={'content':[{'type':'text','content':_0x56605f}],'prompt':_0x5c6862,'model':_0x5e089c,'outputFormat':_0xcf6b33},_0x32138f=this['_sendApiRequest']('/actions/custom/calls','POST',_0x1328b2);return{'getStream':async()=>{const _0x1b81f1=(await _0x32138f['request'])['body'];return this['_getStreamReader'](_0x1b81f1);},'abortController':_0x32138f['abortController']};}['executeAction']({actionName:_0x1ea320,content:_0x1f0d30,args:_0x751e59}){const _0x163ac2={'content':[{'type':'text','content':_0x1f0d30}],'args':_0x751e59},_0x1efedc=this['_sendApiRequest']('/actions/system/'+_0x1ea320+'/calls','POST',_0x163ac2);return{'getStream':async()=>{const _0x4bd5a1=(await _0x1efedc['request'])['body'];return this['_getStreamReader'](_0x4bd5a1);},'abortController':_0x1efedc['abortController']};}['uploadFile'](_0x5ef699,_0x1bc88e,_0x1c38cf){const _0x472286=new FormData();_0x472286['append']('file',_0x1bc88e,_0x1bc88e['name']),_0x1c38cf&&_0x472286['append']('attributes',JSON['stringify'](_0x1c38cf));const _0x24a78c=this['_sendApiRequest']('/conversations/'+_0x5ef699+'/files','POST',_0x472286);return{'getId':async()=>(await _0x24a78c['request'])['json'](),'abortController':_0x24a78c['abortController']};}['fetchDocument'](_0x42b6ec,_0x32f4cb){const _0x5c0e56=this['_sendApiRequest']('/conversations/'+_0x42b6ec+'/documents/'+_0x32f4cb,'GET');return{'getDocument':async()=>(await _0x5c0e56['request'])['json'](),'abortController':_0x5c0e56['abortController']};}['uploadDocument'](_0x5d2cd9,_0x26440c,_0x4c890b){const _0x342104={'content':_0x26440c};_0x4c890b&&(_0x342104['attributes']=_0x4c890b);const _0x453bbf=this['_sendApiRequest']('/conversations/'+_0x5d2cd9+'/documents','POST',_0x342104);return{'getId':async()=>(await _0x453bbf['request'])['json'](),'abortController':_0x453bbf['abortController']};}['fetchConversations'](_0x5f55c6,_0x3a5621={}){const _0x5d1a87=new URLSearchParams();_0x5d1a87['append']('group',_0x5f55c6),_0x5d1a87['append']('excludeEmpty',!0x1!==_0x3a5621['excludeEmpty']?'true':'false'),_0x5d1a87['append']('limit',_0x3a5621['limit']?_0x3a5621['limit']['toString']():'100'),_0x5d1a87['append']('sortBy',_0x3a5621['sortBy']?_0x3a5621['sortBy']:'createdAt'),_0x5d1a87['append']('order',_0x3a5621['order']?_0x3a5621['order']:'desc');const _0x29db73=this['_sendApiRequest']('/conversations?'+_0x5d1a87['toString'](),'GET');return{'getConversations':async()=>{const _0x3d3e97=await _0x29db73['request'];return(await _0x3d3e97['json']())['items'];},'abortController':_0x29db73['abortController']};}['deleteConversation'](_0x1dde3e){const _0x59e8dc=this['_sendApiRequest']('/conversations/'+_0x1dde3e,'DELETE');return{'execute':async()=>{await _0x59e8dc['request'];},'abortController':_0x59e8dc['abortController']};}['updateConversation'](_0x3467bc,_0x447fa2){const _0x2cccbc=this['_sendApiRequest']('/conversations/'+_0x3467bc,'PATCH',_0x447fa2);return{'getResult':async()=>(await _0x2cccbc['request'],_0x447fa2),'abortController':_0x2cccbc['abortController']};}['fetchConversation'](_0x2fd75c){const _0x1de129=this['_sendApiRequest']('/conversations/'+_0x2fd75c,'GET');return{'getConversation':async()=>(await _0x1de129['request'])['json'](),'abortController':_0x1de129['abortController']};}['fetchConversationMessages'](_0x22f30f){const _0x1b9adf=this['_sendApiRequest']('/conversations/'+_0x22f30f+'/messages','GET');return{'getMessages':async()=>{const _0x172ca5=await _0x1b9adf['request'];return(await _0x172ca5['json']())['items'];},'abortController':_0x1b9adf['abortController']};}['uploadUrl'](_0x386aa2,_0x1c773d,_0x4884c9){const _0x135b58=this['_sendApiRequest']('/conversations/'+_0x386aa2+'/web-resources','POST',{'url':_0x1c773d,'attributes':_0x4884c9});return{'getId':async()=>(await _0x135b58['request'])['json'](),'abortController':_0x135b58['abortController']};}['getModels'](_0x40834f='en'){const _0x3c51a2=new URLSearchParams();_0x3c51a2['append']('language',_0x40834f);const _0x58db5b='/models/1?'+_0x3c51a2['toString'](),_0xa12437=this['_sendApiRequest'](_0x58db5b,'GET');return{'list':async()=>await(await _0xa12437['request'])['json'](),'abortController':_0xa12437['abortController']};}['deleteFile'](_0x432bd5,_0x46004b){const _0x20c490=this['_sendApiRequest']('/conversations/'+_0x432bd5+'/files/'+_0x46004b,'DELETE');return{'execute':async()=>{await _0x20c490['request'];},'abortController':_0x20c490['abortController']};}['deleteDocument'](_0x32abc8,_0x550b80){const _0x3f0be4=this['_sendApiRequest']('/conversations/'+_0x32abc8+'/documents/'+_0x550b80,'DELETE');return{'execute':async()=>{await _0x3f0be4['request'];},'abortController':_0x3f0be4['abortController']};}['deleteWebResource'](_0x22b9c0,_0x41f036){const _0x18513d=this['_sendApiRequest']('/conversations/'+_0x22b9c0+'/web-resources/'+_0x41f036,'DELETE');return{'execute':async()=>{await _0x18513d['request'];},'abortController':_0x18513d['abortController']};}['callSystemReview']({reviewName:_0x1b6c01,content:_0xecf623,args:_0x188ec6}){const _0x584607=this['_sendApiRequest']('/reviews/system/'+_0x1b6c01+'/calls','POST',{'content':[{'type':'text','content':_0xecf623}],'args':_0x188ec6});return{'getStream':async()=>{const _0x300098=(await _0x584607['request'])['body'];return this['_getStreamReader'](_0x300098);},'abortController':_0x584607['abortController']};}['callCustomReview']({content:_0x3a0679,prompt:_0x411c3e,model:_0x39afb4}){const _0x49d2a7=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x3a0679}],'prompt':_0x411c3e,'model':_0x39afb4});return{'getStream':async()=>{const _0xd8f782=(await _0x49d2a7['request'])['body'];return this['_getStreamReader'](_0xd8f782);},'abortController':_0x49d2a7['abortController']};}['upsertAIChatRating'](_0x58f65b,_0x54163a,_0x21992a){const _0x3d8122=this['_sendApiRequest']('/conversations/'+_0x58f65b+'/messages/'+_0x54163a+'/ratings','PUT',{'positiveCount':_0x21992a['positiveCount'],'totalCount':_0x21992a['totalCount'],'modificationId':_0x21992a['modificationId']});return{'execute':async()=>{await _0x3d8122['request'];},'abortController':_0x3d8122['abortController']};}['upsertAIActionRating'](_0x46a7f1,_0x3feb63,_0x5749a0){const _0x1c78be=this['_sendApiRequest']('/actions/system/'+_0x46a7f1+'/calls/'+_0x3feb63+'/ratings','PUT',{'positiveCount':_0x5749a0['positiveCount'],'totalCount':_0x5749a0['totalCount']});return{'execute':async()=>{await _0x1c78be['request'];},'abortController':_0x1c78be['abortController']};}['upsertCustomAIActionRating'](_0x26619d,_0x15ad9d){const _0x27ee96=this['_sendApiRequest']('/actions/custom/calls/'+_0x26619d+'/ratings','PUT',{'positiveCount':_0x15ad9d['positiveCount'],'totalCount':_0x15ad9d['totalCount']});return{'execute':async()=>{await _0x27ee96['request'];},'abortController':_0x27ee96['abortController']};}['upsertAIReviewRating'](_0x3c49c0,_0x356bba,_0x33831d,_0x91c817){const _0x3ef49a=this['_sendApiRequest']('/reviews/system/'+_0x3c49c0+'/calls/'+_0x356bba+'/ratings','PUT',{'positiveCount':_0x33831d['positiveCount'],'totalCount':_0x33831d['totalCount'],'dataId':_0x91c817});return{'execute':async()=>{await _0x3ef49a['request'];},'abortController':_0x3ef49a['abortController']};}['upsertCustomAIReviewRating'](_0x1fd9ee,_0x4b371f,_0x3692ec){const _0x5c8a92=this['_sendApiRequest']('/reviews/custom/calls/'+_0x1fd9ee+'/ratings','PUT',{'positiveCount':_0x4b371f['positiveCount'],'totalCount':_0x4b371f['totalCount'],'dataId':_0x3692ec});return{'execute':async()=>{await _0x5c8a92['request'];},'abortController':_0x5c8a92['abortController']};}['_sendApiRequest'](_0x9ee634,_0x3bde51,_0x1bdc18){const _0x1a65ff=new AbortController(),_0x10ee4b=_0x1bdc18 instanceof FormData,_0x3baf39={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x1bdc18&&!_0x10ee4b&&(_0x3baf39['Content-Type']='application/json');const _0x3cce8f={'method':_0x3bde51,'headers':_0x3baf39,'signal':_0x1a65ff['signal']};return _0x1bdc18&&(_0x3cce8f['body']=_0x10ee4b?_0x1bdc18:JSON['stringify'](_0x1bdc18)),{'request':fetch(''+this['_apiUrl']+_0x9ee634,_0x3cce8f)['catch'](_0x182876=>{this['_handleError'](_0x182876);})['then'](_0x36e362=>_0x36e362['ok']?_0x36e362:_0x36e362['json']()['then'](_0x10a322=>{throw{'url':this['_apiUrl'],'path':_0x9ee634,'method':_0x3bde51,'body':_0x1bdc18,'status':(_0x36e362||{})['status'],'statusText':(_0x36e362||{})['statusText'],'code':_0x10a322['code'],'message':_0x10a322['message'],'traceId':_0x10a322['traceId']};})),'abortController':_0x1a65ff};}async*['_getStreamReader'](_0x18c3b0){const _0x524879=[],_0xa8ff4c=_0x18c3b0['getReader'](),_0x461a36=$t({'onError':_0x4e5cf2=>{this['_handleError'](_0x4e5cf2);},'onEvent':_0x2a3459=>{_0x2a3459['data']=JSON['parse'](_0x2a3459['data']),_0x524879['push'](_0x2a3459);}});try{let _0x543dd3=!0x1;for(;!_0x543dd3;){const {done:_0x198565,value:_0xdb849e}=await _0xa8ff4c['read']();_0x198565&&(_0x543dd3=!0x0),_0x461a36['feed'](this['_decoder']['decode'](_0xdb849e,{'stream':!0x0})),yield*_0x524879,_0x524879['length']=0x0;}}catch(_0x157352){this['_handleError'](_0x157352);}finally{_0xa8ff4c['releaseLock'](),_0x461a36['reset']();}}['_handleError'](_0x33055f){if(_0x33055f instanceof _0x36ca17)throw _0x33055f;if(_0x33055f instanceof Error&&'AbortError'===_0x33055f['name'])throw new _0x36ca17('ai-request-aborted',this,{'originalError':_0x33055f});throw new _0x36ca17('ai-request-failed',this,{'originalError':_0x33055f});}}function i(_0x4614bf,_0x4dd963,_0x74214e){const t=_0x4614bf['t'];switch(_0x4dd963){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'},_0x74214e);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'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_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x74214e);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.'},_0x74214e);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_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x74214e);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x74214e);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x74214e);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x74214e);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.'},_0x74214e);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.'},_0x74214e);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.'},_0x74214e);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.'},_0x74214e);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'},_0x74214e);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x74214e);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x4dd963;}}function Hs(_0x5614a4,_0x51bf4c){const _0xed045c=new _0x1e9460(_0x5614a4),_0x29cf69=i(_0x5614a4,'AI_TABS_LABEL_MINIMIZE'),_0x276d41=i(_0x5614a4,'AI_TABS_LABEL_MAXIMIZE');return _0xed045c['set']({'withText':!0x1,'icon':_0x327f4b,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0xed045c['bind']('label')['to'](_0x51bf4c,'isMaximized',_0x3a0132=>_0x3a0132?_0x29cf69:_0x276d41),_0xed045c['bind']('icon')['to'](_0x51bf4c,'isMaximized',_0x3449e0=>_0x3449e0?_0x932832:_0x327f4b),_0xed045c['bind']('isOn')['to'](_0x51bf4c,'isMaximized'),_0xed045c['on']('execute',()=>{_0x51bf4c['fire']('resizeTabs');}),_0xed045c;}function ji(_0x53f9b7){return _0x413294(_0x53f9b7);}function Tt(_0x2caa56){return _0x3807c6(_0x2caa56);}function St(_0x1a76ce,_0x4633ee,_0x53bc75){const _0x84a134=null!==_0x4633ee?_0x24cf62=>_0x24cf62['attribs'][_0x1a76ce]===_0x4633ee:_0xa2c10e=>Boolean(_0xa2c10e['attribs'][_0x1a76ce]);return yt(_0x1a5114=>_0x5d51b2(_0x1a5114)&&_0x84a134(_0x1a5114),_0x53bc75);}function Bi(_0x567161,_0x21befe,_0x3f3d76){const _0xc51332=null!==_0x21befe?_0xd183df=>_0xd183df['attribs'][_0x567161]===_0x21befe:_0x4c138e=>Boolean(_0x4c138e['attribs'][_0x567161]);return _0x3e90f0(_0x545e5d=>_0x5d51b2(_0x545e5d)&&_0xc51332(_0x545e5d),_0x3f3d76);}function At(_0x463cb4,_0x7e7322){return _0x463cb4&&_0x5d51b2(_0x463cb4)?_0x463cb4['attribs'][_0x7e7322]:null;}function Qi(_0x47d618,_0x52799a,_0x5520af){_0x5d51b2(_0x47d618)&&(null===_0x5520af?delete _0x47d618['attribs'][_0x52799a]:_0x47d618['attribs'][_0x52799a]=_0x5520af);}function qi(_0x1e9293,_0x531a19,_0x769739){const _0x368523=_0x531a19['cloneNode'](!0x0);'beforebegin'===_0x769739?_0x2b8438(_0x1e9293,_0x368523):'afterbegin'===_0x769739?_0x12356b(_0x1e9293,_0x368523):'beforeend'===_0x769739?_0x59ec57(_0x1e9293,_0x368523):'afterend'===_0x769739&&_0x2bdf7a(_0x1e9293,_0x368523);}function Gi(_0x18cdc5){const _0x3ce169=[];let _0x4785fb=_0x18cdc5;for(;_0x4785fb;)_0x4785fb=_0x2456ab(_0x4785fb),_0x4785fb&&_0x3ce169['push'](_0x4785fb);return _0x3ce169;}function zn(_0x1efe8e){return _0x1efe8e['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Zi(_0x4ca4a0){let _0x3de5f6=0x0;for(;_0x4ca4a0['parentNode'];)_0x4ca4a0=_0x4ca4a0['parentNode'],_0x3de5f6++;return _0x3de5f6;}function Ns(_0x15e237){const _0x52d912=[];let _0x2ddb67=_0x15e237['nextSibling'];for(;_0x2ddb67;)_0x52d912['push'](_0x2ddb67),_0x2ddb67=_0x2ddb67['nextSibling'];_0x52d912['forEach'](_0x332514=>{_0x4c1d4c(_0x332514);});}class Ui extends/* #__PURE__ -- @preserve */
25
+ ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x26b84e();}['convertMarkdownToHTML'](_0x26bf26){const _0x223e92=this['_m2html']['parse'](_0x26bf26);return this['parseAndNormalizeHTML'](_0x223e92);}['parseAndNormalizeHTML'](_0x2b47a7){return this['_parseHTML'](_0x2b47a7);}['_parseHTML'](_0x59bb95){const _0x682b7=ji('<dummy>'+_0x59bb95['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x682b7['children']=_0x682b7['children'][0x0]['children'],_0x682b7;}}class Ni extends/* #__PURE__ -- @preserve */
26
+ ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x988c46){super(),this['_generateUid']=_0x988c46||_0x926b30;}['merge'](_0x20506c,_0x5742af,_0x2eadc8){const _0x231535=_0x20506c['cloneNode'](!0x0);if(0x0===_0x5742af['childNodes']['length']){const _0x1bf36b=[];return Bi('data-id','new-element',_0x231535)['forEach'](_0x93028f=>{const _0x3a4bc1=this['_generateUid']();Qi(_0x93028f,'data-id',_0x3a4bc1),_0x1bf36b['push'](_0x3a4bc1);}),this['_removeSpecialComments'](_0x231535),{'parsedContent':_0x231535,'newNodeIds':_0x1bf36b,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x2eadc8&&_0x2eadc8['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x231535),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Bi('data-id',null,_0x5742af)['map'](_0x4c1e0c=>At(_0x4c1e0c,'data-id'))['filter'](_0x1a2457=>!!_0x1a2457));let _0x17c9c8=-0x1,_0x376016=!0x1;const _0x11f42a=_0x231535['childNodes'],_0x2ca0ba=Array['from'](_0x11f42a)['filter'](_0x4df31b=>!(0x3===_0x4df31b['nodeType']&&''===Tt(_0x4df31b)['trim']())),_0x20e946=_0x2ca0ba['length'];for(let _0x5abea4=0x0;_0x5abea4<_0x20e946;_0x5abea4++){const _0x1c641d=_0x2ca0ba[_0x5abea4],_0x2aab75=_0x2ca0ba[_0x5abea4+0x1];if(this['_isNewNode'](_0x1c641d)){if(-0x1===_0x17c9c8&&(_0x17c9c8=_0x5abea4),this['_markWrappedElements'](_0x1c641d),!this['_isNewNode'](_0x2aab75)){const [_0x4e8ae3,_0x43e2a2]=this['_findReferenceNode'](_0x1c641d,_0x376016,_0x5742af);if(_0x4e8ae3){const _0x251a98=Array['from'](_0x2ca0ba)['slice'](_0x17c9c8,_0x5abea4+0x1);this['_insertNodes'](_0x4e8ae3,_0x251a98,_0x43e2a2),_0x17c9c8=-0x1;}}}else{if(this['_isExistingContentComment'](_0x1c641d))_0x376016=!0x0;else{if(this['_isExistingNode'](_0x1c641d)){const _0x26d282=At(_0x1c641d,'data-id');if(_0x26d282&&this['_existingDataIds']['has'](_0x26d282)){const _0x467a0=St('data-id',_0x26d282,_0x5742af);this['_replaceNode'](_0x467a0,_0x1c641d);}if(this['_touchedNodesState']['removedIds']['includes'](_0x26d282)){const _0x36a363=this['_touchedNodesState']['removedIds']['indexOf'](_0x26d282);this['_touchedNodesState']['removedIds']['splice'](_0x36a363,0x1);}}else{if(this['_isDelNode'](_0x1c641d)){const _0x45aa59=At(_0x1c641d,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x45aa59)||this['_storeDeletedElementIds'](_0x1c641d);}}}}}for(const _0x2054b8 of this['_touchedNodesState']['removedIds']){const _0x57826c=St('data-id',_0x2054b8,_0x5742af);if(_0x57826c){if(_0x2eadc8&&_0x2eadc8['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x2054b8;const _0x1314b2=_0x2eadc8['replaceRemovedWith']['cloneNode'](!0x0);Qi(_0x1314b2,'data-id',_0x2054b8),Qi(_0x1314b2,'data-removed','true'),_0x482733(_0x57826c,_0x1314b2);}else _0x4c1d4c(_0x57826c);}}if(Bi('data-wrapped-id',null,_0x5742af)['forEach'](_0x3eb5ce=>{const _0x40aaa4=St('data-id',At(_0x3eb5ce,'data-wrapped-id'),_0x5742af);var _0x207a03,_0x38bffe;_0x40aaa4&&(_0x38bffe=_0x3eb5ce,_0x4c1d4c(_0x207a03=_0x40aaa4),_0x482733(_0x38bffe,_0x207a03));}),Bi('data-id','new-element',_0x5742af)['forEach'](_0x5905ee=>{const _0x5ad740=this['_getUid'](_0x5905ee);Qi(_0x5905ee,'data-id',_0x5ad740),this['_touchedNodesState']['newIds']['push'](_0x5ad740);}),this['_removeSpecialComments'](_0x5742af),_0x2eadc8&&_0x2eadc8['markUnstableElements']&&this['_markUnstableElements'](_0x5742af,_0x2eadc8['markUnstableElementsDepth']||0x0),_0x2eadc8&&_0x2eadc8['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x150ab9=St('data-id',this['_touchedNodesState']['lastTouchedId'],_0x5742af);for(;_0x150ab9;)Ns(_0x150ab9),_0x150ab9=_0x150ab9['parentNode'];}return{'parsedContent':_0x5742af,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x19c871,_0x50fb81,_0xf36e71){for(const _0x3ff4f5 of _0x50fb81){const _0x5f030c=this['_getUid'](_0x3ff4f5);Qi(_0x3ff4f5,'data-id',_0x5f030c),this['_touchedNodesState']['newIds']['push'](_0x5f030c),this['_touchedNodesState']['lastTouchedId']=_0x5f030c;}const _0x3a3090='afterbegin'===_0xf36e71||'afterend'===_0xf36e71?_0x50fb81['reverse']():_0x50fb81;for(const _0x5d763c of _0x3a3090)qi(_0x19c871,_0x5d763c,_0xf36e71);}['_replaceNode'](_0x14337e,_0x328c32){if(!_0x14337e)return;if(_0xf0f532=_0x328c32,zn(Tt(_0x14337e))===zn(Tt(_0xf0f532)))return;var _0xf0f532;const _0x45f19e=this['_getUid'](_0x14337e);Qi(_0x328c32,'data-id',_0x45f19e),this['_touchedNodesState']['modifiedIds']['push'](_0x45f19e),this['_touchedNodesState']['lastTouchedId']=_0x45f19e,_0x482733(_0x14337e,_0x328c32['cloneNode'](!0x0));}['_findReferenceNode'](_0x56f8d5,_0xe22d9f,_0x46bd41){const _0x51359e=this['_findPrevElementWithDataId'](_0x56f8d5,!0x1);if(_0x51359e){const _0x5c78f4=this['_getNodeDataId'](_0x51359e),_0x30be5c=St('data-id',_0x5c78f4,_0x46bd41);if(_0x30be5c)return[_0x30be5c,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x5c78f4);}const _0x149a9a=this['_findNextElementWithDataId'](_0x56f8d5,!0x1);if(_0x149a9a){const _0x36d02b=this['_getNodeDataId'](_0x149a9a),_0x4e6bd3=St('data-id',_0x36d02b,_0x46bd41);if(_0x4e6bd3)return[_0x4e6bd3,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x36d02b);}return _0xe22d9f?_0x56f8d5['nextSibling']?this['_findFallbackReferenceNode'](_0x56f8d5,_0x46bd41):[_0x46bd41['childNodes'][_0x46bd41['childNodes']['length']-0x1],'afterend']:[_0x46bd41['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x30eb69,_0x24f31d){const _0x2fe0f2=[],_0x1115bd=this['_findPrevElementWithDataId'](_0x30eb69,!0x0);if(_0x1115bd){const _0x5306e4=St('data-id',this['_getNodeDataId'](_0x1115bd),_0x24f31d);_0x5306e4&&_0x2fe0f2['push']([_0x5306e4,'afterend']);}const _0x2bc91c=this['_findNextElementWithDataId'](_0x30eb69,!0x0);if(_0x2bc91c){const _0xb010e9=St('data-id',this['_getNodeDataId'](_0x2bc91c),_0x24f31d);_0xb010e9&&_0x2fe0f2['push']([_0xb010e9,'beforebegin']);}if(_0x2fe0f2['length']>0x1)return Zi(_0x2fe0f2[0x0][0x0])<=Zi(_0x2fe0f2[0x1][0x0])?_0x2fe0f2[0x0]:_0x2fe0f2[0x1];return 0x1===_0x2fe0f2['length']?_0x2fe0f2[0x0]:[_0x24f31d['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x415ef9,_0x411955){let _0xbfd8b=_0x415ef9['nextSibling'],_0x49d825=null,_0x21f49c=!0x1;for(;_0xbfd8b;){if(_0x3bac06(_0xbfd8b)){if(this['_isDelNode'](_0xbfd8b)&&(_0x49d825=_0xbfd8b),this['_isExistingContentComment'](_0xbfd8b)&&_0x411955&&!_0x21f49c){_0x21f49c=!0x0,_0xbfd8b=_0xbfd8b['nextSibling'];continue;}break;}const _0x36712b=At(_0xbfd8b,'data-id');if(_0x36712b&&'new-element'!==_0x36712b&&this['_existingDataIds']['has'](_0x36712b)){_0x49d825=_0xbfd8b;break;}_0xbfd8b=_0xbfd8b['nextSibling'];}return _0x49d825;}['_findPrevElementWithDataId'](_0x7c6c76,_0x3b7620){let _0x313fd0=_0x7c6c76['previousSibling'],_0x4b83e0=null,_0x50755a=!0x1;for(;_0x313fd0;){if(_0x3bac06(_0x313fd0)){if(this['_isDelNode'](_0x313fd0)&&(_0x4b83e0=_0x313fd0),this['_isExistingContentComment'](_0x313fd0)&&_0x3b7620&&!_0x50755a){_0x50755a=!0x0,_0x313fd0=_0x313fd0['previousSibling'];continue;}break;}const _0x1f7d91=At(_0x313fd0,'data-id');if(_0x1f7d91&&'new-element'!==_0x1f7d91&&this['_existingDataIds']['has'](_0x1f7d91)){_0x4b83e0=_0x313fd0;break;}_0x313fd0=_0x313fd0['previousSibling'];}return _0x4b83e0;}['_markWrappedElements'](_0x1fdb76){_0x5d51b2(_0x1fdb76)&&Bi('data-id',null,_0x1fdb76)['forEach'](_0x9cf674=>{this['_isExistingNode'](_0x9cf674)&&!this['_hasWrappedParent'](_0x9cf674)&&(Qi(_0x9cf674,'data-wrapped-id',At(_0x9cf674,'data-id')),Qi(_0x9cf674,'data-id',null));});}['_getNodeDataId'](_0x345865){if(!_0x345865)return null;if(_0x5d51b2(_0x345865))return At(_0x345865,'data-id');if(_0x3bac06(_0x345865)){const _0x5d485d=Tt(_0x345865)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x5d485d&&_0x5d485d[0x1])return _0x5d485d[0x1];}return null;}['_storeDeletedElementIds'](_0x5847c0){if(_0x3bac06(_0x5847c0)){const _0x5d70cc=Tt(_0x5847c0)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x5d70cc&&_0x5d70cc[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x5d70cc[0x1]);}}['_getUid'](_0x10fe2c){return this['_isExistingNode'](_0x10fe2c)?At(_0x10fe2c,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x20b599){(function(_0x53f208){return _0x1a1c14(_0x10036d=>_0x3bac06(_0x10036d),_0x53f208,!0x0,0x1/0x0);}(_0x20b599)['filter'](_0x4ae2d1=>this['_isDelNode'](_0x4ae2d1)||this['_isExistingContentComment'](_0x4ae2d1))['forEach'](_0x360587=>{_0x4c1d4c(_0x360587);}));}['_markLastTagElementUnstable'](_0x21ec5b){const _0x153724=_0x21ec5b['childNodes'],_0xea037d=_0x153724[_0x153724['length']-0x1];_0xea037d&&_0x5d51b2(_0xea037d)&&Qi(_0xea037d,'data-unstable','true');}['_markUnstableElements'](_0x45bb5f,_0x82f7a5){const _0x2f0497=St('data-unstable','true',_0x45bb5f);if(!_0x2f0497)return;const _0x50b1e3=Gi(_0x2f0497)['slice'](0x0,-0x1),_0x21f5a8=_0x50b1e3['length'];let _0x80547d=_0x2f0497;if(_0x21f5a8>_0x82f7a5){let _0x3c4909=_0x21f5a8,_0x29ebb9=null;for(;_0x3c4909>_0x82f7a5&&_0x3c4909>=0x0;)_0x3c4909--,_0x29ebb9=_0x50b1e3[_0x3c4909];_0x29ebb9&&(_0x80547d=_0x29ebb9,Qi(_0x2f0497,'data-unstable',null),Qi(_0x29ebb9,'data-unstable','true'));}else{if(_0x21f5a8<_0x82f7a5){let _0x554a4e=_0x21f5a8,_0x39fc9f=_0x2f0497;for(;_0x554a4e<_0x82f7a5;){const _0x4ad305=_0x39fc9f['childNodes']['filter'](_0x2d702b=>_0x5d51b2(_0x2d702b));if(0x0===_0x4ad305['length'])break;_0x554a4e++,_0x39fc9f=_0x4ad305[_0x4ad305['length']-0x1];}_0x39fc9f&&(_0x80547d=_0x39fc9f,Qi(_0x2f0497,'data-unstable',null),Qi(_0x39fc9f,'data-unstable','true'));}}let _0x464ca4=_0x80547d;for(;_0x464ca4;){for(;_0x464ca4['nextSibling'];)_0x464ca4=_0x464ca4['nextSibling'],_0x5d51b2(_0x464ca4)&&Qi(_0x464ca4,'data-unstable','true');_0x464ca4=_0x464ca4['parentNode'];}}['_isNewNode'](_0x17516d){return Boolean('new-element'===At(_0x17516d,'data-id'));}['_isExistingNode'](_0x1c3066){return Boolean((At(_0x1c3066,'data-id')||'')['length']>0x0&&'new-element'!==At(_0x1c3066,'data-id'));}['_isDelNode'](_0x31455e){return!!_0x31455e&&Boolean(_0x3bac06(_0x31455e)&&Tt(_0x31455e)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x5b7694){let _0x430c27=_0x5b7694['parentNode'];for(;_0x430c27;){if(At(_0x430c27,'data-wrapped-id'))return!0x0;_0x430c27=_0x430c27['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x39eb06){return Boolean(_0x3bac06(_0x39eb06)&&Tt(_0x39eb06)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function J({editor:_0x92c037,changeGroups:_0x52e582,documentContextContent:_0xe7689a,showDiff:_0x1cfd78,trimUnchanged:_0x308ddb=!0x0}){return _0x52e582['map'](_0x375979=>{const _0x6a3ed2=new Et([]),_0xa13f1e=new Et([]);for(const _0x4c1d0a of _0x375979['changes'])if(_0x1cfd78&&'removed'==_0x4c1d0a['type']||_0xa13f1e['children']['push'](_0x4c1d0a['node']['cloneNode'](!0x0)),'new'!=_0x4c1d0a['type']&&(_0x1cfd78||'removed'!=_0x4c1d0a['type'])){const _0x33372d=yt(_0x1c5fac=>At(_0x1c5fac,'data-id')==_0x4c1d0a['id'],_0xe7689a,!0x0);_0x33372d&&_0x6a3ed2['children']['push'](_0x33372d['cloneNode'](!0x0));}const {content:_0x28e838,hasChanges:_0xe75689}=function(_0x573466,_0x1b7d25,_0x59cd5c,_0x495d8c,_0x3cd8ee=!0x0){const _0x2469c5=_0x573466['plugins']['get']('DocumentCompare'),_0x331ad1=Tt(_0x1b7d25),_0x48ba98=Tt(_0x59cd5c),_0x453196=_0x573466['data']['parse'](_0x331ad1,'$root'),_0xf5ab1e=_0x573466['model']['createPositionAt'](_0x453196,0x0),_0x1326a2=_0x2469c5['getDiff'](_0x331ad1,_0x48ba98,{'anchor':_0xf5ab1e,'markDeletions':_0x495d8c}),_0x3b44f3=_0x1326a2['getOperations']();if(0x0==_0x3b44f3['length'])return{'content':_0x1b7d25['cloneNode'](!0x0),'hasChanges':!0x1};_0x495d8c?function(_0x117a66,_0x5ccee1,_0x2cc74c){if(0x0==_0x117a66['length'])return;const _0x3d533e=_0x2cc74c['plugins']['get']('DocumentCompare'),_0x63b978=_0x2cc74c['plugins']['get']('SuggestionsConversion');_0x2cc74c['model']['change'](_0x577ddd=>{const _0x4241f9=new Set();for(let _0x10d3d1=0x0;_0x10d3d1<_0x117a66['length'];_0x10d3d1++){const _0x3e88d3=_0x117a66[_0x10d3d1];if(_0x3e88d3['baseVersion']=null,_0x3e88d3['isDocumentOperation']=!0x1,_0x3d533e['isMarkedRemoveOperation'](_0x3e88d3)){const _0x3f97b3=_0x893b7e(_0x3e88d3['newRange'],_0x2cc74c['model']),_0x253353='suggestion:deletion:'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0x253353,_0x3f97b3);}else switch(_0x3e88d3['type']){case'rename':{if(_0x3e88d3['oldName']==_0x3e88d3['newName'])break;_0x577ddd['batch']['addOperation'](_0x3e88d3),_0x2cc74c['model']['applyOperation'](_0x3e88d3);const _0x2ecee9='$elementName',_0xddfa95=_0x3e88d3['position'],_0x52f03c=_0x2cc74c['model']['createRange'](_0xddfa95,_0x2cc74c['model']['createPositionAt'](_0xddfa95['nodeAfter'],'end')),_0x286cdb='suggestion:attribute:'+_0x2ecee9+':'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0x286cdb,_0x52f03c);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3e88d3['oldValue']==_0x3e88d3['newValue'])break;_0x577ddd['batch']['addOperation'](_0x3e88d3),_0x2cc74c['model']['applyOperation'](_0x3e88d3);const _0x245dac=_0x3e88d3['key'];if(!_0x63b978['isRegisteredAttribute'](_0x245dac))break;const _0x27323c=_0x893b7e(_0x3e88d3['range'],_0x2cc74c['model']),_0x31a20f='suggestion:attribute:'+_0x245dac+':'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0x31a20f,_0x27323c);break;}case'insert':{_0x577ddd['batch']['addOperation'](_0x3e88d3),_0x2cc74c['model']['applyOperation'](_0x3e88d3);if(_0x117a66[_0x10d3d1+0x1]&&'move'==_0x117a66[_0x10d3d1+0x1]['type']){no(_0x5ccee1,_0x3e88d3);break;}const _0x3dc178=_0x3e88d3['position'],_0x272ac4=_0x3e88d3['howMany'],_0x1ee799=_0x893b7e(_0x2cc74c['model']['createRange'](_0x3dc178,_0x3dc178['getShiftedBy'](_0x272ac4)),_0x2cc74c['model']),_0xe628fe='suggestion:insertion:'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0xe628fe,_0x1ee799);break;}case'split':{_0x577ddd['batch']['addOperation'](_0x3e88d3),_0x2cc74c['model']['applyOperation'](_0x3e88d3);const _0x303150=_0x3e88d3['splitPosition'],_0x1ece03=_0x3e88d3['moveTargetPosition'],_0x1af477=_0x2cc74c['model']['createRange'](_0x303150,_0x1ece03),_0x27e37e='suggestion:insertion:'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0x27e37e,_0x1af477);break;}case'move':{_0x577ddd['batch']['addOperation'](_0x3e88d3),_0x2cc74c['model']['applyOperation'](_0x3e88d3),_0x117a66[_0x10d3d1-0x1]&&'insert'==_0x117a66[_0x10d3d1-0x1]['type']&&no(_0x5ccee1,_0x3e88d3);const _0x4b9fc4=_0x3e88d3['getMovedRangeStart'](),_0x3a2595=_0x3e88d3['howMany'];for(let _0x446379=0x0;_0x446379<_0x3a2595;_0x446379++){const _0xca5bb3=_0x4b9fc4['getShiftedBy'](_0x446379)['nodeAfter'];_0x4241f9['add'](_0xca5bb3);}break;}case'remove':{const _0x4ff19e=_0x3e88d3['sourcePosition'],_0x23c5d1=_0x3e88d3['howMany'],_0x5afa3c=new et(_0x4ff19e,_0x23c5d1);_0x577ddd['batch']['addOperation'](_0x5afa3c),_0x2cc74c['model']['applyOperation'](_0x5afa3c);break;}}}for(const _0x273585 of _0x4241f9){const _0x332f0a=_0x2cc74c['model']['createRangeOn'](_0x273585),_0x1ed024='suggestion:formatBlock:$fakeWrap:'+_0x926b30()+':$aiSuggestion';_0x5ccee1['markers']['set'](_0x1ed024,_0x893b7e(_0x332f0a,_0x2cc74c['model']));}});}(_0x3b44f3,_0x453196,_0x573466):_0x573466['model']['change'](_0x40b671=>{for(const _0xdd3cda of _0x3b44f3)if('remove'==_0xdd3cda['type']){const _0x2c6eca=_0xdd3cda['sourcePosition'],_0x4336c6=_0xdd3cda['howMany'],_0x4abf32=new et(_0x2c6eca,_0x4336c6);_0x40b671['batch']['addOperation'](_0x4abf32),_0x573466['model']['applyOperation'](_0x4abf32);}else{if('marker'==_0xdd3cda['type']){const _0x230d5a=_0xdd3cda['name'],_0x3aa38e=_0xdd3cda['newRange'];null!==_0x3aa38e?_0x453196['markers']['set'](_0x230d5a,_0x3aa38e):_0x453196['markers']['delete'](_0x230d5a);}else _0xdd3cda['baseVersion']=null,_0xdd3cda['isDocumentOperation']=!0x1,_0x40b671['batch']['addOperation'](_0xdd3cda),_0x573466['model']['applyOperation'](_0xdd3cda);}});if(_0x3cd8ee){const _0x41f320=mt(_0x573466,_0x3b44f3,_0x453196);ft(_0x573466['model'],_0x41f320),function(_0x8e097e,_0x17bd68){const _0x3120e6=_0x17bd68['getFirstRange']()['start'];let _0x32c524=_0x17bd68['getFirstRange']()['end'];const _0x159028=_0x3120e6['root'];(_0x32c524['textNode']||_0x32c524['nodeAfter']&&_0x32c524['nodeAfter']['is']('$text'))&&(_0x1fa6b7(_0x32c524,'...'),_0x32c524=_0x32c524['getShiftedBy'](0x3)),(_0x3120e6['textNode']||_0x3120e6['nodeBefore']&&_0x3120e6['nodeBefore']['is']('$text'))&&(_0x1fa6b7(_0x3120e6,'...'),function(_0x54823b,_0x54a317,_0x9735dc){for(let [_0x3a4501,_0x31eca4]of _0x54823b['markers']){const _0x500ac1=_0x31eca4['_getTransformedByInsertion'](_0x54a317,_0x9735dc,!0x1);_0x31eca4=_0x500ac1[0x0],_0x54823b['markers']['set'](_0x3a4501,_0x31eca4);}}(_0x159028,_0x3120e6,0x3),_0x3120e6['parent']==_0x32c524['parent']&&(_0x32c524=_0x32c524['getShiftedBy'](0x3)));const _0x4f41fd=_0x8e097e['createRange'](_0x8e097e['createPositionAt'](_0x159028,0x0),_0x3120e6),_0x1b0568=_0x8e097e['createRange'](_0x32c524,_0x8e097e['createPositionAt'](_0x159028,'end')),_0xe6d0e0=[..._0x4f41fd['getMinimalFlatRanges'](),..._0x1b0568['getMinimalFlatRanges']()];_0xe6d0e0['reverse']();for(const _0x4d7655 of _0xe6d0e0)to(_0x4d7655),Jn(_0x159028,_0x4d7655);}(_0x573466['model'],_0x41f320);}const _0x143918=_0x573466['data']['stringify'](_0x453196,{'showSuggestionHighlights':!0x0});return{'content':ji(_0x143918),'hasChanges':!0x0};}(_0x92c037,_0x6a3ed2,_0xa13f1e,_0x1cfd78,_0x308ddb);return{'type':_0x375979['changes'][0x0]['type'],'index':_0x375979['index'],'content':_0x28e838,'hasChanges':_0xe75689};});}function no(_0x301f4d,_0x36a765){for(const [_0x464f90,_0x3fe9b8]of _0x301f4d['markers']){const _0x1d5b96=it['_createFromRanges'](_0x3fe9b8['getTransformedByOperation'](_0x36a765));_0x301f4d['markers']['set'](_0x464f90,_0x1d5b96);}}function mt(_0x4f1902,_0x2d406c,_0x804ba1){const _0x224e98=_0x4f1902['plugins']['get']('DocumentCompare');let _0x487981=_0x4f1902['model']['createPositionAt'](_0x804ba1,Number['POSITIVE_INFINITY']),_0x2d9803=_0x4f1902['model']['createPositionAt'](_0x804ba1,0x0);for(const _0x5c7be0 of _0x2d406c){let _0x4681eb,_0x1d1f37;if(_0x224e98['isMarkedRemoveOperation'](_0x5c7be0))_0x4681eb=_0x5c7be0['newRange']['start'],_0x1d1f37=_0x5c7be0['newRange']['end'];else switch(_0x487981=_0x487981['getTransformedByOperation'](_0x5c7be0),_0x2d9803=_0x2d9803['getTransformedByOperation'](_0x5c7be0),_0x5c7be0['type']){case'rename':_0x4681eb=_0x5c7be0['position'],_0x1d1f37=_0x4681eb['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x4681eb=_0x5c7be0['range']['start'],_0x1d1f37=_0x5c7be0['range']['end'];break;case'insert':_0x4681eb=_0x5c7be0['position'],_0x1d1f37=_0x4681eb['getShiftedBy'](_0x5c7be0['howMany']);break;case'split':_0x4681eb=_0x5c7be0['splitPosition'],_0x1d1f37=_0x5c7be0['moveTargetPosition'];break;case'merge':{const _0x3f9bef=_0x5c7be0['targetPosition']['path']['slice'](0x0,-0x1);_0x4681eb=_0x4f1902['model']['createPositionFromPath'](_0x804ba1,_0x3f9bef),_0x1d1f37=_0x4681eb['getShiftedBy'](0x1);break;}case'remove':{const _0x3ff5aa=_0x5c7be0['howMany'],_0x7d8f96=_0x5c7be0['sourcePosition']['_getTransformedByInsertion'](_0x5c7be0['targetPosition'],_0x3ff5aa),_0x2bae20=_0x5c7be0['getMovedRangeStart']();'remove'==_0x5c7be0['type']?(_0x4681eb=_0x7d8f96,_0x1d1f37=_0x7d8f96):(_0x4681eb=_0x2bae20,_0x1d1f37=_0x2bae20['getShiftedBy'](_0x3ff5aa));break;}}_0x4681eb&&_0x4681eb['isBefore'](_0x487981)&&(_0x487981=_0x4681eb['clone'](),_0x487981['stickiness']='toNone'),_0x1d1f37&&_0x1d1f37['isAfter'](_0x2d9803)&&(_0x2d9803=_0x1d1f37['clone'](),_0x2d9803['stickiness']='toNone');}return _0x4f1902['model']['createSelection'](_0x4f1902['model']['createRange'](_0x487981,_0x2d9803));}function ft(_0x3f1778,_0x577777){ro(_0x3f1778,_0x577777,'forward');const _0x2cfdf9=_0x577777['getFirstRange']();_0x577777['setTo']([]),_0x577777['setTo'](_0x2cfdf9,{'backward':!0x0}),ro(_0x3f1778,_0x577777,'backward');}function ro(_0x127023,_0xae8e14,_0x115b04){let _0x58ccf5=0x14;for(;_0x58ccf5;){_0x127023['modifySelection'](_0xae8e14,{'unit':'word','direction':_0x115b04}),_0x58ccf5--;const _0x1d2584=_0xae8e14['focus']['forward'==_0x115b04?'nodeBefore':'nodeAfter'];if(_0x1d2584&&_0x1d2584['is']('element')&&_0x127023['schema']['isBlock'](_0x1d2584)&&_0x127023['schema']['isObject'](_0x1d2584))break;}}function Jn(_0x3aa8b1,_0x1e2cf5){for(const [_0x1d346f,_0x566a6d]of _0x3aa8b1['markers']){const _0x2e2c1b=_0x566a6d['_getTransformedByDeletion'](_0x1e2cf5['start'],_0x1e2cf5['end']['offset']-_0x1e2cf5['start']['offset']);null!=_0x2e2c1b?_0x3aa8b1['markers']['set'](_0x1d346f,_0x2e2c1b):_0x3aa8b1['markers']['delete'](_0x1d346f);}}class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Et([]);['parsedMergedContent']=new Et([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0xadc989,content:_0x1bdd0a='',isDone:_0x46c078=!0x1,interactionId:_0x3a0359,areActionsDisabled:_0xdec52,documentContextContent:_0x273ded,editor:_0x40dff5,id:_0x5eee9a}){super(),this['id']=_0x5eee9a||_0x926b30(),this['interactionId']=_0x3a0359,this['type']=_0xadc989,this['areActionsDisabled']=!!_0xdec52,this['editor']=_0x40dff5,this['aiResponseParser']=new Ui(),this['aiResponseApplier']=new Ni(),this['documentContextContent']=ji(_0x273ded||''),this['set']('isDone',_0x46c078),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x1bdd0a);}['appendContent'](_0x443a2d){this['set']('content',this['content']+_0x443a2d);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5b56b7,_0x3cb72a){this['changeGroups'][_0x5b56b7]['state']=_0x3cb72a,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5b56b7,'state':_0x3cb72a});}['getContentParts']({showDiff:_0xd3e3ab,groupIndex:_0x56b8d3}){if(!this['editor'])throw new _0x36ca17('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x4d80cf=this['_getCachedContentParts'](_0xd3e3ab,_0x56b8d3);if(_0x4d80cf)return _0x4d80cf;let _0x4535a4=[];if(void 0x0===_0x56b8d3)_0x4535a4=this['changeGroups'];else{const _0x5d6d76=this['changeGroups']['find'](({index:_0x3c752d})=>_0x3c752d===_0x56b8d3);if(!_0x5d6d76)throw new _0x36ca17('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x56b8d3});_0x4535a4=[_0x5d6d76];}const _0x30ff6a=J({'editor':this['editor'],'showDiff':_0xd3e3ab,'changeGroups':_0x4535a4,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0xd3e3ab,_0x30ff6a),_0x30ff6a;}['_getCachedContentParts'](_0x1f4b4a,_0x31ba30){const _0x39c438=_0x1f4b4a?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x39c438]['length'])return null;const _0x13665a=this['cachedSuggestionContentParts'][_0x39c438];if(void 0x0===_0x31ba30)return _0x13665a['length']>0x0&&_0x13665a['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x1f4b4a,null),null):_0x1e538d(_0x13665a);{const _0x2a2b6c=_0x13665a['find'](({index:_0x129056})=>_0x129056===_0x31ba30);if(_0x2a2b6c)return[_0x1e538d(_0x2a2b6c)];}return null;}['_setCachedContentParts'](_0x5d6b93,_0x106e99){const _0x288e9e=_0x5d6b93?'withDiff':'withoutDiff';_0x106e99?_0x106e99['forEach'](_0x1181a3=>{const _0x2b4490=this['cachedSuggestionContentParts'][_0x288e9e],_0x4d2739=_0x2b4490['find'](({index:_0x4490fe})=>_0x4490fe===_0x1181a3['index']);if(_0x4d2739){const _0x1a0daa=_0x2b4490['indexOf'](_0x4d2739);_0x2b4490['splice'](_0x1a0daa,0x1,_0x1181a3);}else _0x2b4490['push'](_0x1181a3);}):this['cachedSuggestionContentParts'][_0x288e9e]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x3a63fd=this['changeGroups'];this['updateChangeGroups']();const _0x148508=this['_getDifferentChangeGroups'](_0x3a63fd,this['changeGroups']);(_0x148508['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x148508),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x32f56b,_0x157427){const _0x1b33a0=[];for(const _0xab1be9 of _0x157427){const _0x2c5239=_0x32f56b[_0xab1be9['index']];_0x2c5239?_0x2c5239['changes']['length']!==_0xab1be9['changes']['length']?_0x1b33a0['push'](_0xab1be9):_0x2c5239['changes']['forEach']((_0x2a6bf7,_0x308615)=>{const _0x102cb8=_0xab1be9['changes'][_0x308615];_0x2a6bf7['id']!==_0x102cb8['id']&&_0x1b33a0['push'](_0xab1be9);}):_0x1b33a0['push'](_0xab1be9);}return _0x1b33a0;}['updateChangeGroups'](){const _0x511230=new _0x10ebb7('p',{},[new _0x10ebb7('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x280441(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x598b7b=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x511230,'cutAfterLastChange':!this['isDone']});if(!_0x598b7b['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x598b7b['parsedContent'];let _0x19e668=[];if(_0x3e90f0(_0xb666f4=>{const _0x403b36=At(_0xb666f4,'data-id');if(!_0x403b36||!_0x152b95(_0x403b36))return!0x1;const _0x537876=[_0xb666f4,...Gi(_0xb666f4)]['at'](-0x2);if(_0xb666f4!=_0x537876){const _0x41a31e=At(_0x537876,'data-id');_0x152b95(_0x41a31e)||(_0x19e668['push']({'node':_0x537876,'id':_0x41a31e,'type':'modified'}),_0x598b7b['modifiedNodeIds']['push'](_0x41a31e));}else _0x598b7b['modifiedNodeIds']['includes'](_0x403b36)?_0x19e668['push']({'node':_0xb666f4,'type':'modified','id':_0x403b36}):_0x598b7b['newNodeIds']['includes'](_0x403b36)?_0x19e668['push']({'node':_0xb666f4,'type':'new','id':_0x403b36,'anchorId':At(_0xb666f4['previousSibling'],'data-id')}):_0x19e668['push']({'node':_0xb666f4,'type':'removed','id':_0x403b36});return!0x0;},this['parsedMergedContent']),_0x19e668=_0x19e668['filter'](({node:_0x6a2959})=>[...Gi(_0x6a2959),_0x6a2959]['every'](_0x1a2734=>!At(_0x1a2734,'data-unstable'))),0x0==_0x19e668['length'])return;const _0x2633cd=[[_0x19e668[0x0]]];for(let _0x4490ed=0x1;_0x4490ed<_0x19e668['length'];_0x4490ed++){const _0x15fee4=_0x2633cd[_0x2633cd['length']-0x1],_0x566a6f=_0x15fee4[_0x15fee4['length']-0x1];_0x19e668[_0x4490ed]['node']['previousSibling']==_0x566a6f['node']&&'modified'!=_0x19e668[_0x4490ed]['type']&&'modified'!=_0x566a6f['type']?_0x15fee4['push'](_0x19e668[_0x4490ed]):_0x2633cd['push']([_0x19e668[_0x4490ed]]);}for(const _0xf823ed of _0x2633cd){const _0x5b3a16=_0xf823ed[0x0],_0x5d8e9e=_0xf823ed[_0xf823ed['length']-0x1],_0x4ac99d=_0x8ae9c6(_0x5b3a16['node']['previousSibling']);_0x4ac99d&&_0xf823ed['unshift'](_0x4ac99d);const _0x23a6d6=_0x8ae9c6(_0x5d8e9e['node']['nextSibling']);_0x23a6d6&&_0xf823ed['push'](_0x23a6d6);}function _0x152b95(_0x529429){return _0x598b7b['modifiedNodeIds']['includes'](_0x529429)||_0x598b7b['newNodeIds']['includes'](_0x529429)||_0x598b7b['removedNodeIds']['includes'](_0x529429);}function _0x8ae9c6(_0x26e7d1){if(_0x26e7d1&&At(_0x26e7d1,'data-id')&&!At(_0x26e7d1,'data-unstable')){const _0x26548a=At(_0x26e7d1,'data-id');if(!_0x152b95(_0x26548a))return{'node':_0x26e7d1,'type':'context','id':_0x26548a};}return null;}this['changeGroups']=_0x2633cd['map']((_0x3f5e82,_0x2dd7a8)=>({'changes':_0x3f5e82,'state':'pending','index':_0x2dd7a8}));}}const ye=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xe extends _0x290e58(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x25853d,editor:_0x3cd1ac}){super(),this['id']=_0x926b30(),this['connector']=_0x25853d,this['isStopped']=!0x0,this['editor']=_0x3cd1ac;}async['start'](){const _0x28e52a=[];let _0x31ae13,_0x159393,_0x1b8a62;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x49c604=await this['currentRequest']['getStream']();for await(const _0x452fbf of _0x49c604){if(this['isStopped'])return;if('error'==_0x452fbf['event'])return void this['fire']('error',{'error':new _0x36ca17('ai-chat-interaction-error',this)});switch(_0x452fbf['event']){case'message-metadata':this['messageId']=_0x452fbf['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x452fbf['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x452fbf['data']['conversationTitle'],!0x0);break;case'source':_0x28e52a['push'](_0x452fbf['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x31ae13='modification-delta'==_0x452fbf['event']?'modification':'text',_0x159393='modification-delta'==_0x452fbf['event']?_0x452fbf['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x31ae13&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x31ae13,'interactionId':this['id'],'id':_0x159393}),'modification'==_0x31ae13&&(this['currentReply']['sources']=_0x28e52a['splice'](0x0))),this['currentReply']['appendContent'](_0x452fbf['data']['textDelta']);break;case'mcp-tool-result':_0x1b8a62=JSON['parse'](_0x452fbf['data']['result']),this['_handleToolResultData']({'toolName':_0x452fbf['data']['toolName'],'data':_0x1b8a62['data'],'attributes':_0x1b8a62['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x452fbf['data']['toolName'],'data':_0x452fbf['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x28e52a['length']>0x0&&(this['currentReply']['sources']=_0x28e52a['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x459aed){return this['replies']['find'](_0xaee016=>_0xaee016['id']===_0x459aed);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x48ee76=>_0x48ee76['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0xbf88c2){const _0x4c6d80=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0xbf88c2});return this['replies']['push'](_0x4c6d80),_0x4c6d80['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x4c6d80),_0x4c6d80;}['setConversationTitle'](_0xe4feee,_0x133ff0=!0x1){this['fire']('setConversationTitle',_0xe4feee,_0x133ff0);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0xeec383){this['fire']('toolDataReceived',{'type':'result','toolName':_0xeec383['toolName'],'data':structuredClone(_0xeec383['data']||{}),'attributes':structuredClone(_0xeec383['attributes']||{})},this);}['_handleToolNotificationData'](_0x156c37){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x156c37['toolName'],'data':structuredClone(_0x156c37['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var qe=function(_0x20acab){return _0x20acab['TOOL']='mcp-tool-context',_0x20acab['FILE']='file',_0x20acab['DOCUMENT']='document',_0x20acab['URL']='web-resource',_0x20acab['TEXT']='text',_0x20acab['SELECTION']='selection',_0x20acab;}({}),Fe=function(_0x19fc79){return _0x19fc79['TEXT']='text',_0x19fc79['MARKDOWN']='markdown',_0x19fc79['HTML']='html',_0x19fc79;}({});const Ue=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),He=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class We extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x3a4309,config:_0x4a5fd4,ownerId:_0x266b42}){super(),this['_connector']=_0x3a4309,this['_config']=_0x4a5fd4,this['_ownerId']=_0x266b42;}['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'](_0x81167e){const _0x34ff53=await this['_createContextItemFromContent'](_0x81167e);return this['_addToConversationContextItem'](_0x34ff53),'current-document'===_0x34ff53['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x34ff53;}async['_createContextItemFromContent'](_0x205fd7){if(_0x205fd7['type']===qe['DOCUMENT']){const _0x362e31=await this['_connector']['fetchDocument'](this['_ownerId'],_0x205fd7['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x205fd7['type'],'content':_0x362e31['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x362e31['attributes']?.['version'],'sessionId':_0x362e31['attributes']?.['sessionId']};}if(_0x205fd7['type']===qe['TOOL'])return{'id':_0x205fd7['id'],'uiId':_0x205fd7['id'],'label':_0x205fd7['data']?.['label']||_0x205fd7['id'],'type':qe['TOOL'],'mcpServerName':_0x205fd7['mcpServerName'],'toolName':_0x205fd7['toolName'],'data':_0x205fd7['data']||{}};return{'id':_0x205fd7['id'],'uiId':_0x205fd7['id'],'label':_0x205fd7['attributes']?.['label']||_0x205fd7['name']||_0x205fd7['url']||_0x205fd7['id'],'type':_0x205fd7['type'],..._0x205fd7?.['attributes']?.['resourceId']?{'resourceId':_0x205fd7['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x973e4){const _0x188d39=this['_pendingContextItems']['get'](_0x973e4);_0x188d39?.['isReadOnly']||this['_removeContextItem'](_0x973e4);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x96bf9a of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x96bf9a['uiId']);const _0x425ed3=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x425ed3&&this['_addContextItem']({..._0x425ed3,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3e183f){for(const _0x4393cc of _0x3e183f['values']())this['_addToConversationContextItem'](_0x4393cc);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'](_0x3f671c){return Array['from'](_0x3f671c['values']())['map'](_0x483ddd=>this['_mapContextItemToRequestData'](_0x483ddd))['filter'](_0x1d8299=>null!==_0x1d8299);}async['addFilesToContext'](_0x81818e,_0x1565d1,_0x4d10ca=qe['FILE']){const _0x4fff72='files-'+_0x926b30();this['_startUploadOperation'](_0x4fff72);try{await Promise['all'](_0x81818e['map'](async _0x51889a=>{const _0x4c3dd9='file-'+_0x926b30(),_0x25f800=_0xac888d(_0x51889a['name']);try{this['_addContextItem']({'type':_0x4d10ca,'label':_0x1565d1?.['label']||_0x25f800,'uiId':_0x4c3dd9,'resourceId':_0x1565d1?.['resourceId']},!0x0);const _0xe9b0ce=this['_connector']['uploadFile'](this['_ownerId'],_0x51889a,_0x1565d1);this['_ongoingUploads']['set'](_0x4c3dd9,_0xe9b0ce['abortController']);const {id:_0x5a626}=await _0xe9b0ce['getId']();this['_ongoingUploads']['delete'](_0x4c3dd9),this['_finishContextItemLoading']({'type':_0x4d10ca,'id':_0x5a626,'label':_0x1565d1?.['label']||_0x25f800,'uiId':_0x4c3dd9,'resourceId':_0x1565d1?.['resourceId']},!0x1);}catch(_0x4c0507){this['_ongoingUploads']['delete'](_0x4c3dd9);if(!(_0x4c0507 instanceof _0x36ca17&&_0x4c0507['message']['startsWith']('ai-request-aborted'))){const _0x3c7510=Ue['get'](_0x4c0507['code'])||'ai-chat-file-upload-failed',_0x4373d8=new _0x36ca17(_0x3c7510,null,{'fileName':_0x25f800,..._0x4c0507});_0x4373d8['stack']=_0x4c0507['stack'],this['fire']('error',{'error':_0x4373d8});}this['_removeContextItem'](_0x4c3dd9);}}));}finally{this['_finishUploadOperation'](_0x4fff72);}}['addCurrentDocumentToContext'](_0x30c46b){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x425235={'type':qe['DOCUMENT'],'uiId':'current-document','label':_0x30c46b,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x425235);}async['updateCurrentDocument'](_0x52141a,_0x88df50,_0x176237,_0x124831){const _0x38395e=this['_pendingContextItems']['get']('current-document');if(_0x38395e&&_0x52141a){_0x38395e['selection']=_0x124831?_0x124831['map'](_0x140c0f=>({'start':_0x140c0f['start'],'end':_0x140c0f['end']})):[];try{if(_0x38395e['version']===_0x88df50)return;const {id:_0x5b233d}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x52141a,{'version':_0x88df50,'sessionId':_0x176237})['getId']();_0x38395e['id']=_0x5b233d,_0x38395e['content']=_0x52141a,_0x38395e['version']=_0x88df50,_0x38395e['sessionId']=_0x176237;}catch(_0x12f811){const _0x40d187=new _0x36ca17('ai-chat-document-upload-failed',null);_0x40d187['stack']=_0x12f811['stack'],this['fire']('error',{'error':_0x40d187});}}}['addSelectionToContext'](_0x21e085){this['_addContextItem']({'type':qe['SELECTION'],'label':_0x21e085,'uiId':'selection','content':_0x21e085});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x5a4296,_0x265d35){const _0x4de937='url-'+_0x926b30();this['_startUploadOperation'](_0x4de937);const _0x33bad8='url-'+_0x926b30();try{this['_addContextItem']({'type':qe['URL'],'label':_0x265d35?.['label']||_0x5a4296,'uiId':_0x33bad8,'resourceId':_0x265d35?.['resourceId']},!0x0);const _0x3a2c52=this['_connector']['uploadUrl'](this['_ownerId'],_0x5a4296,_0x265d35);this['_ongoingUploads']['set'](_0x33bad8,_0x3a2c52['abortController']);const {id:_0x48e0cb}=await _0x3a2c52['getId']();this['_ongoingUploads']['delete'](_0x33bad8),this['_finishContextItemLoading']({'type':qe['URL'],'id':_0x48e0cb,'label':_0x265d35?.['label']||_0x5a4296,'uiId':_0x33bad8,'resourceId':_0x265d35?.['resourceId']},!0x1);}catch(_0x551a60){this['_ongoingUploads']['delete'](_0x33bad8),(_0x551a60['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x36ca17('ai-chat-url-upload-failed',this,{'url':_0x5a4296,'originalError':_0x551a60}),'url':_0x5a4296}),this['_removeContextItem'](_0x33bad8));}finally{this['_finishUploadOperation'](_0x4de937);}}['addToolItemToContext'](_0x606886){_0x606886['id']=_0x606886['id']??_0x926b30()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x606886['uiId'],_0x606886),this['fire']('contextItemAdded',{'contextItem':_0x606886,'isLoading':!0x1});}async['loadSourceResources'](_0x5bba26,_0x496f07,_0x3e9d60){const _0x3aab27=this['_addContextOptionsState']['sources']['find'](_0x36b830=>_0x36b830['id']===_0x5bba26);if(!_0x3aab27)return this['fire']('error',{'error':new _0x36ca17('ai-chat-source-not-found',this,{'sourceId':_0x5bba26}),'sourceId':_0x5bba26}),[];try{const _0x550f43=(await _0x3aab27['getResources'](_0x496f07))['map'](_0x54ce5b=>{const _0x46f9e5=this['_isResourceInContext'](_0x54ce5b['id']);return{..._0x54ce5b,'isInContext':_0x46f9e5};});return _0x3aab27['resources']=_0x550f43,this['fire']('sourceResourcesLoaded',{'sourceId':_0x5bba26,'source':_0x3aab27,'resources':_0x550f43,'uid':_0x3e9d60}),_0x550f43;}catch(_0x3ad595){return this['fire']('error',{'error':new _0x36ca17('ai-chat-source-resources-load-failed',this,{'sourceId':_0x5bba26,'originalError':_0x3ad595}),'sourceId':_0x5bba26,'sourceLabel':_0x3aab27['label']}),[];}}async['addResourceToContext'](_0x44cf27,_0x100993){if(this['_isResourceInContext'](_0x100993['id']))return;let _0x33a1b1=_0x100993['data'];if(!_0x33a1b1&&_0x44cf27['getData'])try{_0x33a1b1=await _0x44cf27['getData'](_0x100993['id']);}catch(_0x1d2d74){return void this['fire']('error',{'error':new _0x36ca17('ai-chat-resource-load-failed',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id'],'originalError':_0x1d2d74}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});}if(_0x33a1b1)switch(_0x100993['type']){case qe['URL']:if('string'!=typeof _0x33a1b1)return void this['fire']('error',{'error':new _0x36ca17('ai-chat-context-invalid-data',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id'],'expectedType':'string','actualType':typeof _0x33a1b1}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});await this['addUrlToContext'](_0x33a1b1,{'label':_0x100993['label'],'resourceId':_0x100993['id']});break;case qe['FILE']:if(!(_0x33a1b1 instanceof File))return void this['fire']('error',{'error':new _0x36ca17('ai-chat-context-invalid-data',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id'],'expectedType':'File','actualType':typeof _0x33a1b1}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});await this['addFilesToContext']([_0x33a1b1],{'label':_0x100993['label'],'resourceId':_0x100993['id']});break;case qe['TEXT']:if('object'!=typeof _0x33a1b1||!('content'in _0x33a1b1)||!('type'in _0x33a1b1))return void this['fire']('error',{'error':new _0x36ca17('ai-chat-context-invalid-data',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x33a1b1}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});_0x33a1b1=We['_convertTextResourceToFile'](_0x33a1b1,_0x100993['label']),await this['addFilesToContext']([_0x33a1b1],{'label':_0x100993['label'],'resourceId':_0x100993['id']},qe['TEXT']);break;case qe['TOOL']:break;default:this['fire']('error',{'error':new _0x36ca17('ai-chat-context-unsupported-type',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id'],'resourceType':_0x100993['type']}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});}else this['fire']('error',{'error':new _0x36ca17('ai-chat-resource-no-data',this,{'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']}),'resourceId':_0x100993['id'],'sourceId':_0x44cf27['id']});}static['_convertTextResourceToFile'](_0x14631a,_0x51587e){switch(_0x14631a['type']){case Fe['MARKDOWN']:return new File([_0x14631a['content']],_0x51587e,{'type':'text/markdown'});case Fe['HTML']:return new File([_0x14631a['content']],_0x51587e,{'type':'text/html'});default:return new File([_0x14631a['content']],_0x51587e,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x43329f){switch(_0x43329f['type']){case qe['FILE']:return{'type':qe['FILE'],'id':_0x43329f['id']};case qe['URL']:return{'type':qe['URL'],'id':_0x43329f['id']};case qe['DOCUMENT']:return{'type':qe['DOCUMENT'],'id':_0x43329f['id'],..._0x43329f['selection']?.['length']&&{'selection':_0x43329f['selection']}};case qe['TEXT']:return{'type':qe['FILE'],'id':_0x43329f['id']};case qe['TOOL']:{const _0x5c1cac=_0x43329f;return{'type':qe['TOOL'],'mcpServerName':_0x5c1cac['mcpServerName'],'toolName':_0x5c1cac['toolName'],'data':_0x5c1cac['data'],'id':_0x5c1cac['id']};}default:return null;}}['_addContextItem'](_0x161d9f,_0x9b6107=!0x1){if(this['_pendingContextItems']['set'](_0x161d9f['uiId'],_0x161d9f),_0x161d9f['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x161d9f,'isLoading':_0x9b6107}),'current-document'===_0x161d9f['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x161d9f['resourceId']){const _0x50f9e8=this['_findSourceIdsByResourceId'](_0x161d9f['resourceId']);_0x50f9e8&&_0x50f9e8['forEach'](_0x4a1254=>{this['_updateResourceInContextState'](_0x4a1254,_0x161d9f['resourceId'],!0x0);});}}['_removeContextItem'](_0x2eb16c){const _0x3bdf51=this['_pendingContextItems']['get'](_0x2eb16c),_0x2586e7=this['_ongoingUploads']['get'](_0x2eb16c);if(_0x2586e7&&(_0x2586e7['abort'](),this['_ongoingUploads']['delete'](_0x2eb16c)),_0x3bdf51?.['resourceId']){const _0xffb063=this['_findSourceIdsByResourceId'](_0x3bdf51['resourceId']);_0xffb063&&_0xffb063['forEach'](_0x3d060b=>{this['_updateResourceInContextState'](_0x3d060b,_0x3bdf51['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2eb16c),this['fire']('contextItemRemoved',{'uiId':_0x2eb16c,'type':_0x3bdf51?.['type']}),'current-document'===_0x2eb16c&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x4c2724,_0x5057ff){if(this['_pendingContextItems']['has'](_0x4c2724['uiId'])&&(this['_pendingContextItems']['set'](_0x4c2724['uiId'],_0x4c2724),this['fire']('contextItemLoadingEnded',{'contextItem':_0x4c2724,'isLoading':_0x5057ff}),_0x4c2724['resourceId'])){const _0x4f0f2e=this['_findSourceIdsByResourceId'](_0x4c2724['resourceId']);_0x4f0f2e&&_0x4f0f2e['forEach'](_0x3b6b55=>{this['_updateResourceInContextState'](_0x3b6b55,_0x4c2724['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x595dbc){this['_conversationContextItems']['set'](_0x595dbc['uiId'],_0x595dbc);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0xf078c5=>({..._0xf078c5,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x251ebd=>({..._0x251ebd,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x544ed4=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x544ed4,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x5c9ef4){for(const _0x4dd42a of this['_pendingContextItems']['values']())if(_0x4dd42a['resourceId']===_0x5c9ef4)return!0x0;for(const _0x2c0016 of this['_conversationContextItems']['values']())if(_0x2c0016['resourceId']===_0x5c9ef4)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0xd5c82f){const _0x159abb=[];for(const _0x3171a9 of this['_addContextOptionsState']['sources']){_0x3171a9['resources']['find'](_0x1f1cd7=>_0x1f1cd7['id']===_0xd5c82f)&&_0x159abb['push'](_0x3171a9['id']);}return 0x0===_0x159abb['length']?null:_0x159abb;}['_updateResourceInContextState'](_0x39b7d6,_0x55171f,_0x18fcac){const _0x54e15f=this['_addContextOptionsState']['sources']['find'](_0xe094d2=>_0xe094d2['id']===_0x39b7d6);if(!_0x54e15f)return;const _0x1938fa=_0x54e15f['resources']['find'](_0x11e656=>_0x11e656['id']===_0x55171f);_0x1938fa&&(_0x1938fa['isInContext']=_0x18fcac,this['fire']('resourceStateChanged',{'sourceId':_0x39b7d6,'resourceId':_0x55171f,'isInContext':_0x18fcac}));}['_startUploadOperation'](_0x35f75a){this['_ongoingUploadOperations']['set'](_0x35f75a,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x4da689){this['_ongoingUploadOperations']['delete'](_0x4da689),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Be=['capabilitiesUpdated'];class Je extends _0x290e58(){['_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'](_0xbc4065){const _0x39cafc={};return _0xbc4065&&_0xbc4065['isWebSearchEnabled']&&(_0x39cafc['webSearch']={}),_0xbc4065&&_0xbc4065['isReasoningEnabled']&&(_0x39cafc['reasoning']={}),_0x39cafc;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x4442ff){_0x4442ff!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4442ff,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x375000){_0x375000!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x375000,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ke extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x13dede){super(_0x13dede),this['conversationId']=_0x13dede['conversationId'],this['contextItems']=_0x13dede['contextItems'],this['capabilities']=_0x13dede['capabilities'],this['userMessage']=_0x13dede['userMessage'],this['model']=_0x13dede['model'],this['attributes']=_0x13dede['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':We['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Je['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class _t extends _0x290e58(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x311d93){super(),this['options']=_0x311d93,this['connector']=_0x311d93['connector'],this['chatModels']=_0x311d93['chatModels'],this['id']=_0x311d93['conversationId'],this['isFromHistory']=_0x311d93['isFromHistory'];}async['init'](_0xb82acc){try{this['chatContext']=new We({'connector':this['connector'],'config':_0xb82acc,'ownerId':this['id']}),this['chatContext']['delegate'](...He)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Je(),this['chatCapabilities']['delegate'](...Be)['to'](this),this['chatCapabilities']['init']();const _0x1c70fb=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x1c70fb});const _0x2ae82b=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x2ae82b&&await this['setModel'](_0x2ae82b);}catch(_0x563400){const _0xce44d5=new _0x36ca17('ai-chat-conversation-init-failed',null,{'message':_0x563400['message']||_0x563400});_0xce44d5['stack']=_0x563400['stack'],this['fire']('error',{'error':_0xce44d5});}}async['start'](){if(this['isStarted'])throw new _0x36ca17('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x36ca17('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x18288e}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x18288e,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x28846d){const _0x53e969=new _0x36ca17('ai-chat-conversation-start-failed',null,{'message':_0x28846d['message'],'conversationId':this['id']});throw _0x53e969['stack']=_0x28846d['stack'],this['fire']('error',{'error':_0x53e969}),_0x53e969;}}async['load'](_0x1964a2,_0x237522){try{const _0x25ef62=await this['connector']['fetchConversation'](_0x1964a2)['getConversation'](),_0x32047b=await this['connector']['fetchConversationMessages'](_0x1964a2)['getMessages'](),_0x19cdad=_0x32047b[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x25ef62['id'],'title'in _0x25ef62?this['fire']('setConversationTitle',_0x25ef62['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x1eafe0=(await this['chatModels']['getAll']())['find'](_0x34d757=>_0x34d757['id']['toLowerCase']()===_0x19cdad['toLowerCase']());return this['selectedModel']=_0x1eafe0,this['fire']('modelSelected',{'selectedModel':_0x1eafe0,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x32047b,_0x237522,_0x19cdad),this['currentInteraction']=void 0x0,this;}catch(_0x13efcc){const _0x4237fa=new _0x36ca17('ai-chat-conversation-init-from-id-failed',null,{'message':_0x13efcc['message'],'conversationId':_0x1964a2});throw _0x4237fa['stack']=_0x13efcc['stack'],this['fire']('error',{'error':_0x4237fa}),_0x4237fa;}}async['_processMessagesToInteractions'](_0x230f65,_0x271b19,_0x3f2c50){let _0x1e5ce4;for(const _0x4e132e of _0x230f65)if('user'===_0x4e132e['role']){const _0x505b5f=await this['_extractContextItems'](_0x4e132e),_0x4b56c9={'isReasoningEnabled':Object['hasOwn'](_0x4e132e['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x4e132e['capabilities'],'webSearch')};_0x1e5ce4=this['createInteraction']({'userMessage':_0x4e132e['prompt'],'contextItems':_0x505b5f,'capabilities':_0x4b56c9,'modelId':_0x3f2c50,'attributes':_0x4e132e['attributes']}),this['currentInteraction']=_0x1e5ce4,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x4e132e['role']&&_0x1e5ce4){const _0x541bfd=[];for(const _0x3a1660 of _0x4e132e['content'])switch(_0x3a1660['type']){case'text':case'modification':{const _0x2ae937=_0x1e5ce4['getDocumentContext']()?.['sessionId']!==_0x271b19;_0x1e5ce4['currentReply']=_0x1e5ce4['createReply']({'type':_0x3a1660['type'],'isDone':!0x0,'interactionId':_0x1e5ce4['id'],'areActionsDisabled':_0x2ae937}),_0x1e5ce4['currentReply']['appendContent'](_0x3a1660['content']),_0x541bfd['length']>0x0&&(_0x1e5ce4['currentReply']['sources']=_0x541bfd['splice'](0x0));break;}case'url':_0x541bfd['push'](_0x3a1660);break;case'mcp-tool-result':{const {data:_0x2bf354,attributes:_0x5e419f}=JSON['parse'](_0x3a1660['content']);_0x1e5ce4['_handleToolResultData']({'toolName':_0x3a1660['toolName'],'data':_0x2bf354,'attributes':_0x5e419f});break;}}}}}async['_extractContextItems'](_0x5cf453){const _0x3efbed=new Map();if(!_0x5cf453['content'])return _0x3efbed;for(const _0x30f3ce of _0x5cf453['content']){const _0x1ce352=await this['chatContext']['populateFromMessage'](_0x30f3ce);_0x1ce352&&_0x3efbed['set'](_0x1ce352['id'],_0x1ce352);}return _0x3efbed;}async['handleUserInteraction']({userMessage:_0x20c9ef,attributes:_0x20d512}){if(!this['isStarted'])throw new _0x36ca17('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x36ca17('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x25d05c=this['chatContext']['getPendingContextItems'](),_0x49fe9d=this['chatCapabilities']['getCapabilitiesConfig'](),_0x1144e9=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x20c9ef,'contextItems':_0x25d05c,'capabilities':_0x49fe9d,'modelId':_0x1144e9,'attributes':_0x20d512}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x5cfb78){if(_0x5cfb78 instanceof _0x36ca17)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x5cfb78});else{const _0x43aadf=Ue['get'](_0x5cfb78['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x36ca17(_0x43aadf,null,{'error':_0x5cfb78})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x3ec23f,contextItems:_0x112683,capabilities:_0x285bf0,modelId:_0x10211f,attributes:_0x5ee5be}){const _0x1f9ea2=new Ke({'userMessage':_0x3ec23f,'contextItems':_0x112683,'capabilities':_0x285bf0,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x10211f,'attributes':_0x5ee5be});return _0x1f9ea2['delegate'](...ye)['to'](this),this['interactions']['push'](_0x1f9ea2),this['fire']('interactionCreated',_0x1f9ea2),_0x1f9ea2;}['getInteraction'](_0x5864be){return this['interactions']['find'](_0x244395=>_0x244395['id']===_0x5864be);}['removeInteraction'](_0x5ed5f6){const _0x4cec46=this['getInteraction'](_0x5ed5f6);_0x4cec46&&(_0x4cec46['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4cec46),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x54b31f){this['chatContext']['addCurrentDocumentToContext'](_0x54b31f);}async['updateCurrentDocumentInContext']({content:_0x2577d1,version:_0x2d946f,sessionId:_0x4859ec,selections:_0xca16f0}){await this['chatContext']['updateCurrentDocument'](_0x2577d1,_0x2d946f,_0x4859ec,_0xca16f0);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x3df48a){this['chatContext']['addSelectionToContext'](_0x3df48a);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x11638f){this['chatContext']['addFilesToContext'](_0x11638f);}['addUrlToContext'](_0x46ad81){this['chatContext']['addUrlToContext'](_0x46ad81);}['addToolItemToContext'](_0x4c44d7){this['chatContext']['addToolItemToContext'](_0x4c44d7);}['addResourceToContext'](_0x11ffe9,_0x377c9b){this['chatContext']['addResourceToContext'](_0x11ffe9,_0x377c9b);}['loadSourceResources'](_0x47bfdc,_0x1c14f8,_0x47a5c1){return this['chatContext']['loadSourceResources'](_0x47bfdc,_0x1c14f8,_0x47a5c1);}['removeFromContext'](_0x4c5b03){this['chatContext']['removeFromContext'](_0x4c5b03);}['setWebSearch'](_0x1ea804){this['chatCapabilities']['setWebSearch'](_0x1ea804);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x275eb7){this['chatCapabilities']['setReasoning'](_0x275eb7);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x1c14f6){_0x1c14f6?!0x1===await this['chatModels']['isAvailable'](_0x1c14f6)&&(_0x3bfc82('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x1c14f6}),_0x1c14f6=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x3bfc82('ai-chat-conversation-set-model-null',{'conversation':this}),_0x1c14f6=(await this['chatModels']['getAvailableModels']())[0x0]),_0x1c14f6['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x1c14f6,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x1c14f6}));}}class It extends _0x290e58(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3e4072,config:_0x13c6c3,locale:_0x13bd3f}){super(),this['_connector']=_0x3e4072,this['_config']=_0x13c6c3,this['_locale']=_0x13bd3f;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x3ae98b=await this['getAll']();let _0x398678;return _0x398678=this['_availableModels']?this['_filterModels'](_0x3ae98b,this['_availableModels']):_0x3ae98b['filter'](_0x1d7ed5=>_0x1d7ed5['recommended']),_0x398678;}async['getModel'](_0x5f4bad){const _0x4cf883=await this['getAll']();if(!_0x4cf883['length'])return null;if(_0x5f4bad){const _0x4d23a3=this['_getModelById'](_0x4cf883,_0x5f4bad);if(_0x4d23a3)return _0x4d23a3;_0x3bfc82('ai-chat-model-id-unrecognized',{'modelId':_0x5f4bad,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x29f591=await this['getAvailableModels']();if(!_0x29f591['length'])return null;if(this['_defaultModelId']){const _0x26d597=this['_getModelById'](_0x29f591,this['_defaultModelId']);if(_0x26d597)return _0x26d597;_0x3bfc82('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x29f591[0x0]['id']});}return _0x29f591[0x0];}async['isAvailable'](_0x25261c){return(await this['getAvailableModels']())['some'](_0x5eb341=>_0x5eb341['name']===_0x25261c['name']&&_0x5eb341['provider']===_0x25261c['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x8db321=this['_locale']['uiLanguage']||'en',_0x3183b8=this['_connector']['getModels'](_0x8db321),_0x3e47c7=await _0x3183b8['list']();this['_modelList']=_0x3e47c7['items']['map'](_0x205c8c=>vi(_0x205c8c)?{..._0x205c8c,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x205c8c);}catch(_0x3c8635){throw gt('ai-models-unable-to-retrieve',{'error':_0x3c8635}),_0x3c8635;}return[...this['_modelList']];}['_filterModels'](_0x5344fe,_0x3289e0){let _0x1ded37;if(_0x3289e0){_0x1ded37=[];const _0x4a284f=new Set(),_0x7e3bc5='string'==typeof _0x3289e0?[_0x3289e0['toLocaleLowerCase']()]:_0x3289e0['map'](_0x309616=>_0x309616['toLocaleLowerCase']());for(const _0x34b9b0 of _0x7e3bc5)for(const _0x4f1db3 of _0x5344fe)!_0x4a284f['has'](_0x4f1db3['id'])&&this['_isMatchingFilter'](_0x4f1db3,_0x34b9b0)&&(_0x1ded37['push'](_0x4f1db3),_0x4a284f['add'](_0x4f1db3['id']));}else _0x1ded37=_0x5344fe;return _0x1ded37;}['_isMatchingFilter'](_0x168ded,_0x2baef3){const _0x1fdacd=_0x168ded['id']['toLocaleLowerCase'](),_0x1ed1d8=_0x168ded['name']['toLocaleLowerCase'](),_0x265463=_0x168ded['provider']['toLocaleLowerCase']();return _0x1fdacd===_0x2baef3||_0x1ed1d8===_0x2baef3||vi(_0x168ded)&&'auto'===_0x2baef3||_0x265463===_0x2baef3||_0x1fdacd['startsWith'](_0x2baef3);}['_getModelById'](_0x4c2758,_0x5d35a8){return _0x4c2758['find'](_0x297487=>vi(_0x297487)&&'auto'===_0x5d35a8?_0x297487:_0x297487['id']===_0x5d35a8)||null;}}function vi(_0x2f99e5){return _0x2f99e5['id']['startsWith']('agent');}function T(_0x19da04){if(_0x19da04 instanceof dt)return _0x19da04;if(_0x19da04?.['editors']&&_0x19da04['editors']['get'](0x0))return _0x19da04['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.'),_0x19da04['editors']['get'](0x0);throw new _0x36ca17('ai-get-editor-from-context-no-editor');}function Z({editor:_0x21d971,interaction:_0xefa739,reply:_0x2443a7,groups:_0x3982a8,transform:_0x2472f9,documentCompare:_0x170428,documentCompareOptions:_0x510d7a}){const _0xfdb813=_0xefa739['getDocumentContext']();if(!_0xfdb813)return[];const _0x2fdd3d=_0xfdb813['content'],_0x64cc12=_0xfdb813['version'],_0x3ba04f=_0x2443a7['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1f4ebf}of _0x3982a8){const _0x163f83=_0x1f4ebf['filter'](_0xe97b47=>'new'!=_0xe97b47['type'])['map'](_0x4ca803=>St('data-id',_0x4ca803['id'],_0x3ba04f)),_0x4e9f2e=_0x1f4ebf['filter'](_0x755d94=>'removed'!=_0x755d94['type'])['map'](_0x1684d5=>_0x1684d5['node']['cloneNode'](!0x0));let _0x1132a3=null;if(_0x163f83['length']){_0x1132a3=_0x163f83[0x0]['previousSibling'];for(let _0x4ee6f3=0x0;_0x4ee6f3<_0x163f83['length'];_0x4ee6f3++)_0x4c1d4c(_0x163f83[_0x4ee6f3]);}if(_0x4e9f2e['length']){_0x1132a3||(_0x1f4ebf[0x0]['anchorId']?_0x1132a3=St('data-id',_0x1f4ebf[0x0]['anchorId'],_0x3ba04f):(_0x1132a3=_0x4e9f2e['shift'](),_0x12356b(_0x3ba04f,_0x1132a3)));for(let _0x2b5ee2=0x0;_0x2b5ee2<_0x4e9f2e['length'];_0x2b5ee2++)_0x2bdf7a(_0x1132a3,_0x4e9f2e[_0x2b5ee2]),_0x1132a3=_0x4e9f2e[_0x2b5ee2];}}const _0x215010=Tt(_0x3ba04f),_0xe4462a=_0x170428['getDiff'](_0x2fdd3d,_0x215010,_0x510d7a)['getOperations']();if(_0x2472f9){const _0x129619=_0x21d971['model']['document']['history']['getOperations'](_0x64cc12),_0x4820df={'document':_0x21d971['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return nt(_0xe4462a,_0x129619,_0x4820df)['operationsA'];}return _0xe4462a;}function Y(_0x2ffbd7,_0x25c00d){if('marker'!=_0x25c00d['type'])return;const _0x1b75c4=_0x2ffbd7['model']['markers']['get'](_0x25c00d['name']);_0x1b75c4&&(_0x25c00d['oldRange']=_0x1b75c4['getRange']());}class at extends _0x575928{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[q,_0x29a341];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x591ff4(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new It({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x10bcec=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x1f83d5,_0x3748ce)=>{this['_handleUIUserMessage']({'userMessage':_0x3748ce});}),this['listenTo'](_0x10bcec,'resizedTabs',(_0x5bf748,_0x1be5d3)=>{this['_setIsMaximized'](_0x1be5d3);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x10bcec['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x3bd3ff,_0x3f0e1a)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x3f0e1a));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x5d3226,_0x1f96ff)=>{this['activeConversation']?.['addUrlToContext'](_0x1f96ff);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x9e06c1,_0x12e2f2)=>{_0x12e2f2['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x4ea420,_0x4e1b23)=>{this['activeConversation']?.['addResourceToContext'](_0x4e1b23['source'],_0x4e1b23['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x55fb1e,_0x4056e8)=>{this['_removeFromContext'](_0x4056e8);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3b64ba,_0x3f4d2a)=>{this['activeConversation']?.['loadSourceResources'](_0x3f4d2a['sourceId'],_0x3f4d2a['query'],_0x3f4d2a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x3724bd,_0x5877b7)=>{this['activeConversation']?.['setModel'](_0x5877b7);}),this['listenTo'](this['_aiChatUi'],'like',(_0xcda76a,{replyId:_0x7a0184})=>{console['log']('Liked\x20response',_0x7a0184);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x2d8d06,{replyId:_0x1dc2e0})=>{console['log']('Disliked\x20response',_0x1dc2e0);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x545eeb,_0x537ddc)=>{this['_insertSuggestion'](_0x537ddc);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0xfce5f4,{replyId:_0x3dfa43,partIndex:_0x166892})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x3dfa43,_0x166892);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x17e6f6,{replyId:_0x35f99f,partIndex:_0x5c9844})=>{const _0x52bef6=this['_getDocumentRangeForReplyChanges'](_0x35f99f,_0x5c9844);_0x52bef6&&'$graveyard'!=_0x52bef6['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x52bef6['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x1b47c1,_0x52affb)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x52affb);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0xe844ea,{replyId:_0x1fcbf8,showDiff:_0x10fa44})=>{const {reply:_0x53c1c0}=this['getInteractionAndReplyById'](_0x1fcbf8),_0x244e15=_0x53c1c0['getContentParts']({'showDiff':_0x10fa44});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x53c1c0['id'],'parts':_0x244e15,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x17a095,{replyId:_0xa0571e,partIndex:_0x8a0e95})=>{this['_rejectSuggestion']({'replyId':_0xa0571e,'partIndex':_0x8a0e95}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x47ac7d,partIndex:_0x2d300f}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x3ebd3e}=this['getInteractionAndReplyById'](_0x47ac7d),_0x4ec921=_0x3ebd3e['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x2d300f});this['_aiChatBalloon']['updateContent']({'part':_0x4ec921[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x2a4512,partIndex:_0x1b5ec9}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x2a4512,'partIndex':_0x1b5ec9}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x499ae0,partIndex:_0x14937e}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x499ae0,'partIndex':_0x14937e}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x9537d4,partIndex:_0x25d7ee}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x9537d4,'partIndex':_0x25d7ee}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0xa80956,partIndex:_0x164de5}=this['_currentPreviewedChangeGroup'],_0x1c1f7f=this['_getPresentableSiblingContentPartIndex'](_0xa80956,_0x164de5,'next');null!==_0x1c1f7f&&this['_openBalloonFor'](_0xa80956,_0x1c1f7f);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x39ac46,partIndex:_0x5b1974}=this['_currentPreviewedChangeGroup'],_0x11e50c=this['_getPresentableSiblingContentPartIndex'](_0x39ac46,_0x5b1974,'previous');null!==_0x11e50c&&this['_openBalloonFor'](_0x39ac46,_0x11e50c);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x450fe1,{id:_0x5e8e8d})=>{if('aiChatBalloon'!==_0x5e8e8d)return;const {replyId:_0x31f420,partIndex:_0x3561da}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x31f420,'index':_0x3561da,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x533b44,_0x17b38f)=>{_0x17b38f['on']('ready',()=>{this['_integrateEditor'](_0x17b38f);});});const _0x3e5736=this['context']['config']['get']('ai.chat.initialConversation');let _0x5c333a=_0x3e5736;if('lastCreated'!=_0x3e5736||(_0x5c333a=await this['_getLastCreatedConversationId'](),_0x5c333a))return'new'==_0x5c333a?this['_startConversationSafely']():this['loadConversation'](_0x5c333a);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0xf2b36c){const _0x1199ba=T(this['context']);if(!_0x1199ba['plugins']['has']('TrackChanges'))throw new _0x36ca17('ai-no-track-changes',null);const _0x3218c9=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x35109f,interaction:_0x5d8217}=this['getInteractionAndReplyById'](_0xf2b36c['replyId']),_0x403f79=this['_getDocumentRangeForReplyChanges'](_0xf2b36c['replyId'],_0xf2b36c['partIndex']),_0xb8243e=void 0x0!==_0xf2b36c['partIndex']?[_0x35109f['changeGroups'][_0xf2b36c['partIndex']]]:_0x35109f['changeGroups']['filter'](_0x31e6e1=>'pending'==_0x31e6e1['state']),_0x191c10=_0xb8243e['map'](_0x50d89e=>_0x35109f['changeGroups']['indexOf'](_0x50d89e));if(!_0x403f79||'$graveyard'==_0x403f79['range']['root']['rootName'])return void _0x191c10['forEach'](_0x57c818=>_0x35109f['setChangeGroupState'](_0x57c818,'outdated'));_0x191c10['forEach'](_0x4b932a=>_0x35109f['setChangeGroupState'](_0x4b932a,'accepted'));const _0x643d02=Z({'editor':_0x1199ba,'reply':_0x35109f,'interaction':_0x5d8217,'groups':_0xb8243e,'transform':!0x0,'documentCompare':_0x3218c9,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x13c311;_0x403f79&&this['_scrollToSuggestionRange'](_0x403f79['range']),_0x1199ba['model']['change'](_0x56ab84=>{_0x13c311=_0x56ab84['batch'],_0x1199ba['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x643d02),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x13c311,{'interactionId':_0x5d8217['id'],'replyId':_0x35109f['id'],'indexes':_0x191c10['slice']()}),this['_updateRatings'](_0x35109f);}['_applySuggestion'](_0x8e079c){const _0x2b8f3f=T(this['context']),_0x2770d9=this['context']['plugins']['get'](_0x29a341),{reply:_0x294e37,interaction:_0x3aac17}=this['getInteractionAndReplyById'](_0x8e079c['replyId']),_0x1dc286=this['_getDocumentRangeForReplyChanges'](_0x8e079c['replyId'],_0x8e079c['partIndex']),_0x219c4f=void 0x0!==_0x8e079c['partIndex']?[_0x294e37['changeGroups'][_0x8e079c['partIndex']]]:_0x294e37['changeGroups']['filter'](_0x6d5ac=>'pending'==_0x6d5ac['state']),_0x2c5d1d=_0x219c4f['map'](_0x190f1e=>_0x294e37['changeGroups']['indexOf'](_0x190f1e));if(!_0x1dc286||'$graveyard'==_0x1dc286['range']['root']['rootName'])return void _0x2c5d1d['forEach'](_0x247baf=>_0x294e37['setChangeGroupState'](_0x247baf,'outdated'));_0x2c5d1d['forEach'](_0x40a4e6=>_0x294e37['setChangeGroupState'](_0x40a4e6,'accepted'));const _0x282b96=Z({'editor':_0x2b8f3f,'reply':_0x294e37,'interaction':_0x3aac17,'groups':_0x219c4f,'transform':!0x0,'documentCompare':_0x2770d9,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x281514;_0x1dc286&&this['_scrollToSuggestionRange'](_0x1dc286['range']),_0x2b8f3f['model']['change'](_0x3c8a06=>{_0x281514=_0x3c8a06['batch'];for(const _0x824aad of _0x282b96)_0x824aad['baseVersion']=_0x2b8f3f['model']['document']['version'],Y(_0x2b8f3f,_0x824aad),_0x3c8a06['batch']['addOperation'](_0x824aad),_0x2b8f3f['model']['applyOperation'](_0x824aad);}),this['_batchToChanges']['set'](_0x281514,{'interactionId':_0x3aac17['id'],'replyId':_0x294e37['id'],'indexes':_0x2c5d1d['slice']()}),this['_updateRatings'](_0x294e37);}['_rejectSuggestion'](_0x4da023){const {reply:_0x4e680e}=this['getInteractionAndReplyById'](_0x4da023['replyId']);_0x4e680e['setChangeGroupState'](_0x4da023['partIndex'],'rejected');}['_openBalloonFor'](_0x11a917,_0x4bf772){if(!this['_aiChatBalloon'])return;const {reply:_0x2c47c9}=this['getInteractionAndReplyById'](_0x11a917),_0x543bce=_0x2c47c9['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x2480e3,_0x5d849f;if(void 0x0!==_0x4bf772?(_0x5d849f=_0x543bce['find'](_0x29a76f=>_0x29a76f['index']==_0x4bf772),_0x2480e3=_0x5d849f?.['index']):(_0x5d849f=_0x543bce[0x0],_0x2480e3=_0x5d849f['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x11a917&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x2480e3)return;const _0x55fd31=this['_getUserPresentableContentPartDocumentRange'](_0x11a917,_0x2c47c9,_0x5d849f);if(!_0x55fd31)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x11a917,'partIndex':_0x2480e3},this['_scrollToSuggestionRange'](_0x55fd31,!0x0);const _0xce3b48=this['_getPresentableSiblingContentPartIndex'](_0x11a917,_0x2480e3,'next');this['_aiChatBalloon']['updateContent']({'part':_0x5d849f,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x2480e3,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x2480e3+0x1)['toString']()),'showRotator':null!==_0xce3b48,'ranges':[_0x55fd31],'areActionsDisabled':_0x2c47c9['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x11a917,_0x2480e3),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x11a917,'index':_0x2480e3,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0xc3ab01,_0x3ec500,_0x5b1707){const {reply:_0x3bb355}=this['getInteractionAndReplyById'](_0xc3ab01),_0x38ca53=_0x3bb355['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x38ca53['length'])return null;const _0x104706=_0x38ca53['findIndex'](_0x495347=>_0x495347['index']==_0x3ec500),_0x27dc3d='next'==_0x5b1707?0x1:-0x1;let _0x6c9ea4=_0x38ca53['at']((_0x104706+_0x27dc3d)%_0x38ca53['length'])['index'],_0x3375d4=_0x38ca53[_0x6c9ea4];for(;!this['_getUserPresentableContentPartDocumentRange'](_0xc3ab01,_0x3bb355,_0x3375d4);){if(_0x6c9ea4=_0x38ca53['at']((_0x6c9ea4+_0x27dc3d)%_0x38ca53['length'])['index'],_0x6c9ea4===_0x104706)return null;_0x3375d4=_0x38ca53[_0x6c9ea4];}return _0x6c9ea4;}['_getUserPresentableContentPartDocumentRange'](_0x3696c3,_0x521132,_0x16e96c){const _0x1cc197=_0x521132['changeGroups'];if(!_0x16e96c['hasChanges'])return null;const _0xb8acb1=_0x1cc197['find'](_0x253263=>_0x253263['index']==_0x16e96c['index']);if('pending'!==_0xb8acb1?.['state'])return null;const _0x3c0f79=this['_getDocumentRangeForReplyChanges'](_0x3696c3,_0x16e96c['index']);if(!_0x3c0f79)return null;const {range:_0x4c2cbd,currentIndex:_0x463040}=_0x3c0f79;return'$graveyard'==_0x4c2cbd['root']['rootName']?(_0x521132['setChangeGroupState'](_0x463040,'outdated'),null):_0x3c0f79['range'];}['_getDocumentRangeForReplyChanges'](_0x46656e,_0x166ed4){const _0x58b7d3=T(this['context']),{reply:_0x272f2c,interaction:_0x496b21}=this['getInteractionAndReplyById'](_0x46656e),_0x1a8c0e=_0x272f2c['changeGroups']['filter'](_0x113c48=>'pending'==_0x113c48['state']),_0x2b2e81=_0x1a8c0e['map'](_0x27822b=>_0x272f2c['changeGroups']['indexOf'](_0x27822b));void 0x0===_0x166ed4&&(_0x166ed4=_0x2b2e81[0x0]);const _0x1e2b38=_0x2b2e81['indexOf'](_0x166ed4);if(-0x1==_0x1e2b38)return null;const _0x21911d=_0x1a8c0e[_0x1e2b38],_0x237ed8=new Et([]),_0x51d804=new Et([]);for(const _0x2ea569 of _0x21911d['changes'])if('removed'!=_0x2ea569['type']&&_0x51d804['children']['push'](_0x2ea569['node']['cloneNode'](!0x0)),'new'!=_0x2ea569['type']){const _0x3a99a1=yt(_0x327f8c=>At(_0x327f8c,'data-id')==_0x2ea569['id'],_0x272f2c['documentContextContent'],!0x0);_0x237ed8['children']['push'](_0x3a99a1['cloneNode'](!0x0));}if(0x0==_0x237ed8['children']['length']){if(_0x21911d['changes'][0x0]['anchorId']){const _0x2376ae=St('data-id',_0x21911d['changes'][0x0]['anchorId'],_0x272f2c['documentContextContent']);_0x237ed8['children']['unshift'](_0x2376ae['cloneNode'](!0x0)),_0x51d804['children']['unshift'](_0x2376ae['cloneNode'](!0x0)),_0x2376ae['nextSibling']&&(_0x237ed8['children']['push'](_0x2376ae['nextSibling']['cloneNode'](!0x0)),_0x51d804['children']['push'](_0x2376ae['nextSibling']['cloneNode'](!0x0)));}else{const _0x20aff4=_0x272f2c['documentContextContent']['children'][0x0];if(!_0x20aff4)return null;_0x237ed8['children']['push'](_0x20aff4['cloneNode'](!0x0)),_0x51d804['children']['push'](_0x20aff4['cloneNode'](!0x0));}}const _0x19a48e=_0x496b21['getDocumentContext'](),_0x884293=_0x58b7d3['data']['parse'](_0x19a48e['content']),_0x31eead=Tt(_0x237ed8),_0x583c0=_0x58b7d3['data']['parse'](_0x31eead),_0xb0efec=_0x58b7d3['data']['parse'](_0x31eead),_0x4747da=_0x58b7d3['model']['createPositionAt'](_0x583c0,0x0),_0x594714=Tt(_0x51d804),_0x5d4822={'anchor':_0x4747da,'markDeletions':!0x1},_0x346012=_0x58b7d3['plugins']['get'](_0x29a341)['getDiff'](_0x31eead,_0x594714,_0x5d4822)['getOperations']();if(!_0x346012['length'])return null;_0x58b7d3['model']['change'](_0x9bf80d=>{for(const _0x733346 of _0x346012)if('remove'==_0x733346['type']){const _0x47ff1d=_0x733346['sourcePosition'],_0x5930d1=_0x733346['howMany'],_0x155331=new et(_0x47ff1d,_0x5930d1);_0x9bf80d['batch']['addOperation'](_0x155331),_0x58b7d3['model']['applyOperation'](_0x155331);}else'marker'!==_0x733346['type']&&(_0x733346['baseVersion']=null,_0x733346['isDocumentOperation']=!0x1,_0x9bf80d['batch']['addOperation'](_0x733346),_0x58b7d3['model']['applyOperation'](_0x733346));});const _0x3d22a3=mt(_0x58b7d3,_0x346012,_0x583c0);ft(_0x58b7d3['model'],_0x3d22a3);const _0x1f4bd4=_0x3d22a3['getFirstRange']()['start']['path']['slice'](),_0x12b331=_0x3d22a3['getFirstRange']()['end']['path']['slice'](),_0x1f7ef0=[];let _0x4bdd8c=_0x583c0,_0x510620=_0xb0efec;for(let _0x2815e3=0x0;_0x2815e3<_0x12b331['length'];_0x2815e3++){const _0x322809=_0x4bdd8c['maxOffset']-_0x12b331[_0x2815e3];_0x1f7ef0[_0x2815e3]=_0x510620['maxOffset']-_0x322809,_0x4bdd8c=_0x4bdd8c['getChildAtOffset'](_0x12b331[_0x2815e3]),_0x510620=_0x510620['getChildAtOffset'](_0x1f7ef0[_0x2815e3]);}const _0x3666d6=_0x58b7d3['model']['createRange'](_0x58b7d3['model']['createPositionFromPath'](_0xb0efec,_0x1f4bd4),_0x58b7d3['model']['createPositionFromPath'](_0xb0efec,_0x1f7ef0)),_0x44d0e1=_0xb0efec['getChild'](0x0)['getAttribute'](Ct),_0x4eda1c=Array['from'](_0x884293['getChildren']())['find'](_0x2c703a=>_0x2c703a['getAttribute'](Ct)==_0x44d0e1)['getPath'](),_0x49ad61=_0x3666d6['start']['path']['slice'](),_0x509da3=_0x3666d6['end']['path']['slice']();_0x49ad61[0x0]=_0x4eda1c[0x0]+_0x49ad61[0x0],_0x509da3[0x0]=_0x4eda1c[0x0]+_0x509da3[0x0];let _0x51dd9f=_0x58b7d3['model']['createRange'](_0x58b7d3['model']['createPositionFromPath'](_0x58b7d3['model']['document']['getRoot'](),_0x49ad61),_0x58b7d3['model']['createPositionFromPath'](_0x58b7d3['model']['document']['getRoot'](),_0x509da3));const _0xec044=_0x58b7d3['model']['document']['history']['getOperations'](_0x19a48e['version']);for(const _0x1aa1d9 of _0xec044)_0x51dd9f=it['_createFromRanges'](_0x51dd9f['getTransformedByOperation'](_0x1aa1d9));return{'range':_0x51dd9f,'currentIndex':_0x166ed4};}['_integrateEditor'](_0x928059){if(!_0x928059['plugins']['has']('Undo'))return;const _0x1a3afc=_0x928059['commands']['get']('undo'),_0x1953bb=_0x928059['commands']['get']('redo');this['listenTo'](_0x1a3afc,'revert',(_0x242ceb,_0x557d1c,_0x242340)=>{const _0x5764dc=this['_batchToChanges']['get'](_0x557d1c);if(!_0x5764dc)return;const _0x12db40=this['activeConversation']['getInteraction'](_0x5764dc['interactionId'])['getReply'](_0x5764dc['replyId']);_0x5764dc['indexes']['forEach'](_0x16d585=>_0x12db40['setChangeGroupState'](_0x16d585,'pending')),this['_batchToChanges']['delete'](_0x557d1c),this['_batchToChanges']['set'](_0x242340,_0x5764dc);}),this['listenTo'](_0x1953bb,'revert',(_0x1a8d0a,_0x40f7c8,_0x149a4c)=>{const _0x5738d9=this['_batchToChanges']['get'](_0x40f7c8);if(!_0x5738d9)return;const _0x408a14=this['activeConversation']['getInteraction'](_0x5738d9['interactionId'])['getReply'](_0x5738d9['replyId']);_0x5738d9['indexes']['forEach'](_0x2220a7=>_0x408a14['setChangeGroupState'](_0x2220a7,'accepted')),this['_batchToChanges']['delete'](_0x40f7c8),this['_batchToChanges']['set'](_0x149a4c,_0x5738d9);});}async['loadConversation'](_0x38016f){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](pt)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x38016f)['getConversation'](),await this['_startConversationSafely'](_0x38016f),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x38016f,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x2a908b){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x38016f}),this['_logError'](new _0x36ca17('ai-chat-conversation-not-found',this,{'error':_0x2a908b}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x440275=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x1cf416=await _0x440275['getConversations']();return _0x1cf416['length']?_0x1cf416[0x0]['id']:'new';}catch(_0x2aae14){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x926b30()}),this['_logError'](new _0x36ca17('ai-chat-conversation-init-failed',this,{'error':_0x2aae14})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x252c4e){this['activeConversation']['id']===_0x252c4e&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x3a35ce=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x3a35ce),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x33b22d,attributes:_0x1fed0a}){await this['_handleUIUserMessage']({'userMessage':_0x33b22d,'attributes':_0x1fed0a});}['getGroupId'](){const _0x108844=this['context']['config']['get']('collaboration.channelId');if(!_0x108844)throw new _0x36ca17('ai-chat-missing-channel-id',this);return _0x108844;}async['_startConversationSafely'](_0x191e51){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x191e51);}catch(_0x4d6f31){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x191e51||_0x926b30()}),console['error'](_0x4d6f31),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x16165e){let _0x5ad1cc;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x16165e||!this['activeConversation']?_0x5ad1cc=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x5ad1cc=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x25bda0=this['getGroupId'](),_0x338a82=_0x16165e||_0x926b30();this['activeConversation']=new _t({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x5ad1cc,'conversationId':_0x338a82,'group':_0x25bda0,'getEditor':()=>T(this['context']),'isFromHistory':!!_0x16165e}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x40a6e4,_0x11c44f)=>{this['_aiChatUi']['createConversation'](_0x11c44f),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x16165e||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x2e252e,_0x22f063)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x22f063['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x3e57be,_0x257526)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x257526);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x20bbc7=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x20bbc7);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x433e3c=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x433e3c);}),this['activeConversation']['on']('webSearchFinished',(_0x51948a,_0x185be3)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x185be3,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x362410,_0x28d308)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x28d308,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x5d8c30,_0x14762f)=>{this['_aiChatUi']['removeFeedInteraction'](_0x14762f['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x4b3deb,_0xe99e89,_0x1a8f80)=>{this['updateConversationTitle'](_0xe99e89,_0x1a8f80);}),this['activeConversation']['on']('replyCreated',(_0x5b9ef6,_0x2b9287)=>{'text'===_0x2b9287['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2b9287):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2b9287);}),this['activeConversation']['on']('replyContentUpdated',async(_0x6810b9,_0x52652d)=>{await this['_updateReplyContent']({'reply':_0x52652d});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x5864b5,{reply:_0x4194c0,index:_0xb0a8e9,state:_0xf4bb0b})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x4194c0['id'],'index':_0xb0a8e9,'state':_0xf4bb0b}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x4194c0['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xb0a8e9&&this['_aiChatBalloon']?.['setState'](_0xf4bb0b);}),this['activeConversation']['on']('contextItemAdded',(_0x22d0a4,_0x5ab37e)=>{if(this['_aiChatUi']['addContextItem'](_0x5ab37e['contextItem'],_0x5ab37e['isLoading']),'selection'===_0x5ab37e['contextItem']['type']){const _0x1665f8=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x1665f8,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x502f78,_0x26dfa4)=>{this['_aiChatUi']['removeContextItem'](_0x26dfa4['uiId']),'current-document'==_0x26dfa4['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x26dfa4['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x14c9b6,_0x175bc3)=>{this['_aiChatUi']['setContextItemLoading'](_0x175bc3['contextItem']['uiId'],_0x175bc3['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x3b5b00,_0x10e159)=>{this['_aiChatUi']['setConversationContext'](_0x10e159['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0xc5ff38,_0x811115)=>{this['_aiChatUi']['setAddContextOptions'](_0x811115['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x52ea3a,_0x237365)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x237365['sourceId'],_0x237365['source'],_0x237365['resources'],_0x237365['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x5059ee,_0x314735)=>{this['_aiChatUi']['updateResourceState'](_0x314735['sourceId'],_0x314735['resourceId'],_0x314735['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x5d471d,_0x8aa166)=>{this['_aiChatUi']['updateCapabilities'](_0x8aa166);}),this['activeConversation']['on']('modelSelected',async(_0x41d200,_0x59e4e2)=>{const _0x3657e9=(await this['_aiChatModels']['getAll']())['find'](_0xc13fc9=>_0xc13fc9['id']===_0x59e4e2['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x3657e9,_0x59e4e2['isDisabled']);}),this['activeConversation']['on']('error',(_0x34fa0a,{error:_0x1c3861,interactionId:_0x34e650,fileName:_0x51b399,url:_0x50c3db,sourceId:_0x922e6a,sourceLabel:_0x5f5b79})=>{const _0x483adb=_0x34e650?_0x34e650+':'+_0x926b30():_0x926b30();_0x1c3861['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x483adb}):_0x1c3861['message']['startsWith']('ai-chat-conversation-init-failed')||_0x1c3861['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x51b399),'id':_0x483adb}):_0x1c3861['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x50c3db),'id':_0x483adb}):_0x1c3861['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x483adb}):_0x1c3861['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x483adb}):_0x1c3861['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x922e6a&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x922e6a),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x5f5b79||'source'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x483adb}),this['_logError'](_0x1c3861)):_0x1c3861['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x483adb}),this['_logError'](_0x1c3861)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x483adb}),this['_logError'](_0x1c3861));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x16165e||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x4a2a0a,attributes:_0x5858d7}){if(!this['activeConversation'])throw new _0x36ca17('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x5b78ac=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x5b78ac);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x4a2a0a,'attributes':_0x5858d7});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x11e63f){this['_aiChatUi']['setIsMaximized'](_0x11e63f);}['_logError'](_0x1aa080){gt(_0x1aa080['message']);}['_removeFromContext'](_0x3ce25d){this['activeConversation']?.['removeFromContext'](_0x3ce25d);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x1268fb){const [_0x510002,_0x5898ac]=_0x1268fb['split'](':'),_0x334585=this['activeConversation']['getInteraction'](_0x510002),_0x10e3a4=_0x334585['getReply'](_0x5898ac);return{'interaction':_0x334585,'reply':_0x10e3a4};}['_scrollToSuggestionRange'](_0x5ad878,_0x3c3902=!0x1){const _0x45cbe4=T(this['context']),_0x24af91={'target':_0x45cbe4['editing']['view']['domConverter']['viewRangeToDom'](_0x45cbe4['editing']['mapper']['toViewRange'](_0x5ad878)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x3c3902};_0x3c3902&&(_0x24af91['alignToTop']=!0x0),_0x538b49(_0x24af91);}['updateConversationTitle'](_0x32823a,_0x15d780=!0x1){this['_aiChatUi']['setConversationTitle'](_0x32823a||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x15d780);}async['_updateReplyContent']({reply:_0x4a147f,renderingStrategy:_0x338a32}){const {id:_0x107070,interactionId:_0x37f31e,isDone:_0x72bdf1,type:_0x50f9ae,parsedContent:_0x36bf23}=_0x4a147f,_0x242785=_0x37f31e+':'+_0x107070;if('modification'===_0x50f9ae){const _0x290595=_0x4a147f['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x242785,'parts':_0x290595,'renderingStrategy':_0x338a32,'isDone':_0x72bdf1});}else'text'===_0x50f9ae&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x242785,'parsedContent':_0x36bf23,'renderingStrategy':_0x338a32,'isDone':_0x72bdf1});_0x72bdf1&&_0x4a147f['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x242785,_0x4a147f['sources']);}async['_stopLastInteraction'](){const _0x474d46=this['activeConversation']?.['lastInteraction'];_0x474d46&&(_0x474d46['stop'](),this['_aiChatUi']['stopInteraction'](_0x474d46));}async['_flushLastInteractionUI'](){const _0x1e72dd=this['activeConversation']?.['lastInteraction'];if(_0x1e72dd){for await(const _0x1d546e of _0x1e72dd['replies'])await this['_updateReplyContent']({'reply':_0x1d546e,'renderingStrategy':'static'});}}['_updateRatings'](_0x557980){const _0x5888ad={'positiveCount':_0x557980['changeGroups']['filter'](_0x55ba72=>'accepted'===_0x55ba72['state'])['length'],'totalCount':_0x557980['changeGroups']['length'],'modificationId':_0x557980['id']},_0x130968=this['activeConversation']['getInteraction'](_0x557980['interactionId'])['messageId'];_0x130968&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x130968,_0x5888ad);}['_registerToolDataCallback'](_0x1b0e50){let _0x351cbd=null,_0x12b8ef=null;this['on']('toolDataReceived',(_0x103644,_0x5b6564,_0x2e99c0)=>{_0x2e99c0['id']!==_0x351cbd&&(_0x351cbd=_0x2e99c0['id'],_0x12b8ef=this['_getAIChatInteractionAPI'](_0x2e99c0)),_0x1b0e50(_0x5b6564,_0x12b8ef);});}['_getAIChatInteractionAPI'](_0x19e236){const _0x390721=this['_aiChatUi'],_0x33c600=()=>{_0x19e236['resetWebSearchState'](),_0x19e236['resetReasoningState'](),_0x390721['clearLoadingMessage']();},_0x44bb77=()=>{_0x19e236['currentReply']&&(_0x19e236['currentReply']['done'](),_0x19e236['currentReply']=void 0x0);};return{'insertTextReply':(_0x23e817,_0x430029)=>{_0x44bb77(),_0x33c600();const _0x227220=_0x19e236['currentReply']=_0x19e236['createReply']({'type':'text','interactionId':_0x19e236['id'],'content':_0x23e817,'id':_0x430029||_0x926b30()});return _0x44bb77(),_0x227220;},'insertCustomElement':async(_0x588042,_0x2cb3a1)=>(_0x44bb77(),_0x33c600(),_0x390721['addFeedItemCustomElement'](_0x588042,_0x2cb3a1||_0x926b30())),'setLoadingMessage':_0x1990cc=>{_0x390721['setLoadingMessage'](_0x1990cc);},'clearLoadingMessage':()=>{_0x390721['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x575928{constructor(_0x4deb01){super(_0x4deb01),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_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 _0x2d85ed=T(this['context']),_0x4e1afe=_0x2d85ed['plugins']['has']('RealTimeCollaborationClient')&&_0x2d85ed['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x4e1afe||_0x926b30();}return this['_sessionId'];}async['getDocumentData'](){const _0x25e67b=T(this['context']),_0x205432=_0x25e67b['model'],_0x1d01b2=_0x25e67b['data']['toView'](_0x205432['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x2e38ef=new Dt(_0x25e67b['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x1d01b2,_0x2e38ef);let _0x319d59=await this['_getDocumentDataStringFromView'](_0x1d01b2);const _0x2a292f=this['_getMarkersInDocumentOrder'](),_0x5ac379=[];for(const _0x10ae70 of _0x2a292f){const _0x54dfbc='<'+_0x10ae70['name']+':start></'+_0x10ae70['name']+':start>',_0x571f18=_0x319d59['indexOf'](_0x54dfbc);_0x319d59=_0x319d59['substring'](0x0,_0x571f18)+_0x319d59['substring'](_0x571f18+_0x54dfbc['length']);const _0x12c556='<'+_0x10ae70['name']+':end></'+_0x10ae70['name']+':end>',_0x532cb0=_0x319d59['indexOf'](_0x12c556);_0x319d59=_0x319d59['substring'](0x0,_0x532cb0)+_0x319d59['substring'](_0x532cb0+_0x12c556['length']),_0x5ac379['push']({'markerName':_0x10ae70['name'],'start':_0x571f18,'end':_0x532cb0,'htmlFragment':_0x319d59['substring'](_0x571f18,_0x532cb0)});}return{'content':_0x319d59,'version':_0x25e67b['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x5ac379};}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4b529a,_0x34a63e)=>{_0x34a63e['on']('ready',()=>{this['_integrateEditor'](_0x34a63e);});});}['_setOutputDataProcessor'](_0x4fdf9d){this['_outputDataProcessor']=_0x4fdf9d;}async['_getDocumentDataStringFromView'](_0x48dee2){let _0x5cbf42;const _0x2ebcc1=T(this['context']);if(this['_outputDataProcessor']){const _0x30da49=_0x2ebcc1['data']['processor']['domConverter']['viewToDom'](_0x48dee2),_0x124d17=await this['_outputDataProcessor'](_0x30da49);_0x5cbf42=_0x2ebcc1['data']['processor']['htmlWriter']['getHtml'](_0x124d17);}else _0x5cbf42=_0x2ebcc1['data']['processor']['toData'](_0x48dee2);return _0x5cbf42;}['_integrateEditor'](_0x45ded9){_0x45ded9['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x45ded9['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x106ce1,{writer:_0x357fbb,options:_0x36860c})=>_0x36860c['convertAiChatSelectionMarker']?_0x357fbb['createUIElement'](_0x106ce1['markerName']+':'+(_0x106ce1['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x3688ff,_0xc9b788,_0x88cc57=!0x1,_0xb864bb=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0xb864bb)return!0x1;const _0xb0e1f8=T(this['context'])['model'];return _0xb0e1f8['change'](_0x20745d=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0xc9b788,this['_displayedFakeSelectionLocked']=_0x88cc57;let _0x50ed7d=0x0;for(let _0x504520 of _0x3688ff){const _0x33e6f9=R+':'+_0x50ed7d;if(_0x504520['start']['isAtEnd']){const _0x376ffb=_0x504520['start']['getLastMatchingPosition'](({item:_0x3ed9d7})=>!_0xb0e1f8['schema']['isContent'](_0x3ed9d7),{'boundaries':_0x504520});_0x504520=_0x20745d['createRange'](_0x376ffb,_0x504520['end']);}_0x20745d['addMarker'](_0x33e6f9,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x504520}),_0x50ed7d++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x43e6ac){if(this['_displayedFakeSelectionId']!=_0x43e6ac)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x49a100=T(this['context']),_0x476c48=_0x49a100['model']['markers']['getMarkersGroup'](R);return _0x49a100['model']['change'](_0x143024=>{for(const _0x440cd3 of _0x476c48)_0x143024['removeMarker'](_0x440cd3);}),!0x0;}async['modelToDataWithIds'](_0x8b04de){const _0x5e2717=T(this['context']),_0x488a70=_0x5e2717['data']['toView'](_0x8b04de),_0xb4c573=new Dt(_0x5e2717['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x488a70,_0xb4c573),this['_getDocumentDataStringFromView'](_0x488a70);}['_setDataIdsOnChildren'](_0x557ddb,_0x2d88cf){let _0x376431=!0x1;const _0x2e02f6=new Set();for(const _0x1fa40f of _0x557ddb['getChildren']()){const _0x2e5dc5=_0x1fa40f['is']('emptyElement')||_0x1fa40f['is']('containerElement');if(!_0x1fa40f['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x1fa40f,_0x2d88cf)||_0x2e5dc5)&&(_0x2d88cf['setAttribute']('data-id',this['_nextDataId'](_0x2e02f6),_0x1fa40f),_0x376431=!0x0);}return _0x376431;}['_nextDataId'](_0x49f994){let _0x223e54;do{_0x223e54='';for(let _0x472bfd=0x0;_0x472bfd<0x4;_0x472bfd++)_0x223e54+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x49f994['has'](_0x223e54));return _0x49f994['add'](_0x223e54),_0x223e54;}['getSelectionText'](){const {model:_0x328653}=T(this['context']),_0x531e33=_0x328653['document']['selection'],_0x3f5b7b=[];for(const _0x509095 of _0x531e33['getRanges']())for(const _0x5105e0 of _0x509095['getItems']())_0x5105e0['is']('$textProxy')?_0x3f5b7b['push'](_0x5105e0['data']):_0x5105e0['is']('element')&&_0x3f5b7b['length']>0x0&&'\x20'!==_0x3f5b7b[_0x3f5b7b['length']-0x1]&&_0x3f5b7b['push']('\x20');return _0x3f5b7b['length']?'\x22'+_0x3f5b7b['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x3e14b0=T(this['context'])['model'];return Array['from'](_0x3e14b0['markers']['getMarkersGroup'](R))['sort']((_0x37faae,_0x1635f8)=>_0x37faae['getStart']()['isBefore'](_0x1635f8['getStart']())?-0x1:_0x37faae['getStart']()['isAfter'](_0x1635f8['getStart']())?0x1:0x0);}}const ut=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],bt=[...ut,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x55cbc3){this['options']={'delay':_0x55cbc3['delay']??0x14,'textNodeStyle':_0x55cbc3['textNodeStyle'],'onStreamUpdate':_0x55cbc3['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x3031cf,targetElement:_0x573e56,abortSignal:_0x56f2d6}){this['isStreaming']&&this['stop'](),_0x56f2d6?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x54590c(_0x3031cf,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x53ed64=0x0;_0x53ed64<this['currentIndex'];_0x53ed64++)this['nodesList'][_0x53ed64]['shouldBeStreamed']=!0x0;do{const _0x1e4cbd=Date['now'](),_0x5530cd=this['nodesList'][this['currentIndex']],_0x44a923=_0x1e4cbd-this['lastUpdateTime'];if(_0x5530cd){_0x5530cd['shouldBeStreamed']=!0x0;let _0x3e33f6=_0x5530cd['parent'];for(;_0x3e33f6;)_0x3e33f6['shouldBeStreamed']=!0x0,_0x3e33f6=_0x3e33f6['parent'];}if(_0x44a923<this['options']['delay'])try{const {promise:_0x54c13d,abortController:_0x158370}=Ds(this['options']['delay']-_0x44a923);this['timeoutAbortController']=_0x158370,await _0x54c13d;}catch(_0x4dcaf9){return;}_0x13f10f(_0x573e56,'<'+_0x573e56['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x573e56['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x1a7bc4}){Array['from'](_0x1a7bc4['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x3ae795=>{_0x3ae795['replaceWith'](_0x3ae795['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x273665){let _0x1e1354='';if(function(_0x56ec44){return _0x22ff9c(_0x56ec44);}(_0x273665)){for(const _0x5d304f of _0x273665['children'])_0x1e1354+=this['renderNode'](_0x5d304f);}else{if(Ts(_0x273665)){if(!_0x273665['shouldBeStreamed'])return'';const _0x55ddcc=_0x273665,_0x563657=Object['entries'](_0x55ddcc['attribs'])['map'](([_0x34f3a8,_0x54805e])=>_0x34f3a8+'=\x22'+_0x54805e+'\x22')['join']('\x20');_0x1e1354+='<'+_0x55ddcc['tagName']+(_0x563657?'\x20'+_0x563657:'')+'>';for(const _0x2f0c20 of _0x3d953b(_0x55ddcc))_0x1e1354+=this['renderNode'](_0x2f0c20);_0x1e1354+='</'+_0x55ddcc['tagName']+'>';}else{if(!Ss(_0x273665))return'';if(!_0x273665['shouldBeStreamed'])return'';!function(_0xb985a3){if(!_0xb985a3['parent']||!Ts(_0xb985a3['parent']))return!0x1;if(!ys['includes'](_0xb985a3['parent']['tagName']))return!0x1;return!_0x1aed79(_0xb985a3)['match'](/^\s*[<>]\s*$/);}(_0x273665)?_0x1e1354+=_0x3807c6(_0x273665):_0x1e1354+=_0x3807c6(new _0x10ebb7('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x273665]));}}return _0x1e1354;}['getParsedDocumentNodeList'](){const _0x140176=[];return function(_0x5b2a5f,_0x5c719e){const _0x2d4931=_0x28f411=>{if(_0x5c719e(_0x28f411),_0x28f411 instanceof _0x5f1e12)for(let _0x8d28b0=0x0;_0x8d28b0<_0x28f411['children']['length'];_0x8d28b0++){const _0x63460c=_0x28f411['children'][_0x8d28b0];_0x2d4931(_0x63460c);}};for(let _0x415431=0x0;_0x415431<_0x5b2a5f['children']['length'];_0x415431++)_0x2d4931(_0x5b2a5f['children'][_0x415431]);}(this['document'],_0x407a2d=>{if(Ss(_0x407a2d)){const _0x23389f=this['splitTextNodeIntoWordNodes'](_0x407a2d);_0x23389f['length']&&_0x140176['push'](..._0x23389f);}_0x407a2d['isWordSplitSource']||_0x407a2d['isWordSplitResult']||_0x140176['push'](_0x407a2d);}),_0x140176;}['splitTextNodeIntoWordNodes'](_0x25465c){if(_0x25465c['isWordSplitSource']||_0x25465c['isWordSplitResult'])return[];const _0x14683a=_0x1aed79(_0x25465c)['match'](/(?:\s*\S+\s*)/g),_0x3a2b28=[];if(_0x14683a&&_0x14683a['length']>0x1){for(const _0x569e2f of _0x14683a){const _0x3de673=new _0x280441(_0x569e2f);_0x3de673['isWordSplitResult']=!0x0,_0x2b8438(_0x25465c,_0x3de673),_0x3a2b28['push'](_0x3de673);}_0x25465c['isWordSplitSource']=!0x0,_0x4c1d4c(_0x25465c);}return _0x3a2b28;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ss(_0x723dc6){return _0x30a61f(_0x723dc6);}function Ts(_0x19aacf){return _0x5d51b2(_0x19aacf);}function Ds(_0x1f5d51){const _0x357fb3=new AbortController();return{'promise':new Promise((_0x2e3787,_0x133cd3)=>{const _0x4e9d84=setTimeout(_0x2e3787,_0x1f5d51);_0x357fb3['signal']['addEventListener']('abort',()=>{clearTimeout(_0x4e9d84),_0x133cd3();});}),'abortController':_0x357fb3};}class Fr extends _0x184e76{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x311fd7){super();const _0x2f377c=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']=_0x311fd7,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2f377c['if']('isDone','ck-ai-chat__feed__item_done'),_0x2f377c['if']('isVisible','ck-hidden',_0x5e48ec=>!_0x5e48ec),'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'](_0x40efe7=>{_0x40efe7['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x223708,_0x40bf9f,_0x3a3a1f){await this['htmlStreamer']['stream']({'document':_0x223708,'targetElement':_0x40bf9f,'abortSignal':_0x3a3a1f});}}class oa extends _0x184e76{['showChangesToggleView'];constructor(_0x39ba7f,_0x2f88a7){super(_0x39ba7f),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Zn(_0x39ba7f),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x39ba7f,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x2f88a7['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x27198f=>_0x27198f?_0x45a410:_0x4ecb10),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x3a295b=new _0xc034b();_0x3a295b['content']=_0x822d49,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x2f88a7['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x3a295b,{'tag':'span','children':[i(_0x39ba7f,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Zn extends _0x1e9460{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Or={'accepted':_0x546f60,'rejected':_0x815ee6,'outdated':_0x815ee6};class ws extends _0x184e76{['stateIconView'];constructor(_0xa65a5b){super(_0xa65a5b);const _0x24878a=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Nr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x24878a['to']('state',_0x25b9ee=>'ck-ai-suggestion__content-part-state_'+_0x25b9ee),_0x24878a['if']('isVisible','ck-hidden',_0x58c6f1=>!_0x58c6f1)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x24878a['to']('state',_0x447d7a=>{switch(_0x447d7a){case'accepted':return i(_0xa65a5b,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0xa65a5b,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0xa65a5b,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x5d0d86){this['state']=_0x5d0d86;}}class Nr extends _0xc034b{constructor(){super(),this['set']('state','accepted'),this['content']=Or[this['state']],this['on']('change:state',()=>{this['content']=Or[this['state']];});}}class cs extends _0x178dcf{['_applyButton'];['_suggestButton'];constructor(_0x5a2004,_0x4fef44,_0x43ab93){super(_0x5a2004);const _0x2be3f3=Boolean(_0x43ab93);this['set']('isEnabled',!_0x2be3f3),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x438c13=[];if(_0x2be3f3){const _0x8aed06=new _0x1e9460(_0x5a2004);_0x8aed06['set']({'label':i(_0x5a2004,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x42893a}),_0x438c13['push'](_0x8aed06);}else{_0x4fef44['includes']('applySuggestion')&&(this['_applyButton']=new _0x1e9460(_0x5a2004),this['_applyButton']['set']({'label':i(_0x5a2004,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x546f60}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x438c13['push'](this['_applyButton'])),_0x4fef44['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x1e9460(_0x5a2004),this['_suggestButton']['set']({'label':i(_0x5a2004,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x50a3ec}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x438c13['push'](this['_suggestButton']));const _0x3e352c=new _0x1e9460(_0x5a2004);_0x3e352c['set']({'label':i(_0x5a2004,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x815ee6}),_0x3e352c['bind']('isEnabled')['to'](this),_0x3e352c['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x438c13['push'](_0x3e352c);}this['items']['addMany'](_0x438c13);const _0x1a5769=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x1a5769['if']('isVisible','ck-hidden',_0x23f78a=>!_0x23f78a)]}});}['setButtonsVisibility']({showApplyButton:_0xcd9ea2,showSuggestButton:_0x503eae}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0xcd9ea2),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x503eae);}}class vn extends _0x184e76{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x1a3ebd,{part:_0x3142b4,uiIndex:_0x3b3c00,availableActions:_0x16bf38,areActionsDisabled:_0x3d9cc4}){super(_0x1a3ebd),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new cs(_0x1a3ebd,_0x16bf38,_0x3d9cc4),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x3142b4['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x3142b4['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x3142b4['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ws(_0x1a3ebd),this['titleLabelView']=new Sn(_0x1a3ebd,_0x3b3c00),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x24c334,_0x1db502,_0x2560a6,_0x4ee90d)=>{'pending'===_0x4ee90d?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x2560a6?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x2560a6),this['children']['add'](this['stateView']));});}}class Sn extends _0x184e76{constructor(_0x41512d,_0x20901a){super(_0x41512d),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x41512d,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x20901a['toString']())]});}}class as extends _0x184e76{['htmlStreamer'];constructor(_0xd84f2e){super(_0xd84f2e),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x5ea00a,renderingStrategy:_0x5f0115,abortSignal:_0x34e40f}){'streaming'===_0x5f0115?await this['htmlStreamer']['stream']({'document':_0x5ea00a['content'],'targetElement':this['element'],'abortSignal':_0x34e40f}):this['element']['innerHTML']=Tt(_0x5ea00a['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x184e76{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4c0364,{part:_0x4da2d4,uiIndex:_0x319937,areActionsDisabled:_0x53373c,availableActions:_0x1073ee}){super(_0x4c0364);const _0x3b37b3=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x32bc83=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x53373c;};this['on']('change:state',_0x32bc83),this['on']('change:isDone',_0x32bc83),_0x32bc83(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x4c0364,{'part':_0x4da2d4,'uiIndex':_0x319937,'availableActions':_0x1073ee,'areActionsDisabled':_0x53373c}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...ut)['to'](this),this['_streamableContentView']=new as(_0x4c0364),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x3b37b3['to']('state',_0x9fd660=>'ck-ai-suggestion__body__content-part_'+_0x9fd660),_0x3b37b3['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x3b37b3['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x3b37b3['if']('isVisible','ck-hidden',_0x2d7014=>!_0x2d7014)]},'children':this['_children'],'on':{'mouseenter':_0x3b37b3['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x4da2d4['index']});}),'mouseleave':_0x3b37b3['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x4da2d4['index']});}),'click':_0x3b37b3['to'](_0xed7401=>{const _0x3f4500=_0xed7401['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x3f4500)&&this['fire']('showChangeInText',{'index':_0x4da2d4['index']});})}});}async['updateContent']({part:_0x3fbbc4,renderingStrategy:_0x515198,showUnchangedParts:_0x4b6586=!0x1,abortSignal:_0x433ae9}){this['partDefinition']=_0x3fbbc4,this['isVisible']=this['partDefinition']['hasChanges']||_0x4b6586,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x3fbbc4,'renderingStrategy':_0x515198,'abortSignal':_0x433ae9});}['markAsDone'](){this['isDone']=!0x0;}}class z extends _0x290e58(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x20f069){const _0x20fcf7=this['createTask'](_0x20f069);return this['queue']['push'](_0x20fcf7),this['_processQueue'](),_0x20fcf7['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(_0x5bf7ee=>{this['once']('_queueEmpty',()=>{_0x5bf7ee();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x20915f=this['queue']['shift']();try{await _0x20915f['callback'](this['_abortController']['signal']),_0x20915f['resolve']();}catch(_0x4d2c5f){_0x20915f['reject'](_0x4d2c5f);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x4aedc6){let _0x3281eb,_0x43cc7b;const _0x249339=new Promise((_0x36036f,_0x5619f7)=>{_0x3281eb=_0x36036f,_0x43cc7b=_0x5619f7;});return{'callback':_0x4aedc6,'resolve':_0x3281eb,'reject':_0x43cc7b,'completePromise':_0x249339};}}class Ze extends Fr{constructor(_0x1f57ae){super(_0x1f57ae),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x1f57ae['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x47f76a){this['element']['innerHTML']=_0x47f76a;}}const ot=['applySuggestion','insertSuggestion'];class ra extends _0x184e76{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x3dcc61,_0x3488c2=[...ot],_0xa06c32){super(_0x3dcc61);const _0x2ad697=this['bindTemplate'],_0x223a80=Boolean(_0xa06c32);if(this['set']('isEnabled',!_0x223a80),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x223a80){const _0x52c404=new _0x1e9460(_0x3dcc61);_0x52c404['set']({'label':i(_0x3dcc61,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x42893a});const _0x4924b0=new _0x184e76(_0x3dcc61);_0x4924b0['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x3dcc61,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x52c404]}]}),this['children']['add'](_0x4924b0);}else this['_applyChangesButton']=new _0x1e9460(_0x3dcc61),this['_applyChangesButton']['set']({'label':i(_0x3dcc61,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3488c2['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x1e9460(_0x3dcc61),this['_insertSuggestionsButton']['set']({'label':i(_0x3dcc61,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3488c2['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x1b0634=>{_0x1b0634['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x2ad697['if']('isVisible','ck-hidden',_0x39cc7c=>!_0x39cc7c)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x403508){this['isVisible']=_0x403508;}['_switchButtonLabelsPlurality'](_0x4e22e9){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x4e22e9?(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0x184e76{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x447b60,_0x3fc32c){super(_0x447b60),this['bodyCollection']=_0x3fc32c,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',_0x4993a1=>!_0x4993a1)]},'children':this['children']});const _0x6452ea=new _0x184e76(this['locale']),_0x440fb7=new _0xc034b();_0x440fb7['content']=_0xd367bf,_0x6452ea['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x440fb7,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x6452ea),this['_setupBalloonPanel'](_0x447b60);}['addSource'](_0xfcba3e){this['children']['add'](new qr(this['locale'],_0xfcba3e,this['balloonPanelView']));}['_setupBalloonPanel'](_0x5eecc1){this['balloonPanelView']=new _0x2fff3d(_0x5eecc1),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x1e9460{['balloonPanelView'];['source'];constructor(_0x491d25,_0x1e64a3,_0x1a4a24){super(_0x491d25),this['source']=_0x1e64a3,this['balloonPanelView']=_0x1a4a24,this['set']({'label':_0x1e64a3['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x327cf2=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x327cf2['to'](()=>{window['open'](_0x1e64a3['url'],'_blank');}),'mouseenter':_0x327cf2['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x327cf2['to'](()=>{this['_hideTooltip']();})}}),_0x1e64a3['favicon']){const _0x1a7be1=new _0x184e76(_0x491d25);_0x1a7be1['setTemplate']({'tag':'img','attributes':{'src':_0x1e64a3['favicon']||_0xd367bf,'alt':_0x1e64a3['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1a7be1);}else this['set']('icon',_0xd367bf);}['_createTooltipContentView'](_0x2cb118,_0x1b4994){const _0x34a97c=new _0x184e76(_0x2cb118),_0xf3c57=[];let _0x113eb0;_0x1b4994?.['favicon']?(_0x113eb0=new _0x184e76(_0x2cb118),_0x113eb0['setTemplate']({'tag':'img','attributes':{'src':_0x1b4994['favicon'],'alt':_0x1b4994['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x113eb0=new _0xc034b(),_0x113eb0['content']=_0xd367bf,_0x113eb0['extendTemplate']({'attributes':{'alt':_0x1b4994['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0xf3c57['push'](_0x113eb0);const _0x1458b8=new _0x184e76(_0x2cb118);_0x1458b8['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x1b4994['url']},'children':[{'text':new URL(_0x1b4994['url'])?.['hostname']}]}),_0xf3c57['push'](_0x1458b8);const _0x5e9cb1=new _0x184e76(_0x2cb118);_0x5e9cb1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0xf3c57});const _0x771448=new _0x184e76(_0x2cb118);return _0x771448['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x1b4994['title']['length']>0x190?_0x1b4994['title']['substring'](0x0,0x190)+'...':_0x1b4994['title']}]}),_0x34a97c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x5e9cb1,_0x771448]}),_0x34a97c;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x2fff3d['defaultPositions']['northArrowSouth'],_0x2fff3d['defaultPositions']['northArrowSouthWest'],_0x2fff3d['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0xb0e10=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0xb0e10);}}class ca extends _0x184e76{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x31ab99,_0x39452c){super(_0x31ab99);const {areActionsDisabled:_0x3b3c7e,showUnchangedParts:_0x43fdff,availableActions:_0x4e8711}=_0x39452c;this['_areActionsDisabled']=_0x3b3c7e,this['_showUnchangedParts']=_0x43fdff,this['_availableActions']=_0x4e8711,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new z(),this['_emptyPartsWarningView']=new Ze({'id':'empty-parts-warning','initialContent':i(_0x31ab99,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x31ab99,_0x39452c['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x39452c['bodyCollection']),_0x39452c['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...ut)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0xfe9f61,renderingStrategy:_0x266f3e,abortSignal:_0x13c52d}){this['_children']['length']?_0xfe9f61['forEach'](_0x2a52c7=>{const _0x5e54dc=this['_cachedContentParts']['findIndex'](_0x3d8fea=>_0x3d8fea['index']==_0x2a52c7['index']);-0x1===_0x5e54dc?this['_cachedContentParts']['push'](_0x2a52c7):this['_cachedContentParts'][_0x5e54dc]=_0x2a52c7;}):this['_cachedContentParts']=_0xfe9f61;const _0x55d05e=this['_showUnchangedParts']?_0xfe9f61:_0xfe9f61['filter'](_0x40f4fa=>_0x40f4fa['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x55d05e['length']>0x1);for(const _0x42e4ae of _0x55d05e)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x5d0f88=>{let _0x39570c=this['getPartView'](_0x42e4ae['index']);_0x39570c||(_0x39570c=new na(this['locale'],{'part':_0x42e4ae,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x39570c['delegate'](...ut)['to'](this),this['_children']['add'](_0x39570c),this['hasPendingParts']=!0x0),await _0x39570c['updateContent']({'part':_0x42e4ae,'renderingStrategy':_0x266f3e,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x5d0f88}),_0x39570c['markAsDone']();});return _0x13c52d?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x5c9919,_0x1f4c95){const _0x30a61e=this['getPartView'](_0x5c9919);_0x30a61e&&(_0x30a61e['state']=_0x1f4c95),this['hasPendingParts']='pending'==_0x1f4c95||Array['from'](this['_children'])['some'](_0x4eb817=>'pending'==_0x4eb817['state']);}['setPartActive'](_0x316715,_0x5e8100){if(!0x1===_0x316715){for(const _0x4a06fe of this['_children'])_0x4a06fe['isActive']=!0x1;}else{const _0x51c6b5=this['getPartView'](_0x316715);_0x51c6b5&&(_0x51c6b5['isActive']=_0x5e8100);}}['updateSources'](_0x189b82){_0x189b82['forEach'](_0x50db9b=>this['_sourcesView']['addSource'](_0x50db9b)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x5918d7){return this['_children']['find'](_0x264c9b=>_0x264c9b['partDefinition']['index']==_0x5918d7)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x4f9c42=!this['_cachedContentParts']['find'](({hasChanges:_0x11bd2f})=>_0x11bd2f),_0x5c00a3=!!this['_cachedContentParts']['find'](({hasChanges:_0x123fd1})=>!_0x123fd1);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x5c00a3,_0x4f9c42?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x323ca7=>_0x323ca7['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0xc158e7=>_0xc158e7['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x184e76{['bodyView'];['children'];['headerView'];constructor(_0x460674,_0x48a8cd,_0x3b3141){super(_0x460674);const {showDiff:_0x55b0c5,areActionsDisabled:_0x4d1b3,showUnchangedParts:_0xabb939,availableActions:_0x1c140a}=_0x48a8cd;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x460674,{'showDiff':_0x55b0c5}),this['headerView']['on']('toggleShowChanges',(_0x22e0f8,_0x5d2aa1)=>{this['areChangesVisible']=_0x5d2aa1['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x5d2aa1['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x460674,{'areActionsDisabled':_0x4d1b3,'showUnchangedParts':!!_0xabb939,'availableActions':_0x1c140a,'bodyCollection':_0x3b3141}),this['bodyView']['delegate'](...ut)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x4e6012){await this['bodyView']['updateContentParts'](_0x4e6012);}['updateSources'](_0x3194b9){this['bodyView']['updateSources'](_0x3194b9);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Qe extends Fr{['containerView'];constructor(_0x3d98eb,_0x5c8142,_0x50e164){super(_0x5c8142),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x3d98eb,{'showDiff':_0x5c8142['showDiff'],'areActionsDisabled':_0x5c8142['areActionsDisabled'],'availableActions':_0x5c8142['availableActions']},_0x50e164),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x57cc70,_0x3cdfe8)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3cdfe8['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0xd1dac,{index:_0x540c7a})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x540c7a});}),this['containerView']['on']('applySuggestion',(_0x49f851,{index:_0x29ebd9}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x29ebd9});}),this['containerView']['on']('insertSuggestion',(_0x3435a6,{index:_0x27ce3a}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x27ce3a});}),this['containerView']['on']('rejectSuggestion',(_0x3c3647,{index:_0x23882a})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x23882a});}),this['containerView']['on']('mouseOverSuggestion',(_0x2e470e,{index:_0x5163e9})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5163e9});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2d30dd,{index:_0x40ed8b})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x40ed8b});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x34d9d5){await this['containerView']['updateContent'](_0x34d9d5);}['updatePartState'](_0x476048,_0x221ee6){this['containerView']['bodyView']['updatePartState'](_0x476048,_0x221ee6);}['setPartActive'](_0x3c339c,_0x45c2a9){!0x1===_0x3c339c?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x3c339c,_0x45c2a9);}['updateSources'](_0x209231){this['containerView']['updateSources'](_0x209231);}['getPartView'](_0x35cb82){return this['containerView']['bodyView']['getPartView'](_0x35cb82);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Xe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x5d1a20,_0x28474e,_0x587ef0){super(_0x28474e),this['_bodyCollection']=_0x587ef0,this['locale']=_0x5d1a20,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x184e76(),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':ji(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x29bc68,renderingStrategy:_0x3d9213,abortSignal:_0x30ba78}){'streaming'===_0x3d9213?await this['streamIntoElement'](_0x29bc68,this['replyContainer']['element'],_0x30ba78):this['replyContainer']['element']['innerHTML']=_0x3807c6(_0x29bc68);}['updateSources'](_0x44a67c){const _0x435c08=new Sr(this['locale'],this['_bodyCollection']);_0x435c08['children']['addMany'](_0x44a67c['map'](_0x538af2=>new qr(this['locale'],_0x538af2,_0x435c08['balloonPanelView']))),_0x435c08['isVisible']=!0x0,this['children']['add'](_0x435c08);}}class li extends _0x4435de{constructor(_0x1361bd=void 0x0){super();const _0x196a59=_0x1361bd?'ck-ai-spinner_'+_0x1361bd:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x196a59]}});}}const xn={'file':_0x55fdc0,'document':_0x35a5eb,'web-resource':_0xb249a6,'text':_0x55fdc0,'selection':_0x5a0e45,'mcp-tool-context':_0x35a5eb},Ur='ck-ai-chat-context-chip',Wr='ck-ai-chat-context-chip_wide',Yr='ck-ai-chat-context-chip_document',$r='ck-ai-chat-context-chip__label',Qr='ck-ai-chat-context-chip__type-icon',Xr='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Vo extends _0x1e9460{constructor(_0x30f2b8,_0x50c05f,_0x2bd04f,_0x4b86cd,_0x48f74d=!0x1){super(_0x30f2b8),this['_isAnimationOnEnterEnabled']=_0x4b86cd,this['_initializeProperties'](_0x50c05f,_0x2bd04f,_0x48f74d),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'](_0x17653e,_0x3ee1a3,_0x1088b0){this['set']('label',_0x17653e['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x17653e['type']),this['set']('id',_0x17653e['uiId']),this['set']('readonly',_0x3ee1a3),this['set']('isLoading',_0x1088b0);}['_setupTemplate'](){const _0x348f2a=this['_createIconView'](),_0x5005a5=this['_createRemoveButton'](),_0x1f7e51=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x1f7e51),'children':this['_createTemplateChildren'](_0x348f2a,_0x5005a5,_0x1f7e51)});}['_createTemplateAttributes'](_0x2cc05c){return{'class':[Ur,_0x2cc05c['if']('itemType',Yr,_0x1bab42=>'document'==_0x1bab42),_0x2cc05c['if']('itemType',Wr,_0x5670e9=>'selection'==_0x5670e9)],'data-cke-tooltip-text':_0x2cc05c['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Xr};}['_createTemplateChildren'](_0x2c1e44,_0x16fbf7,_0x5be575){const _0x13f6a8=this['_createLabelElement'](_0x5be575),_0x119569=this['_createLoaderIcon']();return this['readonly']?[_0x2c1e44,_0x13f6a8]:[_0x2c1e44,_0x119569,_0x13f6a8,_0x16fbf7];}['_createLabelElement'](_0x523860){return{'tag':'span','attributes':{'class':$r},'children':[{'text':_0x523860['to']('label')}]};}['_createRemoveButton'](){const _0x502f9b=new _0x1e9460(this['locale']);return _0x502f9b['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0xf5ecf7}),this['_setupRemoveButtonEvent'](_0x502f9b),_0x502f9b;}['_setupRemoveButtonEvent'](_0x23771f){_0x23771f['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x297cbc=this['bindTemplate'],_0x4b48fd=new _0xc034b();return _0x4b48fd['content']=xn[this['itemType']],_0x4b48fd['extendTemplate']({'attributes':{'class':[Qr,_0x297cbc['if']('isLoading','ck-hidden',_0x5a96d2=>_0x5a96d2)]}}),_0x4b48fd;}['_handleAnimationEndOnce'](_0x1d1958,_0x6ea8b3){if(!_0x1d1958)return;const _0x1dc84d=()=>{_0x6ea8b3(),_0x1d1958['removeEventListener']('animationend',_0x1dc84d),_0x1d1958['removeEventListener']('webkitAnimationEnd',_0x1dc84d);};_0x1d1958['addEventListener']('animationend',_0x1dc84d),_0x1d1958['addEventListener']('webkitAnimationEnd',_0x1dc84d);}['_createLoaderIcon'](){const _0x9a436a=new li('small');return _0x9a436a['bind']('isVisible')['to'](this,'isLoading',_0x5f06f8=>_0x5f06f8),_0x9a436a;}}function In(_0x21dd92){if(!_0x21dd92)return _0x21dd92;if(_0x21dd92['length']<=0x78)return _0x21dd92;const _0x2ca4d6=_0x21dd92['slice'](0x0,0x78),_0x1f2ecd=_0x2ca4d6['lastIndexOf']('\x20');return(_0x1f2ecd>0x0?_0x2ca4d6['slice'](0x0,_0x1f2ecd):_0x2ca4d6)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ro{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x44a244,_0x1d46e1,_0x105357,_0x580d42,_0x5e2834){this['_locale']=_0x44a244,this['_visibleChips']=_0x1d46e1,this['_config']={...hn,..._0x105357,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x105357['cssClasses']}},this['_overflowChips']=new _0x4b57cf(),this['_bodyCollection']=_0x580d42,this['_parentView']=_0x5e2834||null;}['setContainerElement'](_0x3edea8){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x3edea8,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 _0x53a408=[...this['_visibleChips'],...this['_overflowChips']],_0x189f92=this['_createCalculationContainer'](),_0x53fd2f=this['_calculateOverflowInContainer'](_0x189f92,_0x53a408),_0x328467=_0x189f92['_ancestorsToRestore'];_0x328467&&this['_restoreAncestorVisibility'](_0x328467),_0x189f92['remove'](),this['_applyOverflowResults'](_0x53a408,_0x53fd2f);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x1ff4d5({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x185823=new _0x1e9460(this['_locale']);_0x185823['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x530c37=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x530c37['push'](this['_config']['cssClasses']['controlsButton']),_0x185823['extendTemplate']({'attributes':{'class':_0x530c37}}),_0x185823;}['_createShowMoreBalloonPanelView'](){const _0x14bf1e=new _0x2fff3d(this['_locale']);return _0x14bf1e['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x14bf1e),_0x14bf1e;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x226ece=>{_0x226ece['disableAnimationOnEnter']();});const _0x587211=new _0x184e76(this['_locale']);_0x587211['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x587211);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x4a8cfc=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x4a8cfc?'':'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'](_0x166e4e){const _0x25fb4f=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2a3f5a=this['_containerElement']?.['classList'];if(_0x2a3f5a){const _0x405222=_0x2a3f5a[0x0]||'',_0x1c0b3c=_0x166e4e['querySelector']('.'+_0x405222),_0x498e6d=_0x166e4e['querySelector'](_0x25fb4f);return _0x1c0b3c||_0x498e6d||_0x166e4e;}return _0x166e4e['querySelector'](_0x25fb4f)||_0x166e4e;}['_calculateContainerWidth'](){const _0x2f9322=this['_parentView']?.['element']||this['_containerElement'];if(!_0x2f9322)return an;const _0x159e2e=window['getComputedStyle'](_0x2f9322)['width'];if('auto'===_0x159e2e||'0px'===_0x159e2e||!_0x159e2e){const _0x123506=_0x2f9322['parentElement'];if(_0x123506){const _0x36f050=window['getComputedStyle'](_0x123506);return'auto'!==_0x36f050['width']?_0x36f050['width']:an;}return an;}return _0x159e2e;}['_applyCalculationStyles'](_0x52a64d,_0x3788ab){this['_config']['cssClasses']['calculationContainer']&&_0x52a64d['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x52a64d['style']['width']=_0x3788ab,_0x52a64d['style']['position']='absolute',_0x52a64d['style']['top']='-9999px',_0x52a64d['style']['left']='-9999px',_0x52a64d['style']['opacity']='0',_0x52a64d['style']['pointerEvents']='none',_0x52a64d['style']['zIndex']='-1',_0x52a64d['style']['visibility']='visible\x20!important',_0x52a64d['style']['display']='block\x20!important',_0x52a64d['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4b2155){_0x4b2155['forEach'](({element:_0x209233,originalDisplay:_0x21fab0,originalVisibility:_0x3b054c})=>{_0x209233['style']['display']=_0x21fab0,_0x209233['style']['visibility']=_0x3b054c;});}['_makeAncestorsVisible'](_0x27aa12){const _0x455361=[];let _0xa23cae=_0x27aa12;for(;_0xa23cae&&_0xa23cae!==document['body'];){const _0x260d38=window['getComputedStyle'](_0xa23cae);'none'!==_0x260d38['display']&&'hidden'!==_0x260d38['visibility']||(_0x455361['push']({'element':_0xa23cae,'originalDisplay':_0xa23cae['style']['display'],'originalVisibility':_0xa23cae['style']['visibility']}),_0xa23cae['style']['display']='block',_0xa23cae['style']['visibility']='visible'),_0xa23cae=_0xa23cae['parentElement'];}return _0x455361;}['_createContainerElements'](){let _0x3c360d,_0x2c7182;return this['_parentView']?.['element']?(_0x3c360d=this['_parentView']['element']['cloneNode'](!0x0),_0x2c7182=this['_findTargetContainer'](_0x3c360d)):(_0x3c360d=document['createElement']('div'),_0x2c7182=_0x3c360d),{'calculationContainer':_0x3c360d,'targetContainer':_0x2c7182};}['_createCalculationContainer'](){const {calculationContainer:_0x5eaca5,targetContainer:_0x58b7b9}=this['_createContainerElements'](),_0x32e6a0=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x5eaca5,_0x32e6a0);const _0x5a88df=this['_parentView']?.['element']||this['_containerElement'],_0x1c3b2f=_0x5a88df?.['parentElement'];_0x1c3b2f?_0x1c3b2f['appendChild'](_0x5eaca5):document['body']['appendChild'](_0x5eaca5),_0x5eaca5['_targetContainer']=_0x58b7b9;const _0x37da02=this['_makeAncestorsVisible'](_0x1c3b2f||null);return _0x5eaca5['offsetWidth'],_0x5eaca5['_ancestorsToRestore']=_0x37da02,_0x5eaca5;}['_calculateOverflowInContainer'](_0x489dbe,_0x540189){const _0x36482c=_0x489dbe['_targetContainer']||_0x489dbe,_0x5aa3e6=[],{rowCount:_0x38e2e3}=this['_renderChipsAndCountRows'](_0x36482c,_0x540189);if(_0x38e2e3<=this['_config']['maxVisibleRows'])return _0x5aa3e6;const _0x18fb18=_0x540189['slice']();for(;_0x18fb18['length']>0x0;){if(this['_testButtonFit'](_0x489dbe,_0x36482c,_0x18fb18)){const _0x2cce0f=_0x540189['filter'](_0x5e648e=>!_0x18fb18['includes'](_0x5e648e));_0x5aa3e6['push'](..._0x2cce0f);break;}if(!_0x18fb18['pop']())break;}return _0x5aa3e6;}['_renderChipsAndCountRows'](_0xb507d5,_0x285447){_0xb507d5['innerHTML']='',_0x285447['forEach'](_0x4539ae=>{if(_0x4539ae['element']){const _0x16fec4=_0x4539ae['element']['cloneNode'](!0x0);_0xb507d5['appendChild'](_0x16fec4);}}),_0xb507d5['offsetWidth'];const _0x45a1dc=_0xb507d5['children'],_0x2e3b96=[];return Array['from'](_0x45a1dc)['forEach'](_0x236239=>{const _0xcd0275=_0x236239['getBoundingClientRect']()['top'];_0x2e3b96['some'](_0x5a9caa=>Math['abs'](_0x5a9caa-_0xcd0275)<this['_config']['rowDetectionTolerance'])||_0x2e3b96['push'](_0xcd0275);}),{'rowCount':_0x2e3b96['length']};}['_createMockButton'](){const _0x1aa16b=document['createElement']('button');return _0x1aa16b['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x1aa16b['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x1aa16b['textContent']='+\x201',_0x1aa16b;}['_testButtonFit'](_0x15078b,_0x1f1cfe,_0x5cf8ce){this['_renderChipsAndCountRows'](_0x1f1cfe,_0x5cf8ce);const _0x3e2d62=this['_createMockButton']();_0x15078b['appendChild'](_0x3e2d62),_0x15078b['offsetWidth'];const _0x5c9d3f=[..._0x1f1cfe['children'],_0x3e2d62],_0x24033a=[];_0x5c9d3f['forEach'](_0x58b81f=>{const _0x44448d=_0x58b81f['getBoundingClientRect']()['top'];_0x24033a['some'](_0x3c78bb=>Math['abs'](_0x3c78bb-_0x44448d)<this['_config']['rowDetectionTolerance'])||_0x24033a['push'](_0x44448d);});const _0x53dda1=_0x24033a['length'];return _0x3e2d62['remove'](),_0x53dda1<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x57d0c0,_0x1025a9){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x57d0c0['forEach'](_0x1d385a=>{_0x1025a9['includes'](_0x1d385a)?this['_overflowChips']['add'](_0x1d385a):this['_visibleChips']['add'](_0x1d385a);});}['_updateOverflowUI'](_0x1c4b92){if(_0x1c4b92>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1c4b92>0x0&&this['_showMoreButtonView']){const _0x3c94ad=''+this['_config']['showMoreLabelPrefix']+(_0x1c4b92<0x63?_0x1c4b92:'99');this['_showMoreButtonView']['label']=_0x3c94ad;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0xa62684,_0x594385){this['_distributeChips'](_0xa62684,_0x594385),this['_updateOverflowUI'](_0x594385['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x220b0b=>{_0x220b0b[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 _0x10be70=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x10be70['width']||0x0===_0x10be70['height'])return!0x1;const _0x200598=window['innerHeight']||document['documentElement']['clientHeight'],_0x5abe02=window['innerWidth']||document['documentElement']['clientWidth'],_0xba2481=0xc8;return _0x10be70['bottom']>=-0xc8&&_0x10be70['top']<=_0x200598+_0xba2481&&_0x10be70['right']>=-0xc8&&_0x10be70['left']<=_0x5abe02+_0xba2481;}}const Zr='ck-ai-chat__feed__context-chips',la='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',da='ck-ai-chat-controls-button',_a='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x184e76{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x1ee76d,_0x25cdb2,_0x5d24f8){super(_0x1ee76d),this['_bodyCollection']=_0x5d24f8,this['_createContextChips'](_0x25cdb2);const _0x4fb1e4={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':da}};this['_overflowManager']=new Ro(_0x1ee76d,this['_contextChips'],_0x4fb1e4,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Zr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':la},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x1c2496=this['element']['querySelector']('.'+la);_0x1c2496&&(this['_overflowManager']['setContainerElement'](_0x1c2496),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x41b195){for(const _0x3d1966 of _0x41b195){const _0x2775af=new Vo(this['locale'],_0x3d1966,!0x0,!0x1);this['_contextChips']['add'](_0x2775af);}}}class Ye extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x484468,_0x421a4d,_0xc91d47){super(_0x421a4d),this['_locale']=_0x484468,this['_bodyCollection']=_0xc91d47,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 _h(this['_locale'],this['options']['contextItems']['filter'](_0x3f174c=>!_0x3f174c['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x184e76(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 Mt extends Fr{['capabilities'];constructor(_0x499555,_0x46e325){super(_0x46e325);const {isWebSearchEnabled:_0x150f2b,isReasoningEnabled:_0x4fde05}=_0x46e325['capabilities'],_0x4a3a3c=[];let _0x7b2ac='';_0x150f2b&&_0x4fde05?(_0x7b2ac=i(_0x499555,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x4a3a3c['push'](aa(_0xd367bf)),_0x4a3a3c['push'](aa(_0x433ff5))):_0x150f2b?(_0x7b2ac=i(_0x499555,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x4a3a3c['push'](aa(_0xd367bf))):_0x4fde05&&(_0x7b2ac=i(_0x499555,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x4a3a3c['push'](aa(_0x433ff5))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x7b2ac?'':'ck-hidden']}});const _0x4e76f0=new _0x184e76();_0x4e76f0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x4a3a3c,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x7b2ac]}]}),this['children']['add'](_0x4e76f0),this['capabilities']=_0x46e325['capabilities'];}}function aa(_0x4f3bea){const _0x1e21cc=new _0xc034b();return _0x1e21cc['content']=_0x4f3bea,_0x1e21cc;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class $e{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x5801bf){this['element']=_0x5801bf,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x31336b of Fs){const _0x568406='keydown'!==_0x31336b;this['element']['addEventListener'](_0x31336b,this['_onUserEvent']['bind'](this),{'passive':_0x568406,'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'](_0x167992){if(this['isRunning']){if('keydown'===_0x167992['type']){const _0x2ff872=_0x167992['key'];if(!Us['includes'](_0x2ff872))return;}_0x167992 instanceof WheelEvent?_0x167992['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x4d82f7,scrollHeight:_0x51e4ca,clientHeight:_0x26c09c}=this['element'];return _0x51e4ca-_0x4d82f7-_0x26c09c<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class ai extends _0x184e76{constructor(_0x475d3f,_0x11f452){super(_0x475d3f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x11f452)});}['_createSkeletonItems'](_0x4c6ef8){const _0x3b79d0=['ck','ck-ai-skeleton__item'];return _0x4c6ef8['map'](_0x24f3b2=>{let _0x46e2c5='';switch(_0x24f3b2['attributes']['align']){case'right':_0x46e2c5='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x46e2c5='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x46e2c5='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x24f3b2['tag'],'attributes':{'class':[..._0x3b79d0,_0x24f3b2['attributes']['class']?_0x24f3b2['attributes']['class']:''],'style':'width:\x20'+_0x24f3b2['attributes']['width']+';\x20height:\x20'+_0x24f3b2['attributes']['height']+';'+_0x46e2c5}};});}}const di={'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(_0x5afde0,_0x18e998,_0x5ae611,_0x49b9b9){return new Array(_0x5afde0)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x18e998,'height':_0x5ae611,'align':_0x49b9b9}}));}class mi extends Fr{constructor(_0x42543d){super(_0x42543d),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class ui extends _0x184e76{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x440254,_0x4a470b){super(_0x440254),this['_bodyCollection']=_0x4a470b,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...bt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new $e(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x2a4f1a,_0x43735a){let _0x313bd5;return'ai-reply'===_0x2a4f1a?_0x313bd5=new Xe(this['locale'],_0x43735a,this['_bodyCollection']):'ai-suggestion-reply'===_0x2a4f1a?(_0x313bd5=new Qe(this['locale'],_0x43735a,this['_bodyCollection']),_0x313bd5['bind']('isTrackChangesOn')['to'](this)):_0x313bd5='user-message'===_0x2a4f1a?new Ye(this['locale'],_0x43735a,this['_bodyCollection']):'interaction-header'===_0x2a4f1a?new Mt(this['locale'],_0x43735a):'custom-element'===_0x2a4f1a?new mi(_0x43735a):new Ze(_0x43735a),this['children']['add'](_0x313bd5),_0x313bd5;}async['updateReplyItem']({id:_0x1ae195,parsedContent:_0x35fad0,renderingStrategy:_0x235a80,abortSignal:_0x1d33be}){const _0x4c7679=this['getItemById'](_0x1ae195);if(!(_0x4c7679 instanceof Xe))throw new _0x36ca17('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x4c7679,'id':_0x1ae195,'parsedContent':_0x35fad0});await _0x4c7679['updateContent']({'parsedContent':_0x35fad0,'renderingStrategy':_0x235a80,'abortSignal':_0x1d33be});}async['updateWebSources'](_0x323741,_0x557580){const _0x23e232=this['getItemById'](_0x323741);if(_0x23e232 instanceof Qe)_0x23e232['updateSources'](_0x557580);else{if(!(_0x23e232 instanceof Xe))throw new _0x36ca17('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x23e232,'id':_0x323741,'sources':_0x557580});_0x23e232['updateSources'](_0x557580);}}async['updateSuggestionItem']({id:_0x25c72e,parts:_0x26733c,renderingStrategy:_0x1fcb4d,abortSignal:_0x394439}){const _0x4484d8=this['getItemById'](_0x25c72e);if(!(_0x4484d8 instanceof Qe))throw new _0x36ca17('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x4484d8,'id':_0x25c72e,'parts':_0x26733c});await _0x4484d8['updateContent']({'parts':_0x26733c,'renderingStrategy':_0x1fcb4d,'abortSignal':_0x394439});}['updateSuggestionPartState']({id:_0x3a7bb3,index:_0x4980ec,state:_0x275f95}){const _0x5e1ac5=this['getItemById'](_0x3a7bb3);if(!(_0x5e1ac5 instanceof Qe))throw new _0x36ca17('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3a7bb3});_0x5e1ac5['updatePartState'](_0x4980ec,_0x275f95);}['setSuggestionPartActive']({id:_0x119fa0,index:_0x377f88,isActive:_0x2faf1b}){const _0x529dc5=this['getItemById'](_0x119fa0);if(!(_0x529dc5 instanceof Qe))throw new _0x36ca17('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x119fa0});this['children']['filter'](_0xb6af75=>_0xb6af75 instanceof Qe)['forEach'](_0x1445af=>{_0x1445af['setPartActive'](!0x1);}),_0x529dc5['setPartActive'](_0x377f88,_0x2faf1b);}['markItemAsDone'](_0x4ff38c){this['getItemById'](_0x4ff38c)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x2cf30e=>_0x2cf30e['options']['id']);}['removeItem'](_0x5d519a){this['children']['remove'](this['getItemById'](_0x5d519a));}['hasItem'](_0x544929){return!!this['children']['find'](_0x2bf632=>_0x2bf632['options']['id']['includes'](_0x544929));}['scrollToSuggestion'](_0x4e1cd5,_0x4508b0){const _0x31376b=this['getItemById'](_0x4e1cd5);if(!(_0x31376b instanceof Qe))return void _0x3bfc82('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x4e1cd5,'partIndex':_0x4508b0});const _0x17162a=_0x31376b['getPartView'](_0x4508b0);_0x17162a?_0x3c5789(_0x17162a['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x3bfc82('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x4e1cd5,'partIndex':_0x4508b0});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x529516=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x529516,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x719c78=new ai(this['locale'],di['aiFeed']);return _0x719c78['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x56ee5c=>!_0x56ee5c)]}}),_0x719c78;}['_createFeedItems'](){const _0x1e5345=new _0x184e76(this['locale']);return _0x1e5345['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1e5345;}['_createFeedLoader'](){const _0x21c5b6=new _0x184e76(this['locale']);return _0x21c5b6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0xd7d440=>!_0xd7d440)]},'children':this['_createLoaderChildren']()}),_0x21c5b6;}['_createLoaderChildren'](){const _0x1de075=new li();return _0x1de075['isVisible']=!0x0,[_0x1de075,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x33222d){const _0x5746e8=this['children']['find'](_0x533787=>_0x533787['options']['id']['includes'](_0x33222d));if(!_0x5746e8)throw new _0x36ca17('ai-chat-feed-view-item-not-found',this,{'id':_0x33222d});return _0x5746e8;}['setLoadingMessage'](_0xb2970d){this['set']('loadingMessage',_0xb2970d);}['toggleLoadingSkeleton'](_0x18e41d){this['set']('isLoadingSkeletonVisible',_0x18e41d);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nh extends _0x35cdc6{['filter'](){let _0x45eaa8=0x0;for(const _0x998e91 of this['items'])_0x45eaa8+=_0x998e91['items']['length'];return{'resultsCount':_0x45eaa8,'totalItemsCount':_0x45eaa8};}}const ah='ck-ai-chat__prompt-input_highlighted';class _s extends _0x4043f2{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x3e6aa5,_0x5818b9){super(_0x3e6aa5,{'queryView':{'label':'','creator':_0x5db2e8,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nh(_0x3e6aa5),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5818b9,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=_s['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=_s['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',(_0x505a59,_0x1c9570)=>!_0x505a59&&!_0x1c9570),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5af1f8,_0x2976ab)=>{this['isUploadInProgress']||this['isEmpty']||_0x5af1f8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2976ab());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x53f795=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x53f795)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x2a73e3=_0xac888d(_0x53f795);this['fire']('sendUserMessage',_0x2a73e3),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x2d7596){this['queryView']['fieldView']['set']('placeholder',_0x2d7596);}['focus'](_0x49fb6e=!0x1){super['focus'](),_0x49fb6e&&(this['element']['classList']['contains'](ah)||(this['element']['classList']['add'](ah),setTimeout(()=>{this['element']['classList']['remove'](ah);},0x320)));}['_createSubmitButton'](){const _0xb9d1a4=new _0x1e9460(this['locale']);return _0xb9d1a4['set']({'icon':_0x4fc1d8,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0xb9d1a4['on']('execute',()=>{this['submit']();}),_0xb9d1a4;}['setIsUploadInProgress'](_0x4ac51d){this['isUploadInProgress']=_0x4ac51d;}['_setUpAddContextButtonPositioning'](){const _0x309f2e=this['locale'],_0xcf5489=()=>{_0x28fe94['window']['requestAnimationFrame'](()=>{if(_0x255643(this['element'])){const _0x53466c=new _0x5b8f6e(this['queryView']['fieldView']['element']),_0x45e71a=new _0x5b8f6e(this['_addContextButtonView']['element']),_0x3af1a2=_0x53466c['width'],_0x414690='rtl'===_0x309f2e['uiLanguageDirection']?'right':'left';_0x53466c['excludeScrollbarsAndBorders']();const _0x2f9459=_0x3af1a2-_0x53466c['width']+0x1;this['_addContextButtonView']['element']['style'][_0x414690]='calc('+(_0x3af1a2-_0x45e71a['width']-_0x2f9459)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0xcf5489),this['on']('render',()=>{_0xcf5489(),this['_queryViewResizeObserver']=new _0xb25201(this['queryView']['fieldView']['element'],()=>{_0xcf5489();});});}}const ga='ck-ai-chat__prompt-capabilities',Ia='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls-button--commands',Ta='ck-ai-button-tertiary',pa='ck-ai-chat-controls__model-selection',ma='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class vs extends _0x184e76{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x309948){super(_0x309948),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x355ccd=>'selector'===_0x355ccd),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x362c22=>_0x362c22?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x28b266=>_0x28b266),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x512c5d=>_0x512c5d),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x22b9a8=>i(this['locale'],_0x22b9a8?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x4c5d9b=>_0x4c5d9b),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x207cc0=>i(this['locale'],_0x207cc0?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x4b57cf(),_0x321091(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x416a8f,_0xc9a95b){if(_0xc9a95b)this['set']('modelDisplayMode','hidden');else{const _0x220aba=0x1===_0x416a8f['length'];this['set']('modelDisplayMode',_0x220aba?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x416a8f?.['length'])for(const _0x1f47da of _0x416a8f){const _0x3c29c6=new _0xf9ff1d({'label':_0x1f47da['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1f47da['id'],'model':_0x1f47da});_0x3c29c6['bind']('isOn')['to'](this,'activeModelId',_0x21b746=>_0x21b746===_0x1f47da['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x3c29c6,'labelView':new Sa(this['locale'],_0x1f47da)});}}['setWebSearch'](_0x176a5b){this['set']('webSearchActive',_0x176a5b);}['setReasoning'](_0x46a2e1){this['set']('reasoningActive',_0x46a2e1);}['setModel'](_0x43f4d3){if(!_0x43f4d3)return;this['activeModelId']=_0x43f4d3['id'],this['activeModelName']=_0x43f4d3['name']||_0x43f4d3['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x43f4d3['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x43f4d3['name']);const _0x4d022c=_0x43f4d3['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x4d022c),this['_webSearchButton']['set']('isVisible',_0x4d022c);const _0x3f0a8c=_0x43f4d3['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x3f0a8c),this['_reasoningButton']['set']('isVisible',_0x3f0a8c);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x5bd99c){this['set']('modelSelectorEnabled',!0x1),_0x5bd99c&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x45e289=new _0x1e9460();return _0x45e289['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0xd367bf,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x45e289['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x45e289;}['_createReasoningButton'](){const _0x8eb284=new _0x1e9460();return _0x8eb284['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x433ff5,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x8eb284['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x8eb284;}['_createCommandsButton'](){const _0x40be34=new _0x1e9460();return _0x40be34['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x1d5463,'withText':!0x0,'class':Ia,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x40be34['extendTemplate']({'attributes':{'class':[Ea]}}),_0x40be34['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x40be34;}['_createModelSelectionDropdown'](){const _0x809162=_0x546896(this['locale']);return _0x809162['set']({'panelPosition':'ne','class':[pa]}),_0x809162['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa,'class':Ta}),this['listenTo'](_0x809162,'execute',_0x4bd476=>{this['fire']('selectModel',_0x4bd476['source']['model']);}),_0x809162;}['_createModelNameView'](){const _0x32a2f6=new ba(this['locale']);return _0x32a2f6['bind']('text')['to'](this,'activeModelName',_0x986e34=>_0x986e34??''),_0x32a2f6['bind']('isVisible')['to'](this,'modelDisplayMode',_0x10051a=>'name'===_0x10051a),_0x32a2f6;}}let Sa=class extends _0x55674c{constructor(_0x52bbc4,_0x1a5ccd){super();const _0x45d8b1=this['bindTemplate'],_0x2d4b41=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x45d8b1['to']('style'),'id':_0x45d8b1['to']('id')},'children':[{'tag':'div','attributes':{'class':[ma]},'children':[{'text':_0x45d8b1['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x1a5ccd['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x2d4b41}]}),_0x2d4b41['addMany'](this['_getCapabilityParts'](_0x52bbc4,_0xd367bf,'AI_CHAT_SEARCH_WEB',_0x1a5ccd['capabilities']['webSearch']?.['enabled']??!0x1)),_0x2d4b41['addMany'](this['_getCapabilityParts'](_0x52bbc4,_0x433ff5,'AI_CHAT_REASONING',_0x1a5ccd['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x2d38b6,_0x1c2b3b,_0x14cf99,_0x3ad897){const _0x2fbf64=new _0xc034b();_0x2fbf64['content']=_0x1c2b3b;const _0x4c1f20=new _0x184e76(_0x2d38b6);_0x4c1f20['setTemplate']({'tag':'span','children':[{'text':i(_0x2d38b6,_0x14cf99)+':\x20'}]});const _0xed4ad8=new _0x184e76(_0x2d38b6);return _0xed4ad8['setTemplate']({'tag':'span','children':[{'text':i(_0x2d38b6,_0x3ad897?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x2fbf64,_0x4c1f20,_0xed4ad8];}},ba=class extends _0x184e76{constructor(_0x1c45b3){super(_0x1c45b3),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x26c3dd=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x26c3dd['if']('isVisible','ck-hidden',_0x17a633=>!_0x17a633)]},'children':[{'text':_0x26c3dd['to']('text')}]});}};const Ra='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class Po extends _0x184e76{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x44aa96){super(_0x44aa96),this['focusTracker']=new _0x22c832(),this['keystrokes']=new _0x2b0c94(),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 _0x56c0d3({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x14ef4e=>{this['focusTracker']['add'](_0x14ef4e['element']),this['keystrokes']['listenTo'](_0x14ef4e['element']);}),_0xa2cd14({'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'](_0x4bb126){this['urlInputField']['errorText']=_0x4bb126,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x843186=new _0x1e9460(this['locale']);return _0x843186['set']({'icon':_0x29f3c3,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x1054a5,_0x2ebeb0,_0x250c86)=>{_0x843186['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x250c86?'':'\x20ck-hidden')]});}),_0x843186;}['_createUrlInputField'](){const _0x2394ff=new _0xfba0d2(this['locale'],th);return _0x2394ff['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x2394ff['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x2394ff;}['_createConfirmButton'](){const _0x44727c=new _0x1e9460(this['locale']);return _0x44727c['set']({'icon':_0xa54ca6,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x44727c;}['_setupTemplate'](){const _0x39a3b2=new _0x41e0a3(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x39a3b2['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ra,'tabindex':'-1'},'children':[_0x39a3b2,{'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',_0x4134c4=>{_0x4134c4['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x18845e,_0x4c3769)=>{this['clear'](),this['fire']('cancel'),_0x4c3769();});}['_handleSubmit'](){const _0x1d17be=this['getValue']()['trim']();_0x1d17be?this['_isValidUrl'](_0x1d17be)?(this['clearError'](),this['fire']('submitUrl',_0x1d17be)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x2e88f9=this['getValue']()['trim'](),_0x2646a2=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x2e88f9['length']>0x0&&!_0x2646a2;}['_isValidUrl'](_0x26ea7a){try{return!!new URL(_0x26ea7a);}catch{return!0x1;}}}const ka='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',va='ck-ai-chat-resources__item-title',ya='ck-ai-chat-resources__item__icon';class hc extends _0x4ffa3a{['resource'];['_titleView'];['_iconView'];constructor(_0x24c822,_0x23a389){super(_0x24c822),this['resource']=_0x23a389,this['set']('isInContext',!!_0x23a389['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x4c4f5d){if(_0x4c4f5d['isInContext'])return _0xa54ca6;switch(_0x4c4f5d['type']){case qe['DOCUMENT']:return _0x35a5eb;case qe['URL']:return _0xb249a6;case qe['FILE']:case qe['TEXT']:return _0x55fdc0;default:return _0x56717c;}}['highlightText'](_0x1cb295){if(!_0x1cb295||''===_0x1cb295['trim']())return void this['_titleView']['highlightText'](null);const _0x594117=new RegExp(_0x3383a1(_0x1cb295),'gi');this['_titleView']['highlightText'](_0x594117);}['updateResourceState'](_0x31320f){this['resource']['isInContext']=_0x31320f,this['isInContext']=_0x31320f,this['_updateIcon']();}['_createTitleView'](){const _0x4b8397=new _0x56f45c();return _0x4b8397['text']=this['resource']['label'],_0x4b8397['extendTemplate']({'tag':'span','attributes':{'class':[va]}}),_0x4b8397;}['_createIconView'](){const _0x109bdf=new _0xc034b();return _0x109bdf['content']=this['getResourceIcon'](this['resource']),_0x109bdf;}['_setupTemplate'](){const _0x5d59fd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ka,_0x5d59fd['if']('isVisible','ck-hidden',_0x20da17=>!_0x20da17),_0x5d59fd['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x5d59fd['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const xa='ck-ai-chat-resources__list';class Lr extends _0x35cdc6{['_source'];constructor(_0x33efbe,_0xd7d6e){super(_0x33efbe),this['_source']=_0xd7d6e,this['extendTemplate']({'attributes':{'class':[xa]}});}['setResources'](_0xf06fa0,_0x201740){this['items']['clear']();let _0x4920f6=_0xf06fa0;if(this['_source']['useDefaultFiltering']&&_0x201740&&''!==_0x201740['trim']()){const _0xbd64aa=new RegExp(_0x201740['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x4920f6=_0xf06fa0['filter'](_0x27579c=>_0xbd64aa['test'](_0x27579c['label']));}for(const _0x475fdc of _0x4920f6){const _0x36277a=new hc(this['locale'],_0x475fdc);_0x36277a['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x475fdc);}),this['items']['add'](_0x36277a);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x201740);}['highlightText'](_0x658d69){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x142691=>{_0x142691['highlightText'](_0x658d69);});}['updateResourceState'](_0x13cf3c,_0x6c044){for(const _0x339deb of this['items']){const _0x817e81=_0x339deb;_0x817e81['resource']['id']===_0x13cf3c&&_0x817e81['updateResourceState'](_0x6c044);}}['_handleResourceSelection'](_0xc07181,_0x4b353e){this['fire']('addResourceToContext',{'source':_0xc07181,'resource':_0x4b353e});}}class Tr extends _0xfba0d2{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x5c18d9){const t=_0x5c18d9['t'],_0x312ecc={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x5c18d9,'AI_CHAT_SEARCH_RESOURCES')};super(_0x5c18d9,_0x312ecc['creator']),this['label']=_0x312ecc['label'],this['_viewConfig']=_0x312ecc,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x5c18d9,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x1176fb){this['fire']('search',_0x1176fb);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0xc034b(),this['iconView']['content']=_0x3c98bc,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x4fc718,t){this['resetButtonView']=new _0x1e9460(_0x4fc718),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x557804,'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',_0x5f3e96=>!_0x5f3e96),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 lc extends _0x184e76{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x472bc9,_0x3e648f){super(_0x472bc9),this['_source']=_0x3e648f['source'],this['_searchInputVisibleFrom']=_0x3e648f['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 _0x4e90c7([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Tr(this['locale']);}['_createSearchSection'](){const _0x3be76d=new _0x184e76(this['locale']);return _0x3be76d['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x3f1164,_0x1028c5)=>{this['loadResources'](_0x1028c5),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x1028c5);}),_0x3be76d;}['_createResourcesListView'](){const _0x456d61=new Lr(this['locale'],this['_source']);return _0x456d61['delegate']('addResourceToContext')['to'](this),_0x456d61['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x456d61;}['_createSkeletonView'](){const _0x4e197f=new ai(this['locale'],di['aiChatResources']);return _0x4e197f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x26d351=>!_0x26d351)]}}),_0x4e197f;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x34b1e3){const _0x3bb42a=_0x926b30();this['_latestLoadResourcesUid']=_0x3bb42a,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x34b1e3,'uid':_0x3bb42a}),this['isLoading']=!0x0;}['setResources'](_0x306eb6,_0x29ba56){if(_0x29ba56&&_0x29ba56!==this['_latestLoadResourcesUid'])return;const _0xd30681=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x306eb6,_0xd30681),_0x306eb6['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x50673f,_0x3ddf7a){this['_resourcesListView']['updateResourceState'](_0x50673f,_0x3ddf7a);}}const La='ck-ai-chat-context-controls__source-balloon-panel',Da='ck-button-icon\x20ck-button-back',Pa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Oo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x18fd10,_0x30f180,_0x475f67){this['_locale']=_0x18fd10,this['_bodyCollection']=_0x30f180,this['_config']=_0x475f67;}['showSourceResourcesBalloon']({source:_0x10ea40,withBackButton:_0x5e2a5c}){let _0x40a119=this['_sourceResourceBalloons']['get'](_0x10ea40['id']);_0x40a119||(_0x40a119=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x10ea40['id'],_0x40a119),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x40a119)),this['_addSourceResourceContent']({'balloonPanel':_0x40a119,'source':_0x10ea40,'withBackButton':_0x5e2a5c}),_0x40a119['show']();const _0x1ad19d=this['_config']['getTargetElement']();_0x1ad19d&&_0x40a119['pin']({'target':_0x1ad19d,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x29feb2,_0x543fd3,_0x25e4ee){const _0x2f30de=this['_sourceResourceBalloons']['get'](_0x29feb2);if(!_0x2f30de)return;const _0x25adbc=this['_getResourcesViewFromBalloon'](_0x2f30de);_0x25adbc&&(_0x25adbc['setResources'](_0x543fd3,_0x25e4ee),_0x25adbc['once']('change:isLoading',()=>{_0x2f30de['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x1e1af0){const _0xcf6335=this['_sourceResourceBalloons']['get'](_0x1e1af0);_0xcf6335&&requestAnimationFrame(()=>{_0xcf6335['hide'](),this['_sourceResourceBalloons']['delete'](_0x1e1af0),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x31b216 of this['_sourceResourceBalloons']['values']())if(_0x31b216['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x2935b5,_0xde6ea3,_0x8a79b7){const _0x267672=this['_sourceResourceBalloons']['get'](_0x2935b5);if(!_0x267672||!_0x267672['isVisible'])return;const _0x4e674a=this['_config']['getTargetElement']();if(!_0x4e674a)return;_0x267672['pin']({'target':_0x4e674a,'limiter':this['_config']['getLimiterElement']()});const _0x355420=this['_getResourcesViewFromBalloon'](_0x267672);_0x355420&&_0x355420['updateResourceState'](_0xde6ea3,_0x8a79b7);}['destroy'](){for(const _0x33a370 of this['_sourceResourceBalloons']['values']())_0x33a370['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x328782=new _0x2fff3d(this['_locale']);return _0x328782['extendTemplate']({'attributes':{'class':La}}),this['_bodyCollection']['add'](_0x328782),_0x328782;}['_addSourceResourceContent']({balloonPanel:_0x183c5a,source:_0x46f76c,withBackButton:_0x5ecd6a}){_0x183c5a['content']['clear']();const _0x4a0fcd=this['_createBalloonHeader']({'balloonPanel':_0x183c5a,'source':_0x46f76c,'withBackButton':_0x5ecd6a});_0x183c5a['content']['add'](_0x4a0fcd);const _0x530c39=this['_createBalloonResourcesView'](_0x46f76c);_0x183c5a['content']['add'](_0x530c39);}['_createBalloonHeader']({balloonPanel:_0x44efaf,source:_0x3ea449,withBackButton:_0x43ba7b}){const _0x3d3d5b=new _0x41e0a3(this['_locale'],{'label':_0x3ea449['label'],'class':Pa});return _0x43ba7b&&_0x3d3d5b['children']['add'](this['_createBackButton'](_0x44efaf),0x0),_0x3d3d5b;}['_createBackButton'](_0x1826ec){const _0x42713a=new _0x1e9460(this['_locale']);return _0x42713a['set']({'icon':_0x29f3c3,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Da}),_0x42713a['on']('execute',()=>{_0x1826ec['hide'](),this['_config']['onBackToContext']();}),_0x42713a;}['_createBalloonResourcesView'](_0x296d00){const _0x41fec9=new lc(this['_locale'],{'source':_0x296d00,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x41fec9['on']('loadSourceResources',(_0x2ad4ed,_0x271999)=>{this['_config']['onLoadSourceResources'](_0x271999);}),_0x41fec9['on']('addResourceToContext',(_0x3eb137,_0x22758f)=>{this['_config']['onResourceSelected'](_0x22758f['source'],_0x22758f['resource']),this['closeSourceResourceBalloon'](_0x296d00['id']);}),_0x41fec9;}['_getResourcesViewFromBalloon'](_0xcd9027){const _0x130bc5=_0xcd9027['content']['get'](0x1);return _0x130bc5 instanceof lc?_0x130bc5:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4e43df){_0x1ff4d5({'emitter':_0x4e43df,'contextElements':[_0x4e43df['element']],'callback':()=>{_0x4e43df['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4e43df['isVisible']});}}const xs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Uo='ck-ai-chat-context-controls',Lo='ck-ai-chat-context-controls__pending-contexts',No='ck-ai-chat-context-controls__add-context-balloon-panel',Mo='ck-ai-chat-context-controls__add-context-button',Ho='ck-ai-chat-context-controls__url-balloon-panel',jo='ck-ai-chat-context-controls__balloon-button',Fo='ck-ai-chat-context-controls__balloon-button-source',Xo='ck-ai-chat-controls-button',Do='ck-ai-chat-context-chips-wrapper-balloon',$o='ck-ai-chat-controls_context_show-more-button',Wo='ck-ai-chat-context-controls__show-more-balloon-panel',qo='ck-ai-chat',zo=[_0x2fff3d['defaultPositions']['northArrowSouthWest'],_0x2fff3d['defaultPositions']['northArrowSouth'],_0x2fff3d['defaultPositions']['northArrowSouthEast'],_0x2fff3d['defaultPositions']['southArrowNorthWest'],_0x2fff3d['defaultPositions']['southArrowNorth'],_0x2fff3d['defaultPositions']['southArrowNorthEast']];class Is extends _0x184e76{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x5878fa,_0x240c1a){super(_0x5878fa),this['bodyCollection']=_0x240c1a['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x5878fa),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x5878fa),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x5878fa),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x5878fa,_0x240c1a);const _0x5c9587={'cssClasses':{'showMoreButton':$o,'showMoreBalloon':Wo,'overflowContainer':Do,'controlsButton':Xo}};this['_overflowManager']=new Ro(_0x5878fa,this['_currentContextsChips'],_0x5c9587,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'](_0x2969db,_0x17b9c6){const _0x54332d=this['_createContextButton'](_0x2969db,'current',!0x0,_0x17b9c6);this['_addContextToCollection'](_0x54332d,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x12623e){this['_removeContextFromCollection'](_0x12623e,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x12623e,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x3f57ad,_0x5566c2){let _0x18e2d3=this['_currentContextsChips']['find'](_0x186e97=>_0x186e97['id']===_0x3f57ad);_0x18e2d3||(_0x18e2d3=this['_overflowManager']['overflowChips']['find'](_0x5d644a=>_0x5d644a['id']===_0x3f57ad)),_0x18e2d3&&(_0x18e2d3['isLoading']=_0x5566c2);}['setConversationContext'](_0x41fc46){this['_conversationContextsChips']['clear']();for(const _0x32736b of _0x41fc46){const _0x472959=this['_createContextButton'](_0x32736b,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x472959,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x475e8a,_0xdcaf1b,_0x79db5){this['_resourcesBalloonView']['updateResourceState'](_0x475e8a,_0xdcaf1b,_0x79db5);}['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']({source:_0x3be37c,withBackButton:_0x180df8}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x3be37c,'withBackButton':_0x180df8}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x34a9a2,_0x5867f7,_0x40b576,_0x1b4f71){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x34a9a2,_0x40b576,_0x1b4f71);}['closeSourceResourceBalloon'](_0x3bbf64){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x3bbf64),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x14a0bd){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x14a0bd),this['_setAddContextButtonEnabled'](_0x14a0bd);}['_setAddContextButtonEnabled'](_0x485e35){const _0x513d55=!_0x485e35['document']['isHidden']&&_0x485e35['document']['enabled'],_0x1cc0ec=_0x485e35['urls']['enabled'],_0x11121e=_0x485e35['files']['enabled'],_0x58f365=_0x485e35['sources']['length']>0x0,_0x5ad15a=_0x485e35['customItems']&&_0x485e35['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x513d55||_0x1cc0ec||_0x11121e||_0x58f365||_0x5ad15a;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Uo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x2c62d0){const _0x1534cb=new _0x1e9460(_0x2c62d0);return _0x1534cb['set']({'label':i(_0x2c62d0,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Xo+'\x20'+Mo,'icon':_0xb4fa02,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x1534cb;}['_createAddContextBalloonPanelView'](_0x1dd7fe){return this['_createBaseBalloonPanel'](_0x1dd7fe,No);}['_createUrlBalloonPanelView'](_0x24fc07){const _0x1fc7f6=this['_createBaseBalloonPanel'](_0x24fc07,Ho);return this['_addUrlContent'](_0x1fc7f6,_0x24fc07),_0x1fc7f6;}['_createResourcesBalloonView'](_0x825e3a,_0x188560){const _0xbbdc83={'searchInputVisibleFrom':_0x188560['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});},'onResourceSelected':(_0x34a0ea,_0x184ae7)=>{this['fire']('addResourceToContext',{'source':_0x34a0ea,'resource':_0x184ae7});},'onLoadSourceResources':_0x123954=>{this['fire']('loadSourceResources',_0x123954);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Oo(_0x825e3a,_0x188560['bodyCollection'],_0xbbdc83);}['_getLimiterElement'](){return this['element']?.['closest']('.'+qo)||document['body'];}['_createBaseBalloonPanel'](_0x42df8a,_0x25601e){const _0x397ea1=new _0x2fff3d(_0x42df8a);return _0x397ea1['extendTemplate']({'attributes':{'class':_0x25601e}}),this['bodyCollection']['add'](_0x397ea1),_0x397ea1;}['_setBalloonPanelContent'](_0x2a90a9,_0xa02067,_0x263b5c){if(_0x2a90a9['content']['clear'](),!_0x263b5c['document']['isHidden']&&_0x263b5c['document']['enabled']){const _0x3bd29b=this['_createBalloonButton'](_0xa02067,{'label':i(_0xa02067,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x35a5eb});_0x3bd29b['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x2a90a9['content']['add'](_0x3bd29b);}if(_0x263b5c['urls']['enabled']){const _0x5c7ec4=this['_createBalloonButton'](_0xa02067,{'label':i(_0xa02067,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0xb249a6});_0x5c7ec4['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_urlInputView']['focus']();}),_0x2a90a9['content']['add'](_0x5c7ec4);}if(_0x263b5c['files']['enabled']){const _0x5d05ca=new _0x254afa(_0xa02067);_0x5d05ca['set']({'label':i(_0xa02067,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x3baee4,'withText':!0x0,'tooltip':!0x0,'class':jo,'allowMultipleFiles':!0x0}),_0x5d05ca['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x5d05ca['on']('done',(_0x292d6f,_0x364b32)=>{this['fire']('addFileToContext',_0x364b32);}),_0x5d05ca['tooltip']=!0x0,_0x2a90a9['content']['add'](_0x5d05ca);}for(const _0x51e53b of _0x263b5c['sources']){const _0xa6f6e8=this['_createBalloonButton'](_0xa02067,{'label':_0x51e53b['label'],'icon':_0x51e53b['icon']||_0x56717c,'type':'source'});_0x2a90a9['content']['add'](_0xa6f6e8),_0xa6f6e8['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x51e53b,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x82c901 of _0x263b5c['customItems']||[]){const _0x37c467=this['_createBalloonButton'](_0xa02067,{'label':_0x82c901['label'],'icon':_0x82c901['icon']||_0x56717c,'type':'customItem'});_0x2a90a9['content']['add'](_0x37c467),_0x37c467['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x82c901);});}this['_hasExactlyOneSource']=0x1===_0x2a90a9['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x3cd31e,_0x831961){this['_urlInputView']=new Po(_0x831961),this['_urlInputView']['on']('submitUrl',(_0x279b7f,_0x37c1cb)=>{this['_handleUrlSubmit'](_0x37c1cb);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});}),_0x3cd31e['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x1de6de,_0x55b3e9){const _0x3f4b9c='source'===_0x55b3e9['type']?new Ha(_0x1de6de):new _0x1e9460(_0x1de6de);return _0x3f4b9c['set']({'label':_0x55b3e9['label'],'icon':_0x55b3e9['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':jo}),_0x3f4b9c;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x1ff4d5({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0xcbb74a){const _0x5c73c8=this['_addContextBalloonConfig'];_0x5c73c8['buttonView']['isOn']=_0xcbb74a,_0xcbb74a?_0x5c73c8['balloonView']['show']():_0x5c73c8['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x1f8146,buttonView:_0x509f28,hideMethod:_0x4acff8}=this['_addContextBalloonConfig'];_0x1ff4d5({'emitter':_0x1f8146,'contextElements':[_0x1f8146['element'],_0x509f28['element']],'callback':()=>{_0x4acff8();},'activator':()=>_0x509f28['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x34f944,_0x16fc24,_0x55b8a8=!0x1,_0x42074d=!0x1){const _0x2cd350='conversation'===_0x16fc24||!0x0===_0x34f944['isReadOnly'],_0xd2682c=new Vo(this['locale'],_0x34f944,_0x2cd350,_0x55b8a8,_0x42074d);return _0x2cd350||_0xd2682c['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0xd2682c['id']);}),_0xd2682c;}['_addContextToCollection'](_0x6f915,_0x44c5c2){_0x44c5c2['add'](_0x6f915,0x0);}['_removeContextFromCollection'](_0x471bb3,_0x3761d9){const _0x559faf=_0x3761d9['find'](_0x1f550a=>_0x1f550a['id']===_0x471bb3);_0x559faf&&_0x3761d9['remove'](_0x559faf);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x30b461){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x30b461);}}class Ha extends _0x1e9460{['arrowView'];constructor(_0xdb37f9){super(_0xdb37f9),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Fo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x18014e=new _0xc034b();return _0x18014e['content']=_0xd17942,_0x18014e['extendTemplate']({'attributes':{'class':Fo+'__arrow'}}),_0x18014e;}}class Cs extends _0x184e76{['_cancelButtonView'];['_loaderView'];constructor(_0x439ccb){super(_0x439ccb),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 _0x37c8bb=new _0x1e9460(this['locale']);return _0x37c8bb['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x2ff977}),_0x37c8bb['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x37c8bb;}['_createLoaderView'](){const _0x340bf3=new _0x184e76(this['locale']);return _0x340bf3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x340bf3;}}class pi extends _0x184e76{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x788989,_0x1ebc81){super(_0x788989),this['_contextPanelView']=this['_createContextPanelView'](_0x788989,{'bodyCollection':_0x1ebc81['bodyCollection'],'searchInputVisibleFrom':_0x1ebc81['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x788989),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x788989),this['_loaderView']=this['_createLoaderView'](_0x788989),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x788989),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'](...xs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x1c3a53=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x1c3a53['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x1c3a53['if']('isLoading','ck-hidden',_0x25631f=>_0x25631f||!this['isModelAvailable']),_0x1c3a53['if']('isModelAvailable','ck-hidden',_0x471026=>!_0x471026||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x1c3a53['if']('isLoading','ck-hidden',_0x5cc505=>!_0x5cc505)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x1c3a53['if']('isModelAvailable','ck-hidden',_0x5e8007=>_0x5e8007)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x1ff4d5({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x4884cf,_0x2f1da6){return new Is(_0x4884cf,_0x2f1da6);}['_createPromptInputView'](_0x12c71c){return new _s(_0x12c71c,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x6fe611){return new vs(_0x6fe611);}['_createLoaderView'](_0x2b3742){return new Cs(_0x2b3742);}['_createModelUnavailableMessageView'](_0x53a149){const _0x334675=new As(_0x53a149);return _0x334675['delegate']('startConversation')['to'](this),_0x334675;}['_handlePromptInputFocus'](_0x2b5a98,_0x4c9019,_0x4fb7b2){_0x4fb7b2?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1a1629,_0x25a5fe){this['_contextPanelView']['addContextItem'](_0x1a1629,_0x25a5fe);}['removeContextItem'](_0x516e52){this['_contextPanelView']['removeContextItem'](_0x516e52);}['setContextItemLoading'](_0x106fca,_0x27e425){this['_contextPanelView']['setContextItemLoading'](_0x106fca,_0x27e425);}['setIsUploadInProgress'](_0x45bf9c){this['_promptInputView']['setIsUploadInProgress'](_0x45bf9c);}['setConversationContext'](_0x1b3558){this['_contextPanelView']['setConversationContext'](_0x1b3558);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x4ec957,_0x55204f,_0x3f46d1){this['_contextPanelView']['updateResourceState'](_0x4ec957,_0x55204f,_0x3f46d1);}['setWebSearch'](_0x174d51){this['_promptCapabilitiesView']['setWebSearch'](_0x174d51);}['setReasoning'](_0x3e249e){this['_promptCapabilitiesView']['setReasoning'](_0x3e249e);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x451592){this['_contextPanelView']['setAddContextOptions'](_0x451592);}['setInputPlaceholder'](_0x1ff12f){this['_promptInputView']['setPlaceholderText'](_0x1ff12f);}['setModelList'](_0x5bba4a,_0x34a3bf){this['_promptCapabilitiesView']['setModelList'](_0x5bba4a,_0x34a3bf);}['setModel'](_0x21089c){_0x21089c?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x21089c)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x3905fa){this['_promptCapabilitiesView']['disableModelSelector'](_0x3905fa);}['populateSourceResourceBalloon'](_0xf4a6a4,_0x172874,_0x31fef1,_0x300144){this['_contextPanelView']['populateSourceResourceBalloon'](_0xf4a6a4,_0x172874,_0x31fef1,_0x300144);}['closeSourceResourceBalloon'](_0x4c078f){this['_contextPanelView']['closeSourceResourceBalloon'](_0x4c078f);}['focusPromptInput'](_0x56db08=!0x1){this['_promptInputView']['focus'](_0x56db08);}['setPromptInputValue'](_0x435466){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x435466;}}class As extends _0x184e76{constructor(_0x3738d6){super(_0x3738d6);const _0xa27430=new _0x1e9460(_0x3738d6);_0xa27430['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0xa27430['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0xa27430]}]});}}class wi extends _0x41e0a3{['conversationStartButton'];['resizeButton'];constructor(_0xe299ef,_0x491a97){super(_0xe299ef,{'label':i(_0xe299ef,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':vt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0xe299ef),this['children']['add'](this['conversationStartButton']),_0x491a97&&(this['resizeButton']=Hs(_0xe299ef,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0xf7d6b5){const _0x3488a4=new _0x1e9460(_0xf7d6b5);return _0x3488a4['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x40fce4,'class':'ck-ai-chat__start-conversation'}),_0x3488a4['on']('execute',()=>{this['fire']('startConversation');}),_0x3488a4;}}class fi extends _0x184e76{constructor(_0x417a89){super(_0x417a89),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x417a89,'AI_DISCLAIMER_TEXT')}]}]});}}class Pt extends _0x184e76{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0xa80c3e,_0xe1afe7){super(_0xa80c3e),this['_bodyCollection']=new _0x591ff4(_0xa80c3e),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new wi(_0xa80c3e,_0xe1afe7['showResizeButton']),this['chatHeader']['delegate'](...bt)['to'](this),this['chatFeed']=new ui(_0xa80c3e,this['_bodyCollection']),this['chatFeed']['delegate'](...bt)['to'](this),this['chatControls']=new pi(_0xa80c3e,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0xe1afe7['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...bt)['to'](this),this['chatDisclaimer']=new fi(_0xa80c3e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0xa80c3e['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x3db714,_0x183f9f,_0x48cb24,_0x3cd3e9){this['chatControls']['populateSourceResourceBalloon'](_0x3db714,_0x183f9f,_0x48cb24,_0x3cd3e9);}['closeSourceResourceBalloon'](_0x4f50c7){this['chatControls']['closeSourceResourceBalloon'](_0x4f50c7);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ct extends _0x575928{static get['requires'](){return[pt];}['_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(_0x19d943){super(_0x19d943);const _0x4a0042=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new z(),this['_view']=new Pt(this['context']['locale'],{'showResizeButton':_0x4a0042['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...bt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0xfe8430,{showDiff:_0x10c10c})=>{this['showDiff']=_0x10c10c;}),_0x4a0042['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':vt,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x5d0fce=>_0x5d0fce),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x4d6818=>_0x4d6818),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x39d755){const _0x217960=this['context']['config']['get']('ai.chat.welcomeMessage')??i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x39d755['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x217960}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x319bc4,staticMessage:_0x2c315e}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x319bc4,'initialContent':'<p>'+_0x2c315e+'</p>'});}['addFeedItemUserMessage'](_0x2f4121){const _0x4e6563=_0x2f4121['attributes']?.['displayedPrompt']||_0x2f4121['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x2f4121['contextItems']['values']()),'initialContent':'<p>'+_0x4e6563+'</p>','id':_0x2f4121['id']});}['addFeedItemError']({errorMessage:_0x123f97,id:_0x10b43e}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x123f97+'</p>','id':_0x10b43e});}['addFeedItemAIReply'](_0x58ced5){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x58ced5['interactionId']+':'+_0x58ced5['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x5c3141){const _0x144391=T(this['context']);let _0x492cfb=_0x144391['config']['get']('ai.availableReplyActions')||[...ot];if(_0x144391['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x1d217b=_0x144391['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x1d217b,'value');}}else _0x492cfb=_0x492cfb['filter'](_0x3256d0=>'insertSuggestion'!=_0x3256d0);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x5c3141['interactionId']+':'+_0x5c3141['id'],'areActionsDisabled':_0x5c3141['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x492cfb}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x126b38,_0x5ae5e6){const _0x209d55=this['_view']['chatFeed']['children']['last'];if(_0x209d55 instanceof Mt)return this['_view']['chatFeed']['children']['remove'](_0x209d55),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x126b38['id'],'capabilities':{'isWebSearchEnabled':_0x209d55['capabilities']['isWebSearchEnabled']||_0x5ae5e6['isWebSearchEnabled'],'isReasoningEnabled':_0x209d55['capabilities']['isReasoningEnabled']||_0x5ae5e6['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x126b38['id'],'capabilities':_0x5ae5e6});}async['addFeedItemCustomElement'](_0x1446e7,_0x28900e){let _0x5a1052;return await this['_promiseQueue']['enqueue'](async()=>{_0x5a1052=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x1446e7,'id':_0x28900e});}),_0x5a1052;}['removeFeedItem'](_0x56a19d){this['_view']['chatFeed']['removeItem'](_0x56a19d);}['hasFeedItem'](_0x56b70a){return this['_view']['chatFeed']['hasItem'](_0x56b70a);}['updateFeedInteractionHeader'](_0x1c6d11){const _0xb83df9=this['_view']['chatFeed']['children']['find'](_0x1f925f=>_0x1f925f['options']['id']==_0x1c6d11['id']&&_0x1f925f instanceof Mt);_0xb83df9&&_0xb83df9['set']('isVisible',_0x1c6d11['isVisible']);}async['updateFeedItemAIReplyContent'](_0x4ec748){const _0x4b1642=_0x4ec748['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x18c824=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x4ec748,'abortSignal':_0x18c824,'renderingStrategy':_0x4b1642}),_0x4ec748['isDone']&&this['markFeedItemAsDone'](_0x4ec748['id']);});}['updateFeedItemAIReplySources'](_0x5e75c5,_0x386414){this['_view']['chatFeed']['updateWebSources'](_0x5e75c5,_0x386414);}async['updateFeedItemAIReplySuggestionContent'](_0xb74311){const _0x34d358=_0xb74311['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5e71db=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0xb74311,'abortSignal':_0x5e71db,'renderingStrategy':_0x34d358}),_0xb74311['isDone']&&this['markFeedItemAsDone'](_0xb74311['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x13e558){this['_view']['chatFeed']['updateSuggestionPartState'](_0x13e558);}['setFeedItemAIReplySuggestionPartActive'](_0x1bb3cc){this['_view']['chatFeed']['setSuggestionPartActive'](_0x1bb3cc);}['markFeedItemAsDone'](_0x40f1e8){this['_view']['chatFeed']['markItemAsDone'](_0x40f1e8);}['removeFeedInteraction'](_0x2439c7){this['_view']['chatFeed']['getItemIds']()['filter'](_0x9c412c=>_0x9c412c['startsWith'](_0x2439c7))['forEach'](_0x53cfa4=>this['_view']['chatFeed']['removeItem'](_0x53cfa4));}['startInteraction'](){const _0x4d38db=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x4d38db),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x42a564){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x1392c9=>_0x1392c9['startsWith'](_0x42a564['id']))['forEach'](_0x1f831f=>this['markFeedItemAsDone'](_0x1f831f)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x2a20f1,_0x4d4492){this['_view']['chatControls']['addContextItem'](_0x2a20f1,_0x4d4492);}['removeContextItem'](_0xf32072){this['_view']['chatControls']['removeContextItem'](_0xf32072);}['setContextItemLoading'](_0x4d2ad7,_0x392d4d){this['_view']['chatControls']['setContextItemLoading'](_0x4d2ad7,_0x392d4d);}['setIsUploadInProgress'](_0x327a22){this['_view']['chatControls']['setIsUploadInProgress'](_0x327a22);}['setConversationContext'](_0x57c53e){this['_view']['chatControls']['setConversationContext'](_0x57c53e);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x35eac6,_0x13a58d,_0x57a9ac){this['_view']['chatControls']['updateResourceState'](_0x35eac6,_0x13a58d,_0x57a9ac);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x86e8ea){this['_view']['chatControls']['setAddContextOptions'](_0x86e8ea);}['updateCapabilities'](_0xf0894e){this['_view']['chatControls']['setWebSearch'](_0xf0894e['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0xf0894e['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0xf0894e));}['setSelectedModel'](_0x56981c,_0x3ca4f4){this['_view']['chatControls']['setModel'](_0x56981c),_0x3ca4f4&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x36f0f5){this['feedItemRenderingStrategy']=_0x36f0f5;}['toggleLoadingSkeleton'](_0x2a333a){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x2a333a);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2004cd,_0x554302=!0x1){if(_0x554302&&!Rt()&&_0x2004cd['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2004cd);this['_view']['chatHeader']['label']=_0x2004cd;}['setLoadingMessage'](_0x53ceec){this['_view']['chatFeed']['setLoadingMessage'](_0x53ceec);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x54c261){let _0x4bb24f=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x54c261[_0x4bb24f],_0x4bb24f++,_0x4bb24f===_0x54c261['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x5606a0){this['_view']['chatHeader']['isMaximized']=_0x5606a0;}['prepareLoadingMessage'](_0x9e9638){return _0x9e9638['isWebSearchEnabled']&&_0x9e9638['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x9e9638['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x9e9638['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x2faed8){return _0x2faed8?_0x2faed8['isWebSearchEnabled']&&_0x2faed8['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x2faed8['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x2faed8['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x261493,_0x24689f,_0x298fc8,_0x374417){this['_view']['populateSourceResourceBalloon'](_0x261493,_0x24689f,_0x298fc8,_0x374417);}['closeSourceResourceBalloon'](_0x30a3b7){this['_view']['closeSourceResourceBalloon'](_0x30a3b7);}['setPromptInputValue'](_0x306d0e){this['_view']['chatControls']['setPromptInputValue'](_0x306d0e);}['focusPromptInput'](_0x2399c7=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x2399c7);}['scrollFeedToSuggestion'](_0x324bfc,_0x543c02){this['_view']['chatFeed']['scrollToSuggestion'](_0x324bfc,_0x543c02);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class yi extends _0x35cdc6{['sections'];constructor(_0x360f04,_0x2972f3){super(_0x360f04),this['sections']=_0x2972f3,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x1a2d59){let _0x18088f=0x0,_0x9d5f9=0x0;for(const _0x1b0d1d of this['sections']){const {resultsCount:_0x2921cd,totalItemsCount:_0x30b911}=_0x1b0d1d['filter'](_0x1a2d59);_0x18088f+=_0x2921cd,_0x9d5f9+=_0x30b911;}return{'resultsCount':_0x18088f,'totalItemsCount':_0x9d5f9};}}class Ei extends _0x4ffa3a{['title'];['itemsViews'];['_itemsListView'];constructor(_0x1d5a30,{title:_0xbf70e0,items:_0x10e1db}){super(_0x1d5a30);const _0x17f644=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0xbf70e0,this['itemsViews']=_0x10e1db;const _0x352e63=new _0x184e76(_0x1d5a30);_0x352e63['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x35cdc6(_0x1d5a30),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x17f644['if']('isVisible','ck-hidden',_0x5d39bb=>!_0x5d39bb)]},'children':[_0x352e63,this['_itemsListView']]});}['filter'](_0x59e9ee){const _0x1c5e91=this['itemsViews']['length'];let _0x5e31e5=0x0;for(const _0x53b8e1 of this['itemsViews']){if(_0x59e9ee){const _0x53579d=_0x53b8e1['isMatching'](_0x59e9ee);_0x53b8e1['isVisible']=!!_0x53579d,_0x53b8e1['highlightText'](_0x59e9ee);}else _0x53b8e1['isVisible']=!0x0,_0x53b8e1['highlightText'](null);_0x53b8e1['isVisible']&&_0x5e31e5++;}return this['isVisible']=_0x5e31e5>0x0,{'resultsCount':_0x5e31e5,'totalItemsCount':_0x1c5e91};}['getItem'](_0x237741){return this['itemsViews']['find'](_0x1c398f=>_0x1c398f['id']===_0x237741);}['removeItem'](_0x1b26db){const _0x316975=this['itemsViews']['indexOf'](_0x1b26db);-0x1!==_0x316975&&(this['itemsViews']['splice'](_0x316975,0x1),this['_itemsListView']['items']['remove'](_0x1b26db));}}class Ri extends/* #__PURE__ -- @preserve */
27
+ _0x3bd6ad(_0x4ffa3a){['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(_0x23ba56,_0x4923af){super(_0x23ba56);const _0x411653=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x4923af['pinned']),this['set']('loadingState',null),this['id']=_0x4923af['id'];const {title:_0x36194f,createdAt:_0x30df1e,active:_0x6ffd8a=!0x1}=_0x4923af;this['_titleView']=new _0x56f45c(),this['_titleView']['text']=_0x36194f,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x1baed8=this['_createCheckView'](),_0x584a21=this['_createPinButtonView'](_0x23ba56),_0x1b8a34=this['_createMenuDropdownView'](),_0x58b805=this['_createEditInputView'](_0x23ba56,_0x36194f),_0x3ff29d=this['_createAcceptEditButtonView'](_0x23ba56,_0x58b805),_0x3cee98=this['_createCancelEditButtonView'](_0x23ba56,_0x58b805);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x584a21),this['actions']['add'](_0x1b8a34),this['on']('change:isEdit',(_0xd65919,_0x4533b1,_0x50d9ee)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x50d9ee?(this['actions']['add'](_0x3ff29d),this['actions']['add'](_0x3cee98),this['mainContent']['add'](_0x58b805),_0x58b805['element']['focus']()):(this['actions']['add'](_0x584a21),this['actions']['add'](_0x1b8a34),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x6ffd8a?'ck-ai-chat-history__item--active':'',_0x411653['if']('isVisible','ck-hidden',_0x33feaa=>!_0x33feaa),_0x411653['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',_0x411653['if']('loadingState','ck-hidden',_0xee1ea=>!!_0xee1ea)]},'children':_0x6ffd8a?[_0x1baed8]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x411653['if']('loadingState','ck-hidden',_0x43af48=>!_0x43af48)]},'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',_0x411653['if']('loadingState','ck-hidden',_0x1b61d4=>!!_0x1b61d4)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x411653['if']('loadingState','ck-hidden',_0x1fd402=>!_0x1fd402)]},'children':[{'text':_0x411653['to']('loadingState',_0x360bf9=>_0x360bf9?i(this['locale'],Ri['LOADING_LABELS'][_0x360bf9]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x30df1e]}]},{'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'](_0x1d4801){this['_titleView']['text']=_0xac888d(_0x1d4801);}['updateLoadingState'](_0x1c87ed,_0x9de900){this['set']('loadingState',_0x9de900?_0x1c87ed:null);}['_createCheckView'](){const _0x6d040e=new _0xc034b();return _0x6d040e['set']({'content':_0x34e643}),_0x6d040e;}['_createPinButtonView'](_0x21dbda){const _0x21d118=new _0x1e9460(_0x21dbda);return _0x21d118['set']({'label':i(_0x21dbda,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x9d14c3,'withText':!0x1,'tooltip':!0x0}),_0x21d118['bind']('isOn')['to'](this,'pinned'),_0x21d118['on']('execute',()=>{const _0x4babec=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x4babec});}),_0x21d118;}['_createMenuDropdownView'](){const _0x15824f=_0x546896(this['locale'],_0x4e06b6),_0x24b7a6=_0x15824f['panelView']['children'];_0x15824f['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0xe97e9}),_0x15824f['panelPosition']='sw';const _0x3d0c1f=new _0x1e9460(this['locale']);_0x3d0c1f['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x3d0c1f['withText']=!0x0,_0x3d0c1f['on']('execute',()=>{this['isEdit']=!0x0;});const _0x1eb68b=new _0x1e9460(this['locale']);_0x1eb68b['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x1eb68b['withText']=!0x0,_0x1eb68b['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x578919=new _0x35cdc6(this['locale']),_0x4f876a=new _0x4ffa3a(this['locale']);_0x4f876a['children']['add'](_0x3d0c1f);const _0x5594c2=new _0x4ffa3a(this['locale']);return _0x5594c2['children']['add'](_0x1eb68b),_0x578919['items']['addMany']([_0x4f876a,_0x5594c2]),_0x24b7a6['add'](_0x578919),_0x15824f;}['_createEditInputView'](_0x18b6d5,_0x1fd5d8){const _0x4d02e9=new _0x9c7843(_0x18b6d5),_0x5e4607=_0x4d02e9['bindTemplate'];return _0x4d02e9['value']=_0x1fd5d8,_0x4d02e9['extendTemplate']({'on':{'keydown':_0x5e4607['to'](_0x3f2310=>{'Enter'==_0x3f2310['key']&&this['_commitEditInputValue'](_0x4d02e9);})}}),_0x4d02e9;}['_createAcceptEditButtonView'](_0x417f4e,_0x50eae5){const _0x411452=new _0x1e9460(_0x417f4e);return _0x411452['set']({'icon':_0x34e643,'withText':!0x1,'tooltip':i(_0x417f4e,'AI_CHAT_HISTORY_ACCEPT')}),_0x411452['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x411452['on']('execute',()=>{this['_commitEditInputValue'](_0x50eae5);}),_0x411452;}['_commitEditInputValue'](_0x57fd58){const _0x26cb86=_0x57fd58['element']['value']||'';this['_titleView']['text']=_0x26cb86,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x26cb86});}['_createCancelEditButtonView'](_0x3aa2b8,_0xff1d77){const _0x3fe7b3=new _0x1e9460(_0x3aa2b8);return _0x3fe7b3['set']({'icon':_0x557804,'withText':!0x1,'tooltip':i(_0x3aa2b8,'AI_CHAT_HISTORY_CANCEL')}),_0x3fe7b3['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x3fe7b3['on']('execute',()=>{this['isEdit']=!0x1,_0xff1d77['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x3fe7b3;}['_createSpinnerView'](){const _0x29edd8=new li('tiny');return _0x29edd8['isVisible']=!0x0,_0x29edd8;}['isMatching'](_0x1002aa){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x1002aa)?{'title':!0x0}:null;}['highlightText'](_0x9e6767){this['_titleView']['highlightText'](_0x9e6767);}}class wt extends _0x184e76{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x13b522,_0x4ca0ff){super(_0x13b522),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x195227=new _0x41e0a3(_0x13b522,{'label':i(_0x13b522,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x4ca0ff&&(this['resizeButton']=Hs(_0x13b522,this),_0x195227['children']['add'](this['resizeButton'])),this['sectionsView']=new yi(_0x13b522,[]),this['sectionsView']['delegate'](...Mi)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x11ad43=>!_0x11ad43)]}}),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':[_0x195227,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x3071a2=new _0x46980e(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x492b2f=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x492b2f),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x143253=this['_createErrorView']();return _0x143253['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x3dcf8f=>!_0x3dcf8f)]}}),_0x3071a2['on']('render',()=>{_0x3071a2['children']['add'](_0x143253,0x1);}),_0x3071a2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x9a6e3=>!_0x9a6e3)]}}),_0x3071a2;}['_createSkeletonView'](){const _0xeda145=new ai(this['locale'],di['aiHistory']);return _0xeda145['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xcc1193=>!_0xcc1193)]}}),_0xeda145;}['_createErrorView'](){const _0x2724f4=new _0x184e76(this['locale']),_0x295d4d=new _0x1e9460(this['locale']);_0x295d4d['set']({'withText':!0x1,'icon':_0x557804,'class':'ck-ai-notification_error__dismiss-button'}),_0x295d4d['bind']('isVisible')['to'](this,'hasItems',_0x18a4b3=>!!_0x18a4b3),_0x295d4d['on']('execute',()=>{this['errorMessage']='';});const _0x966b52=this['bindTemplate'];return _0x2724f4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x966b52['to']('errorMessage')}]},_0x295d4d]}),_0x2724f4;}['_createEmptyStateView'](){const _0x31c955=new _0x1e9460(this['locale']);_0x31c955['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x40fce4,'class':'ck-ai-chat__start-conversation'}),_0x31c955['on']('execute',()=>{this['fire']('openChat');});const _0x75af45=new _0x184e76(this['locale']);return _0x75af45['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x487426=>!_0x487426)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x31c955]}),_0x75af45;}['_createListItemViews'](_0x487672,_0x252606){const _0x4df950=[];for(const _0x2f717f of _0x487672){const _0x191a74=new Ri(_0x252606,_0x2f717f);_0x191a74['delegate'](...Mi)['to'](this),_0x4df950['push'](_0x191a74);}return _0x4df950;}['updateHistoryItemsWithCategories'](_0x30c0a9){const _0x3fd901=this['locale']||'en',_0x9e4c26=[];for(const _0x111aee of _0x30c0a9){const _0x595958=this['_createListItemViews'](_0x111aee['items'],_0x3fd901);_0x9e4c26['push'](new Ei(_0x3fd901,{'title':_0x111aee['title'],'items':_0x595958}));}this['sectionsView']['sections']=_0x9e4c26,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x9e4c26),this['hasItems']=_0x30c0a9['some'](_0x5f15c3=>_0x5f15c3['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x429735){for(const _0x5c399e of this['sectionsView']['sections']){const _0x5f55b1=_0x5c399e['getItem'](_0x429735);if(_0x5f55b1){if(_0x5c399e['removeItem'](_0x5f55b1),0x0===_0x5c399e['itemsViews']['length']){const _0x707a25=this['sectionsView']['sections']['indexOf'](_0x5c399e);-0x1!==_0x707a25&&(this['sectionsView']['sections']['splice'](_0x707a25,0x1),this['sectionsView']['items']['remove'](_0x5c399e));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0xfbbd0c,_0x58d57d){for(const _0x16d9db of this['sectionsView']['sections']){const _0x271b1e=_0x16d9db['getItem'](_0xfbbd0c);if(_0x271b1e){_0x271b1e['updateTitle'](_0x58d57d);break;}}}['updateItemLoadingState'](_0x361fc3,_0x3bc5c9,_0x569b2d){for(const _0x260074 of this['sectionsView']['sections']){const _0x100a9c=_0x260074['getItem'](_0x361fc3);if(_0x100a9c){_0x100a9c['updateLoadingState'](_0x3bc5c9,_0x569b2d);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x58d736=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x58d736);}}}const Mi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x575928{static get['requires'](){return[pt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3094e1){super(_0x3094e1);const _0x4cb16d=this['context']['plugins']['get']('AITabs');this['_historyView']=new wt(this['context']['locale'],_0x4cb16d['showResizeButton']),this['_historyView']['delegate'](...Mi)['to'](this),_0x4cb16d['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x352d6b){this['_historyView']['removeHistoryItem'](_0x352d6b);}['updateItems'](_0x5b885b){this['_historyView']['updateHistoryItemsWithCategories'](_0x5b885b);}['updateItemTitle'](_0x240061,_0x1b826e){this['_historyView']['updateItemTitle'](_0x240061,_0x1b826e);}['updateItemLoadingState'](_0x52db59,_0x3ff57e,_0x398a90){this['_historyView']['updateItemLoadingState'](_0x52db59,_0x3ff57e,_0x398a90);}['setLoadingSkeleton'](_0x5b3324){this['_historyView']['isLoading']=_0x5b3324;}['showError'](_0x170b1b){this['_historyView']['errorMessage']=_0x170b1b;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x126a4d){this['_historyView']['isMaximized']=_0x126a4d;}}class nr extends ts(){['id'];['createdAt'];constructor({id:_0x3d4fc3,title:_0x34b4cc,createdAt:_0x164d62,updatedAt:_0x50ec13,pinned:_0x3aa65c}){super(),this['id']=_0x3d4fc3,this['createdAt']=new Date(_0x164d62),this['set']('title',_0x34b4cc),this['set']('updatedAt',_0x50ec13?new Date(_0x50ec13):null),this['set']('pinned',_0x3aa65c||!0x1);}['updateTitle'](_0x38cfef){this['set']('title',_0xac888d(_0x38cfef)),this['updatedAt']=new Date();}['updatePinned'](_0x836d3a){this['set']('pinned',_0x836d3a),this['updatedAt']=new Date();}}class Ht extends _0x290e58(){['items']=[];['connector'];['group'];constructor({connector:_0x116c47,group:_0x4c32a0}){super(),this['connector']=_0x116c47,this['group']=_0x4c32a0;}async['init'](){try{const _0xac5f7a=this['connector']['fetchConversations'](this['group']),_0x147d65=await _0xac5f7a['getConversations']();this['loadItems'](_0x147d65);}catch(_0x2071ea){this['fire']('error',{'error':_0x2071ea,'operation':'init'});}}['addItem'](_0x527c7d){this['items']['push'](_0x527c7d);}async['removeItem'](_0x22fb85){const _0x551150=this['items']['findIndex'](_0x3b5e52=>_0x3b5e52['id']===_0x22fb85);if(-0x1===_0x551150)return!0x1;try{return await this['connector']['deleteConversation'](_0x22fb85)['execute'](),this['items']['splice'](_0x551150,0x1),this['fire']('itemRemoved',{'itemId':_0x22fb85}),!0x0;}catch(_0x4ebb9b){return this['fire']('error',{'error':_0x4ebb9b,'operation':'removeItem','itemId':_0x22fb85}),!0x1;}}['getItem'](_0x4ec079){return this['items']['find'](_0x5846b4=>_0x5846b4['id']===_0x4ec079);}async['updateItemTitle'](_0x4ceb60,_0xb3ffa7){const _0x34ff79=this['getItem'](_0x4ceb60);if(!_0x34ff79)return!0x1;try{return await this['connector']['updateConversation'](_0x4ceb60,{'title':_0xb3ffa7})['getResult'](),_0x34ff79['updateTitle'](_0xb3ffa7),this['fire']('itemUpdated',{'itemId':_0x4ceb60,'updates':{'title':_0xb3ffa7}}),!0x0;}catch(_0x54d63b){return this['fire']('error',{'error':_0x54d63b,'operation':'updateItemTitle','itemId':_0x4ceb60}),!0x1;}}async['updateItemPinned'](_0x31154e,_0x802ed5){const _0x53fd73=this['getItem'](_0x31154e);if(!_0x53fd73)return!0x1;try{return await this['connector']['updateConversation'](_0x31154e,{'pinned':_0x802ed5})['getResult'](),_0x53fd73['updatePinned'](_0x802ed5),this['fire']('itemUpdated',{'itemId':_0x31154e,'updates':{'pinned':_0x802ed5}}),!0x0;}catch(_0x32a805){return this['fire']('error',{'error':_0x32a805,'operation':'updateItemPinned','itemId':_0x31154e}),!0x1;}}['loadItems'](_0x2f2943){try{this['items']=[],_0x2f2943['map'](_0x2efdae=>{this['addItem'](new nr(_0x2efdae));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x188216){this['fire']('error',{'error':_0x188216,'operation':'loadItems'});}}['getItems'](_0x1a9fe7={}){const _0x4a6d88=void 0x0!==_0x1a9fe7['pinned']&&_0x1a9fe7['pinned'],_0x245279=_0x1a9fe7['from']?new Date(_0x1a9fe7['from']['getFullYear'](),_0x1a9fe7['from']['getMonth'](),_0x1a9fe7['from']['getDate']()):null,_0x142369=_0x1a9fe7['to']?new Date(_0x1a9fe7['to']['getFullYear'](),_0x1a9fe7['to']['getMonth'](),_0x1a9fe7['to']['getDate']()):null;return this['items']['filter'](_0x534c9d=>{if(_0x534c9d['pinned']!==_0x4a6d88)return!0x1;if(_0x142369){const _0x4ab799=new Date(_0x534c9d['createdAt']['getFullYear'](),_0x534c9d['createdAt']['getMonth'](),_0x534c9d['createdAt']['getDate']());return _0x245279?_0x245279['getTime']()===_0x142369['getTime']()?_0x4ab799['getTime']()===_0x245279['getTime']():_0x4ab799<_0x142369&&_0x4ab799>=_0x245279:_0x4ab799<_0x142369;}return!0x0;});}}class jt extends _0x575928{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[q,at,xt,pt];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](q),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](at);const _0x581d9c=this['context']['plugins']['get'](pt);try{const _0x29ddd6=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0x29ddd6}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x320116,_0x4dbc45)=>{this['_setItemLoading'](_0x4dbc45['id'],'remove'),this['_handleRemove'](_0x4dbc45['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3122da,_0x885ddb)=>{this['_setItemLoading'](_0x885ddb['id'],'rename'),this['_handleEditTitle'](_0x885ddb['id'],_0x885ddb['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x24bf34,_0x20b146)=>{void 0x0!==_0x20b146['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x20b146['itemId'],_0x20b146['updates']['title']),void 0x0!==_0x20b146['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x20b146['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x452aec,_0x1e3956)=>{this['_aiChatController']['handleRemovedConversation'](_0x1e3956['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x1e3956['itemId']),this['_clearItemLoading'](_0x1e3956['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x785663,_0x81dafb)=>{this['_handleHistoryErrorUI'](_0x81dafb['error'],_0x81dafb['operation'],_0x81dafb['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x8513c6,_0x2db7ad)=>{this['_handleSelectConversation'](_0x2db7ad['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x5310b6,_0x2b776c)=>{const _0x3dad5e=_0x2b776c['pinned']?'pin':'unpin';this['_setItemLoading'](_0x2b776c['id'],_0x3dad5e),this['_handleTogglePin'](_0x2b776c['id'],_0x2b776c['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x581d9c['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x581d9c['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x581d9c,'resizedTabs',(_0x215db3,_0x3f095a)=>{this['_setIsMaximized'](_0x3f095a);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x581d9c['resize']();});}catch(_0x2cff8e){this['_handleHistoryErrorUI'](_0x2cff8e,'init');}}async['_handleEditTitle'](_0x814e43,_0x167a8b){await this['history']['updateItemTitle'](_0x814e43,_0x167a8b);}async['_handleTogglePin'](_0x25bb6f,_0x2398c4){await this['history']['updateItemPinned'](_0x25bb6f,_0x2398c4);}async['_handleRemove'](_0x5a3ecf){await this['history']['removeItem'](_0x5a3ecf);}async['_handleSelectConversation'](_0x14107f){await this['_aiChatController']['loadConversation'](_0x14107f);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x2041d6=this['_aiChatController']['activeConversation']?.['id'],_0x45d7bd=this['_getCategorizedItems']()['map'](_0x55c585=>({'title':_0x55c585['title'],'items':_0x55c585['items']['map'](_0x1191c7=>({'id':_0x1191c7['id'],'title':_0x1191c7['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x1191c7['createdAt'])['toLocaleDateString'](),'active':_0x1191c7['id']===_0x2041d6,'pinned':_0x1191c7['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x45d7bd);}['_setItemLoading'](_0x44da78,_0x16f1eb){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x44da78,_0x16f1eb,!0x0);}['_clearItemLoading'](_0x101003){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x101003,null,!0x1);}['_handleHistoryErrorUI'](_0x506d3b,_0x4dd622,_0x5edf5c){const _0x84d18e=this['_generateErrorMessage'](_0x4dd622,_0x5edf5c);this['_aiChatHistoryUi']['showError'](_0x84d18e),_0x5edf5c&&this['_clearItemLoading'](_0x5edf5c),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x46ae24,_0x29a85a){const _0xa7209c=_0x29a85a?this['history']['getItem'](_0x29a85a):null,_0x42bd29=_0xa7209c?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x46ae24){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x42bd29);case'updateItemPinned':{const _0x5bc125=i(this['context']['locale'],_0xa7209c?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x5bc125,_0x42bd29]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x42bd29);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x21fba2=new Date(),_0x3b664a=new Date(_0x21fba2['getFullYear'](),_0x21fba2['getMonth'](),_0x21fba2['getDate']()),_0x34cfc8=new Date(_0x3b664a);_0x34cfc8['setDate'](_0x34cfc8['getDate']()-0x1);const _0x5f3ebf=new Date(_0x3b664a);_0x5f3ebf['setDate'](_0x5f3ebf['getDate']()-0xe);const _0x2cae3a=this['history']['getItems']({'pinned':!0x0}),_0x554610=this['history']['getItems']({'from':_0x3b664a,'to':_0x3b664a}),_0xda5634=this['history']['getItems']({'from':_0x34cfc8,'to':_0x34cfc8}),_0xa4d173=this['history']['getItems']({'from':_0x5f3ebf,'to':_0x34cfc8}),_0x3d0fbe=this['history']['getItems']({'to':_0x5f3ebf}),_0x53b6d8=[];return _0x2cae3a['length']>0x0&&_0x53b6d8['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x2cae3a}),_0x554610['length']>0x0&&_0x53b6d8['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x554610}),_0xda5634['length']>0x0&&_0x53b6d8['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0xda5634}),_0xa4d173['length']>0x0&&_0x53b6d8['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0xa4d173}),_0x3d0fbe['length']>0x0&&_0x53b6d8['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x3d0fbe}),_0x53b6d8;}['_setIsMaximized'](_0x1e29b5){this['_aiChatHistoryUi']['setIsMaximized'](_0x1e29b5);}}class ht extends _0x575928{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ma extends _0x575928{static get['requires'](){return[at,D,ct,ht];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2e572b){super(_0x2e572b),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](at)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](at)['startConversation']();}async['sendMessage']({message:_0x3f9f62,attributes:_0x5a63bc}){await this['context']['plugins']['get'](at)['sendMessage']({'message':_0x3f9f62,'attributes':_0x5a63bc});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](at)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](at)['focusPromptInput']();}['registerToolDataCallback'](_0x113cbf){this['context']['plugins']['get'](at)['_registerToolDataCallback'](_0x113cbf);}}class fs extends _0x1e9460{['id'];constructor(_0xbc5e97,_0x354c3b){super(_0xbc5e97);const {id:_0x1bf158,type:_0x10801f,icon:_0x5aea5c}=_0x354c3b;this['id']=_0x1bf158,this['set']({'label':_0x354c3b['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x354c3b['id']}}),_0x5aea5c?this['icon']=_0x5aea5c:'chat'===_0x10801f?this['icon']=_0x2be426:'review'===_0x10801f?this['icon']=_0x560fa1:'translate'===_0x10801f&&(this['icon']=Vt);}}class kt extends _0x184e76{['listView'];constructor(_0x552970,_0x4883c4){super(_0x552970);const _0xf069ae=_0x4883c4['map'](_0x34a175=>{const _0x976cb8=new _0x4ffa3a(this['locale']),_0x4631f8=new fs(this['locale'],_0x34a175);return _0x976cb8['children']['add'](_0x4631f8),_0x4631f8['delegate']('execute')['to'](this),_0x976cb8;});this['listView']=new _0x35cdc6(this['locale']),this['listView']['items']['addMany'](_0xf069ae),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var Ua=function(_0x1c40e7){return _0x1c40e7['CHAT']='chat',_0x1c40e7['REVIEW']='review',_0x1c40e7['TRANSLATE']='translate',_0x1c40e7;}({});class Va extends _0x575928{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ct];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ct),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x256f24=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x256f24['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x256f24,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x39ea56=Object['values'](Ua);this['_shortcuts']['forEach'](_0x4c3b89=>{let _0x7c63d8=!0x0;if(_0x4c3b89['id']&&_0x4c3b89['label']&&_0x39ea56['includes'](_0x4c3b89['type'])?'chat'===_0x4c3b89['type']&&(_0x7c63d8='string'==typeof _0x4c3b89['prompt']):_0x7c63d8=!0x1,!_0x7c63d8)throw new _0x36ca17('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x4c3b89});});}['_injectShortcuts'](){const _0x1ddce6=this['context']['plugins']['get'](ct);this['_shortcutsView']=new kt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x1ddce6['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0x2a8e39=>{const _0x1963f2=_0x2a8e39['source']['id'];this['_executeShortcut'](_0x1963f2);});}['_removeShortcuts'](){const _0x513b32=this['context']['plugins']['get'](ct);_0x513b32['hasFeedItem'](Ut)&&_0x513b32['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x410e05){const _0x32431b=this['_shortcuts']['find'](_0x33e8b0=>_0x33e8b0['id']===_0x410e05),_0xb9d8d9=_0x32431b['type'];'chat'===_0xb9d8d9?this['_runChatShortcut'](_0x32431b):'review'===_0xb9d8d9?_0x32431b['check']?this['_runReviewShortcut'](_0x32431b):this['_switchTab']('reviewMode'):'translate'===_0xb9d8d9&&(_0x32431b['language']?this['_runTranslateShortcut'](_0x32431b):this['_switchTab']('translate'));}['_switchTab'](_0xf0c81f){if(!this['context']['plugins']['has']('AITabs'))throw new _0x36ca17('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0xf0c81f});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0xf0c81f);}async['_runChatShortcut']({prompt:_0x28adc5,draftMode:_0x1ccf6a,useWebSearch:_0x1a2b37=!0x1,useReasoning:_0x1a6ff=!0x1,model:_0xe9aca7}){const _0x2e837b=this['context']['plugins']['get']('AIChat'),_0x25bdd9=this['context']['plugins']['get']('AIChatController'),_0x56164a=_0x25bdd9['activeConversation'];let _0x3c044c;_0x3c044c=_0xe9aca7?await _0x56164a['chatModels']['getModel'](_0xe9aca7):await _0x56164a['chatModels']['getDefault'](),_0x3c044c&&await _0x56164a['setModel'](_0x3c044c),_0x56164a['setWebSearch'](_0x1a2b37),_0x56164a['setReasoning'](_0x1a6ff),_0x25bdd9['addCurrentDocumentToChatContext'](),_0x1ccf6a?(this['_aiChatUI']['setPromptInputValue'](_0x28adc5),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x2e837b['sendMessage']({'message':_0x28adc5});}['_runReviewShortcut']({check:_0xa4b8,model:_0x5077c6,prompt:_0x476566,params:_0x7672ec}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x36ca17('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x3387c8={'id':_0xa4b8,'isCustom':'custom'===_0xa4b8};_0x5077c6&&_0x476566&&(_0x3387c8['args']={'model':_0x5077c6,'prompt':_0x476566}),_0x7672ec&&(_0x3387c8['params']=_0x7672ec),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x3387c8);}['_runTranslateShortcut']({language:_0x2109ac}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x36ca17('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x2109ac,'args':{'language':_0x2109ac}});}}class io extends Lt{constructor(_0x448667){super(_0x448667);const _0x2178d7=_0x448667['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x2178d7,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x50fa35=this['editor']['plugins']['get']('AITabs')['view'];_0x50fa35['isVisible']=!_0x50fa35['isVisible'];}}class qt extends _0x511be8{static get['requires'](){return[pt];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x11f9cb=this['editor'];_0x11f9cb['commands']['add']('toggleAi',new io(_0x11f9cb)),_0x11f9cb['ui']['componentFactory']['add']('toggleAi',()=>{const _0x18d6df=this['_createAIUIButton'](_0x1e9460);return _0x18d6df['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x18d6df;}),_0x11f9cb['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x348153=this['_createAIUIButton'](_0x12221a);return _0x348153['set']({'role':'menuitemcheckbox'}),_0x348153;});}['_createAIUIButton'](_0x261873){const _0x11dd26=this['editor'],_0x47bc44=_0x11dd26['commands']['get']('toggleAi'),_0x127418=new _0x261873(_0x11dd26['locale']);return _0x127418['set']({'label':i(_0x11dd26['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x6818cf,'isToggleable':!0x0}),_0x127418['bind']('isEnabled')['to'](_0x47bc44),_0x127418['bind']('isOn')['to'](_0x47bc44,'value',_0x2a5b66=>!!_0x2a5b66),this['listenTo'](_0x127418,'execute',()=>{_0x47bc44['execute']();}),_0x127418;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ls extends _0x184e76{['_errorView'];constructor(_0x3837d5){super(_0x3837d5),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x36344d){this['showError'](_0x36344d);}['showError'](_0x191967){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x191967,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x5c8fd7=new _0x184e76(this['locale']),_0x464588=new _0x184e76(this['locale']);return _0x464588['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x5c8fd7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x2a3d53=>!_0x2a3d53)]},'children':[_0x464588]}),_0x5c8fd7;}}const $=0xa;class Q extends _0x575928{static get['requires'](){return[D];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x473b5f){const {id:_0x15052d}=this['_currentConfig']??{};this['_currentConfig']=_0x473b5f;const {id:_0x3c3e28}=this['_currentConfig'];this['isOpen']&&_0x15052d===_0x3c3e28?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x14fd8d=T(this['context'])['plugins']['get']('Dialog');_0x14fd8d['isOpen']&&this['_currentConfig']&&_0x14fd8d['id']===this['_currentConfig']['id']&&_0x14fd8d['hide']();}['_updateDialog'](){const _0x598ce7=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x19ec45,title:_0x19a030}=this['_currentConfig'];_0x598ce7['view']?.['headerView']&&(_0x598ce7['view']['headerView']['label']=_0x19a030,_0x598ce7['view']['headerView']['iconView']&&_0x19ec45&&(_0x598ce7['view']['headerView']['iconView']['content']=_0x19ec45)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x598ce7['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x2e3109){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x2e3109);}['_showDialog'](){const _0x2ed6ea=T(this['context'])['plugins']['get']('Dialog'),{id:_0x250a1c,title:_0x36e163,icon:_0x135165,class:_0x5c9f22,mainView:_0x45df9b}=this['_currentConfig'];_0x45df9b['delegate'](...F)['to'](this),_0x2ed6ea['show']({'title':_0x36e163,'icon':_0x135165,'hasCloseButton':!0x0,'id':_0x250a1c,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x5c9f22||''),'content':_0x45df9b,'onShow':_0x2a5c2c=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x1a540d=this['_getSelectionElements']();_0x1a540d&&_0x1a540d[0x0]&&_0x538b49({'target':_0x1a540d[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x2a5c2c['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x250a1c});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x250a1c}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x274f6b,_0x5df5be){if(!_0x5df5be)return null;const _0x190573=this['_getSelectionElements']();if(!_0x190573||0x0===_0x190573['length'])return{'left':Math['round'](_0x5df5be['left']+_0x5df5be['width']/0x2-_0x274f6b['width']/0x2),'top':Math['round'](_0x5df5be['top']+_0x5df5be['height']/0x2-_0x274f6b['height']/0x2)};const _0x1f5785=Math['round'](_0x5df5be['left']+_0x5df5be['width']/0x2-_0x274f6b['width']/0x2),_0x4903b9=_0x190573['map'](_0x399acc=>new _0x5b8f6e(_0x399acc)),_0x2a2d16=_0x274f6b['height'];return{'left':_0x1f5785,'top':this['_calculateOptimalTopPosition'](_0x4903b9,_0x2a2d16,_0x5df5be)};}['_calculateOptimalTopPosition'](_0x15d9d7,_0x2345c5,_0x14d761){const _0x3c9af6=new _0x5b8f6e(_0x28fe94['window']),_0x2c5d57=_0x15d9d7['map'](_0x51375c=>_0x51375c['getVisible']())['filter'](_0x265de0=>_0x265de0),_0x105687=_0x5b8f6e['getBoundingRect'](_0x2c5d57);if(!_0x105687)return Math['round'](_0x14d761['top']+_0x14d761['height']/0x2);const _0x40149b=_0x3c9af6['getIntersection'](_0x105687);if(!_0x40149b)return Math['round'](_0x14d761['top']+_0x14d761['height']/0x2);const _0x4362ed=_0x14d761['getVisible'](),_0x2fe1bc=_0x4362ed&&_0x105687['height']>_0x4362ed['height'],_0x4c5555=_0x40149b['top'],_0x2e0aa5=_0x40149b['bottom'];if(_0x2fe1bc){const _0x1ab7ef=(_0x4362ed||_0x3c9af6)['height']/0x2-_0x2345c5/0x2,_0x58a6ba=_0x4c5555-$-_0x14d761['top'],_0x25563e=_0x14d761['bottom']-_0x2e0aa5-$;return _0x58a6ba>=_0x2345c5?Math['max']($,_0x4c5555-_0x2345c5-$):_0x25563e>=_0x2345c5?_0x2e0aa5+$:Math['max']($,_0x1ab7ef);}const _0x5d0426=_0x4c5555-_0x2345c5,_0x3e6225=_0x14d761['bottom']-_0x2e0aa5-$,_0x2fd84b=_0x4c5555-$-_0x14d761['top'];let _0x28c270;if(_0x3e6225>=_0x2345c5)_0x28c270=_0x2e0aa5+$;else{if(_0x2fd84b>=_0x2345c5)_0x28c270=_0x5d0426-$;else _0x28c270=_0x4c5555+_0x105687['height']/0x2-_0x2345c5/0x2;}return _0x28c270;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x41deca=T(this['context']);this['listenTo'](_0x41deca['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x3871e0,data:{newRange:_0x1d33c3}}of _0x41deca['model']['document']['differ']['getChangedMarkers']())if(_0x3871e0['startsWith'](R+':')&&(_0x1d33c3&&(_0x1d33c3['start']['isEqual'](_0x1d33c3['end'])||'$graveyard'==_0x1d33c3['root']['rootName'])||null==_0x1d33c3)){const _0x702616=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x702616),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x1905e9=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x1905e9['model']['document']);}['_getSelectionElements'](){const _0x37bf5f=T(this['context']);return _0x450a79(_0x37bf5f['editing'],[..._0x37bf5f['model']['markers']['getMarkersGroup']('ai-selection'),..._0x37bf5f['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class us extends _0x178dcf{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x302e67,_0x155b1e={}){super(_0x302e67),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x155b1e};const _0x265bdb=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x265bdb?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x52d613){this['showChangesButton']['isEnabled']=_0x52d613;}['_setupRatingButtons'](){this['likeButton']=new _0x1e9460(this['locale']),this['likeButton']['set']({'icon':_0x16e3fe,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x1e9460(this['locale']),this['dislikeButton']['set']({'icon':_0x46fa26,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x1e9460(this['locale']),this['copyButton']['set']({'icon':_0xb692f9,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x5375c2=new _0xc034b();_0x5375c2['set']({'content':_0xa54ca6}),_0x5375c2['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'](_0x5375c2);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x1e9460(this['locale']),this['showChangesButton']['set']({'icon':_0x196b91,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':'ck-ai-button-tertiary'}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x52b7e0=>_0x52b7e0?_0x3d498c:_0x196b91),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class lt extends ls{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x1c15bb,_0xa9420d){super(_0x1c15bb);const _0x2a5f2b=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x22c832(),this['_keystrokes']=new _0x2b0c94(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x56c0d3({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0xa9420d,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new as(_0x1c15bb),this['_partToolbarView']=new cs(_0x1c15bb,_0xa9420d['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0xa9420d),this['_stateView']=new ws(_0x1c15bb),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new us(_0x1c15bb,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ms(_0x1c15bb,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x5c5511,_0xc27bc9,_0x2ec842,_0xa3b86d)=>{let _0x36a203,_0x50391f;'pending'===_0xa3b86d?(_0x36a203=this['_partToolbarView'],_0x50391f=this['_stateView']):(_0x36a203=this['_stateView'],_0x50391f=this['_partToolbarView']),this['_stateView']['setState'](_0x2ec842),_0x36a203['isVisible']=!0x1,_0x50391f['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x2a5f2b['to']('_state',_0x949a2e=>'ck-ai-chat-balloon-main_state_'+_0x949a2e)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0xa9420d);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x452858){_0x452858?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x452858);}['setState'](_0x4e6d74){this['_state']=_0x4e6d74;}['showError'](_0x36efb0){super['showError'](_0x36efb0),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x3dab58){super['showBlockingError'](_0x3dab58),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x5c599a){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x5c599a;}['togglePartToolbarEnabled'](_0x503ba3){this['_partToolbarView']['isEnabled']=_0x503ba3;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x1bafce,showSuggestButton:_0x390b1a}){_0x1bafce=_0x1bafce&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x390b1a=_0x390b1a&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x1bafce,'showSuggestButton':_0x390b1a});}['_createNextButtonView'](){const _0x1bf5c9=new _0x1e9460(this['locale']);return _0x1bf5c9['set']({'icon':_0x460c5d,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x1bf5c9['on']('execute',()=>{this['fire']('showNext');}),_0x1bf5c9;}['_createPreviousButtonView'](){const _0x15683f=new _0x1e9460(this['locale']);return _0x15683f['set']({'icon':_0x567c89,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x15683f['on']('execute',()=>{this['fire']('showPrevious');}),_0x15683f;}}class ms extends _0x184e76{constructor(_0x3e00cd,_0x3f40e0){super(_0x3e00cd),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x3f40e0});}}class Ot extends _0x511be8{static get['requires'](){return[_0x6460a2,Q];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x172119){super(_0x172119),this['set']('showDiff',!0x1);}['open'](_0x16ca4c){const _0x2f8d19=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2f8d19['plugins']['get']('AIBalloon')['open']({..._0x16ca4c,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x16ca4c['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x16ca4c['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x5097cd){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x5097cd);}['setState'](_0x1aca5c){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x1aca5c);}['_createChatBalloonView'](){const _0x5e0e58=this['editor'],_0x1dd160=_0x5e0e58['plugins']['get']('AIBalloon'),_0x393b79=_0x5e0e58['commands']['get']('trackChanges');let _0x37aca5=_0x5e0e58['config']['get']('ai.availableReplyActions')||[...ot];_0x5e0e58['plugins']['has']('TrackChanges')||(_0x37aca5=_0x37aca5['filter'](_0x39c9d2=>'insertSuggestion'!=_0x39c9d2));const _0x157cc8=new lt(_0x5e0e58['locale'],{'availableActions':_0x37aca5,'showApplyButton':!0x0,'showSuggestButton':!!_0x393b79});return _0x157cc8['bind']('showDiff')['to'](this),_0x157cc8['delegate'](...ut)['to'](this),_0x157cc8['delegate']('showPrevious','showNext')['to'](this),_0x1dd160['delegate']('dialogClosed')['to'](this),_0x157cc8['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x157cc8['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x157cc8['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x393b79&&_0x157cc8['bind']('isTrackChangesOn')['to'](_0x393b79,'value'),_0x157cc8['render'](),_0x157cc8;}['_toggleRotatorButtonsInDialogHeader'](_0x1f395a){const _0x3c2540=this['editor'],_0xf89631=_0x3c2540['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x1f395a),_0xf89631['has'](this['_chatBalloonView']['previousButtonView'])||(_0xf89631['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x3c2540['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0xf89631['remove'](this['_chatBalloonView']['previousButtonView']),_0xf89631['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ba extends _0x511be8{static get['requires'](){return[qt,Ot,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x3f10cd){const {editor:_0x118b37,action:_0x17a994,withText:_0x2feeaa=!0x1,withIcon:_0x2140e4=!0x0,isInDropdown:_0x47cf87=!0x0,shouldPreventFocus:_0x4c6db9=!0x1}=_0x3f10cd;return()=>{const _0x1aba0d=_0x118b37['locale'],_0x342459=new _0x1e9460(_0x1aba0d),_0x373d08=_0x342459['bindTemplate'];_0x47cf87&&_0x342459['extendTemplate']({'on':{'mouseenter':_0x373d08['to'](()=>{_0x4c6db9&&_0x4c6db9()||_0x342459['focus']();})}});const _0x5d9382=_0x17a994['icon']??_0x17a994['parent']?.['icon'];return _0x342459['set']({'label':_0x17a994['displayedPrompt'],'withText':_0x2feeaa,'role':'menuitem','icon':_0x2140e4?_0x5d9382??_0x363d5b:void 0x0,'tooltip':!_0x2feeaa,'class':'ck-ai-quick-actions-button','isEnabled':_0x17a994['isEnabled']}),_0x342459['on']('execute',()=>{_0x118b37['editing']['view']['focus'](),_0x118b37['commands']['execute']('aiQuickAction',_0x17a994);}),_0x342459;};}class Ps extends _0x8cf39b{['arrowView'];constructor(_0x37517e,_0x11fd65){super(_0x37517e,_0x11fd65);const _0x470438=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x5bd19b=>String(_0x5bd19b)),'data-cke-tooltip-disabled':_0x470438['to']('isOn')},'on':{'mouseenter':_0x470438['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x2fc929=new _0xc034b();return _0x2fc929['content']=_0xd17942,_0x2fc929['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x2fc929;}}class Ls extends _0x35cdc6{['_allListItems'];['_allSearchableItems'];constructor(_0x348ca9,_0x37bd65,_0x3e57b4){super(_0x348ca9),this['_allListItems']=_0x37bd65,this['_allSearchableItems']=_0x3e57b4;}['filter'](_0x35152d){if(!_0x35152d)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x510d16=_0x35152d['source']['toLowerCase']()['trim'](),_0x5e92ff=this['_allSearchableItems']['filter'](_0x3577d0=>(_0x3577d0['groupLabel']?_0x3577d0['label']+'\x20('+_0x3577d0['groupLabel']+')':_0x3577d0['label'])['toLowerCase']()['includes'](_0x510d16));return this['items']['clear'](),this['items']['addMany'](_0x5e92ff['sort']((_0x3d660c,_0x11b23d)=>{const _0x84055d=_0x3d660c['groupLabel'],_0x2dd1f2=_0x11b23d['groupLabel'];return _0x84055d||_0x2dd1f2?_0x84055d?0x1:-0x1:0x0;})['map'](_0x5e3b70=>_0x5e3b70['item'])),this['_highlightQuery'](_0x510d16,_0x5e92ff),{'resultsCount':_0x5e92ff['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x32088e,_0x4dfbc9){if(!_0x32088e)return;const _0x39ec9a=new RegExp(_0x3383a1(_0x32088e),'gi');_0x4dfbc9['forEach'](_0x48baba=>{_0x48baba['highlightViews']&&_0x48baba['highlightViews']['forEach'](_0x495100=>{'function'==typeof _0x495100['highlightText']&&_0x495100['highlightText'](_0x39ec9a);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x2ee50a=>{_0x2ee50a['highlightViews']&&_0x2ee50a['highlightViews']['forEach'](_0x163913=>{'function'==typeof _0x163913['highlightText']&&_0x163913['highlightText'](null);});});}}const Qs='menu',Gs='menuitem';class co extends _0x184e76{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x3fc7d8,_0x4f52d5,_0xb4724f,_0x3190a5,_0xb0fb69=!0x1){const _0x2b0872=_0x3fc7d8['locale'];super(_0x2b0872),this['_bodyCollection']=_0x3190a5,this['_hasSearch']=_0xb0fb69;const _0x5ebd10=this['_createListItems'](_0x3fc7d8,_0x4f52d5,_0xb4724f);this['optionsListView']=new Ls(_0x2b0872,_0x5ebd10,this['_allSearchableItems']),this['optionsListView']['role']=Qs,this['optionsListView']['items']['addMany'](_0x5ebd10),this['focusTracker']=new _0x22c832(),this['keystrokes']=new _0x2b0c94(),_0xb0fb69&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x5ebd10,this['focusCycler']=new _0x56c0d3({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0xb0fb69&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x16943e=_0xb0fb69&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x4e90c7(_0x16943e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x2b0872['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x46980e(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x530824=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x530824);}['_createListItems'](_0x2504f5,_0x331ff6,_0x51f31e){const _0x2090b5=new _0x4e90c7();return _0x331ff6['forEach'](_0x250eee=>{if('actions'in _0x250eee){const {listItem:_0x6feba3}=this['_createActionGroupButton'](_0x2504f5,_0x250eee,_0x51f31e);_0x2090b5['add'](_0x6feba3),_0x250eee['actions']['forEach'](_0x44ad3f=>{this['_createActionButton'](_0x2504f5,_0x44ad3f,_0x250eee['label'],_0x250eee['icon']);const {listItem:_0x5e5672,highlightViews:_0x5e2708}=this['_createSearchResultActionButton'](_0x2504f5,_0x44ad3f,_0x250eee['label'],_0x250eee['icon']);this['_allSearchableItems']['push']({'item':_0x5e5672,'label':_0x44ad3f['displayedPrompt'],'groupLabel':_0x250eee['label'],'highlightViews':_0x5e2708});});}else{const {listItem:_0x50ac4b}=this['_createActionButton'](_0x2504f5,_0x250eee);_0x2090b5['add'](_0x50ac4b);const _0x299d8e=_0x50ac4b['children']['first'];if(_0x299d8e){const {listItem:_0x7479f3,highlightViews:_0x5d608d}=this['_createSearchResultActionButton'](_0x2504f5,_0x250eee);this['_allSearchableItems']['push']({'item':_0x7479f3,'label':_0x299d8e['label']||'','highlightViews':_0x5d608d});}}}),_0x2090b5;}['_createActionButton'](_0x204c5b,_0x294a1c,_0x33c001,_0x33318b){const _0x21da47=new _0x4ffa3a(this['locale']);if(_0x33c001&&_0x33318b){const _0xb24403=new _0x1e9460(this['locale']),_0xb92e37=_0xb24403['bindTemplate'],_0xfdfe37=new _0x56f45c();_0xfdfe37['text']=_0x294a1c['displayedPrompt'];const _0x3e3d03=new _0x56f45c();_0x3e3d03['text']=_0x33c001;const _0x30e327=new _0xc034b();_0x30e327['content']=_0x33318b,_0x30e327['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x20c210=new _0x184e76(this['locale']);_0x20c210['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x266b07=new _0x184e76(this['locale']);return _0x266b07['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0xb24403['set']({'label':_0x294a1c['displayedPrompt']+'\x20('+_0x33c001+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0xb24403['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0xfdfe37,_0x20c210,_0x30e327,_0x3e3d03,_0x266b07],'on':{'mouseenter':_0xb92e37['to'](()=>{this['_isSearchFocused']()||_0xb24403['focus']();}),'click':_0xb92e37['to'](()=>{_0xb24403['fire']('execute');})}}),_0xb24403['on']('execute',()=>{_0x204c5b['editing']['view']['focus'](),_0x204c5b['commands']['execute']('aiQuickAction',_0x294a1c);}),_0x21da47['children']['add'](_0xb24403),{'listItem':_0x21da47,'highlightViews':[_0xfdfe37,_0x3e3d03]};}{const _0x4e6dfb=new _0x32742a(),_0x14ea7d=new _0x1e9460(this['locale'],_0x4e6dfb),_0x498efe=_0x14ea7d['bindTemplate'],_0x306916=_0x294a1c['icon']??_0x294a1c['parent']?.['icon'],_0x297a2a=void 0x0!==_0x294a1c['icon'];return _0x14ea7d['set']({'label':_0x294a1c['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x297a2a?_0x306916??_0x363d5b:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x14ea7d['extendTemplate']({'on':{'mouseenter':_0x498efe['to'](()=>{this['_isSearchFocused']()||_0x14ea7d['focus']();})}}),_0x14ea7d['on']('execute',()=>{_0x204c5b['editing']['view']['focus'](),_0x204c5b['commands']['execute']('aiQuickAction',_0x294a1c);}),_0x21da47['children']['add'](_0x14ea7d),{'listItem':_0x21da47,'highlightViews':[_0x4e6dfb]};}}['_createSearchResultActionButton'](_0x15ee6f,_0x2a1332,_0x30e81d,_0x234ed0){return _0x30e81d&&_0x234ed0?this['_createSearchResultGroupedActionButton'](_0x15ee6f,_0x2a1332,_0x30e81d,_0x234ed0):this['_createSearchResultIndividualActionButton'](_0x15ee6f,_0x2a1332);}['_createSearchResultGroupedActionButton'](_0x47aee3,_0x23fe30,_0x135ccf,_0x5bbf87){const _0x28f261=new _0x4ffa3a(this['locale']),_0x1a12f3=new _0x1e9460(this['locale']),_0x4b8ca3=_0x1a12f3['bindTemplate'],{view:_0x5854bd,highlightView:_0x4e266b}=this['_createSearchResultGroupRow'](_0x135ccf,_0x5bbf87),{view:_0x270dae,highlightView:_0x5a6862}=this['_createSearchResultActionRow'](_0x23fe30['displayedPrompt']),_0x30da90=this['_createSearchResultContentView'](_0x5854bd,_0x270dae);return _0x1a12f3['set']({'label':_0x23fe30['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x1a12f3['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x30da90],'on':{'mouseenter':_0x4b8ca3['to'](()=>{this['_isSearchFocused']()||_0x1a12f3['focus']();}),'click':_0x4b8ca3['to'](()=>{this['_handleSearchResultButtonClick'](_0x1a12f3);})}}),this['_setupActionButtonExecution'](_0x1a12f3,_0x47aee3,_0x23fe30),_0x28f261['children']['add'](_0x1a12f3),{'listItem':_0x28f261,'highlightViews':[_0x4e266b,_0x5a6862]};}['_createSearchResultIndividualActionButton'](_0x44d694,_0x6f99d9){const _0x58cac1=new _0x4ffa3a(this['locale']),_0x2e171c=new _0x32742a(),_0x5b391a=new _0x1e9460(this['locale'],_0x2e171c),_0x1c02f4=_0x5b391a['bindTemplate'];return _0x5b391a['set']({'label':_0x6f99d9['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5b391a['extendTemplate']({'on':{'mouseenter':_0x1c02f4['to'](()=>{this['_isSearchFocused']()||_0x5b391a['focus']();})}}),this['_setupActionButtonExecution'](_0x5b391a,_0x44d694,_0x6f99d9),_0x58cac1['children']['add'](_0x5b391a),{'listItem':_0x58cac1,'highlightViews':[_0x2e171c]};}['_createSearchResultGroupRow'](_0x4bb6d5,_0x277aef){const _0x1d6f9d=new _0x184e76(this['locale']),_0x16e1a6=new _0xc034b();_0x16e1a6['content']=_0x277aef,_0x16e1a6['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x3dedf8=new _0x56f45c();return _0x3dedf8['text']=_0x4bb6d5,_0x1d6f9d['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x16e1a6,_0x3dedf8]}),{'view':_0x1d6f9d,'highlightView':_0x3dedf8};}['_createSearchResultActionRow'](_0x380f1d){const _0x1e2984=new _0x184e76(this['locale']),_0x1c06cf=new _0x56f45c();return _0x1c06cf['text']=_0x380f1d,_0x1e2984['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x1c06cf]}),{'view':_0x1e2984,'highlightView':_0x1c06cf};}['_createSearchResultContentView'](_0x1817eb,_0xf88fd2){const _0x44c919=new _0x184e76(this['locale']);return _0x44c919['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x1817eb,_0xf88fd2]}),_0x44c919;}['_setupActionButtonExecution'](_0x4230e3,_0x5b43d7,_0x349772){_0x4230e3['on']('execute',()=>{_0x5b43d7['editing']['view']['focus'](),_0x5b43d7['commands']['execute']('aiQuickAction',_0x349772);});}['_createActionGroupButton'](_0x112b20,_0x133b99,_0xb5adee){const _0x3c4024=new _0x4ffa3a(this['locale']),_0x50535f=new _0x32742a(),_0xb58c9=new Ps(this['locale'],_0x50535f),_0x27c2b3=_0xb58c9['bindTemplate'],_0x1e4052=this['_getPanelKeystroke'](_0xb5adee),_0x4db8a5=this['_createGroupActionsList'](_0x112b20,_0x133b99['actions'],_0xb5adee);_0xb58c9['set']({'label':_0x133b99['label'],'withText':!0x0,'role':Gs,'icon':_0x133b99['icon']??_0x363d5b,'isEnabled':_0x133b99['actions']['some'](_0x735013=>_0x735013['isEnabled'])}),_0xb58c9['extendTemplate']({'on':{'mouseenter':_0x27c2b3['to'](()=>{this['_isSearchFocused']()||_0xb58c9['focus']();})}});const _0x7b9e07=new _0x2fff3d(this['locale']);return _0x7b9e07['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x27c2b3['to'](_0x294b79=>{this['_handlePanelKeydown'](_0x294b79,_0x1e4052,_0xb58c9,_0x7b9e07);})}}),_0xb58c9['bind']('isOn')['to'](_0x7b9e07,'isVisible'),this['_bodyCollection']['add'](_0x7b9e07),_0x7b9e07['content']['add'](_0x4db8a5),this['_setupGroupMenuBehavior'](_0xb58c9,_0x7b9e07),_0x3c4024['children']['add'](_0xb58c9),{'listItem':_0x3c4024,'highlightView':_0x50535f};}['_createGroupActionsList'](_0x4166ec,_0x7ce62e,_0x12e859){const _0x4d392e=new _0x35cdc6(this['locale']);return _0x4d392e['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x7ce62e['forEach'](_0x548ad4=>{const _0x2a9efc=new _0x4ffa3a(this['locale']),_0x5ac6d5=Zt({'editor':_0x4166ec,'action':_0x548ad4,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x2a9efc['children']['add'](_0x5ac6d5),_0x12e859['focusTracker']['add'](_0x5ac6d5),_0x4d392e['items']['add'](_0x2a9efc);}),_0x4d392e;}['_setupGroupMenuBehavior'](_0x2b3e7a,_0x2fa78d){const _0x13f617=_0x2b3e7a['bindTemplate'],_0x470f63=this['_getButtonKeystroke'](_0x2b3e7a);_0x2b3e7a['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x13f617['to'](()=>{this['_showNestedPanel'](_0x2fa78d,_0x2b3e7a);}),'mouseleave':_0x13f617['to'](_0x226b85=>{const _0x5305ee=_0x226b85['relatedTarget'];this['_isMovingToNestedMenu'](_0x5305ee,_0x2fa78d)||this['_hideNestedPanel'](_0x2fa78d);}),'keydown':_0x13f617['to'](_0x23d674=>{_0x23d674['key']==_0x470f63&&(this['_showNestedPanel'](_0x2fa78d,_0x2b3e7a),_0x2fa78d['content']['get'](0x0)['focus']());})}}),_0x2fa78d['on']('render',()=>{_0x2fa78d['element']?.['addEventListener']('mouseleave',_0xf8c677=>{const _0x49c66f=_0xf8c677['relatedTarget'];_0x2b3e7a['element']?.['contains'](_0x49c66f)||this['_isMovingToNestedMenu'](_0x49c66f,_0x2fa78d)||this['_hideNestedPanel'](_0x2fa78d);});});}['_showNestedPanel'](_0x4657d4,_0x1a4779){this['_openNestedPanels']['forEach'](_0x68ea3e=>{_0x68ea3e!==_0x4657d4&&_0x68ea3e['isVisible']&&_0x68ea3e['hide']();}),_0x4657d4['show'](),_0x4657d4['pin']({'positions':[_0x291da6['eastSouth']],'target':_0x1a4779['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x4657d4);}['_hideNestedPanel'](_0x4d8c7e){_0x4d8c7e['hide'](),this['_openNestedPanels']['delete'](_0x4d8c7e);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x3461cd=>_0x3461cd['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x339734,_0x2a01a4){if(!_0x339734)return!0x1;if(_0x2a01a4['element']?.['contains'](_0x339734))return!0x0;const _0x2eaa00=_0x339734;return _0x2eaa00['closest']&&(null!==_0x2eaa00['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x2eaa00['closest']('.ck-ai-quick-actions-group-list')||null!==_0x2eaa00['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x2c6251){return'rtl'===_0x2c6251['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x1d857a){return'rtl'===_0x1d857a['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x26a11f,_0x2f8fc7,_0x10befd,_0x10e8e2){_0x26a11f['key']==_0x2f8fc7&&(_0x10befd['focus'](),this['_hideNestedPanel'](_0x10e8e2));}['_handleSearchResultButtonClick'](_0x127901){_0x127901['fire']('execute');}}function Xt(_0x53bdee){const {editor:_0x30ef0c,content:_0x1683d4,buttonDefinition:_0x1be94b,bodyCollection:_0x2d54b2,hasSearch:_0x159e80=!0x1}=_0x53bdee;return()=>{const _0x3490a0=_0x30ef0c['locale'],_0x46d5b8=_0x546896(_0x3490a0);_0x46d5b8['buttonView']['set']({'icon':_0x1be94b['icon']??_0x363d5b,'label':_0x1be94b['label'],'tooltip':!0x0}),_0x46d5b8['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1393e8=new co(_0x30ef0c,_0x1683d4,_0x46d5b8,_0x2d54b2,_0x159e80);if(_0x46d5b8['panelView']['children']['add'](_0x1393e8),_0x159e80){const _0x4ba718='ai-quick-actions-dropdown-selection';_0x46d5b8['on']('change:isOpen',(_0x5cf86,_0x1da21a,_0x504c17)=>{if(_0x504c17){if(_0x30ef0c['plugins']['has']('AIEditing')){const _0x4c6c92=_0x30ef0c['plugins']['get'](D),_0x27fb34=_0x30ef0c['model']['document']['selection'],_0x427bde=Array['from'](_0x27fb34['getRanges']());_0x427bde['length']>0x0&&_0x4c6c92['showFakeVisualSelection'](_0x427bde,_0x4ba718,!0x1,!0x0);}}else _0x30ef0c['plugins']['has']('AIEditing')&&_0x30ef0c['plugins']['get'](D)['hideFakeVisualSelection'](_0x4ba718),_0x1393e8['resetSearch']();});}return _0x46d5b8;};}const ee='<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>',ie='<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>',ne='<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 Qt=function(_0x34393e){return _0x34393e['CHAT']='CHAT',_0x34393e['ACTION']='ACTION',_0x34393e['REVIEW']='REVIEW',_0x34393e;}({}),Ga=function(_0x157f87){return _0x157f87['CHAT']='AIChat',_0x157f87['ACTION']='AIActions',_0x157f87['REVIEW']='AIReviewMode',_0x157f87;}({});class ii extends _0x511be8{static get['requires'](){return[te,q];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x297365=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x297365),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x1e4cd4){return function(_0x595e1f){const _0x33ef87=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x595e1f['uiLanguage']),_0x4da1de=_0x33ef87||'English',_0x559ae8=[{'id':'ask-ai','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x595e1f,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x4da1de),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x4da1de),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x4da1de),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ft},{'id':'fix-grammar','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x595e1f,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x595e1f,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x595e1f,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x595e1f,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x559ae8;}(_0x1e4cd4);}async['_getDefaultAndCustomActions'](){const _0x3208b3=ii['getDefaultQuickActions'](this['editor']['locale']),_0x3d84ac=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x41e619=[];try{_0x41e619=await new It({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x32a5a6){const _0x332462=new _0x36ca17('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x32a5a6});gt(_0x332462['message']);}finally{const _0x5e2dff=_0x3d84ac['map'](_0xec020=>({..._0xec020,'icon':void 0x0}));_0x3208b3['find'](_0x51da1f=>'other'===_0x51da1f['id'])['actions']['push'](..._0x5e2dff),_0x3208b3['forEach'](_0x533df7=>{if('actions'in _0x533df7)_0x533df7['actions']['forEach'](_0x1a9e81=>{if(_0x1a9e81['isEnabled']=!!_0x41e619['find'](_0x4f1b12=>_0x4f1b12['id']===_0x1a9e81['model'])||void 0x0===_0x1a9e81['model'],!_0x1a9e81['isEnabled']){const _0xf6051e=new _0x36ca17('ai-quick-actions-unavailable-model',this,{'actionId':_0x1a9e81['id'],'modelId':_0x1a9e81['model']});gt(_0xf6051e['message']);}});else{if(_0x533df7['isEnabled']=!!_0x41e619['find'](_0x31b52b=>_0x31b52b['id']===_0x533df7['model'])||void 0x0===_0x533df7['model'],!_0x533df7['isEnabled']){const _0x165b9b=new _0x36ca17('ai-quick-actions-unavailable-model',this,{'actionId':_0x533df7['id'],'modelId':_0x533df7['model']});gt(_0x165b9b['message']);}}});}return _0x3208b3;}['_initializeQuickActionsComponentsAndCommands'](){const _0x11df40=new _0x591ff4(this['editor']['locale']);_0x11df40['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x11df40),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x11df40);}['_initializeQuickActionsDropdown'](_0x564243){const _0x252c33=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x363d5b,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x564243,'hasSearch':_0x252c33}));}['_prepareQuickActionsDefinition'](_0x266d5d){this['_quickActionsDefinition']=_0x266d5d['map'](_0x387224=>{if('actions'in _0x387224){const _0x2ed3c9=_0x387224;return{..._0x2ed3c9,'actions':_0x2ed3c9['actions']['map'](_0x37a797=>{const {actions:_0x18e47d,..._0x30e767}=_0x2ed3c9;return{..._0x37a797,'parent':_0x30e767};})['filter'](_0x96b6ed=>this['_shouldIncludeAction'](_0x96b6ed))};}return _0x387224;})['filter'](_0x3e6efe=>'actions'in _0x3e6efe?_0x3e6efe['actions']['length']>0x0:this['_shouldIncludeAction'](_0x3e6efe));}['_shouldIncludeAction'](_0x5780ea){const _0x3fe9db=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ga[_0x5780ea['type']])&&!_0x3fe9db['includes'](_0x5780ea['id'])&&!('CHAT'===_0x5780ea['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x19425e){this['_quickActionsDefinition']['forEach'](_0x550865=>{if('actions'in _0x550865){const _0x5ee8b3=Xt({'editor':this['editor'],'content':_0x550865['actions'],'buttonDefinition':_0x550865,'bodyCollection':_0x19425e});this['editor']['ui']['componentFactory']['add'](_0x550865['id'],_0x5ee8b3),_0x550865['actions']['forEach'](_0x58582d=>{const _0x2c0c6a=Zt({'editor':this['editor'],'action':_0x58582d});this['editor']['ui']['componentFactory']['add'](_0x58582d['id'],_0x2c0c6a);});}else{const _0x33aa91=Zt({'editor':this['editor'],'action':_0x550865,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x550865['id'],_0x33aa91);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3ee6fe=>{const _0x2b5c50=new _0x53e868(_0x3ee6fe),_0x5dbb2b=i(_0x3ee6fe,'AI_QUICK_ACTIONS_HEADING');_0x2b5c50['buttonView']['set']({'label':_0x5dbb2b,'icon':_0x363d5b});const _0x53f37b=new _0x685ce2(_0x3ee6fe);_0x53f37b['set']({'ariaLabel':_0x5dbb2b,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0xdac847=>{if('actions'in _0xdac847){const _0x4caf2f=_0xdac847,_0x18abfc=new _0x217236(_0x3ee6fe,_0x2b5c50),_0x5ad147=new _0x53e868(_0x3ee6fe),_0x391cc6=new _0x685ce2(_0x3ee6fe);_0x5ad147['buttonView']['set']({'label':_0x4caf2f['label'],'icon':_0x4caf2f['icon']}),_0x4caf2f['actions']['forEach'](_0x47c156=>{const _0x3f1c21=new _0x217236(_0x3ee6fe,_0x5ad147),_0x18a9b2=new _0x12221a(_0x3ee6fe);_0x18a9b2['set']({'label':_0x47c156['displayedPrompt'],'icon':_0x47c156['icon'],'role':'menuitem','isEnabled':_0x47c156['isEnabled']}),_0x18a9b2['on']('execute',()=>{this['_executeQuickAction'](_0x47c156);}),_0x18a9b2['delegate']('execute')['to'](_0x5ad147),_0x3f1c21['children']['add'](_0x18a9b2),_0x391cc6['items']['add'](_0x3f1c21);}),_0x5ad147['panelView']['children']['add'](_0x391cc6),_0x18abfc['children']['add'](_0x5ad147),_0x53f37b['items']['add'](_0x18abfc);}else{const _0x57cf01=_0xdac847,_0x245956=new _0x217236(_0x3ee6fe,_0x2b5c50),_0x2ae0b3=new _0x12221a(_0x3ee6fe);_0x2ae0b3['set']({'label':_0x57cf01['displayedPrompt'],'icon':_0x57cf01['icon'],'role':'menuitem','isEnabled':_0x57cf01['isEnabled']}),_0x2ae0b3['on']('execute',()=>{this['_executeQuickAction'](_0x57cf01);}),_0x2ae0b3['delegate']('execute')['to'](_0x2b5c50),_0x245956['children']['add'](_0x2ae0b3),_0x53f37b['items']['add'](_0x245956);}});const _0x484f6c=Object['values'](Ga)['some'](_0x637468=>this['editor']['plugins']['has'](_0x637468));return _0x2b5c50['set']({'isEnabled':_0x484f6c}),_0x2b5c50['panelView']['children']['add'](_0x53f37b),_0x2b5c50;});}['_executeQuickAction'](_0x3ab271){const _0x11c246=this['editor'];_0x11c246['editing']['view']['focus'](),_0x11c246['commands']['execute']('aiQuickAction',_0x3ab271);const _0x342cb6=_0x11c246['ui']['view']['menuBarView'];_0x342cb6&&_0x342cb6['close']&&_0x342cb6['close']();}}class ci extends Lt{['execute'](_0x557829){switch(this['_expandSelectionIfCollapsed'](),_0x557829['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x44a046=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x36ca17('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x44a046});}this['_handleAIChatAction'](_0x557829);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x3bb417=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x36ca17('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3bb417});}this['_handleAIActionsAction'](_0x557829);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0xd4e9e0=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x36ca17('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0xd4e9e0});}this['_handleAIReviewAction'](_0x557829);}}async['_handleAIChatAction'](_0x237546){const _0x4e8524=this['editor']['plugins']['get']('AIChat'),_0x5c5ec8=this['editor']['plugins']['get']('AIChatController'),_0x167733=this['editor']['plugins']['get']('AITabs')['view'];if(_0x167733['isVisible']||(_0x167733['isVisible']=!0x0),'chat'!==_0x167733['activeTab']&&_0x167733['activateTab']('chat'),'ask-ai'===_0x237546['id'])_0x5c5ec8['removeSelectionFromChatContext'](),await _0x4e8524['addSelectionToChatContext'](),_0x4e8524['focusPromptInput']();else await _0x4e8524['startConversation'](),_0x5c5ec8['removeSelectionFromChatContext'](),await _0x4e8524['addSelectionToChatContext'](),_0x4e8524['focusPromptInput'](),await _0x4e8524['sendMessage']({'message':_0x237546['prompt']||_0x237546['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x237546['id']},'displayedPrompt':_0x237546['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x34aaca=this['editor'],_0x354ff1=_0x34aaca['model']['document']['selection'];if(!_0x354ff1['isCollapsed'])return;const _0x1f752f=_0x17af57(_0x354ff1['getSelectedBlocks']())||_0x34aaca['model']['schema']['getLimitElement'](_0x354ff1);_0x34aaca['model']['change'](_0x42453a=>{_0x42453a['setSelection'](_0x1f752f,'in');});}['_handleAIActionsActionLabel'](_0x9b832e){return _0x9b832e['parent']?.['label']&&'other'!==_0x9b832e['parent']?.['id']?_0x9b832e['parent']['label']+':\x20'+_0x9b832e['displayedPrompt']:_0x9b832e['displayedPrompt'];}async['_handleAIActionsAction'](_0x15669c){const _0x6e2053=this['editor']['plugins']['get']('AIActions'),_0x6b228d=_0x15669c['prompt']?{'userMessage':_0x15669c['prompt'],'model':_0x15669c['model']}:{'actionName':_0x15669c['actionName']||_0x15669c['id'],'args':_0x15669c['args']},_0x55cfad=this['_handleAIActionsActionLabel'](_0x15669c);await _0x6e2053['executeAction'](_0x6b228d,_0x55cfad,_0x15669c['icon']);}async['_handleAIReviewAction'](_0x163525){console['log']('handleAIReviewAction',_0x163525);}}class ti extends _0x511be8{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x538334=this['editor'],_0x2ad310=new ci(this['editor']);if(_0x538334['commands']['add']('aiQuickAction',_0x2ad310),_0x538334['plugins']['has']('AIChat')){const _0x3ebef5=this['editor']['plugins']['get']('AIChat');_0x538334['model']['document']['selection']['on']('change:range',(_0x7fd2a9,_0x13d00e)=>{_0x13d00e['directChange']&&_0x3ebef5['removeSelectionFromChatContext']();});}}}class De extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x5b8039=this['documentContextContent']['children']['map'](_0x371237=>({'node':_0x371237,'id':At(_0x371237,'data-id')})),_0x31f78b=this['parsedMergedContent']['children']['map'](_0x2e8a75=>({'node':_0x2e8a75,'id':At(_0x2e8a75,'data-id')||_0x926b30()})),_0x363a68=_0x148630(_0x5b8039,_0x31f78b,{'comparator':(_0x4a4253,_0x1fdd70)=>_0x4a4253['id']==_0x1fdd70['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x363a68['length']&&_0x363a68[_0x363a68['length']-0x1]['removed'];)_0x363a68['pop']();}const _0x260176=_0x363a68['map'](_0xa9d484=>{const _0xe24e4d=_0xa9d484['added']?'new':_0xa9d484['removed']?'removed':'modified';return{'node':_0xa9d484['value'][0x0]['node'],'type':_0xe24e4d,'id':_0xa9d484['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x260176,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x2d2e61,_0x3858e1){return _0x3858e1;}}class W extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x5351e2){super(_0x5351e2),this['content']=_0x5351e2['content'],this['version']=_0x5351e2['version'],this['actionName']=_0x5351e2['actionName'],this['args']=_0x5351e2['args'],this['userMessage']=_0x5351e2['userMessage'],this['model']=_0x5351e2['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':qe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x4c72fd){const _0x57acbe=new De({'editor':this['editor'],'documentContextContent':this['content'],..._0x4c72fd});return this['replies']['push'](_0x57acbe),_0x57acbe['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x57acbe),_0x57acbe;}}class Bn extends _0x178dcf{constructor(_0x35158b,_0xf870aa=!0x0,_0x9a6a4d=!0x0){super(_0x35158b),this['set']('isEnabled',!0x1),_0xf870aa&&(this['applyButton']=this['_createButton'](i(_0x35158b,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x9a6a4d&&(this['suggestButton']=this['_createButton'](i(_0x35158b,'AI_BALLOON_SUGGEST_BUTTON'),_0xf870aa?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0xf870aa,'showSuggestButton':_0x9a6a4d}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x4e9853,showSuggestButton:_0x49d8eb}){this['applyButton']&&(this['applyButton']['isVisible']=_0x4e9853),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x49d8eb);}['_createButton'](_0x3935b8,_0x105c94){const _0x5bd70c=new _0x1e9460(this['locale']);return _0x5bd70c['set']({'label':_0x3935b8,'class':_0x105c94,'isVisible':!0x0,'withText':!0x0}),_0x5bd70c;}}class yn extends _0x184e76{constructor(_0x3cfaf7){super(_0x3cfaf7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0x3cfaf7,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x184e76{constructor(_0x11706b){super(_0x11706b),this['set']('isVisible',!0x0);const _0x3075a4=new li('small');_0x3075a4['isVisible']=!0x0;const _0x4c71e5=new _0x184e76(this['locale']);_0x4c71e5['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x553e0b=>!_0x553e0b)]},'children':[_0x3075a4,_0x4c71e5]});}}class rt extends ls{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x402bca,_0x2fc149){super(_0x402bca),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x2fc149,this['_focusTracker']=new _0x22c832(),this['_keystrokes']=new _0x2b0c94(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x56c0d3({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x4e90c7(),this['_addContentWrapper'](_0x2fc149),this['_addDisclaimerView'](),this['_addToolbar'](_0x2fc149),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x2fc149);});}['render'](){super['render']();for(const _0x100e81 of this['_focusables'])this['_focusTracker']['add'](_0x100e81['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x4df820){-0x1===_0x4df820?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x37cce0){this['_isLoading']=_0x37cce0;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x3eed70){super['showError'](_0x3eed70),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x1be2b6){super['showBlockingError'](_0x1be2b6),this['setErrorState']();}['addMiniToolbarItem'](_0x57b673){this['_miniToolbarView']['items']['has'](_0x57b673)||this['_miniToolbarView']['items']['add'](_0x57b673);}['removeMiniToolbarItem'](_0x242eb9){this['_miniToolbarView']['items']['has'](_0x242eb9)&&this['_miniToolbarView']['items']['remove'](_0x242eb9);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x3c0f15,showSuggestButton:_0x4a0a07}){_0x3c0f15=_0x3c0f15&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x4a0a07=_0x4a0a07&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x3c0f15,'showSuggestButton':_0x4a0a07});}async['updateContent'](_0x2bede0){await this['_streamableContentView']['update'](_0x2bede0);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x14f9f9){this['_contentWrapper']=new _0x184e76(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x14f9f9['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x29b26e,showSuggestButton:_0x500088}){this['_toolbarView']=new Bn(this['locale'],_0x29b26e,_0x500088),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x40e8ab,_0x1fae43,_0x59ab52)=>!(_0x40e8ab||_0x1fae43||_0x59ab52)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x29b26e,'showSuggestButton':_0x500088}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x6ae52f){return this['_miniToolbarView']=new us(this['locale'],_0x6ae52f),this['_miniToolbarView']['delegate'](...ut)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x4cbe62,_0x375df2)=>!(_0x4cbe62||_0x375df2)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new as(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x23c1a5=new _0x1e9460(this['locale']),_0x18f651=new _0x1e9460(this['locale']),_0x4de70b=new Ln(this['locale']),_0x333eac=new _0x1e9460(this['locale']);_0x23c1a5['set']({'icon':_0x3b6fc0,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x18f651['set']({'icon':_0x29f3c3,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x333eac['set']({'icon':_0x3a3110,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x23c1a5['bind']('isEnabled')['to'](this,'isBusy',_0x267387=>!_0x267387),_0x23c1a5['on']('execute',()=>{this['fire']('tryAgain');}),_0x18f651['bind']('isEnabled')['to'](this,'isBusy',_0x4fef14=>!_0x4fef14),_0x18f651['on']('execute',()=>{this['fire']('showPrevious');}),_0x333eac['bind']('isEnabled')['to'](this,'isBusy',_0x4f034c=>!_0x4f034c),_0x333eac['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x18f651,this['_navigationCounter']=_0x4de70b,this['_navigationNextButton']=_0x333eac,this['_navigationTryAgainButton']=_0x23c1a5;}['updateMiniToolbarButtons'](_0x11f35a,_0x47fa8d){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x222770=_0x11f35a>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x222770){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x39d1de=_0x11f35a-_0x47fa8d;this['_navigationCounter']['setInteractionCount'](_0x39d1de+'/'+_0x11f35a),this['_navigationPreviousButton']['isEnabled']=_0x47fa8d<_0x11f35a-0x1,this['_navigationNextButton']['isEnabled']=_0x47fa8d>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0xed1174){this['_isLoading']=_0xed1174;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x17995c=this['_getScrollableElement']();_0x17995c&&!this['_scrollManager']&&(this['_scrollManager']=new $e(_0x17995c));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x184e76{constructor(_0x34f59f){super(_0x34f59f);const _0x5df99d=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x5df99d['to']('interactionCount')}]});}['setInteractionCount'](_0x95d802){this['set']('interactionCount',_0x95d802);}}class ri extends _0x511be8{static get['requires'](){return[q,_0x6460a2,D,Q,_0x29a341];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x9d3409){super(_0x9d3409),this['_bodyCollection']=new _0x591ff4(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new z();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x205ac3,_0x1b589b,_0x262b52){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x397c54,anchorData:_0x3f6908}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x205ac3,_0x397c54,_0x3f6908,_0x1b589b,_0x262b52);}}const {modelFragment:_0x346497,anchorData:_0x2c57af}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x205ac3,_0x346497,_0x2c57af,_0x1b589b,_0x262b52);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x3e0d37=this['editor']['plugins']['has']('TrackChanges');let _0x1323de=this['editor']['config']['get']('ai.availableReplyActions')||[...ot];_0x3e0d37||(_0x1323de=_0x1323de['filter'](_0x509fad=>'insertSuggestion'!=_0x509fad));const _0x1acd4d=this['editor']['commands']['get']('trackChanges'),_0xe3032c=new rt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x3e0d37,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1323de});return _0xe3032c['bind']('isBusy')['to'](this),_0x1acd4d&&_0xe3032c['bind']('isTrackChangesOn')['to'](_0x1acd4d,'value'),_0xe3032c['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0xe3032c['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0xe3032c['on']('showNext',()=>{this['_navigateToNext']();}),_0xe3032c;}['_getExecuteDataRegular'](){const _0x2c761b=this['editor']['model']['document']['selection'];if(_0x2c761b['isCollapsed']){const _0x4d4a26=_0x17af57(_0x2c761b['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x2c761b);this['editor']['model']['change'](_0x1aa7b8=>{_0x1aa7b8['setSelection'](_0x4d4a26,'in');});}const _0x52bf7d=_0x2c761b['getFirstRange'](),_0x36be2f=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x2c761b),_0x52bf7d['start'],_0x52bf7d['end']);this['_copyMarkersToFragment'](_0x36be2f,_0x2c761b,{'isTableSelection':!0x1});const _0x256a46=_0x2c761b['getFirstRange']()['start'],_0x6a292d=new Map();let _0x3a4a69=_0x36be2f;for(let _0x4a4fd9=0x0;_0x4a4fd9<_0x256a46['path']['length'];_0x4a4fd9++)_0x6a292d['set'](_0x3a4a69,_0x256a46['path'][_0x4a4fd9]),_0x3a4a69=_0x3a4a69['getChild'](0x0);return{'modelFragment':_0x36be2f,'anchorData':_0x6a292d};}['_getExecuteDataInTable'](){const _0x378ba9=this['editor']['model']['document']['selection'],_0x3867a3=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x4d6b38=_0x378ba9['getFirstRange']()['start']['parent']['parent'],_0x556758=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x4d6b38),this['editor']['model']['createPositionAfter'](_0x4d6b38)),_0x41277a=this['_wrapWithCommonAncestors'](_0x3867a3,_0x556758['start'],_0x556758['end']);this['_copyMarkersToFragment'](_0x41277a,_0x378ba9,{'isTableSelection':!0x0});const _0x39c960=_0x378ba9['getFirstRange']()['start'],_0x1ca5af=new Map();let _0x2ffe35=_0x41277a;for(let _0x515714=0x0;_0x515714<_0x39c960['path']['length'];_0x515714++)if(_0x1ca5af['set'](_0x2ffe35,_0x39c960['path'][_0x515714]),_0x515714<_0x39c960['path']['length']-0x1)_0x2ffe35=_0x2ffe35['getChild'](0x0);else{let _0x2d0d86=_0x2ffe35['nextSibling'];for(;_0x2d0d86;)_0x1ca5af['set'](_0x2d0d86,_0x39c960['path'][_0x515714]),_0x2d0d86=_0x2d0d86['nextSibling'];}return{'modelFragment':_0x41277a,'anchorData':_0x1ca5af};}async['_executeAction'](_0x135594,_0x175281,_0x1f3fc6,_0x4c4404,_0x10dc41){const _0x4109c0=this['editor']['plugins']['get'](D),_0x272bd5=this['editor']['plugins']['get'](Q),_0x4946e8=this['editor']['model']['document']['selection'],_0x268d48=await _0x4109c0['modelToDataWithIds'](_0x175281),_0x213ebc=this['editor']['model']['document']['version'],_0x59d0da=[..._0x4946e8['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x272bd5['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x4c4404,'icon':_0x10dc41||_0x363d5b,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x59d0da,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x272bd5),this['_interactionParams']={'action':_0x135594,'content':_0x268d48,'version':_0x213ebc,'aiBalloon':_0x272bd5,'modelFragment':_0x175281,'anchorData':_0x1f3fc6},this['_setupApplyListeners'](),this['listenTo'](_0x272bd5,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x272bd5,'dialogClosed',(_0x3f6b07,{id:_0x21787f})=>{if('aiActionsBalloon'===_0x21787f){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x20798f=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x14905c=_0x20798f['changeGroups'][0x0];_0x14905c&&'pending'===_0x14905c['state']&&_0x20798f['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x272bd5);}}),this['_createInteraction'](_0x268d48,_0x213ebc,_0x272bd5,_0x135594);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x1e6bb8,anchorData:_0x371468}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x1e6bb8,_0x371468,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x1e6bb8,_0x371468,!0x0);});}['_wrapWithCommonAncestors'](_0xa9b152,_0x1d4a98,_0x22dc78){const _0x5442f0=this['editor']['model']['createRange'](_0x1d4a98,_0x22dc78)['getCommonAncestor'](),_0x341fcf=_0x5442f0['is']('documentFragment')?[]:_0x5442f0['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x341fcf['length']){const _0x501d4c=_0x341fcf['map'](_0x406107=>_0x406107['_clone'](!0x1));for(let _0x4604b9=0x1;_0x4604b9<_0x501d4c['length'];_0x4604b9++)_0x501d4c[_0x4604b9-0x1]['_appendChild'](_0x501d4c[_0x4604b9]);return _0x501d4c[_0x501d4c['length']-0x1]['_appendChild'](_0xa9b152),new tt(_0x501d4c[0x0]);}return _0xa9b152;}['_copyMarkersToFragment'](_0x1bce84,_0x4250dc,_0x417fa6={'isTableSelection':!0x1}){const _0x384f1e=this['editor']['model'],_0x4aad96=Array['from'](_0x4250dc['getRanges']()),_0x350770=_0x4250dc['getFirstRange']()['start'];for(const _0x2add03 of _0x384f1e['markers']){if(_0x2add03['name']['startsWith'](R)||!_0x2add03['affectsData'])continue;const _0x561d5c=_0x2add03['getRange']();if(!_0x4aad96['some'](_0x4073d1=>_0x4073d1['containsRange'](_0x561d5c,!0x0)))continue;const _0x2a36b4=this['_regularCalculateMarkerPath'](_0x561d5c['start'],_0x350770,_0x417fa6['isTableSelection']),_0x69325f=this['_regularCalculateMarkerPath'](_0x561d5c['end'],_0x350770,_0x417fa6['isTableSelection']),_0x173e33=_0x384f1e['createPositionFromPath'](_0x1bce84,_0x2a36b4),_0xe8baff=_0x384f1e['createPositionFromPath'](_0x1bce84,_0x69325f);if(!_0x173e33['isEqual'](_0xe8baff)){const _0x309173=_0x384f1e['createRange'](_0x173e33,_0xe8baff);_0x1bce84['markers']['set'](_0x2add03['name'],_0x309173);}}}['_regularCalculateMarkerPath'](_0x2576ee,_0x531368,_0x244ff4=!0x1){const _0x46c2bc=[..._0x2576ee['path']['slice']()];for(let _0x42faef=0x0;_0x42faef<Math['max'](_0x531368['path']['length'],_0x2576ee['path']['length']);_0x42faef++){const _0x5d656e=_0x531368['path'][_0x42faef]||0x0,_0x54a633=(_0x2576ee['path'][_0x42faef]||0x0)-_0x5d656e;if(_0x46c2bc[_0x42faef]=_0x54a633,0x0!==_0x54a633&&!_0x244ff4)break;}return _0x46c2bc;}async['_createInteraction'](_0x4f79cc,_0x4170ea,_0x1a9f64,_0x14fa8f){const _0x488e28=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x14fa8f,'content':_0x4f79cc,'version':_0x4170ea,'aiBalloon':_0x1a9f64,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x58045b=new W({'connector':this['_aiConnector'],'editor':_0x488e28,'content':_0x4f79cc,'version':_0x4170ea,..._0x14fa8f});this['_interactions']['push'](_0x58045b);const _0x407934=(_0x57137f,_0x8a8c83=!0x1,_0x2ea34d='streaming')=>this['_promiseQueue']['enqueue'](async _0x5abae2=>{try{const _0x236dc6=J({'editor':_0x488e28,'changeGroups':_0x57137f['changeGroups'],'documentContextContent':_0x57137f['documentContextContent'],'showDiff':_0x8a8c83,'trimUnchanged':!0x1});_0x236dc6['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x236dc6[0x0],'renderingStrategy':_0x2ea34d,'abortSignal':_0x5abae2});}catch(_0x4f7565){if(this['_isAbortError'](_0x4f7565))return;throw _0x4f7565;}});this['_interaction']['on']('replyCreated',(_0x1e9f49,_0x36459e)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x407934(_0x36459e)['catch'](_0x3e9a41=>{this['_isAbortError'](_0x3e9a41)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x3e9a41),this['_setErrorState'](_0x58045b));});}),this['_interaction']['on']('replyContentUpdated',(_0xb0f6f,_0x4d02ff)=>{_0x407934(_0x4d02ff)['catch'](_0x223b52=>{this['_isAbortError'](_0x223b52)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x223b52),this['_setErrorState'](_0x58045b));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x4d3171){this['_isAbortError'](_0x4d3171)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x4d3171),this['_setErrorState'](_0x58045b));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0xa3f95c,{showDiff:_0x3d427f})=>{try{this['_balloonShowDiff']=_0x3d427f;const _0x350eb6=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x350eb6&&await _0x407934(_0x350eb6,_0x3d427f,'static');}catch(_0x2e9654){this['_isAbortError'](_0x2e9654)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x2e9654),this['_setErrorState'](_0x58045b));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x250717,{reply:_0x418896})=>{const _0x5ec6e5={'positiveCount':_0x418896['changeGroups']['filter'](_0xe118f1=>'accepted'===_0xe118f1['state'])['length'],'totalCount':_0x418896['changeGroups']['length']},_0x27d28c=this['_interaction']['actionCallId'],_0x1228a8=this['_interaction']['actionName'];_0x1228a8?this['_aiConnector']['upsertAIActionRating'](_0x1228a8,_0x27d28c,_0x5ec6e5):this['_aiConnector']['upsertCustomAIActionRating'](_0x27d28c,_0x5ec6e5);}),this['_setLoadingState']();try{const _0x3b0246=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x3b0246;}catch(_0x5a5dd6){if(this['_isAbortError'](_0x5a5dd6))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x58045b);}}['_applyChanges'](_0x2e71e7,_0x339d7f,_0x5e6c8b){const _0x5a2099=this['editor'];if(_0x5e6c8b&&!_0x5a2099['plugins']['has']('TrackChanges'))throw new _0x36ca17('ai-no-track-changes',null);const _0x574793=this['editor']['plugins']['get'](_0x29a341),_0x517cff=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x517cff||!_0x517cff['replies']['length'])return;const _0x27c7a8=_0x517cff['replies'][_0x517cff['replies']['length']-0x1],_0x26c707=_0x27c7a8['changeGroups'];_0x27c7a8['setChangeGroupState'](0x0,'accepted');let _0x297694=Z({'editor':_0x5a2099,'reply':_0x27c7a8,'interaction':_0x517cff,'groups':_0x26c707,'transform':!0x1,'documentCompare':_0x574793,'documentCompareOptions':{'anchor':_0x5a2099['model']['createPositionAt'](_0x2e71e7,0x0),'markDeletions':_0x5e6c8b}});_0x297694=this['_filterOperationsOutsideRange'](_0x297694,_0x339d7f);for(const _0x34d106 of _0x297694)this['_anchorOperation'](_0x339d7f,_0x34d106,_0x5a2099['model']['document']['getRoot']());const _0x19dd0e=_0x517cff['getDocumentContext']()['version'],_0x58bf08=_0x5a2099['model']['document']['history']['getOperations'](_0x19dd0e),_0x3fcd52={'document':_0x5a2099['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0xe5a294=nt(_0x297694,_0x58bf08,_0x3fcd52)['operationsA'];_0x5a2099['model']['change'](_0x413dde=>{if(_0x413dde['setSelection'](_0x5a2099['model']['document']['selection']['focus']),_0x5e6c8b)_0x5a2099['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xe5a294);else{for(const _0xcc442 of _0xe5a294)_0xcc442['baseVersion']=_0x5a2099['model']['document']['version'],Y(_0x5a2099,_0xcc442),_0x413dde['batch']['addOperation'](_0xcc442),_0x5a2099['model']['applyOperation'](_0xcc442);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x75b56a,_0x3065b7){return _0x75b56a['filter'](_0x5912b5=>{if('rename'==_0x5912b5['type']){const _0x11f36d=_0x5912b5['position']['nodeAfter'];return!_0x3065b7['has'](_0x11f36d);}if(_0x5912b5['type']['indexOf']('Attribute')>-0x1){const _0x532170=_0x5912b5['range']['start']['nodeAfter'];return!_0x3065b7['has'](_0x532170);}return!0x0;});}['_anchorOperation'](_0x378249,_0x4ada2f,_0x5421dc){const _0x1d41b1=_0x4ada2f['clone']();for(const _0x25d4ac in _0x4ada2f){const _0x4beec4=_0x4ada2f[_0x25d4ac];_0x4beec4 instanceof it?_0x4ada2f[_0x25d4ac]=new it(_0x3a728f(_0x4beec4['start']),_0x3a728f(_0x4beec4['end'])):_0x4beec4 instanceof st&&(_0x4ada2f[_0x25d4ac]=_0x3a728f(_0x4beec4));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x1d41b1['type'])){if(_0x1d41b1['isDocumentOperation']=!0x1,_0x1d41b1['baseVersion']=null,'remove'==_0x1d41b1['type']){const _0x31c033=_0x1d41b1['sourcePosition'],_0x245b3c=_0x1d41b1['howMany'];new et(_0x31c033,_0x245b3c)['_execute']();}else _0x1d41b1['_execute']();}function _0x3a728f(_0x56589c){if('$graveyard'==_0x56589c['root']['rootName'])return _0x56589c;const _0x6b6b82=[];let _0x2f2c2f=_0x56589c['root'];for(let _0x2f0738=0x0;_0x2f0738<_0x56589c['path']['length'];_0x2f0738++){const _0x1c8433=_0x378249['get'](_0x2f2c2f)||0x0;_0x6b6b82[_0x2f0738]=_0x56589c['path'][_0x2f0738]+_0x1c8433,_0x2f2c2f=_0x2f2c2f['getChildAtOffset'](_0x56589c['path'][_0x2f0738]);}return new st(_0x5421dc,_0x6b6b82,_0x56589c['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x2dc352,content:_0x4d0a87,version:_0xdd5f9a,aiBalloon:_0xe6c9db}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x4d0a87,_0xdd5f9a,_0xe6c9db,_0x2dc352)['catch'](_0x32dbc9=>{this['_isAbortError'](_0x32dbc9)||console['error']('Error\x20refreshing\x20interaction:',_0x32dbc9);});}['_isAbortError'](_0x302e91){return!!_0x302e91['message']&&_0x302e91['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x3d405a=this['_interactions']['length'];this['_currentInteractionIndex']<_0x3d405a-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x2fbbf9){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x2fbbf9;const _0x1d6544=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x1d6544)return;if(_0x1d6544['hasError'])return this['_setErrorState'](_0x1d6544),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x1d6544['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x218f05=_0x1d6544['replies'][_0x1d6544['replies']['length']-0x1];if(_0x218f05){const _0x2904ac=this['editor'];try{const _0x3fec6d=J({'editor':_0x2904ac,'changeGroups':_0x218f05['changeGroups'],'documentContextContent':_0x218f05['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x540c6e=>setTimeout(_0x540c6e,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x3fec6d[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x5d820a){this['_isAbortError'](_0x5d820a)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x5d820a);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x2a3f65){const _0x52281c=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x52281c),_0x2a3f65['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class Fa extends _0x511be8{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x51e265){super(_0x51e265),_0x51e265['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ys extends _0x184e76{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x31a872,_0x2dcb0){super(_0x31a872),this['id']=_0x2dcb0,this['set']('status','pending'),this['set']('changeId',_0x2dcb0),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x4ce771,_0x172959)=>{_0x172959&&_0x172959['target']&&'A'===_0x172959['target']['tagName']&&_0x172959['preventDefault'](),this['fire']('activateChange',{'id':_0x2dcb0,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x2dcb0,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x2dcb0,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x26b70b=new _0x184e76(this['locale']);return _0x26b70b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x3db49a=>!_0x3db49a)]}}),_0x26b70b;}['_createAcceptButtonView'](){const _0x104519=new _0x1e9460(this['locale']);return _0x104519['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x104519['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x112e94=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x112e94['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x592a1e=>'pending'!==_0x592a1e&&'accepted'!==_0x592a1e),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x53bd69=>'pending'===_0x53bd69),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x58cbcf=>'accepted'===_0x58cbcf)]}}),this['on']('change:status',(_0x125a93,_0x192178,_0x45052a)=>{_0x104519['isEnabled']='pending'===_0x45052a,'accepted'===_0x45052a&&(_0x104519['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x104519['icon']=_0x34e643);}),_0x104519;}['_createDismissButtonView'](){const _0x5ebf62=new _0x1e9460(this['locale']);return _0x5ebf62['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5ebf62['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x105094=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x105094['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x4dd975=>'pending'!==_0x4dd975&&'rejected'!==_0x4dd975),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x114b00=>'pending'===_0x114b00),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x38377e=>'rejected'===_0x38377e)]}}),this['on']('change:status',(_0xe59619,_0x5410bc,_0xb655fb)=>{_0x5ebf62['isEnabled']='pending'===_0xb655fb,'rejected'===_0xb655fb&&(_0x5ebf62['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x5ebf62['icon']=_0x557804);}),_0x5ebf62;}['_createInfoButtonView'](){const _0x2e4015=new _0x1e9460(this['locale']);return _0x2e4015['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x42893a,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x2e4015['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3bc9b5=>_0x3bc9b5),_0x2e4015['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x2e4015;}['_createOutdatedButtonView'](){const _0x25ca5c=new _0x1e9460(this['locale']);return _0x25ca5c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':tc,'withText':!0x0,'isEnabled':!0x1}),_0x25ca5c['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x74a24f=>'outdated'!==_0x74a24f)],'disabled':'disabled'}}),_0x25ca5c;}}class me extends _0x2fff3d{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x8c3910,_0x3624e5){super(_0x8c3910),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x3624e5['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x4b7657){this['resultItemView']['changeId']=_0x4b7657['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x4b7657['contentDiffed'];}['showBalloon'](_0x1b66dd,_0xcb63c7,_0x2c62ef,_0x18ba81,_0x30c1c5,_0x510308){const _0x2e33d7=_0xcb63c7();if(!_0x2e33d7)return;this['updateContent'](_0x1b66dd),this['show']();const _0x2da1ba=Array['from'](_0x2e33d7['getClientRects']())['reverse'](),_0x3a685e=this['_getPointedRectIndexFromEvent'](_0x2c62ef,_0x2da1ba),_0x2247d2=_0x2da1ba[_0x3a685e??0x0];'click'===_0x18ba81?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0xcb63c7(),_0x3a685e,_0x1b66dd['id'],_0x30c1c5,_0x510308)||_0x2247d2})):'hover'===_0x18ba81&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0xcb63c7(),_0x3a685e,_0x1b66dd['id'])||_0x2247d2}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x1ff4d5({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x39310f=[this['element']];return this['_pinnedTargetElement']&&_0x39310f['push'](this['_pinnedTargetElement']),_0x39310f;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x3d0d32=new _0x184e76();return this['resultItemView']=new Ys(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x3d0d32['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x3d0d32;}['_getBestRectPositionOnClick'](_0x3424f6,_0x16fcc8,_0x3400f3,_0x3d9be0,_0x4e7f6a){if(!_0x3424f6)return null;const _0x1fe2de=this['position']['replace']('arrow_',''),_0x214fd9=Array['from'](_0x3424f6['getClientRects']());let _0x376c08,_0xdd9b3e=_0x214fd9['reverse']();return void 0x0!==_0x16fcc8&&this['_isPinnedRectVisible'](_0xdd9b3e[_0x16fcc8],_0x3d9be0,_0x4e7f6a)?(_0x376c08=_0xdd9b3e[_0x16fcc8],this['_pinnedRectIndex']=_0x16fcc8):this['_isPinnedRectVisible'](_0xdd9b3e[0x0],_0x3d9be0,_0x4e7f6a)&&void 0x0===_0x16fcc8?_0x376c08=_0xdd9b3e[0x0]:(_0xdd9b3e='s'==_0x1fe2de[0x0]?[..._0x214fd9]['reverse']():_0x214fd9,_0xdd9b3e['forEach'](_0x34de7e=>{this['_isPinnedRectVisible'](_0x34de7e,_0x3d9be0,_0x4e7f6a)&&(_0x376c08=_0x34de7e);})),this['_pinnedTargetChangeId']=_0x3400f3,this['_pinnedTargetElement']=_0x3424f6,_0x376c08||_0x3424f6['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x21c0a2,_0x160c8a,_0x5a858e){if(!_0x21c0a2)return null;const _0x97f1e1=Array['from'](_0x21c0a2['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x160c8a&&this['_pinnedTargetChangeId']!==_0x5a858e)return this['_pinnedRectIndex']=_0x160c8a,this['_pinnedTargetElement']=_0x21c0a2,this['_pinnedTargetChangeId']=_0x5a858e,_0x97f1e1[_0x160c8a];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x5a858e){if(_0x21c0a2!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x97f1e1[this['_pinnedRectIndex']];}return void 0x0!==_0x160c8a&&this['_pinnedTargetChangeId']!==_0x5a858e?(this['_pinnedRectIndex']=_0x160c8a,this['_pinnedTargetElement']=_0x21c0a2,this['_pinnedTargetChangeId']=_0x5a858e,_0x97f1e1[_0x160c8a]):_0x21c0a2['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x281fa8,_0x2de490){if(_0x281fa8)for(let _0x52587c=0x0;_0x52587c<_0x2de490['length'];_0x52587c++){const _0x4546d8=_0x2de490[_0x52587c];if(_0x281fa8['clientX']>=_0x4546d8['left']-0x3&&_0x281fa8['clientX']<=_0x4546d8['right']+0x3&&_0x281fa8['clientY']>=_0x4546d8['top']-0x3&&_0x281fa8['clientY']<=_0x4546d8['bottom']+0x3)return _0x52587c;}}['_isPinnedRectVisible'](_0xfe98e0,_0x47e48c,_0x102168){const _0x5e98b5=new _0x5b8f6e(_0xfe98e0),_0x331b6c=_0x47e48c||document['documentElement'],_0x3eecfc=_0x5e98b5['getIntersection'](_0x3e7313(_0x102168)),_0x52664d=new _0x5b8f6e(_0x331b6c)['getIntersection'](_0x5e98b5);return!!(_0x3eecfc&&_0x52664d&&_0x5e98b5['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x575928{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[pt];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x352314){super(_0x352314),this['_bodyCollection']=new _0x591ff4(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ih)['to'](this),this['_balloonSuggestionView']=new me(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x21d375=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x21d375);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x20a938){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x35bdaa=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x20a938,_0x35bdaa);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x530a8c){_0x530a8c&&('error-general'!==_0x530a8c['status']?'error-chunk'!==_0x530a8c['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x29eabc){this['_mainView']['addCheckRunResult'](_0x29eabc);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x46edfd){this['_mainView']['showGeneralReviewCoreErrorView'](_0x46edfd??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x556647,_0x5d5268){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x556647,_0x5d5268);}['setActiveStateInResults'](_0x33c99e){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3da98e=>{_0x3da98e['id']===_0x33c99e&&_0x3da98e['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x37b890=>_0x37b890['setItemAsInactive']());}['updateChangeState'](_0x4c0fcd,_0x4793a8){'accepted'===_0x4793a8||'rejected'===_0x4793a8||'outdated'===_0x4793a8?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x4c0fcd,_0x4793a8):this['_mainView']['reviewCheckResultsView']['showResult'](_0x4c0fcd,_0x4793a8);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x1cd9cb,_0x27c4a1,_0x474f67,_0x2d646b,_0x18b005,_0x54ba9d){this['_balloonSuggestionView']['showBalloon'](_0x1cd9cb,_0x27c4a1,_0x474f67,_0x2d646b,_0x18b005,_0x54ba9d);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x3d5188){const _0x21a69a=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x52e8fc=>_0x52e8fc['id']===_0x3d5188);return _0x21a69a?_0x21a69a['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x184e76{constructor(_0xd7889f){super(_0xd7889f),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x1ab342=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x1ab342['if']('isVisible','ck-hidden',_0x3a4a1a=>!_0x3a4a1a)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x1ab342['to']('errorMessage')}]}]});}}class Ae extends _0x184e76{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x26018c,_0x578d45){super(_0x26018c),this['reviewCoreHeader']=_0x578d45['header'],this['generalErrorView']=new sh(_0x26018c),this['reviewCheckListView']=_0x578d45['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x578d45['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x578d45['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x5838fe){this['reviewCheckResultsView']['addResult'](_0x5838fe),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x3aed4b){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x3aed4b;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class vr extends _0x1e9460{constructor(_0x19f380,_0x3b9d84){super(_0x3b9d84),this['set']({'label':_0x19f380,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x4ffa3a{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x4ca5c7,_0x4092b9){super(_0x4ca5c7),this['_contents']=_0x4092b9,this['_resultViews']=new _0x4e90c7(),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 fi(_0x4ca5c7),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 _0xe51b9f=this['_createCombinedSkeletonLoader'](),_0x1becce=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x1becce['if']('isLoading','ck-ai_review__check-run_loading',_0x47ad48=>_0x47ad48),_0x1becce['if']('isResultReady','ck-ai_review__check-run_ready',_0x3a0959=>_0x3a0959),_0x1becce['if']('isVisible','ck-hidden',_0xa578a1=>!_0xa578a1)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x364b6a=>_0x364b6a)]},'children':this['_resultViews']},_0xe51b9f]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x58f21e){const _0x1ef32f=new Ys(this['locale'],_0x58f21e['id']);_0x1ef32f['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x1ef32f),_0x1ef32f['resultResponseView']['element']['innerHTML']=_0x58f21e['contentDiffed'];}['hideResult'](_0x553e86,_0x476bd4){if('pending'===_0x476bd4)return;const _0x275b25=this['_resultViews']['find'](_0xec24c=>_0xec24c['id']===_0x553e86);_0x275b25&&(_0x275b25['status']=_0x476bd4,_0x275b25['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0xa66652,_0x38c275){if('pending'!==_0x38c275)return;const _0x42930e=this['_resultViews']['find'](_0xde2792=>_0xde2792['id']===_0xa66652);_0x42930e&&(_0x42930e['status']=_0x38c275,_0x42930e['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x5b91b4,_0xb67157){this['headerTitle']=_0x5b91b4,this['headerSubtitle']=_0xb67157||'';}['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 ai(this['locale'],di['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x3d54e2=new _0x184e76(this['locale']),_0x63070f=[];for(let _0x3b2f90=0x0;_0x3b2f90<0x10;_0x3b2f90++){const _0x462480=this['_createSkeletonLoader']();_0x462480['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x63070f['push'](_0x462480);}return _0x3d54e2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x580e67=>!_0x580e67)]},'children':_0x63070f}),_0x3d54e2;}['_createErrorView'](){const _0x41586f=new _0x184e76(this['locale']),_0x1bab11=new _0x1e9460(this['locale']),t=this['locale']['t'];return _0x41586f['delegate']('retryReview')['to'](this),_0x1bab11['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x1bab11['on']('execute',()=>{this['fire']('retryReview');}),_0x41586f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x110eb0=>!_0x110eb0),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x4d50f4=>'chunk'===_0x4d50f4)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0xf242a7=>'chunk'===_0xf242a7)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2fab51=>'general'!==_0x2fab51)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4548b5=>'chunk'!==_0x4548b5)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x1bab11]}),_0x41586f;}['_createCancelButtonView'](){const _0x3db49c=new _0x1e9460(this['locale']);return _0x3db49c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x2ff977}),_0x3db49c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x363265=>_0x363265),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5c162a=>_0x5c162a)]}}),_0x3db49c['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x3db49c;}['_createToggleDiffButtonView'](){const _0x4e1c6a=new _0x1e9460(this['locale']);_0x4e1c6a['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4e1c6a['bind']('isEnabled')['to'](this,'isError',_0x252d0d=>!_0x252d0d),_0x4e1c6a['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3e5653=>!_0x3e5653),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x550378=>_0x550378)]}});const _0x3a9951=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x452a27=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4e1c6a['bind']('isOn')['to'](this,'isToggleDiffOn',_0xe8f923=>_0xe8f923),_0x4e1c6a['bind']('icon')['to'](this,'isToggleDiffOn',_0x1cd138=>_0x1cd138?_0x1597a1:_0x11989d),_0x4e1c6a['bind']('label')['to'](this,'isToggleDiffOn',_0x50286c=>_0x50286c?_0x3a9951:_0x452a27),_0x4e1c6a['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4e1c6a;}['_createAcceptAllButtonView'](){const _0x466aed=new _0x1e9460(this['locale']);return _0x466aed['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x466aed['bind']('isEnabled')['to'](this,'isError',_0x9e1a38=>!_0x9e1a38),_0x466aed['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x28e38e=>!_0x28e38e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4c4c7c=>_0x4c4c7c)]}}),_0x466aed['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x466aed;}['_createExitReviewButtonView'](){const _0x1431a6=new _0x1e9460(this['locale']);return _0x1431a6['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x1431a6['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2acad1=>!_0x2acad1),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1a3a07=>_0x1a3a07)]}}),_0x1431a6['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x1431a6;}['_createResultHeaderView'](){const _0x555882=new _0x184e76(this['locale']),_0x30ac58=this['_createTitleView']();return _0x555882['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x4c69f3=>_0x4c69f3)]},'children':[_0x30ac58,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x555882;}['_createTitleView'](){const _0x4c42e0=new _0x184e76(this['locale']),_0x5598c2=new li();return _0x5598c2['bind']('isVisible')['to'](this,'isResultReady',_0x386b2d=>!_0x386b2d),_0x4c42e0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x5598c2,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x25f516=>_0x25f516)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x18473e=>!_0x18473e)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x4c42e0;}['_createFinishReviewButtonView'](){const _0x153abc=new vr(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x153abc['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x47392a=>!_0x47392a)]}}),_0x153abc['delegate']('finishReview')['to'](this),_0x153abc;}}class be extends _0x4ffa3a{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x1d6488,_0x545afe){super(_0x1d6488),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x545afe['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x545afe['headerText']);const _0xc72373=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0xc72373['if']('isVisible','ck-hidden',_0x2a14e2=>!_0x2a14e2)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x545afe['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x1cc2c9){const _0x5493ae=new vr(_0x1cc2c9,this['locale']);return _0x5493ae['delegate']('finishReview')['to'](this),_0x5493ae;}['_createResultHeaderView'](_0x34c6fa){const _0x22b2d8=new _0x184e76(this['locale']);return _0x22b2d8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x34c6fa}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x22b2d8;}}class Dr extends _0x184e76{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0xdfd6fa,_0x3c40fc){super(_0xdfd6fa),this['_defaultValue']=_0x3c40fc['default']||(_0x3c40fc['data']['length']>0x0?_0x3c40fc['data'][0x0]['id']:''),this['_defaultLabel']=_0x3c40fc['data']['find'](_0x28ac00=>_0x28ac00['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x546896(this['locale']);const _0x621f2b=this['_prepareListOptions'](_0x3c40fc['data']);_0x321091(this['_dropdownView'],_0x621f2b,{'role':'menu','ariaLabel':_0x3c40fc['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x37d256=>{_0x37d256['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x46bf55=>{this['formValue']=_0x46bf55['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x46bf55['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x25f986=[]){const _0x57fcdb=new _0x4b57cf();this['resetToDefault']();for(const _0x43c512 of _0x25f986){const _0x5737f9=new _0xf9ff1d({'label':_0x43c512['label'],'withText':!0x0,'role':'menuitemradio','id':_0x43c512['id'],'model':_0x43c512});_0x5737f9['bind']('isOn')['to'](this,'formValue',_0xdfafe9=>_0xdfafe9===_0x5737f9['id']);const _0xa0cbe5={'type':'button','model':_0x5737f9};_0x57fcdb['add'](_0xa0cbe5);}return _0x57fcdb;}}class sc extends _0x4ffa3a{['_formItem']=null;constructor(_0x17472f,_0x540274,_0x2228d1){super(_0x17472f),this['argsKey']=_0x540274?.['argsKey'];if('dropdown'===_0x540274['formType'])this['_formItem']=new Dr(this['locale'],_0x540274);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x4937a0=new _0x20574d(this['locale'],{'children':[this['_formItem']],'class':[_0x2228d1?'ck-form__row_with-submit':'']});_0x2228d1&&_0x4937a0['children']['add'](_0x2228d1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x4937a0]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class po extends _0x2dac43{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x51189b){super(_0x51189b),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x2b0c94(),this['minRows']=po['MIN_ROWS'],this['maxRows']=po['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class cc extends _0x184e76{['focusTracker']=new _0x22c832();['keystrokes']=new _0x2b0c94();['focusCycler'];['_focusables']=new _0x4e90c7();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x5a319d,_0xbe878f,_0x2f4a6d=!0x1){super(_0x5a319d),this['_check']=_0xbe878f,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0xbe878f['defaultModel']?_0xbe878f['defaultModel']['id']:'',this['_defaultLabel']=_0xbe878f['defaultModel']?_0xbe878f['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0xfba0d2(this['locale'],()=>new po(_0x5a319d)),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 _0x4b57cf(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x2f4a6d),_0x321091(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x20574d(this['locale'],{'children':[this['promptInputView']]}),new _0x20574d(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x1c023a,_0x3a85af)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x3a85af()):_0x3a85af();}),this['focusCycler']=new _0x56c0d3({'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'](_0x2b3755=>{this['_focusables']['add'](_0x2b3755),this['focusTracker']['add'](_0x2b3755['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 _0xe7278a of this['_getFormValidators']()){const _0xd1038a=_0xe7278a();if(_0xd1038a)return this['promptInputView']['errorText']=_0xd1038a,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0xf8ce83=new _0x1e9460(this['locale']),t=this['locale']['t'];return _0xf8ce83['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0xf8ce83['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xf8ce83;}['_createCancelButtonView'](){const _0x117440=new _0x1e9460(this['locale']),t=this['locale']['t'];return _0x117440['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x117440['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2dc79b=>{_0x2dc79b['stopPropagation']();})}}),_0x117440['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x117440;}['_setModelList'](_0x5d1f5d){this['_modelSelectionDropdownItems']['clear']();const _0x34a69b=this['_check']['models'];if(_0x5d1f5d)this['set']('modelDisplayMode','hidden');else{const _0x3bd3cf=0x1===_0x34a69b['length'];this['set']('modelDisplayMode',_0x3bd3cf?'name':'selector');}if(this['resetToDefault'](),_0x34a69b?.['length']){0x1===_0x34a69b['length']&&this['set']('activeModelName',_0x34a69b[0x0]['name']||_0x34a69b[0x0]['id']);for(const _0x4b3e21 of _0x34a69b){const _0x2c0962=new _0xf9ff1d({'label':_0x4b3e21['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4b3e21['id'],'model':_0x4b3e21});_0x2c0962['bind']('isOn')['to'](this,'modelId',_0x171be4=>_0x171be4===_0x4b3e21['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2c0962,'labelView':new ko(this['locale'],_0x4b3e21)});}}}['_createModelSelectionDropdown'](){const _0x4ab93a=_0x546896(this['locale']);return _0x4ab93a['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x4ab93a['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x4ab93a['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x312c17=>'selector'===_0x312c17),this['listenTo'](_0x4ab93a,'execute',_0x3d5501=>{this['modelId']=_0x3d5501['source']['model']['id'],_0x4ab93a['buttonView']['label']=_0x3d5501['source']['label'];}),_0x4ab93a;}['_createModelNameView'](){const _0x394e04=new _o(this['locale']);return _0x394e04['bind']('text')['to'](this,'activeModelName',_0x42d7a1=>_0x42d7a1??''),_0x394e04['bind']('isVisible')['to'](this,'modelDisplayMode',_0x879ffb=>'name'===_0x879ffb),_0x394e04;}['_createActionsFooterView'](){const _0x398f9d=new _0x184e76(this['locale']);return _0x398f9d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x398f9d;}}class _o extends _0x184e76{constructor(_0xf12add){super(_0xf12add),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0xc5824d=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0xc5824d['if']('isVisible','ck-hidden',_0x1e2ec0=>!_0x1e2ec0)]},'children':[{'text':_0xc5824d['to']('text')}]});}}class ko extends _0x55674c{constructor(_0x17c4be,_0x16b05c){super();const _0x435742=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x435742['to']('style'),'id':_0x435742['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x435742['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x16b05c['description']||'']}]}]});}}class ec extends _0x4ffa3a{['_formItemsCollection']=new _0x4e90c7();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x30fcbd,_0x4c1095,_0xe8996a,_0x443aac=!0x1){super(_0x30fcbd),this['_hideModels']=_0x443aac,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x4c1095['isParameterized']);const _0x4faa5e=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x3ef53f=>_0x3ef53f),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x2cb978=>_0x2cb978)],'style':{'--ck-ai-review-check-list-item-index':_0xe8996a}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x4c1095['title']}]},_0x4faa5e]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x4c1095['description']?[{'text':_0x4c1095['description']}]:[]}]}]},..._0x4c1095['isParameterized']?[this['_createParameterizedView'](_0x4c1095)]:[],...'custom'===_0x4c1095['id']?[this['_createCustomView'](_0x4c1095,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x4c1095['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x4c1095['id'],'args':_0x4c1095['useArgs']?_0x4c1095['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x1ff4d5({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x3176d9=>{_0x3176d9['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x13d069=new _0xc034b();return _0x13d069['content']=_0x3d890b,_0x13d069['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x13d069;}['_createParameterizedView'](_0x47a726){const _0x176735=new _0x184e76(),_0xbd53d1=this['_createFormView'](_0x47a726);return _0x176735['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x561ff5=>!_0x561ff5)]},'children':[_0xbd53d1]}),_0x176735;}['_createFormView'](_0x3bcee5){const _0x12643d=new _0x184e76(),_0x22bc0b=Array['isArray'](_0x3bcee5['options'])?_0x3bcee5['options']:[],_0x268ede=new _0x1e9460(this['locale']),t=this['locale']['t'];_0x268ede['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x268ede['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x14235a=>{_0x14235a['stopPropagation']();})}}),_0x268ede['on']('execute',()=>{const _0x57d808=[],_0x4aa6c0={};this['_formItemsCollection']['forEach'](_0x24deb0=>{_0x57d808['push'](_0x24deb0['value']),_0x3bcee5['useArgs']&&_0x3bcee5['options']&&(_0x4aa6c0[_0x24deb0['argsKey']]=_0x24deb0['value']);}),this['fire']('runReviewCheck',{'id':_0x3bcee5['id'],'params':_0x57d808['length']?_0x57d808:void 0x0,'args':Object['keys'](_0x4aa6c0)['length']?_0x4aa6c0:void 0x0});});const _0x214b5c=_0x22bc0b['length'];return _0x22bc0b['forEach']((_0x1cc148,_0x48f612)=>{const _0x4fa796=_0x48f612===_0x214b5c-0x1;this['_formItemsCollection']['add'](new sc(this['locale'],_0x1cc148,_0x4fa796?_0x268ede:null));}),_0x12643d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x12643d;}['_createCustomView'](_0xf9ff47,_0x355317=!0x1){return this['_customCheckView']=new cc(this['locale'],_0xf9ff47,_0x355317),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x334740=>!_0x334740)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x1fd4e3,_0x2992eb,_0x1ab944)=>{_0x1ab944||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x4ffa3a{['_checkViews'];constructor(_0x332220){super(_0x332220),this['_checkViews']=new _0x4e90c7(),this['_setupTemplate']();}['setChecks'](_0x409ef4,_0x531693=!0x1){this['_checkViews']['clear']();for(const [_0x4228b7,_0x3a01ed]of _0x409ef4['entries']()){const _0x453f60=new ec(this['locale'],_0x3a01ed,_0x4228b7,_0x531693);_0x453f60['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x453f60);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x43924d of this['_checkViews'])_0x43924d instanceof ec&&_0x43924d['resetToDefault']();}['_setupTemplate'](){const _0x56189d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x56189d['if']('isVisible','ck-hidden',_0x33ddc0=>!_0x33ddc0)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x63fc5=this['context']['locale'],_0x158b9d=new _0x41e0a3(_0x63fc5,{'label':i(_0x63fc5,'AI_REVIEW_MODE'),'icon':_0x375882,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x158b9d,'list':new je(_0x63fc5),'results':new Ve(_0x63fc5,{'generalErrorText':i(_0x63fc5,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x63fc5,{'headerText':i(_0x63fc5,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x63fc5,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x63fc5,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x340132=this['context']['plugins']['get']('AITabs');_0x340132['view']['on']('activateTab',(_0x5e829d,_0x3f8c68)=>{'reviewMode'===_0x3f8c68?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x340132['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x375882,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x575928{static get['requires'](){return[_0x29a341,D];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x1d2fae){super(_0x1d2fae),this['_domEmitter']=new(_0x48ef7b())(),this['_eventEmitter']=new(_0x290e58())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x505ac1=T(this['context']);_0x505ac1['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x8721f3,{writer:_0x2d6b91})=>{const _0x3c8f2b=this['_markers']['get'](_0x8721f3['markerName']),_0x33bdeb={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x3c8f2b?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x8721f3['markerName']};return _0x2d6b91['createUIElement']('span',_0x33bdeb,function(_0x148abf){const _0x409243=this['toDomElement'](_0x148abf);return _0x409243['innerHTML']=_0x3c8f2b?.['content']?.['asString']||'',_0x409243;});}}),_0x505ac1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x210c88=>{const _0xb38077=this['_markers']['get'](_0x210c88['markerName']),_0x4128be=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0xb38077?.['id']||'')&&_0x4128be['push']('ck-ai_review__change_active'),{'classes':_0x4128be,'attributes':{'data-marker-id':_0x210c88['markerName']}};}}),_0x505ac1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x5952b5=>{const _0x321d43=this['_markers']['get'](_0x5952b5['markerName']),_0x16ef5a=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x321d43?.['id']||'')&&_0x16ef5a['push']('ck-ai_review__change_active'),{'classes':_0x16ef5a,'attributes':{'data-marker-id':_0x5952b5['markerName']}};}}),_0x505ac1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x27ad83=>{const _0x5cc172=this['_markers']['get'](_0x27ad83['markerName']),_0x13e83e=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x5cc172?.['id']||'')&&_0x13e83e['push']('ck-ai_review__change_active'),{'classes':_0x13e83e,'attributes':{'data-marker-id':_0x27ad83['markerName']}};}}),_0x505ac1['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x559b86,{writer:_0xa02c63})=>_0xa02c63['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x559b86['isOpening']?'start':'end')})}),_0x505ac1['conversion']['for']('downcast')['attributeToAttribute']({'model':Ct,'view':_0x169cf0});const _0x50152d=_0x505ac1['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x50152d,'mouseup',(_0x56d291,_0x576d74)=>{const _0x4f145c=_0x576d74['target'],_0x80c127=this['_findMarkerElement'](_0x4f145c);if(!_0x80c127)return;const _0x39080d=_0x80c127['getAttribute']('data-marker-id'),_0x57f3b8=_0x39080d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x39080d,'changeId':_0x57f3b8,'markerElement':()=>this['_findMarkerElementById'](_0x39080d),'domEvent':_0x576d74});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x50152d,'mouseover',(_0x421c07,_0x58b45b)=>{const _0x18c613=_0x58b45b['target'],_0x1b7fdf=_0x58b45b['relatedTarget'];let _0x10842e=this['_findMarkerElement'](_0x18c613);if(!_0x10842e&&_0x1b7fdf&&(_0x10842e=this['_findMarkerElement'](_0x1b7fdf)),!_0x10842e)return;const _0x268523=_0x10842e['getAttribute']('data-marker-id'),_0x190130=_0x268523['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x190130,'markerElement':()=>this['_findMarkerElementById'](_0x268523),'domEvent':_0x58b45b});}),this['_domEmitter']['listenTo'](document,'mouseover',_0xd2e461((_0x1a249f,_0x3b1e0b)=>{const _0x34af3a=_0x3b1e0b['target'];if(this['_findMarkerElement'](_0x34af3a))return;_0x34af3a['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x505ac1['model']['document']['registerPostFixer'](_0x2c2d63=>this['_validateMarkers'](_0x505ac1,_0x2c2d63)),_0x505ac1['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x505ac1));}['getDocumentData'](){const _0x2a77d5=this['context']['plugins']['get']('AIEditing'),_0x140a53=T(this['context']),_0x5580b7=_0x140a53['model'],_0x4ef405=new tt();for(const _0xb600b0 of _0x5580b7['document']['getRoot']()['getChildren']()){const _0x3d0688=_0xb600b0['_clone'](!0x0);_0x4ef405['_appendChild'](_0x3d0688);}for(const _0x1696ec of _0x5580b7['markers'])_0x4ef405['markers']['set'](_0x1696ec['name'],this['_changeRangeOwnerDocument'](_0x1696ec['getRange']()['clone'](),_0x4ef405));const _0x3f7426=new _0x3f0c2e({'ignoreElementEnd':!0x0,'startPosition':_0x5580b7['createPositionAt'](_0x4ef405,0x0)}),_0x3c8fce=new Set(),_0x3cf7f4=new Map();for(const {item:_0x239d39}of _0x3f7426){if(!_0x239d39['is']('$textProxy'))continue;const _0x43604d=_0x239d39['parent'];if(_0x43604d&&_0x43604d['is']('element')){const _0xbe55b0=this['_upsertDataId'](_0x43604d,()=>_0x2a77d5['_nextDataId'](_0x3c8fce));_0x3c8fce['add'](_0xbe55b0);for(const _0x5ab743 of _0x43604d['getChildren']())_0x5ab743['is']('element')&&_0x3c8fce['add'](this['_upsertDataId'](_0x5ab743,()=>_0x2a77d5['_nextDataId'](_0x3c8fce)));let _0x1a3b17=_0x43604d;for(;_0x1a3b17['parent']&&!_0x1a3b17['parent']['is']('documentFragment');)_0x1a3b17=_0x1a3b17['parent'],_0x1a3b17['hasAttribute'](Ct)&&_0x1a3b17['_removeAttribute'](Ct);_0x3cf7f4['set'](_0xbe55b0,{'path':_0x43604d['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x1a3b17['_clone'](!0x0),_0xbe55b0,_0x140a53['data'])}),_0x3f7426['jumpTo'](_0x5580b7['createPositionAfter'](_0x43604d));}}return{'content':_0x140a53['data']['processor']['toData'](_0x140a53['data']['toView'](_0x4ef405)),'version':_0x140a53['model']['document']['version'],'elements':_0x3cf7f4};}['diffContent'](_0x14b8c9,_0x14ad1c,_0x8542fa=!0x1){const _0x249be3=[],_0xc7b55=T(this['context']),_0x408b3e=_0xc7b55['data']['parse'](_0x14ad1c,'$documentFragment'),_0x1db28c=_0xc7b55['data']['parse'](_0x14b8c9,'$documentFragment'),_0x25973b=_0xc7b55['model']['createPositionAt'](_0x1db28c,0x0);if(this['_haveSingleTopLevelElement'](_0x408b3e)){if(!this['_hasSameTopLevelElement'](_0x1db28c,_0x408b3e))return _0x249be3;}else{const _0x285765=_0xc7b55['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x1db28c,_0x285765)||!this['_haveOnlyInlineContent'](_0x408b3e,_0x285765))return _0x249be3;}const _0x104793=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x14b8c9,_0x14ad1c,{'anchor':_0x25973b,'markDeletions':!0x0})['getOperations']()['filter'](_0x571f82=>'insert'===_0x571f82['type']||'marker'===_0x571f82['type']&&_0x571f82['name']['startsWith']('$markedRemove')),_0x1b4d16=this['_groupAdjacentOperations'](_0x104793),_0x58bf19=[];if(_0x8542fa){if(_0x1b4d16['length']){const _0x3ba804=_0x1b4d16[0x0]['operations'][0x0],_0x85f2dd='insert'===_0x3ba804['type']?_0x3ba804['position']:_0x3ba804['newRange']['start'],_0x50b61e=this['_getPositionLimitingRange'](_0x85f2dd,_0xc7b55,'inside'),_0x2d1af3=_0x50b61e?_0x408b3e['getChild'](0x0)['getChildren']():_0x408b3e['getChildren'](),_0x84cb10=_0x50b61e||_0xc7b55['model']['createRangeIn'](_0x1db28c),_0x1e2b72=[new _0x57d058('$markedRemove:synthetic'+_0x926b30(),null,_0x84cb10,_0xc7b55['model']['document']['model']['markers'],!0x0,_0xc7b55['model']['document']['version']+0x1),new _0x1e2b01(_0x84cb10['end'],_0x2d1af3,_0xc7b55['model']['document']['version']+0x2)];_0x58bf19['push']({'operations':_0x1e2b72,'operationsIsolated':_0x1e2b72,'groupOffset':0x0});}}else _0x58bf19['push'](..._0x1b4d16);let _0xf0b350=0x0;return _0xc7b55['model']['change'](_0x56e607=>{for(let _0x55b497=0x0;_0x55b497<_0x58bf19['length'];_0x55b497++){const _0x5149a9=_0x58bf19[_0x55b497],_0x3ad5fe=_0x56e607['createDocumentFragment']();for(const _0x29371d of _0x1db28c['getChildren']())_0x56e607['append'](_0x29371d['_clone'](!0x0),_0x3ad5fe);for(const _0x2683a8 of _0x5149a9['operationsIsolated'])if('insert'===_0x2683a8['type']){const _0x14cd9d=_0x2683a8;_0x14cd9d['baseVersion']=null,_0x14cd9d['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x14cd9d,_0x3ad5fe),_0x56e607['batch']['addOperation'](_0x2683a8),_0xc7b55['model']['applyOperation'](_0x2683a8);const _0x3261f4='suggestion:insertion:id:authorId:'+_0xf0b350++,_0x17e552=_0xc7b55['model']['createRange'](_0x14cd9d['position'],_0x14cd9d['position']['getShiftedBy'](_0x14cd9d['howMany']));_0x3ad5fe['markers']['set'](_0x3261f4,_0x17e552);}else{if('marker'===_0x2683a8['type']&&_0x2683a8['name']['startsWith']('$markedRemove')){const _0x43d784=_0x2683a8,_0x3551b9='suggestion:deletion:id:authorId:'+_0xf0b350++;this['_changeOperationOwnerDocument'](_0x43d784,_0x3ad5fe),_0x3ad5fe['markers']['set'](_0x3551b9,_0x43d784['newRange']);}}if(_0x8542fa)_0x249be3['push']({..._0x5149a9,'context':this['_createGetContentFn'](_0x1db28c,_0xc7b55['data']),'content':this['_createGetContentFn'](_0x1db28c,_0xc7b55['data'])});else{const _0x2e5411=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x5149a9['operationsIsolated'][0x0]),_0x3ad5fe),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x5149a9['operationsIsolated'][_0x5149a9['operationsIsolated']['length']-0x1]),_0x3ad5fe));_0x3ad5fe['markers']['set'](fe+'suggestion-context',new it(_0x2e5411['start'],_0x2e5411['end'])),_0x249be3['push']({..._0x5149a9,'context':this['_createGetContextFn'](_0x3ad5fe,_0xc7b55['data'],{'ellipsisBefore':_0x2e5411['hasContentBefore'],'ellipsisAfter':_0x2e5411['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3ad5fe,_0xc7b55['data'])});}}}),_0x249be3;}['markChangePositionInEditorContent'](_0x43b6d1,_0x5aef4f){if(!_0x43b6d1['length'])return;const _0x2fce8=_0x43b6d1[0x0]['parent']['id'],_0x1bc31a=_0x5aef4f['elements']['get'](_0x2fce8);if(!_0x1bc31a)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x2fce8);const _0x4d7236=_0x1bc31a['path'],_0x5a37cb=T(this['context']),_0x470f1d=_0x5a37cb['model']['document']['history']['getOperations'](_0x5aef4f['version']),_0x2d04f4=[];for(const _0x562d8d of _0x43b6d1){const _0x2cbacd=_0x562d8d['operationsIsolated']['map'](_0x53623c=>this['_translateOperationToEditorContent'](_0x53623c,_0x4d7236,_0x5a37cb['model']['document']['getRoots']()[0x0]));if(!_0x2cbacd||!_0x2cbacd['length'])continue;const _0x13b884=_0x2cbacd['every'](_0x2723d3=>'marker'===_0x2723d3['type']&&_0x2723d3['name']['startsWith']('$markedRemove')),_0x107524={'document':_0x5a37cb['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x50dfbb=nt(_0x2cbacd,_0x470f1d,_0x107524)['operationsA'];for(const _0x5e332d of _0x50dfbb)if('insert'===_0x5e332d['type']){const _0x1b442a=_0x5e332d,_0x5ae926=_0x1b442a['nodes'];_0x5a37cb['model']['change'](_0xd5b711=>{const _0x3435bf=_0xd5b711['createDocumentFragment']();for(const _0x53c3e9 of _0x5ae926)_0xd5b711['append'](_0x53c3e9['_clone'](!0x0),_0x3435bf);_0x2d04f4['push']({'start':_0x1b442a['position'],'end':_0x1b442a['position'],'type':'insert','groupId':_0x562d8d['id'],'content':{'asString':this['_createGetContentFn'](_0x3435bf,_0x5a37cb['data'])(),'asFragment':_0x3435bf}});});}else{if('marker'===_0x5e332d['type']&&_0x5e332d['name']['startsWith']('$markedRemove')){const _0x223878=_0x5e332d;let _0x37254d='remove-text';if(_0x13b884){const _0x32e614=this['_findAdjacentContextDistance'](_0x223878['newRange']['start'],'backward',_0x5a37cb['model']['schema']),_0x1597b4=this['_findAdjacentContextDistance'](_0x223878['newRange']['end'],'forward',_0x5a37cb['model']['schema']);if(_0x32e614||_0x1597b4){const _0x4b3127=_0x223878['newRange']['start']['getShiftedBy'](-_0x32e614),_0x1a0fbd=_0x223878['newRange']['end']['getShiftedBy'](_0x1597b4);_0x2d04f4['push']({'start':_0x4b3127,'end':_0x1a0fbd,'groupId':_0x562d8d['id'],'type':'remove-context'});}else _0x37254d='remove-only';}_0x2d04f4['push']({'start':_0x223878['newRange']['start'],'end':_0x223878['newRange']['end'],'groupId':_0x562d8d['id'],'type':_0x37254d});}}}this['_insertMarkers'](_0x2d04f4);}['clearAllMarkers'](){const _0x48260e=T(this['context']);_0x48260e['model']['change'](_0x48b13b=>{for(const _0x7c474c of this['_markers']['keys']())_0x48260e['model']['markers']['get'](_0x7c474c)&&_0x48b13b['removeMarker'](_0x7c474c);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x49258f){const _0x7aa1c7=T(this['context']),_0x35d959=_0x7aa1c7['model'],_0x3606e8=_0x49258f['map'](_0x3a87e0=>this['_getMarkersDataForGroup'](_0x3a87e0))['flat']();_0x35d959['change'](_0x17066e=>{for(const _0x58623c of _0x3606e8){const _0x192a68=_0x7aa1c7['model']['markers']['get'](_0x58623c['id']);if(_0x192a68){if('insert'===_0x58623c['type']){if(!_0x58623c['content'])continue;_0x35d959['insertContent'](_0x58623c['content']['asFragment']||null,_0x192a68['getRange']()['start']);}else'remove-text'!==_0x58623c['type']&&'remove-only'!==_0x58623c['type']||_0x35d959['deleteContent'](_0x35d959['createSelection'](_0x192a68['getRange']()));_0x17066e['removeMarker'](_0x58623c['id']),this['_markers']['delete'](_0x58623c['id']);}}});}['rejectChange'](_0x4fc195){const _0xc8cdcc=T(this['context']),_0x4810c6=this['_getMarkersDataForGroup'](_0x4fc195);_0xc8cdcc['model']['change'](_0x5caffe=>{for(const _0x5a1eea of _0x4810c6)_0x5caffe['removeMarker'](_0x5a1eea['id']),this['_markers']['delete'](_0x5a1eea['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x218de0){const _0x4347d9=Array['from'](this['_markers']['values']())['filter'](_0xe1bef1=>_0xe1bef1['groupId']===_0x218de0);if(!_0x4347d9['length'])return null;const _0x2b2d5c=0x1===_0x4347d9['length']?_0x4347d9[0x0]:this['_sortMarkers'](_0x4347d9)[0x0],_0xc8ae40=T(this['context'])['model']['markers']['get'](_0x2b2d5c['id']);if(!_0xc8ae40)return null;return{'modelRange':_0xc8ae40['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x2b2d5c['id'])};}['getContentElementForChange'](_0xce6829){const _0xbd62f2=Array['from'](this['_markers']['values']())['filter'](_0x4fcc99=>_0x4fcc99['groupId']===_0xce6829);if(!_0xbd62f2['length'])return null;const _0x2f03d1=0x1===_0xbd62f2['length']?_0xbd62f2[0x0]:this['_sortMarkers'](_0xbd62f2)[0x0],_0x2aa0a4=T(this['context']),_0x2622e9=_0x2aa0a4['model']['markers']['get'](_0x2f03d1['id']);if(!_0x2622e9)return null;const _0x1adbc0=_0x2622e9['getRange'](),_0x5180bc=_0x2aa0a4['editing']['view']['getDomRoot']();if(!_0x5180bc||!_0x1adbc0)return null;let _0x1a1545=_0x1adbc0['start']['parent'];for(;_0x1a1545['parent']&&'$root'!==_0x1a1545['parent']['name'];)_0x1a1545=_0x1a1545['parent'];if(!_0x1a1545||!_0x1a1545['name'])return null;const _0x111ca5=_0x5180bc['querySelector']('[data-marker-id=\x22'+_0x2f03d1['id']+'\x22]');if(!_0x111ca5)return null;let _0x3b7b58=null;_0x2aa0a4['model']['change'](_0x53be9b=>{_0x3b7b58=_0x53be9b['createDocumentFragment'](),_0x53be9b['append'](_0x1a1545['_clone'](!0x0),_0x3b7b58);});const _0x482665=_0x2aa0a4['data']['toView'](_0x3b7b58)['getChild'](0x0);return _0x111ca5['closest'](_0x482665['name']);}['reactivateMarkers'](_0x133c42){const _0x153bae=this['_getMarkersDataForGroup'](_0x133c42);if(!_0x153bae['length'])return;const _0x41a34e=Array['from'](this['_activeMarkers'])['sort'](),_0x433e54=Array['from'](new Set(_0x153bae['map'](_0x1677a4=>_0x1677a4['id'])))['sort']();_0x41a34e['join']('|')!==_0x433e54['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x133c42));}['setMarkersInElementAsActive'](_0x176178){const _0x284f00=this['_getMarkersDataForGroup'](_0x176178);if(!_0x284f00['length'])return;const _0x6b286c=T(this['context']),_0x5838d4=new Set(_0x284f00['map'](_0x58092b=>_0x58092b['id'])),_0x44f684=Array['from'](_0x5838d4['values']())['map'](_0x207816=>_0x6b286c['model']['markers']['get'](_0x207816))['filter'](_0x59c0e4=>!!_0x59c0e4);_0x5838d4['forEach'](_0x46e4b2=>{this['_activeMarkers']['add'](_0x46e4b2);}),_0x6b286c['model']['change'](()=>{_0x44f684['forEach'](_0x53a744=>{_0x6b286c['editing']['reconvertMarker'](_0x53a744);});});}['setAllMarkersAsInactive'](){const _0x12a77b=Array['from'](this['_activeMarkers']);if(!_0x12a77b['length'])return;this['_activeMarkers']['clear']();const _0x52bb63=T(this['context']),_0x27485d=_0x12a77b['map'](_0xfb85d9=>_0x52bb63['model']['markers']['get'](_0xfb85d9))['filter'](_0xc6d692=>!!_0xc6d692);_0x52bb63['model']['change'](()=>{_0x27485d['forEach'](_0x37f5b8=>{_0x52bb63['editing']['reconvertMarker'](_0x37f5b8);});});}['_getPositionLimitingRange'](_0x453077,_0x46d7c8,_0x38f41f='outside'){if(!_0x453077)return null;let _0x52e673=_0x453077['parent'];for(;_0x52e673&&_0x52e673['parent']&&'$root'!==_0x52e673['parent']['name']&&!_0x46d7c8['model']['schema']['isLimit'](_0x52e673)&&!_0x46d7c8['model']['schema']['isBlock'](_0x52e673);)_0x52e673=_0x52e673['parent'];if(!_0x52e673||!_0x52e673['name']||'$root'===_0x52e673['name'])return null;let _0x3a9e16=null;return _0x46d7c8['model']['change'](_0x3dc31e=>{_0x3a9e16='inside'===_0x38f41f?_0x3dc31e['createRangeIn'](_0x52e673):_0x3dc31e['createRangeOn'](_0x52e673);}),_0x3a9e16;}['_validateMarkers'](_0x175657,_0x3fbacb){const _0xc1f02d=Array['from'](this['_markers']['keys']()),_0xe91ef=new Map();for(const _0x23a02e of _0xc1f02d){const _0x58ab62=_0x175657['model']['markers']['get'](_0x23a02e);if(!_0x58ab62)continue;const _0x49cd35=_0x58ab62['getStart']()['path'][0x0];_0xe91ef['has'](_0x49cd35)||_0xe91ef['set'](_0x49cd35,[]),_0xe91ef['get'](_0x49cd35)['push'](_0x58ab62);}const _0x57a9de=new Set();for(const _0x1960e1 of _0x175657['model']['document']['differ']['getChanges']()){let _0x44129e=-0x1,_0x490e7f=null;if('insert'===_0x1960e1['type'])_0x490e7f=new it(_0x1960e1['position'],_0x1960e1['position']['getShiftedBy'](_0x1960e1['length'])),_0x44129e=_0x1960e1['position']['path'][0x0];else{if('remove'!==_0x1960e1['type'])continue;_0x490e7f=new it(_0x1960e1['position']),_0x44129e=_0x1960e1['position']['path'][0x0];}const _0x511db2=_0xe91ef['get'](_0x44129e)||[];if(_0x511db2['length']){for(const _0x532be5 of _0x511db2)if(_0x490e7f['root']['rootName']===_0x532be5['getRange']()['root']['rootName']&&('insert'!==_0x1960e1['type']||!_0x490e7f['containsRange'](_0x532be5['getRange']()))&&(_0x490e7f['isIntersecting'](_0x532be5['getRange']())||_0x490e7f['start']['isTouching'](_0x532be5['getRange']()['end'])||_0x490e7f['end']['isTouching'](_0x532be5['getRange']()['start']))){const _0x18d08b=this['_parseMarkerName'](_0x532be5['name']);Array['from'](this['_markers']['values']())['filter'](_0x556d05=>_0x556d05['groupId']===_0x18d08b['groupId'])['forEach'](_0x188704=>_0x57a9de['add'](_0x188704['id']));}}}if(_0x57a9de['size']){for(const _0x3a8ed2 of _0x57a9de)_0x3fbacb['removeMarker'](_0x3a8ed2);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x56a833){for(const {name:_0x17dfc6,data:_0x5c8cd4}of _0x56a833['model']['document']['differ']['getChangedMarkers']()){if(!_0x17dfc6['startsWith'](fe))continue;const _0x20954f=_0x5c8cd4['oldRange'],_0x43427b=_0x5c8cd4['newRange'],_0x310a13=_0x20954f&&'$graveyard'===_0x20954f['root']['rootName'],_0xef5a16=_0x43427b&&'$graveyard'===_0x43427b['root']['rootName'];if(_0x310a13&&_0xef5a16)continue;const _0x330db9=this['_parseMarkerName'](_0x17dfc6);this['_markers']['get'](_0x17dfc6)&&(_0xef5a16||!_0x43427b?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x17dfc6,'changeId':_0x330db9['groupId']}):_0x310a13&&_0x43427b&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x17dfc6,'changeId':_0x330db9['groupId']}));}}['_parseMarkerName'](_0x4e6c1c){const _0x18045f=_0x4e6c1c['split'](':'),_0x54c87c=(_0x18045f[0x1]||'')['split']('_');return{'prefix':_0x18045f[0x0],'groupId':_0x54c87c[0x0],'suffix':_0x54c87c[0x1]};}['_translateOperationToEditorContent'](_0x185a16,_0x2491b2,_0x2f610f){if('insert'===_0x185a16['type']){const _0x518bf1=_0x185a16;return new _0x1e2b01(this['_changePosition'](_0x2491b2['concat'](_0x518bf1['position']['offset']),_0x2f610f),_0x518bf1['nodes'],_0x518bf1['baseVersion']);}if('marker'===_0x185a16['type']&&_0x185a16['name']['startsWith']('$markedRemove')){const _0x425c9e=_0x185a16;return new _0x57d058(_0x425c9e['name'],_0x425c9e['oldRange'],this['_changeRange'](_0x425c9e['newRange'],_0x2491b2['concat'](_0x425c9e['newRange']['start']['offset']),_0x2491b2['concat'](_0x425c9e['newRange']['end']['offset']),_0x2f610f),_0x425c9e['_markers'],_0x425c9e['affectsData'],_0x425c9e['baseVersion']);}return _0x185a16;}['_groupAdjacentOperations'](_0x36b8ba){if(!_0x36b8ba['length'])return[];const _0x577c79=[];let _0x1d678b=0x0,_0x15e6fe=0x0,_0x509512=[];for(let _0x16e94c=0x0;_0x16e94c<=_0x36b8ba['length'];_0x16e94c++){const _0x44a7fb=_0x36b8ba[_0x16e94c],_0x137128=_0x36b8ba[_0x16e94c-0x1];!_0x44a7fb||_0x137128&&!this['_getOperationEnd'](_0x137128)['isTouching'](this['_getOperationStart'](_0x44a7fb))?(_0x577c79['push']({'operations':_0x509512,'operationsIsolated':_0x509512['map'](_0x1b7955=>this['_shiftOperation'](_0x1b7955['clone'](),-_0x15e6fe)),'groupOffset':_0x1d678b}),_0x509512=_0x44a7fb?[_0x44a7fb]:[],_0x15e6fe+=_0x1d678b,_0x1d678b=0x0):_0x509512['push'](_0x44a7fb),_0x44a7fb&&'insert'===_0x44a7fb['type']&&(_0x1d678b+=_0x44a7fb['howMany']);}return _0x577c79;}['_findAdjacentContextDistance'](_0x1acbea,_0xbda290,_0x161683,_0xd0f704=0x1){const _0x4784dd=new _0x3f0c2e({'startPosition':_0x1acbea,'direction':_0xbda290});let _0x21973e=0x0;for(let _0x2f68f7=0x0;_0x2f68f7<_0xd0f704;_0x2f68f7++){let _0x2c4a4b=0x0,_0x70412a=!0x1,_0x38c7f2='forward'===_0xbda290?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x543ad3}of _0x4784dd)if(_0x543ad3['is']('$textProxy')){const _0x32130a=_0x38c7f2['exec'](_0x543ad3['data']);if(_0x32130a&&_0x32130a['length']){if(_0x2c4a4b+='forward'===_0xbda290?_0x32130a['index']+_0x32130a[0x0]['length']:_0x543ad3['data']['length']-_0x32130a['index'],_0x32130a[0x0]['length']!==_0x543ad3['data']['length'])break;_0x70412a=!0x0,_0x38c7f2='forward'===_0xbda290?/^\w+/:/\w+$/;}else{if(_0x70412a)break;_0x2c4a4b+=_0x543ad3['offsetSize'];}}else{if(_0x543ad3['is']('element')){_0x161683['isInline'](_0x543ad3)&&!_0x70412a&&(_0x2c4a4b+=0x1);break;}}_0x21973e+=_0x2c4a4b,_0x4784dd['jumpTo'](_0x1acbea['getShiftedBy']('forward'===_0xbda290?_0x21973e:-_0x21973e));}return _0x21973e;}['_getChangeContext'](_0x30cd4e,_0x481cd0){const _0x21b55e=T(this['context'])['model']['schema'],_0x332d3e=this['_findAdjacentContextDistance'](_0x30cd4e,'backward',_0x21b55e,0x6),_0x5926fb=this['_findAdjacentContextDistance'](_0x481cd0,'forward',_0x21b55e,0x6),_0x3703d8=_0x30cd4e['getShiftedBy'](-_0x332d3e),_0x4eaaa0=_0x481cd0['getShiftedBy'](_0x5926fb);return{'start':_0x3703d8,'end':_0x4eaaa0,'hasContentBefore':!_0x3703d8['isAtStart'],'hasContentAfter':!_0x4eaaa0['isAtEnd']};}['_insertMarkers'](_0x683e33){const _0x4eb617=this['context']['plugins']['get']('AIEditing'),_0x5ced7d=new Set();T(this['context'])['model']['change'](_0x1a6271=>{for(const _0x337a9c of _0x683e33){const _0x87ceba=''+fe+_0x337a9c['type']+':'+_0x337a9c['groupId']+'_'+_0x4eb617['_nextDataId'](_0x5ced7d);this['_markers']['set'](_0x87ceba,{'id':_0x87ceba,'groupId':_0x337a9c['groupId'],'type':_0x337a9c['type'],'content':_0x337a9c['content']}),_0x1a6271['addMarker'](_0x87ceba,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1a6271['createRange'](_0x337a9c['start'],_0x337a9c['end'])});}});}['_createGetContextFn'](_0x1d0160,_0x4f2190,_0x3843f3){let _0x25141e='';return()=>{if(!_0x25141e){const _0x529cba=_0x4f2190['toView'](_0x1d0160,{'showSuggestionHighlights':!0x0});let _0x46c73d=_0x529cba['getChild'](0x0);if(_0x46c73d['is']('containerElement')||(_0x46c73d=_0x529cba),!_0x46c73d)return'';let _0x3d9024=!0x1;const _0x177769=[];for(const _0x3d6e00 of _0x46c73d['getChildren']())_0x3d6e00['is']('element','span')&&_0x3d6e00['hasClass']('ck-ai_review-marker_context-end')&&(_0x3d9024=!0x1),_0x3d9024&&_0x177769['push'](_0x3d6e00),_0x3d6e00['is']('element','span')&&_0x3d6e00['hasClass']('ck-ai_review-marker_context-start')&&(_0x3d9024=!0x0);_0x46c73d['_removeChildren'](0x0,_0x46c73d['childCount']),_0x3843f3?.['ellipsisBefore']&&_0x46c73d['_appendChild']('…'),_0x46c73d['_appendChild'](_0x177769),_0x3843f3?.['ellipsisAfter']&&_0x46c73d['_appendChild']('…');const _0x36fb67=_0x4f2190['htmlProcessor']['domConverter']['viewToDom'](_0x529cba),_0x401646=_0x4f2190['htmlProcessor']['htmlWriter']['getHtml'](_0x36fb67);_0x25141e=_0x401646;}return _0x25141e;};}['_createGetContentFn'](_0xba3b38,_0x590ef1){let _0xdd1f05='';return()=>(_0xdd1f05||(_0xdd1f05=_0x590ef1['stringify'](_0xba3b38,{'showSuggestionHighlights':!0x0})),_0xdd1f05);}['_createGetContentUsingDataIdFn'](_0x3ac08b,_0x4c9e74,_0x3bc521){let _0xdcbc08='';return()=>{if(!_0xdcbc08){const _0x53d7b3=_0x3bc521['toView'](new tt(_0x3ac08b)),_0x2e5a40=_0x3bc521['htmlProcessor']['domConverter']['viewToDom'](_0x53d7b3)['querySelector']('[data-id=\x22'+_0x4c9e74+'\x22]');_0xdcbc08=_0x2e5a40?.['outerHTML']||'';}return _0xdcbc08;};}['_findMarkerElement'](_0xa64b48,_0x2e8160=0x5){let _0xf30ac8=_0xa64b48,_0x41ec76=null;for(let _0x10e889=0x0;_0x10e889<_0x2e8160&&_0xf30ac8;_0x10e889++){if(!_0xf30ac8['className']){_0xf30ac8=_0xf30ac8['parentElement'];continue;}if(!(''+_0xf30ac8['className'])['includes']('ck-ai_review-marker_')){_0xf30ac8=_0xf30ac8['parentElement'];continue;}if(!_0xf30ac8['getAttribute']('data-marker-id'))break;_0x41ec76=_0xf30ac8;break;}return _0x41ec76;}['_findMarkerElementById'](_0x136dca){const _0x1566ef=T(this['context']),_0x353d76=_0x1566ef['model']['markers']['get'](_0x136dca);return _0x353d76?_0x5b13cd(_0x1566ef['editing'],_0x353d76):null;}['_getMarkersDataForGroup'](_0x514c19){return Array['from'](this['_markers']['values']())['filter'](_0x29e491=>_0x29e491['groupId']===_0x514c19);}['_getOperationStart'](_0x4ed1c7){return'insert'===_0x4ed1c7['type']?_0x4ed1c7['position']:_0x4ed1c7['newRange']['start'];}['_getOperationEnd'](_0x3c5b51,_0xea0c35=!0x1){return'insert'===_0x3c5b51['type']?_0xea0c35?_0x3c5b51['position']:_0x3c5b51['position']['getShiftedBy'](_0x3c5b51['howMany']):_0x3c5b51['newRange']['end'];}['_shiftOperation'](_0x16dbdc,_0x3f74fc){return'insert'===_0x16dbdc['type']?_0x16dbdc['position']=_0x16dbdc['position']['getShiftedBy'](_0x3f74fc):'marker'===_0x16dbdc['type']&&_0x16dbdc['newRange']&&(_0x16dbdc['newRange']=new it(_0x16dbdc['newRange']['start']['getShiftedBy'](_0x3f74fc),_0x16dbdc['newRange']['end']['getShiftedBy'](_0x3f74fc))),_0x16dbdc;}['_changeOperationOwnerDocument'](_0x8c3523,_0x8f7b40){'insert'===_0x8c3523['type']?_0x8c3523['position']=this['_changePositionOwnerDocument'](_0x8c3523['position'],_0x8f7b40):'marker'===_0x8c3523['type']&&_0x8c3523['newRange']&&(_0x8c3523['newRange']=this['_changeRangeOwnerDocument'](_0x8c3523['newRange'],_0x8f7b40));}['_changePositionOwnerDocument'](_0x4b11fb,_0x2d1c5c){return new st(_0x2d1c5c,_0x4b11fb['path']);}['_changeRangeOwnerDocument'](_0x4bd92b,_0x3a19e6){return new it(this['_changePositionOwnerDocument'](_0x4bd92b['start'],_0x3a19e6),this['_changePositionOwnerDocument'](_0x4bd92b['end'],_0x3a19e6));}['_changePosition'](_0x59e96a,_0x4bef95){return new st(_0x4bef95,[..._0x59e96a]);}['_changeRange'](_0x3e29c5,_0x1dd590,_0x476064,_0xd65474){return new it(this['_changePosition'](_0x1dd590,_0xd65474),this['_changePosition'](_0x476064,_0xd65474));}['_sortMarkers'](_0x1ee23b){const _0x53ef35=_0x46ef84=>{switch(_0x46ef84){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x1ee23b['sort']((_0x2b9e13,_0x1814dd)=>_0x53ef35(_0x2b9e13['type'])-_0x53ef35(_0x1814dd['type']));}['_hasSameTopLevelElement'](_0x4b7c03,_0x52db42){const _0x5a0a1c=_0x4b7c03['getChild'](0x0),_0x579e13=_0x52db42['getChild'](0x0);return!(!_0x5a0a1c||!_0x579e13)&&((!_0x5a0a1c['is']('element')||!_0x579e13['is']('element')||_0x5a0a1c['name']===_0x579e13['name'])&&!(_0x5a0a1c['is']('element')&&!_0x579e13['is']('element')||!_0x5a0a1c['is']('element')&&_0x579e13['is']('element')));}['_haveSingleTopLevelElement'](_0x26d691){return 0x1===_0x26d691['childCount'];}['_haveOnlyInlineContent'](_0x1cdf7a,_0x41a207){for(const _0x3ec00d of _0x1cdf7a['getChildren']())if(_0x3ec00d['is']('element')&&!_0x41a207['isInline'](_0x3ec00d))return!0x1;return!0x0;}['_upsertDataId'](_0x32410f,_0x49caf2){let _0x330594=_0x32410f['getAttribute'](Ct);return _0x330594||(_0x330594=_0x49caf2(),_0x32410f['_setAttribute'](Ct,_0x330594)),_0x330594;}}class Os extends _0x290e58(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x32f10f,contentNew:_0x277186,contentInitial:_0x2afaa6,documentVersion:_0x363188}){super(),this['id']=_0x32f10f,this['contentNew']=_0x277186,this['contentInitial']=_0x2afaa6,this['documentVersion']=_0x363188;}}class Ks extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x4850ba,_0x2e9ab4,_0x258cd0){super(),this['id']=_0x4850ba,this['parent']=_0x258cd0,this['_data']=_0x2e9ab4,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 Ws extends ts(){['id']=_0x926b30();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x2a86e2,_0x52aae3,_0x2c41f6,_0x4af768,_0x9d0d36){super(),this['_sourceCheck']=_0x52aae3,this['_documentData']=_0x2a86e2,this['_aiConnector']=_0x2c41f6,this['_reviewParams']=_0x4af768,this['_reviewArgs']=_0x9d0d36,this['on']('change:status',(_0x379af3,_0x4f20d6,_0x1c66a1)=>{'aborted'==_0x1c66a1&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x1c66a1,'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'](_0xb49000=>'pending'===_0xb49000['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x226d28){this['_documentData']=_0x226d28;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x184561=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x372435 of _0x184561)'unmodified'!==_0x372435['data']['operation']&&('error'!==_0x372435['data']['operation']?'review-metadata'!==_0x372435['event']?this['_addReviewCheckResult'](_0x372435['data']['dataId'],_0x372435['data']['textDelta']):this['callId']=_0x372435['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x155643){this['_currentError']=_0x155643,_0x155643 instanceof Error&&_0x155643['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'](_0x247539,_0x4e4edc){const _0x32fcf7=this['_results']['get'](_0x247539);if(!_0x32fcf7)return;if(0x0===_0x4e4edc['length'])return;const _0x172abb=[];_0x4e4edc['forEach']((_0x240498,_0x4a3934)=>{const _0x117a6d=new Ks(_0x32fcf7['id']+'-'+_0x4a3934,_0x240498,_0x32fcf7);_0x117a6d['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x117a6d,'status':_0x117a6d['status']});}),_0x117a6d['on']('change:isActivated',()=>{_0x117a6d['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x117a6d}):this['fire']('reviewCheckResultDeactivated',{'change':_0x117a6d});}),this['_changes']['push'](_0x117a6d),_0x172abb['push'](_0x117a6d);}),this['fire']('reviewCheckResultReady',{'changes':_0x172abb,'result':_0x32fcf7,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x3cb07e){const _0x5b0c9b=this['_changes']['find'](_0x2746b6=>_0x2746b6['id']===_0x3cb07e);return!(!_0x5b0c9b||'pending'!==_0x5b0c9b['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x330537=>!0x0===_0x330537['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x307390=>'pending'===_0x307390['status']);}['getChangeById'](_0x13baa1){return this['_changes']['find'](_0x434429=>_0x434429['id']===_0x13baa1);}['markAllChangesAsAccepted'](){for(const _0x5d9b85 of this['_changes'])'pending'===_0x5d9b85['status']&&(_0x5d9b85['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x21b001){const _0x104989=this['_changes']['find'](_0x3299ce=>_0x3299ce['id']===_0x21b001);_0x104989&&'pending'===_0x104989['status']&&(_0x104989['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x10b18c){const _0x58d5b3=this['_changes']['find'](_0x29ad47=>_0x29ad47['id']===_0x10b18c);_0x58d5b3&&'pending'===_0x58d5b3['status']&&(_0x58d5b3['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x48bfdd){const _0x44e3dd=this['_changes']['find'](_0xd58d3c=>_0xd58d3c['id']===_0x48bfdd);_0x44e3dd&&'pending'===_0x44e3dd['status']&&(_0x44e3dd['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0xee8b78){const _0x326e02=this['_changes']['find'](_0x3d2f20=>_0x3d2f20['id']===_0xee8b78);_0x326e02&&'outdated'===_0x326e02['status']&&(_0x326e02['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x4dba79){this['_changes']['filter'](_0x5acaf9=>_0x5acaf9['isActivated']&&_0x5acaf9['id']!==_0x4dba79)['forEach'](_0x294f7b=>{_0x294f7b['isActivated']=!0x1;});const _0x457850=this['_changes']['find'](_0xa5035f=>_0xa5035f['id']===_0x4dba79);_0x457850&&'pending'===_0x457850['status']&&(_0x457850['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x535f00=>_0x535f00['isActivated'])['forEach'](_0x107ea1=>{_0x107ea1['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0xfb677f){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x483dd4;if(_0xfb677f){const _0x52a7b5=this['_changes']['find'](_0x1a4c38=>_0x1a4c38['id']===_0xfb677f);if(_0x52a7b5&&_0x52a7b5['isRated'])return;_0x52a7b5&&(_0x483dd4=_0x52a7b5['parent']['id'],_0x52a7b5['isRated']=!0x0);}const _0x6da0cc={'positiveCount':this['_changes']['filter'](_0x426a39=>'accepted'===_0x426a39['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x6da0cc,this['callId'],_0x483dd4);}['_addReviewCheckResult'](_0x3bbbb2,_0x4f4454){const _0x2d5511=this['_documentData']['elements']['get'](_0x3bbbb2);if(!_0x2d5511)return;const _0x16ffb5=_0x2d5511['getContent']();if(_0x16ffb5===_0x4f4454)return;const _0x2c6005=new Os({'id':_0x3bbbb2,'contentInitial':_0x16ffb5,'contentNew':_0x4f4454,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x2c6005['id'],_0x2c6005),this['fire']('reviewCheckResultAdded',{'result':_0x2c6005,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x2bc1ba=>'pending'===_0x2bc1ba['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x47468c=>'pending'===_0x47468c['status'])['length']&&(this['status']='finished'));}}class si extends Ws{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xfd419d=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0xac976d=0x0;_0xac976d<this['_reviewParams']['length'];_0xac976d++){if(!this['_reviewParams'][_0xac976d]||!this['_sourceCheck']['options'][_0xac976d])continue;const _0x47267f=this['_sourceCheck']['options'][_0xac976d],_0x246ccf=_0x47267f['data']?.['find'](_0xf13dd6=>_0xf13dd6['id']===this['_reviewParams'][_0xac976d]);_0x246ccf&&_0xfd419d['push'](_0x246ccf['label']);}return _0xfd419d['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x375889,_0x5ee04e,_0x221abc){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x5ee04e,_0x375889,_0x221abc);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x575928{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[q];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x39bc92,_0x39215e)=>{const _0x49a77a=this['_aiReviewCheckList']['getCheckById'](_0x39215e['id']);if(_0x49a77a){this['_onReviewCheckRun'](_0x39215e),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x39215e,_0x49a77a),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x3e9fe5,_0x28c53e)=>{switch(_0x28c53e['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x28c53e);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x36ca17('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x36ca17('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x28c53e['status']&&'error-chunk'!==_0x28c53e['status']&&'error-general'!==_0x28c53e['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x234696,_0x410504)=>{if(!this['_currentReviewCheckRun'])throw new _0x36ca17('ai-review-mode-no-current-check-run',this);const _0x2d3257=this['_diffContent'](_0x410504['result']['contentInitial'],_0x410504['result']['contentNew']);_0x410504['source']['addResultChanges'](_0x410504['result']['id'],_0x2d3257);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x277b30,_0x26cb16)=>{for(const _0x2f02e4 of _0x26cb16['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x2f02e4);this['_markChangePositionInEditorContent'](_0x26cb16['changes'],_0x26cb16['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x5eeb14,_0x42499f)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x42499f['change']['id'],_0x42499f['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x39db26,_0x30825e)=>{this['_onReviewCheckResultActivated'](_0x30825e);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x55916e){_0x55916e instanceof Error&&_0x55916e['message']['includes']('ai-request-aborted')||(_0x55916e instanceof _0x36ca17?this['_logError'](_0x55916e):this['_logError'](new _0x36ca17('ai-review-mode-check-run-failed',this,void 0x0,_0x55916e)));}}else this['_logError'](new _0x36ca17('ai-review-mode-source-check-not-found',this,{'checkId':_0x39215e['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x58afdd=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x58afdd['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x58afdd['map'](_0x1354b7=>_0x1354b7['id']));const _0x556b01=this['_currentReviewCheckRun'];_0x556b01['markAllChangesAsAccepted'](),_0x556b01['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x29b4b2,_0x5e11da)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5e11da['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x5e11da['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x5e11da['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5e11da['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x469cd8,_0x1b1b50)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1b1b50['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x1b1b50['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x1b1b50['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1b1b50['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x2e5383,_0x582567)=>{this['_onActivateChange'](_0x582567);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x37e06e,_0x541ec5)=>{this['_onDeactivateChange'](_0x541ec5);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x3cf161,_0x22c139)=>{this['_onChangeMarkerClicked'](_0x3cf161,_0x22c139);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x7ec579,_0x333fcd)=>{this['_onChangeMarkerHovered'](_0x7ec579,_0x333fcd);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x132ec8,_0x1d5be1)=>{this['_onChangeMarkerRemoved'](_0x132ec8,_0x1d5be1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x520bbf,_0x541f23)=>{this['_onChangeMarkerRestored'](_0x520bbf,_0x541f23);});}['_createReviewCheckRun'](_0x285729,_0x570f5a){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x570f5a,this['_aiConnector'],_0x285729['params'],_0x285729['args']);}['_onChangeMarkerRemoved'](_0x1f49cf,_0x4c2886){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4c2886['changeId']);}['_onChangeMarkerRestored'](_0x37be8b,_0x564421){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x564421['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x4dc6e7=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x4dc6e7&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x3ba790=this['_aiReviewCoreEditing']['getEditor']();_0x3ba790&&_0x3ba790['editing']['view']['change'](_0x4d555c=>{const _0x310cca=_0x3ba790['editing']['view']['document']['getRoot']();_0x4d555c['removeClass']('ck-ai_review-diff',_0x310cca),_0x4d555c['removeClass']('ck-ai_review-highlights',_0x310cca),_0x4d555c['removeClass']('ck-ai-translate-mode-content',_0x310cca);});}['_getTranslationWithDefault'](_0x5d664d,_0xae229d){const _0xb40630=i(this['context']['locale'],_0x5d664d);return _0xb40630===_0x5d664d?_0xae229d:_0xb40630;}['_logError'](_0x2548d3,_0x41bb93=!0x1){gt(_0x2548d3['message']),_0x41bb93||(_0x2548d3['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x217d23){if('content'===this['_changeActivationSource']){const _0x5f10d9=this['_aiReviewCoreUi']['getChangeElement'](_0x217d23);_0x5f10d9&&_0x3c5789(_0x5f10d9['closest']('.ck-ai_review__check-run-result')||_0x5f10d9);}else{if('panel'===this['_changeActivationSource']){const _0x4caf9b=this['_getChangeContentElement'](_0x217d23);if(!_0x4caf9b)return;_0x538b49({'target':_0x4caf9b,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const we=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class Js{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x16be28){this['id']=_0x16be28['id'],this['commandId']=_0x16be28['commandId'],this['title']=_0x16be28['title'],this['description']=_0x16be28['description'],this['isParameterized']=_0x16be28['isParameterized'],this['useArgs']=_0x16be28['useArgs'],this['options']=_0x16be28['options'],this['args']=_0x16be28['args'];}}class vo extends ts(){['_checks']=[];['setupChecks'](_0x19c738){this['_checks']=_0x19c738['map'](_0x38fc76=>new Js(_0x38fc76));}get['checks'](){return this['_checks'];}['getCheckById'](_0x4322a3){return this['checks']['find'](_0x147139=>_0x147139['id']===_0x4322a3);}['removeCheckById'](_0x8b2d9b){this['_checks']=this['_checks']['filter'](_0xee0472=>_0xee0472['id']!==_0x8b2d9b);}}class ke extends Js{['_models']=[];['_defaultModel']=null;constructor(_0x3af0c0,_0x240b25,_0x2b0597){super(_0x3af0c0),this['_models']=_0x240b25,this['_defaultModel']=_0x2b0597;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Js{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x242bfb,_0x4b155a,_0x559c0d){super(_0x242bfb),this['prompt']=_0x242bfb['prompt'],this['model']=_0x242bfb['model'],this['model']?this['_defaultModel']=_0x4b155a['find'](_0x2b39b1=>_0x2b39b1['id']===this['model'])||null:this['_defaultModel']=_0x559c0d;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0xa51e5,_0x293400,_0x4be602){super(),this['_allModels']=_0xa51e5,this['_recommendedModels']=_0x293400,this['_defaultModel']=_0x4be602;}['setupChecks'](_0x15ea72){this['_checks']=_0x15ea72['map'](_0x2be578=>!0x0===_0x2be578['isExtra']?new Ie(_0x2be578,this['_allModels'],this['_defaultModel']):'custom'===_0x2be578['id']?new ke(_0x2be578,this['_recommendedModels'],this['_defaultModel']):new Js(_0x2be578));}}class Ce extends Ws{['_prompt'];['_model'];constructor(_0x530c40,_0x507651,_0x240519,_0x1c5656,_0x10fbc5){super(_0x240519,_0x1c5656,_0x10fbc5),this['_prompt']=_0x530c40,this['_model']=_0x507651;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x27f878,_0x53da28,_0x5a9f37){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x53da28,_0x27f878,_0x5a9f37);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x180672){this['_prompt']=_0x180672;}set['model'](_0x49ba5e){this['_model']=_0x49ba5e;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x141438){super(_0x141438),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x2d55c5=>_0x2d55c5['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x86e881,_0x4beee6)=>{this['_isDiffOn']=_0x4beee6['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x126998,_0x3c3a0b){return _0x126998['isCustom']?new Ce(_0x126998['args']['prompt'],_0x126998['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x3c3a0b,this['_aiConnector']):_0x3c3a0b['isExtra']?new Re(_0x3c3a0b['prompt'],_0x3c3a0b['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x3c3a0b,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3c3a0b,this['_aiConnector'],_0x126998['params'],_0x126998['args']);}['_onReviewCheckResultActivated'](_0x4359d9){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x4359d9['change']['id']),this['_scrollToChange'](_0x4359d9['change']['id']);const _0x511a9d=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x4359d9['change']['id']);if(!_0x511a9d)return;const _0x400785=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x4359d9['change'],()=>_0x511a9d['getElement'](),void 0x0,'click',_0x400785?.['editing']?.['view']?.['getDomRoot'](),_0x400785?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x4359d9['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x118cf3){this['_currentReviewCheckRun']&&'click'===_0x118cf3['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x118cf3['id']));}['_onDeactivateChange'](_0x1e3d24){this['_currentReviewCheckRun']&&'balloon'===_0x1e3d24['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x2c5843,_0x223a5c){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x223a5c['changeId']);const _0x18ac58=this['_currentReviewCheckRun']['getChangeById'](_0x223a5c['changeId']);if(!_0x18ac58)return;const _0x2116ab=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x18ac58,_0x223a5c['markerElement'],_0x223a5c['domEvent'],'click',_0x2116ab?.['editing']?.['view']?.['getDomRoot'](),_0x2116ab?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x395a86,_0x2847e8){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x43672c=this['_currentReviewCheckRun']['getChangeById'](_0x2847e8['changeId']);if(!_0x43672c)return;const _0x2a5c5f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x43672c,_0x2847e8['markerElement'],_0x2847e8['domEvent'],'hover',_0x2a5c5f?.['editing']?.['view']?.['getDomRoot'](),_0x2a5c5f?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x5f42dd){const _0x40ede9=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5f42dd);return _0x40ede9?_0x40ede9['getElement']():null;}['_markChangePositionInEditorContent'](_0x1bf8fd,_0x5b81ed){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x1bf8fd,_0x5b81ed);}['_diffContent'](_0x1f6146,_0x48ccf1){return this['_aiReviewCoreEditing']['diffContent'](_0x1f6146,_0x48ccf1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x30a1b8){const _0x526c56=this['_aiReviewCoreEditing']['getEditor']();_0x30a1b8?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x526c56&&_0x526c56['editing']['view']['change'](_0x16eb6b=>{const _0x41ad6e=_0x526c56['editing']['view']['document']['getRoot']();for(const _0x2f47f9 of _0x41ad6e['getClassNames']())_0x2f47f9['startsWith']('ck-ai_review-')&&_0x16eb6b['removeClass'](_0x2f47f9,_0x41ad6e);_0x16eb6b['addClass'](_0x30a1b8?'ck-ai_review-diff':'ck-ai_review-highlights',_0x41ad6e);});}async['_getChecksList'](){const _0x45c087=[...we,...this['_getExtraChecks']()],_0x3a20c5=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x3a20c5,_0x45c087);let _0x119752=_0x45c087;this['_hasDefaultAvailableCommands']||(_0x119752=_0x3a20c5['map'](_0x3fa8be=>_0x45c087['find'](_0x2a2cc5=>_0x2a2cc5['id']===_0x3fa8be))['filter'](_0x516d57=>!!_0x516d57)),_0x119752=_0x119752['map'](_0x1ba689=>_0x1ba689['isExtra']?_0x1ba689:this['_translateReviewCheck'](_0x1ba689));const _0xf0ca97=_0x119752['some'](_0x52403e=>_0x52403e['isExtra']||'custom'===_0x52403e['id']);let _0xf2598b=[],_0x58ce4c=[],_0x329404=null;if(_0xf0ca97){const _0x29ced6=await this['_getModels']();_0xf2598b=_0x29ced6['all'],_0x58ce4c=_0x29ced6['recommended'],_0x329404=_0x29ced6['default'];}const _0x270672=new _e(_0xf2598b,_0x58ce4c,_0x329404);return _0x270672['setupChecks'](_0x119752),_0xf0ca97&&this['_filterChecksWithMissingModel'](_0x270672),_0x270672;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x6cd4e9=>({'id':_0x6cd4e9['id'],'commandId':_0x6cd4e9['id'],'title':_0x6cd4e9['label'],'description':_0x6cd4e9['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x6cd4e9['prompt'],'model':_0x6cd4e9['model']}));}['_logErrorForNonExistentChecks'](_0x295413,_0x3cb722){const _0x333eb9=_0x295413['filter'](_0x233c1b=>!_0x3cb722['some'](_0x124915=>_0x124915['id']===_0x233c1b));_0x333eb9['length']&&this['_logError'](new _0x36ca17('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x333eb9['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x2de5e7=new It({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x2de5e7['getAll'](),'recommended':await _0x2de5e7['getAvailableModels'](),'default':await _0x2de5e7['getDefault']()};}catch(_0x1e5de0){return this['_logError'](new _0x36ca17('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x1e5de0)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x4850d7){const _0x14498='AI_REVIEW_CHECK_'+_0x4850d7['id']['toUpperCase']()['replaceAll']('-','_'),_0xe20bbb={..._0x4850d7,'title':this['_getTranslationWithDefault'](_0x14498+'_TITLE',_0x4850d7['title']),'description':this['_getTranslationWithDefault'](_0x14498+'_DESCRIPTION',_0x4850d7['description'])};return _0x4850d7['options']&&(_0xe20bbb['options']=_0x4850d7['options']['map'](_0x523ef9=>({..._0x523ef9,'label':this['_getTranslationWithDefault'](_0x14498+'_OPTIONS_LABEL',_0x523ef9['label']||''),'data':_0x523ef9['data']?_0x523ef9['data']['map'](_0x4c0d76=>({..._0x4c0d76,'label':this['_getTranslationWithDefault'](_0x14498+'_OPTIONS_DATA_'+_0x4c0d76['id']['toUpperCase'](),_0x4c0d76['label'])})):void 0x0}))),_0xe20bbb;}['_filterChecksWithMissingModel'](_0x489083){const _0x3499f1=[];_0x489083['checks']['forEach'](_0x332517=>{(_0x332517 instanceof Ie&&!_0x332517['defaultModel']||_0x332517 instanceof ke&&!_0x332517['models']['length'])&&_0x3499f1['push'](_0x332517['id']);}),_0x3499f1['length']&&_0x3499f1['forEach'](_0x2e9a13=>{_0x489083['removeCheckById'](_0x2e9a13),this['_logError'](new _0x36ca17('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x2e9a13}),!0x0);});}}class Ka extends _0x575928{static get['requires'](){return[pe,ge,de];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class jr extends Js{get['apiId'](){return'translate';}}class Pe extends vo{['setupChecks'](_0x17c955){this['_checks']=_0x17c955['map'](_0x52ccf5=>new jr(_0x52ccf5));}}class Se extends si{['_title'];constructor(_0x178127,_0x4e15bd,_0x29b03e,_0x41a694,_0x1e67ab,_0x51aa82){super(_0x178127,_0x4e15bd,_0x29b03e,_0x1e67ab,_0x51aa82),this['_title']=_0x41a694;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x2155c2){super(_0x2155c2),this['context']['config']['define']('ai.translate.languages',[{'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'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x57572b,_0x3770e9){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3770e9,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x57572b['params'],_0x57572b['args']);}['_onReviewCheckResultActivated'](_0x3eddfc){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x3eddfc['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x3eddfc['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x20319c){this['_currentReviewCheckRun']&&('hover'===_0x20319c['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x20319c['id'])),'click'===_0x20319c['uiInteraction']&&this['_scrollToChange'](_0x20319c['id']));}['_onDeactivateChange'](_0xc3396){this['_currentReviewCheckRun']&&'panel'===_0xc3396['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0xb33e6d,_0x843fa5){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x843fa5['changeId']),this['_scrollToChange'](_0x843fa5['changeId']));}['_onChangeMarkerHovered'](_0x2d977c,_0x423167){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x423167['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x423167['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x1909ac){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x1909ac);}['_markChangePositionInEditorContent'](_0x369754,_0x27603d){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x369754,_0x27603d);}['_diffContent'](_0x4ebce7,_0x29631a){return this['_aiReviewCoreEditing']['diffContent'](_0x4ebce7,_0x29631a,!0x0);}['_onReviewCheckRun'](){const _0x367226=this['_aiReviewCoreEditing']['getEditor']();_0x367226&&_0x367226['editing']['view']['change'](_0x3a02a7=>{const _0x4ac0cf=_0x367226['editing']['view']['document']['getRoot']();for(const _0x341a08 of _0x4ac0cf['getClassNames']())(_0x341a08['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x341a08)&&_0x3a02a7['removeClass'](_0x341a08,_0x4ac0cf);_0x3a02a7['addClass']('ck-ai-translate-mode-content',_0x4ac0cf);});}async['_getChecksList'](){const _0x1f92e8=[],_0x50f386=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x1281d6 of _0x50f386)_0x1f92e8['push']({'title':_0x1281d6['label'],'id':_0x1281d6['id'],'commandId':_0x1281d6['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x1281d6['id']}});const _0x2e9435=new Pe();return _0x2e9435['setupChecks'](this['_translateChecks'](_0x1f92e8)),_0x2e9435;}['_translateChecks'](_0x4279fe){return _0x4279fe['map'](_0x42390e=>{const _0x3c3b1d='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x42390e['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x42390e,'title':this['_getTranslationWithDefault'](_0x3c3b1d,_0x42390e['title'])};});}}class Le extends Ve{constructor(_0x3eb8bb,_0x1b2249){super(_0x3eb8bb,_0x1b2249),this['on']('set:isLoading',(_0x2047f3,_0x54ace8,_0xd0cce6)=>{_0xd0cce6&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x4a73c7,_0x35427b,_0x3fc201)=>{_0x3fc201&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x448729=super['_createAcceptAllButtonView']();return _0x448729['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x448729;}['_createExitReviewButtonView'](){const _0x5659d4=super['_createExitReviewButtonView']();return _0x5659d4['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x5659d4;}}class Ne extends je{['_setupTemplate'](){const _0x20f4a2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x20f4a2['if']('isVisible','ck-hidden',_0x1d6139=>!_0x1d6139)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x20f4a2['if']('isVisible','ck-hidden',_0x4a382e=>!_0x4a382e)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x2dc019=this['context']['locale'],_0x11d4ea=new _0x41e0a3(_0x2dc019,{'label':i(_0x2dc019,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x6cdaad,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x53e492=new Ae(_0x2dc019,{'header':_0x11d4ea,'list':new Ne(_0x2dc019),'results':new Le(_0x2dc019,{'generalErrorText':i(_0x2dc019,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x2dc019,{'headerText':i(_0x2dc019,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x2dc019,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x2dc019,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x53e492['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x53e492;}['registerTab'](){const _0x3f2985=this['context']['plugins']['get']('AITabs');_0x3f2985['view']['on']('activateTab',(_0x2b3b22,_0x2018d3)=>{'translate'===_0x2018d3?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x3f2985['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x6cdaad,'order':0x0,'content':this['_mainView']});}}class Wa extends _0x575928{static get['requires'](){return[rr,tr,de];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,$n as AIAssistant,n as AIAssistantUI,Q as AIBalloon,Ma as AIChat,at as AIChatController,ht as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,Va as AIChatShortcuts,ct as AIChatUI,q as AIConnector,D as AIEditing,Ba as AIEditorIntegration,Qt as AIQuickActionType,Fa as AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Js as AIReviewCheck,Os as AIReviewCheckResult,Ws as AIReviewCheckRun,Ka as AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,pt as AITabs,ar as AITextAdapter,qt as AIToggleButtonUI,Wa as AITranslate,rr as AITranslateController,tr as AITranslateUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,E as ShowAIAssistantCommand,io as ToggleAICommand,Hs as createResizeButton,qn as getDefaultAICommands};